summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* zephyr: config: drop few more redundant optionsstabilize-15335.B-mainFabio Baltieri2023-01-315-11/+0
| | | | | | | | | | | | | | | | Now that http://crrev.com/c/4126617 has been submitted we should not get anymore of these, drop the last remaining few that are triggering presubmit warnings. BRANCH=none BUG=none TEST=./util/check_zephyr_project_config.py -d $( find -name '*.conf' ) TEST=zmake compare-builds -a Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Change-Id: Ifc19bb531cc18bae7c5c47cb8110ed710b6bd65b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4188746 Reviewed-by: Tristan Honscheid <honscheid@google.com>
* Asurada: move isl9238c_hibernate to board_hibernateSue Chen2023-01-311-2/+5
| | | | | | | | | | | | | move isl9238c_hibernate from board_hibernate_late to board_hibernate. BUG=b:247925239 BRANCH=asurada TEST=hibernate Change-Id: Ie7130fac68ce045da18bbe369c14d07d5253d017 Signed-off-by: Sue Chen <sue.chen@quanta.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4165983 Reviewed-by: Ting Shen <phoenixshen@chromium.org>
* xivu: modify form_factor motionsene functionmatt_wang2023-01-311-13/+34
| | | | | | | | | | | | | | | | Disable the tablet mode motionsense function when unit is 180 sku. BUG=b:265752765 BRANCH=nissa TEST=The 180 SKU DTT Platform Type is not the tablet mode. And the 360 SKU can get the correct clamshell mode or the tablet mode. LOW_COVERAGE_REASON=Skyrim board tests not created yet: b/247151116 Change-Id: I2ce7976dac02b2baf29da392f839e9ef06aaf057 Signed-off-by: matt_wang <matt_wang@compal.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4199253 Reviewed-by: Peter Marheine <pmarheine@chromium.org> Reviewed-by: SamSP Liu <samsp_liu2@compal.corp-partner.google.com>
* markarth: modify thermal sensormatt_wang2023-01-312-4/+34
| | | | | | | | | | | | | | Markarth change the thermal sensor from PCT2075 to F75303. LOW_COVERAGE_REASON=no unit tests for Markarth yet, b/247151116 BUG=b:262409595 BRANCH=none TEST=zmake build markarth success Change-Id: I6fd0bb506d1daa78b2f729f62d96c09375583ceb Signed-off-by: matt_wang <matt_wang@compal.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4145105 Reviewed-by: Diana Z <dzigterman@chromium.org>
* Omnigul : Enable Battery parameter.Logan_Liao2023-01-312-27/+29
| | | | | | | | | | | | | | | | | | According to the power team, modify the battery parameter for Omnigul. BUG=b:263691095 BRANCH=none TEST=make BOARD=omnigul Change-Id: I85c85803bcf1140c32cf12ad4cab56614b1304cb Signed-off-by: Logan_Liao <Logan_Liao@compal.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4160821 Reviewed-by: Logan Liao <logan_liao@compal.corp-partner.google.com> Commit-Queue: Kyle Lin <kylelinck@google.com> Reviewed-by: Kyle Lin <kylelinck@google.com> Code-Coverage: Kyle Lin <kylelinck@google.com> Tested-by: Logan Liao <logan_liao@compal.corp-partner.google.com> Reviewed-by: Elthan Huang <elthan_huang@compal.corp-partner.google.com>
* Casta : Change Maximum Voltage of BatteryYongBeum.Ha2023-01-311-1/+1
| | | | | | | | | | | | | Change max voltage of battery to 8600mV BUG=b:266123223 BRANCH=firmware-octopus-11297.B TEST= build, update and check charging voltage Change-Id: I4caaf30dceb87dc8de6c41aa2e996f89fc7f00d8 Signed-off-by: YongBeum.Ha <ybha@samsung.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4199244 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* zephyr/app/ec/ec_app_main: Fix timer handle allocationRobert Zieba2023-01-311-1/+1
| | | | | | | | | | | | | | | The timer struct used for preventing sleep within 15 seconds of boot was incorrectly placed on the stack. Change the struct to a static global. BRANCH=none BUG=b:249314949 TEST=Builds and runs on rex device Change-Id: Ia4818524847f587aec098c5cf1f897f45c22da50 Signed-off-by: Robert Zieba <robertzieba@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4205805 Reviewed-by: Scott Collyer <scollyer@chromium.org> Commit-Queue: Scott Collyer <scollyer@chromium.org>
* Nautilus : Change Maximum Voltage of BatteryYongBeum.Ha2023-01-311-1/+1
| | | | | | | | | | | | | Change max voltage of battery to 8600mV BUG=b:266123223 BRANCH=firmware-octopus-11297.B TEST= build, update and check charging voltage Change-Id: Iccb17ad8e503e8743a4de591d79375810f86c2f8 Signed-off-by: YongBeum.Ha <ybha@samsung.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4199246 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* zephyr/test/skyrim: Add baseboard USB PD testsRobert Zieba2023-01-315-0/+308
| | | | | | | | | | | | | Add baseboard USB PD tests. BRANCH=none BUG=b:247151116 TEST=Ran tests Change-Id: Ie6e5ac2b6caa93e3d0f166c4d957ee96973e0c2d Signed-off-by: Robert Zieba <robertzieba@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4148775 Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* include/ioexpander: Change inline definitions to static inlineRobert Zieba2023-01-311-5/+5
| | | | | | | | | | | | | | | | These functions are currently defined as `inline`. The definition of these functions is only visible within the current compilation unit which causes linker errors when attempting to use these functions in tests. Change declarations to `static inline` to resolve this. BRANCH=none BUG=b:247151116 TEST=Built Change-Id: Ief4a8db87c823f6d2c0fb9d08b000ebe49c469ea Signed-off-by: Robert Zieba <robertzieba@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4148774 Reviewed-by: Diana Z <dzigterman@chromium.org>
* zephyr/test: Add initial skyrim test frameworkRobert Zieba2023-01-3111-0/+169
| | | | | | | | | | | | | Add the initial file structure for skyrim board tests. BRANCH=none BUG=b:247151116 TEST=Ran tests Change-Id: Ie557b9184f81b095e3840bec7ab1c976742e3525 Signed-off-by: Robert Zieba <robertzieba@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4148773 Reviewed-by: Diana Z <dzigterman@chromium.org>
* Zephyr: Add STM32G473 chipsetBrian J. Nemec2023-01-304-0/+66
| | | | | | | | | | | | | | Adds board files for the STM32G473 chipset. BUG=b:243700103 BRANCH=None TEST=None Change-Id: I428274d65c4acbccee9973b6364bad64f8ac3cf0 Signed-off-by: Brian Nemec <bnemec@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4201464 Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
* Zephyr: Add configs for F75303matt_wang2023-01-3011-8/+195
| | | | | | | | | | | | | | | | | | The F75303 driver needs a Kconfig, and needs to build in zephyr. Add support to the device tree parsing and definition for the F75303 i2c temperature sensors. LOW_COVERAGE_REASON=no emulator for the F75303. b:266089368 BUG=b:262409595 BRANCH=none TEST=build the project that using the F75303 success.(mushu nami markarth) Change-Id: Id769718fbcda3e4213c50c90c9c7918bc0a31a43 Signed-off-by: matt_wang <matt_wang@compal.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4142061 Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Chao Gui <chaogui@google.com> Reviewed-by: Chao Gui <chaogui@google.com>
* fan: update fan stalled value reportingSumeet Pawnikar2023-01-301-1/+5
| | | | | | | | | | | | | | | | | | | Report fan stalled value as 0 instead of 0xfffe so userspace applications can take an appropriate action based on this to control the fan. BUG=b:261701530, b:266221111 TEST=Built and tested on Skolas BRANCH=None Change-Id: I0e9d80e7982fd61d512621bf85a4873a387e33ef Signed-off-by: Sumeet Pawnikar <sumeet.r.pawnikar@intel.com> Signed-off-by: poornima tom <poornima.tom@intel.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4160829 Code-Coverage: Sumeet Pawnikar <sumeet.r.pawnikar@intel.corp-partner.google.com> Tested-by: Sumeet Pawnikar <sumeet.r.pawnikar@intel.corp-partner.google.com> Reviewed-by: Sumeet Pawnikar <sumeet.r.pawnikar@intel.corp-partner.google.com> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* winterhold: Modify thermal configLeila Lin2023-01-302-7/+104
| | | | | | | | | | | | | | | | | | | Modify amb sensor's thermal config. Change soc/cpu sensor's fan config when thermal mode change. LOW_COVERAGE_REASON=no unit tests for skyrim yet, b/247151116 BUG=b:255732503 BRANCH=none TEST=verify the thermal config on winterhold is correct Change-Id: I8351af7ea6de778503dff2fae2d08eccd69a3b3e Signed-off-by: Leila Lin <leilacy_lin@compal.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4165999 Reviewed-by: Josh Tsai <josh_tsai@compal.corp-partner.google.com> Tested-by: LeilaCY Lin <leilacy_lin@compal.corp-partner.google.com.test-google-a.com> Reviewed-by: Elthan Huang <elthan_huang@compal.corp-partner.google.com> Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: LeilaCY Lin <leilacy_lin@compal.corp-partner.google.com.test-google-a.com>
* pujjo: Increase OCP level margin to prevent OCPtony.tang2023-01-301-0/+3
| | | | | | | | | | | | | Increase OCP level margin to prevent OCP BUG=b:263996465 BRANCH=none TEST=zmake build pujjo Change-Id: I24152d5ad435182637889b6eebada8c92c1c3e43 Signed-off-by: tony.tang <tony.tang@lcfc.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4179441 Reviewed-by: Peter Marheine <pmarheine@chromium.org>
* RAA489000: support modify OCP level margintony.tang2023-01-302-0/+19
| | | | | | | | | | | | | support modify OCP level margin BUG=b:263996465 BRANCH=none TEST=zmake build pujjo Change-Id: I53a88053b0d1fee80b0e53c0e6bd7ece671b3c67 Signed-off-by: tony.tang <tony.tang@lcfc.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4154456 Reviewed-by: Peter Marheine <pmarheine@chromium.org>
* winterhold: adjusts phase comparator threshold offsetjohnwc_yeh2023-01-301-0/+3
| | | | | | | | | | | | | | | | Modify 0x39 Forward Buck Phase Comparator Threshold Offset bit<15:13> from 000=0mV to 100=-4mV. BUG=b:265862821 BRANCH=none TEST=fix charger stuck in CCM problem and S5 power consumption can meet < 0.5W criteria. Change-Id: Ifd2c0ddd9403670ca6cebca93f9e84cd09682fba Signed-off-by: johnwc_yeh <johnwc_yeh@compal.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4179443 Reviewed-by: Elthan Huang <elthan_huang@compal.corp-partner.google.com> Reviewed-by: Diana Z <dzigterman@chromium.org>
* charger/isl9238c: Add BUCK_PHASE_VOLTAGE configjohnwc_yeh2023-01-305-0/+24
| | | | | | | | | | | | | | | | Adjusts the phase comparator threshold offset for forward buck and buck-boost. LOW_COVERAGE_REASON=No isl9238c emulator BUG=b:265862821 BRANCH=none TEST=fix charger stuck in CCM problem and S5 power consumption can meet < 0.5W criteria. Change-Id: Idc10c266e97c104f221eabc51b28c6c243ce17be Signed-off-by: johnwc_yeh <johnwc_yeh@compal.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4179434 Reviewed-by: Diana Z <dzigterman@chromium.org>
* craask: Config to reduce flash sizeAndrew McRae2023-01-271-0/+4
| | | | | | | | | | | | | | Disable extended console help: ~3500 bytes BUG=b:266867807 TEST=Verify on nivviks BRANCH=none Change-Id: Iac09f1b5048997e6a481b476fa2abf8db4a6dbb6 Signed-off-by: Andrew McRae <amcrae@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4199235 Commit-Queue: Keith Short <keithshort@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
* zephyr: validate ZEPHYR_BASE path is valid before precheckAl Semjonovs2023-01-271-0/+6
| | | | | | | | | | | | | | | | | When ZEPHYR_BASE is invalid, we get a failed import error on preupload CL checks. Provide a more informative error message when ZEPHYR_BASE points to a bad path. BUG=None BRANCH=NONE TEST=export ZEPHYR_BASE="platform/ec" preupload verify error Change-Id: Ie08a36185818a102aae02c2f3422992b2094bd65 Signed-off-by: Al Semjonovs <asemjonovs@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4199169 Reviewed-by: Tristan Honscheid <honscheid@google.com>
* docs: Fix iconJeremy Bettis2023-01-271-1/+1
| | | | | | | | | | | | | | | | The icon url changed in gerrit, point to the current location. BRANCH=None BUG=None TEST=See preview Change-Id: I88392e12971ef7c93be5533d8d68276558efee92 Signed-off-by: Jeremy Bettis <jbettis@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4199171 Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org> Auto-Submit: Jeremy Bettis <jbettis@chromium.org> Commit-Queue: Paul Fagerburg <pfagerburg@chromium.org> Tested-by: Jeremy Bettis <jbettis@chromium.org>
* Skyrim: Reduce flash usageDiana Z2023-01-271-2/+2
| | | | | | | | | | | | | | | Remove extended shell help and the TCPC dump command to free up more flash space on skyrim platforms. BRANCH=None BUG=None TEST=build and confirm we now have less than 95% of flash used Change-Id: Ie9edf26e70f27aefd14301bbdabb18da75e999a2 Signed-off-by: Diana Z <dzigterman@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4199172 Reviewed-by: Robert Zieba <robertzieba@google.com> Commit-Queue: Robert Zieba <robertzieba@google.com>
* util: check_zephyr_project_config: ignore west modulesFabio Baltieri2023-01-272-5/+3
| | | | | | | | | | | | | | | | | Currently parse_modules load all Zephyr modules if west is installed on the system, which breaks this presubmit check if it is run outside of the chroot and west is installed. Fix that by passing EC_BASE as modules instead of extra_modules, which prevents the west list to be parsed in the first place. BRANCH=none BUG=none TEST=./util/check_zephyr_project_config.py -d $( find -name '*.conf' ) Change-Id: I43ec7dff6c2b1a4e289d7afe4a9c807a2646f531 Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4188745 Reviewed-by: Al Semjonovs <asemjonovs@google.com>
* usbc-pd: Log with labels should honor debug levelAndrew McRae2023-01-272-2/+2
| | | | | | | | | | | | | | | | | | | | | | Even if labels are not enabled, honor the debug level and do not log if the debug level == 0. It would be better if label support was decoupled from the logging level, since it may be useful to selectively enable some level of debugging even without labels (albeit perhaps not that useful). Logging always when labels are off and debug level == 0 may not be desired, since in some cases the cost of logging is high. BUG=b:266879860 TEST=Verify on nivviks that logs do not appear when the debug level is TEST=fixed at 0. BRANCH=none Change-Id: Ia271581cf72df2a3598e941b4d984d1472de0c04 Signed-off-by: Andrew McRae <amcrae@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4199236 Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Diana Z <dzigterman@chromium.org>
* zephyr/app/ec/ec_app_main: Add support for disabling sleep from bootRobert Zieba2023-01-272-0/+30
| | | | | | | | | | | | | | | Legacy EC code on some platforms disables sleep for the first 15 seconds following boot by default. Add the same functionality to zephyr. BRANCH=none BUG=b:249314949 TEST=Built and ran on skyrim device, verified sleep disabled Change-Id: I9c3f868d6d5a4d55d14b341bc1c4b304edd5be88 Signed-off-by: Robert Zieba <robertzieba@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4179368 Reviewed-by: Diana Z <dzigterman@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
* docs: Add doc for puprJeremy Bettis2023-01-272-0/+20
| | | | | | | | | | | | | | | | Add a doc explaining what to do with pupr cls. BRANCH=None BUG=b:261258378 TEST=None Change-Id: Idf2cc0d26f225056ba5e9d841626cb9a6101f42a Signed-off-by: Jeremy Bettis <jbettis@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4198453 Auto-Submit: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org> Tested-by: Jeremy Bettis <jbettis@chromium.org>
* zephyr: emul: update EMUL_DT_INST_DEFINE API usageFabio Baltieri2023-01-2720-21/+25
| | | | | | | | | | | | | | | | | Update various instances of the EMUL_DT_INST_DEFINE to set the extra argument introduced in: 6062914cf2 emul: Add support for backend APIs BRANCH=none BUG=none TEST=./twister Cq-Depend: chromium:4200298 Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Change-Id: I2bcec5786e78840fd552dcbde1b50f6941a23f05 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4188744 Reviewed-by: Keith Short <keithshort@chromium.org>
* rex: suppress anti-ghosting on recovery keysHarsha B R2023-01-271-0/+3
| | | | | | | | | | | | | | | | | This patch with fix the ESC + REF + PWR_BTN issue with rex. Though GSC recognizes REF + PWR_BTN, EC fails/miss the ESC key press. BUG=b:260555509 TEST=Recovery key combo works fine on rex BRANCH=none Change-Id: I6f604c8711374cf88a4e264b306735401d26c635 Signed-off-by: Harsha B R <harsha.b.r@intel.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4189601 Reviewed-by: Li1 Feng <li1.feng@intel.com> Reviewed-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Kshitij Shah <tij@google.com>
* board/hyperdebug: Split board.c into several filesJes B. Klinke2023-01-265-514/+537
| | | | | | | | | | | | | | In preparation for more board-specific logic for HyperDebug, this CL breaks GPIO and SPI parts of board.c into separate files. BUG=none TEST=make BOARD=hyperdebug Change-Id: I2df152e3aada246264ca2f9d0cb7722b1fda3477 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4166663 Commit-Queue: Jes Klinke <jbk@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org> Tested-by: Jes Klinke <jbk@chromium.org>
* zephyr/test: Fix TYPEC_VDM_RESPONSE paramstabilize-15329.59.B-mainstabilize-15329.44.B-mainrelease-R111-15329.B-mainCaveh Jalali2023-01-261-1/+1
| | | | | | | | | | | | | | | | The EC_CMD_TYPEC_VDM_RESPONSE host command takes a 'struct ec_params_typec_vdm_response' as input, not 'struct ec_params_typec_status'. These structs are identical, so no functional change is introduced. BRANCH=none BUG=b:258110734,b:208884535 TEST='./twister -v -T zephyr/test' passes Change-Id: I583ed1b24eadf7cd3e4c751346337525342d4327 Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4195665 Reviewed-by: Boris Mittelberg <bmbm@google.com>
* zephyr: west manifestAl Semjonovs2023-01-251-0/+44
| | | | | | | | | | | | | | Create a manifest for west initialization BUG=None BRANCH=NONE TEST=west init west update Change-Id: I2480cf7c3750fdc0d3e628da70fb75fb90496b40 Signed-off-by: Al Semjonovs <asemjonovs@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4189422 Reviewed-by: Yuval Peress <peress@google.com>
* flash_fp_mcu: Dynamically determine gpiochip number for volteerPatryk Duda2023-01-251-18/+18
| | | | | | | | | | | | | | | | | Volteer-kernelnext uses upstream kernel which changes every week. In this case it's cumbersome to hardcode gpiochip number in the script and we should determine it dynamically. BUG=b:266463371 BRANCH=none TEST=Run `flash_fp_mcu --hello` on volteer and volteer-kernelnext Change-Id: I80e32d9ce3a291d1ace886a1c1cd2508dca7fdb9 Signed-off-by: Patryk Duda <pdk@semihalf.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4193840 Tested-by: Patryk Duda <patrykd@google.com> Commit-Queue: Patryk Duda <patrykd@google.com> Reviewed-by: Josie Nordrum <josienordrum@google.com>
* board/hyperdebug: Enable DFUJes B. Klinke2023-01-254-4/+44
| | | | | | | | | | | | | | | Configure HyperDebug board similar to Servo V4, in that the RO copy of the firmware is replaced with a 4kB bootloader, whose only task is to decide whether to jump to STM ROM DFU bootloader or to RW. BUG=b:192262089 TEST=Upgrade firmware on STM32L5 based Nucleo board using dfu-util Change-Id: I5a9461a5a9b28642b274f26affa1c64a4c2bfe11 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4183942 Reviewed-by: Brian Nemec <bnemec@google.com> Commit-Queue: Jes Klinke <jbk@chromium.org> Tested-by: Jes Klinke <jbk@chromium.org>
* common: Allow boards to opt out of image paddingJes B. Klinke2023-01-253-0/+6
| | | | | | | | | | | | | | | | | | | | | The HyperDebug board uses the DFU bootloader in the same way as Servo V4 is going to, meaning that the RO section is 4kB and the RW section takes up the rest of the 512kB flash space. Currently, less than 64kB of actual code is in the RW. In order to make image files smaller, and speed up DFU flashing by a factor of ten, I want the option of not having the ec.bin image padded to the size of the flash space. This CL introduces a CONFIG_IMAGE_PADDING, which defaults to being enabled. TEST=make BOARD=hyperdebug, then flash the smaller image using DFU BUG=b:192262089 Change-Id: I12cdd4f7b7a3e48c9c7640bafa2d6f10e4ca24f7 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4193070 Commit-Queue: Jes Klinke <jbk@chromium.org> Tested-by: Jes Klinke <jbk@chromium.org> Reviewed-by: Wai-Hong Tam <waihong@google.com>
* chip/stm32: Modification to DFU for STM32L5Jes B. Klinke2023-01-253-18/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The STM32L5 series behaves the same as STM32L4 to a large degree, so this CL adds code to enable RTC clock on L5 using the same register bits as on L4. The "backup registers" however, sit in a new "Tamper" component on L5, and not in the RTC component as on L4. This CL adds register declarations for the TAMP component. Lastly, jumping to the ROM bootloader with C function pointer call, as was done in jump_to_dfu(), does not work on the STM32L5 ROM bootloader (at least not on my Nucleo-X552EZ board.) The flaw seems to be that an ARM vector table contains a reset vector, and separately contains an initial value for the stack register. The previous code made no attempt at setting the stack point as the bootloader expected, and depending on how the EC code (and the STM ROM bootloader) is compiled, this may or may not work. This CL adds assembly code to set the stack pointer to the value given in the ROM header, before performing the jump. BUG=b:192262089 TEST=Upgrade firmware on STM32L5 based Nucleo board using dfu-util Change-Id: I2a871f0eaf9ea9f4c27c75ccb472cd4ff9616524 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4190164 Reviewed-by: Brian Nemec <bnemec@google.com> Tested-by: Jes Klinke <jbk@chromium.org> Commit-Queue: Jes Klinke <jbk@chromium.org>
* TCPMv2: Clear DPM state on disconnectDiana Z2023-01-252-0/+62
| | | | | | | | | | | | | | When a partner disconnects, clear the DPM state so stale data from it won't be presented to the AP. BRANCH=None BUG=b:208884535 TEST=./twister -T ./zephyr/test Change-Id: Idf800b6c5c223e67c72c2124fb111fad27ce6361 Signed-off-by: Diana Z <dzigterman@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4179363 Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* Test: Add test for VDM:Attention deliveryDiana Z2023-01-251-0/+247
| | | | | | | | | | | | | | Add unit tests to ensure we deliver VDM:Attention properly up to the AP with messages in the correct order. BRANCH=None BUG=b:208884535 TEST=./twister -T ./zephyr/test Change-Id: I922b391e6d2fb9c969063be2b8d2e492fe8e74b3 Signed-off-by: Diana Z <dzigterman@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4171492 Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* TCPMv2: Add host command VDM:Attention retrievalDiana Z2023-01-254-1/+30
| | | | | | | | | | | | | | | Add onto the existing VDM_RESPONSE host command to allow the AP to retrieve VDM:Attention messages. BRANCH=None BUG=b:208884535 TEST=build, deploy on skyrim and confirm ectool shows Attention messages from the queue until it empties Change-Id: Ice2e23b745f0faf892d2fd598c6e573e63e6a982 Signed-off-by: Diana Z <dzigterman@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4171491 Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* TCPMv2: Queue Attention messages for consumptionDiana Z2023-01-255-6/+142
| | | | | | | | | | | | | | | Set up a queue within the DPM to hold VDM:Attention messages which the AP will be able to deplete at its leisure. BRANCH=None BUG=b:208884535 TEST=builds with and without AP VDM control Change-Id: Ia73ac3c6164251ab021776fdca252033646797dd Signed-off-by: Diana Z <dzigterman@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4171490 Code-Coverage: Aaron Massey <aaronmassey@google.com> Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* TCPMv2: Rearrange VDM response HC contentsDiana Z2023-01-255-22/+18
| | | | | | | | | | | | | | | | | | The AP would like to consume VDM:Attention packets in the same host command as the VDM responses. To support this, pull the previous return error into a response structure field instead. Also correct an incorrect struct for the VDM response test utility (though it is functionally equivalent to the TYPEC_STATUS struct). BRANCH=None BUG=b:208884535 TEST=./twister -T ./zephyr/test Change-Id: I5d976dda6be40b72de15e84f4bbd9311d908a904 Signed-off-by: Diana Z <dzigterman@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4171489 Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* util: check_zephyr_project_config: keep paths as Path objectsFabio Baltieri2023-01-252-14/+14
| | | | | | | | | | | | | | Use Path objects for ZEPHYR_BASE and use the site module to add module paths instead modifying sys.path. BRANCH=none BUG=none TEST=pytest Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Change-Id: If6f3b60d90d9acaff91609d55acffbfb605e0961 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4188740 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* zephyr: zmake: Add config and device tree check capability to compare-buildsMadhurima Paruchuri2023-01-254-48/+178
| | | | | | | | | | | | | | | | | The invocation of command with -con arg now will compare config files, -dt will compare devicetree files along with binary files and outputs the failed projects lists separately along with combined list. With -bin arg now binaries comparisons can be avoided. BUG=b:262374758 BRANCH=none TEST=zmake compare-builds it8xxx2_evb -bin -con -dt TEST=Modified dt and config in Rex and saw comparison failing Change-Id: I29751c640b833792f6bfbacbdb80b9119bdb8efc Signed-off-by: Madhurima Paruchuri <mparuchuri@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4169805 Reviewed-by: Fabio Baltieri <fabiobaltieri@google.com>
* herobrine: Delay enabling 5V if battery is disconnectedYu-An Chen2023-01-242-30/+82
| | | | | | | | | | | | | | | | Wait negotiated VBUS transition before enabling 5V rail when battery is disconnected BUG=b:260192201 BRANCH=none TEST=zmake build evoker TEST=./twister -T zephyr/test/herobrine Change-Id: Ieebd10ea32b26e9f1f3f3e438351ba519ae1b337 Signed-off-by: Yu-An Chen <yu-an.chen@quanta.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4123671 Reviewed-by: Wai-Hong Tam <waihong@google.com> Commit-Queue: Wai-Hong Tam <waihong@google.com>
* chip/stm32: Correction to EXTI register declarations for STM32L5Jes B. Klinke2023-01-243-13/+60
| | | | | | | | | | | | | | | | | | Originally, I copied STM32L4 declarations for STM32L5, making adjustments for base addresses, and other obvious differences. It turns out that the external interrupt controller has som subtle changes to its registers. Most notably the EXTICR registers (used for selection which external pin is routed to which of the 16 edge detection "engines") have been moved from the SYSCFG component into EXTI component. BUG=b:192262089 TEST=Observe edge detection working on HyperDebug (based on STM32L5) Change-Id: I4ad4f2559c60bef73a29812ebac1316cfa389a3e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4166670 Commit-Queue: Jes Klinke <jbk@chromium.org> Tested-by: Jes Klinke <jbk@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* common/build.mk: Allow shmalloc/shared_mem in RW when using DFUJes B. Klinke2023-01-231-1/+11
| | | | | | | | | | | | | | | | | | | | | | | CONFIG_MALLOC can ordinarily be used to control whether shmalloc.o or shared_mem.o is linked, with the latter being the automatic default is CONFIG_MALLOC is disabled in either or both of RO and RW. CONFIG_DFU_BOOTMANAGER_MAIN was introduced, allowing the RO stage to be completely replaced by a 4Kb bootloader, but it had the unintended side effect that NEITHER shmalloc.o nor shared_mem.o will be linked with the RW stage. Thic change makes it such that of of the shared memory files are linked into the RW stage, depending on the setting of CONFIG_MALLOC. BUG=b:192262089 TEST=make BOARD=hyperdebug Change-Id: Ie21ffb772447d4817632210656f9820bfad4946a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4183954 Reviewed-by: Brian Nemec <bnemec@google.com> Commit-Queue: Jes Klinke <jbk@chromium.org> Tested-by: Jes Klinke <jbk@chromium.org>
* common/hooks.h: Tolerate same function registered as multiple hooksJes B. Klinke2023-01-231-4/+4
| | | | | | | | | | | | | | | | | | The file clock-stm32l4.c registers the function clock_chipset_startup as both HOOK_CHIPSET_STARTUP and HOOK_CHIPSET_RESUME. Before this change, compiling with hooks disabled would lead to a linker error as a function unused_hook_clock_chipset_startup() would be declared twice. This change makes it such that the hook, as well as the name of the registered function is concatenated into the synthetic function name. BUG=b:192262089 TEST=make BOARD=hyperdebug Change-Id: Ic7ead88e2fd86d509769a1c0a88a788b72576238 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4183953 Tested-by: Jes Klinke <jbk@chromium.org> Commit-Queue: Jes Klinke <jbk@chromium.org> Reviewed-by: Brian Nemec <bnemec@google.com>
* docs: Update coverage requirement to 90%Tristan Honscheid2023-01-231-4/+3
| | | | | | | | | | | | | | | Update the firmware testing requirements doc to reflect the new 90% threshold. BUG=None BRANCH=None TEST=None, ironically Change-Id: I35f90b1592db2203d3c6f7ae05071fdd23ad0695 Signed-off-by: Tristan Honscheid <honscheid@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4182781 Reviewed-by: Yuval Peress <peress@google.com> Reviewed-by: Keith Short <keithshort@chromium.org>
* mchp: Remove undefined behavior in espi msvw handlersDustin L. Howett2023-01-231-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code in espi_msvw[12]_interrupt relies on undefined behavior today. __builtin_ctz is specified as returning values in the range [0, 31], but we are checking for 32. This behavior may be unexpected compared to the CTZ/CLZ instruction on ARM, which use the value 32 to indicate that there are no ones in the provided input. GCC 11+ optimizes the two loops below into infinite loops, as it can see that the condition will never be met. After this change, the disassembly of espi_mswv1_interrupt can be confirmed to contain an exit behind a branch. ... // r4 is loaded with girq24_result and has bits successively cleared 1a: b90c cbnz r4, 20 <espi_mswv1_interrupt+0x20> 1c: e8bd 81f0 ldmia.w sp!, {r4, r5, r6, r7, r8, pc} 20: fa94 f5a4 rbit r5, r4 ... BUG=None BRANCH=main TEST=Examined the disassembly for espi_msvw[12]_interrupt; see above Change-Id: I68a5c753233a17b6b0fb61a31f1eeccf78c00aba Signed-off-by: Dustin L. Howett <dustin@howett.net> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4114450 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Alexandru Stan <amstan@chromium.org>
* nissa: Enable AC_PRESENT charger supportAndrew McRae2023-01-231-0/+1
| | | | | | | | | | | | | | When using the RAA489000 charger, enable the code to correctly generate the AC_PRESENT signal. BUG=b:263691951 TEST=Verify on nirwen that AC_PRESENT is correctly generated BRANCH=none Change-Id: I3086104af8dda692b0eddbc2d71cf41e2512cea2 Signed-off-by: Andrew McRae <amcrae@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4179437 Reviewed-by: Peter Marheine <pmarheine@chromium.org>