Commit Graph

3792 Commits

Author SHA1 Message Date
Jett Rink
7824f5656d yorp: use cbi for board version
Replace ADC-based board version with CBI/EEPROM board version. This will
cause all of the existing boards to report -1 (or 65535) as their
board version until you can update it from the kernel.

To set your board version to 0 run the following command in
the AP console when WP if off (e.g. battery removed)

$ ectool cbi set 0 0 1 2

BRANCH=none
BUG=b:77551185,b:77900842
TEST=wrote to cbi from ap console and verify flash state on
ap and ec console

Change-Id: I03987cc89ca4c14580dcf61de23780fe5304663b
Signed-off-by: Jett Rink <jettrink@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1008832
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2018-04-13 13:25:29 -07:00
Scott Collyer
133fe0668c yorp: Add support for Sanyo battery
Currently we only support the Acer LG and Panasonic battery. There is
a 3rd Acer battery type that Quanta could be providing us with for
Yorp proto boards. This CL adds support for the Sanyo battery.

BUG=b:74132235
BRANCH=none
TEST=verifed that when connected to Sanyo battery that the battery is
reported as present.

Change-Id: I1810da59866795e93340163216412441be098795
Signed-off-by: Scott Collyer <scollyer@google.com>
Reviewed-on: https://chromium-review.googlesource.com/1011557
Commit-Ready: Jett Rink <jettrink@chromium.org>
Tested-by: Scott Collyer <scollyer@chromium.org>
Reviewed-by: Jett Rink <jettrink@chromium.org>
2018-04-13 13:25:19 -07:00
Scott Collyer
1e677d3f32 anx7447: Add functions to the anx7447 driver to check/erase OCM flash
This CL adds support to check if the OCM flash is erased and if not,
will erase it at initialization time. These changes are encapsulated
in a new config option CONFIG_USB_PD_TCPM_ANX7447_OCM_ERASE and this
option is enabled for Yorp boards.

BUG=b:77658388
BRANCH=NONE
TEST=make -j buildall. Tested on a board that hadn't yet been
erased. Verifed the message
"anx7447: OCM flash checked and successfully erased"
was in the EC log, but did not show up on subsequent reboots.

Change-Id: I660e76a9498d3dc1ba821a04317b324f716c5089
Signed-off-by: Scott Collyer <scollyer@google.com>
Reviewed-on: https://chromium-review.googlesource.com/988414
Commit-Ready: Jett Rink <jettrink@chromium.org>
Tested-by: Jett Rink <jettrink@chromium.org>
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
2018-04-13 13:25:13 -07:00
Mark Hayter
4bfde23411 Documentation for CCD and servo_micro
Add markdown documentation (from reviewed doc) for the Servo Micro as
an example of CCD.

Tested with emacs markdown preview (markdown package) which is almost
the same as gitiles.

BUG=none
BRANCH=none
TEST=emacs markdown preview
Signed-off-by: Mark Hayter <mdhayter@chromium.org>

Change-Id: Ic5877a3b80313089ab9c79e376b4ee1f58e573eb
Reviewed-on: https://chromium-review.googlesource.com/996893
Commit-Ready: Mark Hayter <mdhayter@chromium.org>
Tested-by: Mark Hayter <mdhayter@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Nick Sanders <nsanders@chromium.org>
2018-04-13 01:43:28 -07:00
Dino Li
c2927f7dbb cleanup: it83xx: pull pnpcfg_settings[] to the chip-level
With this change, we don't need to declare pnpcfg_settings[]
for each it83xx based board.

BUG=b:76022972
BRANCH=none
TEST=make buildall -j, boot to kernel on reef_it8320.

Change-Id: I39eb465ba7d6191dce4ab1a39787a2c925ec3b91
Signed-off-by: Dino Li <Dino.Li@ite.com.tw>
Reviewed-on: https://chromium-review.googlesource.com/1009544
Commit-Ready: Vijay P Hiremath <vijay.p.hiremath@intel.com>
Tested-by: Vijay P Hiremath <vijay.p.hiremath@intel.com>
Reviewed-by: Vijay P Hiremath <vijay.p.hiremath@intel.com>
Reviewed-by: Jett Rink <jettrink@chromium.org>
2018-04-12 23:10:59 -07:00
Caveh Jalali
5b521e3ac6 atlas: manage USB-C high speed muxes
this adds control over the USB high speed muxes as a function of DP
HPD.  this allows an external monitor to be added/removed with
chromeos extending the display as appropriate.

BUG=b:77151172
BRANCH=none
TEST=chromeos detects external monitor plugin and extends display

Change-Id: I7df7a8136ddaa4eeaca800d29b46350dafd8f838
Signed-off-by: Caveh Jalali <caveh@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1009208
Commit-Ready: Caveh Jalali <caveh@google.com>
Tested-by: Caveh Jalali <caveh@google.com>
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Duncan Laurie <dlaurie@google.com>
2018-04-12 01:25:33 -07:00
Divya Sasidharan
36df8427f4 yorp: Configure CONFIG_EXTPOWER_DEBOUNCE_MS
Without this configuration defined the board assumes
battery only mode for G3->S5 boot up power sequence and
thereby waits for power button press.

BUG=b:76230069;b:75974377
BRANCH=None
TEST=On yorp, with battery and external power connected
reboot on EC console boot the SoC to S0. Verify on both ports.

Change-Id: I837b7f99bd3c238ce74e394c773169d703ad9392
Signed-off-by: Divya Sasidharan <divya.s.sasidharan@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/1008247
Commit-Ready: Aaron Durbin <adurbin@chromium.org>
Tested-by: Divya S Sasidharan <divya.s.sasidharan@intel.com>
Reviewed-by: Vijay P Hiremath <vijay.p.hiremath@intel.com>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Jett Rink <jettrink@chromium.org>
2018-04-11 22:52:42 -07:00
Divya Sasidharan
7abf83842a yorp: Disable config for DRP_AUTO_TOGGLE
Since there are known issues with ANX7447 driver to work
reliably in low power mode, disable DRP_AUTO_TOGGLE option
since TCPC_LOW_POWER mode config and this one should be disabled
together.

BUG=b:77544959
BRANCH=None
TEST=On yorp; on port 0 and 1 test without and with battery boots up.
Please note with battery we may still need to press power button to
get the SoC to boot up to S0 b:76230069.
Detaching the Type-C charger with battery connected also shuts down
the system which is a known failure b:77606986.

Change-Id: I1b744cd9aa063328845f9a1cc7e36d291dfec9f5
Signed-off-by: Divya Sasidharan <divya.s.sasidharan@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/1007629
Commit-Ready: Divya S Sasidharan <divya.s.sasidharan@intel.com>
Tested-by: Divya S Sasidharan <divya.s.sasidharan@intel.com>
Reviewed-by: Scott Collyer <scollyer@chromium.org>
Reviewed-by: Jett Rink <jettrink@chromium.org>
2018-04-11 14:55:39 -07:00
Nicolas Boichat
fb7817c735 poppy: Move PMIC init to a deferred function
Instead of doing I2C traffic in an init hook, move it to a
deferred function to be called outside of INIT_HOOK processing.

(identical to CL:1001474 on eve branch, moved to poppy board
file)

BUG=b:77336348
BRANCH=poppy
TEST=while true ; do ectool reboot_ec RO ; ectool reboot_ec RW ; done for 24 hours

Change-Id: Icd9c2096ca026da6308b74582144886b30ea965f
Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1003436
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2018-04-11 01:19:51 -07:00
raymondchou
74f8a8595d Nami: Disable ALS for Sona
Use OEM ID to update motion_sensor_count to disable ALS for Sona.

BUG=b:77185923
BRANCH=none
TEST=Change oem id for Sona then to check the ALS was disabled.

Change-Id: I25714d0a2d2c0f4e9855a70fcb12cb9e65bae9f8
Signed-off-by: raymondchou <raymond_chou@compal.corp-partner.google.com>
Reviewed-on: https://chromium-review.googlesource.com/986034
Commit-Ready: Raymond Chou <raymond_chou@compal.corp-partner.google.com>
Tested-by: Raymond Chou <raymond_chou@compal.corp-partner.google.com>
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-by: stanley zhong <stanley_zhong@compal.corp-partner.google.com>
2018-04-10 21:55:28 -07:00
Mary Ruthven
b0f79a7044 cr50:usb_spi: add Cheza EC support
The Cheza EC requires EC_RX_H1_TX be held low while the EC is being
reset to enter gang mode. This change adds another programming mode to
ec usb spi programming to do that.

BUG=b:74388083
BRANCH=cr50
TEST=The cheza boards aren't in, so I just tested EC_TX_CR50_RX_OUT
gpioset EC_TX_OUT 0 and 1 setup EC_TX_CR50_RX_OUT correctly as an
output when asserted and an input when deasserted.

Change-Id: I7fc9cba954f2af5a841f00ce5bf8a27251b33bbe
Signed-off-by: Mary Ruthven <mruthven@google.com>
Reviewed-on: https://chromium-review.googlesource.com/1003529
Commit-Ready: Mary Ruthven <mruthven@chromium.org>
Tested-by: Mary Ruthven <mruthven@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2018-04-10 21:55:21 -07:00
Aseda Aboagye
46ca9738f2 chgstv2: Check charger power in prevent_power_on.
charge_prevent_power_on() had sections which were gated on the following
CONFIG_* option:

    CONFIG_CHARGER_LIMIT_POWER_THRESH_BAT_PCT

However, the block of code that this gated didn't even take the battery
percentage into account and made it very confusing as to why.

This commit simply changes the CONFIG_* option used to gate to be the
following:

    CONFIG_CHARGER_MIN_POWER_MW_FOR_POWER_ON

This better reflects the checks that were actually being made.

Additionally, this CONFIG_* option is defined by default for boards that
have a chipset task and is initialized to 15W, which is the power that
indicates that the charger is likely to speak USB PD.

BUG=b:76174140
BRANCH=None
TEST=make -j buildall

Change-Id: Ic9158dd7109ce6082c6d00157ff266842363b295
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Reviewed-on: https://chromium-review.googlesource.com/977431
Commit-Ready: Aseda Aboagye <aaboagye@chromium.org>
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Edward Hill <ecgh@chromium.org>
2018-04-10 19:13:32 -07:00
Divya Sasidharan
dccaf9d9fc yorp: Enable DP alternate mode
This code enables alternate mode path for
DP for both TypeC ports.

BUG=b:77496487
BRANCH=None
TEST=On yorp; check if the mux is set correctly
for DP use cases. When PD message for hot plug is received
by EC, EC (write register) ---> TCPC (GPIO) ---> SoC,
and display comes up with both ports.

Change-Id: Idfd0f85dc02a04adb266f2755a6d68dcb20141f8
Signed-off-by: Divya Sasidharan <divya.s.sasidharan@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/1003330
Commit-Ready: Divya S Sasidharan <divya.s.sasidharan@intel.com>
Tested-by: Divya S Sasidharan <divya.s.sasidharan@intel.com>
Reviewed-by: Jett Rink <jettrink@chromium.org>
2018-04-10 19:13:31 -07:00
Nicolas Boichat
3a9b89116f nautilus: Shrink accelerometer FIFO to 512 entries
It appears that the shared memory buffer on Nautilus starts at
200c7720 D __shared_mem_buf

That's 29.78 kb into the RAM. Software sync needs 1kb, so we should
be fine, expect that the last 2kb of RAM are supposed to be reserved
for the "booter" (NPCX_BTRAM_SIZE).

We shrink the accelerometer FIFO to 512 entries, freeing up 4kb of
RAM, and increase the UART TX buffer to 4kb, to make use of 3kb of
that freed up space:
200c7320 D __shared_mem_buf

That's 28.78 kb into the RAM.

BRANCH=poppy
BUG=chromium:739771
TEST=make BOARD=nautilus -j, check that shared_mem_buf offset is
     < 29 kb.

Change-Id: I361a439b847d31d3415f2ee66229bd32f8816e2d
Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1002712
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Reviewed-by: Philip Chen <philipchen@chromium.org>
Reviewed-by: Gwendal Grignou <gwendal@google.com>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2018-04-10 19:13:28 -07:00
Jett Rink
be6a263638 usb_charger: initialize VBUS supplier at startup
When using VBUS_DETECT_TCPC the charger code relied on the TCPC
alert to initialize the VBUS supply, but that happens too late in
board startup sequence to allow an initally plugged in USB-C power
supply to be chosen as the active charging port.

We can and should initialize the the supplier sooner as to prevent
the charge_manager_is_seeded() check from failing thus preventing
the board from choosing a charging port.

BRANCH=none
BUG=b:77458917
TEST=PS8751 on yorp will negotiate 20V over USB-C (which was prevent
	by the charge_manager not being seeded)

Change-Id: I6f612c508932a90ece0036ce8310a20de02d8467
Signed-off-by: Jett Rink <jettrink@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/994707
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: Divya S Sasidharan <divya.s.sasidharan@intel.com>
Reviewed-by: Divya S Sasidharan <divya.s.sasidharan@intel.com>
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2018-04-10 19:12:55 -07:00
Jett Rink
c8814430d6 yorp: add more USB-C power logic
* TCPC reset
* PPC input charging (current/voltage limits)
* PPC output charging
* VBUS presence detection

BRANCH=none
BUG=b:74127309,b:77458917,b:77579760
TEST=yorp C1 can negotiate 20V at 3A

Change-Id: Ifa84071be1617a060a217d00bc102d836edffe95
Signed-off-by: Jett Rink <jettrink@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/991081
2018-04-10 19:12:47 -07:00
Vincent Palatin
98c4ef1870 Add nocturne_fp board configuration
Just alias it for now.

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

BRANCH=poppy
BUG=b:77836478
TEST=make BOARD=nocturne_fp
CQ-DEPEND=CL:1004735

Change-Id: I81a956213c626be19b48a4e8ee6f6c23e8e391e4
Reviewed-on: https://chromium-review.googlesource.com/1004755
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Nicolas Norvez <norvez@chromium.org>
2018-04-10 19:12:40 -07:00
Gwendal Grignou
17a7b0b30a FIXUP: meowth: Add Gyro/FIFO support
Remove SPI define, set EC period properly.

BUG=None
BRANCH=none
TEST=check accel and gyro data.

Change-Id: Ic2af6ca9721d127867a39b76e80aa396403a628d
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/999815
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
2018-04-10 10:57:30 -07:00
Divya Sasidharan
7e1ce92219 cleanup: CONFIG_USB_PD_CUSTOM_VDM is not used
The pd_custom_vdm is called in common/usb_pd_protocol no
matter you have this defined or not. No where else I see
pd_vdm being used. So we should not have to deal with this
CONFIG_USB_PD_CUSTOM_VDM.

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

Change-Id: I4e8b710240ee27b12625d797e7824f29044e6462
Signed-off-by: Divya Sasidharan <divya.s.sasidharan@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/998520
Commit-Ready: Divya S Sasidharan <divya.s.sasidharan@intel.com>
Tested-by: Divya S Sasidharan <divya.s.sasidharan@intel.com>
Reviewed-by: Vijay P Hiremath <vijay.p.hiremath@intel.com>
Reviewed-by: Jett Rink <jettrink@chromium.org>
2018-04-09 15:19:00 -07:00
Jett Rink
32bbdbf88c bip: add initial power sequence usb-pd
BRANCH=none
BUG=b:75972988,b:76218141
TEST=buildall

Change-Id: I8d03f10828821c6d8e096d882db9f82cc901003a
Signed-off-by: Jett Rink <jettrink@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/982562
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2018-04-09 15:18:52 -07:00
Philip Chen
eab54036ea nautilus: Support tristate board id strapping pin
With 3 binary strapping pins, we only have 7 available board ids:
000, 001, 010, 011, 100, 101, 110, 111.

Let's make the MSB of board id tristate. So we can have 4 more
board ids to use:
Z00, Z01, Z10, Z11.

BUG=b:77731277
BRANCH=poppy
TEST=build nautilus

Change-Id: I7aebb89437d2ccb9eea6c477155b25d964983232
Signed-off-by: Philip Chen <philipchen@google.com>
Reviewed-on: https://chromium-review.googlesource.com/1000875
Commit-Ready: Philip Chen <philipchen@chromium.org>
Tested-by: Philip Chen <philipchen@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
2018-04-09 01:34:49 -07:00
Gwendal Grignou
7f5299cb7a FIXUP: board: Add CONFIG_ACCEL_FORCE_MODE_MASK for ALS when needed
Enabled forced mode for BMI160 accelerometer on soraka by mistake.

BUG=b:67112751,b:75533383
BRANCH=poppy
TEST=Compile

Change-Id: I429a1d527a56c371351f8248912c580f8680447f
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1000726
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
2018-04-07 12:06:12 -07:00
Nicolas Boichat
60ca132916 poppy: Increase console buffer size to 4096 bytes
Increase the size from 1024 to 4096 to reduce the likelihood of
overflows. To make space for the larger buffer, we reduce
CONFIG_ACCEL_FIFO to 512 entries (from 1024 entries: saves 4096
bytes of RAM).

grep shared_mem_buf build/lux/RW/ec.RW.smap
Before this patch:
200c74e0 D __shared_mem_buf
After this patch:
200c70e0 D __shared_mem_buf
(we saved 1024 bytes of RAM)

BRANCH=poppy
BUG=b:77159941
TEST=Flash lux, see that we do not lose EC logs in /var/log/cros_ec.log.

Change-Id: I320c370369364b280e59f490a86f057fbb502da3
Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/983080
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2018-04-07 00:05:56 -07:00
Duncan Laurie
c0ebdaee16 atlas: Add new board
This is based on the initial code from Caveh here:
https://chromium-review.googlesource.com/959861

Most things are functional, with some workarounds for P0 boards.
The type-c hotplug is not working in this commit, the HPD will be
run from the tcpm in the next board build.  For now we might be
able to get it working on P0 with some more tweaking..

The other known issue is that the battery takes ~2 seconds to
come back online after a cutoff (the auto-power-on timeout is
one second so the board will not power on like it should) and
sometimes the battery is not responding properly on i2c and it
requires an EC reset.

BUG=b:75070158
BRANCH=none
TEST=tested on P0 boards

Change-Id: I438cb93b78d6f501426842d6cbe3d6a994563358
Signed-off-by: Duncan Laurie <dlaurie@google.com>
Signed-off-by: Caveh Jalali <caveh@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/982498
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Tested-by: Caveh Jalali <caveh@google.com>
Reviewed-by: Caveh Jalali <caveh@google.com>
2018-04-06 14:44:06 -07:00
Scott Collyer
bf6be57ca2 yorp: Include anx7447 driver for port 0
Port 0 uses the Anx7447. This CL updates the tcpc config to use the
Anx7447 driver instead of the Anx74xx driver.

BUG=b:74127309
BRANCH=NONE
TEST=make -j BOARD=yorp and verified that when connected external type
C charger to port 0 it reaches SNK_READY

Change-Id: I96967a1d272fcda079280ba6d2f0eb5ed8e3dd7f
Signed-off-by: Scott Collyer <scollyer@google.com>
Reviewed-on: https://chromium-review.googlesource.com/982894
Commit-Ready: Scott Collyer <scollyer@chromium.org>
Tested-by: Scott Collyer <scollyer@chromium.org>
Reviewed-by: Jett Rink <jettrink@chromium.org>
2018-04-05 18:41:19 -07:00
Gwendal Grignou
211c212520 meowth: Add Sync support
BUG=b:73546254
BRANCH=master
TEST=Check sync sensor is present with accelinfo.

Change-Id: Id971d9f1908a2e04be325ac54d3ed600ee7901cd
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/986919
Reviewed-by: Alexandru M Stan <amstan@chromium.org>
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
2018-04-05 18:41:13 -07:00
Gwendal Grignou
54884c45c5 meowth: Add Gyro/FIFO support
Enable Gyro and collect data with FIFO.

BUG=b:73546254
BRANCH=master
TEST=Check gyro data is correct when enabled.
Run CTS test: cheets_CTS_N.7.1_r15.x86.CtsHardwareTestCases

Change-Id: I41321cfc8e7b4f8a006ee45c3a9d11305761315d
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/986918
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
2018-04-05 18:41:13 -07:00
Divya Sasidharan
96931840bc yorp: Enable LED support
BUG=b:74952719
BRANCH=master
TEST=make buildall -j

Change-Id: I49c2f9729425c1c2a08d2a73449b1bfb1912ecc5
Signed-off-by: Divya Sasidharan <divya.s.sasidharan@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/979393
Commit-Ready: Divya S Sasidharan <divya.s.sasidharan@intel.com>
Tested-by: Divya S Sasidharan <divya.s.sasidharan@intel.com>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Jett Rink <jettrink@chromium.org>
2018-04-05 15:20:39 -07:00
Divya Sasidharan
d1d5dc162a yorp: Enable keyboard support
BUG=b:77487719
BRANCH=None
TEST=make buildall -j; on yorp test keyboard

Change-Id: Ieb3da871cfa6e2274a3e54274497846787edb796
Signed-off-by: Divya Sasidharan <divya.s.sasidharan@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/984385
Commit-Ready: Divya S Sasidharan <divya.s.sasidharan@intel.com>
Tested-by: Divya S Sasidharan <divya.s.sasidharan@intel.com>
Reviewed-by: Jett Rink <jettrink@chromium.org>
2018-04-04 20:55:34 -07:00
Furquan Shaikh
5bf954bedf nautilus: Lower VCCIO from 0.975V to 0.850V
CQ-DEPEND=CL:*602341
BUG=b:77496214
BRANCH=poppy
TEST=None

Change-Id: If04161615343f573d0de0881667564f7384c2605
Signed-off-by: Furquan Shaikh <furquan@google.com>
Reviewed-on: https://chromium-review.googlesource.com/996804
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2018-04-04 20:55:22 -07:00
Vadim Bendebury
f2eac533dc cr50: use run time generated public RMA key definition
Use RMA public key definition generated based on the binary blob
containing the key and key ID.

Key generation is controlled by the make file in common/, but actual
key blob comes from the board directory.

The structure holding the key and key ID is being modified to allow
initialization using a flat array.

No more need in defining CONFIG_RMA_AUTH_SERVER_PUBLIC_KEY and
CONFIG_RMA_AUTH_SERVER_KEY_ID.

BRANCH=cr50, cr50-mp
BUG=b:73296144, b:74100307
TEST='make buildall' still succeeds.
     test RMA server generated authentication codes are accepted when
     unlocking RMA.

Change-Id: I8ade94de6eb69b3e49bc5b948dbac20e59962acf
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/990783
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2018-04-04 18:52:03 -07:00
Dylan Lai
82a357a385 TCPM: Add TCPM driver for Analogix anx7447 chip
Driver implements TCPC for ANX7447 chip. Enable Type C
port for USB and DP alt mode.

BUG=b:73793947
BRANCH=NONE
TEST=tested compiled binary for pdeval-stm32f072 board with this patch.
Power contract establishment, port role swap, DP alt mode works fine.

Change-Id: Ic11e499fc5fb4aba7732c75e4cb2fee54828c616
Reviewed-on: https://chromium-review.googlesource.com/956790
Commit-Ready: Scott Collyer <scollyer@chromium.org>
Tested-by: Scott Collyer <scollyer@chromium.org>
Reviewed-by: Scott Collyer <scollyer@chromium.org>
2018-04-03 21:40:51 -07:00
Vijay Hiremath
a9c7d6b0d7 Code cleanup: Remove cold reset logic
Majority of the chipsets do not have a dedicated GPIO to trigger
AP cold reset. Current code either ignores cold reset or does a warm
reset instead or have a work around to put AP in S5 and then bring
back to S0. In order to avoid the confusion, removed the cold reset
logic and only apreset is used hence forth.

BUG=b:72426192
BRANCH=none
TEST=make buildall -j
     Manually tested on GLKRVP, apreset EC command can reset AP.

Change-Id: Ie32d34f2f327ff1b61b32a4d874250dce024cf35
Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/991052
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>
Reviewed-by: Jett Rink <jettrink@chromium.org>
2018-04-03 18:47:12 -07:00
Vadim Bendebury
44c81deec4 cr50: prepare using blobs as RMA key sources
This patch brings in both prod and test RMA server public keys as two
binary files.

A bash script for converting binary blob into C definition is also
provided.

BRANCH=cr50, cr50-mp
BUG=b:73296144, b:74100307
TEST=none yet

Change-Id: I2edd78164b8c912408ac7eda2e0a3a0262a8e81f
Signed-off-by: Vadim Bendebury <vbendeb@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/990782
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2018-04-03 18:47:04 -07:00
Jett Rink
aac3da46a0 yorp: add board version
Hard code value to 0 for now.

BRANCH=none
BUG=b:76448181
TEST=none

Change-Id: Iefe91fb02a958f40a1ff63c122792a390a545290
Signed-off-by: Jett Rink <jettrink@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/984517
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2018-04-02 22:42:48 -07:00
Nick Sanders
2c5f85f666 servo_v4: extend pd task stack
This works around the occasional garbage packet storm
found in coral, which causes a stack overflow.

BUG=b:77336824
TEST=loop power_state:rec on coral 200x
BRANCH=servo

Signed-off-by: Nick Sanders <nsanders@chromium.org>

Change-Id: I08faf333cb0e7b7bb7016956de44f43621b950ea
Reviewed-on: https://chromium-review.googlesource.com/989215
Commit-Ready: Nick Sanders <nsanders@chromium.org>
Tested-by: Nick Sanders <nsanders@chromium.org>
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
2018-04-02 16:26:45 -07:00
Shamile Khan
ba20a76660 yorp: Enable Trackpad power
Enable trackpad power when chipset is in S0 state. Keep
it disabled in other states.

BUG=b:73137125
BRANCH=master
TEST=On Octopus, kernel logs show ELAN enumerated

Change-Id: Ie1fd8ab777e82d900418127b4efee29fe65d1423
Signed-off-by: Shamile Khan <shamile.khan@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/984405
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2018-03-31 04:34:09 -07:00
Philip Chen
f319a80975 scarlet: Enable charge termination only when battery is present
If we enable charge termination when booting w/o battery,
charge termination would trigger and cut the power for max17055.

BUG=b:72697658
BRANCH=scarlet
TEST=Read rt946x reg 0x02, confirm charge termination is
disabled when booting w/o battery, and enabled otherwise.

Change-Id: I5780196ad993299ddfb37621bee5e941aa9b0d14
Signed-off-by: Philip Chen <philipchen@google.com>
Reviewed-on: https://chromium-review.googlesource.com/989314
Commit-Ready: Philip Chen <philipchen@chromium.org>
Tested-by: Philip Chen <philipchen@chromium.org>
Reviewed-by: Philip Chen <philipchen@chromium.org>
2018-03-31 01:56:32 -07:00
raymondchou
7c46ac84e1 Nami: Modify .output_settle_us of keyscan_config
Enable CONFIG_KEYBOARD_BOARD_CONFIG to set .output_settle_us
to 80us from 50us.

BUG=b:77182498
BRANCH=none
TEST=key in "ksstate on" in EC console, then to check
keyboard scan state after pressing each key.

Change-Id: I0c4d83dcbd382a832facb3e8508c5ddee04ac2e6
Signed-off-by: raymondchou <raymond_chou@compal.corp-partner.google.com>
Reviewed-on: https://chromium-review.googlesource.com/983653
Commit-Ready: Raymond Chou <raymond_chou@compal.corp-partner.google.com>
Tested-by: Raymond Chou <raymond_chou@compal.corp-partner.google.com>
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
2018-03-29 22:00:20 -07:00
Dino Li
defa59c6d1 cleanup: it83xx: don't enable non-essential modules at default
We let board-level code to enable them if needed.

BUG=none
BRANCH=none
TEST=make buildall -j

Change-Id: I9369e33ee1821125cf8719a0c3526afaf294da80
Signed-off-by: Dino Li <Dino.Li@ite.com.tw>
Reviewed-on: https://chromium-review.googlesource.com/985346
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2018-03-29 19:51:48 -07:00
Scott Collyer
89f1ee5b5f yorp: Add tcpc alert handling
This CL adds required code to the tcpc_alert_event() and
tcpc_get_alert_status() functions. In addition, it adds
board_tcpc_init().

The ANX7447 does not have an EC controlled reset line. Other than that
modification the actions taken in tcpc_alert_event and
tcpc_get_alert_status are the same as what's been done of previous
projects using these TCPCs.

board_reset_pd_mcu still needs to be implemented, but is not related
to the tcpc_alert_event() and tcpc_get_alert_status() functions. Also,
at this point ANX7447 is not supported as that depends on the driver
landing.

BUG=b:74127309
BRANCH=none
TEST=Verifed that with external charger that USB PD state machine
advances to SNK_READY state. Note that port 0 does not work at all in
this version.

Change-Id: Ib887b4dba6bacb4b3fb6e03f634362e1c3aa4da2
Signed-off-by: Scott Collyer <scollyer@google.com>
Reviewed-on: https://chromium-review.googlesource.com/982518
Commit-Ready: Scott Collyer <scollyer@chromium.org>
Tested-by: Scott Collyer <scollyer@chromium.org>
Reviewed-by: Jett Rink <jettrink@chromium.org>
2018-03-29 17:02:47 -07:00
Elthan_Huang
c00837e9a3 Nami: Multiple configurations of motion sensors
Nami and Vayne share the same EC image but with
different configuration of motion sensors .

Nami is w/ ALS, but Vayne is w/o ALS.

Create board_set_motion_sensor_count function to update
montion sensor count by oem id.

BUG=b:74608262
BRANCH=none
TEST=Change oem id to check the ALS function whether disable in Vayne.

Change-Id: I86481f8313adaf2585a781e5ad2dafe38008d2ab
Signed-off-by: Elthan_Huang <elthan_huang@compal.corp-partner.google.com>
Reviewed-on: https://chromium-review.googlesource.com/948882
Commit-Ready: Elthan Huang <elthan_huang@compal.corp-partner.google.com>
Tested-by: Elthan Huang <elthan_huang@compal.corp-partner.google.com>
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
2018-03-28 23:23:47 -07:00
Mary Ruthven
ed13cb82b6 cr50: use system_rollback_detected to detect rollback
system_rollback_detected is used to determine if the system rolledback
in the rest of the system code base and it's state is saved longer. This
change switches board.c to use that to determine the sysinfo output
instead of using the reset count.

The reset count is cleared when the system boots. Depending on how fast
the system boots it may be difficult to read sysinfo before the reset
counter is cleared. In these cases it is difficult to tell whether an
image has been rejected entirely or the image caused a rollback.

BUG=b:71804463
BRANCH=cr50
TEST=boot the device. Make sure sysinfo shows there's no rollback.
Rollback and make sure sysinfo shows the system has rolledback

Change-Id: Ic29b105c758d0984e47482b9384cf00fe202b716
Signed-off-by: Mary Ruthven <mruthven@google.com>
Reviewed-on: https://chromium-review.googlesource.com/984393
Commit-Ready: Mary Ruthven <mruthven@chromium.org>
Tested-by: Mary Ruthven <mruthven@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
2018-03-28 23:23:35 -07:00
Nicolas Boichat
b3ecc19cb3 charge_state_v2: Hibernate base in S5 with no AC
Tell the base to hibernate when we are in S5, and no AC is connected.
Also, wake the base when AC status changes (S5), and when the system
transistions out of S5.

BRANCH=none
BUG=b:71874971
TEST=1. Lid EC console: apshutdown => Check that Base EC hibernates
     2.a. Lid EC console: powerb; => Check that base reconnects
     2.b. Connect/disconnect adapter: check that base disconnects
          and reconnects

Change-Id: I5e9a4afc64a07ad92f37d171a78a914d26f07c8e
Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/958814
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2018-03-28 23:23:32 -07:00
Nicolas Boichat
bb1a079a62 wand: Fix second UART module, remove unneeded internal pull-up
MODULE_UART should be used for console UART, and MODULE_USART for
all secondary ones (like EC-EC side channel).

BRANCH=none
BUG=b:66575472
TEST=Flash wand, EC-EC communication works

Change-Id: I241bad7902c2e7228783ae1aa9cc33ad5da2c8a2
Signed-off-by: Nicolas Boichat <drinkcat@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/958813
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2018-03-28 19:34:19 -07:00
Scott Collyer
fc5a03fef9 yorp: Add support for LG and Panasonic batteries
This CL adds support for the LG and Panasoninc battery for yorp along
with the infrastructure to support multiple battery types.

BUG=b:74132235
BRANCH=none
TEST=make -j BOARD=yorp and make -j buildall

Change-Id: Idc0d0d29fb6f60eea962102cb096b97ada9d7eb6
Signed-off-by: Scott Collyer <scollyer@google.com>
Reviewed-on: https://chromium-review.googlesource.com/978619
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Divya S Sasidharan <divya.s.sasidharan@intel.com>
Tested-by: Scott Collyer <scollyer@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Jett Rink <jettrink@chromium.org>
2018-03-28 16:40:53 -07:00
Jett Rink
ffa4054760 usbc: add default I2C addresses
Add hard coded I2C addresses as defined by datasheet.

BRANCH=none
BUG=none
TEST=none

Change-Id: Ia69cc4da7474a9c1f8a994d33db88e0a405f02b7
Signed-off-by: Jett Rink <jettrink@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/982561
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
2018-03-28 16:40:40 -07:00
Philip Chen
f03486d36c scarlet: Limit the maximal acceptable VBUS to 5.5V
BUG=b:74399717
BRANCH=scarlet
TEST=Plug in a charger with 5V/9V/15V PD profiles, confirm
scarlet picks 5V

Change-Id: I58ee110d110d873b7221695bf4a182d6d04b65e1
Signed-off-by: Philip Chen <philipchen@google.com>
Reviewed-on: https://chromium-review.googlesource.com/982555
Commit-Ready: Philip Chen <philipchen@chromium.org>
Tested-by: Philip Chen <philipchen@chromium.org>
Reviewed-by: Alexandru M Stan <amstan@chromium.org>
2018-03-27 20:35:12 -07:00
Scott Collyer
a4146020c3 yorp: Fix I2C slave address for PPC
The initial checkin had this address set to NX20P3483_ADDR0, but since
the ADDR pin on the NX20P3483 is tied to GND, then it should be
NX20P3483_ADDR0.

BUG=b:74206647
BRANCH=none
TEST=test on Yorp P0 and verify [0.071748 p0: PPC init'd.]

Change-Id: I2f650140a7efadf028e4df54628c170da6931033
Signed-off-by: Scott Collyer <scollyer@google.com>
Reviewed-on: https://chromium-review.googlesource.com/982549
Commit-Ready: Scott Collyer <scollyer@chromium.org>
Commit-Ready: Furquan Shaikh <furquan@chromium.org>
Tested-by: Scott Collyer <scollyer@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Jett Rink <jettrink@chromium.org>
2018-03-27 20:35:03 -07:00
Aseda Aboagye
46bd51a69a meowth: zoombini: Enable CONFIG_VSTORE.
CONFIG_VSTORE is needed as a part of the verified boot process.  When
the AP boots up, it hashes its FW and asks the EC to store this hash.
When resuming, the AP will ask the EC for this hash.

Meowth and Zoombini were missing this option which was a reason why
resume was failing.

This CL simply enables the VSTORE module and adds 1 VSTORE slot.

BUG=b:72472969
BRANCH=None
TEST=With updated AP FW with HAVE_ACPI_RESUME, verify that
suspend/resume works.

Change-Id: I07d0ce3ef426dc1924de6085703a4174f353f83d
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Reviewed-on: https://chromium-review.googlesource.com/982598
Commit-Ready: Aseda Aboagye <aaboagye@chromium.org>
Tested-by: Vaibhav Shankar <vaibhav.shankar@intel.com>
Tested-by: Lijian Zhao <lijian.zhao@intel.com>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2018-03-27 20:34:53 -07:00