summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* cherry: disable customized usb_a port power for Cherrystabilize-ambassador-14268.43.B-mainstabilize-14268.67.B-mainstabilize-14268.52.B-mainstabilize-14268.51.B-mainrelease-R96-14268.B-mainTing Shen2021-10-071-0/+2
| | | | | | | | | | | | | | | | | | Old Cherry board does not have AP_XHCI_INIT_DONE pin to trigger the interrupt. Use the default hooks in usb_port_power_dumb instead. BUG=b:201238487 TEST=Verify usb to ethernet dongle works BRANCH=main Signed-off-by: Ting Shen <phoenixshen@google.com> Change-Id: Ifca76c2f029f322fdafe28a36a2bd596d4cb1574 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3204565 Tested-by: Ting Shen <phoenixshen@chromium.org> Auto-Submit: Ting Shen <phoenixshen@chromium.org> Reviewed-by: Rong Chang <rongchang@chromium.org> Commit-Queue: Rong Chang <rongchang@chromium.org>
* anahera: Update fan real rpmDevin Lu2021-10-071-5/+3
| | | | | | | | | | | | BUG=b:201711666 BRANCH=none TEST=make BOARD=anahera Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Change-Id: I88336fe1d4abd37d3669cf6944feb32fdcb8c7da Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3197899 Reviewed-by: caveh jalali <caveh@chromium.org> Commit-Queue: caveh jalali <caveh@chromium.org>
* anahera: Correct thermal sensor nameDevin Lu2021-10-072-13/+13
| | | | | | | | | | | | | | | | | | | | This patch corrects the ADC0 channel thermistor name to FAN which is closed to FAN. BUG=b:199246802 BRANCH=none TEST=EC console "temps" on Anahera. 21-10-01 11:38:55.054 Fan : 320 K = 47 C 80% 21-10-01 11:38:55.057 SOC : 318 K = 45 C 66% 21-10-01 11:38:55.061 Charger : 328 K = 55 C 100% 21-10-01 11:38:55.066 Regulator : 309 K = 36 C 0% Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Change-Id: I3b8cdc14f509af83ea19588823f06b23454afd9a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3197898 Reviewed-by: caveh jalali <caveh@chromium.org> Commit-Queue: caveh jalali <caveh@chromium.org>
* dooly: update setting to prevent power leakageZick Wei2021-10-072-2/+18
| | | | | | | | | | | | | | | | We found a power leakage in G3 caused by EC_EDID_WP_DISABLE_L, this patch updates gpio status to prevent power leakage. BUG=b:200710471, b:202309235 BRANCH=puff TEST=verify EC_EDID_WP_DISABLE_L status in G3 and S0. Signed-off-by: Zick Wei <zick.wei@quanta.corp-partner.google.com> Change-Id: Ic1a01306a6ee43360dbd5041a9ead95802efae58 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3207766 Reviewed-by: Andrew McRae <amcrae@google.com> Reviewed-by: Devin Lu <Devin.Lu@quantatw.com> Commit-Queue: Andrew McRae <amcrae@google.com>
* driver: bma4xx: Correct implementation for get offsetChen-Tsung Hsieh2021-10-071-1/+1
| | | | | | | | | | | | | | | | | | Before writing the offset to the BMA sensor, if it is less than 0, we will add 256 to it. So after reading the offset, we should subtract 256 from it instead of -256. BRANCH=none BUG=b:201238498, b:192409667 TEST=run 'ectool motionsense offset 2 19 0 0' on Tomato Change-Id: I26e2e714a529347c2cdb6b051c1423b379ad5c0d Signed-off-by: Chen-Tsung Hsieh <chentsung@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3205437 Reviewed-by: Ting Shen <phoenixshen@chromium.org> Reviewed-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-by: Bhanu Prakash Maiya <bhanumaiya@google.com> Commit-Queue: Li-jen Chen <lijen@google.com>
* bugzzy : set VSN/VSP/VBSTYongBeum.Ha2021-10-074-6/+44
| | | | | | | | | | | | | | | | change VBST to 5.65V change VSN/VSP to 5.5V BUG=b:198072674 BRANCH=None TEST=make -j BOARD=bugzzy Signed-off-by: YongBeum.Ha <ybha@samsung.corp-partner.google.com> Change-Id: I108914d5a6171034047101d95eafb997b5a2abd4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3207767 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
* byra: Enable I2C_CONTROL host commandCaveh Jalali2021-10-071-0/+3
| | | | | | | | | | | | | BRANCH=none BUG=b:196931917 TEST=with follow-on patches, switched I2C bus speed between 400 kHz and 1 MHz. Change-Id: I743ec93274e2566298f9f4712f5ad3aa580b840c Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3181511 Reviewed-by: Boris Mittelberg <bmbm@google.com> Commit-Queue: Boris Mittelberg <bmbm@google.com>
* quackingstick: Initial EC imageSue Chen2021-10-079-0/+1535
| | | | | | | | | | | | | | | | | | | Copy the Coachz reference board EC files into a new directory named for the quakingstick variant. Update the gpio definition for quackingstick and remove unused function. BUG=b:201263032 BRANCH=none TEST=none Signed-off-by: Sue Chen <sue.chen@quanta.corp-partner.google.com> Change-Id: I3769bd0c562e2d07083b90ce4c8d474c6c487c34 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3205430 Commit-Queue: Bob Moragues <moragues@chromium.org> Reviewed-by: Wai-Hong Tam <waihong@google.com> Reviewed-by: Bob Moragues <moragues@chromium.org> Tested-by: Bob Moragues <moragues@chromium.org>
* PS8xxx: Move the delay before Vconn shutdown to PS8xxx driverWai-Hong Tam2021-10-072-10/+15
| | | | | | | | | | | | | | | | | | This workaround is PS8xxx chip specific. Move it from the general TCPCI driver to the PS8xxx driver. BRANCH=Trogdor BUG=b:185202064, b:183586640 TEST=Verified the dock detection: * Insert the dock to the Type-C port and shutdown the device; * Press powerbutton to power on the device; * Use lsusb command, list can not find the dock information; * The dock can be found. Change-Id: I33b4d0649c534735cf20e38831757449dd03ff27 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3209650 Reviewed-by: Diana Z <dzigterman@chromium.org>
* zephyr: Add test for `st_normalize()`Tristan Honscheid2021-10-061-1/+67
| | | | | | | | | | | | | | Add a unit test for `st_normalize()` BUG=b:200589041 BRANCH=None TEST=zmake configure --test zephyr/test/drivers Signed-off-by: Tristan Honscheid <honscheid@google.com> Change-Id: Id8ddb0960aa111ec8ca08ca9af46b7c23d522cbb Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3203594 Reviewed-by: Yuval Peress <peress@google.com> Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* zephyr: Add tests for `st_set_offset()` and `st_get_offset()`Tristan Honscheid2021-10-061-0/+58
| | | | | | | | | | | | | Add tests for `st_set_offset()` and `st_get_offset()`. BUG=b:200589041 BRANCH=None TEST=zmake configure --test zephyr/test/drivers Signed-off-by: Tristan Honscheid <honscheid@google.com> Change-Id: I63f7ab11caac8731a34349c7fa23abac6603ac45 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3203593 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* zephyr: Add tests for `st_get_resolution()` and `st_get_data_rate()`Tristan Honscheid2021-10-061-1/+41
| | | | | | | | | | | | | Add unit tests for `st_get_resolution()` and `st_get_data_rate()`. BUG=b:200589041 BRANCH=None TEST=zmake configure --test zephyr/test/drivers Signed-off-by: Tristan Honscheid <honscheid@google.com> Change-Id: I3d6ff3b10d028f137764350db58b444f5a645b6f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3203592 Reviewed-by: Keith Short <keithshort@chromium.org>
* main: Add count in charge_state enumstabilize-14267.B-mainParth Malkan2021-10-061-1/+3
| | | | | | | | | | | BUG=none BRANCH=none TEST=make buildall -j Change-Id: I6b1cd6968f38eeb96198153a124b11affea2b0a2 Signed-off-by: Parth Malkan <parthmalkan@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3205483 Reviewed-by: Wai-Hong Tam <waihong@google.com>
* zephyr: npcx: Update flash driver to use reg sizeYuval Peress2021-10-063-7/+2
| | | | | | | | | | | | | | | | The `size` field of the cros flash driver was from the days of old where we weren't too familiar with DT_ options. Consolidate the binding to make use of the register's size. BRANCH=none BUG=b:202295086 TEST=zmake testall Signed-off-by: Yuval Peress <peress@google.com> Change-Id: I86c312c0d7e7dc798833b47df333cb2499062aaf Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3208912 Reviewed-by: Wai-Hong Tam <waihong@google.com> Commit-Queue: Wai-Hong Tam <waihong@google.com>
* tree: Remove CONFIG_RO_HEAD_ROOM and CONFIG_RW_HEAD_ROOMTom Hughes2021-10-064-20/+0
| | | | | | | | | | | | | | | | | CONFIG_RO_HEAD_ROOM and CONFIG_RW_HEAD_ROOM are always defined as 0, so remove the values and associated code in order to simplify the code and improve readability. BRANCH=none BUG=b:172020503 TEST=./util/compare_build.sh -b all => MATCH Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: Ie11d23befda674cc15dda9a2d66b9c43ea22d49e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3205489 Reviewed-by: Ting Shen <phoenixshen@chromium.org> Reviewed-by: Mary Ruthven <mruthven@chromium.org>
* board/dratini: Fix LED enum typeTom Hughes2021-10-061-1/+1
| | | | | | | | | | | | | | | | | | | | | "enum ec_led_colors" was used here instead of "enum led_color". Fixes the following clang warning: error: implicit conversion from enumeration type 'enum led_color' to different enumeration type 'enum ec_led_colors' [-Werror,-Wenum-conversion] This is the same fix as commit 036cda45bba9fca0137add1d8693a264ba686d71. BRANCH=none BUG=b:172020503 TEST=make CC=arm-none-eabi-clang BOARD=dratini Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: Ide9188bef86b44041cf214405aee9461a3fbd917 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3205488 Reviewed-by: Eric Yilun Lin <yllin@google.com>
* common/usbc: Fix constnessTom Hughes2021-10-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When building with clang, it reports: common/usbc/usb_prl_sm.c:2304:44: error: 'prl_tx_states' causes a section type conflict with 'flag_bit_names' static __const_data const struct usb_state prl_tx_states[] = { ^ common/usbc/usb_prl_sm.c:131:37: note: declared here static __const_data struct bit_name flag_bit_names[] = { ^ common/usbc/usb_prl_sm.c:2346:44: error: 'prl_hr_states' causes a section type conflict with 'flag_bit_names' static __const_data const struct usb_state prl_hr_states[] = { ^ common/usbc/usb_prl_sm.c:131:37: note: declared here static __const_data struct bit_name flag_bit_names[] = { ^ The issue is that flag_bit_names is not const. When making flag_bit_names const, we must also make the argument to print_bits const to fix the additional warning: common/usbc/usb_prl_sm.c:169:56: error: passing 'const struct bit_name [11]' to parameter of type 'struct bit_name *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers] print_bits(group, set_or_clear ? "Set" : "Clr", flag, flag_bit_names, ^~~~~~~~~~~~~~ common/usbc/usb_prl_sm.c:149:28: note: passing argument to parameter 'names' here struct bit_name *names, BRANCH=none BUG=b:172020503 TEST=make CC=arm-none-eabi-clang BOARD=cret Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I95d28f53755dd23fe288ae70055e09fcf44511ad Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3205487 Reviewed-by: Edward Hill <ecgh@chromium.org>
* gitlab: Disable interrupt test in coverage buildJeremy Bettis2021-10-062-1/+3
| | | | | | | | | | | | | | | | | | | | The interrupt seems to be very sensitive to cpu load and when running for coverage in gitlab, it often times out. Change to skip this test in coverage builds, since it is unlikely to add any coverage for zephyr used code anyway. BRANCH=None BUG=None TEST=None Change-Id: Iefe0da6b925cc820f764c1ad5a79187b8f09885f Signed-off-by: Jeremy Bettis <jbettis@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3208910 Commit-Queue: Jeremy Bettis <jbettis@chromium.org> Commit-Queue: Abe Levkoy <alevkoy@chromium.org> Tested-by: Jeremy Bettis <jbettis@chromium.org> Auto-Submit: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* zephyr: add auto enabling HAS_TASK_* KconfigsMichał Barnaś2021-10-0610-79/+61
| | | | | | | | | | | | | | | | This commit removes the prompt for HAS_TASK_* Kconfigs. They are enabled automatically when corresponding feature is enabled. BRANCH=main BUG=b:198777314 TEST=Verify that all tasks are created correctly. USB PD tasks should match amount or usb-c ports count. Change-Id: Ia69f9762cb8953df99d12b772f607d26df1fe379 Signed-off-by: Michał Barnaś <mb@semihalf.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3197726 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* zephyr: convert port number for I2C_CONTROL HCDawid Niedzwiecki2021-10-061-0/+9
| | | | | | | | | | | | | | | | The port number passed via the I2C control host command may be different than the one used in ZephyrEC so convert it based on the "remote-port" property in DTS. BUG=b:201408931 BRANCH=none TEST=zmake testall Signed-off-by: Dawid Niedzwiecki <dn@semihalf.com> Change-Id: I71e05df2eb4f76b8c93948a97f47193aaaa6e25e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3205251 Reviewed-by: Yuval Peress <peress@google.com> Commit-Queue: Dawid Niedzwiecki <dawidn@google.com>
* zephyr: asurada: enable LEDsDenis Brockus2021-10-064-11/+16
| | | | | | | | | | | | | | BUG=b:187189596 BRANCH=none TEST=verify LEDs on asurada are working Signed-off-by: Denis Brockus <dbrockus@google.com> Change-Id: I9bb42099ff58932d06c8e48087f8aa44665b0f57 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3205482 Tested-by: Denis Brockus <dbrockus@chromium.org> Auto-Submit: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Yuval Peress <peress@google.com> Commit-Queue: Yuval Peress <peress@google.com>
* zephyr: add CONFIG_LED_ONOFF_STATESDenis Brockus2021-10-064-2/+32
| | | | | | | | | | | | | | | | | | Add CONFIG_PLATFORM_EC_LED_ONOFF_STATES and CONFIG_PLATFORM_EC_LED_ONOFF_STATES_BAT_LOW BUG=none BRANCH=none TEST=make buildall TEST=zmake testall Signed-off-by: Denis Brockus <dbrockus@google.com> Change-Id: Iaa858b09774b4caf5fe0a2f2bba4e72532990921 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3205481 Tested-by: Denis Brockus <dbrockus@chromium.org> Auto-Submit: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Yuval Peress <peress@google.com> Commit-Queue: Yuval Peress <peress@google.com>
* zephyr: herobrine: Enable CBI from strapping pinsWai-Hong Tam2021-10-061-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Enable the Zephyr Kconfig for CBI from strapping pins. BRANCH=None BUG=b:186264627, b:193807794 TEST=Built herobrine_npcx9 Zephyr image. Verified the cbi command: uart:~$ cbi [59342.269700 CBI Reading board info] CBI_VERSION: 0x0000 TOTAL_SIZE: 20 BOARD_VERSION: 0 (0x0) OEM_ID: (Error 1) MODEL_ID: (Error 1) SKU_ID: 0 (0x0) FW_CONFIG: (Error 1) PCB_SUPPLIER: (Error 1) SSFC: (Error 1) REWORK_ID: (Error 1) 43 42 49 a8 00 00 14 00 00 04 00 00 00 00 02 04 |CBI.............| 00 00 00 00 |.... | Change-Id: I4a6acbc7a1fdeb92e3e25a622108b210c999524d Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3204192 Reviewed-by: Keith Short <keithshort@chromium.org>
* zephyr: shim: implement a default led_set_brightnessFabio Baltieri2021-10-064-1/+78
| | | | | | | | | | | | | | | | | | | | | Implement a default led_set_brightness, should be good enough to replace all existing pwm leds currently defined: atlas, nocturne: 2 leds with independent channels volteer, boldar, trondo: 2 leds with sidesel terrador, todor, waddledee, wheelie: 1 led brya, kano, liara, waddledoo: 2 leds but only amber/white grunt:1 led with only blue/amber BRANCH=none BUG=b:177452529 TEST=build and run on volteer TEST=gdb disassemble/s led_set_brightness Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Change-Id: I24cb10574889ccfbc7c9fddc70ceb81d1e8b2170 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3207147 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* zephyr: shim: make color-map- properties optionalFabio Baltieri2021-10-062-14/+23
| | | | | | | | | | | | | These are not needed in few boards, make them default to zero. BRANCH=none BUG=b:177452529 TEST=build and gdb check led_color_map Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Change-Id: I83cd38d9438ee0d8d99ae187075c6f7f34791a17 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3207146 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* zephyr: shim: support optional pwm led channelsFabio Baltieri2021-10-061-3/+9
| | | | | | | | | | | | | | | | | This changes the PWM_CHANNEL_BY_IDX macro to correctly handle pwm-leds entries with less than 3 phandles, defaulting the corresponding channels to PWM_LED_NO_CHANNEL. This is necessary for devices with only two LED channels. BRANCH=none BUG=b:200974848 TEST=build only, compared the resulting pwm_leds structure Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Change-Id: I719ebfb085e60cc2ef27c3508c2b73ae85d3f7ac Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3205318 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* zephyr: Add test for `st_write_data_with_mask()`Tristan Honscheid2021-10-051-1/+103
| | | | | | | | | | | | | | | | | Add a unit test for `st_write_data_with_mask()`. Also adds a new mock i2c write function and adds the ability to return fake i2c read values from the read mock. BUG=b:200589041 BRANCH=None TEST=zmake configure --test zephyr/test/drivers Signed-off-by: Tristan Honscheid <honscheid@google.com> Cq-Depend: chromium:3203150 Change-Id: I9d7a5673417f3e62d28536bf2a871d57d7ff5cfb Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3203591 Reviewed-by: Yuval Peress <peress@google.com> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* zephyr: Add test for `st_raw_read_n_noinc()`Tristan Honscheid2021-10-051-4/+32
| | | | | | | | | | | | | | | | Add a unit test for `st_raw_read_n_noinc()` in `stm_mems_common.c` and a clarifying comment to `test_st_raw_read_n()` BUG=b:200589041 BRANCH=None TEST=zmake configure --test zephyr/test/drivers Signed-off-by: Tristan Honscheid <honscheid@google.com> Change-Id: I55bfacaf139283705765ad236807d9b871d77429 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3203630 Reviewed-by: Yuval Peress <peress@google.com> Reviewed-by: Aaron Massey <aaronmassey@google.com> Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* ioex: Skip initializing IOEXes if already initializedfactory-ambassador-14265.B-mainVijay Hiremath2021-10-052-2/+10
| | | | | | | | | | | | | | | | | Some of the IOEXes are needed early than the task is initialized, those IOEXes will be initialized at the board level. This CL skips re-initializing the IOEXes from HOOK function if already initialized. BUG=none BRANCH=none TEST=Tested on ADL RVP, re-initialization of IOEX is skipped Change-Id: I3062c46992a5578bf8f0f0bc2613b6815c28a616 Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3183330 Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Deepti Deshatty <deepti.deshatty@intel.corp-partner.google.com> Commit-Queue: Keith Short <keithshort@chromium.org>
* main: Add board level Pre-task I2C peripheral initializationVijay Hiremath2021-10-053-5/+25
| | | | | | | | | | | | | | | | | Intel RVP requires GPIOs from few of the IO expanders to configure pins pre-task, but the current code initializes the IO expanders after the HOOK task starts. This CL allows board to configure the I2C peripherals pre-task. BUG=none BRANCH=none TEST=Tested on ADL-RVP, able to initialize IOEX pre-task Change-Id: I827e22153a98a058d04da0139e302a6ec0276b43 Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3183329 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* i2c: Use bitbang mode for pre-task i2c transactionsJun Lin2021-10-054-4/+54
| | | | | | | | | | | | | | | | | | | | | | | | | In Intel ADL+_RVP, the keyboard is scanned by a discrete I/O expander IC and it is connected to EC via the I2C interface. EC needs to initialize the IC via I2C transaction before the task scheduling starts. It may cause the system panic if the EC's I2C driver is implemented by task-event-based. With this CL, if any of the I2C ports that need pre-task I2C transaction are defined as bitbang ports along with regular I2C ports will switch to the bitbang (GPIO) mode before the task starts and will again switch back to event based I2C upon task initialization. BRANCH=none BUG=b:199374643 TEST=issue an I2C transaction before the task scheduling starts; make sure the transaction success without panic on npcx9_evb. TEST=pass "make buildall" Signed-off-by: Jun Lin <CHLin56@nuvoton.com> Change-Id: I65460d2b612328f25bce60561bbb82995dd1cfdf Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3161869 Tested-by: Vijay Hiremath <vijay.p.hiremath@intel.com> Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* zephyr: drivers: add usb_mux test suiteTomasz Michalec2021-10-054-0/+630
| | | | | | | | | | | | | | | | | The usb_mux test use proxy mux driver to be between usb_mux API and usb_mux driver. Test is able to instrument calls made to the drivers. All public API functions of usb_mux are tested. BUG=b:184857076 BRANCH=none TEST=zmake configure --test zephyr/test/drivers Signed-off-by: Tomasz Michalec <tm@semihalf.com> Change-Id: I5f68e860b4afc633bce5d165e15851328207b916 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3152256 Reviewed-by: Yuval Peress <peress@google.com> Tested-by: Tomasz Michalec <tmichalec@google.com> Commit-Queue: Tomasz Michalec <tmichalec@google.com>
* zephyr: increase ztest mock parameter limitTristan Honscheid2021-10-051-1/+1
| | | | | | | | | | | | | | We need to increase this limit to accommodate an upcoming test that uses more than 5 parameters to a mocked function. BUG=b:200589041 BRANCH=None TEST=zmake configure --test zephyr/test/drivers Change-Id: I57f908fb7abb7c4c148758216bf00ff317e9c46a Signed-off-by: Tristan Honscheid <honscheid@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3203150 Reviewed-by: Aaron Massey <aaronmassey@google.com>
* tree: Fix LED enum typeTom Hughes2021-10-059-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | "enum ec_led_colors" was used here instead of "enum led_color". Fixes the following clang warning: error: implicit conversion from enumeration type 'enum led_color' to different enumeration type 'enum ec_led_colors' [-Werror,-Wenum-conversion] This is the same fix as commit 533640b6d2ce1189b8c0559ec69e1d64202d2c8b, but this should fix all instances. These usages were found with: git grep --name-only 'enum led_color' | xargs grep ec_led_colors As indicated by the TEST line, all boards match with this change, except for bloog since it uses the incorrect enum in two places. BRANCH=none BUG=b:172020503 TEST=CC=arm-none-eabi-clang BOARD=<affected board> TEST=./util/compare_build.sh -b all -j 120 => All match except bloog Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I75cff3769d5b3b82b9218bfb8584f449fb6a781f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3203936 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* include/power: Fix header guard typoTom Hughes2021-10-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | When building with clang: In file included from board/ambassador/board.c:30: include/power/cometlake-discrete.h:11:9: error: '__CROS_EC_COMETLAKE_DISCRETE_H' is used as a header guard here, followed by include/power/cometlake-discrete.h:12:9: note: '__CROS_EC_COMETLATE_DISCRETE_H' is defined here; did you mean '__CROS_EC_COMETLAKE_DISCRETE_H'? BRANCH=none BUG=b:172020503 TEST=make CC=arm-none-eabi-clang BOARD=ambassador TEST=./util/compare_build.sh -b all -j 70 => MATCH Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I4cda48bc44720ee7ee59e558bf00f26059e58345 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3203934 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* driver/led: Remove unused functionTom Hughes2021-10-051-6/+0
| | | | | | | | | | | | | | | | | Building with clang: driver/led/lm3630a.c:23:19: error: unused function 'lm3630a_read' [-Werror,-Wunused-function] static inline int lm3630a_read(uint8_t reg, int *val) BRANCH=none BUG=b:172020503 TEST=make CC=arm-none-eabi-clang BOARD=aleena Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: If4a26261d41f470c2cb86208e3c1eaada0b2ff3e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3202999 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* chip/npcx: Fix enum typeTom Hughes2021-10-052-2/+2
| | | | | | | | | | | | | | | | | | | | | | | clang reports that the enum types do not match: chip/npcx/lpc.c:967:9: error: implicit conversion from enumeration type 'enum ec_error_list' to different enumeration type 'enum ec_status' [-Werror,-Wenum-conversion] return EC_SUCCESS; common/power_button_x86.c:523:9: error: implicit conversion from enumeration type 'enum ec_error_list' to different enumeration type 'enum ec_status' [-Werror,-Wenum-conversion] return EC_SUCCESS; BRANCH=none BUG=b:172020503 TEST=make CC=arm-none-eabi-clang BOARD=aleena Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I25d1526d58e1e8558153592be7174a8448c130f5 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3202998 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* board/zinger: fix compiler error when building with clangTom Hughes2021-10-051-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When compiling with clang, it reports the following error: board/zinger/runtime.c:271:2: error: non-ASM statement in naked function is not supported cpu_reset(); ^ board/zinger/runtime.c:258:43: note: attribute is here void exception_panic(void) __attribute__((naked)); This is a partial revert of commit 28c034e69e6610602ef592b89476ce48e7ce58e8. Instead of replacing the "b cpu_reset" with a C call to cpu_reset(), change to "bl cpu_reset", which is the same thing. The code generated by gcc for exception_panic is the same before and after this change: 00000000 <exception_panic>: 0: 4b04 ldr r3, [pc, #16] ; (14 <exception_panic+0x14>) 2: 1c18 adds r0, r3, #0 4: 466b mov r3, sp 6: 6999 ldr r1, [r3, #24] 8: 695a ldr r2, [r3, #20] a: f7ff fffe bl 0 <debug_printf> e: f7ff fffe bl 0 <exception_panic> 12: 46c0 nop ; (mov r8, r8) 14: 00000000 .word 0x00000000 BRANCH=none BUG=b:172020503, b:172343310 TEST=make CC=arm-none-eabi-clang BOARD=zinger -j TEST=make buildall -j Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I590ba4d2caabc77f04288d9f566286e87d08df02 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3198205 Reviewed-by: Eric Yilun Lin <yllin@google.com>
* gitlab: Use cache to only get source code onceJeremy Bettis2021-10-051-13/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | There was a recent breakage where one job failed because of a git clone timeout. But more importantly, we should make sure all the jobs are using the same commit. Change CI jobs to use the gitlab cache to keep the non-ec git repos so only the first job (seed_cache) will do the git clone, and the others will just pull the files from the cache. The cache key is the ec commit sha that is being built. The total build time after this is 40m, and the builds before this were 37-39m, so it doesn't seem to be a change. BUG=None BRANCH=None TEST=Pushed to coverage branch on gitlab: https://gitlab.com/zephyr-ec/ec/-/pipelines/382237078 Change-Id: Ic596464fbf90c2964075b4f8f3e6bdc77bde531b Signed-off-by: Jeremy Bettis <jbettis@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3205632 Tested-by: Jeremy Bettis <jbettis@chromium.org> Auto-Submit: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Commit-Queue: Jeremy Bettis <jbettis@chromium.org>
* zephyr: test: isl923x: make all tests staticYuval Peress2021-10-051-13/+13
| | | | | | | | | | | | | A few tests were not declared as static functions, fix that. BRANCH=none BUG=b:201602829 TEST=zmake configure --test zephyr/test/drivers Signed-off-by: Yuval Peress <peress@google.com> Change-Id: I83052ab0f72b9803ff4f06e3459cc819e6744dd1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3201917 Reviewed-by: Wai-Hong Tam <waihong@google.com>
* zephyr: test: isl923x::initYuval Peress2021-10-055-1/+146
| | | | | | | | | | | | | | | | Test the remaining (failure/uncommon) code paths in init(). This includes a mocking of the system_jumped_late function which was already stubbed to always return false. This mock will later need to be cleaned up with a better mock to avoid the custom struct added. BRANCH=none BUG=b:201602829 TEST=zmake configure --test zephyr/test/drivers Signed-off-by: Yuval Peress <peress@google.com> Change-Id: I1be53b0a15850d8b97b7b5a96ccef764f0782816 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3201916 Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* zephyr: test: isl923x::get_vbus_voltageYuval Peress2021-10-053-1/+58
| | | | | | | | | | | | | | Verify all the code paths in get_vbus_voltage (including calculated mV value). BRANCH=none BUG=b:201819565 TEST=zmake configure --test zephyr/test/drivers Signed-off-by: Yuval Peress <peress@google.com> Change-Id: I508880a8af30c2d546655424b289d521f3c22626 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3201915 Reviewed-by: Fabio Baltieri <fabiobaltieri@google.com>
* zephyr: test: isl923x::discharge_on_acYuval Peress2021-10-051-1/+53
| | | | | | | | | | | | | Verify all the code paths on the discharge_on_ac API BRANCH=none BUG=b:201819565 TEST=zmake configure --test zephyr/test/drivers Signed-off-by: Yuval Peress <peress@google.com> Change-Id: Id9b4163ad42a7bcb14bdac425ed9af5d29d1d1d7 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3201914 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* zephyr: test: Add ctrl3 register for isl9238 emulatorYuval Peress2021-10-051-0/+19
| | | | | | | | | | | | | | Adding support for this register improves code coverage for the existing init function. No additional tests are needed at this point. BRANCH=none BUG=b:201819565 TEST=zmake configure --test zephyr/test/drivers Signed-off-by: Yuval Peress <peress@google.com> Change-Id: I9e19372501775940f1a23d05317ba3971212083a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3201913 Reviewed-by: Keith Short <keithshort@chromium.org>
* zephyr: test: isl923x set/unset comparator inversionYuval Peress2021-10-052-1/+75
| | | | | | | | | | | | BRANCH=none BUG=b:201602829 TEST=zmake configure --test zephyr/test/drivers Signed-off-by: Yuval Peress <peress@google.com> Change-Id: I3296c94fd2b591a37349f08c3cd29c92ce5831b9 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3201912 Reviewed-by: Aaron Massey <aaronmassey@google.com> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* zephyr: test: isl923x DC prochotYuval Peress2021-10-052-1/+79
| | | | | | | | | | | | | | Verify setting the prochot amps as well as edge conditions BRANCH=none BUG=b:201602829 TEST=zmake configure --test zephyr/test/drivers Signed-off-by: Yuval Peress <peress@google.com> Change-Id: I12cd413172bfdf395a1c60ef7e487b33687202bc Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3200055 Reviewed-by: Aaron Massey <aaronmassey@google.com> Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* zephyr: test: isl923x AC prochotYuval Peress2021-10-053-2/+103
| | | | | | | | | | | | | Verify setting the prochot amps as well as edge conditions BRANCH=none BUG=b:201602829 TEST=zmake configure --test zephyr/test/drivers Signed-off-by: Yuval Peress <peress@google.com> Change-Id: I306adf1d74eea65a8522c61e5ed71cf8deacfe2a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3200054 Reviewed-by: Wai-Hong Tam <waihong@google.com>
* zephyr: test: isl923x post_init always passesYuval Peress2021-10-051-1/+7
| | | | | | | | | | | BRANCH=none BUG=b:201602829 TEST=zmake configure --test zephyr/test/drivers Signed-off-by: Yuval Peress <peress@google.com> Change-Id: I85f80ad1d8233c1fbefff9ab2124c4c39a3d5062 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3198688 Reviewed-by: Aaron Massey <aaronmassey@google.com>
* zephyr: test: isl923x failure to read charge current regYuval Peress2021-10-051-4/+19
| | | | | | | | | | | BRANCH=none BUG=b:201602829 TEST=zmake configure --test zephyr/test/drivers Signed-off-by: Yuval Peress <peress@google.com> Change-Id: I7e4ed6327c3393f64153f4383002a2c9c38f57b1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3198687 Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* zephyr: test: isl923x::set_mode always turns off learn modeYuval Peress2021-10-053-1/+55
| | | | | | | | | | | | BRANCH=none BUG=b:201602829 TEST=zmake configure --test zephyr/test/drivers Signed-off-by: Yuval Peress <peress@google.com> Change-Id: Ic2481c0de52268cc65475de8e79f1db7834358d2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3198686 Reviewed-by: Sam Hurst <shurst@google.com> Reviewed-by: Jeremy Bettis <jbettis@chromium.org>