summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* USB MUX: Pull HPD update into mux configurestabilize-14189.B-mainDiana Z2021-08-301-6/+17
| | | | | | | | | | | | | | | The mux HPD update is the only function not currently going through configure_mux(). Pull out its contents so it may be run with the rest of the mux changes. BRANCH=None BUG=b:186777984 TEST=tast typec.Mode*.manual on voxel Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I5d91ca89dcdab0dcb0ba844494f9009948ee5abc Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3078412 Reviewed-by: Keith Short <keithshort@chromium.org>
* Chronicler: Fix ps8815 usb3 signal init failYu-An Chen2021-08-301-22/+15
| | | | | | | | | | | | | | | Fix ps8815 init target page Init ps8815 via board_ps8xxx_tcpc_init BUG=b:194985848 BRANCH=volteer TEST=check all register is correct via ectool i2cread Signed-off-by: Yu-An Chen <yu-an.chen@quanta.corp-partner.google.com> Change-Id: I7b2c4a3ec0a23d29157735eda5a9890f087e153d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3115732 Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Commit-Queue: Abe Levkoy <alevkoy@chromium.org>
* bugzzy : Modify battery informationYongBeum.Ha2021-08-302-32/+2
| | | | | | | | | | | | | | | modify battery information based on datasheet. BUG=b:197776876 BRANCH=None TEST=make -j BOARD=bugzzy Signed-off-by: YongBeum.Ha <ybha@samsung.corp-partner.google.com> Change-Id: Ib84152984d340ce395977698551a0af6d156935c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3118647 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Henry Sun <henrysun@google.com>
* zephyr/drivers: it8xxx2: add hard reset in cros_system driverTim Lin2021-08-301-1/+9
| | | | | | | | | | | | | | | | | | This reset cause is power-on reset by enabling ETWD HW reset. BUG=b:185202623 BRANCH=none TEST=console command: reboot hard 21-08-20 10:53:02.198 --- UART initialized after reboot --- 21-08-20 10:53:02.198 [Image: RO, asurada_zephyr_v2.0.10073+ed882 2021-08-20 10:33:] 21-08-20 10:53:02.209 [Reset cause: power-on hard] Change-Id: Iabe71305ef16ab04160a85e86398ef037ad1eba6 Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3108847 Commit-Queue: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
* zephyr/drivers: it8xxx2: add cros_system drivertim2021-08-303-0/+193
| | | | | | | | | | | | | | | | | | | | | | | | | This system module provides hardware specific implementat. BUG=b:185202623 BRANCH=none TEST=console command: version 21-08-19 14:38:29.441 Chip: ite it81202 bx reset cause: watchdog reset -> pass reset-pin -> pass power-on -> pass sort reset: reboot [soft] [preserve] [ap-off] [wait-ext] [cancel] [ap-off-in-ro] [ro] -> pass Cq-Depend: chromium:3102366 Change-Id: I65861a5066a555b51eb26c52b0b1e90aa7999097 Signed-off-by: Tim Lin <tim2.lin@ite.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2835525 Commit-Queue: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
* Tomato: support new vivaldi keyboardSue Chen2021-08-301-0/+1
| | | | | | | | | | | | | | Implements F2 refresh key to ROW3. BUG=b:197468826 BRANCH=none TEST=none Signed-off-by: Sue Chen <sue.chen@quanta.corp-partner.google.com> Change-Id: Ic1ae5fb8f5ba060674a3cc49a482433db99d4ef1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3108849 Reviewed-by: Ting Shen <phoenixshen@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org>
* anahera: Initial EC imageWisley Chen2021-08-2817-0/+1906
| | | | | | | | | | | | | | | | | | | | | | Create the initial EC image for the anahera variant by copying the redrix reference board EC files into a new directory named for the variant. (Auto-Generated by create_initial_ec_image.sh version 1.5.0). BUG=b:197850509 BRANCH=None TEST=make BOARD=anahera TEST=make buildall Signed-off-by: Wisley Chen <wisley.chen@quanta.corp-partner.google.com> Change-Id: I2276109982181a74f86f050de240a5e678034086 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3122687 Tested-by: Devin Lu <Devin.Lu@quantatw.com> Reviewed-by: Zhuohao Lee <zhuohao@chromium.org> Reviewed-by: Boris Mittelberg <bmbm@google.com> Reviewed-by: caveh jalali <caveh@chromium.org> Commit-Queue: caveh jalali <caveh@chromium.org>
* util: Avoid redefining _GNU_SOURCETom Hughes2021-08-282-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | When compiling with C++ _GNU_SOURCE is already defined, which generates a compiler error: util/comm-i2c.cc:6:9: error: '_GNU_SOURCE' macro redefined [-Werror,-Wmacro-redefined] ^ <built-in>:393:9: note: previous definition is here ^ For details on why g++ always defines _GNU_SOURCE on Linux see https://gcc.gnu.org/onlinedocs/libstdc++/faq.html#faq.predefined BRANCH=none BUG=b:144959033 TEST=make buildall Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: If7c2f241562a093d4acf32ccccdf247092458fdd Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2869429 Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* hatch_fp/board: Set correct TIM_WATCHDOG for bloonchipperPatryk Duda2021-08-271-1/+1
| | | | | | | | | | | | | | | | | | | Timer 16 doesn't exist on STM32F4 (see __hw_timer_enable_clock() in chip/stm32/hwtimer32.c). Changed TIM_WATCHDOG to timer which is not used. BUG=b:196391184 b:152048657 BRANCH=none TEST=Flash on dragonclaw. Issue 'crash watchdog' and check if warning appears before reset. Signed-off-by: Patryk Duda <pdk@semihalf.com> Change-Id: Iab9548dba045f500ab0249c561e287c7ba160f14 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3118289 Tested-by: Patryk Duda <patrykd@google.com> Tested-by: Tom Hughes <tomhughes@chromium.org> Reviewed-by: Tom Hughes <tomhughes@chromium.org> Commit-Queue: Tom Hughes <tomhughes@chromium.org>
* Tomato: Add BMA422 for LID ACCELSue Chen2021-08-272-12/+59
| | | | | | | | | | | | | | | board_id >= 2: BMA422 board_id < 2 : KX022 BUG=b:197383637 BRANCH=none TEST=ectool motionsense can get BMA422 data Signed-off-by: Sue Chen <sue.chen@quanta.corp-partner.google.com> Change-Id: Ib0582c7606c4965eec52f58f4ff0fbc026512ca6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3117365 Reviewed-by: Ting Shen <phoenixshen@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org>
* Tomato: read C1 VBUS voltage from rt1718sSue Chen2021-08-272-0/+19
| | | | | | | | | | | | | | | For ADC_VBUS only for C0 VBUS voltage, C1 VBUS voltage should be read from rt1718s internal VBUS ADC. BUG=b:196001868 BRANCH=none TEST=show correct C1 vbus voltage on tomato Signed-off-by: Sue Chen <sue.chen@quanta.corp-partner.google.com> Change-Id: I6c90386e083a480ffaeacd7739d4ddebe0bd8e1e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3114326 Commit-Queue: Ting Shen <phoenixshen@chromium.org> Reviewed-by: Ting Shen <phoenixshen@chromium.org>
* charge_manager: board specific callback to get vbus voltageSue Chen2021-08-274-0/+19
| | | | | | | | | | | | | | | | Add board_get_vbus_voltage to get vbus voltage by board, for ADC_VBUS maybe is only for one typec port when the DUT supports multiple typec. BUG=b:196001868 BRANCH=none TEST=show correct C1 vbus voltage on tomato Signed-off-by: Sue Chen <sue.chen@quanta.corp-partner.google.com> Change-Id: Ia567ec3bddf4f62a08c9902b4f0721783f2c07ff Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3084403 Reviewed-by: Ting Shen <phoenixshen@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org>
* redrix: Move MICMUTE key before MUTE keyDevin Lu2021-08-271-5/+5
| | | | | | | | | | | | | BUG=b:193752537 BRANCH=none TEST=evtest, make sure the keycode is correct. Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Change-Id: If9a67903d4368d46d42acc3052a6540a381afd56 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3120987 Reviewed-by: Zick Wei <zick.wei@quanta.corp-partner.google.com> Reviewed-by: caveh jalali <caveh@chromium.org> Commit-Queue: caveh jalali <caveh@chromium.org>
* primus: add celxpert batteryScott Chao2021-08-272-0/+30
| | | | | | | | | | | | | BUG=b:195568649 BRANCH=none TEST=make -j BOARD=primus TEST=ectool batterycutoff works Change-Id: Id65ee395e1bcff4e276b7d2df766f9e33ecf02de Signed-off-by: Scott Chao <scott_chao@wistron.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3121865 Reviewed-by: Boris Mittelberg <bmbm@google.com> Commit-Queue: caveh jalali <caveh@chromium.org>
* ec3po: Update unittests to use ec3po.<module> import paths.Matthew Blecker2021-08-273-10/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | run_tests.sh no longer uses the Python unittest module's discovery functionality, which was forcing util/ec3po/ subdir to be directly in sys.path as a top-level module location, which is inconsistent with how ec3po modules are used outside of the tests. run_tests.sh no longer auto-discovers *_unittest.py files, instead they are individually listed as ec3po.<name>_unittest modules. It would be straightforward to implement test module autodiscovery, but probably isn't worth the complexity. BRANCH=none BUG=chromium:1031705,b:174894072,b:197618562 TEST=Within chroot, ran ./runtests.sh from within util/ec3po/ directory. Within chroot, ran ~/trunk/src/platform/ec/util/ec3po/run_tests.sh from a different directory. Verified use of the files-under-test (as opposed to the files installed in site-packages/) by adding broken code to console.py and then re-running both invoctions above. Both then failed as intended. Change-Id: I40c180f1d66a4d3befc548f4d763357e6cc24201 Signed-off-by: Matthew Blecker <matthewb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3123835 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* brya: Tune thermal_params, adc_channels for board ID 1Caveh Jalali2021-08-272-1/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | BRANCH=none BUG=b:183452273,b:181271666 TEST=verified tmep sensors report plausible values on board ID 1 and 2: > adc TEMP_DDR_SOC = 1749 mV TEMP_AMBIENT = 1749 mV TEMP_CHARGER = 1556 mV TEMP_WWAN = 1815 mV > > temps DDR and SOC : 304 K = 31 C 0% Ambient : 304 K = 31 C 0% Charger : 310 K = 37 C 0% WWAN : 302 K = 29 C 0% > > thermalget sensor warn high halt fan_off fan_max name 0 0 343 353 308 323 DDR and SOC 1 0 348 353 313 328 Ambient 2 0 348 353 313 328 Charger 3 0 348 353 313 328 WWAN > also, on board ID 1: > adc TEMP_DDR_SOC = 1784 mV TEMP_AMBIENT = 1168 mV TEMP_CHARGER = 1168 mV TEMP_WWAN = 1168 mV > > temps DDR and SOC : 303 K = 30 C 0% Ambient : 322 K = 49 C 60% Charger : 322 K = 49 C 60% WWAN : 322 K = 49 C 60% > > thermalget sensor warn high halt fan_off fan_max name 0 0 343 353 308 323 DDR and SOC 1 0 348 353 313 328 Ambient 2 0 348 353 313 328 Charger 3 0 348 353 313 328 WWAN > We simply see ambient, charger, WWAN report the same sensor. Change-Id: I1d6dd171b09ea2ebb22193d52ae57804920d740c Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3116991 Reviewed-by: Sumeet R Pawnikar <sumeet.r.pawnikar@intel.com> Reviewed-by: Boris Mittelberg <bmbm@google.com>
* adc: Allow runtime config of adc_channelsCaveh Jalali2021-08-275-0/+33
| | | | | | | | | | | | | | | This adds the CONFIG_ADC_CHANNELS_RUNTIME_CONFIG config option to allow the adc_channels array to be tweaked at runtime. BRANCH=none BUG=b:183452273,b:181271666 TEST=buildall passes Change-Id: I1241012b6e36c19baa7fe80853a6c6de4affeefa Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3116990 Reviewed-by: Boris Mittelberg <bmbm@google.com> Reviewed-by: Keith Short <keithshort@chromium.org>
* adc: Remove adc_chip.h where adc.h is usedCaveh Jalali2021-08-27104-104/+0
| | | | | | | | | | | | | | This removes the use of adc_chip.h where adc.h is also used. In this case, adc_chip.h is redundant. BRANCH=none BUG=b:181271666 TEST=buildall passes Change-Id: Id7baf9aef949447a4d47934242f9bae97c971262 Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3120317 Reviewed-by: Keith Short <keithshort@chromium.org>
* adc: Update board files to match adc.h refactorCaveh Jalali2021-08-277-7/+7
| | | | | | | | | | | | | | This updates a few board files that were including adc_chip.h instead of adc.h. adc_chip.h should not be included explicitly in most cases. BRANCH=none BUG=b:181271666 TEST=buildall passes Change-Id: I42f8b5b2129ebe18a96d089f0355b581cba1b274 Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3120316 Reviewed-by: Keith Short <keithshort@chromium.org>
* adc: Include adc_chip.h from adc.hCaveh Jalali2021-08-2720-52/+28
| | | | | | | | | | | | | | | | This reorganizes adc.h and adc_chip.h so that general code only needs to know about adc.h. adc_chip.h is now included by adc.h directly and does not need to be included in general code. BRANCH=none BUG=b:181271666 TEST=buildall passes (with next patch in series) Cq-Depend: chromium:3120316 Change-Id: I8bc107c6900e831a57f7a7fb8668eb08bb179d6c Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3120315 Reviewed-by: Keith Short <keithshort@chromium.org>
* brya: Support temp sensors on board ID 2Caveh Jalali2021-08-272-11/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Brya board ID 2 has 4 temp sensors. This updates adc_channels, temp_sensors, and thermal_params accordingly. BRANCH=none BUG=b:183452273,b:181271666 TEST=verified tmep sensors report plausible values on board ID 2: > adc TEMP_DDR_SOC = 1749 mV TEMP_AMBIENT = 1749 mV TEMP_CHARGER = 1556 mV TEMP_WWAN = 1815 mV > > temps DDR and SOC : 304 K = 31 C 0% Ambient : 304 K = 31 C 0% Charger : 310 K = 37 C 0% WWAN : 302 K = 29 C 0% > > thermalget sensor warn high halt fan_off fan_max name 0 0 343 353 308 323 DDR and SOC 1 0 348 353 313 328 Ambient 2 0 348 353 313 328 Charger 3 0 348 353 313 328 WWAN > Cq-Depend: chromium:3116991 Change-Id: I5a973f8ad281f11713c64974ac2848a3655eee17 Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3116989 Reviewed-by: Sumeet R Pawnikar <sumeet.r.pawnikar@intel.com> Reviewed-by: Boris Mittelberg <bmbm@google.com>
* Revert "zmake: add NPCX monitor to output packer list"Keith Short2021-08-271-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 769264c30d58e0b12795411e99e7d3efbbf78e2d. Reason for revert: This CL is causing b:197899072 Original change's description: > zmake: add NPCX monitor to output packer list > > Add the NPCX monitor binary to the output directory when using the NPCX > output packer. > > BUG=b:197162681 > BRANCH=none > TEST=Build zephyr for volteer, verify npcx_monitor.bin is present in the > output directory with the zephyr.bin image. > > Signed-off-by: Keith Short <keithshort@chromium.org> > Change-Id: I5ab29a797830b6870df5b86e70ebe86a62ff430b > Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3122866 > Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> > Reviewed-by: Yuval Peress <peress@chromium.org> Bug: b:197162681 Change-Id: I6b3f08aa2a7649b06ce8059f58b0f94fe803982d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3123838 Auto-Submit: Keith Short <keithshort@chromium.org> Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com> Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
* gimble: switch T6 to T8 keysWill Tsai2021-08-261-3/+3
| | | | | | | | | | | | | | | | We have brightness_down at T6, brightness_up at T7 and keyboard backlight at T8. BUG=b:194146863 BRANCH=none TEST=make -j BOARD=gimble Signed-off-by: Will Tsai <will_tsai@wistron.corp-partner.google.com> Change-Id: I2de34e783bafb4718649c07a1eea70a60be6b59f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3115041 Tested-by: Scott Chao <scott_chao@wistron.corp-partner.google.com> Reviewed-by: caveh jalali <caveh@chromium.org> Commit-Queue: caveh jalali <caveh@chromium.org>
* gooey: Check pen detection on initarthur.lin2021-08-261-0/+6
| | | | | | | | | | | | | | | | | | | The Pen detection is detecting by interrupt. However, it will miss the event on init if stylus already into garage. This patch adds checking pen detection on init. BRANCH=keeby BUG=None TEST=make buildall -j On Gooey, Resume from battery cutoff or EC hibernate. Make sure stylus is charging. Signed-off-by: arthur.lin <arthur.lin@lcfc.corp-partner.google.com> Change-Id: Ic381faad843c03655f6dd1f7f5a4b2bbfecb3be6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3120769 Reviewed-by: Henry Sun <henrysun@google.com> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
* servo_updater: Add clean reboot at the end of updating procedureLukasz Hajec2021-08-261-0/+3
| | | | | | | | | | | | | | | | | | | | In current state after firmware is updated we perform reboot and check if servo is in RO. Due to this check we need to reinitialize uart connection. This procedure takes resources from kernel driver and makes it impossible to use servo console from OS just after servo_updater. This patch adds additional reboot, it allows kernel driver to reconnect to servo console and use it. BRANCH=None BUG=b:196021317 TEST=run servo_updater.py, after the tool finishes job check if we can access servo EC via serial terminal using e.g. picocom /dev/ttyUSB0. Signed-off-by: Lukasz Hajec <lha@semihalf.com> Change-Id: Icebb1a2faa8803d13736ea241b894adaf146b433 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3111367 Reviewed-by: Matthew Blecker <matthewb@chromium.org> Commit-Queue: Matthew Blecker <matthewb@chromium.org>
* haboki: Add battery ATL GB-S20-4473A9-01H&020HZick Wei2021-08-262-0/+34
| | | | | | | | | | | | BUG=b:197820442 BRANCH=keeby TEST=Make sure battery charging, battery cutoff works. Signed-off-by: Zick Wei <zick.wei@quanta.corp-partner.google.com> Change-Id: Ie53359f33141aa90f390dd088ab0410fc6f47d1b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3120986 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
* flash_ec: Updates to support Zephyr imagesKeith Short2021-08-261-0/+21
| | | | | | | | | | | | | | | | | | | | | Add support for flashing Zephyr images. This includes finding the NPCX monitor binary built with Zephyr images instead of requiring a cros-ec build to provide the monitor. Automatically finding and flashing Zephyr images built with "emerge-<board> chromeos-zephyr" is not supported by this change. BUG=b:197162681 BRANCH=none TEST=Delete cros-ec build directories to ensure NPCX monitor comes from Zehpyr builds. TEST=Verify local image programming using "./util/flash_ec --board volteer --zephyr" Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: Ib85f65b241bd0119bb8cce3193cede5a9fcee4aa Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3116568 Reviewed-by: Wai-Hong Tam <waihong@google.com>
* zmake: add NPCX monitor to output packer listKeith Short2021-08-261-0/+4
| | | | | | | | | | | | | | | | Add the NPCX monitor binary to the output directory when using the NPCX output packer. BUG=b:197162681 BRANCH=none TEST=Build zephyr for volteer, verify npcx_monitor.bin is present in the output directory with the zephyr.bin image. Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I5ab29a797830b6870df5b86e70ebe86a62ff430b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3122866 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Yuval Peress <peress@chromium.org>
* zephyr: compile NPCX monitorKeith Short2021-08-267-0/+845
| | | | | | | | | | | | | | | Compile the NPCX monitor code under the Zephyr environment. BUG=b:197162681 BRANCH=none TEST=Build zephyr for volteer. Verify npcx_monitor.bin is created. Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: Idba6e013288eb9c300c91ea57313db08e13b2e97 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3116567 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Wai-Hong Tam <waihong@google.com> Reviewed-by: CH Lin <chlin56@nuvoton.com>
* honeybuns: fix check for fw_config from CBIScott Collyer2021-08-262-1/+7
| | | | | | | | | | | | | | | | | | | | This CL fixes a logic error where CBI FW_CONFIG field was being checked. In addition, the CBI config option to bypass the write protection check was added as the CBI is only being used to store the dock_mf preference and doesn't need to be write protected. BUG=b:164157329 BRANCH=quiche TEST=Verified on Gingerbread that the status LED color matches with the dock's MF preference. In addition, verified that following a power cycle, the MF preference is read properly from the CBI. Signed-off-by: Scott Collyer <scollyer@google.com> Change-Id: Ie3d5b8d4af73b1d09b3f58f1a990b7c77cb4a6fe Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3116666 Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Scott Collyer <scollyer@chromium.org>
* honeybuns: override usb_ufp_check_usb3_enable()Scott Collyer2021-08-262-1/+6
| | | | | | | | | | | | | | | | | | This CL adds an override function for usb_ufp_check_usb3_enable() so that USB3.1 mode gets enabled by default when attaching as a SNK/UFP in a type-c only connection. BUG=b:195042155 BRANCH=quiche TEST=Verfied that when I connect USBC only source on gingerbread that the TUSB1064 usb mux gets configured to enable USB3.1 mode. Signed-off-by: Scott Collyer <scollyer@google.com> Change-Id: Ib1a12f1c221133d50dcbacb02bb3376ff11fc833 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3120065 Commit-Queue: Scott Collyer <scollyer@chromium.org> Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org>
* usb_mux: Add function to enable USB3.1 mode for UFPScott Collyer2021-08-262-0/+25
| | | | | | | | | | | | | | | | | | | | | This CL adds a new overridable function to allow boards more control over the USB mux. For type-c only connections, the mux may only be set one time based only on data role. The default function returns false, so only boards which override this function will be affected. BUG=b:195042155 BRANCH=quiche TEST=Verfied that when I connect USBC only source on gingerbread that the TUSB1064 usb mux gets configured to enable USB3.1 mode. Signed-off-by: Scott Collyer <scollyer@google.com> Change-Id: I5cc7466d2d13c46b1ff6cfc48af577559591f6e4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3119224 Tested-by: Scott Collyer <scollyer@chromium.org> Commit-Queue: Scott Collyer <scollyer@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org>
* Guybrush: Flag that retimers will power off in G3Diana Z2021-08-261-0/+2
| | | | | | | | | | | | | | | | Both retimers for guybrush will power off in G3, so flag them as such. This is only functionally relevant to the ANX retimer, since it starts up in USB mode by default, but is true for both. BRANCH=None BUG=b:195045790 TEST=on guybrush, power down to G3 and then power back up and ensure retimer is turned off Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: Ia23051ba65b232179cd3b7b3d7c1710487dcd5d2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3095019 Reviewed-by: Rob Barnes <robbarnes@google.com>
* ANX7451: Report failure to set mux in G3Diana Z2021-08-261-3/+6
| | | | | | | | | | | | | | | | | | | Since the ANX7451 is unpowered in Z1/G3, return an error for mux sets during this time. This will let the usb_mux.c code know that any set it attempted to perform was unsuccessful. Otherwise, it will be assumed that setting mux mode of None succeeded, when we'll actually power up to default USB mode. BRANCH=None BUG=b:195045790 TEST=on guybrush, power on board and ensure that C1 is put into None mode successfully after its powered Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: Ic98be3bc15e8f0affeda25d7d7170b89e3aecf10 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3093087 Reviewed-by: Rob Barnes <robbarnes@google.com> Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* zmake: exclude NPCX monitor from coverageKeith Short2021-08-261-0/+2
| | | | | | | | | | | | | | Exclude the NPCX monitor binary sources from coverage BUG=b:197162681 BRANCH=none TEST=zmake testall, zmake converage /tmp/zephyr-coverage Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I86c5270d3599ac486c84479e64225839b4374502 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3122865 Commit-Queue: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Jeremy Bettis <jbettis@chromium.org>
* Chronicler: Remove unused daughterboard configurationYu-An Chen2021-08-264-191/+20
| | | | | | | | | | | | | | | | Remove unused daughterboard configuration BUG=b:191551619 BRANCH=volteer TEST=Check USB C1 port working normally Cq-Depend: chrome-internal:4066744 Signed-off-by: Yu-An Chen <yu-an.chen@quanta.corp-partner.google.com> Change-Id: I553213fab05ce1ca5d864170454b54f8381abfc9 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2978651 Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Reviewed-by: YH Lin <yueherngl@chromium.org> Commit-Queue: YH Lin <yueherngl@chromium.org>
* zephyr: zmake: add re-exec logicJack Rosenthal2021-08-252-0/+111
| | | | | | | | | | | | | | | | | | | Add some logic to re-exec zmake when running inside of a chroot and we find the source code available (to reduce the number of times we have to update the chroot). Note: we also discussed adding a chroot-upgrade-required warning logic. This is actually a separate idea so will be handled in a separate CL. BUG=b:197636145 BRANCH=none TEST=unit tests Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I26ecbb9a575f22c8667a1928e4bd5836f6fd4fe1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3114503 Reviewed-by: Yuval Peress <peress@chromium.org>
* dedede: Update relevant paths fileAseda Aboagye2021-08-251-0/+15
| | | | | | | | | | | | | | | | | This commit adds some relevant paths to be included in the merge commit messages for the dedede firmware branch. BUG=None BRANCH=firmware-dedede-13606 TEST=None Signed-off-by: Aseda Aboagye <aaboagye@google.com> Change-Id: I42b481c6f8dfabed042e5bb701b47323e38d8f3e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3120073 Tested-by: Aseda Aboagye <aaboagye@chromium.org> Auto-Submit: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Diana Z <dzigterman@chromium.org>
* driblee: remove PWM KB light settingMatt_Wang2021-08-252-18/+0
| | | | | | | | | | | | | | | | Driblee does not support the KB light PWM behavior so remove it. BUG=b:195810621 BRANCH=keeby TEST=make BOARD=driblee Signed-off-by: Matt_Wang <Matt_Wang@compal.corp-partner.google.com> Change-Id: I64bc27ae0769a743be67fc4f29597f158e98445b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3115869 Tested-by: Matt Wang <matt_wang@compal.corp-partner.google.com> Reviewed-by: Elmo Lan <elmo_lan@compal.corp-partner.google.com> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
* Corori: modify thermistor defineMatt_Wang2021-08-252-3/+2
| | | | | | | | | | | | | | | | | Remove CONFIG_THROTTLE_AP, CONFIG_THERMISTOR_NCP15WB and add CONFIG_THERMISTOR for corori. BUG=b:197191995 BRANCH=keeby TEST=make BOARD=corori Signed-off-by: Matt_Wang <Matt_Wang@compal.corp-partner.google.com> Change-Id: I4594e906562471eb4791959278efab2ec16d9bf3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3113258 Tested-by: Matt Wang <matt_wang@compal.corp-partner.google.com> Reviewed-by: SamSP Liu <samsp_liu@compal.corp-partner.google.com> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
* Corori:Initial EC image GPIOearlwang2021-08-253-87/+14
| | | | | | | | | | | | | | | | | | Initial gpio for corori BUG=b:194356176 BRANCH=keeby TEST=make -j BOARD=corori success Signed-off-by: earlwang <earl_wang@compal.corp-partner.google.com> Change-Id: I0065af9b0738775d2b4d06fea7acc60a0abb298b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3099430 Reviewed-by: SamSP Liu <samsp_liu@compal.corp-partner.google.com> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Josh Tsai <josh_tsai@compal.corp-partner.google.com> Reviewed-by: Elmo Lan <elmo_lan@compal.corp-partner.google.com> Tested-by: SamSP Liu <samsp_liu@compal.corp-partner.google.com> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
* servo_v4p1: Manage USB2/USB3 terminations based on data roleJan Dabros2021-08-252-4/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | Previously servo_v4p1 was running with USB2 and USB3 paths always on. This was completely ignoring data role of servo. Especially, we shouldn't apply device terminations on USB2/USB3 lines once servo is acting as DFP. While in this mode the only allowed configuration is to establish FASTBOOT, that is direct connection between DUT and HOST. Make use of the CONFIG_USBC_SS_MUX_UFP_ONLY, since USB3 muxer on servo should be enabled only when servo is UFP. BUG=b:137887386,b:182419010 BRANCH=main TEST=Perform "cc snkdts" and "cc srcdts" sequence couple of time and verify presence of all expected USB2 & USB3 devices on the DUT side. TEST=Another test may be to unplug and re-plug CHG connector to servo and verify presence of all expected USB2 & USB3 devices on the DUT. Signed-off-by: Jan Dabros <jsd@semihalf.com> Change-Id: I54a637b67cf62f20658c8c4522a8d8ccc011d863 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3094249 Tested-by: Lukasz Hajec <lha@semihalf.com> Reviewed-by: Wai-Hong Tam <waihong@google.com> Commit-Queue: Wai-Hong Tam <waihong@google.com>
* servo_v4p1: Initial support for FASTBOOT handlingJan Dabros2021-08-252-0/+15
| | | | | | | | | | | | | | | | | | | | | Hardware support for FASTBOOT is in place, however servo_v4p1 is currently not exposing an API for servod. Along with improvement for correct DATA_ROLE handling on servo_v4p1 (in consecutive patch), add a knob for enabling FASTBOOT. It is necessary to add complete sequence when enabling FASTBOOT - that is changing servo DATA_ROLE to DFP. This work will be done in the future. BUG=b:137887386 BRANCH=main TEST=Conduct test from consecutive patch Signed-off-by: Jan Dabros <jsd@semihalf.com> Change-Id: I6cb53ebc9b412002db750b58d04170060478ebd4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3094248 Reviewed-by: Wai-Hong Tam <waihong@google.com> Commit-Queue: Wai-Hong Tam <waihong@google.com>
* servo_v4p1: Fix routines for uservo & fastboot muxersJan Dabros2021-08-251-1/+1
| | | | | | | | | | | | | | | | | | | * uservo_to_host() function shouldn't touch FASTBOOT_DUTHUB muxer * dut_to_host() should fully configure fastboot path These functions were previously unused, however in consecutive patch new management for uservo and fastboot functionalities is added. BUG=b:137887386 BRANCH=main TEST=Conduct test from consecutive patch Signed-off-by: Jan Dabros <jsd@semihalf.com> Change-Id: Ic915caee53c9397b8b0716fbf72d86320aae5e49 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3094247 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Wai-Hong Tam <waihong@google.com> Commit-Queue: Wai-Hong Tam <waihong@google.com>
* pd: usb: Add usb type-c USB mux handling for UFP-only platformsJan Dabros2021-08-252-0/+9
| | | | | | | | | | | | | | | | | | | | | Some platforms (e.g. servo_v4(p1)) are designed to act only as a UFP considering superspeed terminations. Add config option to properly manage usb superspeed muxer for such. BUG=b:137887386,b:182419010 BRANCH=main TEST=With servo_v4p1 connected to the DUT, unplug and replug CHG couple of times in order to force PR_SWAP on DUT port. Each time verify on the DUT console, whether all USB3 devices are visible. They should be, since servo is trying to perform DR_SWAP when it acts as a SRC. Signed-off-by: Jan Dabros <jsd@semihalf.com> Change-Id: I0a7756f0bb2192795b7489334ed01d317d3e54ee Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3094246 Reviewed-by: Michał Barnaś <mb@semihalf.com> Reviewed-by: Wai-Hong Tam <waihong@google.com> Commit-Queue: Wai-Hong Tam <waihong@google.com>
* chip/stm32: Add initial support for STM32L5xx seriesJes B. Klinke2021-08-2514-5/+2586
| | | | | | | | | | | | | | | | Introduce L5xx mostly as copy of L4xx, though registers-stm32l5.c is extensively modified. BUG=b:192262089 TEST=Compile and upload board/hyperdebug to Nucleo board BRANCH=none Signed-off-by: Jes B. Klinke <jbk@opentitan.org> Change-Id: Iccc7b05e4f2dfa732559b8099cf856882401e31c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3086362 Tested-by: Jes Klinke <jbk@chromium.org> Reviewed-by: Scott Collyer <scollyer@chromium.org> Commit-Queue: Jes Klinke <jbk@chromium.org>
* common: move standard library functions from util.c to another fileMichał Barnaś2021-08-257-695/+336
| | | | | | | | | | | | | | | | | | This commit moves some of the standard library functions from util.c file to util_stdlib.c file. It will allow to use util.c for both CrOS EC and Zephyr builds and will make shim util file unnecessary. BRANCH=main BUG=b:177096231 TEST=Build both, CrOS EC and Zephyr firmwares Compilation should finish without any problems After flashing, both versions work as they should Change-Id: If6f930a04d28bec35faa16759f43b36176bf3de7 Signed-off-by: Michał Barnaś <mb@semihalf.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3081827 Commit-Queue: Keith Short <keithshort@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
* Chronicler: Update battery specYu-An Chen2021-08-252-4/+39
| | | | | | | | | | | | | | | Update battery manufacturer name BUG=b:190685811 BRANCH=volteer TEST=check NVT CP813907-01 still working. Signed-off-by: Yu-An Chen <yu-an.chen@quanta.corp-partner.google.com> Change-Id: I689a59b3a64194d163a2eff4d0d3c4c6ed70cc8a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3115076 Reviewed-by: Isaac Lee <isaaclee@google.com> Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* guybrush: Enable AMD STTRob Barnes2021-08-255-13/+63
| | | | | | | | | | | | | | | | Enable AMD STT driver. The AMD STT driver will read the SOC and ambient temperature sensors every second and send the result to the SOC via SB RMI on the i2c bus. BUG=b:176994331 TEST=stt debug BRANCH=None Signed-off-by: Rob Barnes <robbarnes@google.com> Change-Id: I45157acf172dcce00c24971be70c5ec609d460dd Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3082326 Commit-Queue: Diana Z <dzigterman@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org>
* tmp112: Support reading TMP112 in millikelvinRob Barnes2021-08-258-18/+41
| | | | | | | | | | | | | | | TMP112 supports .0625 degrees of resolution. Retain this resolution and support reading the temp in degrees millikelvin. BUG=b:176994331 TEST=Build and run on guybrush BRANCH=None Change-Id: I2802016b1edb08678953238e7f01acdd320c37cf Signed-off-by: Rob Barnes <robbarnes@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3001391 Commit-Queue: Diana Z <dzigterman@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org>