Commit Graph

3633 Commits

Author SHA1 Message Date
Aseda Aboagye
9b83436b14 meowth: zoombini: Remove internal pullups on UART.
Cr50 requires no pullups on the EC UART pins.

BUG=b:73135908
BRANCH=None
TEST=Flash meowth; Reboot Cr50 a bunch, verify that servo is never seen
as "connected".

Change-Id: I88e4a2e510c1c795f2b240c3d742a7466acf696b
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Reviewed-on: https://chromium-review.googlesource.com/917181
Commit-Ready: Aseda Aboagye <aaboagye@chromium.org>
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Edward Hill <ecgh@chromium.org>
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
2018-02-14 17:05:31 -08:00
Vadim Bendebury
7b44ce57a3 cr50: move to prod RMA key
The new key ID is set to zero.

BRANCH=cr50, cr50-eve
BUG=b:70891959
TEST=verified that prod server properly responds to the challenge
     generated by a CR50 running on Robo device.

Change-Id: I1e0da4a2cebca7f985c5f2a6da509c850924a874
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/915503
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Michael Tang <ntang@chromium.org>
2018-02-13 17:40:32 -08:00
Edward Hill
5d793e44c4 grunt: Disable system power (_A rails) in G3
EN_PWR_A GPIO turns on PP1800_A, PP5000_A, PP3300_A, PP950_A.
These should be off in G3 and on in S5 and higher.

VGATE (S0 power) is pulled high in G3 when SPOK (system power,
S5) is low because PP5000_A turns off, so add a check for this
and only pass through high VGATE when SPOK is also high.

Leave kahlee behavior unchanged (power stays on in G3).

BUG=b:72744306
BRANCH=none
TEST=power on and off SOC, see GPIO_EN_PWR_A go low in G3

Change-Id: I68a1ac10263ad84d5ee154613e5e248edb4d287c
Signed-off-by: Edward Hill <ecgh@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/904729
Commit-Ready: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Jett Rink <jettrink@chromium.org>
2018-02-12 18:59:33 -08:00
Duncan Laurie
52e5ab0730 eve: Use PCH ACOK signal to control Deep Sleep entry
Deep Sleep states (DS3, DS5) are a special mode of the Intel PCH chipset
that has very limited wake capabilities and breaks a number of common
user expected behahviors.

In particular, when in Deep S3 the USB ports are turned off and cannot
continue to charge, wake the system, or maintain their internal state
as they will lose 5V power.  This is particularly painful with gnubby
devices as they will need unlocked after every DS3 suspend/resume cycle.

The only external signal that the PCH uses to determine whether or not
to enter Deep Sx states is the ACPRESENT (aka ACOK) pin.

Currently this pin is simply buffered from the charger and will be
asserted whenever a charger is connected.  This change extends the EC
control over the pin to also assert ACPRESENT if either Type-C port is
currently supplying VBUS.

Now when a USB device is inserted the system will be enter S3 state,
but not go into Deep S3 state.  This allows the USB device to continue
to charge, maintain it's internal state, and wake the system.

BUG=b:64406191
BRANCH=eve
TEST=verify GPIO_PCH_ACOK pin from the EC in different scenarios and
test that system goes into S3 or DS3 state as expected:
1) no charger, no USB device: ACOK not asserted, DS3 enabled
2) charger but no USB device: ACOK asserted, DS3 disabled
3) no charger but USB device: ACOK asserted, DS3 disabled
4) charger and USB device:    ACOK asserted, DS3 disabled

Change-Id: I1cd132459194382e418970d29b1b195d8132cfad
Signed-off-by: Duncan Laurie <dlaurie@google.com>
Reviewed-on: https://chromium-review.googlesource.com/896164
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2018-02-12 18:59:32 -08:00
Elthan_Huang
db93a8d74c Nami: Enable hibernate using silego
Nami EC has EC_HIBERNATE pin connected to a silego (U91). When this
pin is asserted, U91 shuts down ROP_PMIC_ENVR3, which turns off the
EC. Thus, we don't use the internal hibernate/wake-up feature in npcx.

BUG=b:72641658
BRANCH=none
TEST=Test system will shutdown and doesn't auto
wake up when type hibernate in ec console. And wake up by AC plugin,
LID open, or power button.

Change-Id: Ib9e02f7e41087e5972eedf4855d88a4c45c75bb4
Signed-off-by: Elthan_Huang <elthan_huang@compal.corp-partner.google.com>
Reviewed-on: https://chromium-review.googlesource.com/890569
Commit-Ready: Daisuke Nojiri <dnojiri@chromium.org>
Tested-by: Raymond Chou <raymond_chou@compal.corp-partner.google.com>
Reviewed-by: Raymond Chou <raymond_chou@compal.corp-partner.google.com>
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
2018-02-12 18:59:29 -08:00
Edward Hill
61e1151d2c grunt: Turn PP1800_SENSOR off in S5
Disable sensor power (lid accel, gyro) in G3+S5. Enable
it in S3+S0. We want it on in S3 for calculating the lid
angle (needed on convertibles to disable resume from
keyboard in tablet mode).

BUG=b:72741289
BRANCH=none
TEST=GPIO_EN_PP1800_SENSOR =0 in G3+S5 and =1 in S3+S0

Change-Id: I043b880b9fbd44242df0d2ac01c92a066d6b4377
Signed-off-by: Edward Hill <ecgh@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/912452
Reviewed-by: Lann Martin <lannm@chromium.org>
Reviewed-by: Jett Rink <jettrink@chromium.org>
2018-02-09 22:21:07 -08:00
Jett Rink
ff11702c40 grunt: Making control of SCI and SMI interrupt pins more clear
BRANCH=none
BUG=none
TEST=none

Change-Id: I82d0a68f192fdc339af8682b99781cb16802ac32
Signed-off-by: Jett Rink <jettrink@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/911590
Reviewed-by: Edward Hill <ecgh@chromium.org>
2018-02-09 16:07:14 -08:00
Vincent Palatin
01cee655ab meowth_fp: put fingerprint code in RW only
Configure the fingerprint to be compile only in the RW partition for
size reason, and keep the RO for firmware update only.

Enable the RW signature to jump automatically to RW.
The dev key was generated with the following command:
openssl genrsa -3 -out board/meowth_fp/dev_key.pem 3072

Enable the new STM32H7 internal flash support along the way.

Signed-off-by: Vincent Palatin <vpalatin@chromium.org>

BRANCH=none
BUG=b:72360575
TEST=run on ZerbleBarn and see the firmware jumping to RW,
then run 'fptest' console command and get a proper capture.
CQ-DEPEND=CL:*552559

Change-Id: Icc894b8a59b255b4c6a139f177e99d0fde7c4e19
Reviewed-on: https://chromium-review.googlesource.com/880955
Commit-Ready: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
2018-02-09 10:51:31 -08:00
Randall Spangler
ff4d22819a cr50: Add SPI hashing command
This allows hashing or dumping SPI flash from the Cr50 console even on
a locked device, so you can verify the RO Firmware on a system via CCD.

See design doc: go/verify-ro-firmware
(more specifically, "Cr50 console commands for option 1")

BUG=chromium:804507
BRANCH=cr50 release (after testing)
TEST=manual:
   # Sample sequence
   spihash ap -> requires physical presence; tap power button
   spihash 0 1024 -> gives a hash; compare with first 1KB of image.bin
   spihash 0 128 dump -> dumps first 128 bytes; compare with image.bin
   spihash 128 128 -> offset works
   spihash 0 0x100000 -> gives a hash; doesn't watchdog reset
   spihdev ec
   spihash 0 1024 -> compare with ec.bin
   spihash disable
   # Test timeout
   spihash ap
   # Wait 30 seconds
   spihash 0 1024 -> still works
   # Wait 60 seconds; goes back disabled automatically
   spihash 0 1024 -> fails because spihash is disabled
   # Presence not required when CCD opened
   ccd open
   spihash ap -> no PP required
   spihash 0 1024 -> works
   spihash disable
   # Possible for owner to disable via CCD config
   ccd -> HashFlash is "Always"
   ccd set HashFlash IfOpened
   ccd lock
   spihash ap -> access denied
   # Cleanup
   ccd open
   ccd reset
   ccd lock

Change-Id: I27b5054730dea6b27fbad1b1c4aa0a650e3b4f99
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/889725
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
2018-02-08 23:42:33 -08:00
Scott Worley
5e18dfc345 mchpevb1: Add remaining board files
Add Microchip EVB plus SKL RVP3 remaining board
files for battery, LED, and USB PD.

BRANCH=none
BUG=
TEST=Review only.
CQ-DEPEND=CL:840654,CL:841022

Change-Id: I34ccb33eb44e73ab841f96f4733bfe419b095678
Signed-off-by: Scott Worley <scott.worley@microchip.corp-partner.google.com>
Reviewed-on: https://chromium-review.googlesource.com/841043
Commit-Ready: Randall Spangler <rspangler@chromium.org>
Tested-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2018-02-08 23:41:19 -08:00
Scott Worley
178e18a164 mchpevb1: Add MCHP EVB board build files
Add Microchip MEC17xx eval board build
makefile rules, GPIO file, and tasklist.
EVB connected to Intel SKL RVBP is eSPI
mode. EVB has smart battery and temperature
sensor on I2C and a BMI160 gyro connected
to GPSPI0.

BRANCH=none
BUG=
TEST=Review only.
CQ-DEPEND=CL:841022,CL:841043

Change-Id: Ie17b896766b80130e3cf2812f6239030027983d8
Signed-off-by: Scott Worley <scott.worley@microchip.corp-partner.google.com>
Reviewed-on: https://chromium-review.googlesource.com/840654
Commit-Ready: Randall Spangler <rspangler@chromium.org>
Tested-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2018-02-08 23:41:18 -08:00
Scott Worley
bbbef02a63 mchpevb1: Add mchpevb1 board files
Add Microchip EVB plus SKL RVP3 main board
files.

BRANCH=none
BUG=
TEST=Review only.
CQ-DEPEND=CL:840654,CL:841043

Change-Id: I2f3cc33989e911c464f761374c0d2d26b054b7d7
Signed-off-by: Scott Worley <scott.worley@microchip.corp-partner.google.com>
Reviewed-on: https://chromium-review.googlesource.com/841022
Commit-Ready: Randall Spangler <rspangler@chromium.org>
Tested-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2018-02-08 23:41:17 -08:00
Ryan Zhang
6c5a4424d7 Fizz: Update thermal table by project
1. Prochot/Shutdown Point
	a. Prochot on: >=81C, off: <=77C
	b. Shutodwn: >=82C

2. custom fan table
	There are three projects sharing two tables, and
	use Kench & Teemo's table before getting correct OEM ID
	because it raises fan speed quicker than the other one.

	a. Kench & Teemo & default
	b. Sion

BUG=b:70294260
BRANCH=master
TEST=EC can get two fan tables with different cbi value.

Change-Id: Ie1bffbcf5c353a9aae5806f6c2b41554eed22b7d
Signed-off-by: Ryan Zhang <ryan.zhang@quanta.corp-partner.google.com>
Reviewed-on: https://chromium-review.googlesource.com/886121
Commit-Ready: Daisuke Nojiri <dnojiri@chromium.org>
Tested-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
2018-02-08 09:24:07 -08:00
Nicolas Boichat
ececca49aa whiskers: Disable keyboard/USB interface when magnet sensor active
BRANCH=none
BUG=b:72722179
TEST=lidopen/lidclose, see that USB interface is getting enabled/disabled
TEST=Close/open sensor with a magnet, see that USB interface is getting
     enabled/disabled
TEST=Boot with sensor open, USB interface is on

Change-Id: Ic738fa2f2adea03cd29914bb5fc96a1fa6834122
Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/894783
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2018-02-08 06:57:51 -08:00
Daisuke Nojiri
bb5f21ed1a Fizz: Monitor input current (version 2.0)
Fizz has three FETs connected to three registers: PR257, PR258,
PR7824. These control the thresholds of the current monitoring
system.
                              PR257  PR7824 PR258
  For BJ (65W or 90W)           off     off   off
  For 4.35A (87W)                on     off   off
  For 3.25A (65W)               off     off    on
  For 3.00A (60W)               off      on   off

The system power consumption is capped by PR259, which is stuffed
differently depending on the SKU (65W v.s. 90W or U42 v.s. U22).
So, we only need to monitor type-c adapters. For example:

  a 90W system powered by 65W type-c charger
  b 65W system powered by 60W type-c charger
  c 65W system powered by 87W type-c charger

In a case such as (c), we actually do not need to monitor the current
because the max is capped by PR259.

AP is expected to read type-c adapter wattage from EC and control
power consumption to avoid over-current or system browns out.

The current monitoring system doesn't support less than 3A
(e.g. 2.25A, 2.00A). These currents most likely won't be enough to
power the system. However, if they're needed, EC can monitor
PMON_PSYS and trigger H_PROCHOT by itself.

BUG=b:72883633,b:64442692,b:72710630
BRANCH=none
TEST=Boot Fizz on 60W/87W/BJ charger. Verify GPIOs are set as expected.

Change-Id: Ic4c0e599f94b24b5e6c02bbf1998b0b89ecad7bf
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/900491
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2018-02-08 01:23:59 -08:00
Daisuke Nojiri
131b7dcc44 Fizz: Uprev board version to 2.2
This patch sets the board version for CBI blob to 2.2.

BUG=none
BRANCH=none
TEST=Boot Fizz.

Change-Id: Ibbb4083b82af3803d06bbdd157b16b369f7f6784
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/905403
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2018-02-08 01:23:52 -08:00
Vadim Bendebury
4a673c15ad rma: enable WP on RMA disable
When RMA procedure is completed WP needs to be enabled back.

BRANCH=cr50, cr50-mp
BUG=b:37952913, b:73075443
TEST=on a Robo device, verified that WP is enabled, took the device
     through RMA unlock, verified that WP is disabled, took the device
     through RMA disable, verified that WP is enabled again.

     Also confirmed that after RMA is disabled WP status follows the
     battery.

Change-Id: Iad6af7d16aadcd10d580f709aeb942cf508a8489
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/905926
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2018-02-08 02:31:20 +00:00
Daisuke Nojiri
c8e2deb24d Fizz/CBI: Create CBI blobs
This patch makes make create EEPROM blobs which contain Cros Board Info.

BUG=b:72949522
BRANCH=none
TEST=make buildall. make BOARD=fizz cbi_kench.

Change-Id: Ie4c50f4707285b44c13afc7410a5ea823a26d98e
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/902822
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2018-02-06 18:19:08 -08:00
Aseda Aboagye
ddd4b363af meowth: zoombini: Enable PWM LED support.
BUG=b:69138917
BRANCH=None
TEST=Flash meowth; verify that LEDs behave as expected.
TEST=Repeat above test for zoombini.

Change-Id: I07ae4b4d0f62c653d3d15c493a7ece573551212a
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Reviewed-on: https://chromium-review.googlesource.com/888221
Commit-Ready: Aseda Aboagye <aaboagye@chromium.org>
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Edward Hill <ecgh@chromium.org>
Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
2018-02-05 23:05:40 -08:00
Aseda Aboagye
5ef9b94d70 meowth: Enable discharge on AC.
This is needed for testing.

BUG=None
BRANCH=None
TEST=Flash meowth; verify can discharge on AC.

Change-Id: I1cf1149fb90077deeb940737e8d103dcec8444fe
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Reviewed-on: https://chromium-review.googlesource.com/888225
Commit-Ready: Aseda Aboagye <aaboagye@chromium.org>
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2018-02-05 19:09:14 -08:00
Aseda Aboagye
06bbd9dd6c meowth: zoombini: Add HPD support.
The HPD pins for meowth and zoombini go from the EC to the AP.  This
commit drives the HPD correctly.

BUG=b:72413020
BRANCH=None
TEST=Flash meowth; Use a couple charge-through hubs, unplug HDMI cable,
replug, verify AP sees new DP sink.

Change-Id: Ie1f86378c59fc4a717edc537ff8afe01b21d9b68
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Reviewed-on: https://chromium-review.googlesource.com/888226
Commit-Ready: Aseda Aboagye <aaboagye@chromium.org>
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Edward Hill <ecgh@chromium.org>
2018-02-05 19:08:39 -08:00
Daisuke Nojiri
044cc72496 Enable PD communication in RO for external display
This patch makes EC enable PD communication if it's running in
manual recovery mode. This is required to show recovery screen
on a type-c monitor.

This patch also makes EC-EFS ignore power availability. It will
make EC verify & jump to RW even if power is sourced by a barrel
jack adapter. This should allow depthcharge to show screens
(e.g. broken, warning) on a type-c monitor.

BUG=b:72387533
BRANCH=none
TEST=On Fizz with type-c monitor, verify
- Recovery screen is displayed in manual recovery mode.
- Critical update screen is displayed in normal mode.
- Warning screen is displayed in developer mode.
Monitors tested: Dingdong, Dell S2718D

Change-Id: Ib53e02d1e5c0f5b2d96d9a02fd33022f92e52b04
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/898346
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2018-02-03 02:38:10 -08:00
Daisuke Nojiri
cd5173dfe0 Fizz: Suppress EC_CMD_PD_GET_LOG_ENTR debug log
Host command handler prints every single host command except when
commands are repeated back-to-back. Some commands do not provide
useful info when studying feedback reports or what is worse they
may hide critical info by flooding the EC log.

BUG=chromium:803955
BRANCH=none
TEST=Observe 'HC 0x115' is not printed.

Change-Id: I4901b27bbfedd54dc0d364b16c49d4ed0dea0fc4
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/896694
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2018-02-03 02:38:07 -08:00
Dino Li
30bf5c1b84 reef_it8320: don't pull-up tx/rx of uart
Because H1 monitor tx/rx signals to detect servo board,
so we can't pull-up tx/rx or the DETECT_SERVO of H1 will
be always high even the servo board isn't connected.

BUG=none
BRANCH=none
TEST=H1 detect servo board correctly.

Change-Id: I2f2dfa220ed77478e6e622a0ed1189f559044aa3
Signed-off-by: Dino Li <Dino.Li@ite.com.tw>
Reviewed-on: https://chromium-review.googlesource.com/897315
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2018-02-02 23:53:41 -08:00
Nicolas Boichat
f0532aa93a charge_state_v2: Safer power transfer between lid and base
To avoid issues where adapter would drive against OTG of lid or
base, and to make sure that we do not over-current the adapter,
we disconnect the base/lid power transfer whenever a new
adapter is connected.

We reenable power transfer as needed.

We also separate out base current control as a new function,
that allows us to record the previous base current only when
the base charge control command is successful, and ignore
errors until the base is responsive for the first time.

Finally, we make sure that
charge_allocate_input_current_limit is only called from a
single location in charger_task.

BRANCH=none
BUG=b:71881017
TEST=Plug/unplug base, reset lux EC, connect charger.
     Base is detected, power allocation works as expected.

Change-Id: I8b206d5b0fbcf0fe868b56a0336745aebe2a6dc2
Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/880021
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2018-02-02 23:53:40 -08:00
Mary Ruthven
4d3c8c1776 cr50: create ap_uart state machine
This change creates a state machine to handle ap uart detection. It
removes all of the ap_uart stuff from ap_state.c and moves it to
ap_uart_state.c. All boards will now use ap_uart to enable/disable ap
uart and tpm_rst_l to detect the ap state.

Separate ap uart detection from ap detection, so we can disable the ap
uart without enabling deep sleep. If the ap is in S3 on ARM devices,
Cr50 wont be in deep sleep, but the AP UART RX signal wont be pulled up.
In this case we need cr50 ap rx to be disabled and deep sleep to be
disabled.

BUG=b:35647982
BRANCH=cr50
TEST=run firmware_Cr50DeviceState on scalet and electro

Change-Id: I81336a9e232df8d44b325eef59327a1c06a80cba
Signed-off-by: Mary Ruthven <mruthven@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/884307
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
2018-02-02 23:53:33 -08:00
Duncan Laurie
9b406da2dc eve: Add support for dumping PMIC fault registers
If during PMIC initialization, it is identified that there was a VR
fault, then dump fault registers 0x16 and 0x17 to EC console. This
information is very useful during debugging sudden power losses in
field and so it is printed out to EC console.

Additionally, add panic reason with these register values as panic
data so that OS can provide this information in cros ec
panicinfo. This helps in retaining the information even if EC console
logs overflow.

BUG=b:65026806
BRANCH=eve
TEST=Verified that on a VCCIO shutdown, PMIC VR fault is
reported: "PMIC VRFAULT: PWRSTAT1=0x80 PWRSTAT2=0x00"

Change-Id: I583e513f865aeefc7dfc9860ce0ce9789808dea2
Signed-off-by: Duncan Laurie <dlaurie@google.com>
Reviewed-on: https://chromium-review.googlesource.com/896163
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2018-02-02 13:19:25 -08:00
YB.Ha
c721ad9162 nautilus : clean up gpios
clean up unused gpios

BUG=none
BRANCH=none
TEST=build/flash nautilus

Change-Id: Ifdebc885d7f81b560b27bfed5abb93d8976e9641
Signed-off-by: YB.Ha <ybha@samsung.com>
Reviewed-on: https://chromium-review.googlesource.com/897305
Commit-Ready: YongBeum Ha <ybha@samsung.com>
Tested-by: YongBeum Ha <ybha@samsung.com>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Shawn N <shawnn@chromium.org>
2018-02-01 21:29:42 -08:00
Edward Hill
5bfeef6bb3 grunt: Set USB-C DP HPD GPIOs correctly.
Change the EC to drive the Hotplug Detect (HPD) GPIOs.

Grunt HW has these driven from EC to SOC, unlike coral which had
the TCPCs drive the HPD signals to SOC.

BUG=b:71810897
BRANCH=none
TEST=external display works using USB-C to DP adapter on both ports

Change-Id: I22ec9eecc5bdf9c6463dd3ce208d051faf15c57a
Signed-off-by: Edward Hill <ecgh@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/892099
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Jett Rink <jettrink@chromium.org>
2018-02-01 21:29:38 -08:00
Martin Roth
69b592426c Grunt: Set AP reset pin to open drain
By setting this GPIO to open drain, we don't need to make any board
changes as it won't conflict with the warm reset pin from the servo
header.

TEST=Warm reset works
BUG=B:72751599
BRANCH=None

Change-Id: I29d976851fc011fcb130a1747e4a39c8bf80a4ed
Signed-off-by: Martin Roth <martinroth@google.com>
Reviewed-on: https://chromium-review.googlesource.com/898075
Commit-Ready: Aaron Durbin <adurbin@chromium.org>
Tested-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Edward Hill <ecgh@chromium.org>
Reviewed-by: Jett Rink <jettrink@chromium.org>
2018-02-01 18:08:42 -08:00
Simon Glass
c23e632984 grunt: Rename orange LED to amber
'Amber' seems to be more common in the code base. Rename it for grunt.

BUG=b:71902053
BRANCH=none
TEST=make BOARD=grunt -j10

Change-Id: I73a6bff4f113f5c49e70fde6d1f4667b8324a6d8
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/896401
Reviewed-by: Edward Hill <ecgh@chromium.org>
Reviewed-by: Jett Rink <jettrink@chromium.org>
2018-02-01 18:08:40 -08:00
Jett Rink
1b87ee65ac cleanup: Removing unnecessary CONFIG_USB_PD_DISCHARGE define
CONFIG_USB_PD_DISCHARGE is now defined automatically if you specify one of
the specified options such as CONFIG_USB_PD_DISCHARGE_TCPC

BRANCH=none
BUG=none
TEST=grunt still discharges using PPC

Change-Id: I94086cfc58bebce9c62ad6aa52b7740b25276d89
Signed-off-by: Jett Rink <jettrink@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/894676
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
2018-02-01 14:55:19 -08:00
Shawn Nematbakhsh
f80b0f31c5 poppy / soraka: Decrease input current limit to prevent OC
Based on measurements, Soraka can pull more current than desired.
Decrease the programmed current limit by an additional factor,
determined by taking the worst-case power measurements across several
different Soraka devices, to ensure that Soraka never pulls more
current than desired.

BRANCH=None
BUG=b:67944740
TEST=Verify with `charger` that input current limit becomes 472mA when a
5V / 500mA charger is plugged, and 2896mA when a 5V / 3000mA charger is
plugged.

Change-Id: I2b2cb6f445533476d173cd7f5fb825d8b11d1405
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/890102
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Benson Leung <bleung@google.com>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
2018-02-01 14:55:18 -08:00
Jett Rink
aa2a4695ae grunt: enabling PPC vbus discharge path
Grunt uses a PPC, so we want it to discharge VBUS instead of the TPCP

BRANCH=none
BUG=b:72179253
TEST=Verified grunt board fall time is within spec now

Change-Id: I556cd2945ee191e3f423ee0a93c35eb2ccff9016
Signed-off-by: Jett Rink <jettrink@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/886564
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Reviewed-by: Edward Hill <ecgh@chromium.org>
2018-01-31 22:39:01 -08:00
Edward Hill
11bda19561 sn5s330: Enable VBUS interrupts
If the sn5s330 PPC is being used to detect VBUS presence
(CONFIG_USB_PD_VBUS_DETECT_PPC), then enable interrupts and call
usb_charger_vbus_change when VBUS_GOOD changes.

BUG=b:72007153,b:72007492
BRANCH=none
TEST=Connect 3A and 1A USB-A chargers to each of Grunt's USB-C ports,
check that BC1.2 detection is working:
	With 1A:
	> chgsup
	port=0/1, type=7, cur=500mA, vtg=5000mV, lsm=1
	With 3A:
	> chgsup
	port=0/1, type=7, cur=2400mA, vtg=5000mV, lsm=1
TEST=Boot Grunt to OS, then connect USB2 mouse or USB3 flash drive to each
of Grunt's USB-C ports. Devices do not work due to b:71772180, but gpioget
shows EC is setting USB_C0/1_BC12_VBUS_ON_L correctly.

Change-Id: Iffc352105a321997adb364b9fbb8bafef248c224
Signed-off-by: Edward Hill <ecgh@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/887938
Reviewed-by: Jett Rink <jettrink@chromium.org>
2018-01-31 22:38:56 -08:00
Anatol Pomazau
5a910a86be Add support for HW alerts
- Add a vendor command that provides alert counter. Userspace can use
   it e.g. for user metric analysis.
 - Add 'alerts' debug console command. It provides information about
   chip alerts: supported alerts, fuse status, interrupt status, alert
   counter.
 - Add 'alerts fire [INT]' command to fire a software defined alert
   (globalsec/fwN where N is 0,1,2,3).

Signed-off-by: Anatol Pomazau <anatol@google.com>

BUG=b:63523947
TEST=ran the FW at Pyro and checked alerts data sent to host

Change-Id: I7cec0c451ed71076b44dad14a151b147ff1337e8
Reviewed-on: https://chromium-review.googlesource.com/817639
Commit-Ready: Anatol Pomazau <anatol@google.com>
Tested-by: Anatol Pomazau <anatol@google.com>
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
2018-01-31 13:47:15 -08:00
Jongpil Jung
62d94fc2a9 nautilus: Implement workaround for broken reset flags for rev3.
Issue will fix next board revision. It was not fixed in rev3 yet.
So, we neet to add workaround for rev3 as well.

BUG=b:67062902
BRANCH=None
TEST=None

Change-Id: I033df22f342a2c8f0ddf4b1883d99018db1df16d
Signed-off-by: Jongpil Jung <jongpil19.jung@samsung.com>
Reviewed-on: https://chromium-review.googlesource.com/893578
Commit-Ready: Jongpil Jung <jongpil19.jung@samsung.corp-partner.google.com>
Tested-by: Jongpil Jung <jongpil19.jung@samsung.corp-partner.google.com>
Reviewed-by: Shawn N <shawnn@chromium.org>
2018-01-31 05:58:00 -08:00
Nicolas Boichat
7ffcd686db whiskers: Enable LM3630A LED driver
Used to control keyboard backlight.

BRANCH=none
BUG=b:68934906
TEST=make BOARD=whiskers -j

Change-Id: Ie793ebe91670965a434896530084561a7f1c57d4
Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/892842
Reviewed-by: Benjamin Gordon <bmgordon@chromium.org>
Reviewed-by: Wei-Han Chen <stimim@chromium.org>
2018-01-31 03:36:25 -08:00
Aseda Aboagye
7368aff427 meowth: zoombini: Enable CONFIG_ALS.
This allows the acpi_light sysfs entry to be populated with the actual
ALS data.

BUG=b:70290036
BRANCH=None
TEST=Flash meowth; read both illuminance values for the ALS devices
under iio and verify that they are both operational.

Change-Id: Ia22633629195d5bdeedc70a908ceca1411110b7d
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Reviewed-on: https://chromium-review.googlesource.com/888218
Commit-Ready: Aseda Aboagye <aaboagye@chromium.org>
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Shawn N <shawnn@chromium.org>
2018-01-30 17:47:20 -08:00
Shawn Nematbakhsh
9afcd8d602 cleanup: Remove CONFIG_USB_PD_TCPC_BOARD_INIT
It's no longer necessary to call board_tcpc_init() from PD tasks, since
HOOK_INIT completion is guaranteed before the task starts. Also, calling
board_tcpc_init() for each PD task without a port arg is a bad idea.

BUG=b:72229154
BRANCH=none
TEST=`make buildall -j`

Change-Id: I6fba07771693b8343568041960a263e02775a8fc
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/881538
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-by: Edward Hill <ecgh@chromium.org>
2018-01-30 14:54:23 -08:00
Philip Chen
1c90656d03 scarlet: Remove unused macros in battery.c
The macros were added for debug and not used anymore.
Let clean it up.

BUG=none
BRANCH=none
TEST=make BOARD=scarlet

Change-Id: I859fd3ddf2d5271ba26d23696013c83dec98a966
Signed-off-by: Philip Chen <philipchen@google.com>
Reviewed-on: https://chromium-review.googlesource.com/891547
Commit-Ready: Philip Chen <philipchen@chromium.org>
Tested-by: Philip Chen <philipchen@chromium.org>
Reviewed-by: Alexandru M Stan <amstan@chromium.org>
2018-01-30 14:54:23 -08:00
Shawn Nematbakhsh
8d29b3dae7 stm32: Fix bkpdata accounting
stm32f0 has 20 bytes (not 20 words) of VBAT-backed RAM. Make more
efficient use of our limited storage to prevent trying to use storage
that doesn't exist.

BUG=b:71333840
BRANCH=None
TEST=Negotiate PD, run "reboot" on scarlet EC console, verify reset path
is taken in pd_partner_port_reset().

Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Change-Id: Ie4c303b74a1b82b84ec971cdcc19c2b21a0032e7
Reviewed-on: https://chromium-review.googlesource.com/885461
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2018-01-30 14:54:17 -08:00
Shawn Nematbakhsh
9362b06201 samus_pd: Remove 'adc' console command
Remove console command for flash / RAM savings.

BUG=None
TEST=`make buildall -j`
BRANCH=None

Change-Id: Ibfccbdf45e5c86260cc55237387994fdf094c19c
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/885463
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2018-01-30 14:54:17 -08:00
Vijay Hiremath
f543a8e798 glkrvp: Switch from NPCX5 EC to NPCX7 EC
BUG=b:68987606, b:72483287
BRANCH=glkrvp
TEST=GLKRVP can boot to OS

Change-Id: If4b99ca60005b97c59a1d8dc16c4065af63d34d8
Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/750365
Commit-Ready: Vijay P Hiremath <vijay.p.hiremath@intel.com>
Tested-by: Vijay P Hiremath <vijay.p.hiremath@intel.com>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2018-01-30 09:02:13 -08:00
YB.Ha
313220c87d nautilus : fix white led shown issue on ec reset
set gpios of LED to output high(off) when ec reset

BUG=b:72485879
BRANCH=none
TEST=build/flash nautilus

Change-Id: I187dc82839fe7000e004cf58c4811656c905c00a
Signed-off-by: YB.Ha <ybha@samsung.com>
Reviewed-on: https://chromium-review.googlesource.com/892679
Commit-Ready: YongBeum Ha <ybha@samsung.com>
Tested-by: YongBeum Ha <ybha@samsung.com>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2018-01-30 06:32:43 -08:00
Mary Ruthven
4d0eb3be49 cr50: fix ec and servo detection
This change reenables the gpio interrupts if the signal is not high.

BUG=none
BRANCH=cr50
TEST=firmware_Cr50DeviceState

Change-Id: Iae4e18594954789cd6841e01d1c943de3b389415
Signed-off-by: Mary Ruthven <mruthven@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/884306
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2018-01-29 16:38:33 -08:00
Furquan Shaikh
8160d1ae86 poppy: Enable dptf device orientation
This is required to support mode-aware DPTF. Also, there is no need to
send mode change event in board specific code as that is already done
by dptf common code.

BUG=b:65467566
BRANCH=None
TEST=Verified that trip point temperatures get updated in the OS
depending upon the device mode.

Change-Id: I854628bcde755bdb1c6c1b73fbfa0948e1d7e420
Signed-off-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/887725
Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
2018-01-29 16:38:32 -08:00
Mary Ruthven
a4e1e47630 cr50: add properties to BOARD_ALL_PROPERTIES
Add BOARD_DEEP_SLEEP_DISABLED and BOARD_DETECT_AP_WITH_UART to
BOARD_ALL_PROPERTIES, so they will be updated after cr50 reboots.

BUG=b:35647982
BRANCH=cr50
TEST=test deep sleep on scarlet

Change-Id: I8999ae7c6c1dad6799b5fdb99ebf5d7618a21c2b
Signed-off-by: Mary Ruthven <mruthven@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/882343
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2018-01-29 16:38:26 -08:00
Nicolas Boichat
31c1fc6d43 whiskers: Update GPIO for next revision
Looks more similar to original hammer.

BRANCH=none
BUG=b:68934906
TEST=make BOARD=whiskers -j

Change-Id: I0f10240f8c3237b20f60a1217e167ad9539e3953
Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/853574
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2018-01-29 05:24:45 -08:00
YB.Ha
14e6afb4f2 nautilus : fix abnormal led operation
The charge state is set to IDLE when battery temperature
is under 0 or over 50 degrees and led is set to green although
external power does not present.
This CL fix this issue.

b:72423182
BRANCH=none
TEST=build/test in nautilus

Change-Id: I238096d46a426dd3ad579540c06eb306f2d1b490
Reviewed-on: https://chromium-review.googlesource.com/888358
Commit-Ready: YongBeum.Ha <ybha@samsung.corp-partner.google.com>
Tested-by: YongBeum.Ha <ybha@samsung.corp-partner.google.com>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2018-01-29 03:06:35 -08:00