summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* ec_commands.h: Remove duplicate wordstabilize-rust-13776.B-mainPatrick Georgi2021-02-061-1/+1
| | | | | | | | | | | | | | | | | Copied from coreboot's copy, modified in https://review.coreboot.org/49531 by Elyes HAOUAS <ehaouas@noos.fr> BUG=none BRANCH=none TEST=none Signed-off-by: Patrick Georgi <pgeorgi@google.com> Change-Id: I7edcb0bdc54d32a7dffecf8055e532b7b3747837 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2633984 Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Commit-Queue: Patrick Georgi <pgeorgi@chromium.org> Tested-by: Patrick Georgi <pgeorgi@chromium.org>
* firmware_builder: add --code-coverage optionPaul Fagerburg2021-02-061-3/+28
| | | | | | | | | | | | | | | | | | Added an option flag --code-coverage that will skip the build for EC hardware targets and build the tests with code coverage enabled. BUG=b:156895937 BRANCH=None TEST=Run firmware_builder.py with --code-coverage option. The 'build' command will do nothing, and the 'test' command will build the host- based unit test with code coverage. Signed-off-by: Paul Fagerburg <pfagerburg@google.com> Change-Id: Ie3786f574e490a5ba6806e518401842bda609e5f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2678937 Tested-by: Paul Fagerburg <pfagerburg@chromium.org> Reviewed-by: LaMont Jones <lamontjones@chromium.org> Commit-Queue: Paul Fagerburg <pfagerburg@chromium.org>
* flash_fp_mcu: Add config for guybrushBhanu Prakash Maiya2021-02-061-0/+16
| | | | | | | | | | | BRANCH=none BUG=b:176826659 TEST=None. Signed-off-by: Bhanu Prakash Maiya <bhanumaiya@google.com> Change-Id: Ia5139265f3f8af6aec7d0c41685f3d3bfa861d1c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2679782 Reviewed-by: Craig Hesling <hesling@chromium.org>
* zephyr: Add support for retimer firmware updatesSimon Glass2021-02-063-0/+21
| | | | | | | | | | | | | | Enable CONFIG_USBC_RETIMER_FW_UPDATE so that retimer chips can be updated on boot. BUG=b:175434113 BRANCH=none TEST=build zephyr for volteer, see that the new code is included Signed-off-by: Simon Glass <sjg@chromium.org> Change-Id: Ie620f322d32bae46c00ff4e8d5477261a7dbe279 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2678926 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* zephyr: zmake: add board-specific DTS overlaysJack Rosenthal2021-02-0610-3/+150
| | | | | | | | | | | | | | | Allow board-specific DTS overlays to be placed at zephyr/dts/board-overlays/${BOARD}.dts in any module. Zmake will find the file and append it to the DTC_OVERLAY_FILE list when discovered. BUG=b:179491802 BRANCH=none TEST=provided unit test passes Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I53d4a04b6056689696b4615b5998937dbcf801c4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2678795 Reviewed-by: Simon Glass <sjg@chromium.org>
* brya: Clone power sequencer from icelakeCaveh Jalali2021-02-062-0/+426
| | | | | | | | | | | | | | | | This clones the icelake power sequencer code as a baseline for brya's custom power sequencer. This is solely intended to highlight the customizations in following patches. BRANCH=none BUG=b:173575131 TEST=buildall passes Change-Id: Ib9f0b986ab617002f987fed26e8aba1f9322a3e1 Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2675308 Reviewed-by: Furquan Shaikh <furquan@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
* brya: Update minimal bootable EC configCaveh Jalali2021-02-066-11/+139
| | | | | | | | | | | | | | This provides a bare minimum bootable configuration for the brya EC using the latest GPIO definitions. The resulting image boots on the EVB and allows us to explore GPIOs. BRANCH=none BUG=b:173575131 TEST=booted on EVB and examined GPIOs Change-Id: I4eb95ec44d2400834630132334f52497dacc5691 Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2677424
* brya: add *gpio.inc filesCaveh Jalali2021-02-062-5/+159
| | | | | | | | | | | | | | | | | | | | This adds the initial GPIO definitions for brya. generated-gpio.inc is extracted from the "EC Pinmux for Brya-Internal Only" google sheets document. gpio.inc is generated manually. Sensors not supported at this early stage, so their interrupt pins are set up as inputs only. BRANCH=none BUG=b:173575131 TEST=buildall passes Cq-Depend: chromium:2677424 Change-Id: Ie05f3cd7f4fdcf1e864d36d0c7b6ff6fb1f99d10 Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2654740 Reviewed-by: Furquan Shaikh <furquan@chromium.org>
* util/update_release_branch.py: Build release branches on normal CQTom Hughes2021-02-051-0/+3
| | | | | | | | | | | | | | | | There appear to be differences in how the firmware CQ and normal CQ build. To avoid breaking the normal CQ, force release branch CLs to run on the normal CQ. BRANCH=none BUG=b:179509333 TEST=none Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I18655d7959451c0f5848e6ada613dd1c52bae5c6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2679768 Commit-Queue: LaMont Jones <lamontjones@chromium.org> Reviewed-by: LaMont Jones <lamontjones@chromium.org>
* zephyr: zmake: Fix zmake default build directory resolutionYuval Peress2021-02-052-15/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | The previous changes to the zmake build system made the incorrect assumption that the build directory exists already as such, running `zmake configure -B $build_dir` with a new non-initialized director would fail since the resolve_build_dir function would fail to recognize it as a valid build directory. The new logic also allows for passing directories which do not yet exist. BRANCH=none BUG=none TEST=pytest zephyr/zmake/tests/test_util.py TEST=zmake configure -B /tmp/z/pos \ zephyr/projects/posix-ec/ \ && zmake -l DEBUG build /tmp/z/pos Signed-off-by: Yuval Peress <peress@chromium.org> Change-Id: I754d4545f8d98cc65270b8d50f327cbb04ce3c87 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2678927 Tested-by: Simon Glass <sjg@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org>
* Revert "zephyr: volteer: enable verbose logging"Simon Glass2021-02-051-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Let's try disabling this and see if Nuvoton's efforts have been successful. This reverts commit eb602fa5a673ffe7b333347af1cebf85f74c4990. BUG=b:179164174, b:179308106, b:179418486 BRANCH=none TEST=boot volteer without any problems (but then I generally did anyway) But I do get log spam still: 21-02-05 14:05:49.779 [92.455200 event set 0x0000000008000000] 21-02-05 14:05:49.779 [92.459300 event clear 0x0000000008000000] 21-02-05 14:05:49.779 [92.462600 ACPI query = 28] 21-02-05 14:05:49.784 [92.465500 HC 0x101] 21-02-05 14:05:49.835 [92.510200 C1: Retimer I2C read err=-6] 21-02-05 14:05:49.835 [92.512300 mux config:0, port:1, rv:-6] 21-02-05 14:05:49.835 [92.516500 HC 0x113] 21-02-05 14:05:49.835 [92.518200 HC 0x103] 21-02-05 14:05:49.835 [92.520100 HC 0x112] 21-02-05 14:05:49.846 [92.522100 HC 0x117] 21-02-05 14:05:49.846 [92.523700 HC 0x113] 21-02-05 14:05:49.846 [92.525600 HC 0x104] 21-02-05 14:05:49.846 +[92.527900 HC 0x11a] 21-02-05 14:05:49.846 [92.529500 HC 0x101] 21-02-05 14:05:49.857 [92.531600 HC 0x104] 21-02-05 14:05:49.857 [92.533300 HC 0x103] 21-02-05 14:05:49.857 [92.536400 HC 0x11a] 21-02-05 14:05:49.857 [92.536900 event set 0x0000000008000000] 21-02-05 14:05:49.857 [92.540900 event clear 0x0000000008000000] (repeats) Change-Id: I2a5710cc396895f8766e4c2a4b37d81cc76d8925 Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2678933 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Tested-by: Jack Rosenthal <jrosenth@chromium.org>
* common: move some structures from .rodata to .dataKeith Short2021-02-054-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move the GPIO tables and the USB PRL states from .rodata to .data on boards that support CONFIG_CHIP_DATA_IN_INIT_ROM. This saves 1600 to 1900 bytes of flash space (and reduces RAM space by the similar amount). Boards affected: delbin_npcx796fc eldrid_npcx796fc halvor lindar lingcod magolor_legacy malefor metaknight_legacy terrador todor trondo voema volteer_apmodeentry volteer waddledoo BUG=none BRANCH=none TEST=make buildall TEST=boot Volteer, run gpioget Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I1a9f421981fb8db4d7ddd62b21d609a401862491 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2677087 Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Commit-Queue: Abe Levkoy <alevkoy@chromium.org>
* zephyr: Add CONFIG_EXTPOWER_GPIO to the shimSimon Glass2021-02-051-0/+2
| | | | | | | | | | | | | | This is not strictly necessary, but shows up as a delta from the existing volteer config. So let's define it. BUG=b:178099673 BRANCH=none TEST=build zephyr and see that extpower_gpio.c is still built Signed-off-by: Simon Glass <sjg@chromium.org> Change-Id: Ica930e9121e041c8159e802c4f86103073410614 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2678788 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* zephyr: Kconfig: add an option for CONFIG_SYSTEM_UNLOCKEDFabio Baltieri2021-02-052-0/+20
| | | | | | | | | | | | | | | Add a Kconfig and matching option for CONFIG_SYSTEM_UNLOCKED, default it to enabled since that's how most boards are setup in ECOS. BUG=b:177604307 BRANCH=none TEST=build and run a Volteer P2 Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Change-Id: Ib85b134fd013654e6be6d758fe999a3e11a59594 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2679522 Reviewed-by: Simon Glass <sjg@chromium.org> Commit-Queue: Simon Glass <sjg@chromium.org>
* zephyr: config: set CONFIG_I2C_CONTROLLER with CONFIG_PLATFORM_EC_I2CFabio Baltieri2021-02-051-0/+1
| | | | | | | | | | | | | | | The config is used by ECOS to add i2c_controller.c (which for Zephyr is done with the config platform option) and also enables calling i2c_prepare_sysjump() on jump_to_image(). BUG=b:177604307 BRANCH=none TEST=build and ran on a Volteer P2 Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Change-Id: Idb635fad500cf16f1890e783d69e1175db69dc89 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2679521 Reviewed-by: Simon Glass <sjg@chromium.org>
* zephyr: Move bbram logic to devicetreeYuval Peress2021-02-058-68/+167
| | | | | | | | | | | | | | | | | Move all bbram logic to a common npcx.dtsi file included in both volteer and kohaku. Updates the bbram access logic in zephyr/shim/src/system.c to use devicetree. Updates the unit tests to match. BRANCH=none BUG=b:178807203 TEST=zmake testall Signed-off-by: Yuval Peress <peress@chromium.org> Change-Id: I2a7c65b92a395c622e8cfe751e4e98b3173e38fb Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2669271 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org>
* core/cortex-m/mpu.c does not compileDenis Brockus2021-02-051-1/+2
| | | | | | | | | | | | | | | | | Fix for loop to be compatible with the tools used in the builders BUG=chromium:1175163, chromium:1175181 BRANCH=none TEST=make buildall Signed-off-by: Denis Brockus <dbrockus@google.com> Change-Id: Ic4d6f1b8aea0e20391eeb0d9496275289a7e21fa Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2678794 Tested-by: Denis Brockus <dbrockus@chromium.org> Auto-Submit: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org> Reviewed-by: Jae Hoon Kim <kimjae@chromium.org> Commit-Queue: Diana Z <dzigterman@chromium.org>
* zephyr: Update KEYBOARD_PWRBTN_ASSERTS_KSIx to be a choiceSimon Glass2021-02-051-4/+19
| | | | | | | | | | | | | | | | | We cannot have both KSI2 and KSI3 selected here, so convert this into a choice. Add a third choice for the case when neither is selected. BUG=b:167405015, b:179482109 BRANCH=none TEST=ninja -C /tmp/z/vol/build-ro/ menuconfig Check the menus look OK Build volteer for zephyr and check that we still have CONFIG_PLATFORM_EC_KEYBOARD_PWRBTN_ASSERTS_KSI2 selected Signed-off-by: Simon Glass <sjg@chromium.org> Change-Id: I0a8de0cf8d60e5d87d3d6d102fcf35c4b8fe06f9 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2678781 Reviewed-by: Keith Short <keithshort@chromium.org>
* zephyr: volteer: Enable volume buttonsSimon Glass2021-02-052-0/+3
| | | | | | | | | | | | | Enable this on volteer since it has volume buttons. BUG=b:167405015 BRANCH=none TEST=build for volteer and see that the new code is included Signed-off-by: Simon Glass <sjg@chromium.org> Change-Id: If98d09cad867d92045655e8d470c99a13a53a1c6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2674956 Reviewed-by: Keith Short <keithshort@chromium.org>
* zephyr: Support volume buttonsSimon Glass2021-02-053-0/+18
| | | | | | | | | | | | | | Add support for volume buttons in Zephyr. BUG=b:167405015 BRANCH=none TEST=with other CLs, build for volteer and see that the new code is included Signed-off-by: Simon Glass <sjg@chromium.org> Change-Id: Id8bd57c4dc36037fc5e4181291623a6f358b8381 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2674955 Reviewed-by: Keith Short <keithshort@chromium.org>
* zephyr: volteer: Enable Fast Role Swap triggered by PPCSimon Glass2021-02-051-0/+2
| | | | | | | | | | | | | | | Volteer uses the Power Path Controller to trigger Fast Role Swap. Enable this in the config. BUG=b:175434113 BRANCH=none TEST=build zephyr with another CL and see that the code is included Signed-off-by: Simon Glass <sjg@chromium.org> Change-Id: I798179b2d21409e9d8d9e7d05c46e2121d30a693 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2677183 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
* zephyr: Add support for Fast Role Swap triggerSimon Glass2021-02-052-0/+57
| | | | | | | | | | | | | Add support for these options so that Fast Role Swap can be enabled. BUG=b:175434113 BRANCH=none TEST=build zephyr with another CL and see that the code is included Signed-off-by: Simon Glass <sjg@chromium.org> Change-Id: I78b68108f9ab50afe137a5010d6024ca07d723f7 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2677182 Reviewed-by: Keith Short <keithshort@chromium.org>
* usb: Correct comments for CONFIG_USB_PD_EXTENDED_MESSAGESSimon Glass2021-02-052-7/+6
| | | | | | | | | | | | | | | Some of the comments are out-of-sync or incorrect for this option. Fix them along with an extra blank line at end-of-file. BUG=none BRANCH=none TEST=build for volteer Signed-off-by: Simon Glass <sjg@chromium.org> Change-Id: I68bc96907b61b16244e114f594adb31ed1438c50 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2677181 Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* zephyr: Correct the USB_PD_REV30 optionSimon Glass2021-02-053-6/+6
| | | | | | | | | | | | | | | This has an extra CONFIG in it. Drop it since it was not intended. BUG=b:175434113 BRANCH=none TEST=build zephyr on volteer Check that CONFIG_USB_PD_REV30 is in fact enabled Signed-off-by: Simon Glass <sjg@chromium.org> Change-Id: Ibb93de1a25ff28d6b2dc29732c60b3ccafd7c0d6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2674958 Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* zephyr: Add support for PD loggingSimon Glass2021-02-053-0/+17
| | | | | | | | | | | | | | | | | | | Enable support for this command. It is not actually used on volteer but seems to be commonly used. BUG=b:175434113 BRANCH=none TEST=build and boot zephyr on volteer and see no errors from EC_CMD_PD_GET_LOG_ENTRY command (0x115) Also test ectool: localhost ~ # ectool pdlog 2020-04-27 18:24:56.460 P0 SNK Charger PD 19776mV / 3000mA, max 20000mV / 3000mA Signed-off-by: Simon Glass <sjg@chromium.org> Change-Id: I30951537ac48c0929cb668cdd2af1e1675696378 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2676611 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
* retimer: PD port retimer firmware update supportli feng2021-02-057-28/+45
| | | | | | | | | | | | | | | | Added one field to struct usb_mux_driver, which returns true if retimer update is supported. Moved query function from usb_retimer_fw_update.c to usb_mux.c. BUG=b:162528867 BRANCH=none TEST=Tested on Voxel, together with related coreboot and kernel changes. EC returns correct port information to kernel. Signed-off-by: li feng <li1.feng@intel.com> Change-Id: I5cab34a14adbf0470cffe6a13234ad53b6f6a90c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2651866 Reviewed-by: Keith Short <keithshort@chromium.org>
* TCPMv2: Check for discard in cable reset stateDiana Z2021-02-051-8/+7
| | | | | | | | | | | | | | | Check for message discard and restore DPM request if cable soft reset doesn't send, then return to Ready to handle the incoming message. BRANCH=None BUG=None TEST=connect Magolor and Madoo together repeatedly and observe the connection is able to stabilize Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I28787f802a8279d318170a304e5aeac6abb03b75 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2676925 Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* TCPMv2: Check charge port when bootingDiana Z2021-02-052-3/+11
| | | | | | | | | | | | | | | | | | When booting into S0, take the current charge port into account when deciding whether to power role swap. If the port has been selected from the UI as a charge port, then refrain from swapping and continue to charge from it. BRANCH=None BUG=b:179334214,b:179095748,b:178070314 TEST=on madoo, connect to magolor and select charging from magolor on the UI. Go through suspend and shutdown iterations and confirm that madoo continues to charge from magolor Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I40ef73309f75372b0a34a7542282244ff30868ed Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2676924 Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* TCPMv2: Consult board before setting power role swap requestDiana Z2021-02-051-0/+4
| | | | | | | | | | | | | | | | | If a board does not want to power role swap (ex. because it is in S5), then do not allow the DPM request for the power role swap to be set. This is equivalent to the logic done when a PR_SWAP message is received by the system. BRANCH=None BUG=b:174726240 TEST=on madoo, plug in phone and shutdown. Verify DUT does not swap to sourcing when in S5 Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: Ia6684006d0de6d9f23bac8bd792c34191fabab14 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2676931 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* zephyr: volteer: Enable POWER_SLEEP_FAILURE_DETECTIONSimon Glass2021-02-051-0/+1
| | | | | | | | | | | | | | Enable this feature for volteer. BUG=b:178099673 BRANCH=none TEST=build volteer for zephyr and see that the code is included Signed-off-by: Simon Glass <sjg@chromium.org> Change-Id: I8eb9b43c80f2da757983972486d3adac589b53ea Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2674948 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Commit-Queue: Jack Rosenthal <jrosenth@chromium.org>
* zephyr: volteer: Enable PWRBTN_ASSERTS_KSI2Simon Glass2021-02-051-0/+1
| | | | | | | | | | | | | | Enable this option on volteer to match ECOS. BUG=b:167405015 BRANCH=none TEST=build for volteer and see that the new code is included Signed-off-by: Simon Glass <sjg@chromium.org> Change-Id: Id36d7af23e6cfeec7fb3e2396fb696e3a8381a00 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2674953 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
* zephyr: Support PWRBTN_ASSERTS_KSI2Simon Glass2021-02-052-0/+24
| | | | | | | | | | | | | | Support these two options for Zephyr. BUG=b:167405015 BRANCH=none TEST=build for volteer and see that the new code is included Signed-off-by: Simon Glass <sjg@chromium.org> Change-Id: I6887de388cf9fa8f2146129aad5058bf4889ff4b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2674952 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
* zephyr: volteer: Enable the keypadSimon Glass2021-02-051-0/+1
| | | | | | | | | | | | | | This is used by some volteer models, so enable it. BUG=b:167405015 BRANCH=none TEST=build for volteer and see that the new code is included Signed-off-by: Simon Glass <sjg@chromium.org> Change-Id: I28daf13348da2bf16a07767d5f75415d6f37fc51 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2674950 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
* zephyr: Support the keypadSimon Glass2021-02-052-0/+12
| | | | | | | | | | | | | Add support for a numeric keypad with Zephyr. BUG=b:167405015 BRANCH=none TEST=build for volteer and see that the new code is included Signed-off-by: Simon Glass <sjg@chromium.org> Change-Id: Ib45c320db979567169297ba7bead5707a3aada0a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2674949 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* zephyr: remove interrupt setting when GPIO initWealian Liao2021-02-051-16/+6
| | | | | | | | | | | | | | | | | | | | | | Zephyr doesn't have specific GPIO interrupt enable/disable functions. Set gpio_pin_configure() with interrupt enable/disable flag will set the interrupt function. This will cause GPIO interrupt is triggered when other modules haven't init. For the original chromium EC GPIO setting, EC doesn't enable GPIO interrupts when GPIO init. This CL removes the GPIO interrupt setting when GPIO init. All the GPIO interrupt setting is in gpio_enable_interrupt(). BUG=b:179217432 BRANCH=none TEST=zmake testall TEST=check doesn't have bus fault when EC boot-up Signed-off-by: Wealian Liao <whliao@nuvoton.corp-partner.google.com> Change-Id: I273134184d63fa16d7d0e7f3bc717449569394e4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2670447 Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Commit-Queue: Jack Rosenthal <jrosenth@chromium.org>
* entry_log: Convert to use new-style interrupt disableSimon Glass2021-02-051-7/+9
| | | | | | | | | | | | | | Update this file to use the irq_lock/unlock() method. BUG=b:175434113 BRANCH=none TEST=make -j30 BOARD=volteer Signed-off-by: Simon Glass <sjg@chromium.org> Change-Id: I25960d9f9848425e5894d515908ec705b815e96f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2674957 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
* i2c_bitbang: save stack space by removing printfTing Shen2021-02-051-10/+9
| | | | | | | | | | | | | | | | | | | | According to stack analyzer, cprintf takes 232 byte stack size. Replace cprintf by cputs on critical paths to save space. After this change, the CHARGER task on juniper takes 200 bytes less (1048 -> 848). BUG=b:179451031 TEST=cherry-pick this CL to kukui branch, run `make analyzestack` BRANCH=kukui Signed-off-by: Ting Shen <phoenixshen@google.com> Change-Id: Ie23820fd4836877d912d6af583e13d43d990f9ee Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2677842 Reviewed-by: Eric Yilun Lin <yllin@chromium.org> Commit-Queue: Eric Yilun Lin <yllin@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Tested-by: Ting Shen <phoenixshen@chromium.org>
* spherion: add new boardEric Yilun Lin2021-02-057-0/+603
| | | | | | | | | | | | | | Copy asurada board with some minor fix to build successfully. BUG=b:178440482 TEST=make BOARD=spherion BRANCH=none Change-Id: Ia679a542460ace781eae0f9d60ad65a25d96eb3c Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2677608 Reviewed-by: Ting Shen <phoenixshen@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org>
* baseboard/asurada: refactor to support baseboard buildEric Yilun Lin2021-02-0510-763/+881
| | | | | | | | | | | | | | | | | | | | | guidelines: 1. sensors are in the board, since this may changes most of the time 2. PPC/Charger/BC12/TCPC/PD are in the baseboard, this is unlikely changing 3. sub-board detection is in the baseboard 4. power signals, power sequence are in the baseboard 5. ADC/PWM this might change, but we keep them in the baseboard for now 6. it5205_sbu is not currently used for now, move it to baseboard 7. battery, led are kept in the board BUG=b:178439840 TEST=boot hayato to OS BRANCH=none Change-Id: I21bf5d1f7901a10c3538ad5646362f2b402652af Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2675328 Reviewed-by: Ting Shen <phoenixshen@chromium.org>
* config.h: fix comment of CONFIG_BOARD_RESET_AFTER_POWER_ONEric Yilun Lin2021-02-051-1/+1
| | | | | | | | | | | | | | The config is supported by ITE chips as well. BUG=none TEST=none BRANCH=none Change-Id: Ib5e4ea4bee8bdc63bb451e4cc8a1133c35bf3dfc Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2675327 Reviewed-by: Ting Shen <phoenixshen@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org>
* vilboz: dynamic changing charge currentSamsp_Liu2021-02-052-0/+83
| | | | | | | | | | | | | | | | | | | This patch base on charger thermistor sensor temperature to dynamic changing charge current. BUG=b:174720890 BRANCH=zork TEST=verify the charge current can be changed when charger thermistor sensor temperature rises and drop. Signed-off-by: Samsp_Liu <Samsp_Liu@compal.corp-partner.google.com> Change-Id: I0ba4c17fcfa6b5b468778865ded53ab494eebe7e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2666554 Tested-by: SamSP Liu <samsp_liu@compal.corp-partner.google.com> Reviewed-by: Elthan Huang <elthan_huang@compal.corp-partner.google.com> Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org>
* Madoo: Lock ECKo_Ko2021-02-051-6/+0
| | | | | | | | | | | | | | | Remove CONFIG_SYSTEM_UNLOCKED for production. BUG=b:168283656 BRANCH=dedede TEST=make BOARD Signed-off-by: Ko_Ko <Ko_Ko@compal.corp-partner.google.com> Change-Id: I9e2ed423facd1b90fb325e5ef73feb673b5a461e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2675323 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org> Tested-by: Aseda Aboagye <aaboagye@chromium.org>
* firmware_builder: add artifact bundlingKevin Shelton2021-02-051-3/+49
| | | | | | | | | | | | | | | | | | | | | Add a new command to bundle artifacts into an (optionally specified) directory and write associated metadata to an (optionally specified) file. BUG=b:176926834 BRANCH=none TEST=./firmware_builder.py --metrics=/tmp/metrics bundle, ./firmware_builder.py --output-dir=/tmp/testbundle --metrics=/tmp/metrics --metadata=/tmp/testmetadata bundle, inspected that the file utility reports a sample resultant artifact as bzip2 compressed data Signed-off-by: Kevin Shelton <kmshelton@chromium.org> Change-Id: Ic58fecd3e3d572acfa1798c0ab15a4c8c558f908 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2643803 Reviewed-by: LaMont Jones <lamontjones@chromium.org> Commit-Queue: LaMont Jones <lamontjones@chromium.org> Tested-by: LaMont Jones <lamontjones@chromium.org>
* copano: Implement keyboard matrixJacky Wang2021-02-052-1/+26
| | | | | | | | | | | | | | | | Base on keyboard spec, modify the keyboard related setting. BUG=b:179098198,b:179224595 BRANCH=firmware-volteer-13672.B TEST=make BOARD=copano 1. Verify keyboard function behavior. Signed-off-by: Jacky Wang <jacky5_wang@pegatron.corp-partner.google.com> Change-Id: Ia8e36461a29c9f184af185a76430fb6a91e1ec61 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2666562 Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Michael5 Chen <michael5_chen1@pegatron.corp-partner.google.com> Reviewed-by: Zhuohao Lee <zhuohao@chromium.org>
* retimer: support retimer firmware updateli feng2021-02-0511-5/+361
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To support AP to update firmware during boot up, one byte EC RAM is allocated for AP <-> EC communication. AP queries PD port/requests EC to perform operations via EC_CMD_ACPI_WRITE; and fetches result from EC via EC_CMD_ACPI_READ. The flow is: 1. AP queries EC PD ports which port supports retimer firmware update. 2. AP queries current MUX. 3. a) If no device attached, AP requests EC to suspend PD task of the port. Then AP requests EC to set MUX to USB mode, Safe mode, TBT mode. After entering TBT mode, the OS can either enumerate the retimers or do firmware update on the enumerated retimers. Once done, AP requests EC to disconnect MUX and resume PD task. 3. b) If device attached, AP moves on as usual. Retimer firmware update is not performed. BUG=b:162528867 BRANCH=none TEST=Tested NDA case on Voxel board, together with coreboot and kernel changes. Coreboot changes are merged. Kernel patches list is: https://chromium-review.googlesource.com/c/chromiumos/ third_party/kernel/+/2670719 After power up, host scans retimers, in sysfs localhost ~ # ls /sys/bus/thunderbolt/devices/ 0-0 0-0:1.1 0-0:3.1 domain0 On PD port 1, manually update retimer firmware. Copy firmware to nvm_non_active1/nvmem, then authenticate it. Host starts flow to update firmware. After it's done, PD port 1 resumes. Hotplug DP dongle/TBT device, devices should function fully. TEST=Tested DA cases on Voxel board, together with coreboot and kernel changes. USB4/TBT devices function as usual. Signed-off-by: li feng <li1.feng@intel.com> Change-Id: Ie976e75f892d5caf48a948598a058a4f42e07eb3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2594492 Reviewed-by: Keith Short <keithshort@chromium.org>
* dartmonkey: Remove stm32f_rtc testTom Hughes2021-02-051-1/+0
| | | | | | | | | | | | | | The stm32f_rtc test is specific to the STM32F series, but dartmonkey is a STM32H series chip. BRANCH=none BUG=b:170432597 TEST=make BOARD=dartmonkey tests -j Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: Iff8f29444b4ac46482cbc526f0164ca3fef1752c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2676005 Reviewed-by: Craig Hesling <hesling@chromium.org>
* zephyr: Support POWER_SLEEP_FAILURE_DETECTIONSimon Glass2021-02-052-0/+15
| | | | | | | | | | | | | | Add support for this feature which is used on some x86 systems. BUG=b:178099673 BRANCH=none TEST=build volteer for zephyr make BOARD=volteer -j8 Signed-off-by: Simon Glass <sjg@chromium.org> Change-Id: I607a96cd79496534da08b050f2e43fd82c351e58 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2643619 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* test: Only run UART fpsensor test on bloonchipperTom Hughes2021-02-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | dartmonkey does not have UART transport enabled, so the test will fail. BRANCH=none BUG=b:170432597 TEST=On icetower v0.1 with servo micro and jlink: ./test/run_device_tests.py --board dartmonkey --test \ fpsensor_uart_ro \ fpsensor_uart_rw \ fpsensor_spi_ro \ fpsensor_spi_rw TEST=On bloonchipper v0.2 with servo micro and jlink: ./test/run_device_tests.py --board bloonchipper --test \ fpsensor_uart_ro \ fpsensor_uart_rw \ fpsensor_spi_ro \ fpsensor_spi_rw Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I0268adf1a306dd7c569f4174bbf714996ac8011c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2669416 Reviewed-by: Craig Hesling <hesling@chromium.org>
* zephyr: volteer: add missing interrupt for ec_wp_lFabio Baltieri2021-02-041-0/+2
| | | | | | | | | | | | | | | | | | | | Spotted this in the log messages: [00:00:00.043,000] <err> gpio_shim: No interrupt defined for GPIO EC_WP_L Adding the missing definition. BUG=none BRANCH=none TEST=no error anymore Change-Id: If4e48ff8e1f05c9fde8db29547b98c0600fc9015 Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2675905 Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* zmake: allow zmake build/test to target project directoriesYuval Peress2021-02-043-30/+63
| | | | | | | | | | | | | | | | | | | | | | Allows zmake to use the default platform/ec/build directory when running the build/test subcommand. Developers can now simply point to the actual projects without having to worry about where the build is being done. BRANCH=none BUG=none TEST=Added/modified unit tests TEST=zmake configure zephyr/test/system && \ zmake build zephyr/test/system && \ zmake test zephyr/test/system && \ echo SUCCESS TEST=rm -fr build/zephyr/test/system ; \ zmake build zephyr/test/system || echo SUCCESS Signed-off-by: Yuval Peress <peress@chromium.org> Change-Id: Id830f8dffc30f641fff0cd5ff50d30b2efedeece Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2665072 Reviewed-by: Simon Glass <sjg@chromium.org>