summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* ish/ish5: add console in use timeout mechanism in low power managmentstabilize-12121.BHu, Hebo2019-04-233-9/+62
| | | | | | | | | | | | | | | | | | | | | | | | on ISH, uart interrupt can only wakeup ISH from low power state via CTS pin, but most ISH platforms only have Rx and Tx pins, no CTS pin exposed, so, we need block ISH enter low power state for a while when console is in use. we have two default timeout values for this mechanism: 1: after ISH boot, have 15 seconds window can input console commands 2: refresh 60 seconds timeout for console use after each console input BUG=b:129246461 BRANCH=none TEST=verified on arcada platform Change-Id: Ic3bb33a7984e1bf55654403c76287617c8828daa Signed-off-by: Hu, Hebo <hebo.hu@intel.com> Reviewed-on: https://chromium-review.googlesource.com/1574375 Commit-Ready: Jack Rosenthal <jrosenth@chromium.org> Tested-by: Hebo Hu <hebo.hu@intel.corp-partner.google.com> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Mathew King <mathewk@chromium.org> Reviewed-by: Hebo Hu <hebo.hu@intel.corp-partner.google.com>
* mm8013: implement battery_serial_numberTing Shen2019-04-231-1/+2
| | | | | | | | | | | | | | | | Return ERROR_UNIMPLEMENTED causes "ectool battery" to fail. Need to return some dummy value. BUG=b:131034963 TEST=ectool battery BRANCH=None Change-Id: I66df131db3b532efd56afab87e97bb3def2fb01f Signed-off-by: Ting Shen <phoenixshen@google.com> Reviewed-on: https://chromium-review.googlesource.com/1575350 Commit-Ready: Ting Shen <phoenixshen@chromium.org> Tested-by: Ting Shen <phoenixshen@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* kukui: scp: move CPU clock selection to clock moduleRong Chang2019-04-232-2/+6
| | | | | | | | | | | | | | | | CPU clock management should be in clock module. BUG=b:120169529 BRANCH=none TEST=manual build and load on kukui, check SCP console command: > rw 0x405C4000 read 0x405c4000 = 0x00000803 Change-Id: Ic13e9a51cf682af33799b713849fd3a445e6cfdb Signed-off-by: Rong Chang <rongchang@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1538097 Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* kukui: scp: Set CPU clock to default before ULPOSC calibrationRong Chang2019-04-231-0/+1
| | | | | | | | | | | | | | | | | | ULPOSC 1 & 2 calibration may fail if SCP CPU clock selection is configured to one of them. The SCP reset mechanism does not reset the clock selection. So before calibration, set CPU to default clock. BUG=b:125695639 BRANCH=none TEST=manual build and load on kukui, check remoteproc init correctly. check SCP uart console command 'ulposc', output non-zero clocks. Change-Id: I6807017808a663f8e80363dc0672748ab1957978 Signed-off-by: Rong Chang <rongchang@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1538096 Reviewed-by: Yilun Lin <yllin@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* kohaku: Add missing GPIO declarationsTim Wawrzynczak2019-04-231-4/+29
| | | | | | | | | | | | | | | | | | | | | Removed fan and tach GPIOs. Added in some miscellaneous GPIO definitions, including: M2_SD_PLN (set as if it were NC for now) IMVP8_PE (set as if it were NC for now) LID_ACCEL_INT_L EC_PROCHOT_IN_OD TP* BUG=b:130577280 BRANCH=none TEST=Compiles (no Kohaku device to test on). Change-Id: Ic95d5f09c9533e30c3ee526a8e0cf30717c07f2d Signed-off-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1574700 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
* twinkie: update task event usageJett Rink2019-04-231-3/+3
| | | | | | | | | | | | | | | | | | | Update Twinkie's usage of events to make the cleanup of TASK_EVENT_CUSTOM easier. The sniffer task does not depend on an event numbers so I am removing one of the events since no one is using it (we just depend on the wake up) BRANCH=none BUG=none TEST=builds Change-Id: I9c6aed8a8553317f090ee3f090d7e066e0191e51 Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1572142 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Reviewed-by: Diana Z <dzigterman@chromium.org>
* cleanup: update TASK_EVENT_CUSTOM usageJett Rink2019-04-231-11/+10
| | | | | | | | | | | | | | | | | | The lightbar.c uses the TASK_EVENT_CUSTOM macro in a non-standard way comparing it to the rest of the code base. Update the style in preparation for changing the TASK_EVENT_CUSTOM macro to be a BUILD_CHECK_INLINE macro. Without this cleanup CL, this code breaks. BRANCH=none BUG=none TEST=builds Change-Id: I4fdbb35a2aeeb1f8718b22c017607aee5fa1730a Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1570606 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org>
* P9221: Add P9221 driverTony Zou2019-04-2211-17/+1227
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds P9221 driver and enable it for Flapjack. The driver originates from https://android.googlesource.com/kernel /msm/+/android-msm-bluecross-4.9-pie-qpr1/drivers/power/supply/qcom /p9221_charger.c CQ-DEPEND=CL:1445133 CL:1551583 BRANCH=none BUG=b:126162615 TEST=Verify charging from PD and WPC as follows: 1. Charge with PD charger. Place DUT on WPC charger. -> PD charger continues to charge. 2. Unplug PD charger. -> WPC starts charging as GPP. 3. Plug PD charger. -> PD charger starts charging at 2A@9V TEST=Verify OTG and WPC functionality as follows: 1. Plug fan to USB port: -> Fan spins 2. Place DUT on WPC charger: -> WPC starts charging as GPP. Fan continues to spin. 3. Remove DUT from WPC charger: -> Fan continues to spin. 4. Do 1 and 2 then unplug USB fan: -> WPC starts charging. TEST=/sys/class/power_supply/CROS_USBPD_CHARGER0/usb_type is BrickID /sys/class/power_supply/sbs-12-000b/status is ok Change-Id: I5fbd0237cedd8095f98582c39973d432e733f2cd Signed-off-by: Tony Zou <zoutao@huaqin.corp-partner.google.com> Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1448193 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
* kohaku: Add support for Rohm BH1733FVC ALSScott Collyer2019-04-222-18/+32
| | | | | | | | | | | | | | | | | Kohaku is not using the Rohm BH1733FVC ALS. This CL removes support for the OPT3001 and adds support for the BH1733FVC. BUG=b:130835790 BRANCH=none TEST=make -j BOARD=kohaku Change-Id: Ifc8d5f247b338057e4ec7f66f56f119fd5058613 Signed-off-by: Scott Collyer <scollyer@google.com> Reviewed-on: https://chromium-review.googlesource.com/1574660 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Reviewed-by: Furquan Shaikh <furquan@chromium.org>
* factory_mode: refactor factory_enable_failedMary Ruthven2019-04-221-17/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Refactor factory_enable_failed, so cr50 always resets if a reset is requested. This change also renames factory_enable_failed to be more specific. It renames ccd_hook_active to wait_for_factory_ccd_change so it's obvious what the variable is doing. It's waiting for the ccd_config change after we enable factory mode. Enabling factory mode can fail in a lot of ways, but by the time we called factory_enable_failed, the failure is specifically about saving the config. This change renames the function, so the failure is a bit more specific. If a reset is required, always reset the system even if saving the factory config failed. ccd_reset_factory_failed is triggered if the ccd changed hook isn't triggered quickly enough or if cr50 fails to save the ccd config. Cr50 has already wiped the TPM and has most likely saved some if not all of the factory mode state. Cr50 should still reset even if the config isn't saved to be safe. enable_ccd_factory_mode isn't used in the process to enable factory mode during init, so this change won't cause a cr50 reboot loop from cr50 trying and failing to enable factory mode during init. This only affects the RMA and factory mode enable vendor commands. BUG=b:129956462 BRANCH=cr50 TEST=Use rma and factory mode vendor commands to enable factory mode. Change-Id: Ib8a502297040296fb0a2250a9e8945af330d4334 Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1572450 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-by: Keith Short <keithshort@chromium.org>
* Bobba: Add new battery for Driod and BlorbSue Chen2019-04-222-0/+30
| | | | | | | | | | | | | | | new battery: Murata KT00304012 BUG=b:130615670 BRANCH=octopus TEST=shipping mode and charge parameters are all good. Signed-off-by: Sue Chen <sue.chen@quanta.corp-partner.google.com> Change-Id: Ic55f5aa8351184ca68fd539975822d8079ac03b4 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1564494 Reviewed-by: Sue Chen <sue.chen@quanta.corp-partner.google.com> Reviewed-by: Marco Chen <marcochen@chromium.org> Tested-by: Sue Chen <sue.chen@quanta.corp-partner.google.com>
* Octopus: support keyboard backlight for Droid/BlorbDavid Huang2019-04-222-0/+22
| | | | | | | | | | | | | | | Enable keyboard backlight control by PWM for Droid and Blorb. BUG=b:130330141 BRANCH=octopus TEST=Use console command "kblight 0-100" to check keyboard backlight works. Change-Id: I3b6ce8b622c5e90f6810ca4f50a4948b55fd61fa Signed-off-by: David Huang <David.Huang@quantatw.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1575349 Tested-by: Marco Chen <marcochen@chromium.org> Reviewed-by: Marco Chen <marcochen@chromium.org>
* Bobba: Add new battery for DriodSue Chen2019-04-202-0/+30
| | | | | | | | | | | | | | | new battery: LGC KT0030G020 BUG=b:130608940 BRANCH=octopus TEST=shipping mode and charge parameters are all good. Signed-off-by: Sue Chen <sue.chen@quanta.corp-partner.google.com> Change-Id: Ia07c10f12334412558565e3c0262f0503a45ab29 Reviewed-on: https://chromium-review.googlesource.com/1569089 Commit-Ready: Marco Chen <marcochen@chromium.org> Tested-by: Marco Chen <marcochen@chromium.org> Reviewed-by: Marco Chen <marcochen@chromium.org>
* ish: fix extra timer interruptHyungwoo Yang2019-04-201-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | currently we often clear timer interrupt status before the main counter gets increased. Due to this, HPET timer generates extra interrupt since the counter and the comparator have still the same value(?). This introduces wrong wall clock and some extra interrupts for events. ... [17178.756500 HC 0x67 err 9] [21476.327769 HC 0x67 err 9] <= extra interrupt changed wall clock ... [30051.881380 HC 0x67 err 9] [34363.588056 HC 0x67 err 9] <= extra interrupt changed wall clock ... [38653.530377 HC 0x67 err 9] [42961.575341 HC 0x67 err 9] <= extra interrupt changed wall clock This patch make sure there's no extra interrupt. BRANCH=none BUG=none TEST=Tested on Arcada platform Change-Id: Ia57f4f2e91b52f0466f248388643d997d60b3221 Signed-off-by: Hyungwoo Yang <hyungwoo.yang@intel.com> Reviewed-on: https://chromium-review.googlesource.com/1573199 Commit-Ready: Jack Rosenthal <jrosenth@chromium.org> Tested-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* ish/ish5: fix high frequent wakeup issue in low power modeHu, Hebo2019-04-204-0/+28
| | | | | | | | | | | | | | | | | | | | on ish, need fw clean fabric agent error status, otherwise will cause ish wakeup immediately after entered low power mode. this operaion has no impact for other functions. BUG=b:130193448 BRANCH=none TEST=verified on arcada platform Change-Id: Iecd85d1ab037aafa988d6c32ad47b51003913198 Signed-off-by: Hu, Hebo <hebo.hu@intel.com> Reviewed-on: https://chromium-review.googlesource.com/1563470 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Mathew King <mathewk@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Mathew King <mathewk@chromium.org> Reviewed-by: Hebo Hu <hebo.hu@intel.corp-partner.google.com>
* hatch/kohaku: Account for different bc1.2 chipsScott Collyer2019-04-207-14/+38
| | | | | | | | | | | | | | | | | This CL moves bc1.2 configuration from baseboard.c/.h to the board.c/.h files for hatch and kohaku. BUG=b:130197995 BRANCH=none TEST=make -j BOARD=hatch and make -j BOARD=kohaku both are successful Change-Id: I2aa44d37a7a1d23196a766c95c59737838e9e09f Signed-off-by: Scott Collyer <scollyer@google.com> Reviewed-on: https://chromium-review.googlesource.com/1574788 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Furquan Shaikh <furquan@chromium.org>
* max14637: Add config guard to is_chg_det_activatedScott Collyer2019-04-201-0/+2
| | | | | | | | | | | | | | | | | | | The function is_chg_det_activated() is only called if either CONFIG_CHARGE_RAMP_SW or CONFIG_CHARGE_RAMP_HW are defined. This function should be guarded by these same 2 config options. BUG=b:130197995 BRANCH=none TEST=Verfied that 'make -j BOARD=kohaku' builds successfully which does not have either RAMP_SW or RAMP_HW defined. Change-Id: I223f52413d9e4244d191fd40f0a0a0dd0a933ec2 Signed-off-by: Scott Collyer <scollyer@google.com> Reviewed-on: https://chromium-review.googlesource.com/1574787 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Furquan Shaikh <furquan@chromium.org>
* bloog: implement ledsDevin Lu2019-04-204-80/+156
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. bloog have two charging leds on left side and right side. each side have two colors amber and white. 2. bloog have a power led indicate to power state suspend/off. The led behavior define as following: 1. Charging led: led on with charging port active, other port is off. Charging: Amber. Discharging: Off. Battery Error: Blinking white (0.4 sec on, 0.4 sec off) Fuel < 10%: Blinking white on right side port (1 sec on, 1 sec off) Force idle for factory: Blinking amber (1 sec on, 1 sec off) 2. Power led: System is S0: White System is suspend/S0ix: Blinking white (1 sec on, 1 sec off) System is S5: Off BUG=b:126460269 BRANCH=none TEST=Make sure led behavior intended. Change-Id: I080b83e11c96d5dda6ef193679ad8f4d2935db19 Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Reviewed-on: https://chromium-review.googlesource.com/1557844 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Reviewed-by: Karthikeyan Ramasubramanian <kramasub@chromium.org> Reviewed-by: Marco Chen <marcochen@chromium.org>
* common: led_onoff_states: move forward baseboard led_state to common codeDevin Lu2019-04-2019-335/+18
| | | | | | | | | | | | | | | | | Now we have led_onoff_states instead of led_state of baseboard, to avoid duplicate file so move forward to common code. BUG=b:126460269 BRANCH=none TEST=make buildall -j, make sure led behavior on meep intended as well. Change-Id: I3adf20ebf2efd2f02b1ae101faf1c36f2f5ed454 Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Reviewed-on: https://chromium-review.googlesource.com/1556869 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Reviewed-by: Marco Chen <marcochen@chromium.org> Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org>
* common: led_onoff_states: add new LED state for fully charged in S5Devin Lu2019-04-202-3/+24
| | | | | | | | | | | | | | | | Synchronize with CL:1419477 to common/led_onoff_states. BUG=none BRANCH=none TEST=make buildall -j Change-Id: Ibb5d9150f03cb7a584d7439bc47d5b59de856502 Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Reviewed-on: https://chromium-review.googlesource.com/1556859 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Reviewed-by: Karthikeyan Ramasubramanian <kramasub@chromium.org> Reviewed-by: Marco Chen <marcochen@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org>
* bloog: add SKUID for convertibleDevin Lu2019-04-191-3/+7
| | | | | | | | | | | | | | BUG=b:129397770 BRANCH=octopus TEST=make sure seneors have initialled by those SKUs. Change-Id: I4ecfd45bd0495ad59f88f328d79c2c84adad4440 Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Reviewed-on: https://chromium-review.googlesource.com/1571145 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Marco Chen <marcochen@chromium.org> Reviewed-by: Marco Chen <marcochen@chromium.org> Reviewed-by: Justin TerAvest <teravest@chromium.org>
* ccd: make ccd open error more meaningfulMary Ruthven2019-04-191-2/+1
| | | | | | | | | | | | | | | | | | | | | Right now if 'ccd open' from the console fails, it pretty much always fails with "nopwd". This error is pretty meaningless, because you can't even set the password until you open ccd. This change suggests removing the battery or sending the open command from the AP in dev mode if ccd open fails. This error should help people remember their device needs to be in dev mode and open needs to be sent from the AP. BUG=b:73170050 BRANCH=cr50 TEST=try 'ccd open' from the console. Verify the error message is changed. Change-Id: I32ca72ed00e03e62d73942961137591dc69bc8fa Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1572156 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Reviewed-by: Randall Spangler <rspangler@chromium.org> Reviewed-by: Namyoon Woo <namyoon@chromium.org>
* fuzz: Define HIDE_EC_STDLIB in nvmem_tpm2_mock.Allen Webb2019-04-191-0/+1
| | | | | | | | | | | | | | | Since nvmem_tpm2_mock is linked outside of libec.a it needs to use the cstdlib version of memcpy so HIDE_EC_STDLIB needs to be defined prior to including any of the EC headers. BRANCH=none BUG=chromium:950310 TEST=TEST_UBSAN=y make -j host-cr50_fuzz Change-Id: I2d303ab1e8f493b4d4715c36f6e81592eeca246d Signed-off-by: Allen Webb <allenwebb@google.com> Reviewed-on: https://chromium-review.googlesource.com/1566654 Reviewed-by: Manoj Gupta <manojgupta@chromium.org>
* Flapjack: Use PWM mode of MT6370 to control LED brightnessDaisuke Nojiri2019-04-191-15/+33
| | | | | | | | | | | | | | | | | | | This patch makes EC use the PWM mode of MT6370 to control the brightness of the LEDs. This makes the colors match the requirements. Current is fixed at 4mA. Brightness is controlled by PWM duty only. Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> BUG=b/130197491 BRANCH=none TEST=Verify the colors (amber, off, red, white) match the description. Change-Id: Iacce4cc75af9b278ef77dcb2ececaf67a7631143 Reviewed-on: https://chromium-review.googlesource.com/1572452 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* common/usbc_ppc: Fix potential illegal memory access.Tim Wawrzynczak2019-04-191-1/+3
| | | | | | | | | | | | | | | Recent coverity scan indicated a potential illegal memory access in ppc_enter_low_power_mode(). This patch fixes it. BUG=none BRANCH=none TEST=Compiled Change-Id: I0df1ca23340cd4466f8e71349b89ca1ab68aadbf Signed-off-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1574099 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* cr50: default to SPI PLT_RST if there's a pullup on DIOA9Mary Ruthven2019-04-191-3/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | The PLT_RST_L SYS_RST_L detection is critical to booting, so we need to have a way to make that decision for SPI boards even if there isn't a matching config in the board properties table. We keep adding SPI PLT_RST configs. Everytime we do we have to immediately add a new config to the strap table, because SPI straps aren't able to default to PLT_RST_L. This change adds support for defaulting to PLT_RST_L if there is a pullup on DIOA9. With this new logic there will be 8 supported configs that default to SPI PLT_RST_L and 4 that default to SPI SYS_RST_L. BUG=b:129866334 BRANCH=cr50, cr50-guc TEST=remove atlas config from the table. Make sure it still defaults to SPI PLT_RST even though the config isn't found. Remove the bob config from the table. Make sure it defaults to SPI SYS_RST_L. Remove the reef config from the table. Make sure it defaults to I2C PLT_RST_L. Change-Id: If9bc79eccb957d0e3442fd978ef422726b485f0e Signed-off-by: Mary Ruthven <mruthven@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1574659 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Reviewed-by: Namyoon Woo <namyoon@chromium.org>
* hatch_fp: fix memory mapping of FP buffersNicolas Norvez2019-04-191-3/+7
| | | | | | | | | | | | | | | On STM32F412 the buffers are located in the regular SRAM, don't define a special section. BRANCH=None BUG=b:124773209 BUG=b:124996507 TEST=fpenroll+fpmatch Change-Id: I8659e4587973c4e30c891084691b28326346e1d7 Signed-off-by: Nicolas Norvez <norvez@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1574658 Reviewed-by: Tom Hughes <tomhughes@chromium.org>
* Flapjack: Embed LCM_ID in SKU_IDDaisuke Nojiri2019-04-192-9/+38
| | | | | | | | | | | | | | | | | This patch makes EC embed LCM_ID read from ADC in SKU_ID. Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> BUG=b/129569858 BRANCH=none TEST=Read LCM_ID properly Change-Id: Ia0edfec82d40f70f44ecf00dc18564863e8acc2f Reviewed-on: https://chromium-review.googlesource.com/1573202 Commit-Ready: YH Lin <yueherngl@chromium.org> Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: YH Lin <yueherngl@chromium.org>
* CBI: Allow board to compose data from other sourcesDaisuke Nojiri2019-04-192-2/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, the source of CBI data is only EEPROM. This patch allows CBI data to be composed from other sources such as ADC or some chip register. cbi_board_override is called by CBI library when data is being requested. Boards can implement this callback to add additional bits or bytes to the data. A board itself may need to get CBI data first to manipulate data properly. For such a case, a board can return EC_ERROR_BUSY to inform the callers that the data is not fully ready while a board itself can accept EC_ERROR_BUSY as an expected value. Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> BUG=b/129569858 BRANCH=none TEST=Read LCM_ID properly Change-Id: Ie1f962c64c8d1461a6c171bc6c6d0c855c82e945 Reviewed-on: https://chromium-review.googlesource.com/1572439 Commit-Ready: YH Lin <yueherngl@chromium.org> Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* ish: remove scan ISR registers IRQ handlingHyungwoo Yang2019-04-193-14/+13
| | | | | | | | | | | | | | | Currently we can LAPIC's ISR registers to find vector number but it's already know to the IRQ handler. BRANCH=none BUG=none TEST=Tested on Arcada platform Change-Id: If6626eee0b2548eb26d15cf97b220403b6afcfdb Signed-off-by: Hyungwoo Yang <hyungwoo.yang@intel.com> Reviewed-on: https://chromium-review.googlesource.com/1573203 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* ish: fix task_start_called()Hyungwoo Yang2019-04-191-2/+2
| | | | | | | | | | | | | | | | Variable "start_called" is never updated due to bug in __task_start. this patch fixes the bug. BRANCH=none BUG=none TEST=Tested on Arcada platform Change-Id: Icdea8adf5a06c891188fc84bc49cb643a7e009ec Signed-off-by: Hyungwoo Yang <hyungwoo.yang@intel.com> Reviewed-on: https://chromium-review.googlesource.com/1570150 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
* kohaku: Remove dynamic GPIO configureation for EN_PP500_ATim Wawrzynczak2019-04-193-38/+2
| | | | | | | | | | | | | | | Hatch uses a different pin for GPIO_EN_PP5000_A, depending on board id. Kohaku does not have this issue and GPIO_EN_PP5000_A can be set correctly in its gpio.inc file. BUG=b:130577280 BRANCH=none TEST=Compiles (no Kohaku device yet to test on). Change-Id: I70a1c37c1362b35a698bb616ff0b658c3ebd1c3f Signed-off-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1574699 Reviewed-by: Scott Collyer <scollyer@chromium.org>
* hatch/kohaku: Move HDMI support to board-specific.Tim Wawrzynczak2019-04-194-10/+2
| | | | | | | | | | | | | | | | Hatch baseboard contained HDMI support, but Kohaku does not have HDMI support, so that code is moved to Hatch board specific code instead. BUG=b:130577280 BRANCH=none TEST=Kled device still works with HDMI; detects when HDMI is plugged in and correctly uses the extra display. Change-Id: Idfcea36068b441c8ad499c1f42f0f0ecf681f978 Signed-off-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1574698 Reviewed-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
* hatch/kohaku: Remove Type A USB support for Kohaku.Tim Wawrzynczak2019-04-195-15/+12
| | | | | | | | | | | | | | | | Move USB Type A support from Hatch baseboard to Hatch board because not all Hatch variants support Type A. BUG=b:130577280 BRANCH=none TEST=Kled device still recognizes Type-A USB flash drive. Change-Id: I23b21b069727d57b8fea29de5bbf4e255cf3a3a9 Signed-off-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1573019 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Reviewed-by: Scott Collyer <scollyer@chromium.org> Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
* atlas: fine tune hue of charging LEDCaveh Jalali2019-04-191-1/+1
| | | | | | | | | | | | | | | | this updates the hue of the charging LED "amber" to be slightly more red based on feedback form the UX team. BUG=b:130447080 BRANCH=none TEST=amber still looks amber. Change-Id: I1a4bbf209fec433af49df7a27444425940b3764a Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1568785 Commit-Ready: Caveh Jalali <caveh@google.com> Tested-by: Caveh Jalali <caveh@google.com> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* atlas: enable discharge-on-acCaveh Jalali2019-04-192-0/+43
| | | | | | | | | | | | | | | | | | | enable a mode where we will switch from AC power to battery power when the battery is fully charged. then, when the battery is no longer considred fully charged (95%), switch back to AC and chrage the battery. BUG=b:128709632 BRANCH=none TEST=observed atlas hovers between 95% and 100% battery charge. no AC current drawn while going from 100% to 95%. Change-Id: I6e22189fa5be43dc31a5c3b93fda70a4fe5958a1 Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1496755 Commit-Ready: Caveh Jalali <caveh@google.com> Tested-by: caveh jalali <caveh@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* Common: move for loop initial declarationDiana Z2019-04-181-2/+6
| | | | | | | | | | | | | | | While builds on cros/master allow variables to be initially declared in for loop statements, builds on firmware branches (ex. octopus) may not. BUG=None BRANCH=octopus TEST=builds on master, builds picked to octopus branch Change-Id: I450d8c564b508a5f51a7784ce67b0664ab97d8ba Signed-off-by: Diana Z <dzigterman@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1570609 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
* util/ectool, common/system: Share sysmbol reset_flag_desc.Yilun Lin2019-04-183-34/+55
| | | | | | | | | | | | | | | | | There were two symbols reset_flag_desc and reset_flag_strings used in two separated places: host binary ectool and device. This CL combines these two symbols to reduce maintance efforts. TEST=make buildall -j BRANCH=None BUG=None Change-Id: I3b5731ab08804f46629d6e43466dce963bd86a69 Signed-off-by: Yilun Lin <yllin@google.com> Reviewed-on: https://chromium-review.googlesource.com/1514395 Commit-Ready: Yilun Lin <yllin@chromium.org> Tested-by: Yilun Lin <yllin@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* led_pwm: use NEAR_FULL_COLOR when discharging-on-acCaveh Jalali2019-04-181-1/+2
| | | | | | | | | | | | | | | | | | | | | | when CONFIG_PWR_STATE_DISCHARGE_FULL is enabled for a board, the charge state machine can enter a special PWR_STATE_DISCHARGE_FULL state used to indicate that we're on AC but powering the system from the battery. the system will hover in-and-out of this state over time while on AC. this should generally be transparent to the user, so we should indicate it using the LEDs the same way we indicate PWR_STATE_CHARGE_NEAR_FULL. BUG=b:128709632 BRANCH=none TEST=verified LED stays white on atlas while battery is draining on AC. LED goes out when charger is removed Change-Id: I3af6783bcdbe399a444099fcee8ebab07451ff2c Signed-off-by: Caveh Jalali <caveh@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1570613 Commit-Ready: Caveh Jalali <caveh@google.com> Tested-by: caveh jalali <caveh@chromium.org> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* mkbp: handle multiple writes of interruptJett Rink2019-04-182-76/+283
| | | | | | | | | | | | | | | | | | | We need to handle the case of multiple tasks trying to set the mkbp interrupt while the host command task is trying to clear it. The setting of the interrupt may also take a while and we need to ensure that we synchronize correct after a longer delay. BRANCH=none BUG=b:129159505 TEST=passing CTS sensor run (except test 133 nullptr) with this change TEST=pass CTS sensor run on eSPI-based system TEST=pass CTS sensor run on GPIO-based system Change-Id: I056b72c1210d7525c29a8555f97e6f09d773d12f Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1560229 Tested-by: Alexandru M Stan <amstan@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* Makefile: Add 'stats:' targetDaisuke Nojiri2019-04-181-0/+5
| | | | | | | | | | | | | | | | | | | | | Currently, only buildall can print flash space stats. This patch adds 'stats:' target, which prints the smallest flash spaces. This target can print flash stats without running other recipes associated with buildall. Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> BUG=none BRANCH=none TEST=make stats Change-Id: I30e0cb7cda60c4309212024a7b842f6b37d836ff Reviewed-on: https://chromium-review.googlesource.com/1554842 Commit-Ready: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Patrick Georgi <pgeorgi@chromium.org>
* USB PD: Re-discover port partner when a contract was in placeDiana Z2019-04-184-2/+69
| | | | | | | | | | | | | | | | | | | | | | When the pd_task starts up with an explicit contract previously in place, re-check the partner's identity. This will happen automatically when we EC reset into RO since pd_chipset_startup sets the flag, but for a RO->RW jump the flag needs to be set again. Additionally, exit DP modes before sysjumping, in order to not confuse the port partner with a second enter mode when it had previously been in that mode. BUG=b:125552060 BRANCH=octopus TEST=on unlocked octopus board, plugged in powered HDMI dongle from hibernate state and confirmed display worked after RO->RW jump. Also turned off software sync and confirmed console "sysjump" worked. Change-Id: Idcde6f04deeb8f409a9b4d0a4b3fc924bdb644c7 Signed-off-by: Diana Z <dzigterman@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1506434 Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
* ish: move register definitions to register.hJett Rink2019-04-182-23/+10
| | | | | | | | | | | | | | | Move bit field definitions to register.h close to their register location definition. BRANCH=none BUG=none TEST=arcada communication still works Change-Id: I6dfacc24f43a9b8ff490a98c3e231f06f55a1dc6 Signed-off-by: Jett Rink <jettrink@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1564376 Commit-Ready: Jack Rosenthal <jrosenth@chromium.org> Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
* Flapjack: Cut off battery when USB-C board isn't connectedDaisuke Nojiri2019-04-181-1/+25
| | | | | | | | | | | | | | | | | | | | | | | Currently, when a battery is connected, the device boots immediately. This makes assembly process unreliable. This patch makes EC cut off a battery at start-up if USBC_THERM reads about the pull-up voltage because that indicates a USB-C board isn't connected, which means the devices is being assembled. Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> BUG=b/124540674 BRANCH=none TEST=Verify a battery is cut off when a USB-C board isn't connected. Verify a battery isn't cut off when a USB-C board is connected. TEST=Verify ADC reads 715 mV even when the thermistor is iced. Change-Id: Iadc756f8705abe083a5d56b5d8ad080dbff15b6a Reviewed-on: https://chromium-review.googlesource.com/1520950 Commit-Ready: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
* bloog: Disable ec_feature kbbacklit by SKUIDDevin Lu2019-04-182-0/+18
| | | | | | | | | | | | | | | Remove kbbacklight support with non-kbbacklight SKU. BUG=b:130142249, b:129397770 BRANCH=octopus TEST=make sure ectool inventory doesn't show keyboard backlight support with non-kbbacklight SKU. Change-Id: I820f13fb13c58b63492a6e544e22545e8ee65f4c Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Reviewed-on: https://chromium-review.googlesource.com/1568893 Commit-Ready: Marco Chen <marcochen@chromium.org> Reviewed-by: Marco Chen <marcochen@chromium.org>
* bloog: add support keyboard backlightDevin Lu2019-04-181-1/+2
| | | | | | | | | | | | | BUG=b:130142249 BRANCH=octopus TEST=make buildall -j, make sure ec console kbkight can adjust keyboard backlight brightness. Change-Id: I635372efe0b92ff3765de83d9adfe953accd96a1 Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Reviewed-on: https://chromium-review.googlesource.com/1535084 Commit-Ready: Marco Chen <marcochen@chromium.org> Reviewed-by: Marco Chen <marcochen@chromium.org>
* *_fp: Add private version infoTom Hughes2019-04-181-0/+3
| | | | | | | | | | | | | | | | | | This shows up when you run the "version" command in the UART console. BRANCH=none BUG=b:130417373 TEST=BOARD=hatch_fp ./util/getversion.sh => shows private version in VERSION BOARD=nocturne_fp ./util/getversion.sh => shows private version in VERSION BOARD=nocturne ./util/getversion.sh => does not show private version in VERSION Change-Id: Ibdf94795bbc8bc823d29ec006b01fc89e8f37114 Signed-off-by: Tom Hughes <tomhughes@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1566040 Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
* bloog: correct accelerometer orientationDevin Lu2019-04-181-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Correct accelerometer orientation, because differece from meep. BUG=b:130619474 BRANCH=octopus TEST=When device is laying on a table, lid angle at 180, both sensors report gravity along Z axis: ectool motionsense Motion sensing active Sensor 0: 507 606 16748 Sensor 1: 17 -334 16442 Sensor 2: 0 0 0 Sensor 3: 0 0 0 When on the base bottom edge, report gravity along Y axis: ectool motionsense Motion sensing active Sensor 0: 403 16491 655 Sensor 1: 19 16163 1540 Sensor 2: 0 0 0 Sensor 3: 0 0 0 When on its left side, report gravity along X axis: ectool motionsense Motion sensing active Sensor 0: 16172 -374 1738 Sensor 1: 16315 -184 1280 Sensor 2: 0 0 0 Sensor 3: 0 0 0 and check the screen rotation was normally. Change-Id: I20ceab05ac9dce2cba09417a759d6657a185788d Signed-off-by: Devin Lu <Devin.Lu@quantatw.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1569087 Reviewed-by: Justin TerAvest <teravest@chromium.org> Reviewed-by: Diana Z <dzigterman@chromium.org> Reviewed-by: Marco Chen <marcochen@chromium.org> Commit-Queue: Marco Chen <marcochen@chromium.org>
* charge_manager: Move source_port_bitmap definition where it's usedDaisuke Nojiri2019-04-181-5/+4
| | | | | | | | | | | | | | | | | | | This patch moves the definition of source_port_bitmap to the location where it's referenced to increase the readability. There is no functionality change. Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org> BUG=none BRANCH=none TEST=buildall Change-Id: I9dcdc3ec10c2f71b9f95c271f86ba31e436e697c Reviewed-on: https://chromium-review.googlesource.com/1566481 Commit-Ready: Daisuke Nojiri <dnojiri@chromium.org> Tested-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Jett Rink <jettrink@chromium.org>
* kohaku: Get rid of fan configuration.Tim Wawrzynczak2019-04-182-79/+2
| | | | | | | | | | | | | | Initial implementation was copied from hatch, but Kohaku has no fan. BUG=b:130577450 BRANCH=none TEST=compiles. Change-Id: Icbbf4419000938f07613cb4b32f4e82166741e17 Signed-off-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/1568763 Reviewed-by: Furquan Shaikh <furquan@chromium.org> Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>