summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* jacuzzi: add extpower gpioTing Shen2019-09-093-13/+6
| | | | | | | | | | | | | | | | jacuzzi has an AC_PRESENT pin, remove the custom callback and use EXTPOWER_GPIO to handle it. BUG=b:135895590 TEST=AC on/off in ec console reported correctly BRANCH=master Change-Id: I48110191a4d36eaa1ec3851d15562643e0e465be Signed-off-by: Ting Shen <phoenixshen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1718287 Reviewed-by: Yilun Lin <yllin@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Tested-by: Ting Shen <phoenixshen@chromium.org>
* util/ectool: check malloc for NULLPatrick Georgi2019-09-071-0/+2
| | | | | | | | | | | | | | | | Found by Coverity Scan #141760. BUG=none BRANCH=none TEST=none Change-Id: Icba3268919e8dde937e00172c288b10e2e3f6e87 Signed-off-by: Patrick Georgi <pgeorgi@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1789147 Tested-by: Patrick Georgi <pgeorgi@chromium.org> Auto-Submit: Patrick Georgi <pgeorgi@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Commit-Queue: Patrick Georgi <pgeorgi@chromium.org>
* util/ecst: check fseek/ftell return valuesPatrick Georgi2019-09-071-26/+35
| | | | | | | | | | | | | | | | | | | | Found by Coverity Scan #5814[14-9], #58159, #58160 Also fix a bunch of typos in comments and variable names and remove extraneous fseek(..., 0, SEEK_SET) before moving to the actual offset (again with SEEK_SET). BUG=none BRANCH=none TEST=none Change-Id: I9d7cb950a7a659c5abb1ff7d6d2c48d623ee515c Signed-off-by: Patrick Georgi <pgeorgi@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1789145 Tested-by: Patrick Georgi <pgeorgi@chromium.org> Auto-Submit: Patrick Georgi <pgeorgi@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Commit-Queue: Patrick Georgi <pgeorgi@chromium.org>
* util/ectool.c: Fix resource leakPatrick Georgi2019-09-071-0/+1
| | | | | | | | | | | | | | | | Found by Coverity Scan #141759. BUG=none BRANCH=none TEST=none Change-Id: I7b17330aa25a6d23c1a547829d6908931baa7891 Signed-off-by: Patrick Georgi <pgeorgi@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1789146 Tested-by: Patrick Georgi <pgeorgi@chromium.org> Auto-Submit: Patrick Georgi <pgeorgi@chromium.org> Commit-Queue: Patrick Georgi <pgeorgi@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* util/ecst.c: ensure string terminationPatrick Georgi2019-09-071-5/+9
| | | | | | | | | | | | | | | | Found by Coverity Scan #58136, #58137 BUG=none BRANCH=none TEST=none Change-Id: Ie17330c4766f6537134117ecd81ecd78cd408132 Signed-off-by: Patrick Georgi <pgeorgi@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1789144 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: Patrick Georgi <pgeorgi@chromium.org> Auto-Submit: Patrick Georgi <pgeorgi@chromium.org> Commit-Queue: Patrick Georgi <pgeorgi@chromium.org>
* driver/touchpad_st: Add enable flag to config.hHarry Cutts2019-09-071-1/+4
| | | | | | | | | | | | | | This flag is used to enable the driver in driver/build.mk, but wasn't documented in config.h yet. BUG=none TEST=`make buildall -j` BRANCH=none Change-Id: Id14bced207192cfa884feb47369066ba7afd7118 Signed-off-by: Harry Cutts <hcutts@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1788677 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* tablet_mode: Update DPTF profile number in hall_sensor_isrPhilip Chen2019-09-071-0/+15
| | | | | | | | | | | | | | | | | | For the boards with GMR sensors, if we want to support mode-aware DPTF profiles, we can update DPTF profile number when the common TABLET_MODE ISR (a.k.a. hall_sensor_isr) is called, so we don't need a board-specific ISR to handle this operation. BUG=b:139168228 BRANCH=none TEST=buildall Change-Id: Icdb526c0e5e5ba9626f19a0de9332c0d06e8b0a7 Signed-off-by: Philip Chen <philipchen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1747061 Reviewed-by: Furquan Shaikh <furquan@chromium.org> Commit-Queue: Philip Chen <philipchen@chromium.org> Tested-by: Philip Chen <philipchen@chromium.org>
* ec: create initial EC image for a new variantPaul Fagerburg2019-09-061-0/+64
| | | | | | | | | | | | | | | | | | | | | | Creating an initial EC image for a variant is just a copy of the base board's files. After all of the CLs to create the variant have landed, then we can make changes specific to the variant. BUG=b:140261109, chromium:999705 BRANCH=none TEST=``./initial_ec_image.sh hatch sushi && git show`` Compare board/hatch/* to board/sushi/* Also run the script with an existing board name to verify that you can't create a variant that already exists. Also run the script with a non-existent base board to verify that you can't clone something that doesn't exist. Change-Id: Ic54b0b5a8b41476779dcbb6af63bd0ddfaff2896 Signed-off-by: Paul Fagerburg <pfagerburg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1782686 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* Dorp: add simplo HIGHPOWER 996QA168H batteryDevin Lu2019-09-062-0/+30
| | | | | | | | | | | BUG=b:138089473 BRANCH=octopus TEST=Test on charging/discharging/battery cut off pass. Change-Id: Ib26447af6944c2d21b6603e391f2e2f76c12bb52 Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1782397 Reviewed-by: Marco Chen <marcochen@chromium.org>
* helios: Use a custom lid interrupt handlerFurquan Shaikh2019-09-052-1/+23
| | | | | | | | | | | | | | | | | This change ignores lid open signal when tablet mode is returned as true. This is a workaround with board version #1 where lid open can be incorrectly triggered in 360-degree mode. BUG=b:139964210 BRANCH=None TEST=make -j BOARD=helios Change-Id: I707dcd2a8efd75668ee29bffa54622aa698e7d57 Signed-off-by: Furquan Shaikh <furquan@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1781803 Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Tested-by: Furquan Shaikh <furquan@chromium.org> Commit-Queue: Furquan Shaikh <furquan@chromium.org>
* usb: clean up statemachine pausingJett Rink2019-09-052-33/+29
| | | | | | | | | | | | | | | | Remove recursive call for resuming after a pause. Reset the state machine by zero'ing out the statemachine context instead of existing the more recent state (which can have other unintended consequences) BRANCH=none BUG=none TEST=builds, pass units tests Change-Id: I107ad6cf158b84fe201cc80a51ee11f8784e9b24 Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1783531 Commit-Queue: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Denis Brockus <dbrockus@chromium.org>
* power: Add power sequencing logic for Tigerlake chipsetVijay Hiremath2019-09-056-11/+26
| | | | | | | | | | | | | | Power sequencing logic for Tigerlake is same as Icelake hence reusing the Icelake code. BUG=b:140508849 BRANCH=none TEST=tglrvp can boot to S0 Change-Id: Id218422146e5549aa5b246ddbcaedd8e442e376b Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1785685 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* intelrvp: Enable USB-C SRC current limitingVijay Hiremath2019-09-054-13/+63
| | | | | | | | | | | | | | | | | | | Enable SRC current limit pin of the type C current-limited power switch to provide more current when sourcing on only 1 port. BUG=b:140404596 BRANCH=none TEST=Manually tested on tglrvp a. 1 port is connected: ILIM pin of respective port's current limited power switch is high and able to source 3A. b. 2 ports are connected: ILIM pin of both port's current limited power switch is low and able to source 1.5A on each port. Change-Id: Ic6ce897e25a25b526c3c52bce8cbdc843ad419f9 Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1783517 Reviewed-by: Keith Short <keithshort@chromium.org>
* g: allow I2CS operate without hardware resetsVadim Bendebury2019-09-054-15/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is not always possible to rely on PMU for resetting the I2CS controller. Most of the AP firmware versions deploy the 'I2C unwedge' cycle when coming out of reset, but not all of them, this is why Cr50 needs to be able to recover on its own in case there was a crash and the I2C bus was left mid transaction with the H1 holding down the SDA line. A GPIO is dedicated to monitor the I2CS_SDA line during reset. If the line is kept low, it could be a sign of a 'wedged' controller. The g I2CS FSM will reset any time the I2C 'stop' condition is detected. The create the 'stop' condition the I2C_SCL input is disconnected from the bus and connected to an internal GPIO, then I2C_SCL level is set to 'high' and register inverting the I2C_SDA value is toggled, which looks like a transition from zero to one to the controller. thus creating the 'stop' condition. BRANCH=cr50, cr50-mp BUG=b:135772657 TEST=the test was ran on a Pyro device, which uses I2C for communication with H1 and which AP firmware does not deploy the 'I2C unwedge' cycle. Test instrumentation involved setting a Chrome OS startup file such that once booted, the AP starts continuously polling TPM for value of an NVMEM index, creating I2C traffic. The host workstation sends the 'apreset cold' command to the EC within a few seconds of Chrome OS coming up. First run a special Cr50 image which is not resetting I2CS using PMU on TPM restarts, is was not trying to unwedge the stuck I2C bus. On five experiments, it takes on average 32 reboots for until I2C bus is locked up and the DUT falls into recovery. Then loaded the Cr50 image with this patch and ran the test again, it survived for 150 cycles without a problem. Change-Id: Iffec33f97557e3acfd1cd5fb76ba158f8c23b608 Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1730143 Reviewed-by: Mary Ruthven <mruthven@chromium.org>
* common: usb_prl_sm add rch_pass_up_message as a stateDenis Brockus2019-09-052-11/+18
| | | | | | | | | | | BUG=none BRANCH=none TEST=make buildall -j Change-Id: Ib89f2edf6ce1a57cfeb5f59ffac1fde77cbfa803 Signed-off-by: Denis Brockus <dbrockus@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1770680 Reviewed-by: Jett Rink <jettrink@chromium.org>
* krane: add it5205 driverTing Shen2019-09-055-13/+47
| | | | | | | | | | | | | | | | | | | | | | | An it5205 is added in kukui/krane rev 5, and deprecated gpio pin USB_C0_DP_OE_L and USB_C0_DP_POLARITY. This CL is intended to make the fw works for both old and new boards: 1) the default usb_mux driver is updated to rev 5, and board_rev_init may change it back for old boards. 2) keep VARIANT_KUKUI_DP_MUX_GPIO in kukui/board.h, and add a customized function to set/clear these gpio pins. BUG=b:135079572 TEST=verify that type c display works on board rev 4/5 BRANCH=master Change-Id: Ibe28816eed026ccb8a9a5234a612f80b038884f1 Signed-off-by: Ting Shen <phoenixshen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1785197 Reviewed-by: Yilun Lin <yllin@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Tested-by: Ting Shen <phoenixshen@chromium.org>
* blooglet: add simplo HIGHPOWER 996QA168H batteryDevin Lu2019-09-052-0/+30
| | | | | | | | | | | | | BUG=b:138089473 BRANCH=octopus TEST=Test on charging/discharging/battery cut off pass. Change-Id: I4b345c5738e80f7e32ef7a4fc0bfa84444665e37 Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1786877 Tested-by: Justin TerAvest <teravest@chromium.org> Reviewed-by: Justin TerAvest <teravest@chromium.org> Commit-Queue: Justin TerAvest <teravest@chromium.org>
* rollback: Clear temporary copies of rollback secret.Yicheng Li2019-09-055-40/+99
| | | | | | | | | | | | | | | | | After working with temporary copies of rollback secret, clear them using always_memset() in third_party/cryptoc/util.c. For boards that have CONFIG_ROLLBACK_SECRET_SIZE, configure CONFIG_LIBCRYPTOC automatically. BRANCH=nocturne BUG=chromium:968809,chromium:989594,b:130238794 TEST=make -j buildall TEST=tested fingerprint enrollment and matching on nocturne DUT, which uses rollback_get_secret(). Change-Id: I44fb5ef7d43c080e4d33c8d9a7d9298e194e1cf3 Signed-off-by: Yicheng Li <yichengli@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1731544 Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* ish: Added board for drallion_ish based on arcada_ishDaniel Gonzalez2019-09-055-0/+373
| | | | | | | | | | | | | | | | "drallion_ish" is already included in devicetree.cb for drallion. Shim loading needs to be configured in OS for drallion. BRANCH=none BUG=b:140311300 TEST=Successfully loaded ISH on drallion board with arcada ish ec code Change-Id: I31274554859a77c6446330c253c994ce8e21734b Signed-off-by: Daniel Gonzalez <daniel.d.gonzalez@intel.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1758538 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Commit-Queue: Jack Rosenthal <jrosenth@chromium.org> Tested-by: Jack Rosenthal <jrosenth@chromium.org>
* fpsensor: replace memset() with always_memset()Yicheng Li2019-09-045-8/+15
| | | | | | | | | | | | | | In fpsensor code, use always_memset() in place of memset(). BRANCH=nocturne BUG=chromium:968809,chromium:989594,b:130238794 TEST=make -j buildall TEST=tested enrollment, matching and multifinger on nocturne DUT Change-Id: I29e32bd2838c1f240607799e61f29759aaee7600 Signed-off-by: Yicheng Li <yichengli@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1737206 Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* util/ectool: Free memory before giving upPatrick Georgi2019-09-041-0/+2
| | | | | | | | | | | | | | | Found by Coverity Scan #203652, #203653 BUG=none BRANCH=none TEST=none Change-Id: I195773c42d4d0dfa35836e3e442cca15125ac9ea Signed-off-by: Patrick Georgi <pgeorgi@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1781471 Tested-by: Patrick Georgi <pgeorgi@chromium.org> Commit-Queue: Patrick Georgi <pgeorgi@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* util/iteflash: Close file on error pathPatrick Georgi2019-09-041-0/+1
| | | | | | | | | | | | | | | Found by Coverity Scan #58166 BUG=none TEST=none BRANCH=none Change-Id: I1caa2a407a2c623c006c500a56c7048649ebb158 Signed-off-by: Patrick Georgi <pgeorgi@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1781470 Tested-by: Patrick Georgi <pgeorgi@chromium.org> Commit-Queue: Patrick Georgi <pgeorgi@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* driver/wpc/p9221: Avoiding using uninitialized variablePatrick Georgi2019-09-041-5/+7
| | | | | | | | | | | | | | | | | | For this, restrict the variables' scope and move the print statements closer to the other variable use. Found by Coverity Scan #198955, #198960 BUG=none BRANCH=none TEST=none Change-Id: I947249e4fd36524de5065616d5bcd32203d8b7e4 Signed-off-by: Patrick Georgi <pgeorgi@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1781469 Tested-by: Patrick Georgi <pgeorgi@chromium.org> Commit-Queue: Patrick Georgi <pgeorgi@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* util/uut: Fix printf formatsPatrick Georgi2019-09-042-7/+7
| | | | | | | | | | | | | | | Found by Coverity Scan #1194{41,48,49,50,53,54,55} BUG=none BRANCH=none TEST=none Change-Id: I8fee672359f7b13639d09e603f3aaa11de05e820 Signed-off-by: Patrick Georgi <pgeorgi@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1781468 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: Patrick Georgi <pgeorgi@chromium.org> Commit-Queue: Patrick Georgi <pgeorgi@chromium.org>
* util/uut/l_com_port: coding style fixPatrick Georgi2019-09-041-4/+4
| | | | | | | | | | | | | | | | The upload hooks complained about using the function name in the string, asking to use __file__ instead. BUG=none BRANCH=none TEST=repo upload is happy now Change-Id: I089e3acd3015cfea74439b2cccd5bb07eb5a4045 Signed-off-by: Patrick Georgi <pgeorgi@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1781467 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: Patrick Georgi <pgeorgi@chromium.org> Commit-Queue: Patrick Georgi <pgeorgi@chromium.org>
* util/comm-i2c: Fix memory leakPatrick Georgi2019-09-041-1/+2
| | | | | | | | | | | | | | | Found by Coverity #58167 BUG=none BRANCH=none TEST=none Change-Id: I434d4b140683b4c3440c30b232fab34d781da9d4 Signed-off-by: Patrick Georgi <pgeorgi@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1781466 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: Patrick Georgi <pgeorgi@chromium.org> Commit-Queue: Patrick Georgi <pgeorgi@chromium.org>
* common/mkbp_event: Avoid accessing an uninitialized variablePatrick Georgi2019-09-041-1/+3
| | | | | | | | | | | | | | | Found by Coverity Scan #198896 BUG=none BRANCH=none TEST=none Change-Id: I0f606e49ed30ff15054c296a8e698aca68a955d3 Signed-off-by: Patrick Georgi <pgeorgi@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1781465 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: Patrick Georgi <pgeorgi@chromium.org> Commit-Queue: Patrick Georgi <pgeorgi@chromium.org>
* mtk_isp: Add the service for p2 driverBibby Hsieh2019-09-045-1/+106
| | | | | | | | | | | | | BUG=b:139269434 TEST=build kukui_scp pass & check DIP_SERVICE is available BRANCH=none Change-Id: I86500068d77700e13e909b5085ca07d1170138c1 Signed-off-by: Bibby Hsieh <bibby.hsieh@mediatek.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1584182 Reviewed-by: Nicolas Boichat <drinkcat@chromium.org> Tested-by: Nicolas Boichat <drinkcat@chromium.org> Commit-Queue: Nicolas Boichat <drinkcat@chromium.org>
* hatch: Change interrupt handler for EC_RSMRST_LScott Collyer2019-09-045-5/+5
| | | | | | | | | | | | | | | | | | This CL changes the interrupt handler for EC_RSMRST_L gpio to use intel_x86_rsmrst_signal_interrupt. This interrupt handler reduces the propagation delay for high->low signal transitions. BUG=b:132421681 BRANCH=None TEST=make buildall Change-Id: I00420347fad84b876688e8d8a7ede9093e11ccaf Signed-off-by: Scott Collyer <scollyer@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1772482 Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Reviewed-by: Furquan Shaikh <furquan@chromium.org> Commit-Queue: Scott Collyer <scollyer@chromium.org>
* cometlake: Minimize delay for high->low rsmrst passthroughScott Collyer2019-09-042-0/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | Hatch designs buffer the PG_EC_RSMRST# signal from the Silego power good logic through the EC and out EC_PCH_RSMRST# to the SoC RSMRST# pin. For power off transitions, this should be as fast as possible, in the ns region if possible. However this time is ~1 msec. To reduce this delay as much as possible this CL introduces a new interrupt handler than can be linked to the rsmrst gpio signal. This interrupt routine handles high->low transitions directly to minimize the propagation delay. The power_signal_interrupt is then called which will wake up the chipset task, and low->high transistions continue to be handled in the power state machine. BUG=b:132421681 BRANCH=None TEST=Shorted PP1050_A_PG to ground to force an abrupt power down and then measured time via scope between PG_EC_RSMRST and EC_PCH_RSMRST. The delay is reduced from ~1 msec to 45 uSec. Change-Id: I266138a2e235ce47f3060f8e1f6f9bc6a75073ae Signed-off-by: Scott Collyer <scollyer@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1757267 Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Furquan Shaikh <furquan@chromium.org> Commit-Queue: Scott Collyer <scollyer@chromium.org>
* g: fix UART TX done logicVadim Bendebury2019-09-031-15/+3
| | | | | | | | | | | | | | | | | | | TX is done when both TX_IDLE and TX_EMPTY conditions are true. Fixing the check makes unnecessary the code which waited for another character time before proceeding when flushing the UART TX FIFO. BRANCH=cr50, cr50-mp BUG=b:140305442 TEST=added code to print a really long string before reset in the 'reboot' command, observed that the entire string is reliably printed before the reset. Change-Id: I0882d96ba9ca5412deb704ccdbc43e8cebeeeab5 Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1779587 Reviewed-by: Marius Schilder <mschilder@chromium.org> Reviewed-by: Andrey Pronin <apronin@chromium.org>
* fuzz_host_cmd: Add fuzzing for fpsensor host cmdsCraig Hesling2019-09-036-3/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds the host commands declared in fpsensor_state.c to the fuzzing mix. They are the following: EC_CMD_FP_SEED 0x0408 EC_CMD_FP_ENC_STATUS 0x0409 EC_CMD_FP_MODE 0x0402 EC_CMD_FP_CONTEXT 0x0406 This is not the complete fpsensor host command interface. More host commands will be added in followup CLs. BRANCH=none BUG=b:116065496 TEST=# Pull in TEST_COVERAGE fix git fetch "https://chromium.googlesource.com/chromiumos/platform/ec" \ refs/changes/86/1725186/1 && git cherry-pick FETCH_HEAD make host-host_command_fuzz TEST_COVERAGE=1 timeout 5m ./build/host/host_command_fuzz/host_command_fuzz.exe llvm-profdata merge -sparse default.profraw -o default.profdata llvm-cov show build/host/host_command_fuzz/host_command_fuzz.exe \ --instr-profile=default.profdata --format=html --output-dir=cov # Inspect cov/.../common/fpsensor/fpsensor_state.c.html to verify TEST=make buildall -j Change-Id: I69e9833463944a0dfba49e5671987b7fec565bf4 Signed-off-by: Craig Hesling <hesling@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1661122
* common/charge_ramp: code cleanupPatrick Georgi2019-09-031-1/+1
| | | | | | | | | | | | | | | | | | No use keeping the return statement outside the #if bracket since the preceding line is also a return statement. Found by Coverity #190406 BUG=none BRANCH=none TEST=none Change-Id: Ifcd36b9d65e4b2682337b4fc963d3dd64a066c7c Signed-off-by: Patrick Georgi <pgeorgi@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1781464 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: Patrick Georgi <pgeorgi@chromium.org> Commit-Queue: Patrick Georgi <pgeorgi@chromium.org>
* common: Add uptime host commandTom Hughes2019-09-0310-27/+167
| | | | | | | | | | | | | | | | | | This moves the EC_CMD_GET_UPTIME_INFO command from behind the CONFIG_CMD_AP_RESET_LOG config in chipset.c into the generic common/uptime.c file, so that all boards in the codebase can use it. If CONFIG_CMD_AP_RESET_LOG is enabled, the "AP reset stats" will be filled. Otherwise, ap_reset_stats is a no-op and recent_ap_reset is filled with zero. BRANCH=none BUG=chromium:997314 TEST=cat /sys/kernel/debug/cros_fp/uptime Change-Id: I3b6f91b2dd22d3d55b707309ec1fdfd26d42fd70 Signed-off-by: Tom Hughes <tomhughes@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1769393 Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
* config: Refactor CONFIG_ACCEL_FIFO to enable use of IS_ENABLEDYuval Peress2019-09-0330-291/+331
| | | | | | | | | | | | | | | This change allows us to use the IS_ENABLED condition to replace the various ifdef guards around the CONFIG_ACCEL_FIFO BUG=b:137758297,chromium:981990 BRANCH=None TEST=buildall and CTS tests on Arcada Change-Id: I65d36bac19855e51c830a33e6f3812575e8d15d9 Signed-off-by: Yuval Peress <peress@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1704164 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
* audio_codec: extract DMIC from I2S RXTzung-Bi Shih2019-09-031-13/+36
| | | | | | | | | | | | | DMIC feature is independent. Extract DMIC from I2S RX. BRANCH=none BUG=b:122027734, b:123268236 TEST=make BOARD=kukui_scp -j Change-Id: Icfd3c6241c7fb72ef8731cb4ca97bc77279f65bb Signed-off-by: Tzung-Bi Shih <tzungbi@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1564501 Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* audio_codec: refactor I2S RXTzung-Bi Shih2019-09-032-69/+53
| | | | | | | | | | | | | | | | Refactor by the following items: - use more specific name "i2s rx" - use verbose symbol names to separate namespaces - remove unused TDM-related code BRANCH=none BUG=b:122027734, b:123268236 TEST=make BOARD=kukui_scp -j && make BOARD=npcx7_evb -j Change-Id: I8ccda5b5bbd9cf144bd68ba25249c8243b3086ac Signed-off-by: Tzung-Bi Shih <tzungbi@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1564500 Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* audio_codec: remove unused EC_FEATURE codeTzung-Bi Shih2019-09-033-6/+0
| | | | | | | | | | | | | | | | Audio codec don't use EC feature. Remove all EC_FEATURE-related code. BRANCH=none BUG=b:122027734, b:123268236 TEST=make BOARD=kukui_scp -j Change-Id: Ib46c5a9bc1486547b81b76d3683e1faf7ff8483d Signed-off-by: Tzung-Bi Shih <tzungbi@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1697885 Reviewed-by: Nicolas Boichat <drinkcat@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-by: Cheng-Yi Chiang <cychiang@chromium.org>
* kodama: CCD_MODE_ODL insteads of USB_C0_DP_OE_Lxiong2019-09-021-2/+2
| | | | | | | | | | | | | | | Remove USB_C0_DP_OE_L and CCD_MODE_ODL is moved from PA5 to PA1. CCD_MODE_ODL is drived by H1, at EC side configure CCD_MODE_ODL as input mode. BUG=b:140079487, b:140358646 BRANCH=master TEST=DP display nomally at Kodama EVT board. Change-Id: I881e8d98ddd3029377f24d1b753d35ef5b6e9768 Signed-off-by: Xiong Huang <xiong.huang@bitland.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1780968 Reviewed-by: Yilun Lin <yllin@chromium.org>
* treeya: fix rotation matrices of lid and base sensorslu zhang2019-08-311-5/+16
| | | | | | | | | | | | | | | | | Now there are two sets of lid/base sensors in proto phase. Both of rotation matrices need to be fixed. BUG=b:138744661 BRANCH=none TEST=Using ec console 'accelinfo on' verified lid angle now goes from 0 to 360 and swtiches to tablet mode after crossing 180 threshold. Change-Id: I93a89a878cf064071eb5f3786f4f5f5475ba2de2 Signed-off-by: lu zhang <lu.zhang@bitland.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1773032 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>
* nvmem: allow printing encrypted contents only in DEV imagesVadim Bendebury2019-08-311-1/+7
| | | | | | | | | | | | | | | | | | The dump_nvmem CLI command used for debugging can also print out the encrypted contents of the NVMEM objects in case it is passed any command line parameter. Let's limit this capability to DEV images only. BRANCH=cr50, cr50-mp BUG=none TEST=verified that the contents still can be printed by images built with CR50_DEV. Change-Id: I4e1204f2470b1481453ffd940102d8739b5d5a34 Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1779489 Reviewed-by: Mary Ruthven <mruthven@chromium.org>
* fan: Enable fan on chipset resumeVijay Hiremath2019-08-311-42/+34
| | | | | | | | | | | | | | | Always enable the fan on chipset resume. If the DPTF is enabled, AP will disable/throttle the fan upon booting to S0. BUG=b:139882986 BRANCH=none TEST=Manually tested on intelrvp. fan is able to run in auto mode on chipset resume. Change-Id: I986c983fde550f797b3aaa3e06c6b958535b2769 Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1768917 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* Kindred: Add WIFI temperature sensor.ben.chen2@quanta.corp-partner.google.com2019-08-302-0/+9
| | | | | | | | | | | | | | | | | | This patch enable temp sensor 3 near by WIFI. BUG=b:140127035 BRANCH=master TEST=run 'temps', verify that temp sensor is present and reasonable. Change-Id: I266cb1ecd92a8727d65c33bae686f5b6848ca168 Signed-off-by: Ben Chen <ben.chen2@quanta.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1751304 Reviewed-by: David Wu <david_wu@quanta.corp-partner.google.com> Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org> Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Tested-by: David Wu <david_wu@quanta.corp-partner.google.com> Commit-Queue: Tim Wawrzynczak <twawrzynczak@chromium.org>
* kukui_scp: suspend some tasks when AP in S3Yilun Lin2019-08-301-4/+7
| | | | | | | | | | | | | | | Some tasks may access DRAM, but DRAM is disabled when AP in S3. This CL stops the tasks when AP goes in S3. TEST=Ensures that the tasks are disabled/enabled when AP in suspend/resume. BUG=b:136240895 BRANCH=none Change-Id: Id726119d87c031e0d04261353705c5812fbbc32e Signed-off-by: Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1773026 Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* kukui_scp: support suspending tasks tasks when AP in S3Yilun Lin2019-08-302-0/+29
| | | | | | | | | | | | | | | | | | Some of the tasks may access AP DRAM. However, for power efficiency, AP stops DRAM clock in S3, so SCP shouldn't access DRAM. This CL enable HC host_sleep_event and stops the tasks when system in S3 and re-enable the tasks when system in S0. BUG=b:136240895 TEST=See SCP disable tasks when AP suspend and enable tasks when AP resume. BRANCH=None Change-Id: I6f423407358b74c2a68432dc1548d1f8259bb331 Signed-off-by: Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1753564 Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* garg: remove AR camera supportDevin Lu2019-08-302-38/+1
| | | | | | | | | | | | | | | Garg doesn't support AR camera, remove unused code. BUG=b:134854577 BRANCH=octopus TEST=make buildall -j Change-Id: I593cc5ef856e5708449e28ad84ced8fa21b1ffa3 Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1771098 Reviewed-by: Marco Chen <marcochen@chromium.org> Reviewed-by: Justin TerAvest <teravest@chromium.org> Reviewed-by: Nigel Sale <nsale@google.com>
* flash_log: prevent console output garblingVadim Bendebury2019-08-301-3/+2
| | | | | | | | | | | | | | | | Dumping the flash log including many short entries results in garbled console output. Let's move cflush() invocation to the main loop, it is not a problem for a console command be throttled like this. BRANCH=cr50 BUG=none TEST=verified that flash logs of many short and long messages are printed out accurately. Change-Id: Id4b988d4eab29aaf118d6495f9a3d61e5d9f9a56 Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1776335 Reviewed-by: Mary Ruthven <mruthven@chromium.org>
* grunt: Disable ec_feature kbbacklit for barla refresh SKUsDevin Lu2019-08-291-0/+1
| | | | | | | | | | | | BUG=b:139686328 BRANCH=grunt TEST=make buildall -j Change-Id: I588874c2f4f9556137d4cc9e895c3f2f6aaa5436 Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1772868 Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org>
* jacuzzi: disable adc after board version detectedTing Shen2019-08-291-0/+10
| | | | | | | | | | | | | | | | | | | | This CL reverts the change in CL:1416074 for devices without POGO pin. To reduce power consumption, we should to disable adc module if it's only used by one-off board/sku id init. For devices with pogo, keep adc enabled for device type detection. BUG=b:138180455 TEST=dut-power in G3, verify that power consumption is lower BRANCH=master Change-Id: I5ca69adf99bba91f86527e377a45e42b021ee310 Signed-off-by: Ting Shen <phoenixshen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1741567 Reviewed-by: Yilun Lin <yllin@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Tested-by: Ting Shen <phoenixshen@chromium.org>
* blooglet: override battery LEDs to indicate system suspendstabilize-12464.BDevin Lu2019-08-291-0/+23
| | | | | | | | | | | | | | | As meep, careena and snappy we have some SKUs are non-power LED design, blinking both two side battery white LEDs (1 sec on/1 sec off) to indicate system suspend with non-charging state. BUG=none BRANCH=octopus TEST=make sure both two side LEDs are blinking white after system suspend. Change-Id: I2839309acb91e365b98b5aac024bb7d7ebf287eb Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1771099 Reviewed-by: Marco Chen <marcochen@chromium.org>