summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* flash_fp_mcu: Add delay to consider bootloader startupstabilize-quickfix-13904.98.B-mainstabilize-13904.67.B-mainstabilize-13904.66.B-mainstabilize-13904.62.B-mainstabilize-13904.59.B-mainstabilize-13904.58.B-mainstabilize-13904.55.B-mainstabilize-13904.49.B-mainstabilize-13904.48.B-mainstabilize-13904.47.B-mainstabilize-13904.44.B-mainstabilize-13904.43.B-mainstabilize-13904.42.B-mainstabilize-13904.41.B-mainstabilize-13904.34.B-mainrelease-R91-13904.B-mainSujit Kautkar2021-04-271-0/+8
| | | | | | | | | | | | | | | | | | | | Add delay of 100 ms to consider minimum bootloader start time for stm32. This fix prevents triggering stm32mon before bootloader is finished. BRANCH=none BUG=b:185074067 TEST=Multiple 'flash_fp_mcu <fpfw>' Tested on coachz, nocturne and morphius boards Change-Id: Ic60e9e67c29664ce22bfc66bec6eaf76ffc80454 Signed-off-by: Sujit Kautkar <sujitka@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2837485 Tested-by: Sujit Kautkar <sujitka@chromium.org> Reviewed-by: Alexandru M Stan <amstan@chromium.org> Commit-Queue: Sujit Kautkar <sujitka@chromium.org> (cherry picked from commit 8cff79c7f79da51e20bfd76f6e1e1b3465b63262) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2854415 Reviewed-by: Sujit Kautkar <sujitka@chromium.org>
* console: make sure eol check runs in python3Ruben Rodriguez Buchillon2021-04-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Indexing into a byte array returns an integer, which will return False when compared to a byte-array. This change makes sure we're comparing two characters (python2) or two integers (python3) BRANCH=None BUG=b:183642673 TEST=python3 b'hello\n'[-1]==b'\n' False TEST=python2.7 b'hello\n'[-1]==b'\n' True TEST=python3 b'hello\n'[-1]==b'\n'[0] True Change-Id: I26a4b1bde7acf733faae7ec355da228d76e261d0 Signed-off-by: Ruben Rodriguez Buchillon <coconutruben@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2809883 Reviewed-by: Mary Ruthven <mruthven@chromium.org> Tested-by: Mary Ruthven <mruthven@chromium.org> (cherry picked from commit a18259036ddc0f1a2cf9673772ba03360aac3b74) Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2846947
* mtscp-rv32i: move mpu settings from board to baseboardTzung-Bi Shih2021-04-095-30/+6
| | | | | | | | | | | | BRANCH=none BUG=b:184793035 TEST=make BOARD=asurada_scp && make BOARD=cherry_scp Signed-off-by: Tzung-Bi Shih <tzungbi@chromium.org> Change-Id: I3d9406bf15275a0423cdf2b9ca5ea1b2ea96f7df Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2814478 Reviewed-by: Ting Shen <phoenixshen@chromium.org> Reviewed-by: Eric Yilun Lin <yllin@chromium.org>
* cherry_scp: change the SRAM sizeTzung-Bi Shih2021-04-092-6/+6
| | | | | | | | | | | | | | Cherry's SRAM size is 768KB. Changes the memory layout accordingly. BRANCH=none BUG=b:184793035 TEST=make BOARD=cherry_scp Signed-off-by: Tzung-Bi Shih <tzungbi@chromium.org> Change-Id: I46de843610942842511d47922bd7d99a84ddeca8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2813400 Reviewed-by: Ting Shen <phoenixshen@chromium.org> Reviewed-by: Eric Yilun Lin <yllin@chromium.org>
* cherry_scp: add initial cherry SCP boardTzung-Bi Shih2021-04-095-0/+96
| | | | | | | | | | | | | | This is basically: cp -r board/asurada_scp board/cherry_scp. BRANCH=none BUG=b:184793035 TEST=make BOARD=cherry_scp Signed-off-by: Tzung-Bi Shih <tzungbi@chromium.org> Change-Id: I7a035962a5a371587b5bea6f1cd78cd777dcdc8d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2813399 Reviewed-by: Ting Shen <phoenixshen@chromium.org> Reviewed-by: Eric Yilun Lin <yllin@chromium.org>
* baseboard/mtscp-rv32i: add initial versionTzung-Bi Shih2021-04-0910-55/+74
| | | | | | | | | | | | | | Moves common code from board/asurada_scp to baseboard/mtscp-rv32i. BRANCH=asurada BUG=b:184793035 TEST=make BOARD=asurada_scp Signed-off-by: Tzung-Bi Shih <tzungbi@chromium.org> Change-Id: I34f9d789ee60449630dd580a9eccff69493b4b21 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2814042 Reviewed-by: Ting Shen <phoenixshen@chromium.org> Reviewed-by: Eric Yilun Lin <yllin@chromium.org>
* zephyr: Stub out interrupt_disable_all() for testsKeith Short2021-04-091-0/+2
| | | | | | | | | | | | | | | Stub out interrupt_disable_all() definition for tests to fix compiler warnings. BUG=none BRANCH=none TEST=zmake testall Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: Id605aa41c9977f1b231779b1a29c769e4dd90335 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2816143 Commit-Queue: Yuval Peress <peress@chromium.org> Reviewed-by: Yuval Peress <peress@chromium.org>
* zephyr: Fix duplicated definition warningKeith Short2021-04-091-10/+12
| | | | | | | | | | | | | | Fix a duplicated definition warning in zephyr/test/system. BUG=none BRANCH=none TEST=zmake testall Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: Ic18dbbd7a9523484c6c46552d807424dcf227d33 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2816142 Commit-Queue: Yuval Peress <peress@chromium.org> Reviewed-by: Yuval Peress <peress@chromium.org>
* zephyr: Disable PLATFORM_EC_STACKOVERFLOW for tests.Keith Short2021-04-091-1/+1
| | | | | | | | | | | | | | | Disable the CONFIG_PLATFORM_EC_STACKOVERFLOW for tests and the posix-ec build to fix a compiler warning. BUG=none BRANCH=none TEST=zmake testall Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: If45fc5d342991d7aef8a5392b2eb3b8e9f6b8d2c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2816141 Commit-Queue: Yuval Peress <peress@chromium.org> Reviewed-by: Yuval Peress <peress@chromium.org>
* zephyr: Fix compiler warnings from zephyr testsKeith Short2021-04-092-3/+9
| | | | | | | | | | | | | | | Fix the warning that an attribute declaration must precede the definition. BUG=none BRANCH=none TEST=zmake testall Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: I9b0394d276e0fb39983cd43269804a70139c0655 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2816140 Commit-Queue: Yuval Peress <peress@chromium.org> Reviewed-by: Yuval Peress <peress@chromium.org>
* isl9241: Toggle learning mode when fully chargedDevin Lu2021-04-091-0/+25
| | | | | | | | | | | | | | | | In low-power states, the ISL9241 may become stuck in CCM, consuming excess power. Toggle learning mode to enter DCM and save power. This is a workaround recommended by Renasas. BUG=b:183771327 BRANCH=firmware-volteer-13672.B-main TEST=Verifed charger doesn't stuck in CCM mode. Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Change-Id: I70bf088b9214fd4b3cee137da561ba84e854106a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2789811 Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Commit-Queue: Abe Levkoy <alevkoy@chromium.org>
* AMD FP6 Mux: Correct ready bitDiana Z2021-04-092-1/+3
| | | | | | | | | | | | | | Ready will actually be indicated by bit 6 in the status return. BRANCH=None BUG=b:184680878 TEST=on guybrush, confirm we see C1 mux as "ready" and try to set appropriate state Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: Ic522add422f06acddaf88a445398727a0e5be482 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2811940 Reviewed-by: Bhanu Prakash Maiya <bhanumaiya@google.com>
* zephyr: Wait for zmake logging even on errorJeremy Bettis2021-04-091-5/+7
| | | | | | | | | | | | | | | | | | | | When zmake fails, some of the logging of subprocesses can be lost. Call multiproc.wait_for_log_end() even if the subcommand raises an error. BUG=b:184298184 TEST=Wrote a test that doesn't compile, then cros workon --host start chromeos-base/zephyr-build-tools sudo emerge chromeos-base/zephyr-build-tools zmake -j 1 configure --test zephyr/test/drivers BRANCH=none Change-Id: If7799c1cc6f50a0d4602f7bc931d51abf95d00f2 Signed-off-by: Jeremy Bettis <jbettis@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2815244 Tested-by: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org> Commit-Queue: Jeremy Bettis <jbettis@chromium.org>
* ec: Improve coverage report.Jeremy Bettis2021-04-082-2/+16
| | | | | | | | | | | | | | | | | | | | | | Exclude the test directories from ec coverage report. Include the test name into the coverage data. Show the test name details in the coverage report. Build several boards with coverage enabled, and use that to make sure all used files are in the coverage report. This lowers the coverage to 38.4% which seems much more realistic than the old value. BRANCH=none BUG=b:156895937 TEST=make -j coverage Signed-off-by: Jeremy Bettis <jbettis@google.com> Change-Id: I91fc5bc7ce676943d34e91e16662e680628d1b7e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2811939 Commit-Queue: Jeremy Bettis <jbettis@chromium.org> Tested-by: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
* guybrush: Add header for ANX7491 retimerRob Barnes2021-04-081-0/+17
| | | | | | | | | | | | | | | Adding a header to hold register values for ANX7491. ANX7491 should work without configuration. More registers can be added as needed for tuning. BUG=b:184592168 TEST=Build BRANCH=None Signed-off-by: Rob Barnes <robbarnes@google.com> Change-Id: If529bfdedff6b151147c8ef02840621b093be672 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2809881 Reviewed-by: Diana Z <dzigterman@chromium.org>
* riscv-rv32i/task: Remove the remove_me functionDino Li2021-04-081-12/+0
| | | | | | | | | | | | | BUG=none BRANCH=none TEST=buildall. Signed-off-by: Dino Li <Dino.Li@ite.com.tw> Change-Id: I2cd176556f2294de304eca3d2e3d29f68cff85dc Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2531769 Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
* cret: Implement motion sensor settingjohnwc_yeh2021-04-083-26/+35
| | | | | | | | | | | | | | | | | | Implement motion sensor setting on MB side and sensor board side. The sensor of model: 1.MB: LSM6DSOTR 2.Sensor board: LIS2DE12TR BUG=b:184504094 BRANCH=dedede TEST=make BOARD=cret Signed-off-by: johnwc_yeh <johnwc_yeh@compal.corp-partner.google.com> Change-Id: Ie010e38e5c2ffeb5acc09cdcf15aea429169cf5e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2809925 Reviewed-by: Elthan Huang <elthan_huang@compal.corp-partner.google.com> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
* galtic: Update the EC battery config setting.Jacky Wang2021-04-082-0/+30
| | | | | | | | | | | | | | | | | Config the EC battery setting depend on battery spec. BUG=b:175350831 BRANCH=firmware-dedede-13606.B TEST=BOARD=galtic 1. Check battery found on EC log. 2. Check battery cutoff function on EC console. 3. Check battery charging FET status when battery full. Signed-off-by: Jacky Wang <jacky5_wang@pegatron.corp-partner.google.com> Change-Id: Ifcfcf0f14f89d4ce2fea1f1abd7db89f0d26fbb0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2809778 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
* Cret: Initialize the vivaldi keyboardJosh Tsai2021-04-081-0/+27
| | | | | | | | | | | | | | | | Initialize vivaldi keyboard. BUG=b:182016897 BRANCH=main TEST=make BOARD=cret Signed-off-by: Josh Tsai <Josh_Tsai@compal.corp-partner.google.com> Change-Id: I727639a74aa2b11caf482ad3f1d91d4e84129b45 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2812602 Reviewed-by: Josh Tsai <josh_tsai@compal.corp-partner.google.com> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Tested-by: Josh Tsai <josh_tsai@compal.corp-partner.google.com> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
* brya: add ALS and ALS RGB sensorsBoris Mittelberg2021-04-084-2/+113
| | | | | | | | | | | | | | | | | | | | | | Add ambient light sensor (with RGB) to motionsense task BRANCH=none BUG=b:179648721 TEST=manual tests. ALS test from AP console: $ ectool motionsense calibrate 3 $ ectool motionsense See the reading for sensor #3 (clear light) and #4 (RGB) Sensor 3: 18366 0 0 Sensor 4: 9673 5656 3832 The values above change with light intensity and color. I've used Lifx RGB light bulb to verify each channel works. Signed-off-by: Boris Mittelberg <bmbm@google.com> Change-Id: I5f0c1529ae1e05f4df0b0ec6fa01808f64092466 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2808136 Reviewed-by: caveh jalali <caveh@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
* brya: add motionsense task and IMU sensorsBoris Mittelberg2021-04-085-2/+163
| | | | | | | | | | | | | | | | | | | | | | | | | | Add motionsense task with following sensors: lid accel, base accel, base gyro. BRANCH=none BUG=b:179648721 TEST=manual tests were performed Base accel/gyro test on EC console: > accelread 1 Current data 1: -65461 65488 8163 > accelread 2 Current data 2: -2 2 65518 Lid accel test from AP console: $ ectool motionsense Sensor 0: 392 10548 12708 All the values above changed when I moved the boards Signed-off-by: Boris Mittelberg <bmbm@google.com> Change-Id: I03cddcf74611da6d2b5557a3998db6f0314a015a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2798977 Reviewed-by: caveh jalali <caveh@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
* i2c_controller: zephyr: explicitly strip flags from addr_flagsFabio Baltieri2021-04-081-1/+6
| | | | | | | | | | | | | | | | | | | | | | The ECOS I2C APIs use addr_flag to pass the I2C address together with few flags. These are currently passed to the Zephyr API stripping only the PEC bit, and no other flags are used in Zephyr platforms at the moment, but if any flag would be present it would confuse the Zephyr I2C stack. This changes the Zephyr part of the driver to explicitly strip any possible flag from add_flag, and also add a warning to signal that we are discarding some information. BUG=none BRANCH=none TEST=build and flash on volteer TEST=cbi shell command Change-Id: I497fe33c52c78d783c86711928067a4aa0a321d7 Signed-off-by: Fabio Baltieri <fabiobaltieri@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2814624 Reviewed-by: Yuval Peress <peress@chromium.org>
* voxel: add New battery COSMX AP20CBLstabilize-coil-13902.B-mainBen Chen2021-04-082-0/+30
| | | | | | | | | | | | | | new battery config : AP20CBL BUG=b:184225420 BRANCH=volteer TEST=Check found battery info in console and cutoff work. Change-Id: I9496eb025a20a9da029be060dc7df50cd6b04306 Signed-off-by: Ben Chen <ben.chen2@quanta.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2799332 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* brya: Assert PROCHOT when VSYS droops too lowCaveh Jalali2021-04-081-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | This addresses a problem where brya shuts down when running without a battery. The root cause is that VSYS droops too much when SoC power demand spikes. The solution is to raise the VSYS_TH2 threshold in the bq25720 charger chip to provide an early throttle feedback signal to the SoC during high load. The default threshold is 5.9v which is low enough to cause problems. On Brya, we see VSYS drop all the way down to 5.4v at which point the SoC shuts down. The voltage should never be drawn down that low, so tune the charger to assert PROCHOT at 7.0v instead. This throttles the SoC sufficiently during high load to avoid instability. 7.0v was selected after consulting with EE team. BRANCH=none BUG=b:183474163 TEST=booted brya to the OS without a battery Change-Id: Id06e567b9f8a499da7ceb345e673e091c94d90c2 Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2798980 Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Will Arthur <wda@google.com> Commit-Queue: Keith Short <keithshort@chromium.org>
* boldar: change lid sensorDeepti Deshatty2021-04-082-12/+12
| | | | | | | | | | | | | | change lid sensor from BMA255 to LIS2DH12 BRANCH=none BUG=none TEST=Verified the LIS2DH12 detection on the target system. Change-Id: I014917c8eab60e1582f08dd8259efdec92ca6d91 Signed-off-by: Deepti Deshatty <deepti.deshatty@intel.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2812477 Reviewed-by: Sooraj Govindan <sooraj.govindan@intel.com> Reviewed-by: caveh jalali <caveh@chromium.org>
* it83xx: disable pre-defined command at defaultDino Li2021-04-082-0/+4
| | | | | | | | | | | | | | | | With this change, no master is able to see the slave device of pre-defined command on port 0. BUG=b:184804044 BRANCH=none TEST=run i2cscan command on icarus, verified that the slave address isn't present on port 0. Signed-off-by: Dino Li <Dino.Li@ite.com.tw> Change-Id: I6df72132d08a3be6ff97fb501eefc4a9fa8d6f08 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2813878 Reviewed-by: Eric Yilun Lin <yllin@chromium.org>
* asurada : measure VBUS by ADC.Eric Yilun Lin2021-04-085-11/+32
| | | | | | | | | | | | | | | | | | | | Dual VBUS ADC are supported since board revision >= 4. This is to address the inaccurate VBUS present detection on SYV682x. SYV682X assumes can only recognize VBUS equals Vsafe5V or Vsafe0V. If the VBUS is not falling at the both range, it assume the VBUS > vSafe5V and thus VBUS is presented. But if the votlage is fallint between Vsafe5V and Vsafe0V, it still thinks VBUS presented, and this is a false positive. BUG=b:181203590 TEST=ensure VBUS ADC reports reasonable value BRANCH=asurada Change-Id: I1b57395216f1d6788bcd09306b503bdd3b49ddc8 Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2793853 Reviewed-by: Ting Shen <phoenixshen@chromium.org>
* zephyr: gpio: Move named GPIO entries to devicetreeYuval Peress2021-04-0812-172/+297
| | | | | | | | | | | | | | | | Migrate NAMED_GPIO() to devicetree enums. This allows us to create common boards and share the GPIO mappings in dts files. BRANCH=none BUG=none TEST=zmake testall Signed-off-by: Yuval Peress <peress@chromium.org> Change-Id: I41c6151569a04628ac6dcc597f05e529327b7b46 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2804495 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Fabio Baltieri <fabiobaltieri@google.com>
* zephyr: i2c mapping using an enumYuval Peress2021-04-0813-101/+111
| | | | | | | | | | | | | | | | | | | | Currently, every project will need to provide a custom mapping header for i2c as well as gpios. We'd like to move that overhead to the dts files, which will make the board dts a lot more reusable as well as clean up the bringup of new boards. Add to the i2c_ports enum from the dts named i2c port list. Each enum is only added if a node exists using that enum. This also allowes for verifying that the enum is only used once. BRANCH=none BUG=b:184786824 TEST=build and flashed volteer TEST=zmake testall Signed-off-by: Yuval Peress <peress@chromium.org> Change-Id: I42cc098a9badac57a3781fa9dfaf32c0ec0c5aca Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2780838
* pd commands: support PD console command srccapsEric Yilun Lin2021-04-084-1/+33
| | | | | | | | | | | | | | | | | | | | | | | This allows servo querying DUT's srccap easier. BUG=b:140256624 TEST=on servo_v4 (TCPMv1) and Asurada (TCPMv2) tested that 1. plug adapter `pd 0 srccaps` show the PDOs 2. unplug adapter `pd 0 srccaps` show nothing sample output: > pd 1 srccaps 0: 5000mV/3000mA 1: 9000mV/2000mA 2: 12000mV/1500mA 3: 3300mV-5900mV/3000mA 4: 3300mV-11000mV/2000mA BRANCH=servo Change-Id: Iadf9f9d91359c96b188509a28b3dc42a7e7b2223 Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2804008 Reviewed-by: Wai-Hong Tam <waihong@google.com>
* usb_common: support parse Augmented PDOEric Yilun Lin2021-04-0810-112/+134
| | | | | | | | | | | | | | | | | | Change the function signature to void pd_extract_pdo_power(uint32_t pdo, uint32_t *ma, uint32_t *max_mv, uint32_t *min_mv); Replace the original caller with an extra unused parameter, no functional changes. BUG=none TEST=`pd 0 srccaps` prints the correct PDO info BRANCH=asurada Change-Id: I9b508e1a13737fe3ed61e6086416cff0c8ffb9a9 Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2810660 Reviewed-by: Wai-Hong Tam <waihong@google.com>
* TCPMv1: clear SourceCap in disconnected stateEric Yilun Lin2021-04-084-20/+2
| | | | | | | | | | | | | Clear the SourceCaps to prevent misleading info. BUG=none TEST=`pd 0 srccaps` no output if adapter unplugged BRANCH=asurada Change-Id: Ibfefb3cc2e91c548fdf6579603dd5be20d68c08e Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2810659 Reviewed-by: Wai-Hong Tam <waihong@google.com>
* 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>