summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* util: rewrite the host test runner in Python 3, and drop pexpectJack Rosenthal2020-03-201-72/+105
| | | | | | | | | | | | | | | | | This is a total-rewrite of the host test runner, in Python 3, and no longer uses the pexpect library (simply because we don't need to open a can of Pringles with a crowbar: our usage can be handled with some simple IPC and the subprocess library). BUG=chromium:1031705,chromium:1061923 BRANCH=none TEST=host tests pass, manually-created failing tests with "Fail!", premature ending, or timeout fail appropriately. Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I4017da877d6a34c1031b261fc41f8334dae26c00 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2106862 Reviewed-by: Chris McDonald <cjmcdonald@chromium.org>
* chip: stm32: fix TIM9 interrupt for STM32F412Virendra Kakade2020-03-201-0/+4
| | | | | | | | | | | | | | | | | | | | | Currently the TIM9 global interrupt is mapped to 25 instead of 24 which causes the interrupt to not work. Fix this by changing the mapping. RM0402 STM32F412 reference manual: Vector table for STM32F412xx (table 40); TIM1_BRK_TIM9 entry. BUG=none BRANCH=none TEST=make -j4 buildall TEST=TIM9 interrupt works after this change on STM32F412 board. Signed-off-by: Virendra Kakade <virendra.kakade@ni.com> Change-Id: I18ee7cda79e78c01bc561b1d70d2a25fa3aed5a5 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2098872 Reviewed-by: Craig Hesling <hesling@chromium.org> Commit-Queue: Craig Hesling <hesling@chromium.org> Tested-by: Craig Hesling <hesling@chromium.org>
* USB-C: Determine port partner's data role based on PD's data roleVijay Hiremath2020-03-193-20/+5
| | | | | | | | | | | | | | | | | | | | | Current code uses the CC lines to find out the data role of a port partner, however when the PD based data role swap happens DR_swap command has no effect on the CC lines. Hence need to use PD's data role to determine port partner's data role. Reference: USB Type-C cable and connector specification, Release 2.0 4.5.1.4.2 USB PD-based Power Role, Data Role and VCONN Swapping Table 4-12 USB PD Swapping Port Behavior Summary BUG=b:151653348 BRANCH=none TEST=UFP/DFP is correctly configured hence no PMC timeout errors observed on Volteer. Change-Id: I237d5c3f88096f4bd2d043ab823c98fe47686fa9 Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2107890 Reviewed-by: Keith Short <keithshort@chromium.org>
* damu: change lid sensorScott Chao2020-03-192-9/+9
| | | | | | | | | | | | | | | change lid sensor from LIS2DWL to LIS2DE12. BUG:b:147689571 BRANCH:kukui TEST=make -j BOARD=damu TEST=make buildall Change-Id: I3920e41df83d264af177fd3ae36029e866f8a01a Signed-off-by: Scott Chao <scott.chao@bitland.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2109433 Reviewed-by: Li-jen Chen <lijen@google.com> Reviewed-by: Ting Shen <phoenixshen@chromium.org>
* jacuzzi: Fix sensor rotation matrixHeng-Ruey Hsu2020-03-191-1/+1
| | | | | | | | | | | BUG=b:151693584 TEST=pass CTSV Accelerometer Measurement Tests BRANCH=None Change-Id: I9b23e6c32311722d53f76fb831aa72bc1331ad73 Signed-off-by: Heng-ruey Hsu <henryhsu@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2109435 Reviewed-by: Ricky Liang <jcliang@chromium.org>
* uart.h: fix compilation inclusion guard placementVadim Bendebury2020-03-191-2/+2
| | | | | | | | | | | | | | | A recent change added a declaration after the compilation inclusion guard '#endif', this is a mistake, let's fix it. BRANCH=none BUG=none TEST=make buildall -j Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Change-Id: I9744b4ffddda3119dda9424e69537338a8c16a41 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2109313 Reviewed-by: Nicolas Boichat <drinkcat@chromium.org> Commit-Queue: Nicolas Boichat <drinkcat@chromium.org>
* Rename Cortex-M MMFS to CFSRPeter Marheine2020-03-195-58/+42
| | | | | | | | | | | | | | | | | Taken as as 32-bit register, ARM call the register at 0xe000ed28 CFSR; the Configurable Fault Status Register. MMFS is the low byte of this value, so it's misleading to refer to the whole 32-bit value as MMFS; instead call it CFSR to make it clear that the value we store encompasses the MMFSR, BFSR and UFSR. BUG=None BRANCH=None TEST=make buildall Change-Id: Ifd62e0a6f27a2e6ddfa509b84c389d960347ff85 Signed-off-by: Peter Marheine <pmarheine@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2104807 Reviewed-by: Keith Short <keithshort@chromium.org>
* volteer: Switch to TCPC VBUS detectAbe Levkoy2020-03-181-1/+1
| | | | | | | | | | | | | | | The SYV682 PPC does not interrupt when VBUS changes, which makes it difficult to use for VBUS detection. Use the TCPCs to do this. BUG=b:151102905 TEST=Charge using each Type-C port using TCPMv1 and TCPMv2 TEST=Observe no console spam when not charging with TCPMv1 and TCPMv2 BRANCH=none Change-Id: I4dd17294e756b94d844af3ed788eed7388120f3b Signed-off-by: Abe Levkoy <alevkoy@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2107880 Reviewed-by: Keith Short <keithshort@chromium.org>
* TCPMv2: Use a DPM_REQUEST message to trigger Port DiscoverySam Hurst2020-03-184-33/+54
| | | | | | | | | | | | | | | | | | | | | | | On reboot, while charging from a dongle, send a DPM_REQUEST message to trigger a Port Discover to enter an Alt Mode. And add a flag to signal that the Port Discovery should continue if it was interrupted by a message reception. BUG=b:149662829 BRANCH=none TEST=make -j buildall Manual tests: Tested with an apple dock and several other docks on kohaku Signed-off-by: Sam Hurst <shurst@google.com> Change-Id: I058c4717758792c77c02c26a74f2d9e9c4954ba0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2098566 Tested-by: Sam Hurst <shurst@google.com> Tested-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org> Commit-Queue: Sam Hurst <shurst@google.com>
* hatch: Enable button console commandpandeyan2020-03-181-0/+1
| | | | | | | | | | | | | | | | Enabled compiler switch for hatch board to simulate button operations. BUG=b:149659987 BRANCH=None TEST=Tested on hatch board. From EC console, entered the below commands: $ button vup 500 Observed volume UP key press on display. Change-Id: Ibcdba6541ecdea6c9e6ce480c932a7613832a87b Signed-off-by: pandeyan <anshuman.pandey@intel.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2059930 Reviewed-by: Jett Rink <jettrink@chromium.org>
* nightfury: Initial EC imageraymondchung2020-03-187-0/+1161
| | | | | | | | | | | | | | The starting point for the nightfury EC image. BUG=b:149226871 BRANCH=firmware-hatch-12672.B TEST=make -j BOARD=nightfury Change-Id: Ifafb645737b3e7c1aa9245a359e3df47ca9d66fa Signed-off-by: Raymond Chung <raymondchung@ami.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2050103 Commit-Queue: Philip Chen <philipchen@chromium.org> Reviewed-by: Philip Chen <philipchen@chromium.org>
* asurada: generate dummy gpio entriesTing Shen2020-03-182-14/+120
| | | | | | | | | | | | | | | | | | script generated gpio table from go/asurada-ec-pinmux, with minimal manual adjustment. BUG=b:150341271 TEST=1) make 2) verify ec console works BRANCH=none Signed-off-by: Ting Shen <phoenixshen@google.com> Change-Id: Ie87199bb00a07f53ceba8a5760945bb7c7aa36d8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2107295 Tested-by: Ting Shen <phoenixshen@chromium.org> Reviewed-by: Eric Yilun Lin <yllin@chromium.org> Commit-Queue: Eric Yilun Lin <yllin@chromium.org> Auto-Submit: Ting Shen <phoenixshen@chromium.org>
* driver/tcpm/it83xx: set cc polarity correctlyRuibin Chang2020-03-181-1/+5
| | | | | | | | | | | | | | | | | | | | | | | TCPM select POLARITY_CC1_DTS or POLARITY_CC2_DTS, it83xx driver always set CC2 polarity to register. We should set CC1 polarity to register for POLARITY_CC1_DTS, So I add a if condition to set cc polarity correctly. BUG=none BRANCH=none TEST=1.on board ampton with driver it83xx, plug-in debug accessory SNK, check cc polarity register setting same as enum case by console. 2.on board it8xxx2_pdevb with driver it8xxx2, plug-in debug accessory SNK, check cc polarity register setting same as enum case by console. Signed-off-by: Ruibin Chang <ruibin.chang@ite.com.tw> Change-Id: Ic42a1bf290e695040fd7f53e7f3b38ec829dd614 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2100560 Tested-by: Ruibin Chang <Ruibin.Chang@ite.com.tw> Reviewed-by: Jett Rink <jettrink@chromium.org> Commit-Queue: Ruibin Chang <Ruibin.Chang@ite.com.tw>
* TCPMv1: Cleanup: Set initial data role based on power roleVijay Hiremath2020-03-181-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | Set initial data role of the PD based on the current power role. - Initial data role for sink is UFP - Initial data role for source is DFP Reference: USB Type-C cable and connector specification, Release 2.0 2.3.3 Initial Power (Source-to-Sink) Detection and Establishing the Data (Host-to-Device) Relationship Once initial connection is established, the Source supplies VBUS and behaves as a DFP, and the Sink consumes VBUS and behaves as a UFP. USB PD, when supported by both ports, may then be used to independently swap both the power and data roles of the ports. BUG=b:151653348 BRANCH=none TEST=make buildall -j Change-Id: I69e01f5b98a656394d61ee6cf657ea63a570abd8 Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2106944 Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Divya S Sasidharan <divya.s.sasidharan@intel.com>
* volteer: enable battery cutoffKeith Short2020-03-171-3/+1
| | | | | | | | | | | | | | | Enable battery cutoff from console and from AP. BUG=b:143809318 BRANCH=none TEST=make buildall TEST=run "cutoff" from EC console, verify voltage on battery is 0 TEST=run "ectool batterycutoff" from AP, verify voltage on battery is 0 Change-Id: If5902a2469201da97d29db6d2e15c6b8b053efda Signed-off-by: Keith Short <keithshort@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2042903 Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
* kukui: increase PD_POWER_SUPPLY_TURN_OFF_DELAYTing Shen2020-03-171-1/+1
| | | | | | | | | | | | | | | | | The default value (50ms) is not enough for kukui platform, increase it to 250ms. BUG=b:149808890 TEST=plug in usb hub, plug in power cable to the hub verify power role swap succeed. BRANCH=kukui Change-Id: I487f0aeea78f2fc5de9a7dcc4a9a38cb831944cf Signed-off-by: Ting Shen <phoenixshen@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2102171 Reviewed-by: Eric Yilun Lin <yllin@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Tested-by: Ting Shen <phoenixshen@chromium.org>
* dratini: Enable HDMI power and add debounce to HDMI HPD low interruptTim Wawrzynczak2020-03-172-2/+40
| | | | | | | | | | | | | | | | | | | Enable power to HDMI rail when AP is in S0, off otherwise. Also, when runtime S0ix kicks in, there can be a long transient pulse low on the HDMI_CONN_HPD signal (300+ ms). This patch adds a 2-second debounce time when the HPD goes low. BUG=b:147261818 BRANCH=firmware-hatch-12672.B TEST=Verified runtime S0ix, suspend/resume S0ix, shutdown, and startup all correctly operate the HDMI & MST signals. Signed-off-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Change-Id: Ia9fce8a2020995c57e9bb3634a147765e3c556f8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2103366 Reviewed-by: Furquan Shaikh <furquan@chromium.org>
* i2c_hid_touchpad: Add function to prepare new input reportsShecky Lin2020-03-172-0/+140
| | | | | | | | | | | | | | | | | | | This is part of a chain to add a common I2C HID interface for touchpads. The CL adds a function to put a new input report in the buffer which would be sent next time when the host tries to read one. BUG=chromium:1008568 BRANCH=none TEST=Build and run on MCU to forward touchpad events to host through I2C HID. Cq-Depend: chromium:2094928 Change-Id: I321054f73155da03d951a4d586dd316caf37f0fc Signed-off-by: Shecky Lin <sheckylin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2094929 Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* i2c_hid_touchpad: Add init and request handlersShecky Lin2020-03-172-0/+263
| | | | | | | | | | | | | | | | | | | This is part of a chain to add a common I2C HID interface for touchpads. The CL adds an init function for I2C HID touchpad and implements a handler that can process I2C HID requests from the host. BUG=chromium:1008568 BRANCH=none TEST=Build and run on MCU to forward touchpad events to host through I2C HID. Signed-off-by: Shecky Lin <sheckylin@chromium.org> Cq-Depend: chromium:2094927 Change-Id: I58d46031396976eb3bf02e1b5516e92a9cd88ed4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2094928 Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* i2c_hid_touchpad: Add basic structs and descriptorsShecky Lin2020-03-175-0/+546
| | | | | | | | | | | | | | | | | This is part of a chain to add a common I2C HID interface for touchpads. The CL layouts basic struct, defines and HID descriptors that would be used by an I2C HID touchpad implementation. BUG=chromium:1008568 BRANCH=none TEST=Build and run on MCU to forward touchpad events to host through I2C HID. Change-Id: I89108f0cdce1a9a11bf1e26e43c6662959c7184e Signed-off-by: Shecky Lin <sheckylin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2094927
* Button: add ectool command to simulate button presspandeyan2020-03-175-63/+188
| | | | | | | | | | | | | | | | | | Added a new ectool command 'ectool button' for simulating volume up and volume down button operations along with the duration in milli-seconds for which button needs to be pressed. BUG=b:149659987 BRANCH=None TEST=Tested on hatch board. From Kernel console, entered the below commands: $ectool button vup 500 Observed volume UP key press on EC console. Change-Id: I6fcdf80ea45b80403f72af89ce99214226731d0f Signed-off-by: pandeyan <anshuman.pandey@intel.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2059929 Reviewed-by: Jett Rink <jettrink@chromium.org>
* flash_ec: fix incorrect indentTing Shen2020-03-171-1/+1
| | | | | | | | | | | | | | | | replace whitespace by tab in a line BUG=none TEST=make sure `flash_ec` still works BRANCH=none Signed-off-by: Ting Shen <phoenixshen@google.com> Change-Id: I811bc3b88f94186c07e90e78d46c82eeb56bebea Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2107147 Tested-by: Ting Shen <phoenixshen@chromium.org> Reviewed-by: Eric Yilun Lin <yllin@chromium.org> Commit-Queue: Eric Yilun Lin <yllin@chromium.org> Auto-Submit: Ting Shen <phoenixshen@chromium.org>
* Juniper: Return BP_NOT_SURE when DFET status is offDavid Huang2020-03-173-2/+71
| | | | | | | | | | | | | | | | | | Make battery_is_present and battery_check_present_status overridable for customize by device. Do not return BP_NO when DFET status is off. Battery might need more charge time to wake up from shutdown. Return BP_NOT_SURE to keep charge battery. BUG=b:149971271 BRANCH=jacuzzi TEST=Insert UVP/shutdown battery and check battery resume normally. Change-Id: I68841e4e6e0457711fc4f43e6346b54805b7217c Signed-off-by: David Huang <david.huang@quanta.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2091131 Reviewed-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-by: Ting Shen <phoenixshen@chromium.org>
* docs/ide-suport.md: Add better editor settingsCraig Hesling2020-03-171-3/+19
| | | | | | | | | | | | | | | This adds a more complete view of file styles in EC. This may not represent the goal, but more the trend of file styles seen in EC. BRANCH=none BUG=none TEST=viewed in gitiles Signed-off-by: Craig Hesling <hesling@chromium.org> Change-Id: Ib981590703088fa34320ab0f7496e7cb0a23df55 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2103866 Reviewed-by: Jett Rink <jettrink@chromium.org>
* util/ide-config.sh: CleanupCraig Hesling2020-03-171-55/+55
| | | | | | | | | | | | | | | * Change error messages to print to stderr * Uglify variables to adhere to shell scripting style BRANCH=none BUG=none TEST=none Change-Id: I2baef1b9711447b3506c74674db5701e9ba8c753 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2101901 Tested-by: Craig Hesling <hesling@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org> Commit-Queue: Craig Hesling <hesling@chromium.org>
* common/keyboard_vivaldi: Support for new Vivaldi keyboardRajat Jain2020-03-175-10/+150
| | | | | | | | | | | | | | | | | | | | | | | | | Vivaldi is a new keyboard that allows individual boards to have additional or different top row keys and/or to reorder those keys. go/vivaldi-prd go/vivaldi-design Add code to provide an API that individual boards that use the vivaldi keyboard, that lets them define their board keyboard top row layout. Some scan codes have been taken from https://wiki.osdev.org/PS/2_Keyboard#Key_Codes.2C_Key_States_and_Key_Mappings and ones that did not exist, have been allotted from (seemingly) free holes in there. BUG=b:146501925 TEST=Check on Jinlon the (new) expected scancodes are output from EC. BRANCH=firmware-hatch-12672.B Signed-off-by: Rajat Jain <rajatja@google.com> Change-Id: Id6b854337958d99898175e7be7a9972938e32399 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2080603 Reviewed-by: Furquan Shaikh <furquan@chromium.org>
* power/icelake: Transition to G3 when S5 failsAseda Aboagye2020-03-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | This commit fixes a bug where we were forcefully setting the chipset state to G3 instead of transitioning to G3 from our failed S5 attempt. This was causing an issue where we had turned on some power rails in trying to reach S5, but when reaching S5 failed, we "assumed" G3 and therefore skipped turning off the rails we had enabled. BUG=b:151479266 BRANCH=hatch TEST=Build and flash on waddledoo that isn't booting to S0. Verify that PP3300_A and PP5000_U are turned off when the sequencing fails and that DPWROK is not asserted after the failure. Signed-off-by: Aseda Aboagye <aaboagye@google.com> Change-Id: Ic7af003270c239088b4364e82783aae56a45fa33 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2106372 Tested-by: Aseda Aboagye <aaboagye@chromium.org> Auto-Submit: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org>
* anx7447.c: anx7447/anx3447 has an additional condition(0xAA:bit6) for ↵Xin Ji2020-03-162-2/+41
| | | | | | | | | | | | | | | | | | | | | | | | Look4connection command 0xAA:bit6 default value is 1. When writing Look4connection command to toggle CC, this bit shall be set to "0"; when TCPM found CC is connected, this bit shall be set to "1" again BRANCH=none BUG=b:146318582 TEST=Manually testing as following: Attached C to hdmi dongle that works as expected. Attached charger, make sure DUT can be charged as expected. Attached with HP USB-C/A Universal Dock G2, make sure DUT can be charged and can't see tcpc timeout. Change-Id: Ic75ebc5b126cb464a999f195fd6d2089d820e5e1 Signed-off-by: Xin Ji <xji@analogixsemi.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2065783 Tested-by: Devin Lu <Devin.Lu@quantatw.com> Reviewed-by: Diana Z <dzigterman@chromium.org> Reviewed-by: S Wang <swang@analogix.corp-partner.google.com> Commit-Queue: Tim Wawrzynczak <twawrzynczak@chromium.org>
* Dedede: Configure PROCHOT as active lowDiana Z2020-03-161-0/+1
| | | | | | | | | | | | | PROCHOT for both waddledee and waddledoo is active low. BUG=None BRANCH=None TEST=make -j buildall Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I047be61dcd2b59269898c1f0da696b24520915d8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2101221 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* OCPC: Introduce charger enumDiana Z2020-03-162-1/+10
| | | | | | | | | | | | | | | This enum will specify which charger is primary, and the number of total charger chips for the board. This will be pre-defined for boards using a single charger chip. BUG=b:147440290 BRANCH=None TEST=make -j buildall Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: Id612ace560207a7805e103465fd4035d46beed8f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2101220 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* ISL923x: Accept charger chip for prochot functionsDiana Z2020-03-163-10/+11
| | | | | | | | | | | | | | | This commit moves the charger chip number into a parameter for the isl923x driver, so it can be used for boards which use more than one charger chip. BUG=None BRANCH=None TEST=make -j buildall Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: Ibfc7aaf30e2c00be0d1b2171052e15c3098516a7 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2101219 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* TUSB544: Add driver structure declarationDiana Z2020-03-162-20/+22
| | | | | | | | | | | | | | | This adds the extern declaration for the tusb544_drv structure for boards to use, clarifies the name of the I2C address flag, and updates to the new redriver driver type. BUG=None BRANCH=None TEST=builds Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I045b76599f6cc5a4c64ae88bda7cd72c94a19e40 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2101218 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* SM5803: Initial driverDiana Z2020-03-164-1/+629
| | | | | | | | | | | | | | | New driver for the SM5803 chip. It includes the core charger driver functions implemented, as well as access functions to control the charger's GPIO and a basic interrupt handler for the chip. BUG=b:146651778 BRANCH=None TEST=able to charge battery on franken-doo Change-Id: I84c734351a739d2472c8c0ad45929ff5929fc6d8 Signed-off-by: Diana Z <dzigterman@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2055767 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>