summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* zephyr: shi: npcx: Improve SHI driverstabilize-RUST-13932.B-mainJun Lin2021-04-232-8/+11
| | | | | | | | | | | | | | | | | | | | | This CL fixes some potential leaks for the SHI driver: 1. Replace irq_lock/irq_unlock with __disable_irq/__enable_irq because irq_lock/irq_unlock leave some system exceptions still enabled. These may block the SHI driver's execution which requires hard timing. 2. Change the interrupt priority of SHI from 2 to 1. BRANCH=none BUG=b:182600858 TEST=Verify the SHI function on Lazor Signed-off-by: Jun Lin <CHLin56@nuvoton.com> Change-Id: If0ea355b5f300054ce8f7ae53de12f99a6d6aba6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2835526 Tested-by: Wealian Liao <whliao@nuvoton.corp-partner.google.com> Tested-by: CH Lin <chlin56@nuvoton.com> Reviewed-by: Wai-Hong Tam <waihong@google.com> Commit-Queue: CH Lin <chlin56@nuvoton.com>
* spherion: add new keyboardBen Chen2021-04-231-0/+2
| | | | | | | | | | | | | This CL implements F2 refresh key to ROW3 BUG=b:181102461 BRANCH=asurada TEST=none Change-Id: I49a05c6ea3b2fcce8c2d914f3d9390903e49c617 Signed-off-by: Ben Chen <ben.chen2@quanta.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2825716 Reviewed-by: Ting Shen <phoenixshen@chromium.org>
* drobit: Fine tune Keyboard backlight PWM frequencyJacky Wang2021-04-231-1/+1
| | | | | | | | | | | | | | | | | Fine tune Keyboard backlight PWM frequency from 2.4kHz to 10kHz BUG=b:185972046 BRANCH=firmware-volteer-13672.B TEST=make BOARD=drobit 1. Verified pass by EE team. Signed-off-by: Jacky Wang <jacky5_wang@pegatron.corp-partner.google.com> Change-Id: I663bd6401ae055d12cfd774a84fcbf5dabc76188 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2845024 Reviewed-by: Michael5 Chen <michael5_chen1@pegatron.corp-partner.google.com> Reviewed-by: Zhuohao Lee <zhuohao@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Zhuohao Lee <zhuohao@chromium.org>
* drobit: Remove config for firmware qualJacky Wang2021-04-231-4/+0
| | | | | | | | | | | | | | | | 1.Remove CONFIG_SYSTEM_UNLOCKED 2.Remove CONFIG_BYPASS_CBI_EEPROM_WP_CHECK BUG=b:182751870 BRANCH=firmware-volteer-13672.B TEST=make BOARD=drobit Signed-off-by: Jacky Wang <jacky5_wang@pegatron.corp-partner.google.com> Change-Id: Ib86c81af7a4e1af6788abed56fdc4749dd9faf78 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2845196 Reviewed-by: Michael5 Chen <michael5_chen1@pegatron.corp-partner.google.com> Reviewed-by: Zhuohao Lee <zhuohao@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
* bq25710: Replace some macros with functionsCaveh Jalali2021-04-231-9/+15
| | | | | | | | | | | | | | This replaces the IIN_DPM_REG_TO_CURRENT and IIN_HOST_CURRENT_TO_REG macros with equivalent functions to make the implementation more robust. BRANCH=none BUG=b:185190976 TEST=buildall passes Change-Id: I9fac69d38efd197a916bc18d12869b04a89adb5a Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2842705 Reviewed-by: Boris Mittelberg <bmbm@google.com>
* bq25710: Fix register field access macrosCaveh Jalali2021-04-232-14/+17
| | | | | | | | | | | | | | | | This cleans up the use of CURRENT_SHIFT and CURRENT_STEP_MA in related macros. Also, in one case INPUT_RESISTOR_RATIO was not applied to IIN_DPM - luckily, this ratio is 1 for all affected boards, so fixing this has not functional impact. BRANCH=none BUG=b:185190976 TEST=ran util/compare_build.sh on affected boards Change-Id: Ib3e8321d3d7ed69d33d7266077a67c5d2893182a Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2785269 Reviewed-by: Boris Mittelberg <bmbm@google.com>
* brya: Update battery parametersCaveh Jalali2021-04-231-3/+3
| | | | | | | | | | | | | | | | | | This updates the brya PoR battery parameters to match the latest spec provided in b/177971846#comment16. - device name added - precharge current raised to 280mA - min. discharge temp raised to -10C BRANCH=none BUG=b:177971846 TEST=PoR battery is recognized and charges Change-Id: I9e3dcd47166cfd943f9f324802de9361d4da7ae6 Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2837416 Reviewed-by: Boris Mittelberg <bmbm@google.com>
* flash_fp_mcu: Add delay to consider bootloader startupSujit Kautkar2021-04-231-0/+8
| | | | | | | | | | | | | | | | | Add delay of 100 ms to consider minimum bootloader start time for stm32. This fix prevents triggering stm32mon before bootloader is finished. BRANCH=none BUG=b:185074067 TEST=Multiple 'flash_fp_mcu <fpfw>' Tested on coachz, nocturne and morphius boards Change-Id: Ic60e9e67c29664ce22bfc66bec6eaf76ffc80454 Signed-off-by: Sujit Kautkar <sujitka@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2837485 Tested-by: Sujit Kautkar <sujitka@chromium.org> Reviewed-by: Alexandru M Stan <amstan@chromium.org> Commit-Queue: Sujit Kautkar <sujitka@chromium.org>
* usb_mux/amd_fp6: Handle chipset_resetRob Barnes2021-04-221-1/+7
| | | | | | | | | | | | | | The driver was only handling chipset_resume. chipset_reset also needs to be handled. Otherwise mux won't be set on an apreset. BUG=None TEST=C1 display works after apreset BRANCH=None Signed-off-by: Rob Barnes <robbarnes@google.com> Change-Id: I0ec336a733e51d44be7ea95f8fcfeb8a606d50a1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2845269 Reviewed-by: Diana Z <dzigterman@chromium.org>
* ANX7451: Add power off and wake up routinesRob Barnes2021-04-222-10/+56
| | | | | | | | | | | | | | | | Add anx7451_power_off and anx7451_wake_up routines. ANX7451 is powered off whenever both USB and DP are disabled. ANX7451 is woken up via i2c before mux set or get. BUG=b:184907521 TEST=Mux is powering off when nothing is connected. Mux is waking up when cable is connected. BRANCH=None Signed-off-by: Rob Barnes <robbarnes@google.com> Change-Id: Idf1343735cb94eb8bbaebe93794195d2f115b086 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2840056 Reviewed-by: Diana Z <dzigterman@chromium.org>
* zephyr: espi: Reorder to avoid forward declarationsSimon Glass2021-04-221-83/+80
| | | | | | | | | | | | | | | | | | | | It seems that these perhaps confuse the compiler, producing this warning in some cases: zephyr/shim/src/espi.c:142:13: warning: 'kbc_ibf_obe_handler' used but never defined Reorder the code to fix this. BUG=none BRANCH=none TEST=try on gitlab: https://gitlab.com/zephyr-ec/ec/-/jobs/1167734180 Change-Id: Ic3fbce80974ac978d38c97bdf25a12facf11201f Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2817959 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
* LED On/Off: Allow compiling without CONFIG_CHARGERDiana Z2021-04-221-0/+8
| | | | | | | | | | | | | | | | The header for charge_get_percent() will only define this function if CONFIG_CHARGER is present. Make a declaration for complilation to use, and then allow most of the led_get_state() function to be optimized out with IS_ENABLED(). BRANCH=None BUG=b:185508707 TEST=make -j buildall Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I3d94f290ac5b9ec82b46b9c0a6fc668b2e8dd91c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2832693 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* LED On/Off: Make battery LED optionalDiana Z2021-04-2266-273/+339
| | | | | | | | | | | | | | | Currently, all boards using the LED On/Off module have battery LEDs. However, if we'd like to expand support to Chromeboxes then the battery LED must become optional. BRANCH=None BUG=b:185508707 TEST=make -j buildall Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: Ieae098829ebe6c8b103f23d5abdbf70e7bcbdf2d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2832692 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* LED On/Off: Remove power LED configDiana Z2021-04-2267-124/+79
| | | | | | | | | | | | | | | | | | | | | | Move the LED on/off module towards using a more flexible LED support approach. Define a weak power LED table and setter for boards to override when needed. Note that during run-time these functions will not get called since led_auto_control_is_enabled() will return false for nonexistent LEDs. This consumes an average of 165 additional bytes of flash space on boards which do not use a power LED. BRANCH=None BUG=b:185508707 TEST=make -j buildall, load on guybrush (battery LED only) and confirm no errors are seen. Load on Boten (both LEDs) and confirm behavior appears normal Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: Iaa1e22a7f5d8be39eb8792ee13d358087d7f7482 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2832691 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* dedede : fix alignment in cbi_ssfcYongBeum.Ha2021-04-222-7/+7
| | | | | | | | | | | | | | fix bit alignment in cbi_ssfc BUG=b:186067339 BRANCH=none TEST=make -j BOARD=sasuke Signed-off-by: YongBeum.Ha <ybha@samsung.corp-partner.google.com> Change-Id: I15902938ddefe27aeb36530008cfb899440c9d15 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2845195 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
* sasuke : fix bug during faft_pdYongBeum.Ha2021-04-221-11/+19
| | | | | | | | | | | | | | | | Some items in faft_pd is failed because of WA for S0iX power consumption. WA is fixed, based on CL:2773218 BUG=b:186022475 BRANCH=none TEST=make -j BOARD=sasuke & run faft_pd Signed-off-by: YongBeum.Ha <ybha@samsung.corp-partner.google.com> Change-Id: I9fe8a14c6e071f12d13012ec7809dad4d20e3192 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2842715 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
* zephyr: driver: bmi160: Add interrupt handler using devicetreeYuval Peress2021-04-221-0/+17
| | | | | | | | | | | | | | Add the interrupt handler using the same model used in the bmi260. BRANCH=none BUG=b:185966444 TEST=zmake testall Signed-off-by: Yuval Peress <peress@chromium.org> Change-Id: I7aa3bcade8c3bc0fe526d44f8223bab8760cf279 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2842714 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* zephyr: motionsense: add bmi160 to the sensor driver listYuval Peress2021-04-222-0/+60
| | | | | | | | | | | | | | Adds the code to create the motion sensor structs for the bmi160. BRANCH=none BUG=b:185966444 TEST=zmake testall Signed-off-by: Yuval Peress <peress@chromium.org> Change-Id: I8b9c31b4006b404beeff33e9edcddb13c7dbf848 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2842713 Commit-Queue: Keith Short <keithshort@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
* zephyr: motionsense: convert cros-ec CONFIG_values to zephyr'sYuval Peress2021-04-221-3/+3
| | | | | | | | | | | | | | | Files in zephyr/ directory should not be using the old CONFIG_ values. Convert them to the CONFIG_PLATFORM_EC_ equivalents. BRANCH=none BUG=b:185966444 TEST=zmake testall Signed-off-by: Yuval Peress <peress@chromium.org> Change-Id: I0bcee471d6b2afcd3de5f06886e19fb771c85c45 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2842712 Commit-Queue: Keith Short <keithshort@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
* zephyr: lazor: add board specific lid angle implementationYuval Peress2021-04-222-0/+33
| | | | | | | | | | | | | | | Add implementation for the board specific lid_angle_peripheral_enable function (taken from board/lazor/board.c). BRANCH=none BUG=b:185966444 TEST=zmake testall Signed-off-by: Yuval Peress <peress@chromium.org> Change-Id: I9067eeb8fb7b156e6fa690b007d777cd5e760d8d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2842711 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* zephyr: driver: bmi160: Add Kconfig to enable bmi160Yuval Peress2021-04-222-2/+13
| | | | | | | | | | | | | | Adds a Kconfig option to add the bmi160 drivers. BRANCH=none BUG=b:185966444 TEST=zmake testall Signed-off-by: Yuval Peress <peress@chromium.org> Change-Id: I602c4fe9564ebb49dc0db5bb00d51b413ebe76c5 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2842710 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* zephyr: dts: bmi160: Add bmi160 DT bindingsYuval Peress2021-04-225-1/+61
| | | | | | | | | | | | | | Adds the bindings needed to use the bmi160 in devicetree. BRANCH=none BUG=b:185966444 TEST=zmake testall Signed-off-by: Yuval Peress <peress@chromium.org> Change-Id: I6c83adca1b6456eea34367df693d1993f6ef86eb Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2842709 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* Lindar: Update lightbar 10-led cfgreno.wang2021-04-221-2/+2
| | | | | | | | | | | | | | | | | | | | Based on b:183826778's comment#17 and comment18 information to update lightbar 10-led cfg setting. The final placement adopt lightbar circuit's LED9 and LED10 which connect to KTD2061's LEDC1 and and LEDC2, not adopt LED11 and LED12 which connect to LEDC3 and LEDC4. BUG=b:183826778 BRANCH=volteer TEST=make -j BOARD=lindar Signed-off-by: reno.wang <reno.wang@lcfc.corp-partner.google.com> Change-Id: I7f7e1cac1f7361c5c21497a0cc4c1ff2763873bf Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2833031 Reviewed-by: Zhuohao Lee <zhuohao@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* gl3590: Add a delay to allow hub release i2c linesJan Dabros2021-04-221-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | GL3590 (USB3 hub) chip may drive I2C_SDA and I2C_SCL lines after being released from reset. Max time for such "activities" is 200ms. In order to ensure correct operations on the i2c bus, we need to delay all i2c transactions in the system by such value. Implementation is using hook with higher priority than I2C_INIT. This guarantees that: * SoC won't start i2c transactions before 200ms mark after GL3590's RESETJ# pin deassertion; * Original order of loading all generic modules (e.g. ioex_init, board_init) won't need to be changed; * Workaround applied only in platform-specific code. BUG=b:181930164 BRANCH=main TEST=build and flash new servo_v4p1 firmware Plug in CHG and DUT cables. _Then_ plug in HOST cable and verify that green diode is lit on servo_v4p1 board indicating proper pass-through charging. Signed-off-by: Jan Dabros <jsd@semihalf.com> Change-Id: I32971d421eb541c788a87701ce5e8c62a8b35777 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2829770 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* cherry: add pwm keyboard backlight controlTing Shen2021-04-223-4/+17
| | | | | | | | | | | | | | BUG=b:181838424 TEST=keyboard backlight works BRANCH=main Signed-off-by: Ting Shen <phoenixshen@google.com> Change-Id: I7fd20808c6e8e6a1e22c060bb14c145256201756 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2785511 Tested-by: Ting Shen <phoenixshen@chromium.org> Auto-Submit: Ting Shen <phoenixshen@chromium.org> Reviewed-by: Eric Yilun Lin <yllin@google.com> Commit-Queue: Ting Shen <phoenixshen@chromium.org>
* sasuke : support multi-usb muxYongBeum.Ha2021-04-222-1/+34
| | | | | | | | | | | | | Select usb mux on board init with cbi_ssfc. BUG=b:182596801 BRANCH=none TEST=make -j BOARD=sasuke & check if c1 port works Signed-off-by: YongBeum.Ha <ybha@samsung.corp-partner.google.com> Change-Id: Id5886a5dbe128cbb7c32af4cb24d930be302eaa0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2801177 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* console: make sure eol check runs in python3Ruben Rodriguez Buchillon2021-04-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Indexing into a byte array returns an integer, which will return False when compared to a byte-array. This change makes sure we're comparing two characters (python2) or two integers (python3) BRANCH=None BUG=b:183642673 TEST=python3 b'hello\n'[-1]==b'\n' False TEST=python2.7 b'hello\n'[-1]==b'\n' True TEST=python3 b'hello\n'[-1]==b'\n'[0] True Change-Id: I26a4b1bde7acf733faae7ec355da228d76e261d0 Signed-off-by: Ruben Rodriguez Buchillon <coconutruben@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2809883 Reviewed-by: Mary Ruthven <mruthven@chromium.org> Tested-by: Mary Ruthven <mruthven@chromium.org>
* thermisor: move header to include dirDawid Niedzwiecki2021-04-2249-48/+48
| | | | | | | | | | | | | | | | Move the "thermistor.h" header to the include/driver/temp_sensor directory. It is used by the Zephyr shim, so the change is useful to include the header. BUG=b:180403276 BRANCH=none TEST=make buildall Signed-off-by: Dawid Niedzwiecki <dn@semihalf.com> Change-Id: I0e83df97e50a3b324440b65ddb900ddf135f2439 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2843323 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* zephyr: create a Kconfig option for CONFIG_CMD_SYSINFOJack Rosenthal2021-04-222-0/+12
| | | | | | | | | | | | | | | | | | | Create a Kconfig option for the sysinfo console command, furthering our parity with EC configurability. This is by default enabled anyway, so the Kconfig is just providing a means to turn it off, if desired. (Which is useful for ITE chips right now, where we don't have full support for all the deps we bring in with this command yet.) BUG=b:180980668 BRANCH=none TEST=hayato build (follow-up CL) Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: Ibe2c2a4d7620ef60979b256735046379bf99e3e5 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2845270 Reviewed-by: Simon Glass <sjg@chromium.org>
* TCPMv2: PE: Clear PRS request following acceptfactory-13929.B-mainScott Collyer2021-04-211-0/+12
| | | | | | | | | | | | | | | | | | | | | This CL adds logic to clear any pending DPM_REQUEST_PR_SWAP once we accept a PRS request from the port partner. This prevents a possible back to back swap if we want to PRS, but the port partner sends the request before PRS swap request is generated. BUG=b:182441965 BRANCH=quiche TEST=tested quiche with kohaku where quiche attaches in sink role. This case causes quiche to want to power role swap and causes the port partner to request a power role swap. Verified that only 1 power role swap occurs. Signed-off-by: Scott Collyer <scollyer@google.com> Change-Id: I05ee27897d5900e71257d268acd3bd37c8abb787 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2799450 Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Scott Collyer <scollyer@chromium.org>
* zephyr: volteer: Set LED PWM clock source to LFCLKWealian Liao2021-04-211-0/+4
| | | | | | | | | | | | | | | | | | | NPCX PWM default clock is set to APB2 which doesn't work in NPCX deep sleep power state. Originally, volteer uses PWM_CONFIG_DSLEEP flag which sets the clock source to LFCLK. Zephyr volteer project hasn't set LED PWM clock source to LFCLK. Setting LED PWM clock source to LFCLK lets LEDs work correctly in NPCX deep sleep power state. BUG=b:184653704 BRANCH=none TEST=System enters s0ix & ec enters deep sleep. Check led is on for 1 second, and off for 3 seconds correctly. Signed-off-by: Wealian Liao <whliao@nuvoton.corp-partner.google.com> Change-Id: Idffcd6428d83049812ab9bbac1f7187a2e6a62c7 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2839048 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* driver: bmi160: Fix imports for zephyr include pathYuval Peress2021-04-211-3/+3
| | | | | | | | | | | | | | | | | Zephyr builds do not use the platform/ec root in the include path so we need to remove the "driver/" prefix for these includes. BRANCH=none BUG=b:185966444 TEST=zmake testall TEST=make buildall Signed-off-by: Yuval Peress <peress@chromium.org> Change-Id: Ic8682ad2b5c53621ea54984d6d7d711fc4e7173f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2842708 Reviewed-by: Fabio Baltieri <fabiobaltieri@google.com> Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* zephyr/drivers: it8xxx2: add SPI host interface drivertim2021-04-213-0/+351
| | | | | | | | | | | | | | | | | Add spi host interface driver which is required to communicate with the EC when the CPU is the ARM processor. BUG=b:185202623 BRANCH=none TEST=replaced board hayato's EC with it81202_evb and the host command can be received and responded. Signed-off-by: tim <tim2.lin@ite.corp-partner.google.com> Change-Id: I25ccdd0b29bf46b6a4ad451150f63b47dc9d3b97 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2813841 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Jack Rosenthal <jrosenth@chromium.org>
* zephyr: adc: Add an empty enum when not ADC is presentSimon Glass2021-04-211-0/+5
| | | | | | | | | | | | | | | | At present we get warnings when adc.h is included but there is no ADC available, such as with posix-ec. Correct this by adding an empty enum in this case. BUG=none BRANCH=none TEST=CQ Signed-off-by: Simon Glass <sjg@chromium.org> Change-Id: I139c48d0de860657036d071e596dea426225b52d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2842205 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org>
* zephyr: shi: npcx: Fix rx deadline checkingJun Lin2021-04-211-2/+2
| | | | | | | | | | | | | | | | | NPCX shi rx uses k_uptime_get() to check deadline time. However, k_uptime_get() return in 'ms' and SHI_CMD_RX_TIMEOUT set in 'us'. Change SHI_CMD_RX_TIMEOUT to 'ms' to fix the unit. BRANCH=none BUG=b:182600858 TEST=zmake testall Signed-off-by: Jun Lin <CHLin56@nuvoton.com> Change-Id: I9824d3b710dc0af076153e1f8479503fe836900c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2842707 Tested-by: Wealian Liao <whliao@nuvoton.corp-partner.google.com> Reviewed-by: Wai-Hong Tam <waihong@google.com> Commit-Queue: Wealian Liao <whliao@nuvoton.corp-partner.google.com>
* zephyr: shi: npcx: Fix unreachable codeJun Lin2021-04-211-2/+2
| | | | | | | | | | | | | | | cros_shi_npcx_disable() has unreachable code. Fix it. BRANCH=none BUG=b:182600858 TEST=zmake testall Signed-off-by: Jun Lin <CHLin56@nuvoton.com> Change-Id: I23394e698805fc9b139dc57a5d096a18dd60df73 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2842706 Tested-by: Wealian Liao <whliao@nuvoton.corp-partner.google.com> Reviewed-by: Wai-Hong Tam <waihong@google.com> Commit-Queue: Wealian Liao <whliao@nuvoton.corp-partner.google.com>
* power: go to hibernate mode immediately if woken up by rtc overflow.Mulin Chao2021-04-211-0/+31
| | | | | | | | | | | | | | | | | If platform uses PSL (Power Switch Logic) for hibernating and RTC is also supported, this CL determines whether ec is woken up by RTC with overflow event (16 weeks). If so, let it go to hibernate mode immediately for better power consumption. BRANCH=none BUG=b:171919875 TEST= test console command "hibernate" with NPCX_LCT_MAX = 1000 and enable chipset_task on npcx9 EVB. Signed-off-by: Mulin Chao <mlchao@nuvoton.com> Change-Id: I52543ee3cd980d444758c6a0cab32c34bd690b9a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2835259 Reviewed-by: Wai-Hong Tam <waihong@google.com>
* goroh: initial commitEric Yilun Lin2021-04-2113-0/+1869
| | | | | | | | | | | | | | | | | | copied from asurada with proper fixes: 1. rename asurada/hayato to goroh 2. change the year to 2021 in copyright notice BUG=b:185846337 TEST=make BOARD=goroh BRANCH=none Change-Id: Ifd66e5b16c5dd463dd9ad215f25a7a1ea1265495 Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2839384 Tested-by: Eric Yilun Lin <yllin@google.com> Auto-Submit: Eric Yilun Lin <yllin@google.com> Reviewed-by: Ting Shen <phoenixshen@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org>
* battery: Correct battery_get_disconnect_state() returnSimon Glass2021-04-211-1/+1
| | | | | | | | | | | | | | | | | | | | This cannot return a value from a different enum. Doing so produces an error with clang: battery_fuel_gauge.c:228:10: warning: implicit conversion from enumeration type 'enum ec_error_list' to different enumeration type 'enum battery_disconnect_state' [-Wenum-conversion] Fix it by returning the existing error value. BUG=none BRANCH=none TEST=CQ Signed-off-by: Simon Glass <sjg@chromium.org> Change-Id: I1f3826ef26b1255934ea96cd1541f60436546b57 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2842204 Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* drobit: Update EC thermal tableJacky Wang2021-04-211-4/+4
| | | | | | | | | | | | | | | Update EC thermal table for throttle and temp_fan_max setting. BUG=b:177777472 BRANCH=firmware-volteer-13672.B TEST=make BOARD=drobit 1. Verified pass by thermal team. Signed-off-by: Jacky Wang <jacky5_wang@pegatron.corp-partner.google.com> Change-Id: Ibfa9c543a1d99e02815882091d495aa601d3640b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2839963 Reviewed-by: Michael5 Chen <michael5_chen1@pegatron.corp-partner.google.com> Reviewed-by: Keith Short <keithshort@chromium.org>
* TCPC: Cleanup: Get Sink & SRC state from PD or PPCVijay Hiremath2021-04-217-54/+25
| | | | | | | | | | | | | | Added option to get the Sinking or Sourcing state from either PD or PPC. BUG=none BRANCH=none TEST=make buildall -j Change-Id: Ibb21ef69b5825ea5722ceacd5d7ef6f535aad17c Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2838127 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* brya: Define fw_config at board levelCaveh Jalali2021-04-219-81/+79
| | | | | | | | | | | | | | | | This updates the brya FW config fields based on the brya/config.star definitions. FW config fields and values are now defined at the project level rather than the program level. In other words each board (variant) defines its own FW config and no longer relies on baseboard definitions. BRANCH=none BUG=b:180434685 TEST=USB C1 port still works on brya for PD charging and SS data Change-Id: I055b0e2b051b7d41bbe116455274fe8b4a785741 Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2837417 Reviewed-by: Keith Short <keithshort@chromium.org>
* brya: Remove debug outputCaveh Jalali2021-04-211-5/+2
| | | | | | | | | | | BRANCH=none BUG=b:180980490,b:184873747 TEST=debug message no longer present when using suzyQ Change-Id: I709588b4e08263b05e49dc3c537e6515e0617b31 Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2837415 Reviewed-by: Alex Levin <levinale@google.com>
* zephyr: zmake: enable verbose logging with --debugJack Rosenthal2021-04-211-3/+9
| | | | | | | | | | | | | | | | | | | | | | The --debug parameter (which is passed in the CQ, since we want to see as much failure context as we can in the logs) currently prevents disabling tracebacks. We had some discussion when that landed about making it enable verbose logging as well. Make the default with --debug as DEBUG instead of WARNING. BUG=none BRANCH=none TEST=zmake -D testall => observed log level is DEBUG zmake testall => observed log level is WARNING zmake -l INFO testall => observed log level is INFO Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I87bf1d7cca34cffd9ff6deeb53fecf0ae8f2e362 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2842364 Commit-Queue: Simon Glass <sjg@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org>
* raa489000: Sink VBUS before switching to TCPC sideAseda Aboagye2021-04-211-15/+15
| | | | | | | | | | | | | | | | | | | | When the RAA48900 switches from charger IC control to TCPC control, it will disable the ASGATE. In cases where the board is booted without a battery, this can cause a loss in VSYS. This commit has the board attempt to sink VBUS if it's present prior to switching the part to TCPC control. BUG=b:181712325 BRANCH=dedede TEST=Build and flash galith, remove battery, plug in 45W charger, verify that DUT can boot up. Signed-off-by: Aseda Aboagye <aaboagye@google.com> Change-Id: Id5b3269911d3b8222b28886f66ef724e3e82c637 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2829115 Reviewed-by: Diana Z <dzigterman@chromium.org> Tested-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
* zephyr: drivers: add CBI test suiteTomasz Michalec2021-04-204-1/+35
| | | | | | | | | | | | | | | CBI test suite uses EC code. It is required to use I2C and eeprom emulators for storage and GPIO emulator for write protect pin. The overlay.dts is extended with required devices. BUG=b:185205123 BRANCH=none TEST=run zmake drivers test Signed-off-by: Tomasz Michalec <tm@semihalf.com> Change-Id: I2dc743b97aac0efa11624ebba4ac2e1b6811b847 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2821699 Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* Revert "Reland "zephyr: zmake: Add a test for zmake and output filtering""Jack Rosenthal2021-04-205-748/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 477997408185b0d446d388239a53657de6367570. Reason for revert: Introduces flakes to the CQ BUG=chromium:1196696 TEST=none Original change's description: > Reland "zephyr: zmake: Add a test for zmake and output filtering" > > This reverts commit 3ea453e890f2f782e8195c94af5de00c8c754f74. > > Reason for revert: Trying again to see what error is produced > > Original change's description: > > Revert "zephyr: zmake: Add a test for zmake and output filtering" > > > > This reverts commit ca160a3394c952f0732f66eb113b9735b5655ed2. > > > > Reason for revert: responsible for CQ failures (crbug.com/1198472) > > > > BUG=chromium:1198472 > > BRANCH=none > > TEST=pytest zephyr/zmake/test > > > > Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> > > Change-Id: I273ee3e26309d595973ec8040a2d835169096670 > > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2824028 > > Reviewed-by: Sonny Rao <sonnyrao@chromium.org> > > Bug: chromium:1198472 > Change-Id: Icaae5c6698f6747b634952d03ae83668e937c089 > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2822402 > Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> > Commit-Queue: Jeremy Bettis <jbettis@chromium.org> > Commit-Queue: Jack Rosenthal <jrosenth@chromium.org> Bug: chromium:1198472 Change-Id: Iabbfdf2c7af82113d91f9aeba256024b7e59b4f8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2842363 Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Commit-Queue: Jack Rosenthal <jrosenth@chromium.org>
* Reland "zephyr: zmake: Add a test for zmake and output filtering"Simon Glass2021-04-205-3/+748
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 3ea453e890f2f782e8195c94af5de00c8c754f74. Reason for revert: Trying again to see what error is produced Original change's description: > Revert "zephyr: zmake: Add a test for zmake and output filtering" > > This reverts commit ca160a3394c952f0732f66eb113b9735b5655ed2. > > Reason for revert: responsible for CQ failures (crbug.com/1198472) > > BUG=chromium:1198472 > BRANCH=none > TEST=pytest zephyr/zmake/test > > Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> > Change-Id: I273ee3e26309d595973ec8040a2d835169096670 > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2824028 > Reviewed-by: Sonny Rao <sonnyrao@chromium.org> Bug: chromium:1198472 Change-Id: Icaae5c6698f6747b634952d03ae83668e937c089 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2822402 Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Commit-Queue: Jeremy Bettis <jbettis@chromium.org> Commit-Queue: Jack Rosenthal <jrosenth@chromium.org>
* spherion: fix kblight will blinking in DC mode.Ben Chen2021-04-202-1/+2
| | | | | | | | | | | | | | Undefine CONFIG_LOW_POWER_S0, don't enter power saving in S0 state. BUG=b:185438302 BRANCH=asurada TEST=make buildall PASS, the kb light function is PASS. Change-Id: Ife9796c0ada5213cd8d9e9cf9fbb086603b76d1d Signed-off-by: Ben Chen <ben.chen2@quanta.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2830667 Reviewed-by: Ting Shen <phoenixshen@chromium.org>
* asurada: drop CONFIG_BRINGUPEric Yilun Lin2021-04-202-2/+0
| | | | | | | | | | | | | | The power sequence status is stable now. BUG=none TEST=make buildall BRANCH=asurada Change-Id: Ibdf644336f1aaefd185d983cd36efde67614d951 Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2835257 Reviewed-by: Ting Shen <phoenixshen@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org>