summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* meep: enable 2nd TCPC source PS8755 for port 1firmware-zork-13421.B-masterMarco Chen2020-08-292-0/+21
| | | | | | | | | | | | | | | | | | | | | | | The original TCPC in the port 1 is PS8751 and this CL adds another option of PS8755. These two are all supported by ps8xxx.c and the board function board_get_ps8xxx_product_id is implemented to judge the source by checking the SSFC bits field in the CBI. BUG=b:159082424, b:163922535 BRANCH=octopus TEST=verify DUT with PS8755 or PS8751 in the sub-board can work correctly in sink and source roles. Signed-off-by: Marco Chen <marcochen@chromium.org> Change-Id: I0cba58eb7b22c95aac1344f1b3a68ce5dac43ab0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2377060 Reviewed-by: Diana Z <dzigterman@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2383924 Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org> Tested-by: Edward Hill <ecgh@chromium.org>
* Octopus: Initiate the first version of parsing SSFC of CBIMarco Chen2020-08-293-1/+61
| | | | | | | | | | | | | | | | | | Initiate the helper functions to parse the SSFC of CBI. The first and only component in this version is TCPC in the port 1. BRANCH=octopus BUG=b:163922535 TEST=EC log of Meep device can output value of SSFC in CBI Signed-off-by: Marco Chen <marcochen@chromium.org> Change-Id: Iaee608a8b9791796fff0b31599c8be1bdc07cf3e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2377058 Reviewed-by: Diana Z <dzigterman@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2383923 Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org> Tested-by: Edward Hill <ecgh@chromium.org>
* morphius: update GPIO for mst functionZick Wei2020-08-292-3/+6
| | | | | | | | | | | | | | | | | | This patch update GPIO for MST function by board version. BUG=b:159051013 BRANCH=zork TEST=verify that MST function can work on board version 4. Signed-off-by: Zick Wei <zick.wei@quanta.corp-partner.google.com> Change-Id: I20c672155f0bd29e27e9b28a1e9f3abd03e87add Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2372162 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2383922 Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org> Tested-by: Edward Hill <ecgh@chromium.org>
* pi3usb9201: Switch to SDP while DFP is connectedEdward Hill2020-08-291-7/+35
| | | | | | | | | | | | | | | | Set CDP_HOST_MODE when we are DFP to advertise higher power but then switch to SDP after device is plugged in, to avoid noise (pulse on D-) causing USB disconnect. BUG=b:156014140 b:163947281 b:163425237 BRANCH=none TEST=audio over USB-C Signed-off-by: Edward Hill <ecgh@chromium.org> Change-Id: Ibc43edc15bbdeca805e68093035a06ef7076d2c9 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2353889 Reviewed-by: Raul E Rangel <rrangel@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2383921
* stm32g4: Fix build issue with i2c driverScott Collyer2020-08-292-2/+1
| | | | | | | | | | | | | | | | | | | This CL fixes 2 minor issues which with the i2c driver file. BUG=b:148493929 BRANCH=None TEST=verfied honeybuns builds correctly. Signed-off-by: Scott Collyer <scollyer@google.com> Change-Id: Ide6aafd4e4296891579fa138ec0d3e54a4ed9c6d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2376828 Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Commit-Queue: Scott Collyer <scollyer@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2383920 Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org> Tested-by: Edward Hill <ecgh@chromium.org>
* zork: Use gpio_or_ioex_set_level for PORT_TO_HPDEdward Hill2020-08-291-2/+2
| | | | | | | | | | | | | | Fix a couple of places missed in CL:2366456 BUG=b:161860605 BRANCH=zork TEST=none Signed-off-by: Edward Hill <ecgh@chromium.org> Change-Id: Icb49da01b3575cfd81f57f01efcafea534212d8d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2380160 Reviewed-by: Peter Marheine <pmarheine@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2383919
* zork: Delay between G3 exit and power buttonEdward Hill2020-08-292-0/+21
| | | | | | | | | | | | | | | On G3->S5, wait for GPIO_EC_FCH_RSMRST_L to be deasserted before asserting GPIO_EC_FCH_PWR_BTN_L. BUG=b:164921478 BRANCH=zork TEST=power button timing Signed-off-by: Edward Hill <ecgh@chromium.org> Change-Id: Ib16f8ccf795382a26e70fd505e03c59db4eeaa88 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2378558 Reviewed-by: Furquan Shaikh <furquan@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2383918
* power_button: Add CONFIG_POWER_BUTTON_TO_PCH_CUSTOMEdward Hill2020-08-293-1/+16
| | | | | | | | | | | | | | | | Allow board to provide board_pwrbtn_to_pch function to override the default behavior of gpio_set_level(GPIO_PCH_PWRBTN_L, level) as the means for asserting power button signal to PCH. BUG=b:164921478 BRANCH=zork TEST=power button timing Signed-off-by: Edward Hill <ecgh@chromium.org> Change-Id: I8f5ffb2759318fdc941155b60be8bf4aa7dd4771 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2378557 Reviewed-by: Furquan Shaikh <furquan@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2383917
* driver: add icm426xx chip type defineJean-Baptiste Maneyrol2020-08-292-0/+4
| | | | | | | | | | | | | | | | | | | | Add new enum motionsensor_chip and update ectool motionsense. BUG=chromium:1117541 BRANCH=None TEST=ectool motionsense info Cq-Depend: chromium:2317888 Signed-off-by: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com> Change-Id: I07736d61bdb7332bfdc44c8f7294233e43a6e00d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2374647 Reviewed-by: Gwendal Grignou <gwendal@chromium.org> Commit-Queue: Gwendal Grignou <gwendal@chromium.org> Tested-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2383916 Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org> Tested-by: Edward Hill <ecgh@chromium.org>
* driver: add ICM-426xx driver supportJean-Baptiste Maneyrol2020-08-297-0/+1729
| | | | | | | | | | | | | | | | | | | Add ICM-426xx accel/gyro driver code. BUG=chromium:1117541 BRANCH=None TEST=ectool motionsense fifo_read && tast run hardware.SensorRing Signed-off-by: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com> Change-Id: I83fe48abc6aa9cde86576a777ac4272d90fac597 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2317888 Reviewed-by: Gwendal Grignou <gwendal@chromium.org> Commit-Queue: Gwendal Grignou <gwendal@chromium.org> Tested-by: Gwendal Grignou <gwendal@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2383915 Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org> Tested-by: Edward Hill <ecgh@chromium.org>
* sm5803: Configure BFET alertsAseda Aboagye2020-08-292-8/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The SM5803 has the capability to monitor to the power burnt across the BFET. There are two thresholds that can be configured: an early threshold, and a fatal threshold in which the charger automatically disables the BFET. This commit configures the BFET alerts to fire at 1.5W for the early threshold and 6.5W for the fatal threshold. The full scale is 7.5W, the lsb is 7.5W/256 ~= 29.2mW. BUG=b:159376384 BRANCH=None TEST=Build and flash waddledee, charge from sub board, verify that no alerts are seen. TEST=Configure the thresholds significantly lower, charge from sub board, verify that the alerts do fire and logging information is printed on the EC console. Signed-off-by: Aseda Aboagye <aaboagye@google.com> Change-Id: I17b3876bc5ed4b41d2378600a8b8bf639f9757ce Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2380404 Tested-by: Aseda Aboagye <aaboagye@chromium.org> Auto-Submit: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: David Schneider <dnschneid@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org> Commit-Queue: Diana Z <dzigterman@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2383914 Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org> Tested-by: Edward Hill <ecgh@chromium.org>
* eve: Check physical battery presence before inhibiting powerDuncan Laurie2020-08-291-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In order to satisfy factory testing requirements we need to boot a bare board with just an AC adapter without requiring a power button. However we also don't want to always allow booting of the battery is present but cut-off (which will indicate BP_NO so we can't use the existing battery_is_present function) or has critically low level as it may not immediately boot. To accomplish this add a function that allows the board to specify a custom "hardware presence" for the battery that is separate from the battery presence check. This could also likely be accomplished by adding another state to "enum battery_present" but that could alter other behavior in the current charge state machine.. BUG=b:63957122 BRANCH=eve TEST=manual testing on Eve to ensure a board without a battery is allowed to power-up when power is first applied without requiring a power button press. Also ensure that a critically low or cut-off battery that does not try to immediately power up. Change-Id: Ia7c6b5ad5043aab15dbc99be7816353d6b92e720 Signed-off-by: Duncan Laurie <dlaurie@google.com> Reviewed-on: https://chromium-review.googlesource.com/582544 Reviewed-by: Furquan Shaikh <furquan@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2320004 Tested-by: Patryk Duda <pdk@semihalf.com> Commit-Queue: Patryk Duda <pdk@semihalf.com> Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2383913 Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org> Tested-by: Edward Hill <ecgh@chromium.org>
* ezkinil/woomax: Fix HDMI DATA_EN for OPT3 DBEdward Hill2020-08-292-4/+4
| | | | | | | | | | | | | | | | Fix mistake in CL:2375803. HDMI_DATA_EN_DB is needed for MST hub on OPT3 DB, in addition to pi3hdx1204 retimer on OPT1 DB. BUG=b:158266701 BRANCH=zork TEST=none Signed-off-by: Edward Hill <ecgh@chromium.org> Change-Id: Ie97f6a59628177542b890bcd4327df1e0ffdc083 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2382631 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Commit-Queue: Denis Brockus <dbrockus@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2383912
* TCPMv2: Send SOP'/SOP'' VDM only when the port is VCONN srcAyushee2020-08-293-3/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | According to USB PD spec, section 2.5.4, only VCONN source can communicate with the cable plug. This CL checks if the port is the VCONN before sending SOP'/SOP'' messages. If there is a VCONN source failure, port retries swapping the VCONN times before marking the VDM as failed/naked. The CL also enables falling back to DP mode in case enter mode thunderbolt fails. BUG=b:148528713 BRANCH=None TEST=Tested on volteer, the port sends SOP'/SOP'' VDMs to the cable only if it's the VCONN source Signed-off-by: Ayushee <ayushee.shah@intel.com> Change-Id: I5880104a7a42b3e7de9e472affd41e937d36f9a5 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2368066 Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2383911 Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org> Tested-by: Edward Hill <ecgh@chromium.org>
* morphius: fix HDMI_DATA_EN_DB on daliZick Wei2020-08-291-2/+3
| | | | | | | | | | | | | | | | | | | This patch fix HDMI_DATA_EN_DB not power on dali sku, which will cause MST hub not powered. BUG=b:150278507 BRANCH=zork TEST=verify MST hub work in S0 on dali sku. verify HDMI work in S0 on picasso sku. Signed-off-by: Zick Wei <zick.wei@quanta.corp-partner.google.com> Change-Id: Iebd7c610d71efde9dbb3d66d7405f1334084ce97 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2379363 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2383910 Tested-by: Edward Hill <ecgh@chromium.org>
* TCPMv2: set VDM response buffer and lengthli feng2020-08-292-13/+38
| | | | | | | | | | | | | | | | | | | | | | | Pass tx_emsg[port].buf to VDM response implementation functions Convert data objects count to bytes VDM header in VDM response message should not use USB_VID_GOOGLE as SVID to respond to all requests. Save SVID from received request and compose response VDM header with this SVID. BUG=b:148528713,b:157163664 BRANCH=none TEST=Connect volteer to Gatkex DFP port, with CL:2370045, check VDM response messages from Volteer have correct contents. Signed-off-by: li feng <li1.feng@intel.com> Change-Id: I7403af1449abfa4ebf6b43ded457e3654396aadb Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2368067 Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2383909 Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org> Tested-by: Edward Hill <ecgh@chromium.org>
* berknip: fix HDMI_DATA_EN_DB on daliZick Wei2020-08-291-2/+4
| | | | | | | | | | | | | | | | | | | This patch fix HDMI_DATA_EN_DB not power on dali sku, which will cause MST hub not powered. BUG=b:152841287 BRANCH=zork TEST=verify MST hub work in S0 on dali sku. verify HDMI work in S0 on picasso sku. Signed-off-by: Zick Wei <zick.wei@quanta.corp-partner.google.com> Change-Id: I09177fc04d8255f84c4cd193404f5285d89979ff Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2379366 Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2383908 Tested-by: Edward Hill <ecgh@chromium.org>
* willow: Support new battery AP19B5KDavid Huang2020-08-292-0/+28
| | | | | | | | | | | | | | | | | | Add new battery config : AP19B5K. BUG=b:166226645 BRANCH=master TEST=Check found battery info in console and cutoff work. Signed-off-by: David Huang <david.huang@quanta.corp-partner.google.com> Change-Id: Ia22673f016b7cf5a581a40039113969b56b29089 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2379357 Reviewed-by: Zhuohao Lee <zhuohao@chromium.org> Commit-Queue: Zhuohao Lee <zhuohao@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2383907 Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org> Tested-by: Edward Hill <ecgh@chromium.org>
* voxel: support TBT/USB4 for C0/C1 portBen Chen2020-08-291-26/+0
| | | | | | | | | | | | | | | | | support TBT/USB4 with all typeC port BUG=b:162376062 BRANCH=none TEST=checking with TBT is working on USB-C0/C1 at Gen3 speed Change-Id: Ia9f3854d9319ff1c28167759622b3ba4b810372d Signed-off-by: Ben Chen <ben.chen2@quanta.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2377047 Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2383906 Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org> Tested-by: Edward Hill <ecgh@chromium.org>
* asurada: keep PP5000_A on at G3Ting Shen2020-08-293-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | In current EC implementation, EC turns off PP5000_A in G3. Since PPC is powered by PP5000_A, it needs special logic to handle the re-power and re-initialization. See b:154775121 for more discussion. To simplify the logic, change the behavior to turn PP5000_A off only when hibernate, so we won't need to worry about re-initialize PPC anymore (resume from hibernate is a reboot, so it's also covered here). BUG=b:154775121 TEST=1) Run the test script in CL:2169443 2) Verify PD is functional whenever EC is awake. BRANCH=none Signed-off-by: Ting Shen <phoenixshen@google.com> Change-Id: I07c03f9a8c0b77012d1284a283ce489e54b1a058 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2378940 Reviewed-by: Nicolas Boichat <drinkcat@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Tested-by: Ting Shen <phoenixshen@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2383905 Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org> Tested-by: Edward Hill <ecgh@chromium.org>
* jacuzzi: remove ADC_BATT_IDTing Shen2020-08-2918-18/+0
| | | | | | | | | | | | | | | | | | | | | ADC_BATT_ID is reassigned to BATT_PRES in Jacuzzi families. Remove it from source code to prevent people using it. BRANCH=kukui BUG=none TEST=make buildall Signed-off-by: Ting Shen <phoenixshen@google.com> Change-Id: I213b502413642c9bfff99443180ddb43debb2463 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2380842 Tested-by: Ting Shen <phoenixshen@chromium.org> Auto-Submit: Ting Shen <phoenixshen@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org> Commit-Queue: Nicolas Boichat <drinkcat@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2383904 Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org> Tested-by: Edward Hill <ecgh@chromium.org>
* driver/it83xx, it8xxx2.c: add auto toggle optionRuibin Chang2020-08-292-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | ITE embedded TCPC doesn't support HW auto toggle, but stand alone TCPC needs the config, so I let function pointer point to NULL, then this port won't transit to TC_DRP_AUTO_TOGGLE state, if CONFIG_USB_PD_DUAL_ROLE_AUTO_TOGGLE is defined. BUG=none BRANCH=none TEST=on board drawcia and it81202_pdevb: When CONFIG_USB_PD_DUAL_ROLE_AUTO_TOGGLE is defined, ITE ports cc are toggled by TCPM switch unattach.SNK/SRC state in TCPMv2. Signed-off-by: Ruibin Chang <ruibin.chang@ite.com.tw> Change-Id: I5c6cd337c7e91c4af7d408d5e631dc74d71de77a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2366417 Commit-Queue: Ruibin Chang <Ruibin.Chang@ite.com.tw> Tested-by: Ruibin Chang <Ruibin.Chang@ite.com.tw> Reviewed-by: Diana Z <dzigterman@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2383903 Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org> Tested-by: Edward Hill <ecgh@chromium.org>
* TCPMv2: handle un- and supported auto toggle TCPCRuibin Chang2020-08-291-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This CL changes for both unsupported and supported auto toggle TCPC on a board: 1.board level enable CONFIG_USB_PD_TCPC_LOW_POWER: Exit LPM state for unsupported auto toggle TCPC port, when drp state is TOGGLE_ON in S0. 2.board level enable CONFIG_USB_PD_DUAL_ROLE_AUTO_TOGGLE: Don't transit to TC_DRP_AUTO_TOGGLE state for unsupported auto toggle TCPC port. BUG=none BRANCH=none TEST=on board drawcia, check unsupported auto toggle TCPC port: 1.connect with adapter/dongle, pd state to SNK/SRC_Ready during G3 -> S0. 2.shut down to G3, connect with adapter and pd state to SNK_Ready. Signed-off-by: Ruibin Chang <ruibin.chang@ite.com.tw> Change-Id: Ic6afc84df1564b2cb19a9032bba0752091cbf7a0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2362371 Tested-by: Ruibin Chang <Ruibin.Chang@ite.com.tw> Reviewed-by: Diana Z <dzigterman@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org> Commit-Queue: Ruibin Chang <Ruibin.Chang@ite.com.tw> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2383902 Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org> Tested-by: Edward Hill <ecgh@chromium.org>
* halvor: implement LED behaviorSamsp_Liu2020-08-293-84/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On halvor, we have a LED indicator with following: Power LED: System S0: White. System S3: Blinking white (1 sec on, 1 sec off) System S5/G3: Off. Battery LED: DC mode: System S0: off. System S5/G3: Off. System battery low: Blinking Amber (1 sec on, 1 sec off) AC mode: Charging: Amber. Full charged: White. BUG=b/166057836 BRANCH=none TEST=halvor test 1. Check battery LED on full charging / charging / discharging. 2. Check power LED on s0 / suspend / s5. 3. Check "ectool led" command for battery and power LED control. 4. Check battery LED on low battery state. Change-Id: Ie6d6661c2b249336798099679635682e43aff5f3 Signed-off-by: Samsp_Liu <Samsp_Liu@compal.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2366418 Tested-by: SamSP Liu <samsp_liu@compal.corp-partner.google.com> Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Commit-Queue: SamSP Liu <samsp_liu@compal.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2383901 Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org> Tested-by: Edward Hill <ecgh@chromium.org>
* driver: bmi160: Read only the first 2 bytes of the interrupt fieldGwendal Grignou2020-08-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The remaining 2 are qualifier for single/double tap we are not interested in. They are not reset to 0 even after we process the interrupt, so when gesture is enabled, we are stuck in the interrupt routine for a while. BMI260 does not have this problem as the interrupt register is now explicitly 16 bit. Gesture is currently enabled on eve that does not have the loop on interrupt, so no other branch than ToT is affected. BUG=b:164974014 BRANCH=none TEST=Without, we would be stuck in bmi160 irq_hanlder: (timestamp of int) (interrupt mask) ... [5064.237873 a hw int: 769270447 - 2 0x00C00000] [5064.238989 a hw int: 769270447 - 2 0x00C04000] [5064.241277 a hw int: 769270447 - 2 0x00C00000] [5064.242397 a hw int: 769270447 - 2 0x00C00000] [5064.243527 a hw int: 769270447 - 2 0x00C00000] [5064.244647 a hw int: 769270447 - 2 0x00C00000] [5064.246419 a hw int: 769270447 - 2 0x00C00000] ... / Qualifier -----/ Signed-off-by: Gwendal Grignou <gwendal@chromium.org> Change-Id: I2c8fd354eddfa412f644555dcdcdb77708a9e3c7 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2370152 Reviewed-by: Patryk Duda <pdk@semihalf.com> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: Patryk Duda <pdk@semihalf.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2383900 Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org> Tested-by: Edward Hill <ecgh@chromium.org>
* iteflash: Reset EC's GPIOs while flashingDino Li2020-08-291-4/+64
| | | | | | | | | | | | | | | | | BUG=b:161957387 BRANCH=none TEST=- EC's GPIOs go back to default while flashing (No power rails are turned on). - EC will be only reset once after flashing. Change-Id: I776da7f5052219df18d570f23fb7fab93583c7fa Signed-off-by: Dino Li <Dino.Li@ite.com.tw> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1270299 Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2383899 Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org> Tested-by: Edward Hill <ecgh@chromium.org>
* eve: Cut off critically low batteryDuncan Laurie2020-08-291-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of going to hibernate when the battery is critically low we should cut off power entirely. Even with the PMIC shut down the H1 chip consumes more power than is healthy when the battery is already critically low, depleting it to dangerously low voltage levels faster than it should. BUG=b:63957122 BRANCH=eve TEST=manual testing on Eve with critically low battery to ensure that it is cut off instead of going into hibernate. Change-Id: I2eaba3623385a4eb3daa39a2fa8aa08d3ec6366e Signed-off-by: Duncan Laurie <dlaurie@google.com> Reviewed-on: https://chromium-review.googlesource.com/582543 Reviewed-by: Furquan Shaikh <furquan@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2320003 Tested-by: Patryk Duda <pdk@semihalf.com> Reviewed-by: Jett Rink <jettrink@chromium.org> Commit-Queue: Patryk Duda <pdk@semihalf.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2383898 Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org> Tested-by: Edward Hill <ecgh@chromium.org>
* it83xx/system: Don't disable DBGR in system resetDino Li2020-08-292-9/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | Our current implementation will disable DBGR (debug mode) in system reset, but this will break flashing sequence. So we make a change to ensure flashing won't be broken under the above situation. Note: DBGR is only applied to flashing sequence, a HW reset after flashing will disable DBGR and allow normal system reset. We also enable wait flashing sequence in this CL, so EC can check if there’s a DBGR flag during initialization and proceed afterwards. BUG=b:118584434, b:165515400 BRANCH=none TEST=- The soft reset still works after flashing. - EC can be flashed even if it is in continuous reboot loop. Change-Id: I9cea2c4fef74de7afcffb203e02f79cb18a4c5bf Signed-off-by: Dino Li <Dino.Li@ite.com.tw> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1243878 Reviewed-by: Jett Rink <jettrink@chromium.org> Commit-Queue: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2383897 Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org> Tested-by: Edward Hill <ecgh@chromium.org>
* Dedede: Clean up chg_chip referencesDiana Z2020-08-294-10/+8
| | | | | | | | | | | | | | | | | | Now that the charger_* interfaces take charge indexes appropriately, clean up the board code to no longer use chg_chip structure directly. BRANCH=None BUG=b:147440290 TEST=on drawlat, confirm sourcing out on both ports works Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I92925e487f90bc3965b868f3f7fc0d3175dc3df9 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2376470 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2383896 Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org> Tested-by: Edward Hill <ecgh@chromium.org>
* Charger: Add chgnum parameter to OTG set functionsDiana Z2020-08-297-20/+29
| | | | | | | | | | | | | | | | | | | | Add the charger number as an input for setting OTG output current and enabling it, both in the charger driver and in charge_set_output_current_limit(). Also add a clarifying note about the intent of CHARGER_SOLO. BRANCH=None BUG=b:147440290 TEST=make -j buildall Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: I7656c19a87d8216f5efc72dcffa6d638064d3e2f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2376469 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2383895 Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org> Tested-by: Edward Hill <ecgh@chromium.org>
* OCPC: Assume port == chgnum when checking OTGDiana Z2020-08-291-0/+3
| | | | | | | | | | | | | | | | | | | Since OCPC has one charger chip per port, it can be assumed in the charger_is_sourcing_otg_power() function that the port will be the same as the charger number with this config enabled. BRANCH=None BUG=b:147440290 TEST=make -j buildall Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: Iff5130e9ac7c268d38fe75eb3eb1c9ea5864abd4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2376468 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2383894 Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org> Tested-by: Edward Hill <ecgh@chromium.org>
* system_is_locked: Use static variable to track stateDuncan Laurie2020-08-291-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When CONFIG_SYSTEM_UNLOCKED is not defined the function to check if flash is write protected (flash_get_protect()) can take up to 7ms to execute, and this function is called up to 18 times when booting from RO. Use a static variable to track the status so we do not spend so long executing this one function. Without this change I would regularly see a PD hard reset when booting without a battery and the system would fail to boot. BUG=b:63957122 BRANCH=eve TEST=manual testing to reliably boot without a battery on Eve Change-Id: I806a215b5745b41ce0d99aeb6853ebfecb0cb7d1 Signed-off-by: Duncan Laurie <dlaurie@google.com> Reviewed-on: https://chromium-review.googlesource.com/582542 Reviewed-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Furquan Shaikh <furquan@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2320002 Tested-by: Patryk Duda <pdk@semihalf.com> Reviewed-by: Jett Rink <jettrink@chromium.org> Commit-Queue: Patryk Duda <pdk@semihalf.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2383893 Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org> Tested-by: Edward Hill <ecgh@chromium.org>
* eve: Enable USB_PD_COMM_LOCKEDDuncan Laurie2020-08-291-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Removing CONFIG_SYSTEM_UNLOCKED is not enough to lock down PD communication in RO when the system is write protected, this option must also be enabled. BUG=b:63957122 BRANCH=eve TEST=manual testing with WP enabled system to ensure that it does not do PD negotiation in RO Change-Id: I8fbfaa0a3fb2d97b9484688ed6767bf70e8f4759 Signed-off-by: Duncan Laurie <dlaurie@google.com> Reviewed-on: https://chromium-review.googlesource.com/582541 Reviewed-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Furquan Shaikh <furquan@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2320001 Tested-by: Patryk Duda <pdk@semihalf.com> Reviewed-by: Jett Rink <jettrink@chromium.org> Commit-Queue: Patryk Duda <pdk@semihalf.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2383892 Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org> Tested-by: Edward Hill <ecgh@chromium.org>
* eve: Set minimum battery percentage for booting to 2%Duncan Laurie2020-08-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | With a battery that has 1% charge there may not be enough to boot the AP, resulting in a brown-out. Raise this to 2% to get more consistent behavior to let the battery charge before booting. BUG=b:63957122 BRANCH=eve TEST=manual testing with depleted batteries to ensure that the AP does not boot until it has 2% charge Change-Id: I7e64925c480993d37754cd51a1dd24fcdc7ba2ec Signed-off-by: Duncan Laurie <dlaurie@google.com> Reviewed-on: https://chromium-review.googlesource.com/582540 Reviewed-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Furquan Shaikh <furquan@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2320000 Tested-by: Patryk Duda <pdk@semihalf.com> Reviewed-by: Jett Rink <jettrink@chromium.org> Commit-Queue: Patryk Duda <pdk@semihalf.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2383891 Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org> Tested-by: Edward Hill <ecgh@chromium.org>
* asurada: rev1: update sensor rotation matrixTing Shen2020-08-291-3/+15
| | | | | | | | | | | | | | | | | BUG=none TEST=`accelinfo on`, verify lid angle looks reasonable BRANCH=none Signed-off-by: Ting Shen <phoenixshen@google.com> Change-Id: I0cba0594797bb30492a295f20ad1198a545b6ee5 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2378768 Tested-by: Ting Shen <phoenixshen@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org> Commit-Queue: Ting Shen <phoenixshen@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2383890 Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org> Tested-by: Edward Hill <ecgh@chromium.org>
* Puff: Restore VBUS (if sourcing) upon CPU startAndrew McRae2020-08-291-0/+16
| | | | | | | | | | | | | | | | | | | | | The PPC (sn5s330) internally disables PP1 if the source drops, so upon CPU restart when the rail is up, check whether we are sourcing VBUS and re-enable it if necessary. BUG=b:161963268 TEST=Run firmware_FwScreenPressPower test and monitor VBUS via twinkie. BRANCH=none Signed-off-by: Andrew McRae <amcrae@google.com> Change-Id: Ibe1c2151526ac1c20690e1891272efbb811f3d8c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2377063 Reviewed-by: Peter Marheine <pmarheine@chromium.org> Commit-Queue: Andrew McRae <amcrae@chromium.org> Tested-by: Andrew McRae <amcrae@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2383789 Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org> Tested-by: Edward Hill <ecgh@chromium.org>
* volteer: Support board-specific TCPC configSamsp_Liu2020-08-2624-145/+1467
| | | | | | | | | | | | | | | | | | | | | | Separate tcpc_config from volteer baseboard to each project board. To meet different configurations on each board. BUG=b:153705222 BRANCH=none TEST=make buildall Change-Id: Iea59518123a542ebe38be195eaf71b4a8f796550 Signed-off-by: Samsp_Liu <Samsp_Liu@compal.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2342183 Tested-by: SamSP Liu <samsp_liu@compal.corp-partner.google.com> Commit-Queue: Keith Short <keithshort@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2378964 Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org> Tested-by: Edward Hill <ecgh@chromium.org>
* SM5803: Improve flow control settingDiana Z2020-08-266-187/+180
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change adds a new Vbus sink enable command which will be called on initial sink connection and detach. This will separate out most of the FLOW1 and FLOW2 register control from the set_mode() driver API which is regularly called from the charger task. This means that, if charging on a port fails, the charging will no longer be automatically re-enabled by the charger task. Additionally, this folds the verification that we aren't disabling sourcing into the sink enable so board files no longer need to verify this before calling the sink enable/disable API. It also allows the OTG disable to fully clear the FLOW1 mode since calls to OTG are more targeted than the sink enable/disable, which happens any time another charge port is set. BRANCH=None BUG=b:163511546,b:165677311 TEST=on waddledee and drawlat, confirm expected FLOW1 contents and Vbus level: - sinking C0 or C1 - sourcing C0 or C1 - sourcing both C0 and C1 - sinking C0 while sourcing C1 - sinking C1 while sourcing C0 - battery cutoff with charger in C0 or C1 - no battery boot with charger in C0 or C1 - power role swap with HooToo hub in C0 and C1 Signed-off-by: Diana Z <dzigterman@chromium.org> Change-Id: Ifdc7786243bdf0a634d8db99b4deb53457232ad3 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2372738 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2378963 Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org> Tested-by: Edward Hill <ecgh@chromium.org>
* eve: Remove the LIMIT_POWER config optionsDuncan Laurie2020-08-261-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | These config options change the behavior of charge_prevent_power_on and ignore the minimum battery percentage for booting. Since we do not have any AP code to actually handle this state we don't want it to always boot the AP or it might brown out with a battery that is critically low. BUG=b:63957122 BRANCH=eve TEST=manual testing with low battery to ensure it does not always attempt to boot the AP. Change-Id: Ic7be3f4d07570e00ea3afa1124af083da0e789c3 Signed-off-by: Duncan Laurie <dlaurie@google.com> Reviewed-on: https://chromium-review.googlesource.com/582539 Reviewed-by: Furquan Shaikh <furquan@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2319999 Tested-by: Patryk Duda <pdk@semihalf.com> Reviewed-by: Jett Rink <jettrink@chromium.org> Commit-Queue: Patryk Duda <pdk@semihalf.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2378962 Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org> Tested-by: Edward Hill <ecgh@chromium.org>
* util/ide-config.sh: Bump C standard to C18Craig Hesling2020-08-261-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | Enable C18 syntax in vscode cpptools. This is important because we use some backward incompatible c18 syntax in EC. This syntax is not properly recognized when c11 mode is used. VSCode CPPTools now supports C18. https://github.com/microsoft/vscode-cpptools/releases/tag/0.28.0 BRANCH=none BUG=none TEST=none Signed-off-by: Craig Hesling <hesling@chromium.org> Change-Id: I3e508f6d0e121e872476ca32db89d6abbbc8ff6c Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2218458 Commit-Queue: Jett Rink <jettrink@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2378961 Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org> Tested-by: Edward Hill <ecgh@chromium.org>
* TBT: Update the TBT3 Compatibility ECN info published by USB-IFVijay Hiremath2020-08-261-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | This CL updates the TBT3 VDO table with the TBT3 Compatibility ECN info published by USB-IF. In the "Universal Serial Bus Type-C Cable and Connector Specification Release 2.0, August 2019" document, Table F-10 TBT3 Device Discover Mode VDO Responses B16 - TBT2 Legacy Adapter & TBT3 Adapter are swapped Correct information is published in the USB Type-C ENGINEERING CHANGE NOTICE (ECN) document "USB Type-C ECN Thunderbolt 3 Compatibility Updates.pdf" with the Title: Thunderbolt 3 Compatibility Updates. BUG=b:147375157 BRANCH=none TEST=make buildall -j Change-Id: If619db58a97b7bfed71c105395ba5b8063d066cd Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2373325 Reviewed-by: Ayushee Shah <ayushee.shah@intel.com> Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: Keith Short <keithshort@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2378960 Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org> Tested-by: Edward Hill <ecgh@chromium.org>
* eve: Remove CONFIG_BATTERY_REVIVE_DISCONNECTDuncan Laurie2020-08-262-50/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since Eve has a custom battery presence function we do not need the disconnect behavior as it will recover better by letting the state machine handle it with precharge directly. Without this change I would sometimes see the first boot after a cut-off battery get stuck with "battery found in disconnect state" and not able to boot up the AP. BUG=b:63957122 BRANCH=eve TEST=manual testing on Eve with cut-off batteries shows more consistent behavior to boot the AP after plugging in adapter. Change-Id: I2d115788c1f9f6171a01525970285abb9f3467a2 Signed-off-by: Duncan Laurie <dlaurie@google.com> Reviewed-on: https://chromium-review.googlesource.com/582538 Reviewed-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Furquan Shaikh <furquan@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2319998 Tested-by: Patryk Duda <pdk@semihalf.com> Reviewed-by: Jett Rink <jettrink@chromium.org> Commit-Queue: Patryk Duda <pdk@semihalf.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2378959 Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org> Tested-by: Edward Hill <ecgh@chromium.org>
* Halvor: Configure unused GPIOs as inputsSamsp_Liu2020-08-261-1/+6
| | | | | | | | | | | | | | | | | | | Configure unused GPIOs as inputs to save power in deep sleep states. BUG=b:162591141 BRANCH=none TEST=havlor test Change-Id: I68e7c11d4de433c01f167e23e3a79a0cc67663ea Signed-off-by: Samsp_Liu <Samsp_Liu@compal.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2334438 Tested-by: SamSP Liu <samsp_liu@compal.corp-partner.google.com> Reviewed-by: Keith Short <keithshort@chromium.org> Commit-Queue: SamSP Liu <samsp_liu@compal.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2378958 Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org> Tested-by: Edward Hill <ecgh@chromium.org>
* Halvor: Update Power ParameterSamsp_Liu2020-08-261-3/+3
| | | | | | | | | | | | | | | | | | | | This patch makes EC configure power parameters BUG=b:159282888 BRANCH=none TEST=halvor test Change-Id: I3e890218e64811273ef393dcdf56f0eb2d045be6 Signed-off-by: Samsp_Liu <Samsp_Liu@compal.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2348240 Reviewed-by: SamSP Liu <samsp_liu@compal.corp-partner.google.com> Reviewed-by: Keith Short <keithshort@chromium.org> Tested-by: SamSP Liu <samsp_liu@compal.corp-partner.google.com> Commit-Queue: SamSP Liu <samsp_liu@compal.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2378957 Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org> Tested-by: Edward Hill <ecgh@chromium.org>
* volteer: Support board-specific currentSamsp_Liu2020-08-2612-2/+44
| | | | | | | | | | | | | | | | | | | | | | | Separate CONFIG_CHARGER_SENSE_RESISTOR and CONFIG_CHARGER_SENSE_RESISTOR_AC from volteer baseboard to each project board. To meet different configurations on each board. BUG=b:158257062 BRANCH=none TEST=make buildall Change-Id: Ib8290bd54d45054b82d7849e84119d419cbc8586 Signed-off-by: Samsp_Liu <Samsp_Liu@compal.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2346088 Tested-by: SamSP Liu <samsp_liu@compal.corp-partner.google.com> Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Commit-Queue: SamSP Liu <samsp_liu@compal.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2378956 Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org> Tested-by: Edward Hill <ecgh@chromium.org>
* Halvor: Implement new battery parameterSamsp_Liu2020-08-262-16/+17
| | | | | | | | | | | | | | | | | | | | | | | Halvor support AEC new battery. This patch makes EC configure battery parameters differently based on manufacturer name. BUG=b:162908664 BRANCH=none TEST=Verify AEC battery can charge/discharge/cutoff. Change-Id: I65fb9ab5ae0d13393d649d0a16f9fa714f9122b7 Signed-off-by: Samsp_Liu <Samsp_Liu@compal.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2224682 Tested-by: SamSP Liu <samsp_liu@compal.corp-partner.google.com> Reviewed-by: SamSP Liu <samsp_liu@compal.corp-partner.google.com> Reviewed-by: Keith Short <keithshort@chromium.org> Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Commit-Queue: SamSP Liu <samsp_liu@compal.corp-partner.google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2378955 Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org> Tested-by: Edward Hill <ecgh@chromium.org>
* chip/mt8192_scp: do not handle pending IPI interruptsTzung-Bi Shih2020-08-261-7/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | No need to handle pending IPI interrupts. Reasons: - Interrupts are level trigger in MT8192 SCP. As long as the source interrupts persist, RV33 handles them eventually. - task_trigger_irq() fires an additional GIPC_IN0 IRQ. The former one will clear the interrupt source by writing GIPC_IN_CLR. When the latter one is handling, RV33 crashed due to it cannot find the corresponding interrupt source. BRANCH=none BUG=b:163682416 TEST=1. cat - <<EOF >test.sh echo stop >/sys/class/remoteproc/remoteproc0/state while :; do dmesg -C echo start >/sys/class/remoteproc/remoteproc0/state sleep 1 if dmesg | grep -q 'rpmsg send timeout'; then break fi echo stop >/sys/class/remoteproc/remoteproc0/state done echo stop >/sys/class/remoteproc/remoteproc0/state EOF 2. sh test.sh Signed-off-by: Tzung-Bi Shih <tzungbi@chromium.org> Change-Id: I2cc89a258a4ce218389799bbe1101ffc1375af8a Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2373846 Reviewed-by: Ting Shen <phoenixshen@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2378954 Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org> Tested-by: Edward Hill <ecgh@chromium.org>
* chip/mt8192_scp: do not switch INTC_IRQ_EN in runtimeTzung-Bi Shih2020-08-261-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MT8192 SCP's interrupt handling is a long path. +----------+ +----------+ +----------+ | INTC | ---> | GVIC | ---> | RV33 | +----------+ +----------+ +----------+ ^ ^ ^ ^ INTC_IRQ_EN VIC_EN MIMASK mie When turning off INTC_IRQ_EN, it is possible GVIC has already latched the interrupt. As a result, RV33 receives the spurious interrupt. MT8192 SCP has no effective way to clear the unwanted interrupt. Thus, do not switch INTC_IRQ_EN in runtime. Disable all interrupts (via mie) instead. BRANCH=none BUG=b:163682416 TEST=1. cat - <<EOF >test.sh echo stop >/sys/class/remoteproc/remoteproc0/state while :; do dmesg -C echo start >/sys/class/remoteproc/remoteproc0/state sleep 1 if dmesg | grep -q 'rpmsg send timeout'; then break fi echo stop >/sys/class/remoteproc/remoteproc0/state done echo stop >/sys/class/remoteproc/remoteproc0/state EOF 2. sh test.sh Signed-off-by: Tzung-Bi Shih <tzungbi@chromium.org> Change-Id: I494330f8d00744c305be7beb19ca6b7084512a72 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2373845 Reviewed-by: Ting Shen <phoenixshen@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2378953 Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org> Tested-by: Edward Hill <ecgh@chromium.org>
* chip/mt8192_scp: add address location of MIEMASK_G0Tzung-Bi Shih2020-08-261-0/+1
| | | | | | | | | | | | | | | BRANCH=none BUG=b:163682416 TEST=make BOARD=asurada_scp Signed-off-by: Tzung-Bi Shih <tzungbi@chromium.org> Change-Id: I38e717a4a88d80a6c22ffd74b38904fa2e38fa73 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2352955 Reviewed-by: Ting Shen <phoenixshen@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2378952 Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org> Tested-by: Edward Hill <ecgh@chromium.org>
* morphius: eanble GMR sensor for tablet modeZick Wei2020-08-263-0/+13
| | | | | | | | | | | | | | | | BUG=b:150278507 BRANCH=none TEST=verify tablet mode work normally. Signed-off-by: Zick Wei <zick.wei@quanta.corp-partner.google.com> Change-Id: I95854bee2113d3fcd458aa6fee62b740858d4b40 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2359622 Reviewed-by: Devin Lu <Devin.Lu@quantatw.com> Reviewed-by: Denis Brockus <dbrockus@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2377828 Reviewed-by: Edward Hill <ecgh@chromium.org> Commit-Queue: Edward Hill <ecgh@chromium.org> Tested-by: Edward Hill <ecgh@chromium.org>