summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* core/cortex-m0/curve25519: Move code to third_party folderNicolas Boichat2020-03-258-0/+31
| | | | | | | | | | | | | | Also, add LICENSE file (some files are under CC0, some are public domain), and METADATA file. BRANCH=none BUG=chromium:884905 TEST=make buildall -j, which also include basic tests. Change-Id: Ib3a7eb9245a0634c4052064c3e36cbe2ddafbcb9 Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1599761 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* common/sha1: Drop support for CONFIG_SHA1Nicolas Boichat2020-03-253-178/+0
| | | | | | | | | | | | | | | Nobody is using CONFIG_SHA1 anymore (it seems like some early zinger used it, but that was moved to SHA256 in 2014), let's just drop support, and not have to worry about moving that to third_party. BRANCH=none BUG=chromium:884905 TEST=make buildall -j Change-Id: If198d63b7e388f395c8efad82763f0dfa7f1ecc7 Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1600947
* volteer: enable ps8815 on USB3 daughter boardCaveh Jalali2020-03-251-3/+12
| | | | | | | | | | | | | | | | | this enables the ps8815 functionality on the USB3 daughter board. note that that this relies on "early TCSS" capability being enabled in the BIOS to configure the TCSS. BUG=b:144397088 BRANCH=none TEST=USB3 flash drive shows up as 5Gbit device recovery works, also shows up as 5Gbit device. Change-Id: Ifb2c021b9df6fdf6fe0964bc9b0508469b593175 Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2113639 Reviewed-by: Keith Short <keithshort@chromium.org>
* dalboz: Remove CONFIG_BRINGUPLu Zhang2020-03-241-1/+0
| | | | | | | | | | | | | | BUG=b:149968930 BRANCH=none TEST=dalboz AP boots to OS on EC reboot Signed-off-by: Lu Zhang <lu.zhang@bitland.corp-partner.google.com> Change-Id: I2671152041cca8976054cf86f068f67ef1b70407 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2115900 Reviewed-by: Paul Ma <magf@bitland.corp-partner.google.com> Reviewed-by: Edward Hill <ecgh@chromium.org> Tested-by: Paul Ma <magf@bitland.corp-partner.google.com> Commit-Queue: Edward Hill <ecgh@chromium.org>
* Waddledee: Fill in batteriesDiana Z2020-03-242-3/+300
| | | | | | | | | | | | | This copies the batteries from the bobba (sparky) board. BUG=b:146557556 BRANCH=None TEST=make -j buildall Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I7deb5ca6409c990c807db477ba3932026e4e6c29 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2110533 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* Waddledee: Complete basic EC tasksDiana Z2020-03-248-52/+449
| | | | | | | | | | | | | | | This commit adds tasks to cover PD functionality, charging, and LED behavior. The charger and TCPC functionality are a part of the ITE variant code for now, but may be moved out as OEM boards are determined. BUG=b:146557556 BRANCH=None TEST=make -j buldall Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I50df3caabfae5e3981d7a8b76c0a76332f7d00a1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2110532 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* compare_builds.sh: Changed to parallel operationCraig Hesling2020-03-241-69/+105
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This completely changes the way compare_build.sh operates. * The test checkouts are done in /tmp directories. This detaches the test environment from your local EC workspace and allows builds for all references to occur at the same time. * Builds for all board and all references happen in parallel, unless disabled from command-line args. * New arguments: -k Allows the tmp dir to be preserved after compare -j 8 Number of jobs that will run concurrently (make -j) -o Forces only one EC ref to be built at a time. Although -j is always enforced, this option limits memory usage. BRANCH=none BUG=none TEST=time ./util/compare_build.sh TEST=time ./util/compare_build.sh -k -o -j 1 TEST=time ./util/compare_build.sh -k -o -j 4 TEST=time ./util/compare_build.sh -k -o TEST=# Introduce syntax error to board/nocturne_fp/board.c # Commit it time ./util/compare_build.sh # Ensure that the script detected the build error Signed-off-by: Craig Hesling <hesling@chromium.org> Change-Id: I3453f58a0ce08988e86572e6979f1a75a553f9b3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2094695
* bloonchipper: Reorganize board.h into sectionsCraig Hesling2020-03-241-70/+117
| | | | | | | | | | | | | | This brings no functional change, as verified with compare_build.sh @ https://crrev.com/c/2093897/11. BRANCH=none BUG=none TEST=./util/compare_builds.sh -b hatch_fp Signed-off-by: Craig Hesling <hesling@chromium.org> Change-Id: I98cb9a8f3419b376051d23c64db11b2059d71aa3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2109246 Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* bloonchipper: More clearly disable UART DMACraig Hesling2020-03-241-5/+5
| | | | | | | | | | | | | | | | | | Through some mental gymnastics, you can see that we don't use DMA for UART. Let's make the board.h more clearly show that we are disabling UART DMA. This brings no functional change, as verified with compare_build.sh @ https://crrev.com/c/2093897/11. BRANCH=none BUG=none TEST=./util/compare_builds.sh -b hatch_fp Signed-off-by: Craig Hesling <hesling@chromium.org> Change-Id: Ia95cf7a7a8f2721041cce1283d2498d049412113 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2109245 Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* nucleo-f412zg: Initial board offeringCraig Hesling2020-03-2415-0/+526
| | | | | | | | | | | | | | | | | | | | | | | | | | | This brings initial support for the Nucleo-F412ZG development board. This configuration is similar to bloonchipper, but without fingerprint sensor support, without rollback secret support, and with an adjusted console USART selection. The included README.md shows some quick steps to get a Nucleo-F412ZG up and running EC. Note that the RSA key included is only for test builds. It should not be used for any production builds. BRANCH=none BUG=none TEST=make BOARD=nucleo-f412zg make BOARD=nucleo-f412zg flash minicom -D/dev/ttyACM0 Change-Id: Ic1150152adbef9ed3f81aafb007be747b2c436af Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1970642 Reviewed-by: Jett Rink <jettrink@chromium.org> Commit-Queue: Craig Hesling <hesling@chromium.org> Tested-by: Craig Hesling <hesling@chromium.org>
* stm32f412: Fix chip config Flash and RAM sizesCraig Hesling2020-03-243-9/+13
| | | | | | | | | | | | | | | | | | We are already using the stm32f446 config for many F4 based chips. Let's actually make this more clear and un-hack our hatch_fp board.h. This present no functional change. BRANCH=none BUG=none TEST=./util/compare_builds.sh -b "hatch_fp sweetberry" Signed-off-by: Craig Hesling <hesling@chromium.org> Change-Id: I6b46e696686ad740833dc889c1db5d7bac84a768 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2109244 Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* nightfury: remove lid als/rgb sensor and camera syncJongpil Jung2020-03-243-119/+2
| | | | | | | | | | | | | | | | | | | | | To fix build error, we need to remove unused devices code for nightfury. Moreover, nightfury doesn't have components. So, remove items RGB Sensor and WF camera SYNC BUG=b:149226871 BRANCH=firmware-hatch-12672.B TEST=emerge-hatch chromeos-ec Change-Id: Ie0b77f3825c0433ac1c70aed90c33f394c2f59ed Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2114953 Tested-by: Jongpil Jung <jongpil19.jung@samsung.corp-partner.google.com> Auto-Submit: Jongpil Jung <jongpil19.jung@samsung.corp-partner.google.com> Reviewed-by: Bob Moragues <moragues@chromium.org> Reviewed-by: Philip Chen <philipchen@chromium.org> Reviewed-by: Scott Collyer <scollyer@chromium.org> Commit-Queue: Philip Chen <philipchen@chromium.org> Commit-Queue: Scott Collyer <scollyer@chromium.org>
* TCPMv2: Not enable PD comm on TX Phy reset if not in a connected stateWai-Hong Tam2020-03-243-8/+22
| | | | | | | | | | | | | | | | | | | | | | | If PD is not in a connected state, the previous approach was to enable PD comm on TX Phy reset and then disable it later (the SM_RUN case in prl_run()). In this short period of time, the TCPC wil respond GoodCRC to the PD message and the PD partner will go forward to the next state that messes up its state machine and causes an unexpected hard reset. We should not enable PD comm if not in a connected state. BRANCH=None BUG=b:151159750 TEST=Tested on Trogdor, with extra patches to fix the DP discovery and separate the Tx and Rx buffers. Unplugged battery and plugged a 20V charger and verified it boot fine, no reboot loop. TEST=Built chocodile_vpdmcu image successfully. TEST=make runtests -j Change-Id: Ic819787f1ec0085abdded3bab8ecbcb813495408 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2107882 Reviewed-by: Sam Hurst <shurst@google.com>
* it83xx/flash: exclude immu tag workaround if chip's core is riscvDino Li2020-03-241-1/+1
| | | | | | | | | | | | | | | | | This issue is present on chip with N8 core only. So we don't need to apply the workaround for chip with RISCV core to save time of writing and erasing. BUG=none BRANCH=none TEST=use console "flasherase" and "flashwrite" commands to erase/write these two 4KB blocks(0x7e000 ~ 0x7ffff) on both IT8320 and IT81202, no error message occurred. Signed-off-by: Dino Li <Dino.Li@ite.com.tw> Change-Id: I9aeb7e32048dafb2fa54bf1a137ecafb5a854b91 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2109438 Reviewed-by: Jett Rink <jettrink@chromium.org>
* it8xxx2: wake up CPU if an interrupt is pending in idle taskDino Li2020-03-244-5/+17
| | | | | | | | | | | BUG=b:142029177 BRANCH=none TEST=In idle task, EC does not get stuck. Signed-off-by: Dino Li <Dino.Li@ite.com.tw> Change-Id: I9f3c0e3b58e68d60b1218338603a5f2a4bc5eb5d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2100055 Reviewed-by: Jett Rink <jettrink@chromium.org>
* kappa: fix battery manufacturer name dataDevin Lu2020-03-241-1/+1
| | | | | | | | | | | BUG=b:146504215 BRANCH=kukui TEST=make BOARD=kappa Change-Id: Id56be3e3e98fc88f5ebac7ea8604a1d65dc1d0df Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2115907 Reviewed-by: Ting Shen <phoenixshen@chromium.org>
* curve25519: Move to third_partyNicolas Boichat2020-03-249-1153/+1159
| | | | | | | | | | | | | | | | curve25519 comes from boringssl as well, move it to that directory. See git log for which boringssl commit the implementation comes from, and changes that were applied. BRANCH=none BUG=chromium:884905 TEST=make buildall -j, which also include basic tests. Change-Id: I1dee4795009c1e2034a181f6083d1f9445c87d41 Signed-off-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1600946 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* dedede: Check PG_VCCIO_EXT for ALL_SYS_PGOODAseda Aboagye2020-03-241-2/+4
| | | | | | | | | | | | | | | | | | According to the latest Intel documentation, ALL_SYS_PGOOD should also take into account PG_VCCIO_EXT. This commit does simply that. BUG=b:151783164 BRANCH=None TEST=Build and flash waddledoo, verify it still boots up. Signed-off-by: Aseda Aboagye <aaboagye@google.com> Change-Id: I1035f5d128d8fdece4b0c5b4642c3f7403db2170 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2116667 Tested-by: Aseda Aboagye <aaboagye@chromium.org> Tested-by: George Engelbrecht <engeg@google.com> Auto-Submit: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org> Commit-Queue: George Engelbrecht <engeg@google.com>
* cbi: Support PCB supplier fieldAbe Levkoy2020-03-245-0/+24
| | | | | | | | | | | | | | | | | | | Add support for PCB_SUPPLIER, to distinguish boards of the same type with different PCB suppliers. BUG=b:140244489 TEST=ectool cbi set 7 0 1 0; ectool cbi get 7 TEST=cbi on EC console after writing with ectool TEST=/usr/share/userfeedback/scripts/cbi_info after writing with ectool TEST=cbi-util create --pcb_supplier 1 ...; cbi-util show ... BRANCH=none Change-Id: Ieadba91694f4775cc86c2c4b09cdf0874b9ad444 Signed-off-by: Abe Levkoy <alevkoy@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2108710 Reviewed-by: Jett Rink <jettrink@chromium.org> Tested-by: George Engelbrecht <engeg@google.com> Commit-Queue: George Engelbrecht <engeg@google.com>
* gitignore: Add "local" exempt directoryCraig Hesling2020-03-241-0/+2
| | | | | | | | | | | | | | | | | | This allows for hiding local scripts and other artifacts from git. BRANCH=none BUG=none TEST=git checkout -f cros/master touch local/myscript git status # Nothing recommended Change-Id: I5b2c80b3bf662e1134118e5f269fcecfd73b0cdc Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2116799 Tested-by: Craig Hesling <hesling@chromium.org> Tested-by: George Engelbrecht <engeg@google.com> Reviewed-by: Jett Rink <jettrink@chromium.org> Commit-Queue: George Engelbrecht <engeg@google.com>
* EFS2: Reset after shutdown if EC is still in ROdnojiri2020-03-241-0/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the system boots in recovery mode, EC stays in RO. When a power button is pressed in recovery screen, currently the system shuts down and EC continues to stay in RO. For a battery-less system, when a power button is pressed again, the system can't boot because there is no PD power (unless the system is powered otherwise). So, EC needs to be in RW so that it can boot the AP on the next power button press. This patch makes EC reset itself when the AP shuts down and EC is still in RO. For a chromebook, when a power button is pressed for power-on, the system may be able to boot using the battery power. However, with this patch, EC will be able to negotiate PD power while waiting for another power button press. The timelines below show the difference between the system without and with this patch: PB (for shutdown) PB (for boot) v v 1) -------------- ... -----+++++++++ 2) -|-+++++++++++ ... ++++++++++++++ where: PB = power button press -: EC in RO +: EC in RW |: Reset Tests are executed on a reworked Helios. Signed-off-by: dnojiri <dnojiri@chromium.org> BUG=chromium:1045209 BRANCH=none TEST=Boot to recovery screen. Press power button to shutdown. Verify (after reset) EC jumps to RW and stays in S5. TEST=Boot to developer screen. Press power button to shutdown. Verify EC stays in RW. TEST=Run reboot from OS. Verify system reboots back to S0. TEST=Run shutdown -H now. Verify system shuts down and stays in S5. TEST=Hold L_Shift+ESC+F3+Power to trigger HW_REINIT. TEST=ectool batterycutoff at-shutdown TEST=test_that firmware_SoftwareSync firmware_DevMode Change-Id: I6a04a9741351fa06cbadf6725ff71452574db68c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2095754 Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: George Engelbrecht <engeg@google.com> Reviewed-by: Peter Marheine <pmarheine@chromium.org> Auto-Submit: Daisuke Nojiri <dnojiri@chromium.org> Commit-Queue: George Engelbrecht <engeg@google.com>
* Mushu : add dual fan control by ECloganliao2020-03-233-1/+65
| | | | | | | | | | | | | | | | | | Currently cannot monitor more than one fan at the same time. This patch distinguish between temperature which read from GPU and read from Charger. Allow EC control two fans individually. BUG=b:148968367 BRANCH=none TEST=make BOARD=mushu Change-Id: I7841fb1cd9f214effa1372e24a9b943b4608a2bb Signed-off-by: loganliao <Logan_Liao@compal.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2082305 Reviewed-by: Bob Moragues <moragues@chromium.org> Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Reviewed-by: Logan Liao <logan_liao@compal.corp-partner.google.com> Tested-by: Bob Moragues <moragues@chromium.org>
* SM5803: OTG, charger detect, and interrupt functionalityDiana Z2020-03-232-6/+178
| | | | | | | | | | | | | | | This commit adds the OTG functions for sourcing Vbus, adds functions for charger detect, and corrects the interrupt handler to call into a deferred function to handle i2c querries. BUG=b:146651778,b:148289370 BRANCH=None TEST=builds Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I66851b9fb339bce2026b184e93edca143cad340b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2110531 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* servo_updater: Do not raise ServoUpdaterException on module importstabilize-12997.B-masterYu-Ping Wu2020-03-211-25/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | External tools such as platform/dev/contrib/dut-console may import servo_updater as a module. On import time, this module will check the existence of FIRMWARE_PATH and potentially raise ServoUpdaterException, which is unnecessary if the function the importing program calls does not have reference to the global variable FIRMWARE_PATH (for example, find_available_version()). In addition, there is only one function, findfiles(), that is currently using FIRMWARE_PATH and other similar global variables. Therefore, move the check for path existence inside findfiles(), so that ServoUpdaterException will not be raised on module import time. Also add servo board name constants to servo_updater to reduce duplicate string literals. BRANCH=none BUG=chromium:1061354 TEST=Run 'sudo servod -b kukui -m jacuzzi' and make sure findfiles() is called without exceptions Cq-Depend: chromium:2102179 Change-Id: I0179c44ba2a3947cb26035d97cd1ebeb453ef67a Signed-off-by: Yu-Ping Wu <yupingso@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2102247 Reviewed-by: Wai-Hong Tam <waihong@google.com>
* waitms: Reload watchdog before spin waitingCraig Hesling2020-03-211-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | This CL moved the reload watchdog operation to before the spin wait operation. This still achieves the goal of allowing back-to-back waitms calls and adds the ability to time watchdog behavior. Without this modification, you can't accurately test the watchdog timeout period. BRANCH=none BUG=b:151475816, b:151528646 TEST=make proj-nucleo-h743zi # Flash > clock hsi > waitms 10000 # Should see watchdog helper message at ~9 seconds Signed-off-by: Craig Hesling <hesling@chromium.org> Change-Id: Id471a2667c913889c1aeba8bc14bb0f33458ed59 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2104494 Reviewed-by: Tom Hughes <tomhughes@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* chip/it8xxx2: add support IT81302 and IT81202Dino Li2020-03-214-6/+74
| | | | | | | | | | | | | | | | | | | | | | | IT81302 (144-pins package) and IT81202 (128-pins package) chips belong to it8xxx2 family. So we apply the same chip options of it83202bx (except ADC pin order config option) and setup the correct flash size, ram size, and ram base. With this change, we are able to build FW image with IT81202 or IT81302 chip variant. BUG=none BRANCH=none TEST=EC boots and test console commands (version, sysinfo, sysjump, flasherase, flashwrite, and flashread) on IT81202 EVB. Hibernate EC and then press servo board's COLD_RST_L to reset EC. EC reboots. Change-Id: If351d561c61f635ebdb1e4e444e73e061a494c9a Signed-off-by: Dino Li <Dino.Li@ite.com.tw> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2072562 Reviewed-by: Jett Rink <jettrink@chromium.org>
* TCPMv2: Split PD message buffers into separate TX/RX buffersSam Hurst2020-03-217-175/+185
| | | | | | | | | | | | | | | | | | | | | Use separate buffers for transmit and reception of PD messages. This prevents the potential corruption of PD messages waiting to be transmitted when an unexpected PD message is received BUG=b:150637227 BUG=b:149662829 BRANCH=none TEST=make -j buildall Manual tests: Tested hatch device and powered dock. Used total phase to verify that transmitted messages were not corrupted by unexpected message reception. Change-Id: I12df471f59fb7510e642bb92b769ccbddd79c84f Signed-off-by: Sam Hurst <shurst@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2103253 Reviewed-by: Diana Z <dzigterman@chromium.org>
* Charger: Add driver function for sourcing OTGDiana Z2020-03-214-7/+23
| | | | | | | | | | | | | Fold charger_is_sourcing_otg_power into the charger driver structure. BUG=None BRANCH=None TEST=make -j buildall Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I0526495fff8464539e216d2cf80c34e09af2c418 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2110530 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* TCPMv2: Process protocol errors within vcs_send_ps_rdy_swapDiana Z2020-03-201-1/+20
| | | | | | | | | | | | | | | | | | Since transmit errors may mean different things in this state based on whether the message sent was PS_RDY or a cable SOFT_RESET, handle errors within the state itself. Absence of a PS_RDY GoodCRC should cause a SOFT_RESET, while absence of a cable SOFT_RESET GoodCRC may simply indicate the cable isn't present. BUG=b:151445255 BRANCH=None TEST=on Trogdor, HooToo hub can complete discovery and enter DP mode Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I5bf45d28d4332c4c5d30eddabab82fef5bab2a3d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2111190 Tested-by: Wai-Hong Tam <waihong@google.com> Reviewed-by: Jett Rink <jettrink@chromium.org>
* TCPMv2: Process incoming messages before discoveryDiana Z2020-03-201-152/+154
| | | | | | | | | | | | | | | | Currently, the SNK_Ready and SRC_Ready states process discovery and DPMs first. This change puts priority on incoming messages, except for hard reset requests. BUG=b:151445255,b:150637227 BRANCH=None TEST=on kindred, saw PR_Swap processed when it came in during the discovery process Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I6260def4de063fee2e48ec7ca8a453d37f686924 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2103039 Reviewed-by: Jett Rink <jettrink@chromium.org>
* halvor: Initial EC imageFrank Wu2020-03-207-0/+645
| | | | | | | | | | | | | | | | | | | | | Create the initial EC image for the halvor variant of the volteer baseboard by copying the baseboard EC files into a new directory named for the variant. (Auto-Generated by create_initial_ec_image.sh version 1.0.1). BUG=b:151399850 BRANCH=none TEST=make BOARD=halvor Signed-off-by: Frank Wu <frank_wu@compal.corp-partner.google.com> Change-Id: I550203d26368c96b1223e232b7430f0f7b2a5b79 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2109437 Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Ruby Lee <ruby_lee@compal.corp-partner.google.com> Tested-by: Ruby Lee <ruby_lee@compal.corp-partner.google.com> Commit-Queue: Keith Short <keithshort@chromium.org>
* nct38xx: Remove ioexpander_nct38xx.hEdward Hill2020-03-206-37/+21
| | | | | | | | | | | BUG=b:150349225 BRANCH=none TEST=none Signed-off-by: Edward Hill <ecgh@chromium.org> Change-Id: I830196908012778254e7306ea6a53bb3e4e4258d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2110547 Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* dalboz: Set IOEX interrupt handler for DB optionEdward Hill2020-03-202-2/+25
| | | | | | | | | | | BUG=b:150349225 BRANCH=none TEST=IO expander works on both OPT1 and OPT2 DB Signed-off-by: Edward Hill <ecgh@chromium.org> Change-Id: If4152427d7c3ec8ea3f719cb0f13f1d3d689fc6b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2108338 Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* dalboz: Set usb_port_enable[] for DB optionEdward Hill2020-03-204-3/+12
| | | | | | | | | | | BUG=b:150349225 BRANCH=none TEST=none Signed-off-by: Edward Hill <ecgh@chromium.org> Change-Id: I9e914a767a6b0fd1d77b3c32a2414711531404f9 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2108337 Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* dalboz: select GPIOs based on DB optionEdward Hill2020-03-206-27/+80
| | | | | | | | | | | | | BUG=b:150349225 BRANCH=none TEST=none Signed-off-by: Edward Hill <ecgh@chromium.org> Change-Id: I7079d989013e022fb0bc7ffa925f51e6490d864c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2101223 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Paul Ma <magf@bitland.corp-partner.google.com> Tested-by: Paul Ma <magf@bitland.corp-partner.google.com>
* zork: split baseboard_tcpc_init to trembyle and dalbozEdward Hill2020-03-203-22/+40
| | | | | | | | | | | | | BUG=b:150349225 BRANCH=none TEST=none Signed-off-by: Edward Hill <ecgh@chromium.org> Change-Id: I5cae9cd365d198873c4d022dd1b166b318c1a4c7 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2108336 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Paul Ma <magf@bitland.corp-partner.google.com> Tested-by: Paul Ma <magf@bitland.corp-partner.google.com>
* zork: split ioex_config[] to trembyle and dalbozEdward Hill2020-03-205-38/+74
| | | | | | | | | | | | | BUG=b:150349225 BRANCH=none TEST=none Signed-off-by: Edward Hill <ecgh@chromium.org> Change-Id: Ifc615bf8c4c5c8a684954ef932c5e9f5e60122de Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2108335 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Paul Ma <magf@bitland.corp-partner.google.com> Tested-by: Paul Ma <magf@bitland.corp-partner.google.com>
* ioexpander: add IOEX_FLAGS_DISABLEDEdward Hill2020-03-202-57/+70
| | | | | | | | | | | | | BUG=b:150349225 BRANCH=none TEST=none Signed-off-by: Edward Hill <ecgh@chromium.org> Change-Id: Id264d633576ca79b288a435f95de7fda9ca201ad Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2108334 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Paul Ma <magf@bitland.corp-partner.google.com> Tested-by: Paul Ma <magf@bitland.corp-partner.google.com>
* usb_port_power: Add CONFIG_USB_PORT_ENABLE_DYNAMICEdward Hill2020-03-202-3/+16
| | | | | | | | | | | | | BUG=b:150349225 BRANCH=none TEST=none Signed-off-by: Edward Hill <ecgh@chromium.org> Change-Id: I06c2ceee818499eabf3a240d27151dbd1ff88653 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2108333 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Paul Ma <magf@bitland.corp-partner.google.com> Tested-by: Paul Ma <magf@bitland.corp-partner.google.com>
* code_reviews: Add an example of CLs linked by topicAbe Levkoy2020-03-201-1/+3
| | | | | | | | | | | | BUG=none TEST=View rendered Markdown BRANCH=none Change-Id: Icabde60da7758d89ab11abe11d5870f25fda4209 Signed-off-by: Abe Levkoy <alevkoy@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2108862 Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* Dood: Modify battery LED behaviorYu-An Chen2020-03-201-1/+1
| | | | | | | | | | | | | | | | Modify battery LED behavior to 1 sec ON 1 sec OFF when battery error. BUG=b:150180166 BRANCH=octopus TEST=Manual check battery LED behavior under battery error. Signed-off-by: Yu-An Chen <yu-an.chen@quanta.corp-partner.google.com> Change-Id: I99f7e936feb712e360d5c3e20793f0c2e90d7bf1 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2111911 Reviewed-by: Henry Sun <henrysun@google.com> Commit-Queue: Henry Sun <henrysun@google.com> Tested-by: Henry Sun <henrysun@google.com>
* max14637: Modify driver to have chip_enable active by defaultScott Collyer2020-03-201-21/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The max14637 provides client mode bc1.2 detection, and the driver enables bc1.2 detection or turns off the IC bases on VBUS changes. However, the driver does not current differentiate between VBUS resulting for the port acting as a sink or source. The result is that bc1.2 detection is also tirggered when the port is acting as a source. This can cause interop issues with other devices which aren't expecting bc1.2 detection singaling in this case. This CL modifies the driver so that the max14637 enable is on by default. This results in the bc1.2 driver being mostly a NOP when the port power role is a source. If the port power role is a sink, then the enable line is pulsed low so that bc1.2 client detection is triggered as expected. BUG=b:147833952 BRANCH=firmware-hatch-12672.B TEST=Verfied that the device which previously was not enumerating, does enumerate. Test both legacy chargers to ensure that client bc1.2 works as expected. Signed-off-by: Scott Collyer <scollyer@google.com> Change-Id: I8bfd243e312c7238a6668edcdfcde2ac0ae5d580 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2086731 Reviewed-by: Shelley Chen <shchen@chromium.org> Commit-Queue: Shelley Chen <shchen@chromium.org> Tested-by: Shelley Chen <shchen@chromium.org>
* tcpci: remove cached pullDenis Brockus2020-03-205-42/+1
| | | | | | | | | | | | | | | | The cached pull is no longer needed, so removing the code. BUG=none BRANCH=none TEST=make buildall -j Signed-off-by: Denis Brockus <dbrockus@google.com> Change-Id: Ib408b085452d6956ebbff04c038f6385a5202227 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2107995 Tested-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org> Auto-Submit: Denis Brockus <dbrockus@chromium.org>
* tcpmv2: cleanup auto discharge disconnectDenis Brockus2020-03-206-123/+235
| | | | | | | | | | | | | | | | | | | | | | | | | | | This CL is based on the inability to boot trembyle when a battery is not connected. The failure looks like it is always right after AutoDischargeDisconnect has been set. I asked Nuvoton if we could go back to using ForcedDischarge and veer away from AutoDischargeDisconnect and I was told no that it is now required. My first step was to determine how close the existing AutoDischargeDisconnect was to the spec and found enough difference that I wanted to get that in line before trying to pinpoint the issues causing this problem. BUG=none BRANCH=none TEST=get tcpmv2 to work without a battery attached Signed-off-by: Denis Brockus <dbrockus@google.com> Change-Id: I44b86ae5dfcf6b547c742c1af0228a0ed8e3520d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2105935 Tested-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Edward Hill <ecgh@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org> Auto-Submit: Denis Brockus <dbrockus@chromium.org>
* zork: Use only AutoDischargeDisconnect to DischargeDenis Brockus2020-03-201-1/+0
| | | | | | | | | | | | | | BUG=none BRANCH=none TEST=make buildall Signed-off-by: Denis Brockus <dbrockus@google.com> Change-Id: Ic9af1a8b3bde25b9525b20bfba84685d7d7bf21e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2110545 Tested-by: Denis Brockus <dbrockus@chromium.org> Auto-Submit: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org>
* zork: allow AutoDischargeDisconnect to be sole DischargeDenis Brockus2020-03-201-2/+3
| | | | | | | | | | | | | | | | | Guard calls to discharge if all discharge is being performed by AutoDischargeDisconnect BUG=none BRANCH=none TEST=make buildall Signed-off-by: Denis Brockus <dbrockus@google.com> Change-Id: Ie584e5579ef816f13ce40604da80fafc76dc4777 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2110544 Tested-by: Denis Brockus <dbrockus@chromium.org> Auto-Submit: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org>
* zork: cleanup TCPMvX selection in case of roll back needsDenis Brockus2020-03-201-7/+10
| | | | | | | | | | | | | | | | | | Removed defines that are now on by default as well. Also turned FRSwap off because it is not currently working. BUG=none BRANCH=none TEST=make buildall Signed-off-by: Denis Brockus <dbrockus@google.com> Change-Id: I4f4cb79ef69ce842be398fca1846da721c68c51b Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2110543 Tested-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org> Auto-Submit: Denis Brockus <dbrockus@chromium.org>
* usb_port_power: move usb_port_enable[] to headerEdward Hill2020-03-204-14/+10
| | | | | | | | | | | | | | BUG=b:150349225 BRANCH=none TEST=none Signed-off-by: Edward Hill <ecgh@chromium.org> Change-Id: I0342239dacf3bfb5f50e5fe873805921fa4723a6 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2108332 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Paul Ma <magf@bitland.corp-partner.google.com> Tested-by: Paul Ma <magf@bitland.corp-partner.google.com> Commit-Queue: Denis Brockus <dbrockus@chromium.org>
* driver: fix ina219 shunt voltage calculationVirendra Kakade2020-03-201-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Currently shunt voltage register value is multiplied by 2 instead of 10 resulting in a shunt voltage value which is 5 times less. Fix this by using the correct multiplier (10) value. example: Refer http://www.ti.com/lit/ds/symlink/ina219.pdf table 7 for shunt voltage register format. Notice that 40.00 mV (40,000uV) <=> 4000 reg value giving us the *10 multiplication factor. BRANCH=none BUG=none TEST=make -j4 buildall TEST=verified that the shunt voltage reported by "ina" console command looks correct on my hardware. Signed-off-by: Virendra Kakade <virendra.kakade@ni.com> Change-Id: I76a21ae3b56336236826785ae6addc1982cc4885 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2094742 Reviewed-by: Nicolas Boichat <drinkcat@chromium.org> Tested-by: Nicolas Boichat <drinkcat@chromium.org> Commit-Queue: Nicolas Boichat <drinkcat@chromium.org>
* stm32: Refactor clock-stm32h7.cCraig Hesling2020-03-201-70/+244
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This cleans up and modularizes the clock configuration code for the STM32H743. This makes it easier and cleaner to add the STM32H7A3 variant. This brings no functional change, as coarsely verified with crrev.com/c/2096017 . BRANCH=icetower BUG=b:130296790 TEST=Verified all impacted registers values with and without this change using crrev.com/c/2096017 on the Nucleo-H743ZI. The sequence of commands used to test was the following: # After fresh startup (from reset) * > clock * > clock hsi * > clock pll * > clock hsi * > clock hsi * > clock * > waitms 5000 * # Run timer to check accuracy of 5 seconds * > clock pll * > waitms 5000 * # Still broken -> Watchdog should still kick-in early and render MCU unusable. Signed-off-by: Craig Hesling <hesling@chromium.org> Change-Id: I4fbf6982190c0d660e31c2027b5ad07cae48755e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2095853 Reviewed-by: Tom Hughes <tomhughes@chromium.org>