summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* board: Rename RSMRST_L_PGOOD as PG_EC_RSMRST_ODLfirmware-chameleon-14280.B-mainDivya Sasidharan2021-10-1286-73/+66
| | | | | | | | | | | | | | | | | GPIO_RSMRST_L_PGOOD is also used as GPIO_PG_EC_RSMRST_ODL creating redundancy. Removing it will help need for redefinitions for zephyr. Remove reference to GPIO_RSMRST_L_PGOOD in zephyr BUG=b:200975143 BRANCH=main TEST=make buildall -j, boot up on brya Change-Id: Iff46595174c54db347b69cff3ad9e266ba9fd535 Signed-off-by: Divya Sasidharan <divya.s.sasidharan@intel.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3180808 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* IOEX: Cleanup: Use IOEX_FLAGS_INITIALIZED flag to get the IOEX statusVijay Hiremath2021-10-1210-39/+30
| | | | | | | | | | | | | | | | | | IOEX_FLAGS_DISABLED is replaced with IOEX_FLAGS_DEFAULT_INIT_DISABLED hence use IOEX_FLAGS_INITIALIZED flag to get the initialization status of the IOEXes. BUG=none BRANCH=none TEST=Tested on Brya. 'ioexget' command works and also default init function skips IOEX initialization. Change-Id: I98ff9643223c02388a2fa679b4631e3389fd466e Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3200063 Reviewed-by: Poornima Tom <poornima.tom@intel.com> Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* zephyr: fix delbin keyboard configurationMichał Barnaś2021-10-121-0/+1
| | | | | | | | | | | | | | Delbin project file was missing col2 inverted config. BRANCH=main BUG=none TEST=Flash and check that all letters are working Change-Id: I59b91d1542987414d115bf1df6a82872850bf0ae Signed-off-by: Michał Barnaś <mb@semihalf.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3219036 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* flash_ec: update zephyr support to support flat projectsKeith Short2021-10-121-3/+10
| | | | | | | | | | | | | | | | | | | | Identify valid Zephyr projects by finding the zmake.yaml file. This correctly finds Zephyr projects, regardless of the directory layout under zephyr/projects. BUG=none BRANCH=none TEST="./util/flash_ec --board guybrush --dry_run --zephyr" identifies the EC binary as "build/zephyr/projects/guybrush/output/zephyr.bin" TEST="./util/flash_ec --board volteer --dry_run --zephyr" identifies the EC binary as "build/zephyr/projects/volteer/volteer/output/zephyr.bin" Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: Ib43aa718f41e4c73f2ad574f7a260f7a94c23dcf Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3212779 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Diana Z <dzigterman@chromium.org>
* common/console: No PROMPT if CONFIG_EXPERIMENTAL_CONSOLEJes B. Klinke2021-10-121-4/+6
| | | | | | | | | | | | | | | | | | | | The existing CONFIG_EXPERIMENTAL_CONSOLE shifts responsibility of command line editing and history away from the EC. As a part of that change, the EC should not emit the prompt character ">". It seems that every instance but one had already been enclosed in ifdef. This CL will take care of that last one, as well as make sure that PROMPT and CTRL are not defined when CONFIG_EXPERIMENTAL_CONSOLE is enabled, allowing the compiler to prevent any regressions. BUG=none BRANCH=none TEST=build servo_micro with CONFIG_EXPERIMENTAL_CONSOLE enabled Signed-off-by: Jes B. Klinke <jbk@chromium.org> Change-Id: Ifdab902cf877c7adee3d8e564cd234ffb19e317b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3213360 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
* storo: Add motion sense config for BMI220Mike Lee2021-10-123-1/+71
| | | | | | | | | | | | | | | | | | | Add BMI220 base sensor config for second source BUG=b:188373185 BRANCH=dedede TEST=Using ectool 'motionsense' verified lid angle goes from 0 to 360 and swtiches to tablet mode after crossing 200 threshold on re-work bmi220/bmi253 DUT Signed-off-by: Mike Lee <mike5@huaqin.corp-partner.google.com> Change-Id: I9e72bb898b2dbfe68e44248f0238982921c4a198 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3077596 Reviewed-by: Henry Sun <henrysun@google.com> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: jesen <wangganxiang@huaqin.corp-partner.google.com> Reviewed-by: Weimin Wu <wuweimin@huaqin.corp-partner.google.com> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
* delbin: The type-C PDO "PD_MAX_POWER_MW" change to 45WMichael5 Chen12021-10-121-2/+3
| | | | | | | | | | | | | | | | The type-C PDO "PD_MAX_POWER_MW" change to 45W from 60W. BUG=b:202754465 BRANCH=firmware-volteer-13672.B TEST=manual Check PDO using command "ectool usbpdpower". Signed-off-by: Michael5 Chen1 <michael5_chen1@pegatron.corp-partner.google.com> Change-Id: Idab8e05550a3a6e924c5cfbb10874a8f020e34a9 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3217473 Reviewed-by: Zhuohao Lee <zhuohao@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* core/cortex-m[0]: Replace calculation with variable for readabilityTom Hughes2021-10-122-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | PANIC_DATA_PTR is defined as ((struct panic_data *)CONFIG_PANIC_DATA_BASE) which is CONFIG_RAM_BASE + CONFIG_RAM_SIZE - CONFIG_PANIC_DATA_SIZE Instead of doing that calculation again, just re-use PANIC_DATA_PTR, which more clearly shows the relationship between pdata_ptr and pstack_addr. As indicated by the TEST line, this results in no change to the generated code. BRANCH=none BUG=b:172020503 TEST=./util/compare_build.sh -b all => MATCH Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I52f769b388dd47269b74d70a651868fcd6c339b5 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3213285 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* lantis: Fix LED behaviorTommy Chung2021-10-121-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | LED behaviors on lantis should be defined as following table (LEFT/RIGHT is C0/C1 port on lantis respectively). Current LED behavior when S0ix in DC/Fully charged mode behavior is "blink white 0.5s(on)/0.5s(off)", but it should be "blink white 1s(on)/1s(off)". Fix this by executing power_ticks++ once instead of twice in each tick calling in. _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ | | | | | | | DC mode | AC in RIGHT | AC in LEFT | |_ _ _ _ _|_ _ _ _ _ _ _ _ _|_ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _ _ _ _ _| | | OFF |Charging: | OFF | | | (Blink white | Amber |(Fully charged | | | 1s(on)/1s(off) | | when S0ix: | | |when battery<10%)|Fully charged: | Blink white | | | | White |1s(on)/1s(off)) | | | (Blink white | | | | | 1s(on)/1s(off) |Fully charged | | | | when S0ix) |when S0ix: | | |RIGHT LED| | Blink white | | | | |1s(on)/1s(off) | | | | | | | | | |Battery error: | | | | | Blink white | | | | |0.5s(on)/0.5s(off) | | | | | | | | | |Force idle: | | | | |(for factory) | | | | | Blink amber | | | | |1s(on)/1s(off) | | |_ _ _ _ _|_ _ _ _ _ _ _ _ _|_ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _ _ _ _ _| | | OFF | OFF |Charging: | | | (Blink white |(Fully charged | Amber | | | 1s(on)/1s(off) | when S0ix: | | | | when S0ix) | Blink white |Fully charged: | | | |1s(on)/1s(off)) | White | | | | | | | | | |Fully charged | | | | |when S0ix: | | | | | Blink white | |LEFT LED | | |1s(on)/1s(off) | | | | | | | | | |Battery error: | | | | | Blink white | | | | |0.5s(on)/0.5s(off) | | | | | | | | | |Force idle: | | | | |(for factory) | | | | | Blink amber | | | | |1s(on)/1s(off) | |_ _ _ _ _|_ _ _ _ _ _ _ _ _|_ _ _ _ _ _ _ _ _ _|_ _ _ _ _ _ _ _ _ _| BUG=none BRANCH=dedede TEST=make sure that all LEFT/RIGHT LED's behaviors correct. Signed-off-by: Tommy Chung <tommy.chung@quanta.corp-partner.google.com> Change-Id: I1ed0f621a20a19a5ac05f2f0aaa6886c8b227f59 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3211325 Reviewed-by: Diana Z <dzigterman@chromium.org> Reviewed-by: Devin Lu <Devin.Lu@quantatw.com> Commit-Queue: Diana Z <dzigterman@chromium.org>
* pazquel: Support battery protection for low voltage chargeTang Qijun2021-10-121-0/+1
| | | | | | | | | | | | | | | | | | Battery voltage is lower than voltage_min, precharge voltage & current are supplied and charging will be disabled after CONFIG_BATTERY_LOW_VOLTAGE_TIMEOUT seconds BRANCH=trogdor BUG=b:198226241 TEST=Keep the battery voltage below 6V and charge it for more than 30 minutes. The system stops the charging function and the charging current is zero. Signed-off-by: Tang Qijun <qijun.tang@ecs.corp-partner.google.com> Change-Id: I6c272a867c8b28b82cdac6dc3d48dfc39e46f906 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3160242 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Commit-Queue: Philip Chen <philipchen@chromium.org>
* zephyr: add TCPCI emulatorTomasz Michalec2021-10-127-1/+1422
| | | | | | | | | | | | | | | | | | | | | Add TCPCI emulator. It follows TCPCI specification revision 2.0 version 1.2, but allows access to TX and RX buffer registers in revision 1.0 style if configured to do so. It can be extended by device specific operations (to implement specific TCPC device behaviour) and partner operations to emulate scenarios with different devices connected on other side of TCPC. BUG=b:184857030 BRANCH=none TEST=make configure --test zephyr/test/drivers Signed-off-by: Tomasz Michalec <tm@semihalf.com> Change-Id: I6305c437d820528de24439337211f32a015e83d1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3181722 Tested-by: Tomasz Michalec <tmichalec@google.com> Commit-Queue: Tomasz Michalec <tmichalec@google.com> Reviewed-by: Yuval Peress <peress@google.com> Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* anahera: Set rpm deviation to 1%Devin Lu2021-10-121-0/+1
| | | | | | | | | | | | | | | | | Currently rpm deviation is 7%, it is too large to cause fan rpm between actual and target is not accurate. This patch set lower rpm deviation to 1%. BUG=b:199246802 BRANCH=none TEST=run ectool pwmsetfanrpm 4000 ~ 4500 rpm. make sure fan actual rpm is accurate. Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Change-Id: I44562ea6946e2eaea3fd3cde5de28f7a45526f60 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3197901 Reviewed-by: caveh jalali <caveh@chromium.org> Commit-Queue: caveh jalali <caveh@chromium.org>
* anahera: Update fan table version 1Devin Lu2021-10-123-0/+150
| | | | | | | | | | | | | | This patch adds a custom fan table which is controlled by EC. BUG=b:199246802 BRANCH=none TEST=Thermal team verified thermal policy is expected. Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Change-Id: I51f4496e044061ceedab8f7a401db32a79a34ffd Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3197900 Reviewed-by: caveh jalali <caveh@chromium.org> Commit-Queue: caveh jalali <caveh@chromium.org>
* cherry: enable EFS2Ting Shen2021-10-122-1/+8
| | | | | | | | | | | | | BUG=b:185726892 BRANCH=main TEST=Verify EFS2 works, see CL:3207813 Signed-off-by: Ting Shen <phoenixshen@google.com> Change-Id: I1e95cd1532abdcb097e4a81d30742dd08f77c46d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2845562 Reviewed-by: Eric Yilun Lin <yllin@google.com> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Tested-by: Ting Shen <phoenixshen@chromium.org>
* power/mt8192: set correct initial power state for EFS2Ting Shen2021-10-121-1/+2
| | | | | | | | | | | | | | | | | | | | | In EFS2, the boot flow happens in RW, so we should not set power state to S0 by default. BUG=b:185726892 TEST=1. Verify AP bootable and able to update EC-RW in following scenarios: a. old RW b. corrupted (not-bootable) RW 2. DISABLE_EC_SOFTWARE_SYNC vboot flag works. 3. manual sysjump won't reboot AP. BRANCH=main Signed-off-by: Ting Shen <phoenixshen@google.com> Change-Id: Ic088a1ccf80fc49424cc1eeb3ff7b946836e5b68 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3207813 Reviewed-by: Eric Yilun Lin <yllin@google.com> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Tested-by: Ting Shen <phoenixshen@chromium.org>
* zmake: fail gracefully if missing SDKPeter Marheine2021-10-122-1/+13
| | | | | | | | | | | | | | | | | | The documentation didn't comment on the need to install a Zephyr SDK package when working outside the chroot, and didn't provide any useful output if one was missing (just failing with an assertion). Add mention of the SDK to the documentation and fail with a more useful message if it's missing and requested. BUG=None TEST=Useful message is shown if SDK is missing BRANCH=None Change-Id: I05fee5294c27197d62b3f726cdd5579571ce9e1b Signed-off-by: Peter Marheine <pmarheine@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3216964 Reviewed-by: Andrew McRae <amcrae@google.com> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* Terrador: Free up flash spaceDiana Z2021-10-121-0/+3
| | | | | | | | | | | | | | | Terrador is nearly out of flash space, so remove the PRL debug strings from its build. BRANCH=None BUG=None TEST=make -j buildall Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: Ieeda2cbf3772f3218cccfe530a2cf3c8f12a0b99 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3218368 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* Trondo: Reduce flash usageDiana Z2021-10-121-0/+1
| | | | | | | | | | | | | | | Trondo is nearly out of space on ToT, so reduce its flash usage by removing help strings. BRANCH=None BUG=None TEST=make -j buildall Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I27179daae41f484afa7d342b18cf8bea0e88dc37 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3218367 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* honeybuns: Enable CONFIG_USB_MS_EXTENDED_COMPAT_ID_DESCRIPTORScott Collyer2021-10-111-0/+1
| | | | | | | | | | | | | | | | | This CL enables Extended Compat ID descriptor feature for USB-EP to make sure that Windows host machines will load a valid USB driver. BRANCH=None BUG=b:196174088 TEST=Verfied on Baklava that there is no yellow exclamation warning when connected to a Windows OS host machine. Signed-off-by: Scott Collyer <scollyer@google.com> Change-Id: I912dc35f75a673e5e71408b89d653b389ba29d6b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3165882 Commit-Queue: Scott Collyer <scollyer@chromium.org> Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* zephyr: shim: clean up pwm_leds pwms declarationFabio Baltieri2021-10-112-8/+2
| | | | | | | | | | | | | | | Declare the pwm phandles inline, more compact and fixes a style issue (phandle is normally closed with the last element). BRANCH=none BUG=none TEST=build only, no functional changes Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Change-Id: I0323fe8cedd41e35ff80644b77f1f69b78cb9d83 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3217096 Commit-Queue: Abe Levkoy <alevkoy@chromium.org> Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* core: Fix flash size calculation when linking with lld (clang)Tom Hughes2021-10-116-14/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The map file generated by lld has a different format than the gnu linker (ld). (We save this map file into build/<board>/<image>/ec.<image>.map during the build.) Instead of trying to parse the different formats in the .map file, use the .smap file (the output of "nm"), which has the values of the symbols and has the same format whether using lld or ld. We need to add a new "__flash_size" symbol so that we can use that symbol to get the size from the .smap. This add flash sizes to a few boards that previously didn't have it: asurada_scp, cherry_scp, and kukui_scp, since the previous logic was always looking for FLASH and these use IROM. BRANCH=none BUG=b:172020503 TEST=make buildall -j TEST=make CC=arm-none-eabi-clang BOARD=elemi TEST=bcompare build_before_change build_after_change => only difference between space_free_flash.txt and space_free_ram.txt files in the two builds is that this change adds the space_free_flash.txt files for asurada_scp, cherry_scp, and kukui_scp. Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I7c64b6ba9bceeeb4044559188c1c1bebbf60471d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3179314 Reviewed-by: Keith Short <keithshort@chromium.org>
* tree: Use correct enum when calling button_disable_gpioTom Hughes2021-10-115-5/+5
| | | | | | | | | | | | | | | | | | | | | When building with clang, it warns: board/puff/board.c:484:23: error: implicit conversion from enumeration type 'enum gpio_signal' to different enumeration type 'enum button' [-Werror,-Wenum-conversion] button_disable_gpio(GPIO_EC_RECOVERY_BTN_ODL); button_disable_gpio() takes an "enum button", not "enum gpio_signal". BRANCH=none BUG=b:172020503 TEST=make CC=arm-none-eabi-clang BOARD=puff Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: Ic8347e4d6cda0fde824c9edf1979f7f5197e3db4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3213110 Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Andrew McRae <amcrae@google.com>
* anahera: Initialize the vivaldi keyboardDevin Lu2021-10-111-6/+53
| | | | | | | | | | | | | | | | | | | Anahera has 4 type keyboard layouts. 1. privacy screen + non-keyboard-backlight keyboard layout. 2. privacy screen + keyboard-backlight keyboard layout. 3. no-privacy screen + non-keyboard-backlight keyboard layout. 4. no-privacy screen + keyboard-backlight keyboard layout. BUG=b:199081586 BRANCH=none TEST=evtest, make sure the keycode is correct for each type. Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Change-Id: I89c25f51bb3f4de0c87e4100494e879179c300ee Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3211167 Reviewed-by: Zick Wei <zick.wei@quanta.corp-partner.google.com> Reviewed-by: Boris Mittelberg <bmbm@google.com> Commit-Queue: Boris Mittelberg <bmbm@google.com>
* anahera: Update FW_CONFIG fieldDevin Lu2021-10-112-14/+28
| | | | | | | | | | | | | | | This patch updated the FW_CONFIG field for Anahera. BUG=b:197169349 BRANCH=none TEST=make BOARD=anahera Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Change-Id: I097821f39d8c52bf2eaf606dc444de04f4bc519b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3211166 Reviewed-by: Zick Wei <zick.wei@quanta.corp-partner.google.com> Reviewed-by: Boris Mittelberg <bmbm@google.com> Commit-Queue: Boris Mittelberg <bmbm@google.com>
* zephyr: test: Add syv682x test using syv682cYuval Peress2021-10-113-0/+27
| | | | | | | | | | | | | | Add Herobrine specific test for syv682c BRANCH=none BUG=b:202727833 TEST=zmake configure --test zephyr/test/drivers Signed-off-by: Yuval Peress <peress@google.com> Change-Id: I79642f4e6d6d70964f1ac601a16220c07a3cb46a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3216415 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org>
* Guybrush: Enable switch memory mapDiana Z2021-10-111-1/+0
| | | | | | | | | | | | | | | Enable CONFIG_PLATFORM_EC_SWITCH so the OS can read our lid switch correctly. BRANCH=None BUG=b:195137794 TEST=on guybrush, load zephyr and observe the OS stays booted!!! Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I229a669f4460f31c989274b3f6bacf07dbbb17de Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3216416 Commit-Queue: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* zephyr drivers: Test chip revision register access failureAaron Massey2021-10-111-0/+32
| | | | | | | | | | | | | | | | | | Tests ln9310_init does not initialize or power up when the chip revision register read is intercepted and failed. read is intercepted and failed BRANCH=None BUG=b:184856083 TEST=zmake configure --test zephyr/test/drivers Signed-off-by: Aaron Massey <aaronmassey@chromium.org> Change-Id: I076bc151e1a847307500bfa90ee4355c5d5f0101 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3205933 Commit-Queue: Aaron Massey <aaronmassey@google.com> Tested-by: Aaron Massey <aaronmassey@google.com> Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Yuval Peress <peress@google.com>
* zephyr: drivers: ln9310 make software_enable doc more explicitAaron Massey2021-10-111-4/+5
| | | | | | | | | | | | | | | | | | Updates documentation in ln9310_software_enable() to explicitly state it contains an alternative startup sequence that is required by older chip versions in addition to normal startup. BRANCH=none BUG=b:184856083 TEST=zmake configure --test zephyr/test/drivers Signed-off-by: Aaron Massey <aaronmassey@chromium.org> Change-Id: I976d2f35b1e392bc584cbd7e13ab34421846f679 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3200519 Commit-Queue: Aaron Massey <aaronmassey@google.com> Tested-by: Aaron Massey <aaronmassey@google.com> Reviewed-by: Yuval Peress <peress@google.com> Reviewed-by: Wai-Hong Tam <waihong@google.com>
* zephyr: test: ln9310 test cfly_precharge workaroundAaron Massey2021-10-112-14/+156
| | | | | | | | | | | | | | | | | Add emulator registers and unit tests for LN9310 cfly precharge workaround required for older chip versions. BRANCH=none BUG=b:184856083 TEST=zmake configure --test zephyr/test/drivers Signed-off-by: Aaron Massey <aaronmassey@chromium.org> Cq-Depend: chromium:3213616 Change-Id: I1e63313b496475fbcc7286ba0cc89c614bd16a0a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3197935 Commit-Queue: Aaron Massey <aaronmassey@google.com> Tested-by: Aaron Massey <aaronmassey@google.com> Reviewed-by: Yuval Peress <peress@google.com>
* zephyr test: ln9310 emulator exposes i2c_emul structAaron Massey2021-10-112-1/+17
| | | | | | | | | | | | | | | | In order to test driver failure paths, the ln9310 emulator now exposes its i2c_emul to be manipulated by unit tests. BRANCH=none BUG=b:184856083 TEST=zmake configure --test zephyr/test/drivers Signed-off-by: Aaron Massey <aaronmassey@chromium.org> Change-Id: I2fadec0cd8e4c1d897b38f0d0024a49b50cbf5d9 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3205932 Commit-Queue: Aaron Massey <aaronmassey@google.com> Tested-by: Aaron Massey <aaronmassey@google.com> Reviewed-by: Yuval Peress <peress@google.com>
* zephyr: test: ln9310 fix emulator and newer chip powers_up testsAaron Massey2021-10-112-6/+8
| | | | | | | | | | | | | | | | | | | | | | Due to a misunderstanding of the ln9310 software_enable function doc, we were mistakenly testing that calling the ln9310_software_enable was unnecessary to power up new versions of the chip. This commit fixes the ln9310 emulator and driver tests to require the ln9310_software_enable function in to power up the ln9310. BRANCH=none BUG=b:184856083 TEST=zmake configure --test zephyr/test/drivers Signed-off-by: Aaron Massey <aaronmassey@chromium.org> Cq-Depend: chromium:3200519 Change-Id: I5c5ddcc46342203298655342cc8b1365263d4f3b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3202697 Commit-Queue: Aaron Massey <aaronmassey@google.com> Tested-by: Aaron Massey <aaronmassey@google.com> Reviewed-by: Yuval Peress <peress@google.com>
* zephyr: test: add an emulated clock to drivers testYuval Peress2021-10-117-1/+241
| | | | | | | | | | | BRANCH=none BUG=b:180112248 TEST=zmake configure --test zephyr/test/drivers Signed-off-by: Yuval Peress <peress@google.com> Change-Id: I4a6561c58c7fab33a66ec8fd4a34da38ace6a45c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3213364 Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* zephyr: optimize I2C mutexesDawid Niedzwiecki2021-10-113-15/+42
| | | | | | | | | | | | | | | | | | | | | | | | | I2C_PORT_COUNT is bigger than the actual physical I2C number in Zephyr. Since the access to I2C has to be controlled per physical port, limit the size of the port_mutex array. Introduce the I2C_DEVICE_COUNT define to represent the number of the physical I2C ports. It is not possible to automate it fully with the current devicetree macros. A new I2C_COPMAT defines will have to be introduced for new chips. The general assumption is that there is only one type of I2C port per chip pointed by the compatible property e.g. "nuvoton,npcx-i2c-port". BUG=b:199918263 BRANCH=none TEST=zmake testall; Make sure there is no "Access I2C without lock!" message in console. Signed-off-by: Dawid Niedzwiecki <dn@semihalf.com> Change-Id: Ie7b0570eb5629ebd4adabc8a47d0d802d847a773 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3211976 Tested-by: Dawid Niedźwiecki <dn@semihalf.com> Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Dawid Niedzwiecki <dawidn@google.com>
* taeko/taeland: Dynamic motion sensor countreno.wang2021-10-082-23/+38
| | | | | | | | | | | | | | | | | | 1. All board supports tablet mode if board id > 0 2. No mockup unit to tune orientation matrix. So, disable it until we get mockup unit. Tracking b/201504044. BUG=b:194765820 BRANCH=None TEST=make -j BOARD=taeko Signed-off-by: reno.wang <reno.wang@lcfc.corp-partner.google.com> Change-Id: I77f414d6d22b49c3cf12f00e261016fa9534ea86 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3192742 Reviewed-by: Boris Mittelberg <bmbm@google.com> Reviewed-by: Parth Malkan <parthmalkan@google.com> Commit-Queue: caveh jalali <caveh@chromium.org> Tested-by: Parth Malkan <parthmalkan@google.com>
* taeko/taeland: update fw config structurereno.wang2021-10-082-14/+37
| | | | | | | | | | | | | | | 1. Update fw config structure 2. Define the default fw config setting for early board BUG=b:194515356 BRANCH=None TEST=make -j BOARD=taeko Signed-off-by: reno.wang <reno.wang@lcfc.corp-partner.google.com> Change-Id: Idff6bae79ec5206e47710352ac1d2da56c933884 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3192741 Reviewed-by: Boris Mittelberg <bmbm@google.com> Commit-Queue: caveh jalali <caveh@chromium.org>
* intelrvp: Treat 2nd reset from H1 as Power-OnVijay Hiremath2021-10-081-0/+2
| | | | | | | | | | | | | | | | | | | on Intel RVP, H-1 resets twice upon fresh boot hence EC sees two resets. This blocks dead battery boot as TCPM treats reset as error recovery and tries TCPC in CC open state. To avoid this issue enabled CONFIG_BOARD_RESET_AFTER_POWER_ON config so that TCPM starts as TC_UNATTACHED_SNK state. BUG=none BRANCH=none TEST=Dead battery boot on ADLRVP works Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com> Change-Id: I6ccf0be4ab6dfcd7557c3228180c1df6bc640ee3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3214773 Reviewed-by: Tanu Malhotra <tanu.malhotra@intel.com> Reviewed-by: caveh jalali <caveh@chromium.org> Commit-Queue: caveh jalali <caveh@chromium.org>
* motion_sense: Fix Fix ap_event_interval calculationGwendal Grignou2021-10-081-1/+1
| | | | | | | | | | | | | | | | Improve precision of the new_rate_us calculation. Fixes: motion_sense: Fix ap_event_interval calculation ("5155d9c7bfc42aa3f53572e0389a8180d7f3a366") BUG=b:195264765,b:129159505,b:73557414 BRANCH=many. TEST=compile Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Change-Id: I4b3d54dedceca5652004da14f32dac6ae98747fa Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3200808 Reviewed-by: Rob Barnes <robbarnes@google.com> Reviewed-by: Diana Z <dzigterman@chromium.org>
* zephyr test: Fix typoAbe Levkoy2021-10-081-1/+1
| | | | | | | | | | | | | | Fix assertion failure message for OVP. BUG=none TEST=zmake configure --test zephyr/test/drivers BRANCH=none Signed-off-by: Abe Levkoy <alevkoy@chromium.org> Change-Id: I93da6d968862974a9b7d7951204833f3bf518c2f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3214775 Commit-Queue: Yuval Peress <peress@google.com> Reviewed-by: Yuval Peress <peress@google.com>
* core/cortex-m: Disable warning in vecttable.c when building with clangTom Hughes2021-10-082-0/+29
| | | | | | | | | | | | | | | See the description in commit c1cc2d919e9f21adc0f992dcac00f6e8b282616d. These files copied the same logic. BRANCH=none BUG=b:172020503 TEST=make buildall TEST=CC=arm-none-eabi-clang make BOARD=servo_micro Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I1d59b3a7eb6e71451313d70fe421880a08dad4b0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3183392 Reviewed-by: Ting Shen <phoenixshen@chromium.org>
* Guybrush: Enable FRSDiana Z2021-10-081-0/+1
| | | | | | | | | | | | | Enable FRS for the guybrush family of boards. BRANCH=None BUG=b:183586640 TEST=tested FRS with the entire dongle pile, GRL testing passed Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I5022914f270c35ceae9c79f0b29df7122af0f2d8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2989629 Reviewed-by: Rob Barnes <robbarnes@google.com>
* chip/stm32: Proper declarations for USB clock and SRAM on L5Jes B. Klinke2021-10-083-122/+178
| | | | | | | | | | | | | | | The STM32L5 series has a few more flags to control power and clock to the USB block. Add code to enable all of them from clock_enable_module(). BUG=b:192262089 TEST=Compile with hyperdebug board (from later in the chain) BRANCH=none Signed-off-by: Jes Bodi Klinke <jbk@chromium.org> Change-Id: Idd9f31bcb9461686c401f8bdcb306e61858a9966 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3133815 Reviewed-by: Scott Collyer <scollyer@chromium.org>
* zephyr: test: drivers: enable configs for better debuggingYuval Peress2021-10-081-0/+9
| | | | | | | | | | | | | | | Some common debugging flags that helped in finding an issue with a concurrent task interfering with zmock assertions. BRANCH=none BUG=none TEST=zmake configure --test zephyr/test/drivers Signed-off-by: Yuval Peress <peress@google.com> Change-Id: I40b08f976497af5062a99bead5d5f4c6ff0cb56c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3213615 Reviewed-by: Aaron Massey <aaronmassey@google.com> Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* volteer: disable console commands to save spaceKeith Short2021-10-081-0/+3
| | | | | | | | | | | | | | | | | | | Disable adc, battfake, and cbi console commands to save space on Volteer. With this change: volteer_apmodeentry: 2208 bytes flash available volteer: 2272 bytes flash available BUG=b:202460235 BRANCH=none TEST=make volteer, make volteer_apmodeentry Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I1192cc1db797c2eba10268fc10f18710af99f91f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3213361 Commit-Queue: Diana Z <dzigterman@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org>
* zephyr: emul: ln9310 Also check min switching frequency for is_initAaron Massey2021-10-081-1/+5
| | | | | | | | | | | | | | | | | | | Due to the default value of of the int1_msk_reg being zero, we should also check that the minimum frequency register was set by the driver. This change is necessary for soon following failure path tests. BRANCH=none BUG=b:184856083 TEST=zmake configure --test zephyr/test/drivers Signed-off-by: Aaron Massey <aaronmassey@chromium.org> Cq-Depend: chromium:3213616 Change-Id: I1f202b7bb324d5b4f7aba4c46bdd0c61d55113f5 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3203931 Commit-Queue: Aaron Massey <aaronmassey@google.com> Tested-by: Aaron Massey <aaronmassey@google.com> Reviewed-by: Yuval Peress <peress@google.com>
* zephyr: test: usb_mux: Disable PD task during testingYuval Peress2021-10-083-0/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A bug that was uncovered during crrev/c/3197935/8 where an extra sleep was needed in an unrelated test would cause usb_mux test to fail if removed. ROOT CAUSE: The PD task would make a call to (struct usb_mux_driver)::set as a result to some stimulous. Normally during the test's run, this didn't coincide with the usb_mux test suite so it didn't matter. The addition of another test forced the threading overlap. When set() was called, the assert would fail since the specific test wasn't expecting the call. FIX: Add logic to task.h to get the Zephyr TID from a given cros TASK_ID_*. This function is used in the ztest setup/teardown methods of the usb_mux test suite to turn on/off the PD tasks so that this race condition is avoided. BRANCH=none BUG=none TEST=zmake configure --test zephyr/test/drivers Signed-off-by: Yuval Peress <peress@google.com> Change-Id: I25adf0663fb89cd52a8677192e720932f0253626 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3213616 Commit-Queue: Aaron Massey <aaronmassey@google.com> Tested-by: Aaron Massey <aaronmassey@google.com> Reviewed-by: Tomasz Michalec <tmichalec@google.com> Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* zephyr: shim: handle sidesel in the shim fileFabio Baltieri2021-10-085-6/+51
| | | | | | | | | | | | | | | | | | | | | This adds handling for the sidesel channel from the shim driver, if the sidesel node is specified. With this, all the pwm-led combinations should be manageable from the shim driver, so this also removes the conditionals from volteer driver and drops it from the Zephyr build entirely. BRANCH=none BUG=b:177452529 TEST=build and run on volteer TEST=checked the binary output if node not defined Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Change-Id: Id215d26a8b14330b9604c7385d6ce436ef1a60cd Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3207995 Commit-Queue: Keith Short <keithshort@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* zephyr: shim: set supported_led_ids from the device treeFabio Baltieri2021-10-082-2/+13
| | | | | | | | | | | | | | | | | This populates supported_led_ids from the device tree pwm-leds child nodes, adds a validation to make sure that the leds device phandle count matches the number of led child nodes. BRANCH=none BUG=b:177452529 TEST=checked the static structures on the built binary Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Change-Id: Id8e35ce08b94dafaea34e340914eecd602e2f1ac Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3207994 Commit-Queue: Keith Short <keithshort@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* board/sasuke: Fix cast to incorrect typeTom Hughes2021-10-081-1/+1
| | | | | | | | | | | | | | | | | | When building with clang, it warns: board/sasuke/cbi_ssfc.c:40:9: error: implicit conversion from enumeration type 'enum ec_ssfc_lid_sensor' to different enumeration type 'enum ec_ssfc_usb_ss_mux' [-Werror,-Wenum-conversion] return (enum ec_ssfc_lid_sensor) cached_ssfc.usb_ss_mux; BRANCH=none BUG=b:172020503 TEST=make CC=arm-none-eabi-clang BOARD=sasuke Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: Icab0e7d7550ed5a3119ec4c5dc3d904137abe341 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3213109 Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* board/primus: Fix enum typeTom Hughes2021-10-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When building with clang, it warns: board/primus/usbc_config.c:138:16: error: implicit conversion from enumeration type 'enum gpio_signal' to different enumeration type 'enum ioex_signal' [-Werror,-Wenum-conversion] rst_signal = GPIO_USB_C0_RT_RST_ODL; ~ ^~~~~~~~~~~~~~~~~~~~~~ board/primus/usbc_config.c:140:16: error: implicit conversion from enumeration type 'enum gpio_signal' to different enumeration type 'enum ioex_signal' [-Werror,-Wenum-conversion] rst_signal = GPIO_USB_C1_RT_RST_ODL; ~ ^~~~~~~~~~~~~~~~~~~~~~ board/primus/usbc_config.c:157:18: error: implicit conversion from enumeration type 'enum ioex_signal' to different enumeration type 'enum gpio_signal' [-Werror,-Wenum-conversion] gpio_set_level(rst_signal, 1); ~~~~~~~~~~~~~~ ^~~~~~~~~~ board/primus/usbc_config.c:167:18: error: implicit conversion from enumeration type 'enum ioex_signal' to different enumeration type 'enum gpio_signal' [-Werror,-Wenum-conversion] gpio_set_level(rst_signal, 0); ~~~~~~~~~~~~~~ ^~~~~~~~~~ BRANCH=none BUG=b:172020503 TEST=make CC=arm-none-eabi-clang BOARD=primus TEST=./util/compare_build.sh -b primus => MATCH Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I6ed40493cdce6f972300f4b9c7f49f136c6a0026 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3213108 Reviewed-by: caveh jalali <caveh@chromium.org> Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* board/rammus: Fix enum typeTom Hughes2021-10-081-1/+1
| | | | | | | | | | | | | | | | | | | | When building with clang, it warns: ard/rammus/led.c:160:23: error: implicit conversion from enumeration type 'enum ec_led_state' to different enumeration type 'enum led_charge_state' [-Werror,-Wenum-conversion] config_battery_led(LED_STATE_OFF); BRANCH=none BUG=b:172020503 TEST=make CC=arm-none-eabi-clang BOARD=rammus TEST=./util/compare_build.sh -b rammus => MATCH Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I68850029e872702dafed661b908bb8d5986a5daf Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3213107 Reviewed-by: Edward Hill <ecgh@chromium.org>