Commit Graph

23 Commits

Author SHA1 Message Date
Edward Hill
9734ec2d6b battery: Move fuel gauge code to common
Move fuel gauge code to common to avoid duplication in octopus and
grunt baseboards.

BUG=b:79704826,b:74018100
BRANCH=none
TEST=make -j buildall

Change-Id: I58a615c9ed7906cb19b49c2baa36aaa619838cf1
Signed-off-by: Edward Hill <ecgh@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1072637
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Vijay Hiremath <vijay.p.hiremath@intel.corp-partner.google.com>
Reviewed-by: Jett Rink <jettrink@chromium.org>
2018-06-01 17:44:20 -07:00
Edward Hill
f30bb2839f grunt: Board specific battery info
Split battery info between baseboard and board, following the
Octopus example. This will allow Grunt and Careena to define their
own lists of supported battery types.

This also adds CONFIG_BATTERY_REVIVE_DISCONNECT support, and
checks the charge/discharge FET status.

BUG=b:79704826,b:74018100
BRANCH=none
TEST=Grunt still boots ok.

Change-Id: I6e82ac5e48f9aabf59b63add253108513f0a6b60
Signed-off-by: Edward Hill <ecgh@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1072039
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Reviewed-by: Jett Rink <jettrink@chromium.org>
2018-06-01 17:44:19 -07:00
Edward Hill
cd5e7cbeb1 grunt: Reduce USB-C source current to 1.5A
Grunt and Careena hardware does not support sourcing 3A over USB-C
so reduce what we advertise to 1.5A.

BUG=b:78908554
BRANCH=none
TEST=Grunt advertises 1.5A Source Cap on both ports

Change-Id: Ifd3ddf45445ae69c5988dee4f66f21056b4b0f96
Signed-off-by: Edward Hill <ecgh@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1077096
Reviewed-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Jett Rink <jettrink@chromium.org>
2018-05-30 20:38:54 -07:00
Jett Rink
65cd9c106c yorp: drive PPC EN_SNK from TCPC gpio
Since the PS8751 is now driving the EN_SNK GPIO on the PPC, we cannot
reset without a battery otherwise we will brown out the board.

BRANCH=none
BUG=b:78896495,b:78021059
TEST=verified with reworked board.

Change-Id: Ibadf46de922c49f5fdd08c43991e71f852ff7600
Signed-off-by: Jett Rink <jettrink@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1067711
2018-05-29 13:37:35 -07:00
Edward Hill
13776ebef9 careena: Change LED colors
Careena has non-PWM White/Orange LEDs.

BUG=b:79704826,b:79894166
BRANCH=none
TEST=make -j buildall

Change-Id: Ie85de84fbd6e4ac4c6139d8407a7a25b5f6d5e7e
Signed-off-by: Edward Hill <ecgh@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1072898
Reviewed-by: Jett Rink <jettrink@chromium.org>
2018-05-25 20:31:50 -07:00
Edward Hill
092e647d99 careena: Make GPIOs match hardware
Update GPIO definitions for Careena to match hardware.

BUG=b:79704826
BRANCH=none
TEST=make BOARD=careena

Change-Id: I755e5fd8123eefdfa8d30ca2314435c28340e488
Signed-off-by: Edward Hill <ecgh@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1070989
Reviewed-by: Jett Rink <jettrink@chromium.org>
2018-05-25 20:31:50 -07:00
Edward Hill
4ab9fc9fa9 grunt: Move common code to baseboard
Move code that will be common to Grunt and Careena to baseboard
to avoid duplication when creating the Careena board.

Add Careena board files. These are currently just a copy of Grunt
and will be modified for Careena next.

BUG=b:79704826
BRANCH=none
TEST=Grunt still boots ok.

Change-Id: I6dd0035bdd62e92a7f3664120fc6ac3f23a0af4d
Signed-off-by: Edward Hill <ecgh@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1070988
2018-05-25 20:31:49 -07:00
Jett Rink
89275aff03 octopus: moving hibernate code to baseboard
bip also need to enable the sink path when going into hibernate

BRANCH=none
BUG=b:79948623
TEST=on bip, verfied that AC_OK, LID_OPEN, and POWER_BTN all wake the EC
up.

Change-Id: I2c1168f856cc45635b5c76f7ca409007fcf141cc
Signed-off-by: Jett Rink <jettrink@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1065203
2018-05-24 15:44:39 -07:00
Jett Rink
4a65a62f85 ppc: making driver non-const
We need to update the driver based on the runtime board id, so we need
to remove the const attribute.

BRANCH=none
BUG=b:78896495,b:78021059
TEST=build all -j

Change-Id: I5f751c33cf4ec68a38aeb8644170df4987c87d7b
Signed-off-by: Jett Rink <jettrink@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1068030
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2018-05-24 15:44:30 -07:00
Jett Rink
36d59f752f yorp: add keyboard backlight control
Enable PWM control of backlight in EC for yorp and phaser. Proto build
of bip will not have backlight control in EC.

BRANCH=none
BUG=b:79422226
TEST=none (no hardware to test with)

Change-Id: Ib6ed4af4de3145b112ed43b4ca1ec9f931f3875f
Signed-off-by: Jett Rink <jettrink@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1050785
Reviewed-by: Justin TerAvest <teravest@chromium.org>
2018-05-23 12:50:54 -07:00
Jett Rink
11bd4c0f4d bip: enabled PPC interrupts
Need to enable PPC interrupts, otherwise system doesn't work correctly
include USB 2.0 not working (since the BC1.2 chip won't be powered after
the Vbus change)

BRANCH=none
BUG=b:79886742
TEST=USB 2.0 works on insertion on C0 on bip

Change-Id: I227dcfac22128389c3d3ab3efdddd045141dff7e
Signed-off-by: Jett Rink <jettrink@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1066221
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2018-05-22 21:57:16 -07:00
Jett Rink
ad31abcfc8 espi: convert all eSPI board to use CONFIG_HOSTCMD_ESPI
Convert all boards that use both CONFIG_ESPI and CONFIG_LPC to only use
the CONFIG_HOSTCMD_ESPI option.

BRANCH=none
BUG=chromium:818804
TEST=entire stack works with lpc and espi

Change-Id: Idd1519494a4f880b7b2018d059579d50c5461fcf
Signed-off-by: Jett Rink <jettrink@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1067499
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2018-05-22 21:56:37 -07:00
Jagadish Krishnamoorthy
2c9c55da93 octopus: implement device mode
To enable device mode, set the gpio USB2_OTG_ID
in the respective boards to high.
Pull the gpio low to disable device mode.

BUG=b:79343083
BRANCH=NONE
TEST=On Yorp board, for UFP mode gpio USB2_OTG_ID should be high,
for DFP mode gpio USB2_OTG_ID should be low.
In OS console, lspci should list xdci.
(with chromiumos/third_party/coreboot/+/1064592)

Change-Id: I70f13a9705626d9bcbe989239f6826d35d8fa536
Signed-off-by: Jagadish Krishnamoorthy <jagadish.krishnamoorthy@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/1058832
Reviewed-by: Jett Rink <jettrink@chromium.org>
2018-05-22 15:54:11 -07:00
Jett Rink
5551befe2a octopus: enable trackpad (S3+) and backlight (S0)
Enable trackpad when entering S3, and display backlight when entering S0
and disable them on the opposite transition. Moving common code to
baseboard.

BRANCH=none
BUG=b:79900266
TEST=bip trackpad works in S3 as wake source. backlight turns off in
S0ix and S3.

Change-Id: I0937771093d87c020b3c0d94a482d108c5a5c180
Signed-off-by: Jett Rink <jettrink@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1064693
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2018-05-18 20:08:26 -07:00
Scott Collyer
23947f1d3b octopus: Display battery FET console message only when disconnected
With CONFIG_BATTERY_REVIVE_DISCONNECT once the battery FULL flag gets
set, charge_state_v2 will call battery_get_disconnect_state. That
function had console print that's only meaningful when the battery is
actually disconnected. To avoid flooding the EC console log under this
expected condition, this CL moves the console log so that it only
happens when the battery is present, but disconnected.

BRANCH=none
BUG=b:79133101
TEST=Verfied that with full battery the console log message is no
longer showing. Also verifed that can recover from battery cutoff
condition.

Change-Id: Id2e161cbd52c0ef07f28b94608f9615071327c97
Signed-off-by: Scott Collyer <scollyer@google.com>
Reviewed-on: https://chromium-review.googlesource.com/1064975
Commit-Ready: Scott Collyer <scollyer@chromium.org>
Tested-by: Scott Collyer <scollyer@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Jett Rink <jettrink@chromium.org>
2018-05-18 14:33:19 -07:00
Scott Collyer
83f8996bd0 octopus: Add CONFIG_BATTERY_REVIVE_DISCONNECT
Adding this config so that battery_get_disconnect_state() is called
directly as a condition in prevent_power_on instead of having this be
a condition battery_is_present. This change allows precharge current
to be sent to the battery when the battery is dead or recovering from
battery cutoff condition.

BRANCH=none
BUG=b:79133101
TEST=tested on Yorp and verfied that in both dead battery and battery
cutoff cases, the battery wakes up as expected.

Change-Id: Iefec578dd241ddb832630ffa2530ba7c631f9a96
Signed-off-by: Scott Collyer <scollyer@google.com>
Reviewed-on: https://chromium-review.googlesource.com/1053096
Commit-Ready: Scott Collyer <scollyer@chromium.org>
Tested-by: Scott Collyer <scollyer@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Jett Rink <jettrink@chromium.org>
2018-05-16 12:41:52 -07:00
Scott Collyer
f6f884b7b1 bip: Undef auto toggle and low power TCPC config options
The ITE TCPC driver does not current support drp_toggle and so can't
have these config options defined. The driver method for drp_toggle is
set to NULL which causes the EC to reboot when power button is pressed
as that calls drp_toggle in the chipset hook.

BRANCH=none
BUG=b:79637786
TEST=Verfied that with these config options not defined the EC no
longer reboots when power button is pressed.

Change-Id: I08e27bb2541bac4fac52411d9c01a366b8874379
Signed-off-by: Scott Collyer <scollyer@google.com>
Reviewed-on: https://chromium-review.googlesource.com/1059580
Commit-Ready: Scott Collyer <scollyer@chromium.org>
Tested-by: Scott Collyer <scollyer@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Jett Rink <jettrink@chromium.org>
2018-05-16 12:41:40 -07:00
Jett Rink
4148738134 yorp: renegotiate Vbus down before hibernating
When we support the lowest power mode for Nuvoton in the next spin, we
will shed the TCPC/PPC power rail during hibernate. Before we drop the
power for the PPCs we need to ensure that Vbus is lower than the
hard-coded 6.8V dead-battery mode over-voltage threshold, otherwise we
will lock ourselves out of power.

BRANCH=none
BUG=b:79218851
TEST=verified that yorp renegotiates Vbus to 5V when entering hibernate
via ec `hibernate` cmd.

Change-Id: I4a98573eefb5757eea02dc48c64d5f9358b5e0b7
Signed-off-by: Jett Rink <jettrink@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1047954
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2018-05-08 13:17:16 -07:00
Jett Rink
52848179d2 octopus: move more implementation to baseboard
Move driver configuration to baseboard in preparation for phaser board

BRANCH=none
BUG=none
TEST=yorp still works

Change-Id: Ifeb434d2d4103160acd6eb9f784533d1ae0ae35a
Signed-off-by: Jett Rink <jettrink@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1042729
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2018-05-04 03:01:58 -07:00
Jett Rink
f24dc485fe octopus: move common function to baseboard
Move common variables and functions to baseboard from yorp and bip

BRANCH=none
BUG=none
TEST=builds

Change-Id: Ic74bec45f4ff6c833e4ef0620380f21b2ed6a041
Signed-off-by: Jett Rink <jettrink@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1040107
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Vijay Hiremath <vijay.p.hiremath@intel.corp-partner.google.com>
2018-05-02 22:20:31 -07:00
Jett Rink
e47daed322 octopus: move common CONFIG defines into baseboard
The `make BOARD=yorp print-configs` and bip version
show no diff before and after this change.

BRANCH=none
BUG=none
TEST=verify the print-configs output does not change.

Change-Id: If2cdc39b685f529ece707b9831052daf58e91dfa
Signed-off-by: Jett Rink <jettrink@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1038898
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Vijay Hiremath <vijay.p.hiremath@intel.corp-partner.google.com>
2018-05-02 22:20:31 -07:00
Jett Rink
a34e253d28 octopus: move common usb/battery code into baseboard
Also implement a few remaining usb function for bip

BRANCH=none
BUG=b:75972988,b:76218141,b:74132235,b:78344554
TEST=verified yorp still functions

Change-Id: I201408b5db689ac4a5bcab0011bc38698271b851
Signed-off-by: Jett Rink <jettrink@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1024279
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
2018-04-26 17:00:45 -07:00
Scott Collyer
514c3b3e26 ec: Add /baseboard to EC project
This CL introduces /baseboard to the EC project which can contain
config options and code which is specific to certain family, but can
be shared among the board derivatives of that family. Only the
infrastructure changes are included with an empty baseboard.c/.h for
octopus.

BRANCH=none
BUG=b:74358864
TEST='make buildall' and ensure that all boards build successfully. In
addition, temporarily moved config options for USB-C and charger to
baseboard.h and tested that 'make BOARD=yorp' is successful.

Change-Id: I16656574f835c56598a9d2bf49bc1e946d71fe76
Signed-off-by: Scott Collyer <scollyer@google.com>
Reviewed-on: https://chromium-review.googlesource.com/954444
Commit-Ready: Scott Collyer <scollyer@chromium.org>
Tested-by: Scott Collyer <scollyer@chromium.org>
Reviewed-by: Furquan Shaikh <furquan@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2018-03-15 15:27:31 -07:00