Commit Graph

32 Commits

Author SHA1 Message Date
Shawn Nematbakhsh
2c0843e845 chell / chell_pd: Use power-optimized GPIO defaults
Pull floating pins high, don't duplicate external pull ups, and make a
few other minor changes.

BUG=chrome-os-partner:48109
TEST=Verify chell continues to boot and S5 power is reduced to
~5.5 mW.
BRANCH=None

Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Change-Id: Iaee0cc926149dae1f4189e6b9e4f7e3a4da6ba1c
Reviewed-on: https://chromium-review.googlesource.com/319165
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Alec Berg <alecaberg@chromium.org>
2015-12-24 01:43:00 -08:00
Bruce
c48f8c3af3 Chell: modify led setting for led test command.
BUG=None
BRANCH=None
TEST=the test command can control led.

Change-Id: Iaae49f35953448e2472196ba9b6411fe8d9487b4
Signed-off-by: Bruce.Wan <Bruce.Wan@quantatw.com>
Reviewed-on: https://chromium-review.googlesource.com/318165
Commit-Ready: Bruce Wan <Bruce.Wan@quantatw.com>
Tested-by: Bruce Wan <Bruce.Wan@quantatw.com>
Reviewed-by: Shawn N <shawnn@chromium.org>
2015-12-16 03:35:41 -08:00
Duncan Laurie
a41d5c84ca glados/chell: Do not pull-up RSMRST to PCH in hibernate
If deep sleep S5 is supported RSMRST to the PCH should not be high
when the PCH is in S5 unless the board is sequencing out of deep sleep
and S5 state. Therefore, ensure RSMRST is low when the EC goes into
hibernate. This assumes deep sleep S5 is employed. A more appropriate
fix is to honor RMSRST state prior to going into hibernate state.
Without this change the behavior on certain platforms do not sequence
out of S5 when coming out of hibernate.

BUG=chrome-os-partner:48133
BRANCH=none
TEST=tested on a failing EVT chell board at the factory

Change-Id: Ia4a1cdb59c25a3fc704c64fbe6beb01ede90d777
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/317070
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2015-12-09 05:14:14 +00:00
Shawn Nematbakhsh
743a9ea7cd pwm: Add common initialization for PWM pins
Rather than having various PWM module groups initialized from various
HOOK_INIT functions, group them all into a single module and initialize
them all from a common function in pwm.c.

BUG=chromium:563708
TEST=Manual on samus / samus_pd (with CONFIG_ADC enabled). Verify that
samus fan + KB backlight control is functional and samus_pd correctly
sets PWM output.
BRANCH=None

Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Change-Id: I9f9b09bfa544cd9bc6b7a867e77757dff0505941
Reviewed-on: https://chromium-review.googlesource.com/314882
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Alec Berg <alecaberg@chromium.org>
2015-12-04 01:20:33 -08:00
Duncan Laurie
0e9cd95664 chell: Keep keyboard backlight off in hibernate
If pulled up the backlight will be at 100% brightness instead of off.

BUG=chrome-os-partner:48130
BRANCH=none
TEST=hibernate on chell, see keyboard backlight stay off

Change-Id: I30cd289b9492356407aa54e6a84b04add647bd9a
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/314936
Reviewed-by: Shawn N <shawnn@chromium.org>
2015-12-01 22:37:00 -08:00
Ben Lok
9ea7ca8d87 pd: send power change event to AP whenever input power is changed
Send power change event to AP whenever input power is changed,
ensure that AP gets the latest power charging info.

BUG=chrome-os-partner:47677
BRANCH=none
TEST=tested on Oak by plug/unplug AC adapter to type-C ports and
verifying the UI battery icon shows the correct status instantly.

Change-Id: I7465afcd8bc9b1c56ecf70fc74446866a8ab1b9a
Signed-off-by: Ben Lok <ben.lok@mediatek.com>
Reviewed-on: https://chromium-review.googlesource.com/313926
Reviewed-by: Alec Berg <alecaberg@chromium.org>
2015-12-01 01:11:04 -08:00
Bruce
2a09bf95e5 Chell: support LED behavior
Add firmware to support LED behavior for following OEM spec.

BUG=None
BRANCH=None
TEST=check led behavior follow the spec

Change-Id: Ib4250a47a153fbe7de0e1cd4a5869fd3efbcfd1d
Signed-off-by: Bruce.Wan <Bruce.Wan@quantatw.com>
Reviewed-on: https://chromium-review.googlesource.com/313898
Commit-Ready: Bruce Wan <Bruce.Wan@quantatw.com>
Tested-by: Bruce Wan <Bruce.Wan@quantatw.com>
Reviewed-by: Shawn N <shawnn@chromium.org>
2015-11-29 18:46:26 -08:00
Duncan Laurie
feb63bec88 chell: Apply USB EQ settings to PS8740 USB mux
Apply the recommended USB EQ settings for Tx and Rx channel
loss compensation to the PS8740 USB mux chip.  This is called
after the driver is initialized and sets up the chip for the
first time.

BUG=chrome-os-partner:47074
BRANCH=none
TEST=build and boot on chell, read back registers to verify
> i2cxfer r 1 0x34 0x32
0x60 [96]
> i2cxfer r 1 0x34 0x3b
0x60 [96]
> i2cxfer r 1 0x20 0x32
0x60 [96]
> i2cxfer r 1 0x20 0x3b
0x60 [96]

Change-Id: I95334be9eed2858864787500a7483fa043947148
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/313748
Reviewed-by: Shawn N <shawnn@chromium.org>
2015-11-24 11:02:50 -08:00
Duncan Laurie
156461b212 chell: Update for EVT build
- Disable SLP_S0 as interrupt source for proto boards
- Remove pull-up on PLATFORM_EC_PROCHOT for EVT boards

BUG=chrome-os-partner:47346
BRANCH=none
TEST=build and boot on chell proto

Change-Id: I3196e9fe1c921d66fd841c6ca1c3d8df131db9eb
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/313663
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2015-11-23 19:23:58 -08:00
Shawn Nematbakhsh
2d287e61ce chell / glados: Add power signal interrupt storm detection
BUG=chromium:557988
BRANCH=None
TEST=None

Change-Id: I4a3dd42dc0b3098881f6ca40e1f71a35d28fe50b
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/313171
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2015-11-19 14:41:40 -08:00
Shawn Nematbakhsh
fca995376e glados / chell: Enable useful console features
- Add kbpress command for FAFT
- Add i2cscan for debug
- Add console history because it's useful

BUG=chrome-os-partner:46969

Change-Id: I195762e4fcb59e77116a6a8e96a9c4f09a21ab1c
Reviewed-on: https://chromium-review.googlesource.com/312792
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Alec Berg <alecaberg@chromium.org>
2015-11-17 14:40:07 -08:00
Shawn Nematbakhsh
74aad9a0a4 chell: Increase RO/RW image size to 104KB
With recent optimizations, we have more SRAM available for code.

BUG=None
TEST=`make BOARD=chell -j`
BRANCH=None

Change-Id: Id2e9c605132994ccab2c51f8f27cfe66e7dd3553
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/312791
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Alec Berg <alecaberg@chromium.org>
2015-11-17 14:40:07 -08:00
Duncan Laurie
d68cb398ab chell: Add keyboard backlight
Add keyboard backlight to PWM2.

BUG=chrome-os-partner:47435
BRANCH=none
TEST=test keyboard backlight on chell

Change-Id: Iab6b1ef95fc1428f0f8ac8b1503956fd990c0b60
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/312403
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Reviewed-by: Shawn N <shawnn@chromium.org>
2015-11-13 15:28:24 -08:00
Aaron Durbin
bd83bb8f36 glados/chell: drive PCH_RTCRST low
The PCH_RTCRST signal is active high controlling the gate of a FET.
Therefore, it's default state should be low.

BUG=chrome-os-partner:47505
BRANCH=None
TEST=Built. The FET is unstuffed on both boards currently.

Change-Id: Ia0e07e67e6ea4eecf151ac8890ad98c8a337c01e
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/312061
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
2015-11-12 12:37:08 -08:00
Duncan Laurie
dc4f1a5eb9 chell: Enable reset of EC on PD panic
Enable the option to reset the EC when the PD panics.

BUG=chrome-os-partner:46289
BRANCH=none
TEST=verify that if PD is in RW and reboots then the EC
will panic and print "PD crash".

Change-Id: I69ab08914aef08b5ef0eaa447c142444113c526c
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/311308
Reviewed-by: Alec Berg <alecaberg@chromium.org>
2015-11-11 11:00:48 -08:00
Duncan Laurie
f8ac3e035e chell: Fix hibernate by not touching PMIC reset pin
This pin is active high to reset the pmic so it can't be
pulled up without resetting the EC.

BUG=chrome-os-partner:47237
BRANCH=none
TEST=hibernate on chell

Change-Id: I3c09a991825544bd5bf5437f4a802e2dd2990807
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/311307
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Reviewed-by: Shawn N <shawnn@chromium.org>
2015-11-11 11:00:48 -08:00
Alec Berg
20562ac025 mec1322: adjust mec adc channels for analog reference of 3.0V
Change ADC channels on mec1322 boards to use scaling based on ADC
reference voltage of 3.0V instead of 3.3V. Also, setup the scaling
for AMON_BMON which reads the adapter input current or battery
current in mA.

BUG=none
BRANCH=none
TEST=tested on glados. use adc console command and verify it
roughly matches twinkie voltage and current.

Change-Id: Id6ed72012ebb1c23cf98a14ee6c156ec0f5fb586
Signed-off-by: Alec Berg <alecaberg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/311302
Reviewed-by: Shawn N <shawnn@chromium.org>
2015-11-09 12:49:44 -08:00
Shawn Nematbakhsh
92a65427d3 tcpm: Add configuration struct for tcpc i2c params
Add a new configuration struct tcpc_config_t that initially defines the
i2c host port and i2c slave address of all TCPCs present on the board.
This will allow us to create boards with multiple TCPCs on different i2c
ports, with arbitrary i2c slave addresses.

BUG=chromium:551078
TEST=Manual on glados. Verify PD communication / charging is still
functional on both PD ports.
BRANCH=None

Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Change-Id: I9b2bde85d7f1642e8727c052e064371be7967619
Reviewed-on: https://chromium-review.googlesource.com/311000
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Alec Berg <alecaberg@chromium.org>
2015-11-08 17:31:12 -08:00
Rong Chang
f9ffa951c1 chg: add narrow VDC power path support
Under NVDC, BGATE natively has a body diode. Hence there's a discharging
path if VSYS is lower than VBAT. This change keeps VSYS voltage when
turning off charging.

BRANCH=none
BUG=chrome-os-partner:46698
TEST=manual
  make buildall -j
  load on boards with isl9237 charger.
  charge the battery to full, and check charging voltage and current.

Change-Id: I8a6046444dd40a3b57f034be124b9e8fe281de40
Signed-off-by: Rong Chang <rongchang@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/309289
Reviewed-by: Alec Berg <alecaberg@chromium.org>
2015-11-05 11:10:25 -08:00
Shawn Nematbakhsh
1915367112 chell: Fix inverted KSO2 / GPIO101
KSO / GPIO101 is inverted and needs to be driven high on scan, so it
can't be configured as open-drain.

BUG=None
TEST=Verify keys on KSO2 scanline are functional.
BRANCH=None

Change-Id: Ic94b9e09a74d22a6e8e4b45ae03088e9ea5c2295
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/310544
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
2015-11-04 07:09:05 -08:00
Shawn Nematbakhsh
2431602575 cleanup: Standardize use of CONFIG_I2C and add MASTER/SLAVE CONFIGs
Some chips previously defined CONFIG_I2C and others didn't. Standardize
the usage by removing CONFIG_I2C from all config_chip files and force it
to be defined at the board level. Also, make boards define
CONFIG_I2C_MASTER and/or CONFIG_I2C_SLAVE based on the I2C interfaces
they will use - this will assist with some later cleanup.

BUG=chromium:550206
TEST=`make buildall -j`
BRANCH=None

Change-Id: I2f0970e494ea49611abc315587c7c9aa0bc2d14a
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/310070
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Alec Berg <alecaberg@chromium.org>
2015-11-03 09:08:21 -08:00
Alec Berg
a023d6b0c1 glados: oak: chell: enable USB PD logging
Enable USB PD logging.

BUG=chrome-os-partner:45933
BRANCH=none
TEST=make -j buildall
make -j BOARD=glados tests
Load on glados and test that PDLOG events show up in dmesg

Change-Id: I61dbc5019ea3228542c2c244228bbb483cf51ead
Signed-off-by: Alec Berg <alecaberg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/309881
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
2015-10-30 17:51:20 -07:00
Duncan Laurie
95e8bc2e0b chell: Set SPI flash chip to W25X40
Chell was still set to use W25Q64 instead of the W25X40 that is
actually on the board.

BUG=chrome-os-partner:46289
BRANCH=none
TEST=successfully run "flash_ec --board=chell"

Change-Id: If21e5f9a00600c97d81d2bb2a8700801ae5c2fd6
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/308727
Reviewed-by: Shawn N <shawnn@chromium.org>
2015-10-27 01:22:57 -07:00
Aseda Aboagye
daca039e2a mec1322: Remove CONFIG_PORT80_TASK_EN from boards.
There is no port 80 task for the MEC1322 anymore,  therefore no board
should be using this define.  I forgot to remove these at the time.

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

CQ-DEPEND=CL:308450

Change-Id: Ie44474470edb40bc94ec95be9663b509e0ba299a
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Reviewed-on: https://chromium-review.googlesource.com/308451
Commit-Ready: Aseda Aboagye <aaboagye@chromium.org>
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Alec Berg <alecaberg@chromium.org>
2015-10-23 14:46:03 -07:00
Alec Berg
776bedc3f8 glados: chell: add VCONN swap ability
Add VCONN swap ability and accept VCONN_SWAP requests as long
as we have the ability to provide VCONN.

BUG=none
BRANCH=none
TEST=test on glados. ask for vconn swap and make sure vconn swap
is successful.

Change-Id: I7340e6253dcde4cdbe333a9622d7826e7ccbe6b4
Signed-off-by: Alec Berg <alecaberg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/308238
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2015-10-23 13:18:58 -07:00
Alec Berg
964534b91e pd: change battery and variable sink cap for voltage inaccuracy
Change battery and variable sink capabilities for all boards
to account for +/-5% voltage inaccuracy.

BUG=none
BRANCH=none
TEST=test glados with third party variable power supply and make
sure it see's our sink capabilities as 4.75V-21V.

Change-Id: I2481ccbe6c47bfed1a6b8b237329e70bd0f8e4ac
Signed-off-by: Alec Berg <alecaberg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/308237
Reviewed-by: Todd Broch <tbroch@chromium.org>
2015-10-23 13:18:58 -07:00
Aseda Aboagye
590caace95 mec1322: Change the Port 80 task to a timer IRQ.
The port 80 task just polls every 1ms until disabled when the system
goes into suspend.  Therefore, this commit configures a 1ms timer
interrupt that will be used for the port 80 writes instead of using an
entire task.  This saves task stack space as well as context switches.

BUG=chrome-os-partner:46062
BUG=chrome-os-partner:46063
BRANCH=None
TEST=Flash GLaDOS and verify using the `port80' console comamnd that
there are bytes in the port80 history.
TEST=make -j buildall tests

Change-Id: I65b48217a638c1f6ae1ac86471f9a98e0ec4533a
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Reviewed-on: https://chromium-review.googlesource.com/305591
Commit-Ready: Aseda Aboagye <aaboagye@chromium.org>
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Kevin K Wong <kevin.k.wong@intel.com>
Reviewed-by: Shawn N <shawnn@chromium.org>
2015-10-19 18:21:22 -07:00
Shawn Nematbakhsh
3fa0502036 glados / kunimitsu / chell: Slow EC-->PD I2C bus to 500 KHz
The stm32 (i2c slave) datasheet provides a 500 KHz timing configuration
for Fm+ when using an 8 MHz i2c clock.

BUG=chrome-os-partner:46188
BRANCH=None
TEST=Verify no i2c errors are seen on EC-->PD I2C bus.

Change-Id: I15d51a77d4739a769fdfa15bc3c1dae82f046d42
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/306183
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Alec Berg <alecaberg@chromium.org>
2015-10-15 21:40:34 -07:00
Aseda Aboagye
811f5482f0 GLaDOS: Kunimitsu: Chell: Reduce UART TX buffer to 512B.
This saves us another 1.5K in data RAM.

BUG=chrome-os-partner:46060
BUG=chrome-os-partner:46063
BRANCH=None
TEST=make -j buildall tests
TEST=Flashed on GLaDOS and watched EC console during boot for any
anomalities.

Change-Id: I534796892e5e55e956e4d517cbe233bb7628520a
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Reviewed-on: https://chromium-review.googlesource.com/305361
Commit-Ready: Aseda Aboagye <aaboagye@chromium.org>
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Alec Berg <alecaberg@chromium.org>
2015-10-15 12:04:37 -07:00
Aseda Aboagye
3274fa21bb chell: Change image size to 100K.
On Chell, we cannot fit all of the data in data RAM, therefore we adjust
this boundary slightly.

This should not be moved further as this represents when we are truly
out of space.

128k image:
 -3k   loader
 -1k   for shmem/panic info
 -24k  RAM for RO/RW
 -100k for RO/RW .text and .rodata

BUG=chrome-os-partner:46058
BUG=chrome-os-partner:46063
BUG=chrome-os-partner:45690
BRANCH=None
TEST=make -j buildall tests

Change-Id: I6fbb0fd53ecb493a1821e6499276a09e93b653b9
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Reviewed-on: https://chromium-review.googlesource.com/305793
Commit-Ready: Aseda Aboagye <aaboagye@chromium.org>
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Alec Berg <alecaberg@chromium.org>
2015-10-14 18:47:12 -07:00
Duncan Laurie
9a8dc6b4f3 chell: remove pd_check_requested_voltage()
This code was removed from all boards except chell which was
likely in the CQ at around the same time.

BUG=chrome-os-partner:42490
BRANCH=none
TEST=make -j buildall

Change-Id: I8351e93d6468996659baceb5edcff9679a2d2092
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/305592
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Alec Berg <alecaberg@chromium.org>
2015-10-14 14:30:18 -07:00
Duncan Laurie
84e27570e9 chell: Add EC/PD configuration for chell board
Add new EC board for chell proto:
- no motion sensors or tablet mode
- no independent volume buttons
- no ALS
- 2x PS8740 USB MUX
- apply PMIC_LDO_EN behavior by default
- leave SLP_S0 workaround in place until HW is updated
- misc GPIO changes
- update battery info with basic 3S config from blaze
- remove custom battery charger profile

The PD board is a symlink to glados as it appears to be the same.

BUG=chrome-os-partner:46289
BRANCH=none
TEST=make -j BOARD=chell ; make -j BOARD=chell_pd

Change-Id: I1084d663b06eeb55f035b10eb776a2e30e0f7074
Signed-off-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/304398
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
2015-10-12 13:15:48 -07:00