summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* KB800X: Fix build errorstabilize-14324.72.B-mainstabilize-14324.62.B-mainstabilize-14324.41.B-mainstabilize-14324.13.B-mainrelease-R97-14324.B-mainDavid Huang2021-11-041-1/+3
| | | | | | | | | | | | | | Fix the build error for kb800x. BUG=b:197505149 BRANCH=none TEST=make buildall -j success. Signed-off-by: David Huang <david.huang@quanta.corp-partner.google.com> Change-Id: I99cfaed0beff8b56532efdd549ac05c9900b1493 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3261448 Reviewed-by: caveh jalali <caveh@chromium.org> Commit-Queue: caveh jalali <caveh@chromium.org>
* volteer: moving buttons and switches to use MKBPMichael5 Chen12021-11-041-0/+1
| | | | | | | | | | | | | | | | | | Switching config option to route buttons and switches over MKBP instead of 8042 driver. BUG=b:171365305 BRANCH=firmware-volteer-13672.B TEST=manal test on delbin Cq-Depend: chromium:3251131, chromium:3256835 Signed-off-by: Michael5 Chen1 <michael5_chen1@pegatron.corp-partner.google.com> Change-Id: Ie8438b189b4de074df121bdba934a36ce49af9b0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3252565 Reviewed-by: Zhuohao Lee <zhuohao@chromium.org> Reviewed-by: Boris Mittelberg <bmbm@google.com> Tested-by: Boris Mittelberg <bmbm@google.com> Commit-Queue: Boris Mittelberg <bmbm@google.com>
* driver: bmi3xx: Fix base accelerometer streaming issueLatchia2021-11-041-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | The configuration of sensor has to be saved before writing offsets and it has to be written back. Instead of writing back the saved configurations, there was a call to read back the configs again. This patch has the correct write API call. BRANCH=none BUG=b:200776764 TEST=1. make BOARD=guybrush -j 2. Flash EC binary on the gurbrush proto 2 device 3. In kernel run: ectool motionsense cd /sys/bus/iio/devices/iio\:device2 && cat location echo 0 > in_accel_x_calibbias ectool motionsense # this should work Signed-off-by: Latchiamaran Senram <latchiamaran.senram@bosch.corp-partner.google.com> Change-Id: If8a20f50df8287fb49dec242f6ee9030e8bbe5d5 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3255475 Tested-by: Chih-Yao Chuang <jasonchuang@google.com> Reviewed-by: Bhanu Prakash Maiya <bhanumaiya@google.com> Commit-Queue: Bhanu Prakash Maiya <bhanumaiya@google.com>
* board/woomax,board/morphius: Fix return typeTom Hughes2021-11-034-8/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | clang warns: board/morphius/board.c:406:8: error: implicit conversion from enumeration type 'enum ioex_signal' to different enumeration type 'enum gpio_signal' [-Werror,-Wenum-conversion] ? IOEX_USB_C1_HPD_IN_DB ^~~~~~~~~~~~~~~~~~~~~ board/woomax/board.c:864:6: error: implicit conversion from enumeration type 'enum ioex_signal' to different enumeration type 'enum gpio_signal' [-Werror,-Wenum-conversion] : IOEX_USB_C1_HPD_IN_DB; ^~~~~~~~~~~~~~~~~~~~~ The only caller appears to be svdm_set_hpd_gpio() and svdm_get_hpd_gpio(), which correctly calls gpio_or_ioex_set_level() since the signal may be either gpio_signal or ioex_signal. Rename the board_usbc_port* function to indicate that it can return gpio or ioex. BRANCH=none BUG=b:172020503 TEST=make buildall TEST=CC=clang make BOARD=woomax TEST=CC=clang make BOARD=morphius Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I7be75c8a714ba103362b293413aadc6a92ab72c3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3243008 Reviewed-by: Eric Yilun Lin <yllin@google.com>
* chip/npcx: Fix monitor compilation with clangTom Hughes2021-11-032-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Disable LTO when compiling the monitor header since clang will generate an LLVM IR bitcode file instead of an ARM object file. objcopy then fails since it doesn't recognize the file type. This shouldn't result in any loss of optimization since these are single .c files that are not being linked. Also add a DISCARD section in the linker script to fix the clang (lld) warning: ld.lld: error: no memory region specified for section '.ARM.exidx' This should be safe since there is no ".ARM.exidx" section in npcx_monitor.elf generated by gcc before this change as shown by arm-none-eabi-objdump -h build/brya/chip/npcx/spiflashfw/npcx_monitor.elf Go ahead and discard any other ".ARM.*" sections as well since we do that in our other EC linker scripts. Details on these sections can be found in https://developer.arm.com/documentation/ihi0044/h/?lang=en#sections under the "Sections" section. 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: I784d7a9e69989b330f58f89ae3a901d459e7cd21 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3243010 Reviewed-by: Edward Hill <ecgh@chromium.org>
* board/zinger: Disable CONFIG_DEBUG_PRINTFTom Hughes2021-11-031-2/+2
| | | | | | | | | | | | | | We're getting low on RO flash space, so disable CONFIG_DEBUG_PRINTF to free up more space. BRANCH=none BUG=b:172020503 TEST=make buildall Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I44345f076d26b8aab111f01081fe9bdfd0a69dee Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3253649 Reviewed-by: Edward Hill <ecgh@chromium.org>
* core/cortex-m0: Fix atomic.h compilation with clangTom Hughes2021-11-031-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | clang warns about the following invalid instructions in the inline assembly: core/cortex-m0/atomic.h:44:9: error: invalid instruction, any one of the following would fix this: <inline asm>:4:1: note: instantiated into assembly here orr r3, r3, r2 ^ <inline asm>:4:1: note: instantiated into assembly here bic r2, r2, r1 ^ ld.lld: error: <inline asm>:1:5: invalid instruction, any one of the following would fix this: mov r1, #0 ^ ld.lld: error: <inline asm>:4:1: invalid instruction, any one of the following would fix this: sub r2, r2, r1 ^ The Cortex M0 instruction set only has the variant of these instructions that set the condition codes (e.g., "bics", "orrs"): https://developer.arm.com/documentation/ddi0432/c/CHDCICDF. The "s" at the end indicates that the condition flags will be updated, but we already indicate that we are clobbering condition codes with "cc" in the inline asm. We need to add ".syntax unified" to tell gcc's assembler we're using unified assembler language (https://developer.arm.com/documentation/dui0473/c/BABJIHGJ): /tmp/ccnA5Gkb.s:15936: Error: instruction not supported in Thumb16 mode -- `orrs r1,r1,r3' /tmp/ccnA5Gkb.s:15996: Error: instruction not supported in Thumb16 mode -- `bics r1,r1,r3' BRANCH=none BUG=b:172020503 TEST=CC=clang make BOARD=burnet TEST=CC=clang make BOARD=servo_micro TEST=make buildall Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: Ifafaf67080e25ab2c5d2aad3efc90a9d61978bf9 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3188639 Reviewed-by: Ting Shen <phoenixshen@chromium.org>
* core/cortex-m0: Use compiler_rt version of clz and ctzTom Hughes2021-11-031-1/+6
| | | | | | | | | | | | | | | | | | | | | | | Use __clzsi2 and __ctzsi2 from compiler_rt instead of our own version. Using the compiler_rt versions result in a slightly smaller image. servo_micro before this change: RO: 18744 bytes in flash remaining RW: 23192 bytes in flash remaining servo_micro after this change: RO: 18808 bytes in flash remaining RW: 23256 bytes in flash remaining BRANCH=none BUG=b:172020503 TEST=CC=clang make BOARD=servo_micro TEST=make buildall Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: Ibc19a3670127dde211fb20d247c1284d0aec5f61 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3199739 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* core/cortex-m0: Use builtins from compiler-rt when using clangTom Hughes2021-11-031-2/+13
| | | | | | | | | | | | | | | | | | | | | | When compiling with clang, use the builtins from compiler-rt rather than our own hand-rolled versions. When trying to compile with our versions, clang fails to link: ld.lld: error: core/cortex-m0/div.S:52:(.text.__aeabi_idiv+0x10): unrecognized relocation R_ARM_THM_JUMP8 ld.lld: error: core/cortex-m0/div.S:97:(.text.__aeabi_idivmod+0x24): unrecognized relocation R_ARM_THM_JUMP8 BRANCH=none BUG=b:172020503 TEST=CC=clang make BOARD=servo_v4 TEST=./util/compare_build.sh -b all -j 120 => MATCH Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I33db397c13bcdcb63bd931d0d8425f9f02a76327 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3188640 Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* Guybrush: Handle dead battery boot in more scenariosDiana Z2021-11-031-25/+45
| | | | | | | | | | | | | | | | | | | | | | | | When booting with no battery and multiple chargers (ex. suzy-q), we may end up in scenarios where we have more than one TCPC in dead battery mode. Attempt to get these TCPCs reset whenever we can, and always err on the side of selecting the dead battery port as charge port. This also corrects a typo in the case of no charge port selected. BRANCH=None BUG=b:183660105 TEST=on guybrush: - boot with cutoff battery at 0% and two chargers, verify one is reset and the other is selected. Re-plug charger that isn't selected and verify it still isn't selected, Charge to 4% and verify new charger can be selected and old port is reset. - boot with cutoff battery at 9% and one charger, verify dead battery port is immediately reset Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I4d4ebf314efbbcde99c820a78f5bd4639d08e0a5 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3248346 Reviewed-by: Edward Hill <ecgh@chromium.org>
* zephyr: mt8192: gather power-signal information from DTDenis Brockus2021-11-0310-12/+205
| | | | | | | | | | | | | | | | | | This currently only uses DT power-signal for platforms that define CONFIG_AP_ARM_MTK_MT8192 BUG=b:188674805 BRANCH=none TEST=zmake testall Signed-off-by: Denis Brockus <dbrockus@google.com> Change-Id: I151c451f0725449459744b1ebda042c0c3aa6ad8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3246296 Commit-Queue: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org> Tested-by: Denis Brockus <dbrockus@chromium.org> Auto-Submit: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
* TCPMv2: Avoid hard reset on shutdown with no batteryDiana Z2021-11-031-2/+5
| | | | | | | | | | | | | | | | | 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>
* ec: Implement keyboard backlight get enabledJeremy Bettis2021-11-035-2/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* moonbuggy: modify LED pwm output typeBen Chen2021-11-033-21/+23
| | | | | | | | | | | | | | | | | Modify moonbuggy LED colors to red and blue. Also set the PWM configuration to active low. BUG=b:204504054 BRANCH=cros/main TEST=factory software PE test is PASS Change-Id: I9e79b007a8ab376b290ec441ffd3bb33338145e8 Signed-off-by: Ben Chen <ben.chen2@quanta.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3255121 Reviewed-by: Joe Tessler <jrt@chromium.org> Reviewed-by: Matthew Ziegelbaum <ziegs@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Joe Tessler <jrt@chromium.org>
* brask: Enable recovery key to send event to OSZhuohao Lee2021-11-033-2/+2
| | | | | | | | | | | | | | | | | | In order to make the recovery key to trigger the sysrq and warm reset to the OS, we move the pin to the irq for receiving the button interrupt and then passing the key event to the OS via MKBP event. BUG=b:204512547 BRANCH=None TEST=1. Press/release recovery button shortly -> sysrq sent 2. Press/hold recovery button at least 4s -> warm reset Change-Id: I7d86851b12b4771a43985c2891c7e8b9299d32e4 Signed-off-by: Zhuohao Lee <zhuohao@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3251206 Reviewed-by: Andrew McRae <amcrae@google.com> Commit-Queue: Andrew McRae <amcrae@google.com>
* Dewatt: support 65w adapterSue Chen2021-11-034-6/+17
| | | | | | | | | | | | | Modify max power and max current to support 65w adapter. BUG=b:204386852 BRANCH=none TEST="make BOARD" pass for board dewatt, guybrush and nipperkin Signed-off-by: Sue Chen <sue.chen@quanta.corp-partner.google.com> Change-Id: Ic18ab3021e39913f2a69550fac269e91d3e83508 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3247739 Reviewed-by: Rob Barnes <robbarnes@google.com>
* zephyr: Validate BUILD.py files are formatted with black in CQJack Rosenthal2021-11-032-1/+6
| | | | | | | | | | | | | | | Check that "black" was run on BUILD.py files in the firmware_builder.py script. BUG=b:193815337 BRANCH=none TEST=firmware_builder.py --metrics=/dev/null test Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I51666167adc9d088601732a067ce36a6f53c8e1a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3256038 Commit-Queue: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* beetley: Add motion sense config for BMI220 & ICM42607wizard2021-11-034-4/+148
| | | | | | | | | | | | | | | | | | Add BMI220 & ICM42607 base sensor config for second source BUG=b:204728251 BRANCH=dedede TEST=ectool 'motionsense' 1.Using ectool 'motionsense' verified lid angle goes from 0 to 360 2.swtiches totablet mode after crossing 200 threshold on re-work bmi220/icm42607 DUT Signed-off-by: wizard <shenhu5@huaqin.corp-partner.google.com> Change-Id: Ie5318f4c872136fcb4e120d25c6370500ae6c95e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3255467 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: jesen <wangganxiang@huaqin.corp-partner.google.com> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
* hayato: Fix icm40608 will pending when gryo set offset value.Michael5 Chen12021-11-031-0/+1
| | | | | | | | | | | | | | | | | Because the configuration "icm426xx_base_gyro" miss setting "drv_data". It will cause icm40608 will pending when gyro set offset value. BUG=b:193752214 BRANCH=asurada TEST=manual 1. ectool motionsense offset 1 0 0 0 2. watch ectool motionsense => Check icm40608 sesnor. Signed-off-by: Michael5 Chen1 <michael5_chen1@pegatron.corp-partner.google.com> Change-Id: I895df941192c86a447c552f3872c9156d61bec80 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3256731 Reviewed-by: Ting Shen <phoenixshen@chromium.org> Reviewed-by: Eric Yilun Lin <yllin@google.com>
* npcx: flash: Refactor flash_get_status()Wealian Liao2021-11-031-50/+24
| | | | | | | | | | | | | | | | | | NPCX internal flash status register 1/2 always read the same time. This CL merges flash_get_status1() flash_get_status2() into 1 function. This improves the performance by eliminating duplicate mutex/tri-state/function call operations. BUG=none BRANCH=none TEST=Set status register & check it by 'flashchip' console command Signed-off-by: Wealian Liao <whliao@nuvoton.corp-partner.google.com> Change-Id: I0efe3d0c9461b5e9daae8e29115c511d5dbf90ee Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3247742 Reviewed-by: caveh jalali <caveh@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: caveh jalali <caveh@chromium.org>
* npcx: flash: Fix physical_get_protect_flags()Wealian Liao2021-11-034-6/+22
| | | | | | | | | | | | | | | | | | | | | 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>
* CEC: move mkbp event to the cec taskZhuohao Lee2021-11-031-2/+13
| | | | | | | | | | | | | | | | | | | The interrupt context can't call the function which contains the mutex. In order to fix this problem, we move the send_mkbp_event to the task level and add two events TASK_EVENT_OKAY, TASK_EVENT_FAILED to indicated the okay/failed event. BUG=b:204138787 BRANCH=None TEST=`cec-ctl --playback -S -d 0` without ec crash Change-Id: Ifae592c2161e78cd2a1be4af6e0a30b615ae9f37 Signed-off-by: Zhuohao Lee <zhuohao@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3251219 Reviewed-by: Boris Mittelberg <bmbm@google.com> Commit-Queue: Boris Mittelberg <bmbm@google.com>
* taeko: modify keyboard backlight settingamber.chen2021-11-031-8/+6
| | | | | | | | | | | | | BUG=b:204737147 BRANCH=main TEST=make -j BOARD=taeko Signed-off-by: amber.chen <amber.chen@lcfc.corp-partner.google.com> Change-Id: Idce11dd6195c3ecefc3d4dfa043080b6a274c7a2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3255474 Reviewed-by: Boris Mittelberg <bmbm@google.com> Reviewed-by: Parth Malkan <parthmalkan@google.com> Commit-Queue: Boris Mittelberg <bmbm@google.com>
* zephyr: Finish accelgyro_bmi260.c unit testsstabilize-14321.B-mainTristan Honscheid2021-11-021-1/+71
| | | | | | | | | | | | | | | Add remaining coverage to file. Test the timeout when waiting for the BMI260 chip to initialize and also handle a failed status read duirng that process BRANCH=None BUG=b:184856157 TEST=zmake configure --test zephyr/test/drivers Signed-off-by: Tristan Honscheid <honscheid@google.com> Change-Id: I6f5174e51a46070edd0ddb0267d9edf34d0d25e9 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3251920 Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* zephyr: Complete coverage for bmi_config_load() in accelgyro_bmi260.cTristan Honscheid2021-11-021-1/+34
| | | | | | | | | | | | | | | | Add a few parts to test_bmi_config_load_no_mapped_flash() that complete coverage of bmi_config_load() in accelgyro_bmi260.c Use FFF for init_rom_copy mock BRANCH=None BUG=b:184856157 TEST=zmake configure --test zephyr/test/drivers Signed-off-by: Tristan Honscheid <honscheid@google.com> Change-Id: I77975e5fb8d8661867c5274975380b5ee11e840b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3245318 Reviewed-by: Yuval Peress <peress@google.com>
* zephyr: Test unsupported chip in `bmi_config_load()`Tristan Honscheid2021-11-021-1/+32
| | | | | | | | | | | | | | | Test what occurs when we try to configure a chip that is turned off in Kconfig (BMI220). This test assumes that CONFIG_ACCELGYRO_BMI220 is NOT define BRANCH=None BUG=b:184856157 TEST=zmake configure --test zephyr/test/drivers Signed-off-by: Tristan Honscheid <honscheid@google.com> Change-Id: I4c2e821788b22d3b7142f915e610793b72cfe0ad Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3242209 Reviewed-by: Wai-Hong Tam <waihong@google.com>
* zephyr: Test accelgyro_bmi260.c init when init_rom_map returns NULLTristan Honscheid2021-11-022-1/+105
| | | | | | | | | | | | | | | | | Tests the situation where we load BMI config data when flash memory is not mapped (basically what occurs when `init_rom_map()` in `bmi_config_load()` returns NULL) Add a macro that helps inspect the argument history for an FFF fake. BRANCH=None BUG=b:184856157 TEST=zmake configure --test zephyr/test/drivers Signed-off-by: Tristan Honscheid <honscheid@google.com> Change-Id: If5e5b7cf7864f86ba3a40d06f4bea517cc854b18 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3242206 Reviewed-by: Yuval Peress <peress@google.com>
* docs/fingerprint: Update linksTom Hughes2021-11-021-3/+2
| | | | | | | | | | | | BRANCH=none BUG=none TEST=view in gitiles Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I654ecdbeb0c92961b46dcd437cd4badde08462af Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3200668 Reviewed-by: Craig Hesling <hesling@chromium.org> Reviewed-by: Josie Nordrum <josienordrum@google.com>
* zephyr: zmake: Only support one Zephyr version per projectJack Rosenthal2021-11-026-15/+10
| | | | | | | | | | | | | | | | Change the per-project config to support only one Zephyr version per project. If a project is supporting multiple versions, it can do so by registering multiple projects. BUG=b:193815337 BRANCH=none TEST=unit tests pass Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: Iee900ad359a657caa0ef85cef88c17414cabfef6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3256036 Commit-Queue: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* Homestar: Modify the BatteryParam registertongjian2021-11-021-2/+2
| | | | | | | | | | | | | | | | | The factory needs to read the battery CT number overstation, but fails to read it through Ectool BatteryParam, so the battery register needs to be modified. BRANCH=Trogdor BUG=b:201618156 TEST=make -j BOARD=homestar Verify build on SIT board Signed-off-by: tongjian <tongjian@huaqin.corp-partner.google.com> Change-Id: Ib53377d3127be9ce0bb9a93acbb6de8160f3bdae Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3195685 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Commit-Queue: Daisuke Nojiri <dnojiri@chromium.org>
* zephyr: zmake: Rename project name fieldJack Rosenthal2021-11-0224-58/+69
| | | | | | | | | | | | | | | | | | | As discussed rename the project name field to "project_name" and make it a required as a keyword argument. For tests, the name project_name makes a bit less sense, so call it test_name, automatically prepend "test-" to all tests, and allow it to be specified either as a keyword or positional argument. BUG=b:193815337 BRANCH=none TEST=unit tests pass Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: Idd1212da98382ddd9961da0fda4078595f540fc8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3256035 Commit-Queue: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* brya: enable PSYS monitoringCaveh Jalali2021-11-021-0/+1
| | | | | | | | | | | | | | This enables PSYS (system power) monitoring at the charger. BRANCH=none BUG=b:195615830 TEST=psys values reported by dump_intel_rapl_consumption look reasonable Change-Id: I5dab0346fefb154c72b4141ed109257c54191244 Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3253077 Reviewed-by: Boris Mittelberg <bmbm@google.com> Reviewed-by: Ryan Lin <ryan.lin@intel.corp-partner.google.com>
* zephyr: Add Kconfig for init_rom regionTristan Honscheid2021-11-026-10/+66
| | | | | | | | | | | | | | | Add support for setting CONFIG_CHIP_INIT_ROM_REGION in unit tests. Add FFF mocks for init_rom functions. BRANCH=None BUG=b:184856157 TEST=zmake configure --test zephyr/test/drivers Signed-off-by: Tristan Honscheid <honscheid@google.com> Change-Id: Ife649a4341381dbe2f5e10b87fa767ed14b6bc5f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3252365 Reviewed-by: Yuval Peress <peress@google.com>
* docs/fingerprint: Fix formatting with mdformatTom Hughes2021-11-021-2/+2
| | | | | | | | | | | | BRANCH=none BUG=none TEST=view in gitiles Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: Ic0d0b4a03850e7f5ec3252fbc0f42dde80c7f4a2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3202692 Reviewed-by: Craig Hesling <hesling@chromium.org> Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
* Mushu: Free up flash spaceWealian Liao2021-11-021-0/+1
| | | | | | | | | | | | | | Mushu is about 48 bytes, so free up 5600 in free flash space for it. BRANCH=None BUG=None TEST=make buildall with following CLs Signed-off-by: Wealian Liao <whliao@nuvoton.corp-partner.google.com> Change-Id: Ia7894b46abe301924376f46f14716a8e45f9a6d7 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3256723 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* Fizz: Free up flash spaceWealian Liao2021-11-021-0/+3
| | | | | | | | | | | | | | | Fizz is about 1080 bytes(1k for public key), so free up 3900 bytes in free flash space for it. BRANCH=None BUG=None TEST=make buildall with following CLs Signed-off-by: Wealian Liao <whliao@nuvoton.corp-partner.google.com> Change-Id: I25af5330e749a1b8a86b0f0b35aa1400fe599d6c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3256722 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* flash_fp_mcu: Add a config for the Brask fingerprint MCUZhuohao Lee2021-11-021-0/+5
| | | | | | | | | | | | | | | | To enable the fingerprint MCU firmware update, we add the config for the Brask. BUG=b:204679292 BRANCH=None TEST=use 'flash_fp_mcu ${BINARY_PATH}', the firmware is programmed correctly. Change-Id: Iac96d296838bf8aa75d641312a114756c9dc15f0 Signed-off-by: Zhuohao Lee <zhuohao@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3251218 Reviewed-by: YH Lin <yueherngl@chromium.org> Commit-Queue: YH Lin <yueherngl@chromium.org>
* zephyr: test: ln9310 state change on mode changeAaron Massey2021-11-021-0/+39
| | | | | | | | | | | | | Test ln9310 driver only changes power state on mode change interrupt. BRANCH=none BUG=b:184856083 TEST=zmake configure --test zephyr/test/drivers Signed-off-by: Aaron Massey <aaronmassey@google.com> Change-Id: Ie54aec6f10d47c756d74ad8b2c79793fe3962e86 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3252928 Reviewed-by: Yuval Peress <peress@google.com>
* zephyr: test: failing reg_track_ctrl for batteryAaron Massey2021-11-021-1/+12
| | | | | | | | | | | | | | | | At initialization, the ln9310 driver for chips with the 2S battery cell type access the reg_track_ctrl register to check the battery's voltage. Verify a failure to read this register is appropriately handled. BRANCH=none BUG=b:184856083 TEST=zmake configure --test zephyr/test/drivers Signed-off-by: Aaron Massey <aaronmassey@google.com> Change-Id: I2e5202795ea57fb2754e9e10adc5d89d25069eeb Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3252927 Reviewed-by: Yuval Peress <peress@google.com>
* zephyr: test: verify ln9310 update_startup failureAaron Massey2021-11-021-0/+42
| | | | | | | | | | | | | | | | When the ln9310 driver is initializing, it updates the chip startup sequence registers. Verify the driver behavior is appropriate. BRANCH=none BUG=b:184856083 TEST=zmake configure --test zephyr/test/drivers Signed-off-by: Aaron Massey <aaronmassey@google.com> Change-Id: I74af11d1658dfbd2e6d2e2d3e7e57d7103eafa79 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3252926 Reviewed-by: Yuval Peress <peress@google.com>
* zephyr: test: verify ln9310 handles explicit resetAaron Massey2021-11-021-0/+55
| | | | | | | | | | | | | | | | During startup, the ln9310 driver checks the ctrl register for zero values to detect if a reset has occurred and act accordingly. Test the driver starts up appropriately after a reset. BRANCH=none BUG=b:184856083 TEST=zmake configure --test zephyr/tests/drivers Signed-off-by: Aaron Massey <aaronmassey@google.com> Change-Id: Iaef0675eceb981b51fce58952e10332199d5cdf6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3252925 Reviewed-by: Yuval Peress <peress@google.com>
* zephyr:it8xxx2: move i2c/adc to projects folderTing Shen2021-11-024-145/+163
| | | | | | | | | | | | | | | | These items should be configured per-project BUG=b:202808130 TEST=1) zmake testall 2) zmake -D -l DEBUG configure -b zephyr/projects/corsola/krabby/ BRANCH=main Signed-off-by: Ting Shen <phoenixshen@google.com> Change-Id: Ie64273768686421245438df1e0776ff14d63aad6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3256040 Reviewed-by: Rong Chang <rongchang@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Tested-by: Ting Shen <phoenixshen@chromium.org>
* zephyr: Fix declaring the ppc_chips arrayDawid Niedzwiecki2021-11-023-3/+33
| | | | | | | | | | | | | | | | | | | DT_INST_FOREACH_STATUS_OKAY doesn't care about the order so use reg property in usbc node so we can rely on it at ppc_chip definition. It allows to reference "ppc_chip[0]" for port 0 etc. BUG=b:194432779 TEST=zmake testall BRANCH=main Signed-off-by: Dawid Niedzwiecki <dn@semihalf.com> Change-Id: I0684389881fde4e8ef3924fc2eff693e15b5c0fa Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3241463 Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Yuval Peress <peress@google.com> Reviewed-by: Wai-Hong Tam <waihong@google.com> Commit-Queue: Dawid Niedzwiecki <dawidn@google.com>
* charger: Enable hw ramp for active_chg_chipTommy Chung2021-11-021-8/+16
| | | | | | | | | | | | | | | 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>
* jinlon: Update fan table version for acousticDevin Lu2021-11-021-29/+29
| | | | | | | | | | | | | | This patch updates the fan table to improve acoustics while charging. BUG=b:195482344 BRANCH=firmware-hatch-12672.B TEST=On Jinlon. thermal team verified the fan steps worked as expected. Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Change-Id: Iab85a39836f347f748a5adc0d04bd3e5392ddcca Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3225269 Reviewed-by: Puthikorn Voravootivat <puthik@chromium.org> Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
* zephyr: zmake: Upgrade to new BUILD.py formatJack Rosenthal2021-11-0160-680/+506
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | go/zephyr-variants defines a BUILD.py format that replaces zmake.yaml. BUILD.py is inspired by Bazel build definitions, allowing for arbitrary Python code to be used as the config format. This enables defining multiple projects in a single directory, and projects to make program-specific customizations to the config definition functions. The other following changes are of note: - Projects can still be referenced by directory name, but can be referenced by the much shorter project name. For example, both of the following work equivalently: $ zmake configure -b zephyr/projects/volteer/delbin $ zmake configure -b delbin - The default build directory was changed to: build/zephyr/${name} This implements the new format, drops the old YAML+jsonschema, and migrates all our projects to the new format. BUG=b:193815337 BRANCH=none TEST=unit tests TEST=zmake testall Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: Ib1e53d9abf558063117cc3f86a5d636e69cf77fe Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3253969 Reviewed-by: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
* fpsensor: Use global fingerprint OWNERS fileTom Hughes2021-11-011-5/+1
| | | | | | | | | | | 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>
* fizz: Remove `adc` console commandAseda Aboagye2021-11-011-0/+1
| | | | | | | | | | | | | | | | | Fizz is out of space, this commit just removes the ADC console command to free up more space. BUG=None BRANCH=None TEST=`make -j BOARD=fizz` verify that build succeeds. Signed-off-by: Aseda Aboagye <aaboagye@google.com> Change-Id: I32bd2ae5a7d262bb6ca3f3e5d34b5a2a59649198 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3255706 Tested-by: Aseda Aboagye <aaboagye@chromium.org> Auto-Submit: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Diana Z <dzigterman@chromium.org>
* Zephyr: Guybrush alternate mode supportDiana Z2021-11-012-0/+5
| | | | | | | | | | | | | | | Flesh out the alternate mode support for Guybrush, which has only DP. Also set up HPD GPIOs. BRANCH=None BUG=b:195137794 TEST=on guybrush, verify display over USB-C on C0 and C1 Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I1ee85a05f34291e33484dc445e40e14381e694d2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3254892 Commit-Queue: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* Zephyr: Add HPD GPIO namesDiana Z2021-11-011-0/+2
| | | | | | | | | | | | | | Add standard names for HPD GPIO pins. BRANCH=None BUG=b:195137794 TEST=zmake testall Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I645eaf2269c7ad90ae5fdc414968d6ff894145c7 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3254891 Commit-Queue: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>