summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* zephyr: drivers: Add hibernation delay unit testfactory-kukui-14374.B-mainTomasz Michalec2021-12-013-4/+236
| | | | | | | | | | | | | | | | | | | Add unit test for hibernation delay set using host command and UART command. system_hibernate() function in test stubs is replaced with FFF fake function to allow tests to check if it was called. BUG=b:206903370 BRANCH=none TEST=zmake configure --test zephyr/test/drivers Signed-off-by: Tomasz Michalec <tm@semihalf.com> Change-Id: I7546a736f9dfa731875741930fa4e6dd9106d22d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3302215 Tested-by: Tomasz Michalec <tmichalec@google.com> Commit-Queue: Tomasz Michalec <tmichalec@google.com> Reviewed-by: Fabio Baltieri <fabiobaltieri@google.com>
* zephyr: drivers: Add unit test for smart dischargeTomasz Michalec2021-12-011-1/+173
| | | | | | | | | | | | | | | | | Add unit test of setting smart discharge zones using host command. Test if generic board_system_is_idle() recognizes smart discharge zones correctly. BUG=b:206903370 BRANCH=none TEST=zmake configure --test zephyr/test/drivers Signed-off-by: Tomasz Michalec <tm@semihalf.com> Change-Id: Ia8e8f9a33183fc0bf6ed4f6705c96e86e4f1ef5d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3302214 Tested-by: Tomasz Michalec <tmichalec@google.com> Commit-Queue: Tomasz Michalec <tmichalec@google.com> Reviewed-by: Fabio Baltieri <fabiobaltieri@google.com>
* zephyr: drivers: Add unit test for exiting G3Tomasz Michalec2021-12-015-29/+174
| | | | | | | | | | | | | | | | Add unit tests for exiting G3 using chipset_exit_hard_off() function and reboot AP on G3 host command. BUG=b:206903370 BRANCH=none TEST=zmake configure --test zephyr/test/drivers Signed-off-by: Tomasz Michalec <tm@semihalf.com> Change-Id: Idafe367da67ff4b6f5ec75aeee16549e14321122 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3302212 Tested-by: Tomasz Michalec <tmichalec@google.com> Commit-Queue: Tomasz Michalec <tmichalec@google.com> Reviewed-by: Fabio Baltieri <fabiobaltieri@google.com>
* zephyr: drivers: Add unit test for chipset stateTomasz Michalec2021-12-012-0/+170
| | | | | | | | | | | | | | | | | Add unit tests for chipset_in_or_transitioning_to_state() and chipset_in_state() functions. They are tested in all states and with selected state masks. BUG=b:206903370 BRANCH=none TEST=zmake configure --test zephyr/test/drivers Signed-off-by: Tomasz Michalec <tm@semihalf.com> Change-Id: Iba32fe5e0826a2e60ee3ee2f0d7b4647c93a21a1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3302211 Reviewed-by: Fabio Baltieri <fabiobaltieri@google.com> Tested-by: Tomasz Michalec <tmichalec@google.com> Commit-Queue: Tomasz Michalec <tmichalec@google.com>
* chronicler: Remove unused battery configurationYu-An Chen2021-12-012-36/+1
| | | | | | | | | | | | | remove unused battery configuration BUG=b:190685811 BRANCH=volteer TEST=make BOARD=chronicler Signed-off-by: Yu-An Chen <yu-an.chen@quanta.corp-partner.google.com> Change-Id: I139f575aa6df111968580f4929d8cf328095488d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3310019 Reviewed-by: Isaac Lee <isaaclee@google.com> Commit-Queue: Isaac Lee <isaaclee@google.com>
* mt6360/rt1718s: prevent BC1.2 trigger after PD establishedTing Shen2021-12-012-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | Add an extra check to prevent BC 1.2 detection trigger when VBUS state change after pd connection established (for example, power role swap or fast role swap) and break the existing USB2 connection. Note that after this change, BC1.2 detection still triggers when a PD charger just plugged in, because bc1.2 detection happens before EC awares that the adapter supports PD. BUG=b:193753475 TEST=verify BC1.2 detection doesn't trigger in following scenario: 1) power role swap 2) fast role swap 3) plug in USB-C-to-A adapter BRANCH=asurada Signed-off-by: Ting Shen <phoenixshen@google.com> Change-Id: I6657d7f1fd8b8f2aad19744b89f794e107cd45c9 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3299287 Reviewed-by: Eric Yilun Lin <yllin@google.com> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Tested-by: Ting Shen <phoenixshen@chromium.org>
* tcpm/rt1718s: uses mutex_t insteadEric Yilun Lin2021-12-011-1/+1
| | | | | | | | | | | | | | | | We should use mutex_t type for both cros-ec and zephyr code base. BUG=none TEST=zmake testall; make buildall BRANCH=none Change-Id: I6c9bc7d00b9959ab12159da6e25df2776497abad Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3306771 Reviewed-by: Ting Shen <phoenixshen@chromium.org> Commit-Queue: Eric Yilun Lin <yllin@google.com> Tested-by: Eric Yilun Lin <yllin@google.com> Auto-Submit: Eric Yilun Lin <yllin@google.com>
* morphius: fix thermal control issueZick Wei2021-12-011-10/+18
| | | | | | | | | | | | | | | | In some condition, CPU prochot will always trigger by EC, this patch fix this issue. BUG=b:202746631 BRANCH=zork TEST=verify prochot no longer trigger in specific steps. Signed-off-by: Zick Wei <zick.wei@quanta.corp-partner.google.com> Change-Id: I37409e2cf04fdb2d4c0ca01b8860971eff70e7d8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3271799 Reviewed-by: Eric Peers <epeers@google.com> Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org>
* zephyr: krabby: refactor usbc_configEric Yilun Lin2021-12-015-237/+275
| | | | | | | | | | | | | | | | | | | | Move non-share code into krabby/usbc_config.c: 1. charger configs 2. bc12 configs 3. ppc configs 4. tcpc configs 5. VBUS ADC getter BUG=b:207802869 TEST=zmake testall BRANCH=none Change-Id: I134c843826dcce536d5fa8b1d52e41ff786175a7 Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3303264 Tested-by: Eric Yilun Lin <yllin@google.com> Commit-Queue: Eric Yilun Lin <yllin@google.com> Reviewed-by: Ting Shen <phoenixshen@chromium.org>
* zephyr: corsola: drop baseboard_common.hEric Yilun Lin2021-12-013-31/+0
| | | | | | | | | | | | | | | | The file is not needed anymore. BUG=b:206553789 TEST=zmake testall BRANCH=none Change-Id: Ice338031b6cba9e84f2522259481a4d3408ffa5e Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3303263 Tested-by: Eric Yilun Lin <yllin@google.com> Auto-Submit: Eric Yilun Lin <yllin@google.com> Commit-Queue: Eric Yilun Lin <yllin@google.com> Reviewed-by: Ting Shen <phoenixshen@chromium.org>
* Dewatt: Modify motion_sensorsSue Chen2021-12-012-82/+21
| | | | | | | | | | | | | | Lid Accel -> BMA422 Base Accelgyro -> BMI260 BUG=none BRANCH=none TEST=make BOARD=dewatt Signed-off-by: Sue Chen <sue.chen@quanta.corp-partner.google.com> Change-Id: I5ec35fc992934bfdc579f6aae0ad58fa1477545f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3292645 Reviewed-by: Diana Z <dzigterman@chromium.org>
* zephyr: corsola: refactor daughterboard detectionEric Yilun Lin2021-12-017-68/+120
| | | | | | | | | | | | | | | | move the daughterboard detection out of the usbc_config.c BUG=b:207802869 TEST=zmake test all BRANCH=none Change-Id: Ie23915d116cfbfd161f640eeea342e18d2647216 Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3303262 Auto-Submit: Eric Yilun Lin <yllin@google.com> Commit-Queue: Eric Yilun Lin <yllin@google.com> Tested-by: Eric Yilun Lin <yllin@google.com> Reviewed-by: Ting Shen <phoenixshen@chromium.org>
* Felwinter: modified fan rpm rangeJosh Tsai2021-12-011-9/+3
| | | | | | | | | | | | | | BUG=b:198371480 BRANCH=none TEST=make -j BOARD=felwinter TEST=verified by thermal team Signed-off-by: Josh Tsai <josh_tsai@compal.corp-partner.google.com> Change-Id: I552897fbb1aa1dc3cb6e7d4f2019502946a14658 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3301559 Reviewed-by: Elmo Lan <elmo_lan@compal.corp-partner.google.com> Reviewed-by: Boris Mittelberg <bmbm@google.com> Reviewed-by: Sumeet Pawnikar <sumeet.r.pawnikar@intel.corp-partner.google.com>
* anahera: Always initialize ioex data structures after sysjumpDevin Lu2021-12-011-4/+8
| | | | | | | | | | | | | | | | [Cherry-pick from: https://crrev.com/c/3299277] BUG=none BRANCH=none TEST=1. make BOARD=anahera 2. On console, ioexget to make sure gpio pins on ioex initialized after sysjump. Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Change-Id: I70908409301684cafd9d6409e4f2e1d370abe2b6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3302225 Reviewed-by: Boris Mittelberg <bmbm@google.com> Commit-Queue: Boris Mittelberg <bmbm@google.com>
* Redrix: Always initialize ioex data structures after sysjumpDevin Lu2021-12-011-4/+8
| | | | | | | | | | | | | | | | [Cherry-pick from: https://crrev.com/c/3299277] BUG=none BRANCH=none TEST=1. make BOARD=redrix 2. On console, ioexget to make sure gpio pins on ioex initialized after sysjump. Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Change-Id: I8427013fd8768bcd88047b39a4286b172eaf3c2b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3302224 Reviewed-by: Boris Mittelberg <bmbm@google.com> Commit-Queue: Boris Mittelberg <bmbm@google.com>
* dooly: fix incorrect I2C data pin mappingsPeter Marheine2021-12-011-2/+2
| | | | | | | | | | | | | | | | | | The data lines defined for the I2C buses associated with USB-C port 1 seem to have been copied from port 0 and while the clock line pins were updated, the data lines were not. This change corrects the data lines to refer to the correct pins. BUG=b:208485991 TEST=builds BRANCH=none Signed-off-by: Peter Marheine <pmarheine@chromium.org> Change-Id: Ic093e9a4c305cef5e8b5661e8443adf90d1faa7b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3306767 Commit-Queue: Keith Short <keithshort@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Andrew McRae <amcrae@google.com>
* Virtual mux: Always wait for ACKDiana Z2021-12-011-9/+3
| | | | | | | | | | | | | | | Now that the USB mux task has been introduced, the virtual mux can always wait on an ACK without blocking the PD tasks. BRANCH=None BUG=b:186777984 TEST=pass tast typec.Mode*.manual on voxel Cq-Depend: chromium:3295572 Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I808ff5b89c112437b595b391d455c9c22ca10194 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3095440 Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* i2c: Use declared initializers for bitbang portsKeith Short2021-11-3011-11/+87
| | | | | | | | | | | | | | | Convert all instances of i2c_bitbang_ports[] to use declared initializers. This allows the fields to be reordered without breaking code. BUG=none BRANCH=none TEST=compare_build.sh Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: If7d578dc2bc5ef1f7c5dc424ceb3193cd98f7a69 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3300663 Reviewed-by: Edward Hill <ecgh@chromium.org>
* i2c: Use declared initializers for i2c_ports: boards m-zKeith Short2021-11-3014-65/+365
| | | | | | | | | | | | | | Convert all instances of i2c_ports[] to use declared initializers. This allows the fields to be reordered without breaking code. BUG=none BRANCH=none TEST=compare_build.sh Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: Ib4ff8cfd7bd8090c45d8804f0bebcb2426f3cc7e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3300662 Reviewed-by: Ting Shen <phoenixshen@chromium.org>
* i2c: Use declared initializers for i2c_ports: boards a-lKeith Short2021-11-3015-88/+437
| | | | | | | | | | | | | | Convert all instances of i2c_ports[] to use declared initializers. This allows the fields to be reordered without breaking code. BUG=none BRANCH=none TEST=compare_build.sh Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: Ibced584424f1f64718fb55cec0c972dc939bec5c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3300661 Reviewed-by: Diana Z <dzigterman@chromium.org>
* i2c: Use declared initializers for i2c_ports: servo boardsKeith Short2021-11-305-15/+56
| | | | | | | | | | | | | | Convert all instances of i2c_ports[] to use declared initializers. This allows the fields to be reordered without breaking code. BUG=none BRANCH=none TEST=compare_build.sh Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I7eb605c0a87fad9b803955fa6ae34d39d71ad27a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3300660 Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
* i2c: Use declared initializers for i2c_ports: eval boardsKeith Short2021-11-3011-32/+203
| | | | | | | | | | | | | | Convert all instances of i2c_ports[] to use declared initializers. This allows the fields to be reordered without breaking code. BUG=none BRANCH=none TEST=compare_build.sh Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: Ib6f4bd684f76a34a74ddd8f476c78223b8ccf2bb Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3300659 Reviewed-by: Eric Yilun Lin <yllin@google.com>
* i2c: Use declared initializers for i2c_ports: reef boardsKeith Short2021-11-303-24/+84
| | | | | | | | | | | | | | Convert all instances of i2c_ports[] to use declared initializers. This allows the fields to be reordered without breaking code. BUG=none BRANCH=none TEST=compare_build.sh Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: Iff4681dc3c750fe7acc0601983dde2fbbc06de38 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3300187 Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* i2c: Use declared initializers for i2c_ports: trogdor boardsKeith Short2021-11-3011-106/+371
| | | | | | | | | | | | | | Convert all instances of i2c_ports[] to use declared initializers. This allows the fields to be reordered without breaking code. BUG=none BRANCH=none TEST=compare_build.sh Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: Ibecd375996b92119eca35721d084c35b6e4e6f1f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3300186 Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* i2c: Use declared initializers for i2c_ports: kukui boardsKeith Short2021-11-3016-37/+254
| | | | | | | | | | | | | | Convert all instances of i2c_ports[] to use declared initializers. This allows the fields to be reordered without breaking code. BUG=none BRANCH=none TEST=compare_build.sh Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I326bd6efef5cdfdf8bbd2c68dda268dca543b9d2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3300185 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* zephyr: zmake: Drop the log level of some config related loggingJack Rosenthal2021-11-301-3/+3
| | | | | | | | | | | | | INFO can be a bit spammy for these logs, use DEBUG instead. BUG=none BRANCH=none TEST="zmake list-projects" has no output spam Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I3f7b919630bf9b5b36c630600f8737c4adba9ab4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3309363 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* zephyr: zmake: Add program name and description to argparseJack Rosenthal2021-11-301-1/+4
| | | | | | | | | | | | | | | Add the program name and description to the constructor for the argument parser. This enables slightly friendlier output for "zmake --help". BUG=none BRANCH=none TEST=Inspect output of "zmake --help" Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I17691111c02486ad9b1ba0f8ebb0e7566eaf7e70 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3309362 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* zephyr: zmake: Add help strings for all subcommandsJack Rosenthal2021-11-301-5/+20
| | | | | | | | | | | | | | Add a brief description of each subcommand so that "zmake --help" tells you what each command does. BUG=none BRANCH=none TEST=observe output of "zmake --help" Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: If787e5e519f5ab1d2f1189798438aa2b84cfe19c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3309361 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* zephyr: zmake: Add a list-projects subcommandJack Rosenthal2021-11-303-0/+102
| | | | | | | | | | | | | | | | | | | Prior to converting to the BUILD.py format, it was possible to find all projects Zmake supports simply by searching for zmake.yaml files (e.g., with "find -name zmake.yaml"). Now that Zmake has a more complex project config format, and a single BUILD.py file may expose multiple projects, we need to expose on the CLI a way to print out all projects. BUG=b:193815337 BRANCH=none TEST=Provided unit tests pass Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: Ie726f35f9044b3d5baf782e5e22c9405c35ce1f7 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3309360 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* bugzzy : disable LCD DCDC by pannel power statusYongBeum.Ha2021-11-301-0/+5
| | | | | | | | | | | | | | | | Check PP1800_PANNEL_S0 when disable VBST/VSN/VSP. BUG=b:208371172 BRANCH=None TEST=make -j BOARD=bugzzy then check LCD off sequence Signed-off-by: YongBeum.Ha <ybha@samsung.corp-partner.google.com> Change-Id: Iad5e02fcb6a895d55b8bfef1b025be4e4e2afbf2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3306762 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
* Scout: Add board_led_auto_controlSue Chen2021-11-301-0/+10
| | | | | | | | | | | | | | | | | Check power state to change led status while receive the auto contorl command. BUG=b:198405130 BRANCH=puff TEST="ectool led power auto" can show correct led behavior immediately. Signed-off-by: Sue Chen <sue.chen@quanta.corp-partner.google.com> Change-Id: I84c37cf7efd69c3442bd9733ad3813edddb0d1aa Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3289575 Reviewed-by: Joe Tessler <jrt@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Commit-Queue: Joe Tessler <jrt@chromium.org>
* led_common: Add board_led_auto_controlSue Chen2021-11-302-0/+18
| | | | | | | | | | | | | | | | | | | Some projects have only power led won't change the led state immediately as the auto command is called for they only check the led state while the power state is changed. Add board_led_auto_control to let them check led state while receive the auto control command. BUG=b:198405130 BRANCH=none TEST=make buildall Signed-off-by: Sue Chen <sue.chen@quanta.corp-partner.google.com> Change-Id: I8befb1b3044b6ee788cc36b21f682a3450f31185 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3288539 Reviewed-by: Joe Tessler <jrt@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Commit-Queue: Joe Tessler <jrt@chromium.org>
* zephyr: kconfig: update USBC_OCP config dependencyEric Yilun Lin2021-11-301-0/+1
| | | | | | | | | | | | | | | | CONFIG_USB_PD_TCPM_TCPCI relies on CONFIG_USBC_OCP BUG=none TEST=zmake testall BRANCH=none Change-Id: I71803de25c08230f1cf5a5f0c4983330c2bbd519 Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3306117 Tested-by: Eric Yilun Lin <yllin@google.com> Auto-Submit: Eric Yilun Lin <yllin@google.com> Reviewed-by: Jeremy Bettis <jbettis@chromium.org> Commit-Queue: Jeremy Bettis <jbettis@chromium.org>
* zephyr: drivers: Use proxy only in usb_mux testTomasz Michalec2021-11-302-33/+69
| | | | | | | | | | | | | | | | | | | | | Use ztest_check_* and ztest_get_return_* in usb_mux proxy only if called from test runner task. This allows other tasks to use usb_mux API simultaneously with test. Change assert in configure_mux() to allow wait for host ACK in test runner task. BUG=none BRANCH=none TEST=make configure --test zephyr/test/drivers Signed-off-by: Tomasz Michalec <tm@semihalf.com> Change-Id: I4661a6c418c6bf5b6dde1c4d867917e9384e2336 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3295572 Reviewed-by: Yuval Peress <peress@google.com> Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Diana Z <dzigterman@chromium.org> Tested-by: Diana Z <dzigterman@chromium.org>
* TCPMv2: Guard DATA_RESET using CONFIG_USB_PD_DATA_RESET_MSGScott Chao2021-11-301-0/+2
| | | | | | | | | | | | | | | | Primus didn't define the CONFIG_USB_PD_DATA_RESET_MSG, cause DP cannot output. BUG=b:208318528 BRANCH=none TEST=make -j BOARD=primus TEST=Check DP can output Signed-off-by: Scott Chao <scott_chao@wistron.corp-partner.google.com> Change-Id: I7d4ec143f3ba1f35319734781b2f4d08d2c7109e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3307007 Reviewed-by: Diana Z <dzigterman@chromium.org> Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Commit-Queue: Abe Levkoy <alevkoy@chromium.org>
* zephyr: gitlab: Filter chip/core specific code from coverageYuval Peress2021-11-301-0/+1
| | | | | | | | | | | | | | Since we're not running these in a QEMU we'll never be able to touch these files. BRANCH=none BUG=none TEST=Run zmake with coverage and manually run lcov with the filters Signed-off-by: Yuval Peress <peress@google.com> Change-Id: I7815dfedafaaacad160408fec7618c89e457d280 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3291128 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* zephyr: gitlab: Use glob pattery to filter zephyr/driversYuval Peress2021-11-301-1/+4
| | | | | | | | | | | | | | | | Looks like * in lcov isn't recusive. Use ** instead which does the job correctly. Also, include the matching include/ directory which I missed on the first pass. BRANCH=none BUG=none TEST=Run tests with coverage, then manually run lcov and verify that the directory was removed. Signed-off-by: Yuval Peress <peress@google.com> Change-Id: I7eb58b0eff01ecd5ba9c4f5da18e947d3e41c489 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3291127 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* zephyr: test: sn5s330 vbus source sink enableAaron Massey2021-11-301-0/+29
| | | | | | | | | | | | | Verify vbus_source/sink_enable function sets corresponding PP bits. BRANCH=none BUG=b:203364783 TEST=zmake configure --test test-drivers Signed-off-by: Aaron Massey <aaronmassey@google.com> Change-Id: I1e91132a3b2517032e7ebf65ec1790c93dfb420f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3300182 Reviewed-by: Tristan Honscheid <honscheid@google.com>
* zephyr: kconfig: add PLATFORM_EC_USB_PD_VBUS_MEASURE_BY_BOARDEric Yilun Lin2021-11-301-1/+7
| | | | | | | | | | | | | | | | | Add new config PLATFORM_EC_USB_PD_VBUS_MEASURE_BY_BOARD. BUG=none TEST=zmake testall BRANCH=none Change-Id: I0b6329548809ba8f7371ce51a25354f4beb01344 Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3305650 Tested-by: Eric Yilun Lin <yllin@google.com> Auto-Submit: Eric Yilun Lin <yllin@google.com> Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Tristan Honscheid <honscheid@google.com> Commit-Queue: Keith Short <keithshort@chromium.org>
* i2c: Use declared initializers for i2c_ports: grunt devicesKeith Short2021-11-306-33/+231
| | | | | | | | | | | | | | Convert all instances of i2c_ports[] to use declared initializers. This allows the fields to be reordered without breaking code. BUG=none BRANCH=none TEST=compare_build.sh Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I24440d64917d24e005b7176f90fc87d56d150444 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3300184 Reviewed-by: Ting Shen <phoenixshen@chromium.org>
* i2c: Use declared initializers for i2c_ports: baseboardsKeith Short2021-11-3010-62/+335
| | | | | | | | | | | | | | Convert all instances of i2c_ports[] to use declared initializers. This allows the fields to be reordered without breaking code. BUG=none BRANCH=none TEST=compare_build.sh Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I463b374760ab559e5bbf3fca7dece3537756a442 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3300183 Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* zephyr: use a chosen node to detect internal flashPeter Marheine2021-11-304-11/+17
| | | | | | | | | | | | | | | | | | | This change defines a well-known chosen node to bind the crec_flash_* shim functions to an actual flash device. Prior to this change, the shim required the internal flash be named 'fiu0' in order to function and this would only be checked at runtime. It is now checked at compile-time, saving a pointer in RAM and failing at build-time if not correctly configured. BUG=b:205615358 TEST=zmake testall BRANCH=none Change-Id: Ie713176960150a7ebeae8d2dcfc10c48260b264c Signed-off-by: Peter Marheine <pmarheine@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3305647 Commit-Queue: Keith Short <keithshort@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
* taniks: Initial EC imageJoey Peng2021-11-3020-0/+2336
| | | | | | | | | | | | | | | | | | Create the initial EC image for the taniks variant by copying the brya reference board EC files into a new directory named for the variant. (Auto-Generated by create_initial_ec_image.sh version 1.5.0). BUG=b:207402720 BRANCH=None TEST=make BOARD=taniks Signed-off-by: Joey Peng <joey.peng@lcfc.corp-partner.google.com> Change-Id: Ib4e9d8fb5c143494276752dbfde53a700aeeab75 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3301562 Reviewed-by: YH Lin <yueherngl@chromium.org> Reviewed-by: Boris Mittelberg <bmbm@google.com>
* wormdingler: Remove the bring up features macroSiyu Qin2021-11-301-8/+0
| | | | | | | | | | | | | | | | Remove the bring up features macro in DVT phase. BUG=b:205203062 BRANCH=trogdor TEST=make BOARD=wormdingler -j Signed-off-by: Siyu Qin <qinsiyu@huaqin.corp-partner.google.com> Change-Id: I112819969bda8068de7651409e2f1c15350bf59b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3292659 Reviewed-by: wen zhang <zhangwen6@huaqin.corp-partner.google.com> Reviewed-by: Bob Moragues <moragues@chromium.org> Reviewed-by: Wai-Hong Tam <waihong@google.com> Commit-Queue: Bob Moragues <moragues@chromium.org>
* taeko: Nx20p3483 cannot sink power after reset ecreno.wang2021-11-302-2/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | To avoid nx20p3483 cannot sink power after reset ec w/ AC only in TCPC1 port, EC shouldn't assert GPIO_USB_C1_RT_RST_R_ODL if no battery. This is caused by ps8815 is in reset, so en_snk is asserted to low. In this moment, nx20p3483 won't supply power to system. That means VBUS_IN is 0V. PP3300_USB_DB_Z1 may discharge to 0V, then nx20p3483 is reset to default, dead battery mode. However, adapter's pd keep in High-V because there is no De-attach process or HARD Reset event to send adapter pd. As nx20p3483's datasheet, its default VBUS OVLO is 6.8V, but VBUS from adapter is High-V, nx20p3483 is latched and won't sink power. So, after reset ec, it should check if battery is present or not before assert GPIO_USB_C1_RT_RST_R_ODL. BUG=b:202489681 BRANCH=None TEST=make -j BOARD=taeko, verify ps8815 fw update in AC+DC, verify power on/off with AC only Signed-off-by: reno.wang <reno.wang@lcfc.corp-partner.google.com> Change-Id: Ib403d2f3f8bbfb719c3fc932bc6a147bea8a2fcf Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3247730 Reviewed-by: Boris Mittelberg <bmbm@google.com> Commit-Queue: Boris Mittelberg <bmbm@google.com>
* cleanup: redrix: Fix macro stringDevin Lu2021-11-301-3/+3
| | | | | | | | | | | BUG=none BRANCH=none TEST=make BOARD=redrix Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Change-Id: I72a499ad21990911ffb3c7627dd2db2a9697f22c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3302223 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* task: change task events bitmask to atomic_tDawid Niedzwiecki2021-11-299-15/+17
| | | | | | | | | | | | | | | | | | | | The events bitmask is used only with atomic_* functions or for reading, so change to variable type to atomic_t. It shouldn't change the generated code. It will be useful for incoming commits related to modifying atomic_t caused by a change in Zephyr upstream (atomic_t from int to long). BUG=b:207082842 TEST=make buildall && zmake testall && build_compare.sh -b all BRANCH=main Signed-off-by: Dawid Niedzwiecki <dn@semihalf.com> Change-Id: Ia0ff4a20f9ed6c3728b1bd8b6cab3b32ebfcc36b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3300321 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* system: change sleep_mask to atomic_t typeDawid Niedzwiecki2021-11-294-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | The sleep_mask is used only with atomic_* functions or for reading, so change to variable type to atomic_t. Do the same with idle_disabled. It shouldn't change the generated code. The only noticed change is for mchp chip. The compiler uses .w asm extension for some instructions in __idle function in clock.c file. It will be useful for incoming commits related to modifying atomic_t caused by a change in Zephyr upstream (atomic_t from int to long). BUG=b:207082842 TEST=make buildall && zmake testall BRANCH=main Signed-off-by: Dawid Niedzwiecki <dn@semihalf.com> Change-Id: I85d05bb911af973f030cf46d3f534c374ef76936 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3300320 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* atomic: cast pointers to atomic_t* for atomic_* callsDawid Niedzwiecki2021-11-2912-20/+21
| | | | | | | | | | | | | | | | | Some atomic_* calls use pointers to different types of variables than atomic_t. Cast those to atomic_t* to avoid compilation errors. It shouldn't change the generated code. BUG=b:207082842 TEST=make buildall && zmake testall && build_compare.sh -b all BRANCH=main Signed-off-by: Dawid Niedzwiecki <dn@semihalf.com> Change-Id: I5d8e8eca7c5d7fe661c75bc75f82c49083c88be0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3300319 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* util/ec3po: Update language for COILTom Hughes2021-11-292-46/+46
| | | | | | | | | | | BRANCH=none BUG=b:163885307 TEST=./util/ec3po/run_tests.sh Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: Idc25a8d3638e434c64e8c6a46661552047556eb2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3298873 Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>