summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* presubmit: Don't use chromite in presubmit hookTristan Honscheid2023-05-171-9/+10
| | | | | | | | | | | | | | | | | We can do the things chromite.lib was doing in other ways while making it easier to run the presubmit hooks outside of the chroot. Replace the command line parsing with `argparse` and use `subprocess` for interfacting with Git. BUG=None TEST=./util/check_low_coverage_reason.py Change-Id: I6ecc692ae26d1646604f2cabd52c76337404a481 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4545398 Commit-Queue: Jeremy Bettis <jbettis@chromium.org> Tested-by: Tristan Honscheid <honscheid@google.com> Auto-Submit: Tristan Honscheid <honscheid@google.com> Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* gothrax: Initial Zephyr EC imageTang Qijun2023-05-176-4/+20
| | | | | | | | | | | | | | | | Create the initial Zephyr EC image for the gothrax variant based on the nereid reference board. (Auto-Generated by create_zephyr_ec_image.sh version 1.0.0). BUG=None TEST=zmake build gothrax --clobber Change-Id: I825206e5529da09a377c27d854372c6a9afc1ed4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4542369 Commit-Queue: Henry Sun <henrysun@google.com> Tested-by: Tang Qijun <qijun.tang@ecs.corp-partner.google.com> Reviewed-by: Henry Sun <henrysun@google.com>
* board/hyperdebug: Add declarations of I2C4Jes B. Klinke2023-05-172-2/+9
| | | | | | | | | | | | | | | | | HyperDebug supports four I2C busses, three of which are to be connected to the three I2C busses used by Ti50. The fourth we want to use for connecting a power measurement chip on the shield, in order to automatically verify that the power draw in sleep modes does not have regressions. BUG=b:282999020 TEST=Observe HyperDebug manipulate IO expanders via I2C4 Change-Id: Ibc4eeab692e0278eb3cc0c77c1affd035b555bc2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4537012 Reviewed-by: Jett Rink <jettrink@chromium.org> Tested-by: Jes Klinke <jbk@chromium.org> Commit-Queue: Jes Klinke <jbk@chromium.org>
* chip/stm32: Support for I2C4 instance on STM32L4/5Jes B. Klinke2023-05-174-7/+42
| | | | | | | | | | | | | | | | | | | The L4/L5 families have four I2C controllers. The fourth has its registers in a separate region, and enable bits are not contiguous with the first three. This CL adds a few if-statements in i2c driver code, in order to support all four controllers. BUG=b:282999020 TEST=Observe I2C activity on HyperDebug I2C4 Change-Id: If27eda73b3da32190bad7df5db8c6bb6c78b4c5c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4537011 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Commit-Queue: Jes Klinke <jbk@chromium.org> Tested-by: Jes Klinke <jbk@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
* power/mt8186: move ap-idle to highest priority at power_chipset_initTing Shen2023-05-172-12/+24
| | | | | | | | | | | | | | | | | | | AP_IDLE should have higher priority over AP_OFF. (note that in this version there's another bug that the S5->S0 hooks are not invoked when sysjump to RW) BUG=b:280408533 TEST=AP can boot to S0 after following steps: 1) dut-control power_state:rec 2) wait a few seconds to enter recovery screen 3) dut-control power_state:warm_reset Change-Id: I0b69f082f09afac93275bef7d93ca7123ab1099f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4387555 Commit-Queue: Ting Shen <phoenixshen@chromium.org> Tested-by: Ting Shen <phoenixshen@chromium.org> Reviewed-by: Sung-Chi Li <lschyi@chromium.org>
* voltorb: Fix LED behaviorSiyu Qin2023-05-171-13/+3
| | | | | | | | | | | | | | | | | | Due to LED behavior is changed to depend on display SOC (CL:4478776), so voltorb LED policy should be fixed as OEM requirement. BUG=b:269208753 TEST=1. No mismatch error. 2. When battery display is 99%, LED is amber. When battery display is 100%, LED is blue. Change-Id: I9d77966b43f2b3208c282a34401f34d47fc4b560 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4542364 Reviewed-by: Ting Shen <phoenixshen@chromium.org> Commit-Queue: Siyu Qin <qinsiyu@huaqin.corp-partner.google.com> Reviewed-by: wen zhang <zhangwen6@huaqin.corp-partner.google.com> Tested-by: Siyu Qin <qinsiyu@huaqin.corp-partner.google.com>
* uldren: Modify battery parameterLogan_Liao2023-05-178-4/+76
| | | | | | | | | | | | | | | This patch base on BatteryParameter_0516 to modify battery parameter. BUG=b:274750316 TEST=test battery cutoff success. Change-Id: Iab754f26bb6d6fa53b956d5e279bf64e03642ef9 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4537643 Reviewed-by: Shou-Chieh Hsu <shouchieh@chromium.org> Reviewed-by: Logan Liao <logan_liao@compal.corp-partner.google.com> Commit-Queue: Shou-Chieh Hsu <shouchieh@chromium.org> Reviewed-by: Elthan Huang <elthan_huang@compal.corp-partner.google.com> Tested-by: Logan Liao <logan_liao@compal.corp-partner.google.com>
* gothrax: Initial Zephyr EC imageYunlong Jia2023-05-1714-0/+1980
| | | | | | | | | | | | | | | | | Create the initial Zephyr EC image for the gothrax variant based on the nereid reference board. (Auto-Generated by create_zephyr_ec_image.sh version 1.0.0). BUG=b:279614675 BRANCH=None TEST=PASS Change-Id: I7a977ed3448101a400a01ae06b452dc8577ebf49 Signed-off-by: Yunlong Jia <yunlong.jia@ecs.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4537641 Reviewed-by: Henry Sun <henrysun@google.com> Commit-Queue: Henry Sun <henrysun@google.com>
* screebo: Implement LED behaviorwen zhang2023-05-173-0/+173
| | | | | | | | | | | | | | | | This defines the LED's behavior according to the OEM specification. Check more detail in the bug. BUG=b:278153037 TEST=1.ectool led battery {color} can set the right color 2.led works as intended behavior in different states Change-Id: I42b67170d0d07554626b2a0158cebc8406be60a0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4463817 Tested-by: wen zhang <zhangwen6@huaqin.corp-partner.google.com> Reviewed-by: caveh jalali <caveh@chromium.org> Commit-Queue: wen zhang <zhangwen6@huaqin.corp-partner.google.com> Reviewed-by: Mike Lee <mike5@huaqin.corp-partner.google.com>
* presubmit: Require bug in LOW_COVERAGE_REASONTristan Honscheid2023-05-163-1/+61
| | | | | | | | | | | | | | | | | Enforce having a bug listed in the LOW_COVERAGE_REASON to track the issue that impedes coverage for that specific CL. This encourages developers to go back and fix those problems. Also update the documentation. BUG=None TEST=util/check_low_coverage_reason.py Change-Id: If35f918b11771d10944e0b6e7a4aeeba84e05eaf Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4537010 Reviewed-by: Jeremy Bettis <jbettis@chromium.org> Commit-Queue: Jeremy Bettis <jbettis@chromium.org> Auto-Submit: Tristan Honscheid <honscheid@google.com> Tested-by: Tristan Honscheid <honscheid@google.com>
* ec: Add #line in include/lid_switch.hJeremy Bettis2023-05-161-0/+6
| | | | | | | | | | | | | | Work around coreboot GCC preprocessor bug. BUG=b:272518464 TEST=gcc -E Change-Id: Ic95717cab141d76a20d45a16126ac37a8859829e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4540107 Reviewed-by: Al Semjonovs <asemjonovs@google.com> Commit-Queue: Jeremy Bettis <jbettis@chromium.org> Auto-Submit: Jeremy Bettis <jbettis@chromium.org> Tested-by: Jeremy Bettis <jbettis@chromium.org>
* TCPMv2: Do not attempt Enter_USB under PD 2.0Abe Levkoy2023-05-162-0/+42
| | | | | | | | | | | | | | | | If the port partner is not PD 3.0 or higher, do not consider it to support USB4/Enter_USB. If the AP requests USB4 entry, disregard the request and consider mode entry complete. Avoid repeatedly sending Enter_USB to a PD 2.0 partner. BUG=b:279421317 TEST=twister -s drivers/drivers.usbc_usb4_mode Change-Id: I3e82738f816e6dd5af24d627b6cd971a34d74586 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4533369 Commit-Queue: Abe Levkoy <alevkoy@chromium.org> Tested-by: Abe Levkoy <alevkoy@chromium.org> Reviewed-by: Jameson Thies <jthies@google.com>
* AMD Mux Emul: Stabilize delayed mux set codeDiana Z2023-05-163-12/+17
| | | | | | | | | | | | | | | | The current emulator relies on timing in order to delay mux sets. However, this can lead to some surprising mismatches in time between the emulator and test (such as the write completing during a subsequent test case). Instead, delay by the number of reads the driver has done. BUG=b:234771735 TEST=./twister -s drivers/drivers.amd_fp6_usb_mux Change-Id: I71c78348e29b70c479da8009b8a085cf4e57c188 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4528795 Reviewed-by: Jeremy Bettis <jbettis@chromium.org> Commit-Queue: Diana Z <dzigterman@chromium.org> Tested-by: Diana Z <dzigterman@chromium.org>
* motion_sense: Fix null pointer reference in gesture detectionRuihai Zhou2023-05-163-2/+57
| | | | | | | | | | | | | | | | | | | | The motion_sense_fifo_stage_data with NULL were removed in CL:4499747. But we need to stage and commit the motion state changed to activity sensor for body detection on the ap side. Revert the change and Add null pointer check in motion_sense_fifo_stage_data and fifo_stage_unit to fix it. BUG=b:272655176 TEST=./twister -v -i -p native_posix -p unit_testing -s drivers/drivers.body_detection TEST=received User proximity: Near/Far event from powerd log Change-Id: I1ef882f25e07fa17d879d8b0a4b9ffe211b071e7 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4520740 Tested-by: Ruihai Zhou <zhouruihai@huaqin.corp-partner.google.com> Commit-Queue: Tim Van Patten <timvp@google.com> Reviewed-by: Sung-Chi Li <lschyi@chromium.org> Reviewed-by: Tim Van Patten <timvp@google.com>
* boringssl: Add elliptic curve key helpersYi Chou2023-05-165-0/+86
| | | | | | | | | | | | | | | BUG=b:248508087 TEST=make V=1 BOARD=bloonchipper -j TEST=./test/run_device_tests.py --board bloonchipper -t boringssl_crypto => PASS TEST=./test/run_device_tests.py --board dartmonkey -t boringssl_crypto => PASS Change-Id: Ifdca7743c09910d413407be986e9d959e5b90479 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4505560 Tested-by: Yi Chou <yich@google.com> Commit-Queue: Yi Chou <yich@google.com> Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* boringssl: Implement sysrand from TRNGYi Chou2023-05-1613-0/+96
| | | | | | | | | | | | | | | | | | The boringssl doesn't include the TRNG implementation, we need our own CRYPTO_sysrand. BUG=b:248508087 TEST=make V=1 BOARD=bloonchipper -j TEST=./test/run_device_tests.py --board bloonchipper -t boringssl_crypto => PASS TEST=./test/run_device_tests.py --board dartmonkey -t boringssl_crypto => PASS Change-Id: I3136bcc96e09f674278bf338297d7bc0576e174c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4496289 Reviewed-by: Tom Hughes <tomhughes@chromium.org> Commit-Queue: Yi Chou <yich@google.com> Tested-by: Yi Chou <yich@google.com>
* test_util.h: Add TEST_ASSERT_ARRAY_NEYi Chou2023-05-161-0/+14
| | | | | | | | | | | BUG=b:248508087 make runhosttests -j200 >/dev/null Change-Id: I7fa48a68bc8a56fb94649a4a0930ce83df6d9a84 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4506541 Reviewed-by: Tom Hughes <tomhughes@chromium.org> Commit-Queue: Yi Chou <yich@google.com> Tested-by: Yi Chou <yich@google.com>
* ec_openocd: flip the logic for verify, change to --no-verifyFabio Baltieri2023-05-161-7/+6
| | | | | | | | | | | | | | The current verify option has to be used with --verify=0, which is a bit unintuitive. Replace it with a --no-verify, or -n. BUG=none TEST=./util/ec_openocd.py --board rex flash -n Change-Id: Ib2747c52b9a07c8ff3985dd0c7416331e2b042b1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4534336 Tested-by: Fabio Baltieri <fabiobaltieri@google.com> Commit-Queue: Fabio Baltieri <fabiobaltieri@google.com> Reviewed-by: Robert Zieba <robertzieba@google.com>
* vell: Sync up FW_CONFIG with config.starDevin Lu2023-05-162-69/+14
| | | | | | | | | | | | BUG=b:282189358 TEST=make BOARD=vell Change-Id: I7a37cf41e22982f354f74f0fe9dbe27673fb29f0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4530325 Commit-Queue: Boris Mittelberg <bmbm@google.com> Reviewed-by: Boris Mittelberg <bmbm@google.com> Tested-by: Devin Lu <devin.lu@quantatw.com> Reviewed-by: caveh jalali <caveh@chromium.org>
* starmie: Config the thermal sensor settingwangganxiang2023-05-162-0/+124
| | | | | | | | | | | | | | | Add thermistor 1V9-100K-100K-4250B for ambient temperature. BUG=b:277309876 TEST=zmake build starmie Use ectool temps all to check can read thermistor temperature. Change-Id: Ia0786b2495f2b4f0d6d29d74cf176b9f61cff01a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4525658 Tested-by: Ganxiang Wang <wangganxiang@huaqin.corp-partner.google.com> Reviewed-by: Mike Lee <mike5@huaqin.corp-partner.google.com> Reviewed-by: Sung-Chi Li <lschyi@chromium.org> Commit-Queue: Ganxiang Wang <wangganxiang@huaqin.corp-partner.google.com>
* omnigul: Remove TBT and USB4 defineLogan_Liao2023-05-161-9/+0
| | | | | | | | | | | | | | | omnigul don't support Thunderbolt and USB4, remove them. BUG=b:282045980 TEST=omnigul didn't hang when connect two omnigul with typec cable Change-Id: Ied52af43231d7454b51d18b531c1d1bf0b54eaac Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4530331 Tested-by: Logan Liao <logan_liao@compal.corp-partner.google.com> Code-Coverage: Kyle Lin <kylelinck@google.com> Commit-Queue: Kyle Lin <kylelinck@google.com> Reviewed-by: Kyle Lin <kylelinck@google.com> Reviewed-by: Logan Liao <logan_liao@compal.corp-partner.google.com>
* voltorb: enable checking battery stable statusSiyu Qin2023-05-161-0/+1
| | | | | | | | | | | | | | | | Check battery status TCA/TDA mask, any one of these two masks is set, the battery state can be considered stable. BUG=b:275392868 TEST=no "charge problem: batt params" in EC console when DUT wakes up from battery ship mode Change-Id: If8712e6e958bac9d9c0645b284a2569cdffae327 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4525879 Reviewed-by: Eric Yilun Lin <yllin@google.com> Commit-Queue: Siyu Qin <qinsiyu@huaqin.corp-partner.google.com> Tested-by: Siyu Qin <qinsiyu@huaqin.corp-partner.google.com> Reviewed-by: Mike Lee <mike5@huaqin.corp-partner.google.com>
* battery: check the battery stable state when battery wake upSiyu Qin2023-05-164-6/+99
| | | | | | | | | | | | | | | | | Check the specific battery status to judge whether the battery is initialized and stable when the battery wakes up from ship mode. Use two MASKs to provide logical AND and logical OR options for different status. BUG=b:275392868 TEST=zmake build -a Change-Id: I7c5b4c9a74024846b6611ed49bf4823cf877469c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4486658 Reviewed-by: Mike Lee <mike5@huaqin.corp-partner.google.com> Tested-by: Siyu Qin <qinsiyu@huaqin.corp-partner.google.com> Reviewed-by: Eric Yilun Lin <yllin@google.com> Commit-Queue: Siyu Qin <qinsiyu@huaqin.corp-partner.google.com>
* taranza: Enable ectool led controlYu-An Chen2023-05-161-0/+3
| | | | | | | | | | | | | Enable ectool led control BUG=b:278167979 TEST=ectool led power white/off/auto Change-Id: I36f5aac2ff78aa6e68347ece6cc59eb87a3bb8b2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4533460 Tested-by: Yu-An Chen <yu-an.chen@quanta.corp-partner.google.com> Reviewed-by: Zhuohao Lee <zhuohao@chromium.org> Commit-Queue: Yu-An Chen <yu-an.chen@quanta.corp-partner.google.com>
* yavilla: Add convertible related functionsTommy Chung2023-05-166-19/+234
| | | | | | | | | | | | | | | | Yavilla has convertible sku, add convertible related functions, including motion sensors, gmr sensor, vol button. Disable motion sensors and gmr semsor for clamesell sku. BUG=b:273791621 TEST=make sure all convertible functions work. Change-Id: I29beaaae8f002c811ad1ccb8ecdd77fa78840a5d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4457658 Commit-Queue: Tommy Chung <tommy.chung@quanta.corp-partner.google.com> Tested-by: Tommy Chung <tommy.chung@quanta.corp-partner.google.com> Reviewed-by: Peter Marheine <pmarheine@chromium.org> Reviewed-by: Devin Lu <devin.lu@quantatw.com>
* corsola: Fix reported USB-C ports for no DB design with DB detection onlschyi2023-05-167-4/+119
| | | | | | | | | | | | | | | | | | | | | The definition of `CORSOLA_DB_NONE` was settled to no DB in the project in the previous CL "corsola: Update implementation for no daughter board ", and the USB-C counts is determined by dts settings in previous CL " corosla: Improve USB-C port configuration". This introduces a reported port number mismatch when the DB detection is enabled, and the desired detection result is no DB in the design. Extend the DB status enum with `CORSOLA_DB_NO_DETECTION` to properly describe the different DB status, and fix the reported USB-C port logic. BUG=b:282625153 TEST=`zmake build <all board> --clobber` Change-Id: Idd55381759677272e0bfc7b270647d759642ce01 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4530326 Reviewed-by: Ting Shen <phoenixshen@chromium.org> Tested-by: Sung-Chi Li <lschyi@chromium.org> Commit-Queue: Sung-Chi Li <lschyi@chromium.org>
* Hades: Give SEQ_EC_DSW_PWROK interrupt higher priorityDaisuke Nojiri2023-05-151-0/+3
| | | | | | | | | | | | | | | This CL gives SEQ_EC_DSW_PWROK interrupt a higher priority to reduce the latency of PCH_PWROK. BUG=b:279918234 TEST=Agah. Latency is reduced to 18 usec. Change-Id: I359b045a7078862bd0d32fa0121c93dee3ef9f7e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4520132 Commit-Queue: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Tarun Tuli <taruntuli@google.com> Auto-Submit: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: Daisuke Nojiri <dnojiri@chromium.org>
* Agah: Give SEQ_EC_DSW_PWROK interrupt higher priorityDaisuke Nojiri2023-05-151-0/+3
| | | | | | | | | | | | | | | This CL gives SEQ_EC_DSW_PWROK interrupt a higher priority to reduce the latency of PCH_PWROK. BUG=b:279918234 TEST=Agah. Latency is reduced to 18 usec. Change-Id: I0cca3e6d5c7bc97eefddc0958eaeb0b65007e5fb Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4518231 Auto-Submit: Daisuke Nojiri <dnojiri@chromium.org> Commit-Queue: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Tarun Tuli <taruntuli@google.com> Tested-by: Daisuke Nojiri <dnojiri@chromium.org>
* NPCX9: Allow boards to customize MIWU interrupt priorityDaisuke Nojiri2023-05-152-16/+67
| | | | | | | | | | | | | | | | This CL will add macros used to set MIWU interrupt priorities. These macro can be set by each board to adjust priorities as needed. BUG=b:279918234 TEST=build agah Change-Id: Ide840e4ab8cc9aa8deb83b6ad76fa64bc0d83972 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4518230 Auto-Submit: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Tarun Tuli <taruntuli@google.com> Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Mulin Chao <mlchao@nuvoton.com> Commit-Queue: Daisuke Nojiri <dnojiri@chromium.org>
* chip: add support for npcx trngDavid Cross2023-05-152-0/+252
| | | | | | | | | BUG=b:280889889 TEST=add CONFIG_RNG to NPCX based board.h file (e.g. npcx9_evb) Change-Id: I93b3a7742c3b7d614cc1218104cd642b3339f8b3 Signed-off-by: David Cross <davidmcross@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4507895 Reviewed-by: Bobby Casey <bobbycasey@google.com>
* tasks: Only report stack overflow if task is enabledRob Barnes2023-05-155-9/+16
| | | | | | | | | | | | | | | | | Don't report stack overflow on a task that has been disabled. Without this change, system safe mode will fail to recover from a stackoverflow because the stackoverflow will be detected again, even though the task has already been disabled. BUG=b:278792557 TEST=System safe mode starts on boten after a stackoverflow Change-Id: I59ab579c296d108dcd8c5aba9cb32bba6c7bbf54 Signed-off-by: Rob Barnes <robbarnes@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4455298 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Boris Mittelberg <bmbm@google.com>
* ec: Add #line in include/system.hJeremy Bettis2023-05-151-0/+6
| | | | | | | | | | | | | | Work around coreboot GCC preprocessor bug. BUG=b:272518464 TEST=gcc -E Change-Id: I609d019680bedddc8deea0f377c8bee4df6f5df1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4533365 Commit-Queue: Aaron Massey <aaronmassey@google.com> Auto-Submit: Jeremy Bettis <jbettis@chromium.org> Tested-by: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Aaron Massey <aaronmassey@google.com>
* ppc: ktu1125: Fix register used for VCONN controlScott Collyer2023-05-151-3/+7
| | | | | | | | | | | | | | | | | | | | The register that was being used to enable/disable VCONN (KTU1125_SET_SW_CFG) was incorrect. It should be KTU1125_CTRL_SW_CFG. In addition, VCONN was being applied to wrong CC line. KTU1125_CC1S_VCONN --> applies VCONN to CC1 when the polarity is CC2 KTU1125_CC2S_VCONN --> applies VCONN to CC2 when the polarity is CC1 BUG=b:267589112 TEST=Verfied using totalphase that VCONN is being enabled and the CC voltage of the CC data line is correct. Change-Id: I45c85800849dbabeac36d976525de7d058ad23f4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4519354 Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org> Reviewed-by: Boris Mittelberg <bmbm@google.com> Commit-Queue: Scott Collyer <scollyer@chromium.org>
* charger: Rename enum charge_state_v2 to charge_stateSimon Glass2023-05-154-23/+23
| | | | | | | | | | | | | | | | Now that we don't have an old charge_state, this is the only one. Rename it accordingly. This makes no functional change. BUG=b:218332694 TEST=make buildall Change-Id: I95923eedd2715b8c7793df8f6e3171c82f9347ca Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4516193 Reviewed-by: Tristan Honscheid <honscheid@google.com> Tested-by: Simon Glass <sjg@chromium.org> Commit-Queue: Eric Peers <epeers@google.com>
* charger: Delete charge_state_v2.hSimon Glass2023-05-151-9/+0
| | | | | | | | | | | | | | | | This is not used any more. Delete it. This makes no functional change. BUG=b:218332694 TEST=make buildall Change-Id: I982d9ac1e593232518850ad061480cd9746cfcbe Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4516192 Tested-by: Simon Glass <sjg@chromium.org> Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org> Commit-Queue: Eric Peers <epeers@google.com>
* doc: zephyr_troubleshooting: add a note about macro expansionFabio Baltieri2023-05-151-2/+12
| | | | | | | | | | | | | | | Add a note about the new config option CONFIG_COMPILER_TRACK_MACRO_EXPANSION, and also add an example on how to disable LTO without changing the project file itself. BUG=none TEST=check the page on gitiles Change-Id: I3af8b5ba4f8a0e59a419e426baa4d5460040e86c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4516858 Commit-Queue: Fabio Baltieri <fabiobaltieri@google.com> Tested-by: Fabio Baltieri <fabiobaltieri@google.com> Reviewed-by: Keith Short <keithshort@chromium.org>
* ec: Enable unaligned access for cortex-mFiras Sammoura2023-05-157-2/+172
| | | | | | | | | | | | | | | | | | Enable unaligned access for cortext-m and. Add a unit test to validate that unaligned access runs properly on both bloonchipper and dartmonkey. Add benchmarks to measure the speed gain between aligned and unaligned access. BRANCH=none BUG=b:239254184 TEST=test/run_device_tests.py -b dartmonkey -t unaligned_access TEST=test/run_device_tests.py -b bloonchipper -t unaligned_access Change-Id: I7d75433e6b7b33d7c82ad740dc85a8646d891c6a Signed-off-by: Firas Sammoura <fsammoura@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4327795 Reviewed-by: Bobby Casey <bobbycasey@google.com> Reviewed-by: Mike Frysinger <vapier@chromium.org>
* omnigul: Modify LED behaviorLogan_Liao2023-05-151-1/+3
| | | | | | | | | | | | | | | | | | | | Modify LED behavior to meet SPEC. S3(discharge): Amber on 1 sec, off 3 sec. S5(discharge): LED off. Battery Error: Amber on 1 sec, off 1 sec. BUG=b:281786726, b:281785649, b:281782326 TEST=test LED behavior meet SPEC. Change-Id: I8e99dfe1d3d415fd5182e494d57e1a02b5c1c59e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4521358 Code-Coverage: Kyle Lin <kylelinck@google.com> Tested-by: Logan Liao <logan_liao@compal.corp-partner.google.com> Reviewed-by: Josh Tsai <josh_tsai@compal.corp-partner.google.com> Commit-Queue: Kyle Lin <kylelinck@google.com> Reviewed-by: Kyle Lin <kylelinck@google.com> Reviewed-by: Logan Liao <logan_liao@compal.corp-partner.google.com>
* [marasov] Enable CONFIG_USB_PD_VBUS_DETECT_PPCmichael5_chen12023-05-152-0/+9
| | | | | | | | | | | | | | | | | | | | | Denpend on HW design, the VBUS control by PPC. Enable CONFIG_USB_PD_VBUS_DETECT_PPC. Disable CONFIG_USB_PD_VBUS_DETECT_TCPCl. BUG=b:277171675 TEST=manual C1: Plug AC through HUB pass (10/10) C1: Plug AC pass (10/10) C0: Plug AC through HUB Pass (10/10) C0: PLug AC pass (10/10) Change-Id: Id91f0aef5e5e24e969c9a50934d821a491d9146b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4520030 Reviewed-by: Michael5 Chen <michael5_chen1@pegatron.corp-partner.google.com> Code-Coverage: Kyle Lin <kylelinck@google.com> Reviewed-by: Kyle Lin <kylelinck@google.com> Tested-by: Michael5 Chen <michael5_chen1@pegatron.corp-partner.google.com> Commit-Queue: Kyle Lin <kylelinck@google.com>
* starmie: Improve RT1739 dead battery voltage issuewangganxiang2023-05-153-1/+11
| | | | | | | | | | | | | | | | Add RT1739 initialization during EC boot. This modification is optimized for dead battery voltage issues. BUG=b:281606949 TEST=zmake build starmie The board can power on normally under AC only mode. Change-Id: I1843b9bce231bc730ad1c4ccb69d74fe3d7beb65 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4516061 Reviewed-by: Mike Lee <mike5@huaqin.corp-partner.google.com> Commit-Queue: Ganxiang Wang <wangganxiang@huaqin.corp-partner.google.com> Reviewed-by: Sung-Chi Li <lschyi@chromium.org> Tested-by: Ganxiang Wang <wangganxiang@huaqin.corp-partner.google.com>
* Craask: define LED behavior at STATE_DISCHARGE_S0_BAT_LOWben chen2023-05-151-1/+1
| | | | | | | | | | | | | | STATE_DISCHARGE_S0_BAT_LOW: Blue on BUG=b:282116750 TEST=check LED behavior while SOC < 10% in battery mode. Change-Id: I57487200de2360dfa34cecda8a99ab1c008d2758 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4525880 Reviewed-by: Ben Chen <ben.chen2@quanta.corp-partner.google.com> Tested-by: Ben Chen <ben.chen2@quanta.corp-partner.google.com> Commit-Queue: Shou-Chieh Hsu <shouchieh@chromium.org> Reviewed-by: Shou-Chieh Hsu <shouchieh@chromium.org>
* USB Mux: Use polarity in safe modeJameson Thies2023-05-1223-24/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, a handful of drivers look for the mux_state to be equal to USB_PD_MUX_SAFE_MODE when handling safe mode. This check requires that the polarity information be cleared before sending the mux_state to any drivers to correctly handle the safe state. But the same mux_state is sent to the kernel, which relies on polarity information from the EC when setting USB-C switches. This CL updates the retimer, tcpm and usb_mux drivers which check for mux_state to equal USB_PD_MUX_SAFE_MODE to instead only look for the safe mode bit to be set. This allows those drivers to function the same way in safe mode regardless of polarity information. It also updates usb_mux.c to preserve the polarity bit when sending mux_state to drivers in safe_state. LOW_COVERAGE_REASON=20 of the changed drivers have no emulators BUG=b:279733113 TEST=make -j buildall, confirmed that no remaining drivers check for mux state to equal USB_PD_MUX_SAFE_MODE. Checked on redrix that we are able to drive a monitor with inverted and normal polarity after losing Try.SRC. Change-Id: Ifc89d0ba1da0975436f93be102fadf725a5b8566 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4527219 Reviewed-by: Diana Z <dzigterman@chromium.org> Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Tested-by: Jameson Thies <jthies@google.com> Commit-Queue: Jameson Thies <jthies@google.com>
* zmake: Resolve coreboot_sdk_root pathAaron Massey2023-05-121-1/+2
| | | | | | | | | | | | | | | | | The COREBOOT_SDK_ROOT environment variable is not resolved. Resolve the COREBOOT_SDK_ROOT environment variable to an absolute path. BUG=b:268050548 TEST=CQ TEST=fwsdk: bazel build //platform/rules_cros_firmware/cros_firmware:herobrine_ec Change-Id: Ib5e053531dfce1a13e2840d8968ae559d425cf89 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4529215 Commit-Queue: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Tested-by: Jack Rosenthal <jrosenth@chromium.org>
* common: move chip agnostic trng code from stm32 to commonDavid Cross2023-05-125-71/+97
| | | | | | | | | | | | | | | | | | | | | Making this change causes common trng functions to move memory locations. This change only affects fingerprint (FPMCU) boards BUG=b:280889889 TEST=make BOARD=bloonchipper, CONFIG_CMD_RAND enabled in board.h ALLOW_CONFIG=1 ./util/compare_build.sh -b all => All boards match, except the following Fingerprint boards: bloonchipper dartmonkey hatch_fp nami_fp nocturne_fp nucleo-dartmonkey Change-Id: I4dbb5e255be0f61eb7b446af4565bea487c08e52 Signed-off-by: David Cross <davidmcross@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4507892 Reviewed-by: Bobby Casey <bobbycasey@google.com>
* kingler: add usbc testEric Yilun Lin2023-05-1212-78/+358
| | | | | | | | | | | | | | This CL adds the initial USB-C tests on kingler BUG=b:272664811 TEST=twister -ci zephyr/test Change-Id: I14395ce84442f40e6fd05f7c14a2814fb24ebb9a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4483240 Reviewed-by: Ting Shen <phoenixshen@chromium.org> Tested-by: Eric Yilun Lin <yllin@google.com> Auto-Submit: Eric Yilun Lin <yllin@google.com> Commit-Queue: Ting Shen <phoenixshen@chromium.org>
* rt1718s: integrate board src enable functionsEric Yilun Lin2023-05-125-42/+41
| | | | | | | | | | | | | | | | | Integrate the source enable functions into the driver. Also, reorder the TCPCI call and the board hook call to ensure the board hook is called later in case that the GPIO config auto-reload clobbers the GPIO values. BUG=b:276661970 TEST=test voltorb C1 source/sink Change-Id: Ifff3ae116c088f13ee5e7eec3418810a35ead884 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4522688 Reviewed-by: Ting Shen <phoenixshen@chromium.org> Auto-Submit: Eric Yilun Lin <yllin@google.com> Tested-by: Eric Yilun Lin <yllin@google.com> Commit-Queue: Ting Shen <phoenixshen@chromium.org>
* Uldren: modify rotate matrixmick_hsiao2023-05-121-4/+4
| | | | | | | | | | | | | | | modift rotate matrix to let motionsensor works corretly BUG=b:281487225 TEST=watch -n 1 ectool motionsense, all data are correctly as expected Change-Id: I13032d7c9eb46695eb281be9cc3f0125dcde85a1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4515843 Reviewed-by: Elthan Huang <elthan_huang@compal.corp-partner.google.com> Tested-by: Mick Hsiao <mick_hsiao@compal.corp-partner.google.com> Commit-Queue: Shou-Chieh Hsu <shouchieh@chromium.org> Reviewed-by: Shou-Chieh Hsu <shouchieh@chromium.org>
* joxer: Allow alternate rotation parameters for JoxerScott Chao2023-05-124-0/+67
| | | | | | | | | | | | | | This will allow joxer to load different rotation matrix according to cbi. BUG=b:282054731 TEST=make sure joxer rotate correctly Change-Id: I03aa376f05f8f68cbabacf897915cb54d6b80ab7 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4486659 Commit-Queue: Scott Chao <scott_chao@wistron.corp-partner.google.com> Reviewed-by: Peter Marheine <pmarheine@chromium.org> Tested-by: Scott Chao <scott_chao@wistron.corp-partner.google.com>
* starmie: implement base detectionwangganxiang2023-05-124-5/+168
| | | | | | | | | | | | | | Change the judgment mode to interrupt. BUG=b:281643319 TEST=`ectool mkbpget switches` Change-Id: I974cd46ed187fefc3989a0072bc93fe556fd425b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4516960 Reviewed-by: Sung-Chi Li <lschyi@chromium.org> Reviewed-by: Mike Lee <mike5@huaqin.corp-partner.google.com> Tested-by: Ganxiang Wang <wangganxiang@huaqin.corp-partner.google.com> Commit-Queue: Ganxiang Wang <wangganxiang@huaqin.corp-partner.google.com>
* winterhold: Enable CHARGER_MAINTAIN_VBAT Configjohnwc_yeh2023-05-121-0/+1
| | | | | | | | | | | | | | | | | | | | Prevents charger from requesting minimum voltage when AC is off and battery is not present. LOW_COVERAGE_REASON=no unit tests for skyrim yet, b/247151116 BUG=b:269679145 TEST=test on winterhold, AC only after cold reboot the last time of the charger 0x15(Max System Voltage) not fill in 0x15=0800(2.048V) Change-Id: I716f43adab716823c68f3a1f8a7accfa1ead05db Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4506107 Reviewed-by: Diana Z <dzigterman@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: JohnWC Yeh <johnwc_yeh@compal.corp-partner.google.com> Reviewed-by: Josh Tsai <josh_tsai@compal.corp-partner.google.com> Reviewed-by: Elthan Huang <elthan_huang@compal.corp-partner.google.com> Commit-Queue: JohnWC Yeh <johnwc_yeh@compal.corp-partner.google.com>