summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* guybrush: Add guybrush fw_configstabilize-glibc-13901.B-mainRob Barnes2021-04-085-0/+140
| | | | | | | | | | | | | | | | Each guybrush variant may have a different fw_config schema. Defining a schema agnostic fw_config interface at baseboard. Each guybrush variant must implement the interface. Fields that are not applicable outside a specific variant do not need to be exposed in the baseboard interface. BUG=b:178215011 TEST=Build and run on Guybrush B2 BRANCH=None Change-Id: I41d24ffddfc41d3148ba6d3685f728f6ec962919 Signed-off-by: Rob Barnes <robbarnes@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2722982 Reviewed-by: Diana Z <dzigterman@chromium.org>
* zephyr: npcx: Add cros_system chip info implementationMulin Chao2021-04-082-0/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | | Add NPCX chip_vendor(), chip_name(), and chip_revision implementation for cros_system driver. BUG=none BRANCH=none TEST=Build & boot ec on volteer. TEST=Press 'version' in console and show related chip information: ``` 21-04-06 17:53:00.681 uart:~$ version 21-04-06 17:53:01.795 Chip: Nuvoton NPCX796FC 02 21-04-06 17:53:01.795 Board: 2 21-04-06 17:53:01.795 RO: _v2.0.8287+db38ffd6d 21-04-06 17:53:01.795 RW: _v2.0.8287+db38ffd6d 21-04-06 17:53:01.795 Build: _v2.0.8287+db38ffd6d ``` Signed-off-by: Mulin Chao <mlchao@nuvoton.com> Signed-off-by: Wealian Liao <whliao@nuvoton.corp-partner.google.com> Change-Id: I73d016f5fa1da6c03e38b312eb4f1b0445a2c1d4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2807479 Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Commit-Queue: Jack Rosenthal <jrosenth@chromium.org>
* zephyr: Add chip info support in shimmed system driverMulin Chao2021-04-081-3/+9
| | | | | | | | | | | | | | | | | | Add chip vendor, name, and revision information via cros_system driver API in the shimmed system driver. BUG=none BRANCH=none TEST=build & boot ec on volteer Signed-off-by: Mulin Chao <mlchao@nuvoton.com> Signed-off-by: Wealian Liao <whliao@nuvoton.corp-partner.google.com> Change-Id: I09ff25d7ad07371900211426a15560ee61326b12 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2807478 Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Commit-Queue: Jack Rosenthal <jrosenth@chromium.org>
* zephyr: Add chip info API in cros_system driverMulin Chao2021-04-081-0/+89
| | | | | | | | | | | | | | | | | | | | | Add the following chip_info API in cros_system driver for getting the chip information: 1. cros_system_chip_vendor() 2. cros_system_chip_name() 3. cros_system_chip_revision() BUG=none BRANCH=none TEST=build & boot ec on volteer Signed-off-by: Mulin Chao <mlchao@nuvoton.com> Signed-off-by: Wealian Liao <whliao@nuvoton.corp-partner.google.com> Change-Id: I06718ff26f9cbee26cc9dbdcbbd02a0cc901d397 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2807477 Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Commit-Queue: Jack Rosenthal <jrosenth@chromium.org>
* zephyr: Bundle a summary code coverage fileJeremy Bettis2021-04-072-5/+40
| | | | | | | | | | | | | | | | | | | | | | | | Fix zmake coverage, it was still using the removed claim_job flag. Change zmake coverage to output a summary lcov.info file as well. Implement zephyr/firmware_builder.py --code-coverage test. Implement zephyr/firmware_builder.py --code-coverage bundle. BRANCH=none BUG=b:183007888 TEST=cros workon --host start chromeos-base/zephyr-build-tools sudo emerge chromeos-base/zephyr-build-tools zephyr/firmware_builder.py --metrics=/tmp/m --code-coverage test zephyr/firmware_builder.py --metrics=/tmp/m --code-coverage bundle tar tvf /tmp/artifact_bundles/coverage.tbz2 cat /tmp/artifact_bundle_metadata Signed-off-by: Jeremy Bettis <jbettis@google.com> Change-Id: I3fbdc4e57029d23a4d24b7ad6e003ee624c75f37 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2809354 Reviewed-by: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Kevin Shelton <kmshelton@chromium.org> Commit-Queue: Jeremy Bettis <jbettis@chromium.org> Tested-by: Jeremy Bettis <jbettis@chromium.org>
* zephyr: lint pass, s/ {4}/\t/g for dts filesYuval Peress2021-04-072-24/+24
| | | | | | | | | | | | | | Use the same spacing (tab) for the i2c and i2c_dts overlay.dts files. BRANCH=none BUG=none TEST=zmake testall Signed-off-by: Yuval Peress <peress@chromium.org> Change-Id: I4e84ab626a2eb9a9eded304ef13153962cf863f2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2811184 Reviewed-by: Simon Glass <sjg@chromium.org> Commit-Queue: Simon Glass <sjg@chromium.org>
* hooks: Avoid torn accesses in the hook taskEvan Green2021-04-071-16/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The hook task runs at the lowest priority, and both reads from and writes to a data structure that can be changed out from under it at any time. This is unsafe, and can cause missed hook events and double hook events. For example, the hook task reads __deferred_until[i], a 64-bit value, in two 32-bit reads. If the hook task is interrupted during this read, and the interruption changes the value, the hook task may read a totally bogus value. This is rare, as overflows across this 32-bit boundary don't happen often, but leads to unpredicable behavior when they do. The writes the hook task does are also problematic, since for instance the hook may have been rescheduled just after the slow old hook task entered its if clause deciding to run the hook, but before it clobbered __deferred_until[i] back to zero. Things get worse if the hook routine pointer ever changes, though I don't think we're currently doing that anywhere today. Instead, disable interrupts while the hook data structure is being manipulated as a makeshift lock around it. Remove the defer_new_call variable as well, since the new deadline is now computed atomically (and without the possibility of torn reads). BUG=b:178660461, b:179062230 BRANCH=None TEST=Run suspend 2500 on Boten, observe no spurious s0ix timeouts. Signed-off-by: Evan Green <evgreen@chromium.org> Change-Id: Iff0d596014e1e79dd9691d363fdc8e54bfe2dff0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2805222 Reviewed-by: Wai-Hong Tam <waihong@google.com>
* zephyr: zmake: Reset the multiproc module before useSimon Glass2021-04-072-0/+8
| | | | | | | | | | | | | | | | | At present the logging map from one test can still be around for a following tests. This can cause strange behaviour. Add a reset() function to help with this. Call it from the Zmake constructor which is used by any test which cares about this. BUG=b:177096315 BRANCH=none TEST=with other CLs, see that the tests pass when all run together Signed-off-by: Simon Glass <sjg@chromium.org> Change-Id: I0bf112e705c6badd3958a0afba8a3761e95fa547 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2809780 Reviewed-by: Yuval Peress <peress@chromium.org>
* zephyr: zmake: Avoid using pip3 for installSimon Glass2021-04-071-3/+2
| | | | | | | | | | | | | | | | | | When running on a distribution it seems better to use the standard install procedure if possible, with pip3 reserved for things that are not available. If users have an old distribution, they will presumably fall back to using pip3 anyway. Update to use 'apt-get install' in the docs. BUG=b:181253613 BRANCH=none TEST=check it in gitiles Signed-off-by: Simon Glass <sjg@chromium.org> Change-Id: I539518a3009e73cb948145ca68f868fa5588909d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2809779 Reviewed-by: Yuval Peress <peress@chromium.org>
* zephyr: Add build instructionsSimon Glass2021-04-071-0/+165
| | | | | | | | | | | | | Add some information from the care & feeding guide. BUG=b:181253613 BRANCH=none TEST=check it in gitiles Change-Id: I1ad507cd87359dbfc6e2b89dcfd4c5d4ea77b2ca Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2807485 Reviewed-by: Yuval Peress <peress@chromium.org>
* Mancomb: Add PPC enable and disable calls to active charger setDiana Z2021-04-071-3/+31
| | | | | | | | | | | | | | | When mancomb is sinking power from a type-c port, enable the PPC on the port to sink. Also ensure that for all other active charge ports, we disable any PPCs which could have been previously enabled. BRANCH=None BUG=b:182468669 TEST=make -j buildall Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I8174de08c6b8eb55a1227ce86cb786aee773afba Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2802832 Reviewed-by: Andrew McRae <amcrae@chromium.org>
* guybrush: Add A1 retimer gpioRob Barnes2021-04-071-0/+2
| | | | | | | | | | | | | A1 retimer gpio on io expander were missed. BUG=None TEST=ioxget BRANCH=None Signed-off-by: Rob Barnes <robbarnes@google.com> Change-Id: I34d8f63e5f4048d0d7a52a915864fdb0fb7e8a51 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2809880 Reviewed-by: Diana Z <dzigterman@chromium.org>
* Revert "RAA489000: Clear debug accessory state on init"Diana Z2021-04-071-15/+0
| | | | | | | | | | | | | | | | This reverts commit 756dc91b0a57aa6d557ee4cb486972d8a7b8106a. There will now be a general debug detach on entry to Unattached.SNK/SRC every boot and so this should no longer be necessary. BRANCH=None BUG=b:177870522 TEST=on galith, ensure that refresh+power resets with servo_v4 sink plugged in results in a successful connection with the servo_v4 Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I991ca7fbb5d51d2d8fc07d3a8d8e885e43e94b44 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2792691 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* TCPMv2: Detach from debug devices in Unattached entryDiana Z2021-04-071-7/+10
| | | | | | | | | | | | | | | | | | | | | Call debug detach routine on the TCPC before setting our terminations in Unattached.SNK/SRC. This will cover more code paths than attempting to ensure we call the debug detach from every possible chipset transition, sysjump, etc. Note we should still debug detach in Attached exits when PR swapping. BRANCH=None BUG=b:183619502 TEST=on Galith, confirm that: - firmware_UserRequestRecovery passes reliably - board is able to boot with no battery and a charger attached in either port Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I6cef8ce57a569b0e15e1e10b77c830b1c7a55d75 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2792690 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* RAA489000: Check battery level in debug detachDiana Z2021-04-071-0/+5
| | | | | | | | | | | | | | | Since our debug detach routine requires setting our CC's to open, we may end up losing Vbus. Protect ourselves by checking the battery level prior to allowing this to be set. BRANCH=None BUG=b:183619502 TEST=make -j buildall Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I45acb7bce2f9a312c2f35ec74dc4563a947ee059 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2792689 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* dooly: update oz554 register settingZick Wei2021-04-071-4/+4
| | | | | | | | | | | | | This patch updates oz554 register setting by each panel. BUG=b:168444976 BRANCH=puff TEST=read back oz554 setting through i2c as intended. Signed-off-by: Zick Wei <zick.wei@quanta.corp-partner.google.com> Change-Id: Icfa9c0c75df1d047768ba2057767e9736c65eeed Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2810426 Reviewed-by: Andrew McRae <amcrae@chromium.org>
* Revert "fpsensor: Support building firmware that works for both sensors"Tom Hughes2021-04-0721-727/+257
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit ac08c9d1dbc9f587df3ee6b15d58c0203f7e356e. Reason for revert: Breaks public build Original change's description: > fpsensor: Support building firmware that works for both sensors > > This is a refactoring to allow building FPMCU firmware that works for > one FPC sensor and one ELAN sensor. > > 1. When both drivers implement our common functions, e.g. fp_sensor_init(), > rename them to fp_sensor_init_fpc() and fp_sensor_init_elan(). > 2. There are a few functions implemented not in FPC driver but in FPC > private library, e.g. fp_sensor_finger_status(). I kept this as-is for > FPC but renamed the one in ELAN driver to fp_sensor_finger_status_elan() > 3. If building for ELAN, need to hardcode elan=1 in hatch_fp/board.c > because the sensor type GPIO always says FPC. > > BRANCH=none > BUG=b:175158241 > TEST=make run-fpsensor; make run-fpsensor_status; > make run-fpsensor_crypto > TEST=make -j BOARD=dartmonkey > TEST=add CONFIG_FP_SENSOR_ELAN515 to board/hatch_fp/board.h; > make -j BOARD=bloonchipper > Firmware binary fully works on Dragonair (FPC) and Voema (ELAN) > TEST=run device tests with http://crrev/c/2750547 and > http://crrev/i/3654297 on Dragonclaw, all pass > > Change-Id: I789090dbdfe35ac6aefd6a629fa4c7bde89dc437 > Signed-off-by: Yicheng Li <yichengli@chromium.org> > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2727971 > Reviewed-by: Tom Hughes <tomhughes@chromium.org> > Commit-Queue: Tom Hughes <tomhughes@chromium.org> Bug: b:175158241, b:184616069 Change-Id: I2a02a6eefc316e7e13aa188f1ae16672dce2babd Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2809521 Auto-Submit: Tom Hughes <tomhughes@chromium.org> Tested-by: Tom Hughes <tomhughes@chromium.org> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Commit-Queue: caveh jalali <caveh@chromium.org>
* zephyr: fix initialization priority to be forward compatibleYuval Peress2021-04-074-2/+27
| | | | | | | | | | | | | | | | | | In upstream Zephyr the initialization of the GPIO module (and most other drivers) was changed. This breaks our gpio and in return also flash initialization. Update both gpio and flash initialization to work with Kconfig and add a compile time validation to be able to catch this sooner in the future. BRANCH=none BUG=none TEST=zmake testall Signed-off-by: Yuval Peress <peress@chromium.org> Change-Id: I44e5867dbf4cb3d5934bf0d0807dcc1aa6c778e1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2808335 Reviewed-by: Simon Glass <sjg@chromium.org>
* zephyr: kconfig: alphabetize the root kconfigYuval Peress2021-04-071-108/+107
| | | | | | | | | | | BRANCH=none BUG=none TEST=zmake testall Signed-off-by: Yuval Peress <peress@chromium.org> Change-Id: I371beb4cda83199ec2d0cc2bb85e4af0144d4e70 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2808334 Reviewed-by: Simon Glass <sjg@chromium.org>
* cherry: add batteryTing Shen2021-04-072-21/+22
| | | | | | | | | | | | | | | BUG=b:181838424 TEST=1) EC console prints "found batt:LGC KT0030G020" 2) cutoff works BRANCH=main Signed-off-by: Ting Shen <phoenixshen@google.com> Change-Id: I903d0140e75a7877fa8ae6a8f04997f44989755b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2807249 Tested-by: Ting Shen <phoenixshen@chromium.org> Tested-by: Parker Lin <parkerlin@google.com> Reviewed-by: Eric Yilun Lin <yllin@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org>
* asurada: enable FRSEric Yilun Lin2021-04-071-0/+1
| | | | | | | | | | | | BUG=b:176876036 TEST=1. ensure smart discharge works with FRS 2. FRS 5V work BRANCH=asurada Change-Id: I3f7ffa805b313d9cbac5fe8908b47d1473caed61 Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2738508 Reviewed-by: Ting Shen <phoenixshen@chromium.org>
* asurada: enable SYV682C and smart dischcargeEric Yilun Lin2021-04-072-1/+8
| | | | | | | | | | | | | | This CL enables SYV682C for hayato revision > 2. BUG=b:160548079 TEST=1. hayato meets tVconnOff 2. hayato meets tVBUSDischarge BRANCH=asurada Change-Id: I424b7785ba877b7cfdc413b8b253457a759b98d3 Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2738507 Reviewed-by: Ting Shen <phoenixshen@chromium.org>
* zephyr: kconfig: move timer configs to separate fileYuval Peress2021-04-072-13/+17
| | | | | | | | | | | | | | Clean up the root Kconfig for Zephyr by moving sub configs to separate file (Kconfig.timer). BRANCH=none BUG=none TEST=zmake testall Signed-off-by: Yuval Peress <peress@chromium.org> Change-Id: Ie5987fd413cdc89a1f3f15508def6fdc64d94750 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2808333 Reviewed-by: Simon Glass <sjg@chromium.org>
* zephyr: kconfig: move timer configs to separate fileYuval Peress2021-04-072-47/+51
| | | | | | | | | | | | | | Clean up the root Kconfig for Zephyr by moving sub configs to separate file (Kconfig.timer). BRANCH=none BUG=none TEST=zmake testall Signed-off-by: Yuval Peress <peress@chromium.org> Change-Id: I11a4c10d19d23aa46f53ea6676dac637f1cd85a2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2808152 Reviewed-by: Simon Glass <sjg@chromium.org>
* zephyr: kconfig: move throttle_ap configs to separate fileYuval Peress2021-04-072-29/+33
| | | | | | | | | | | | | | Clean up the root Kconfig for Zephyr by moving sub configs to separate file (Kconfig.throttle_ap). BRANCH=none BUG=none TEST=zmake testall Signed-off-by: Yuval Peress <peress@chromium.org> Change-Id: I78097f824a95ecce1bf588a27c0c600e31e127b8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2808151 Reviewed-by: Simon Glass <sjg@chromium.org>
* zephyr: kconfig: move rtc configs to separate fileYuval Peress2021-04-072-37/+41
| | | | | | | | | | | | | | Clean up the root Kconfig for Zephyr by moving sub configs to separate file (Kconfig.rtc). BRANCH=none BUG=none TEST=zmake testall Change-Id: I6d9879dd293f944b3029ed1100fc4e406ae8f82c Signed-off-by: Yuval Peress <peress@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2808150 Reviewed-by: Simon Glass <sjg@chromium.org>
* zephyr: kconfig: move panic configs to separate fileYuval Peress2021-04-072-39/+44
| | | | | | | | | | | | | | Clean up the root Kconfig for Zephyr by moving sub configs to separate file (Kconfig.panic). BRANCH=none BUG=none TEST=zmake testall Signed-off-by: Yuval Peress <peress@chromium.org> Change-Id: If506bc71ac969477d88250c1fcacca6a19101968 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2808149 Reviewed-by: Simon Glass <sjg@chromium.org>
* zephyr: kconfig: move mkbp_event configs to separate fileYuval Peress2021-04-072-46/+50
| | | | | | | | | | | | | | Clean up the root Kconfig for Zephyr by moving sub configs to separate file (Kconfig.mkbp_event). BRANCH=none BUG=none TEST=zmake testall Signed-off-by: Yuval Peress <peress@chromium.org> Change-Id: Icc9b40075c57dd5384016f213c0ebb5c38a38185 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2808148 Reviewed-by: Simon Glass <sjg@chromium.org>
* zephyr: kconfig: move flash configs to separate fileYuval Peress2021-04-072-110/+114
| | | | | | | | | | | | | | Clean up the root Kconfig for Zephyr by moving sub configs to separate file (Kconfig.flash). BRANCH=none BUG=none TEST=zmake testall Signed-off-by: Yuval Peress <peress@chromium.org> Change-Id: I7ac8ec87bdca8ab799bc1faf47804e34c7a6beda Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2808147 Reviewed-by: Simon Glass <sjg@chromium.org>
* zephyr: kconfig: move espi configs to separate fileYuval Peress2021-04-072-25/+29
| | | | | | | | | | | | | | Clean up the root Kconfig for Zephyr by moving sub configs to separate file (Kconfig.espi). BRANCH=none BUG=none TEST=zmake testall Change-Id: Ie5bd22b1179b03370a3e45cc91738b767865e2a0 Signed-off-by: Yuval Peress <peress@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2808146 Reviewed-by: Simon Glass <sjg@chromium.org>
* flash_ec: remove hammer like boards from BOARDS_STM32 arrayTing Shen2021-04-071-8/+0
| | | | | | | | | | | | | | | | | flash_ec script is able to infer chip name from servod, we don't need this explicit list for hammer. BUG=none TEST=flash ec command `util/flash_ec --board zed` still works BRANCH=main Signed-off-by: Ting Shen <phoenixshen@google.com> Change-Id: I4f4d72aa3f30e6178f6f7a968af6e2bc8a5c7845 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2807250 Commit-Queue: Ting Shen <phoenixshen@chromium.org> Tested-by: Ting Shen <phoenixshen@chromium.org> Reviewed-by: Chen-Tsung Hsieh <chentsung@chromium.org> Reviewed-by: Eric Yilun Lin <yllin@chromium.org>
* it8xxx2: add support option CONFIG_PRESERVE_LOGSDino Li2021-04-078-4/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On it8xxx2 chips, assert WRST# to reset itself will clear memory content to default value, this is a HW mechanism. So if CONFIG_PRESERVE_LOGS and CONFIG_IT83XX_HARD_RESET_BY_GPG1 are enabled at the same time, we have to save EC logs into flash before reset. We will restore logs from flash on the next initialization before jumping to main routine. BUG=b:183899510, b:183466169 BRANCH=none TEST=1) __image_size is same as ec.RW.bin size. 2) buildall. 3) manually verify reboot, poweroff, and sysjump from AP console: localhost ~ # ectool uptimeinfo EC uptime: 64.755 seconds AP resets since EC boot: 0 Most recent AP reset causes: EC reset flags at last EC boot: reset-pin | power-on localhost ~ # reboot ... localhost ~ # ectool uptimeinfo EC uptime: 19.334 seconds AP resets since EC boot: 0 Most recent AP reset causes: 71.609: reset: at AP's request EC reset flags at last EC boot: reset-pin | power-on | hard localhost ~ # poweroff ... localhost ~ # ectool uptimeinfo EC uptime: 20.627 seconds AP resets since EC boot: 0 Most recent AP reset causes: 71.609: reset: at AP's request 32.149: reset: at AP's request EC reset flags at last EC boot: reset-pin | power-on | hard localhost ~ # ectool reboot_ec RW localhost ~ # ectool uptimeinfo EC uptime: 37.998 seconds AP resets since EC boot: 0 Most recent AP reset causes: 71.609: reset: at AP's request 32.149: reset: at AP's request EC reset flags at last EC boot: reset-pin | power-on | sysjump | hard localhost ~ # Change-Id: I76b5f172b7728dc5ce9bf3a965cb7b2d638f8fc3 Signed-off-by: Dino Li <Dino.Li@ite.com.tw> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2794322 Reviewed-by: Eric Yilun Lin <yllin@chromium.org>
* zephyr: kconfig: move debug_assert configs to separate fileYuval Peress2021-04-072-39/+46
| | | | | | | | | | | | | | | Clean up the root Kconfig for Zephyr by moving sub configs to separate file (Kconfig.debug_assert). Also, add correct dependency to only allow PLATFORM_EC_DEBUG_ASSERT_* configs if PLATFORM_EC_DEBUG_ASSERT is enabled. BRANCH=none BUG=none TEST=zmake testall Signed-off-by: Yuval Peress <peress@chromium.org> Change-Id: I1cdd0dbba3b7300b8b95eb69df49d44033a0eb6c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2808145
* zephyr: kconfig: move console_cmd_mem configs to separate fileYuval Peress2021-04-072-30/+33
| | | | | | | | | | | | | | Clean up the root Kconfig for Zephyr by moving sub configs to separate file (Kconfig.console_cmd_mem). BRANCH=none BUG=none TEST=zmake testall Change-Id: Id9abef7be1943eee42fe6a31cf0488f4b7209a42 Signed-off-by: Yuval Peress <peress@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2808144 Reviewed-by: Simon Glass <sjg@chromium.org>
* zephyr: kconfig: move board_version configs to separate fileYuval Peress2021-04-072-42/+46
| | | | | | | | | | | | | | Clean up the root Kconfig for Zephyr by moving sub configs to separate file (Kconfig.board_version). BRANCH=none BUG=none TEST=zmake testall Signed-off-by: Yuval Peress <peress@chromium.org> Change-Id: I876b0d811b72a0691c763225218ad101ec3826b0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2808143 Reviewed-by: Simon Glass <sjg@chromium.org>
* lantis: Move C1 SM5803 processing to the PD_INT taskTommy Chung2021-04-071-1/+15
| | | | | | | | | | | | | | | | | Since the SM5803 shares an interrupt line with the TCPC, allow the PD_INT task for C1 to process interrupts for this chip. This will ensure that any interrupts from the charger are handled at a high priority and cannot leave the shared IRQ line low for extended periods. BUG=none BRANCH=dedede TEST=On lantis, confirm charger attach to C1 works reliably. Signed-off-by: Tommy Chung <tommy.chung@quanta.corp-partner.google.com> Change-Id: Id363b743eb7825f4a03f7119248218d0259e9d5b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2804004 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
* brya: Update generated-gpio.inc from spreadsheetCaveh Jalali2021-04-071-1/+1
| | | | | | | | | | | | | | This refreshes generated-gpio.inc from the latest GPIO spreadsheet. The change is to configure EC_ACCEL_INT_R_L for 1.8v instead of 3.3v. BRANCH=none BUG=b:179648721 TEST=buildall passes, brya boots. accel interrupts tested by bmbm@ Signed-off-by: Caveh Jalali <caveh@chromium.org> Change-Id: Ib0c2667e7593329e533b47fdb1ce09a4eece6590 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2807252 Reviewed-by: Boris Mittelberg <bmbm@google.com>
* zephyr: lazor: enable RTC host commandsWai-Hong Tam2021-04-071-0/+1
| | | | | | | | | | | | | | | | The RTC host commands are enabled by another config PLATFORM_EC_HOSTCMD_RTC. Enable it on Lazor. BRANCH=None BUG=b:182398910, b:178230662 TEST=Tested on Lazor. Disabled any network connection. Powered down AP for a while. Booted AP again and checked the time is accurate. Change-Id: Id4c2d32747b5a970ff1354c1597c1356143e36ff Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2808795 Reviewed-by: Simon Glass <sjg@chromium.org>
* zephyr: doc: Add a title to the shimming docSimon Glass2021-04-061-47/+49
| | | | | | | | | | | | | | | | | This is confusing when browsing since it has no title. Add one. Also move the 'alternatives considered' to the bottom while we are here, since that is confusing for people who are less interested in the motivation for shimming and just want to know what to do. BUG=b:181253613 BRANCH=none TEST=check it in gitiles Signed-off-by: Simon Glass <sjg@chromium.org> Change-Id: I73a4716278396dfdf0661d6ced67b3d6a9785165 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2807487 Reviewed-by: Yuval Peress <peress@chromium.org>
* zephyr: doc: Add zephyr docs to sitemapSimon Glass2021-04-061-0/+7
| | | | | | | | | | | | | | To make it easier for people to get started with Zephyr, link in the existing docs. BUG=b:181253613 BRANCH=none TEST=check it in gitiles Signed-off-by: Simon Glass <sjg@chromium.org> Change-Id: I68f0deb52a64147e705e53410699c372fd1e69b8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2807484 Reviewed-by: Yuval Peress <peress@chromium.org>
* ec: Add instructions on debugging testsJeremy Bettis2021-04-061-0/+17
| | | | | | | | | | | | | | | | For host based tests, add instructions on emerging and running gdb. BRANCH=none BUG=b:178484932 TEST=doc change only Change-Id: I5c99d2699134d732e4596a0ce9acffb39c22bda6 Signed-off-by: Jeremy Bettis <jbettis@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2805225 Auto-Submit: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org> Commit-Queue: Simon Glass <sjg@chromium.org> Tested-by: Simon Glass <sjg@chromium.org>
* zephyr: dts: volteer: add PSL input pads in 'psl-in-pads' prop.Mulin Chao2021-04-062-0/+23
| | | | | | | | | | | | | | | | | | | | | | Add PSL input pads which used on volteer platform in 'psl-in-pads' property and overwrite their 'flag' property for detection mode. BUG=b:173787365 BRANCH=none TEST=zmake testall TEST=hibernate wake-up from 1. power button 2. lid 3. AC adaptor 4. reset pin Signed-off-by: Mulin Chao <mlchao@nuvoton.com> Signed-off-by: Wealian Liao <whliao@nuvoton.corp-partner.google.com> Change-Id: I669acd24cbd4e46f9042d1ea36f9c040a7f67e07 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2794207 Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* Homestar: Remove the DA9313 support, add the LN9310 supportxuxinxiong2021-04-063-11/+45
| | | | | | | | | | | | | | | | LN9310 and DA9313 are not pin compatible. The layout of Homestar can only choose one and it is LN9310. So remove the DA9313 support and add the LN9310's. BRANCH=Trogdor BUG=b:182358144 TEST=Built homestar image Change-Id: I3c07c0f062a68f64a13a006aa7010c438dfe1b5e Signed-off-by: xuxinxiong <xuxinxiong@huaqin.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2748208 Reviewed-by: Wai-Hong Tam <waihong@google.com> Commit-Queue: Wai-Hong Tam <waihong@google.com>
* Drawcia: Move C1 SM5803 processing to the PD_INT taskDiana Z2021-04-061-1/+15
| | | | | | | | | | | | | | | | Since the SM5803 shares an interrupt line with the TCPC, allow the PD_INT task for C1 to process interrupts for this chip. This will ensure that any interrupts from the charger are handled at a high priority and cannot leave the shared IRQ line low for extended periods. BRANCH=None BUG=b:182534117,b:173056845 TEST=on drawcia, confirm charger attach to C1 works reliably Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I6670c62ca6d59fc3f5db4151cf7142b2da1fec38 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2803462 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* SM5803: Add interrupt processing function to headerDiana Z2021-04-061-0/+3
| | | | | | | | | | | | | | | Expose the function for interrupt processing for use by other tasks, such as the PD_INT task if the charger chip is sharing an IRQ line with the TCPC. BRANCH=None BUG=b:182534117,b:183679237 TEST=make -j buildall Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: Ic147fc282ecd5954c95e0c71e230c27b8c91186b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2803461 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* PD_INT: Add ability to process non-TCPC alerts in PD_INTDiana Z2021-04-062-1/+16
| | | | | | | | | | | | | | | | Some boards may have other chips sharing the TCPC interrupt line, in which case their alerts may need to be handled at the same priority as the TCPC itself. Otherwise, it becomes difficult to respond quickly to TCPC interrupts. BRANCH=None BUG=b:182534117,b:183679237 TEST=make -j buildall Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I905f20eeb0dd89c8516de31005d402a890906595 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2803460 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* nightfury: Change down debounce time to 30msPatryk Duda2021-04-062-0/+15
| | | | | | | | | | | | | | | This patch is implementation of CL:2744760 from firmware-hatch-12672.B for ToT. This change can't be cherry-picked because CL:2194160 removes keyscan_config structure from baseboard/hatch/baseboard.c. BUG=b:181307934 BRANCH=none TEST=make BOARD=nightfury Signed-off-by: Patryk Duda <pdk@semihalf.com> Change-Id: I070390b1f4f13dcce5a93ed0c8982b82a3574d6c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2784642 Reviewed-by: Boris Mittelberg <bmbm@google.com>
* kohaku : limit charging current to 0.45CYongBeum.Ha2021-04-062-0/+32
| | | | | | | | | | | | | | | | | Change charging current from 0.72C to 0.45C when system is in S0 BUG=b:144532818 BRANCH=firmware-hatch-12672.B TEST=FW_NAME=kohaku emerge-kohaku chromeos-ec & check charging current Change-Id: Iba1dd08465b2469a6456cc04ad72a39c7af8b8a4 Signed-off-by: YongBeum.Ha <ybha@samsung.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1957605 Reviewed-by: Scott Collyer <scollyer@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2784641 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Tested-by: Patryk Duda <pdk@semihalf.com> Commit-Queue: Patryk Duda <pdk@semihalf.com>
* cret: Initial EC image setup battery parameterjohnwc_yeh2021-04-062-18/+180
| | | | | | | | | | | | | | | | Setup battery parameter for cret. BUG=b:183875170 BRANCH=dedede TEST=make BOARD=cret Signed-off-by: johnwc_yeh <johnwc_yeh@compal.corp-partner.google.com> Change-Id: I3f4df0a4255bbc6aaf9bbee1260abc7660e4626d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2789807 Reviewed-by: Elthan Huang <elthan_huang@compal.corp-partner.google.com> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Tested-by: Elthan Huang <elthan_huang@compal.corp-partner.google.com> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
* bq25720: Add VSYS_TH2 tuning supportCaveh Jalali2021-04-065-0/+64
| | | | | | | | | | | | | | | | | | This adds support for tuning the bq25720 VSYS_TH2 threshold so that a custom threshold voltage can be specified. The default 3.2v for 1S batteries and 5.9v for 2S (or more) batteries may need to be adjusted to improve system stability. When VSYS droops to this threshold, PROCHOT is asserted to reduce system power demand. BRANCH=none BUG=b:183474163 TEST=with rest of patch stack, booted brya to the OS without a battery Signed-off-by: Caveh Jalali <caveh@chromium.org> Change-Id: I7f52a369371eb93860b14ad8438b790af231c450 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2798979 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>