| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
genvif depends on usb_pd_policy.c. However, the usb_pd_policy.c files
often depend on other symbols that are not included when building
genvif. genvif only needs the pd_src_pdo and pd_src_pdo_count variables
(and charge_manager_get_source_pdo() in one case). Extract these
variables into their own files.
BRANCH=none
BUG=b:172020503
TEST=CC=clang make BOARD=zinger -j
TEST=make buildall
TEST=compare generated *_vif.xml files before and after change:
=> MATCH
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Change-Id: I765750cd86243a0a355dcc6a29b80fc23403d99f
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3231026
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit extracts shell commands to manipulate ioex to different
file to split generic ioex logic from shell commands.
BRANCH=main
BUG=b:202701452
TEST=After flashing, ioexget and ioexset should work correctly
Change-Id: I8707d1dd32324ca6e7b9163b800e32ded67fdf38
Signed-off-by: Michał Barnaś <mb@semihalf.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3262093
Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When shutting down, it's generally desirable to reset Vconn to the
source. However, if we're running with no battery then we should avoid
this hard reset in order to prevent removing board power.
BRANCH=None
BUG=b:202804110
TEST=on guybrush, shutdown with a charger which swaps Vconn and ensure
we don't hard reset
Signed-off-by: Diana Z <dzigterman@chromium.org>
Change-Id: I1b2587495b21a641c3901c5b1fcc127951305e3b
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3260165
Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Prior to crrev/c/1051027, the EC_CMD_PWM_GET_KEYBOARD_BACKLIGHT host cmd
returned an enabled flag, which the FAFT test firmware_ECLidSwitch
depends on. That test, however, was broken, and wasn't actually running
the kb backlight portion of the test on any models, so no one ever
noticed that the HC and the kblight ec console commands don't return
the enabled status.
Add a get_enabled function to the kblight driver struct, and add an
implementation for each existing driver.
BRANCH=None
BUG=b:194908032
TEST=CP'd to leona branch, build EC, flash board
kblight 100 ; lidclose ; kblight ; lidopen ; kblight
Verified the cmd returned enabled: 1 when lights were on
Change-Id: Ia6ab025901869933cf70bb49f3bf2def2987b7b3
Signed-off-by: Jeremy Bettis <jbettis@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3248888
Tested-by: Jeremy Bettis <jbettis@chromium.org>
Auto-Submit: Jeremy Bettis <jbettis@chromium.org>
Commit-Queue: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Protecting status register by /WP works when SRP0 is enabled. The
getting protect flags function should check SRP0 & QE for
EC_FLASH_PROTECT_ERROR_INCONSISTENT flag.
This CL adds the following:
1. SRP0 & QE bits check for npcx flash.
2. EC_FLASH_PROTECT_ERROR_UNKNOWN flag
BUG=none
BRANCH=none
TEST=Protect a range & don't set the SRP0. Check flag by `flashinfo`.
Signed-off-by: Wealian Liao <whliao@nuvoton.corp-partner.google.com>
Change-Id: Iae8645aca7b0d9176e625de3656a35e675df3ef2
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3246882
Reviewed-by: Keith Short <keithshort@chromium.org>
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Commit-Queue: Daisuke Nojiri <dnojiri@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There're some boards with more than one chg chips included (OCPC).
We should set the "active chg chips" when we call charger_set_hw_ramp.
BUG=b:196928096
BRANCH=none
TEST=make sure that hw ramp enabled on the active chg chip.
Signed-off-by: Tommy Chung <tommy.chung@quanta.corp-partner.google.com>
Change-Id: I98c8ca3a189ed1794c06a789a5e685b5d8a8aa12
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3252564
Reviewed-by: Diana Z <dzigterman@chromium.org>
Reviewed-by: Devin Lu <Devin.Lu@quantatw.com>
|
|
|
|
|
|
|
|
|
|
|
| |
BRANCH=none
BUG=b:180546850
TEST=none
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Change-Id: I2730d8c6be88c924cfe794e38434f40bce289c07
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2702501
Reviewed-by: Craig Hesling <hesling@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Without a text section clang/lld will create one and put it at an
address it selects. Even though the section it creates is empty, if the
LMA is beyond the end of the flash, ec.bin will be too large since the
empty space is filled with 0xFF.
For example, before this change servo_micro's ec.bin is 131075 bytes
instead of 131072 (0x20000) bytes.
Examining the sections, we see the LMA is 0x08020003, which is three
bytes beyond the flash size (0x08000000 + 0x20000 + 0x3):
arm-none-eabi-objdump -h build/servo_micro/ec.obj
Sections:
Idx Name Size VMA LMA File off Algn
...
3 .text 00000000 08014b90 08020003 00024b90 2**2
CONTENTS, ALLOC, LOAD, READONLY, CODE
...
After this change, servo_micro's ec.bin is the correct size: 131072
(0x20000) bytes.
Now the .text section is at the beginning of flash:
arm-none-eabi-objdump -h build/servo_micro/ec.obj
Sections:
Idx Name Size VMA LMA File off Algn
0 .text 00000000 08000000 08000000 000000f4 2**2
ALLOC, READONLY, CODE
...
BRANCH=none
BUG=b:172020503
TEST=./util/compare_build.sh -b all -j 120
=> MATCH
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Change-Id: I48f8019fe6b77f880de0d1a0a4a176b3506f3579
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3248887
Reviewed-by: Keith Short <keithshort@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Added more detailed output for `pd <port> srccaps` for
debugging convenience.
For boards that have large enough memory, the output of srccaps
will be formatted showing pdo flags, pdo type, etc.:
Src 0: (Fixed) 5000mV/3000mA DRP UP USB DRD
Src 1: (Aug3.0) 5000mV-2000mV/3000mA DRP UP USB DRD
...
For boards that don't have enough memory to support this,
defining CONFIG_CMD_PD_SRCCAPS_REDUCED_SIZE will default
to displaying the old way of printing out srccaps, shown below:
0: 5000mV/3000mA
1: 5000mV-2000mV/3000mA
...
BRANCH=None
BUG=b:194402616
TEST=On Delbin, connected with ServoV4, execute `pd <port> srccaps`,
Built all boards (make -j buildall)
Signed-off-by: Nehemiah Dureus <ndureus@google.com>
Cq-Depend: chromium:3248341, chromium:3248342, chromium:3248343, chromium:3248344, chromium:3252409, chromium:3252413
Change-Id: I146f619c5baaf28b56a603c3b0a96fc9efbfb26a
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3248345
Reviewed-by: Boris Mittelberg <bmbm@google.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When linking with clang (lld), it complains that it can't find the
"_start" symbol:
ld.lld: warning: cannot find entry symbol _start; defaulting to
0x8000000
"_start" is used by the linker to fill in the entry point address in the
ELF header ("e_entry":
https://refspecs.linuxbase.org/elf/elf.pdf#page=19):
arm-none-eabi-readelf -e ./build/servo_micro/ec.obj
ELF Header:
...
Entry point address: 0x8000000
...
Add an explicit "_start" symbol at the beginning of the firmware image
(entry point) to satisfy the linker.
BRANCH=none
BUG=b:172020503
TEST=./util/compare_build.sh -b all -j 120
=> MATCH
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Change-Id: Id077013cb54869b92d18cea2f74be25135bc4e42
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3249156
Reviewed-by: Keith Short <keithshort@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some driver code paths require control of the return value of
get_time in order to be properly tested.
Now get_time can be mocked during tests.
BRANCH=none
BUG=b:184856083
TEST=zmake testall and make runhosttests
Signed-off-by: Aaron Massey <aaronmassey@chromium.org>
Change-Id: I7f66542aaef015263af66d872978c40746a77292
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3219471
Commit-Queue: Aaron Massey <aaronmassey@google.com>
Tested-by: Aaron Massey <aaronmassey@google.com>
Reviewed-by: Yuval Peress <peress@google.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Since the functions are copied by many boards, move them to common.
The specific param regs are defined in each specific boards.
BUG=b:203031618
BRANCH=none
TEST=make BOARD=burnet/coachz/eve/homestar/kappa/mrbland/quackingstick/
wormdingler.
Signed-off-by: Tommy Chung <tommy.chung@quanta.corp-partner.google.com>
Change-Id: I77c070663ad3e800ec484bd21865c5d911a2c48b
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3220718
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Do not clobber initial io-expander flag values set in
board files.
BUG=b:203907721
BRANCH=none
TEST=ServoV4p1 flags are not clobbered and IO-Expanders are working
Signed-off-by: Sam Hurst <shurst@google.org>
Change-Id: If5d899de5071d8a8e7594de10e2efd4dfb83e838
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3239014
Tested-by: Sam Hurst <shurst@google.com>
Reviewed-by: caveh jalali <caveh@chromium.org>
Reviewed-by: Brian J. Nemec <bnemec@chromium.org>
Commit-Queue: Sam Hurst <shurst@google.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently, static battery info is stored in a host command response
struct (e.g. ec_response_battery_static_info_v1). It can contain
only up to 8 (v0) or 12 (v1) byte strings.
This patch adds struct battery_static_info, which has the full size
string fields to store static battery info.
This will make a host using virtual_battery.c see full size strings
under /sysfs/power_supply/sbs-*.
ACPI and host programs speaking EC_CMD_BATTERY_GET_STATIC will not be
affected.
BUG=b:198722643, b:203031618
BRANCH=None
TEST=Coachz. Run ectool battery.
TEST=Run cat /sys/class/power_supply/sbs-12-000b/manufacturer and
and verify the string is longer than 8 chars.
Change-Id: Id847d66c7c846885113f6afb05a9de1788bf92ae
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3180272
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
| |
BUG=b:198722643, b:203031618
BRANCH=None
TEST=buildall
Change-Id: I595da56412f4d30684b00d1138f7e2339c7f5204
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3227372
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Reviewed-by: Keith Short <keithshort@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Basic checks to verify setting/clearing bits
for all of the currently allocated PD timers
works properly
BUG=b:141363146
BRANCH=none
TEST=make run-usb_pd_timer
Signed-off-by: Denis Brockus <dbrockus@google.com>
Change-Id: I22e237d367a3b3cb28c4a9d88d6c5c375f3b44cf
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3176394
Tested-by: Abe Levkoy <alevkoy@chromium.org>
Reviewed-by: Denis Brockus <dbrockus@chromium.org>
Reviewed-by: Yuval Peress <peress@google.com>
Commit-Queue: Denis Brockus <dbrockus@chromium.org>
Auto-Submit: Denis Brockus <dbrockus@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Use arrays of 32-bit fields to store PD timer status for each port.
Provide a mechanism to perform atomic operations on the appropriate
fields for each timer.
BUG=b:141363146
TEST=make run-usb_pe_drp
BRANCH=none
Signed-off-by: Abe Levkoy <alevkoy@chromium.org>
Change-Id: I23bb4aa9df569cec7088f5b9e451e86372eaabb7
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3171334
Reviewed-by: Denis Brockus <dbrockus@chromium.org>
Reviewed-by: Keith Short <keithshort@chromium.org>
Commit-Queue: Denis Brockus <dbrockus@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When building with clang, it warns:
common/acpi.c:138:11: error: result of comparison of constant 256 with
expression of type 'uint8_t' (aka 'unsigned char') is always false
[-Werror,-Wtautological-constant-out-of-range-compare]
addr >= EC_ACPI_MEM_MAPPED_BEGIN + EC_ACPI_MEM_MAPPED_SIZE) {
~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
It doesn't hurt to leave the check as-is. The values of
EC_ACPI_MEM_MAPPED_BEGIN + EC_ACPI_MEM_MAPPED_SIZE may not be greater
than or equal to 255 on every board.
BRANCH=none
BUG=b:172020503
TEST=CC=clang make BOARD=voema
TEST=make buildall -j
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Change-Id: Ibb27421957e99f2f636331fbaa51dab6fa768744
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3243009
Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently fan off and fan max only applied for legacy fan control
method. Those parameters do not affect the fan curve if
CONFIG_CUSTOM_FAN_CONTROL. The patch will not check the fan off/max
threshold with custom fan control.
BUG=none
BRANCH=none
TEST=make buildall
TEST=On Jinlon. Verify fan curve still work well.
Signed-off-by: Devin Lu <Devin.Lu@quantatw.com>
Change-Id: I49c204aba1468f793da0b890072e600e842be03f
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3141333
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-by: Zick Wei <zick.wei@quanta.corp-partner.google.com>
Commit-Queue: Daisuke Nojiri <dnojiri@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When DUT in laptop mode and gmr_sensor_360 triggerd by unexpected,
system will enter tablet mode. But system will keep in table mode even
gmr_sensor_360 release.
BUG=b:203383664
BRANCH=None
TEST=make buildall -j
DUT in laptop mode and triggerd gmr_sensor_360 then release.
And check system will back to laptop mode from tablet mode normally.
Signed-off-by: arthur.lin <arthur.lin@lcfc.corp-partner.google.com>
Change-Id: I783aaa7e4b03977f67ce122890ab0eb548a8bd38
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3241205
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Console command "charger_dump" is defined in multiple charger
driver files, hence, build fails when more than one charger chip
drivers are enabled for a platform.
To avoid this "charger_dump" console command is defined in
a common file, and this command handler invokes platform specific
charger dump register api.
BRANCH=none
BUG=none
TEST=Verified 'charger dump' command on brya
Signed-off-by: Deepti Deshatty <deepti.deshatty@intel.corp-partner.google.com>
Change-Id: Ic542af90b47880e90073c529f9183abc6a3f5af7
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3211760
Commit-Queue: caveh jalali <caveh@chromium.org>
Reviewed-by: Vijay Hiremath <vijay.p.hiremath@intel.com>
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
From the ec console, setting 8 byte size rework id value using
'cbi set <tag> value size' fails for the tag CBI_TAG_REWORK_ID,
which is of 8byte size while rest of the structure members are
of 4 byte size or variable length.
This patch is to fix the error and allow setting of 8 byte cbi
value for the rework_id.
BUG=b:202870018
BRANCH=None
TEST=Run the command 'cbi set 9 0x123456789abcd 8' from
ec console and see it went through without errors.
Run the command 'cbi' which dumps all the fields of cbi
structure to check if the reworks_id(with tag 9) is
updated to this set value.
Signed-off-by: Thejaswani Putta <thejaswani.putta@intel.com>
Change-Id: Ifaa9c19dd5ea692b51c2666cdd37da09d395cf34
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3219758
Reviewed-by: Thejaswani Putta <thejaswani.putta@intel.corp-partner.google.com>
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-by: Vijay Hiremath <vijay.p.hiremath@intel.com>
Tested-by: Thejaswani Putta <thejaswani.putta@intel.corp-partner.google.com>
Commit-Queue: Daisuke Nojiri <dnojiri@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently, the HOOK_USB_PD_DISCONNECT hook runs before mode exit in the
TC. This means that if the PE clears the mode data, we won't know to
exit active modes.
Decouple this dependency by leaving the alt mode exit code in charge of
clearing the modes on disconnect.
BRANCH=None
BUG=None
TEST=on voxel, disconnect DP monitor and verify HPD is set low
Signed-off-by: Diana Z <dzigterman@chromium.org>
Change-Id: Iebfddf4b7880dcfbeab08bdca426175bc549c833
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3232291
Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
Commit-Queue: Abe Levkoy <alevkoy@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The config option to enable .bss.slow was removed in commit
b224441aaaa5dd08274811d65bb795b4abc231d8 because the option was only
used with kunimitsu, which was removed from the EC codebase a long time
ago.
Remove the reference in the linker maps to complete the cleanup.
BRANCH=none
BUG=b:172020503, b:172221339
TEST=make buildall
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Change-Id: Ibc519f9974cb26e6d15180e2ce0c359867ced1ac
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3219263
Reviewed-by: Ting Shen <phoenixshen@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
DPS would control the PD sink voltage dynamically, so charge_manager
doesn't need to send a new power request if it's not sinking the
max voltage.
Also, merge two new powe requests into one to prevent from sending
multiple requests at one time.
BUG=b:169532537
TEST=enable DPS, and won't send consecutive DP requests when switching
voltage
BRANCH=main
Change-Id: Ib706f4feb5c6434d71b9576f299898a12613aded
Signed-off-by: Eric Yilun Lin <yllin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3229049
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Commit-Queue: Eric Yilun Lin <yllin@google.com>
Tested-by: Eric Yilun Lin <yllin@google.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
To enforce the PD voltage back to the default value, we have
to force a new request.
BUG=b:169532537
TEST=dps dis, and a new PD request is issued
BRANCH=asurada
Change-Id: I4c7d1d6019a9095099dc992411890e394c71b820
Signed-off-by: Eric Yilun Lin <yllin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3229048
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Commit-Queue: Eric Yilun Lin <yllin@google.com>
Tested-by: Eric Yilun Lin <yllin@google.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
One of the checks that runs as part of "repo upload" looks for a single
newline at the end of each file. I'm getting warnings about this when I
touch files that do not follow this, even though I didn't add the extra
newlines.
This commit fixes all files by running the following:
for f in $(find . -name '*.[ch]');
do printf '%s\n' "$(cat ${f})" > ${f};
done
BRANCH=none
BUG=b:172020503
TEST=./util/compare_build.sh -b all -j 120
=> MATCH
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Change-Id: Ia3ece5b64b549d21ca11708791368002bb6e9b0e
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3229797
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Almost all of the console commands were already static. This change
makes all of them static for consistency.
BRANCH=none
BUG=b:172020503
TEST=make buildall -j
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Change-Id: I0ac46358b6fbafa65504c648ce4de0365cdbf723
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3224372
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Almost all of the host commands were already static. This change makes
all of them static for consistency.
BRANCH=none
BUG=b:172020503
TEST=make buildall -j
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Change-Id: I8330e85e6d64a039f08d7620eed1fe897f436567
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3221786
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add Kconfigs to enable virtual battery and set virtual battery address.
Change named-i2c from I2C_PORT_VIRTUAL to I2C_PORT_VIRTUAL_BATTERY.
BRANCH=main
BUG=b:185480578
TEST=When virtual battery is enabled, compilation fails if no
virtual battery port is defined in device tree.
TEST=Enable virtual battery and verify that its handlers
are called properly.
Change-Id: Ic88da28dc443beb89a32868d201072f39abb3a86
Signed-off-by: Michał Barnaś <mb@semihalf.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3207991
Reviewed-by: Keith Short <keithshort@chromium.org>
Commit-Queue: Keith Short <keithshort@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The current input limit setting doesn't respect the PDO's
current limit (e.g. when the current limit is less than
CONFIG_INPUT_CURRENT_LIMIT) and this might cause the over-draining
the charger.
BUG=b:172878439
TEST=1) make buildall
2) modified servo-v4 which only broadcast PDOs with 250mA current
limit and ensure the goroh won't sink more than 250mA.
(while the CONFIG_INPUT_CURRENT_LIMIT is 512mA)
BRANCH=main
Change-Id: I09f8e6fb39a072ee38ea09a5c9898984f4122513
Signed-off-by: Eric Yilun Lin <yllin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3220037
Commit-Queue: Eric Yilun Lin <yllin@google.com>
Tested-by: Eric Yilun Lin <yllin@google.com>
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Diana Z <dzigterman@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
IOEX_FLAGS_DISABLED is replaced with IOEX_FLAGS_DEFAULT_INIT_DISABLED
hence use IOEX_FLAGS_INITIALIZED flag to get the initialization status
of the IOEXes.
BUG=none
BRANCH=none
TEST=Tested on Brya. 'ioexget' command works and also default init
function skips IOEX initialization.
Change-Id: I98ff9643223c02388a2fa679b4631e3389fd466e
Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3200063
Reviewed-by: Poornima Tom <poornima.tom@intel.com>
Reviewed-by: Keith Short <keithshort@chromium.org>
Commit-Queue: Keith Short <keithshort@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The existing CONFIG_EXPERIMENTAL_CONSOLE shifts responsibility of
command line editing and history away from the EC. As a part of that
change, the EC should not emit the prompt character ">". It seems
that every instance but one had already been enclosed in ifdef. This
CL will take care of that last one, as well as make sure that PROMPT
and CTRL are not defined when CONFIG_EXPERIMENTAL_CONSOLE is enabled,
allowing the compiler to prevent any regressions.
BUG=none
BRANCH=none
TEST=build servo_micro with CONFIG_EXPERIMENTAL_CONSOLE enabled
Signed-off-by: Jes B. Klinke <jbk@chromium.org>
Change-Id: Ifdab902cf877c7adee3d8e564cd234ffb19e317b
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3213360
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I2C_PORT_COUNT is bigger than the actual physical I2C number in Zephyr.
Since the access to I2C has to be controlled per physical port, limit
the size of the port_mutex array.
Introduce the I2C_DEVICE_COUNT define to represent the number of the
physical I2C ports. It is not possible to automate it fully with the
current devicetree macros. A new I2C_COPMAT defines will have to be
introduced for new chips. The general assumption is that there is only
one type of I2C port per chip pointed by the compatible property e.g.
"nuvoton,npcx-i2c-port".
BUG=b:199918263
BRANCH=none
TEST=zmake testall; Make sure there is no "Access I2C without lock!"
message in console.
Signed-off-by: Dawid Niedzwiecki <dn@semihalf.com>
Change-Id: Ie7b0570eb5629ebd4adabc8a47d0d802d847a773
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3211976
Tested-by: Dawid Niedźwiecki <dn@semihalf.com>
Reviewed-by: Keith Short <keithshort@chromium.org>
Commit-Queue: Dawid Niedzwiecki <dawidn@google.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Improve precision of the new_rate_us calculation.
Fixes: motion_sense: Fix ap_event_interval calculation ("5155d9c7bfc42aa3f53572e0389a8180d7f3a366")
BUG=b:195264765,b:129159505,b:73557414
BRANCH=many.
TEST=compile
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Change-Id: I4b3d54dedceca5652004da14f32dac6ae98747fa
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3200808
Reviewed-by: Rob Barnes <robbarnes@google.com>
Reviewed-by: Diana Z <dzigterman@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When CONFIG_CMD_STACKOVERFLOW is enabled, we explicitly want to perform
infinit recursion, so we disable the warning.
BRANCH=none
BUG=b:172020503
TEST=make CC=arm-none-eabi-clang BOARD=npcx7_evb
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Change-Id: Ie243834d16ecfc55bf95756d31dc0200892cf275
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3212456
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When making USB connection to the console, theoretically, one does not
know if a previous session has typed a partial command into the
buffer. One could send a newline before typing the desired command,
but it would be even safer to have a keypress that would discard any
partial command.
In particular, the HyperDebug device to be used with OpenTitan is
similar to Servo micro, but there will not be a daemon like servod
maintaining a single USB connection. Instead each invocation of the
"OpenTitan tool" (somewhat equivalent to dut-control) will establish
its own connection with the USB console endpoint, and issue commands.
This design increases the risk of e.g. a testing script being
interrupted on the development workstation resulting in a partial
command being left on the console.
This change adds support for the Ctrl-C character in the EC console,
having the effect of discarding any input, and printing a new command
prompt. This is similar behavior to most Linux shells.
BUG=b:192262089
BRANCH=none
TEST=Upload to Nucleo board, manually connect to ttyUSBn
Signed-off-by: Jes B. Klinke <jbk@chromium.org>
Change-Id: I082b76a7db4961cd4ce2feb91745c465003d416f
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3208915
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, we'd been clearing discovery data during mode exit which was
called on port detach. Now that we're only clearing mode data there,
add an explicit clear to our stored data on HOOK_USB_PD_DISCONNECT to
ensure we will always clear all this cached data on detach regardless of
what other code blocks are doing.
BRANCH=None
BUG=None
TEST=on voxel, plug in TBT dock and unplug. Verify we go from having
many modes discovered in the 'ectool typecdiscovery' output, to having 0
modes discovered on detach
Signed-off-by: Diana Z <dzigterman@chromium.org>
Change-Id: If7ff58bfe4aca885f84c1636210e20cada59154f
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3209662
Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
Commit-Queue: Abe Levkoy <alevkoy@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Deep charge inspection is a battery protection mechanism: If
battery voltage is lower than 6V, deep charge for more than 30 minutes
The battery voltage is still lower than 6V, the system will stop charging
BRANCH=trogdor
BUG=b:198226241
TEST=run-sbs_charging_v2
Signed-off-by: Tang Qijun <qijun.tang@ecs.corp-partner.google.com>
Change-Id: I89adf7809992b9e71b232ad1129af1407acf05a2
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3151037
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Commit-Queue: Daisuke Nojiri <dnojiri@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
CONFIG_RO_HEAD_ROOM and CONFIG_RW_HEAD_ROOM are always defined as 0, so
remove the values and associated code in order to simplify the code and
improve readability.
BRANCH=none
BUG=b:172020503
TEST=./util/compare_build.sh -b all
=> MATCH
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Change-Id: Ie11d23befda674cc15dda9a2d66b9c43ea22d49e
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3205489
Reviewed-by: Ting Shen <phoenixshen@chromium.org>
Reviewed-by: Mary Ruthven <mruthven@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When building with clang, it reports:
common/usbc/usb_prl_sm.c:2304:44: error: 'prl_tx_states' causes a
section type conflict with 'flag_bit_names'
static __const_data const struct usb_state prl_tx_states[] = {
^
common/usbc/usb_prl_sm.c:131:37: note: declared here
static __const_data struct bit_name flag_bit_names[] = {
^
common/usbc/usb_prl_sm.c:2346:44: error: 'prl_hr_states' causes a
section type conflict with 'flag_bit_names'
static __const_data const struct usb_state prl_hr_states[] = {
^
common/usbc/usb_prl_sm.c:131:37: note: declared here
static __const_data struct bit_name flag_bit_names[] = {
^
The issue is that flag_bit_names is not const. When making
flag_bit_names const, we must also make the argument to print_bits const
to fix the additional warning:
common/usbc/usb_prl_sm.c:169:56: error: passing 'const struct bit_name
[11]' to parameter of type 'struct bit_name *' discards qualifiers
[-Werror,-Wincompatible-pointer-types-discards-qualifiers]
print_bits(group, set_or_clear ? "Set" : "Clr", flag, flag_bit_names,
^~~~~~~~~~~~~~
common/usbc/usb_prl_sm.c:149:28: note: passing argument to parameter 'names' here
struct bit_name *names,
BRANCH=none
BUG=b:172020503
TEST=make CC=arm-none-eabi-clang BOARD=cret
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Change-Id: I95d28f53755dd23fe288ae70055e09fcf44511ad
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3205487
Reviewed-by: Edward Hill <ecgh@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The port number passed via the I2C control host command may be different
than the one used in ZephyrEC so convert it based on the "remote-port"
property in DTS.
BUG=b:201408931
BRANCH=none
TEST=zmake testall
Signed-off-by: Dawid Niedzwiecki <dn@semihalf.com>
Change-Id: I71e05df2eb4f76b8c93948a97f47193aaaa6e25e
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3205251
Reviewed-by: Yuval Peress <peress@google.com>
Commit-Queue: Dawid Niedzwiecki <dawidn@google.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some of the IOEXes are needed early than the task is initialized,
those IOEXes will be initialized at the board level. This CL skips
re-initializing the IOEXes from HOOK function if already initialized.
BUG=none
BRANCH=none
TEST=Tested on ADL RVP, re-initialization of IOEX is skipped
Change-Id: I3062c46992a5578bf8f0f0bc2613b6815c28a616
Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3183330
Reviewed-by: Keith Short <keithshort@chromium.org>
Reviewed-by: Deepti Deshatty <deepti.deshatty@intel.corp-partner.google.com>
Commit-Queue: Keith Short <keithshort@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Intel RVP requires GPIOs from few of the IO expanders to configure pins
pre-task, but the current code initializes the IO expanders after the
HOOK task starts. This CL allows board to configure the I2C peripherals
pre-task.
BUG=none
BRANCH=none
TEST=Tested on ADL-RVP, able to initialize IOEX pre-task
Change-Id: I827e22153a98a058d04da0139e302a6ec0276b43
Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3183329
Reviewed-by: Keith Short <keithshort@chromium.org>
Commit-Queue: Keith Short <keithshort@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In Intel ADL+_RVP, the keyboard is scanned by a discrete I/O expander IC
and it is connected to EC via the I2C interface. EC needs to initialize
the IC via I2C transaction before the task scheduling starts. It may
cause the system panic if the EC's I2C driver is implemented by
task-event-based.
With this CL, if any of the I2C ports that need pre-task I2C transaction
are defined as bitbang ports along with regular I2C ports will switch to
the bitbang (GPIO) mode before the task starts and will again switch
back to event based I2C upon task initialization.
BRANCH=none
BUG=b:199374643
TEST=issue an I2C transaction before the task scheduling starts; make
sure the transaction success without panic on npcx9_evb.
TEST=pass "make buildall"
Signed-off-by: Jun Lin <CHLin56@nuvoton.com>
Change-Id: I65460d2b612328f25bce60561bbb82995dd1cfdf
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3161869
Tested-by: Vijay Hiremath <vijay.p.hiremath@intel.com>
Reviewed-by: Keith Short <keithshort@chromium.org>
Commit-Queue: Keith Short <keithshort@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
clang reports that the enum types do not match:
chip/npcx/lpc.c:967:9: error: implicit conversion from enumeration type
'enum ec_error_list' to different enumeration type 'enum ec_status'
[-Werror,-Wenum-conversion]
return EC_SUCCESS;
common/power_button_x86.c:523:9: error: implicit conversion from enumeration
type 'enum ec_error_list' to different enumeration type 'enum ec_status'
[-Werror,-Wenum-conversion]
return EC_SUCCESS;
BRANCH=none
BUG=b:172020503
TEST=make CC=arm-none-eabi-clang BOARD=aleena
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Change-Id: I25d1526d58e1e8558153592be7174a8448c130f5
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3202998
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
common/base_state.c:65:9: error: implicit conversion from enumeration type
'enum ec_error_list' to different enumeration type 'enum ec_status'
[-Werror,-Wenum-conversion]
return EC_SUCCESS;
BRANCH=none
BUG=b:172020503
TEST=make CC=arm-none-eabi-clang BOARD=kakadu
TEST=make buildall
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Change-Id: I7ad0b349270d00a1156462aa32ad19f342b6db61
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3198204
Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
clang fails to compile due to the following:
common/motion_sense.c:1123:34: error: result of comparison of constant -1
with expression of type 'const uint8_t' (aka 'const unsigned char') is
always false [-Werror,-Wtautological-constant-out-of-range-compare]
(in->sensor_odr.sensor_num ==
~~~~~~~~~~~~~~~~~~~~~~~~~ ^
common/motion_sense.c:1454:27: error: result of comparison of constant -1
with expression of type 'const uint8_t' (aka 'const unsigned char') is
always false [-Werror,-Wtautological-constant-out-of-range-compare]
in->spoof.sensor_id == MOTION_SENSE_ACTIVITY_SENSOR_ID) {
~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
As indicated by the TEST line, the output is identical before and after
this change.
BRANCH=none
BUG=b:172020503
TEST=./util/compare_build.sh -b all -j 90
=> MATCH
Signed-off-by: Tom Hughes <tomhughes@chromium.org>
Change-Id: Ieb55b385dfe9e07a8a7098ac3b456a0504215d94
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3197753
Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds an host command to get or set the I2C bus speed of an I2C bus
located on the EC.
BRANCH=none
BUG=b:201039003
TEST=with follow-on patches, switched I2C bus speed between 400 kHz
and 1 MHz using ectool.
Change-Id: Ieaaee8d925509b103771c96bec50a90403766c1a
Signed-off-by: Caveh Jalali <caveh@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3181506
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-by: Boris Mittelberg <bmbm@google.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
BRANCH=none
BUG=b:201039003
TEST=with follow-on patches, switched I2C bus speed between 400 kHz
and 1 MHz using ectool.
Change-Id: Ide60a2515d4d9a5f8e1ff841b8369e63c39f5c6a
Signed-off-by: Caveh Jalali <caveh@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3198247
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-by: Boris Mittelberg <bmbm@google.com>
|