Commit Graph

1340 Commits

Author SHA1 Message Date
Kevin K Wong
a5b3bb0f97 strago: Added temperature reading for battery.
BUG=none
TEST=Verified `temps` prints the battery temperature.
BRANCH=none

Change-Id: Ied6eb5c6c01f7bd4b5f397cb59e165fc7bd7024f
Signed-off-by: Kevin K Wong <kevin.k.wong@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/265900
Reviewed-by: Shawn N <shawnn@chromium.org>
2015-04-16 03:55:42 +00:00
Icarus Sparry
4fce69d394 mec1322: Changed to generate ec.bin for the firmware binary.
Previously for the mec1322 chip an ec.bin file was created in the normal way
and then it was "packed" in a post-processing stage to produce ec.spi.bin.

This change allows a chip or board build.mk file to specify the rules used to
produce ec.bin, and uses this for the mec1322 to do the packing. This means
that we can use the standard "ec.bin" name, and do not need to alter other
scripts, such as the script which creates chromeos-firmwareupdate.

BUG=None
TEST=buildall -j, flash on strago and see it still works.
BRANCH=NONE

Change-Id: I3f880d64e60d14f82cb1d21c8b3f2d4ae5e0dfef
Signed-off-by: Icarus Sparry <icarus.w.sparry@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/265544
Tested-by: Kevin K Wong <kevin.k.wong@intel.com>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Commit-Queue: Kevin K Wong <kevin.k.wong@intel.com>
2015-04-15 22:58:27 +00:00
Kevin K Wong
5654dedc87 strago: Enabled accelerometer support.
BUG=none
TEST=Verified lid angle value via accelinfo console command.
BRANCH=none

Change-Id: I7857fadeb6ffbd83c55d00649437c52ac3f204ba
Signed-off-by: Kevin K Wong <kevin.k.wong@intel.com>
Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/265595
Reviewed-by: Alec Berg <alecaberg@chromium.org>
2015-04-15 04:50:45 +00:00
li feng
26c777c5e0 Strago: Enable and config charger BQ24770
BUG=None
BRANCH=None
TEST=Battery Charging was valitated.
1.Tested with a Dead Battery
and saw it charging.
2.Battery Full charge condition was validated.

Signed-off-by: li feng <li1.feng@intel.com>

Change-Id: If81d700aff2b929f8f8fc183fea4bdece00c4a46
Signed-off-by: Divya Jyothi <divya.jyothi@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/265541
Tested-by: Kevin K Wong <kevin.k.wong@intel.com>
Reviewed-by: Shawn N <shawnn@chromium.org>
Commit-Queue: Kevin K Wong <kevin.k.wong@intel.com>
2015-04-14 19:08:06 +00:00
Kevin K Wong
3779b8ccbe strago: Added support for TMP432 temperature sensor.
BUG=none
TEST=Verified tmp432 console command is returnning correct temperature.
BRANCH=none

Change-Id: Ic43af17961361e4c971a343a0d24d310c3aaf2ac
Signed-off-by: Kevin K Wong <kevin.k.wong@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/265540
Reviewed-by: Shawn N <shawnn@chromium.org>
2015-04-14 01:15:49 +00:00
Kevin K Wong
8580227b40 mec1322: Added CONFIG_SWITCH support.
This allows switch status to be updated to EC MemMap.

BUG=none
TEST=Verified mmapinfo console command is reporting the correct info.
BRANCH=none

Change-Id: I3b6683be8b92b59dffb3227e0a72a122dcda56a2
Signed-off-by: Kevin K Wong <kevin.k.wong@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/265493
Reviewed-by: Shawn N <shawnn@chromium.org>
2015-04-13 21:31:58 +00:00
Todd Broch
0016de8250 plankton: Initialize re-driver.
Host's single lane training algorithm in kernel (intel_dp_is_reversed)
appears to confuse the re-driver's auto training algorithm.  If
however its manually configured the algorithm succeeds.

NOTE, this does present risk on the DPsrc (re-driver) to DPsink
(external monitor) side as voltage levels & pre-emphasis will NOT be
adjusted.

This may be acceptable in the short-term while determining if
additional functionality needs to be added on host side to account for
re-driver's presence

Signed-off-by: Todd Broch <tbroch@chromium.org>

BRANCH=none
BUG=chrome-os-partner:35153
TEST=manual, plankton drives 4K monitor in both polarities

Change-Id: I83ea80c44d36ad1afad56528c80ec5b8a138b5be
Reviewed-on: https://chromium-review.googlesource.com/263138
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Commit-Queue: Todd Broch <tbroch@chromium.org>
Tested-by: Todd Broch <tbroch@chromium.org>
2015-04-13 17:38:11 +00:00
Anton Staaf
0f6335451d USB-Stream: Switch to handling packets in a deferred hook
Previously the TX and RX queues were being accessed from two
different locations without locking, which is wrong.  This
moves the access to a single location in a deffered hook and
calls that hook from the old locations.  The result is
correct, simpler, and not much slower.  It also reduces time
in the USB interrupt handler by moving the memcpy from packet
to queue out to the deferred hook.

Signed-off-by: Anton Staaf <robotboy@chromium.org>

BRANCH=None
BUG=None
TEST=make buildall -j
     Verify that USB streams still work on Ryu and discovery-stm32f072

Change-Id: I6ea53d7c40b42c6112e86a7886f3b888408f72b7
Reviewed-on: https://chromium-review.googlesource.com/264763
Tested-by: Anton Staaf <robotboy@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Commit-Queue: Anton Staaf <robotboy@chromium.org>
Trybot-Ready: Anton Staaf <robotboy@chromium.org>
2015-04-13 16:32:14 +00:00
Alec Berg
f224ae87bd pd: samus: support vconn swap and enable on Samus when in S0/S3
Support VCONN swap on samus and always accept VCONN swap when in
S0 or S3. In S5, we can't provide VCONN, so reject VCONN swap
requests.

BUG=chrome-os-partner:34978
BRANCH=samus
TEST=load on two samus' and use "pd 1 swap vconn" to swap which
side is source vconn. also run in S5 and verify swap request is
rejected.

Change-Id: I04be8d1d910a2d6c5ad8b27a790f8e33121c86ee
Signed-off-by: Alec Berg <alecaberg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/264856
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2015-04-11 04:32:33 +00:00
Vincent Palatin
007fadda59 stm32f0: make ADC watchdog feature modular
The ADC watchdog is about 2/3 of the ADC code size and it is not
optimized out when not used because adc_read_channel() needs to
stop/restart the watchdog if somebody is using it.

The feature is enabled by default to keep the current behavior on
STM32F0 platform, and it is turned off on samus_pd :
This is saving 448 bytes of flash (and 8 bytes of RAM).

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

BRANCH=none
BUG=none
TEST=make buildall and check the firmware size before and after.
when CONFIG_ADC_WATCHDOG is disabled, adc_enable_watchdog() is not
compiled if there is any user the build will fail.

Change-Id: Ie2450bc2a8fd97662322fd3ce87e93c3fece6c6f
Reviewed-on: https://chromium-review.googlesource.com/265303
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Trybot-Ready: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
2015-04-11 03:11:02 +00:00
Vincent Palatin
b5f2ca5dac ryu: remove lightbar traces by default
The lightbar traces are quite verbose when going through AP power cycles
and prevent people from debugging the current power issues.
Let's turn them off by default, real lightbar lovers can still use
the "chan" command to re-enable them.

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

BRANCH=none
BUG=none
TEST=mkae buildall

Change-Id: Ia91f1f9ea2c62a35a0d64e06d377f137ba69fc5e
Reviewed-on: https://chromium-review.googlesource.com/265145
Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Trybot-Ready: Vincent Palatin <vpalatin@chromium.org>
2015-04-11 00:36:05 +00:00
Vincent Palatin
68f65494c7 ryu: rework the workaround for the EN_PP3300 issue
When shutting down the MAX77620 PMIC by asserting its SHDN pin, the
EN_PP3300 output of the PMIC (GPIO3) is not driving low keeping the PP3300
rail up. Workaround that issue by removing the pull-up on EN_PP3300 when
we assert SHDN.

Revert the previous CL 263958 aka "ryu: workaround MAX77620 shutdown issue",
in order to use a better workaround which ensures that the power rails
sequencing at startup

Detect the PP1800 rail going up and down by reading the HPD_IN gpio
state (which has a pull-up tied to PP1800), then enable/disable
EN_PP3300 in sequence.

The code using an interrupt on HPD_IN is enabled only on P5,
and as a downside, it is killing the base charging on those boards.
Indeed HPD_IN(C1) is hijacking the EXTINT1 which used to be connected
to the LID_OPEN (E1) GPIO used for the base detection.

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

BRANCH=none
BUG=chrome-os-partner:38689
TEST=on both P4 and P5 boards, do various power cycling sequences of the
AP using the "apshutdown" and "powerbtn" commands.

Change-Id: Icad6e9ae6a08d76cbfd19f97dd7c129bf43037d8
Reviewed-on: https://chromium-review.googlesource.com/265186
Trybot-Ready: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-by: Alec Berg <alecaberg@chromium.org>
2015-04-11 00:35:59 +00:00
Vincent Palatin
15391709fd twinkie: add simple text tracing mechanism
When using the Twinkie dongle without a protocol decoder on the host,
add a simple text tracing mechanism, so the user can get the timestamped traces
of the packets on the wire (in a best effort fashion).

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

BRANCH=none
BUG=none
TEST=On Twinkie command-line, type "tw trace on"
then plug a DingDong to Samus through Twinkie and
see the PD message traces on the console.

Change-Id: I4fa35d6783cc6279c95209c86f37e6d717de7301
Reviewed-on: https://chromium-review.googlesource.com/237222
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Reviewed-by: Todd Broch <tbroch@chromium.org>
Trybot-Ready: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
2015-04-10 23:29:31 +00:00
Alec Berg
a90f4dd25e samus_pd: disable timerinfo command to save space
Disable the timerinfo command on samus_pd to save flash space

BUG=none
BRANCH=samus
TEST=make -j buildall
From .map file, 256 bytes saved

Change-Id: I6731967741cb28268499126f1753916319a1dcb4
Signed-off-by: Alec Berg <alecaberg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/264939
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2015-04-10 22:08:31 +00:00
Aseda Aboagye
e9883124ff gpio: Refactor IRQ handler pointer out of gpio_list
In the gpio_info struct, we had a irq_handler pointer defined even
though a majority of the GPIOs did not have irq handlers associated. By
removing the irq_handler pointer out of the struct, we can save some
space with some targets saving more than others. (For example, ~260
bytes for samus_pd).

This change also brings about a new define:

     GPIO_INT(name, port, pin, flags, signal)

And the existing GPIO macro has had the signal parameter removed since
they were just NULL.

     GPIO(name, port, pin, flags)

In each of the gpio.inc files, all the GPIOs with irq handlers must be
defined at the top of the file. This is because their enum values from
gpio_signal are used as the index to the gpio_irq_handlers table.

BUG=chromium:471331
BRANCH=none
TEST=Flashed ec to samus and samus_pd, verified lightbar tap, lid, power
button, keyboard, charging, all still working.
TEST=Moved a GPIO_INT declaration after a GPIO declaration and watched the build
fail.
TEST=make -j BOARD=peppy tests
TEST=make -j BOARD=auron tests
TEST=make -j BOARD=link tests

Change-Id: Id6e261b0a3cd63223ca92f2e96a80c95e85cdefb
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Reviewed-on: https://chromium-review.googlesource.com/263973
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
Trybot-Ready: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Alec Berg <alecaberg@chromium.org>
2015-04-10 22:08:25 +00:00
Aseda Aboagye
0b043fed03 spring: Move interrupt enabled gpios to top
All GPIOs with interrupt handlers should be together at the top of the gpio.inc
file.

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

Change-Id: I4174e96acc35268fc77c477191b3ad1ef347a2e3
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Reviewed-on: https://chromium-review.googlesource.com/264505
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
Commit-Queue: Alec Berg <alecaberg@chromium.org>
Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
Trybot-Ready: Aseda Aboagye <aaboagye@chromium.org>
2015-04-10 20:48:29 +00:00
Aseda Aboagye
aa98b2dca5 snow: Move interrupt enabled gpios to top
All GPIOs with interrupt handlers should be together at the top of the gpio.inc
file.

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

Change-Id: I6810a793cc16c38c8dde86f9cbec57a3f82aebfc
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Reviewed-on: https://chromium-review.googlesource.com/264504
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
Commit-Queue: Alec Berg <alecaberg@chromium.org>
Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
Trybot-Ready: Aseda Aboagye <aaboagye@chromium.org>
2015-04-10 20:48:22 +00:00
Shawn Nematbakhsh
0b20fa1e0d glower: Add alternate LPC pin configs
BUG=chrome-os-partner:36326
TEST=Manual on Glower. Verify LPC reset becomes deasserted and AP boots.
BRANCH=None

Change-Id: I2a70a384b501eeabff6d976b62cbec3b15b152aa
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/264453
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2015-04-09 19:19:17 +00:00
Aseda Aboagye
29c7407c3d cyan: Move interrupt enabled gpios to top
All GPIOs with interrupt handlers should be together at the top of the gpio.inc
file.

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

Change-Id: I54926d81c55f25e1ec5ed9a286579cd40b47063c
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Reviewed-on: https://chromium-review.googlesource.com/264953
Trybot-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: Aseda Aboagye <aaboagye@chromium.org>
Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
2015-04-09 09:26:53 +00:00
Kevin K Wong
55c739b9a4 mec1322: Added CONFIG_KEYBOARD_KSO_BASE to align KBD KSO00 pin to board design
MEC1322 KSO00~03 pin has an alternate JTAG function. For board that needs JTAG
function, this #define allows hardware to use a different set of KSO pins.
For example - Uses KSO04~16 instead of KSO00~KSO12.

BUG=none
TEST=Verified keyboard is functional with all keys detected
BRANCH=none

Change-Id: I1e3c1c2b6a4420cb6296b6bc921affa8c0ed5800
Signed-off-by: Kevin K Wong <kevin.k.wong@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/264610
Reviewed-by: Shawn N <shawnn@chromium.org>
2015-04-09 04:45:23 +00:00
Aseda Aboagye
e369986c6e host: Move interrupt enabled gpios to top
All GPIOs with interrupt handlers should be together at the top of the gpio.inc
file.

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

Change-Id: I6a91e6ba88cf2c63826530f6989b6920349da4c5
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Reviewed-on: https://chromium-review.googlesource.com/264498
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
Trybot-Ready: Aseda Aboagye <aaboagye@chromium.org>
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
2015-04-09 03:18:59 +00:00
Aseda Aboagye
4b2bc9600d link: Move interrupt enabled gpios to top
All GPIOs with interrupt handlers sholud be together at the top of the gpio.inc
file.

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

Change-Id: I2c36a3e1f16152b85e01893f3e17fd69571d175f
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Reviewed-on: https://chromium-review.googlesource.com/264540
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
Trybot-Ready: Aseda Aboagye <aaboagye@chromium.org>
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2015-04-09 03:18:53 +00:00
Lee Leahy
55d7fbd47c cyan: Initial EC
BUG=none
TEST=Booted on cyan
BRANCH=none

Change-Id: Ibc7fe6b797fffc00613e13912868fa4d8b14091f
Signed-off-by: Kevin K Wong <kevin.k.wong@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/260684
Reviewed-by: Eric Caruso <ejcaruso@chromium.org>
Reviewed-by: Shawn N <shawnn@chromium.org>
Commit-Queue: Divya Jyothi <divya.jyothi@intel.com>
2015-04-09 01:45:44 +00:00
Aseda Aboagye
3e1bf760b3 samus: Move interrupt enabled gpios to top
All GPIOs with interrupt handlers should be together at the top of the gpio.inc
file.

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

Change-Id: Ie017f148b9b17460aaa32cd5fdc7021feb191247
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Reviewed-on: https://chromium-review.googlesource.com/264542
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Tested-by: Alec Berg <alecaberg@chromium.org>
Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
2015-04-08 21:02:02 +00:00
Aseda Aboagye
eae54e30a0 ryu: Move interrupt enabled gpios to top
All GPIOs with interrupt handlers should be together at the top of the gpio.inc
file.

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

Change-Id: I2cf563dc77b61060e7f4eb755399f6b722eb1bc2
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Reviewed-on: https://chromium-review.googlesource.com/264541
Reviewed-by: Anton Staaf <robotboy@chromium.org>
Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
Trybot-Ready: Aseda Aboagye <aaboagye@chromium.org>
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
2015-04-08 19:11:58 +00:00
Divya Jyothi
88b63ce8f5 Strago: I2C port support added and SPI Flash Size corrected
I2C ports initialized as per board design. Modules
assigned to its corresponding I2C port numbers
Altered the SPI flash size to match the Braswell Ref Design board

BUG=None
BRANCH=None
TEST=Tested all I2C modules on all ports using i2cscan and i2cxfer
console commands

Change-Id: I4158c1aeb29193b5bd07450ba28cdcdc2413926a
Signed-off-by: Divya Jyothi <divya.jyothi@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/264261
Reviewed-by: Shawn N <shawnn@chromium.org>
2015-04-08 19:11:00 +00:00
Aseda Aboagye
41748e967f it8380dev: Move interrupt enabled gpios to top
All GPIOs with interrupt handlers sholud be together at the top of the gpio.inc
file.

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

Change-Id: Id5847e4ea00e0187453af6a479e10defe08dc0a9
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Reviewed-on: https://chromium-review.googlesource.com/264499
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
Trybot-Ready: Aseda Aboagye <aaboagye@chromium.org>
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
2015-04-08 05:04:00 +00:00
Aseda Aboagye
3594debadf fruitpie: Move interrupt enabled gpios to top
All GPIOs with interrupt handlers should be together at the top of the gpio.inc
file.

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

Change-Id: Id2432c78b665995c573466ba0341e63dfa07fee9
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Reviewed-on: https://chromium-review.googlesource.com/264503
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
Trybot-Ready: Aseda Aboagye <aaboagye@chromium.org>
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
2015-04-08 03:44:05 +00:00
Divya Jyothi
0841f0a173 Strago: Gpio initializations for Braswel Reference Design
BUG=chrome-os-partner:36167
TEST=Tested on Braswel Ref Design
BRANCH=None

Change-Id: I445bae14b9c2c445585312d2c0d79d5cd5f9c1b8
Signed-off-by: Divya Jyothi <divya.jyothi@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/263947
Reviewed-by: Shawn N <shawnn@chromium.org>
2015-04-08 03:44:01 +00:00
Alec Berg
2d2d1e15cf pd: treat externally powered dualrole devices as dedicated chargers
Treat externally powered dualrole devices as dedicated chargers.
This allows us to default to consuming power from externally powered
dualrole devices and cancels a charger override when one is attached.

BUG=chrome-os-partner:38785
BRANCH=samus
TEST=tested with third-party dualrole device that can be externally
powered.

also tested with another samus that was hard-coded with externally
powered bit set, and deleted it's policy for power swapping. when
this externally-powered samus is plugged into a samus running this CL,
we always charge from the externally-powered samus.

Change-Id: I850eba668e86d311d9353aa3881fc3a518409630
Signed-off-by: Alec Berg <alecaberg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/263331
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2015-04-07 03:41:01 +00:00
Alec Berg
25e6261ce5 samus_pd: ryu: change sink capabilities for voltage inaccuracy
Change sink capabilities to account for +/-5% voltage inaccuracy
for variable and battery PDOs.

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

Change-Id: Id793142c486dfc908c81c4894b2ec48f99c868f4
Signed-off-by: Alec Berg <alecaberg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/263295
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2015-04-03 06:15:41 +00:00
Vincent Palatin
4d0aad8894 cr50: add USB support
Add a USB device driver for the Synopsys DWC USB device controller.

The common USB protocol stack code still need to be de-duplicated with
the STM32 implementation.

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

BRANCH=none
BUG=chrome-os-partner:33919
TEST=plug Cr50 to a Linux workstation and see USB descriptors using
"lsusb -v -d 18d1:5014"

Change-Id: I4a367241053de2c2d94aa06f82ea4bee51f9f89a
Reviewed-on: https://chromium-review.googlesource.com/231160
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Trybot-Ready: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
2015-04-02 20:27:46 +00:00
Vincent Palatin
6cb426e137 ryu: add P5/Smaug support
Update EC board configuration for P5 boards :
- PMIC_THERM_L GPIO used for PMIC shutdown has moved.
- add 5V regulator control (used for VBUS only)
- the Type-C superspeed muxes control changed
- add a temporary pull-up on EN_PP3300
- add new FW_DEBUG_MODE GPIO

Try to be compatible with both P4 and P5 by detecting the board variant at
runtime.
At EC startup, USBC_SS1_USB_MODE_L/USBC_SS2_USB_MODE_L/USBC_SS_EN_L (aka
PD3/PD9/PE0 aka MUX_CONF0/1/2) now default to low level rather than high
(as the new default value on P5), but they are reset to the correct
value when initializing the PD task (high for P4, low for P5+).

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

BRANCH=none
BUG=chrome-os-partner:38330
TEST=Ran on P4, check board ID on P5 PCB.

Change-Id: Ie9010805a91362c2b4d5eddd825d452d6ccc5b28
Reviewed-on: https://chromium-review.googlesource.com/262310
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
2015-04-01 23:39:02 +00:00
Divya Jyothi
4c1bad17aa Strago: Enable battery charging
Setting up  numbers for Battery info like input current limit,
    Battery voltage, temperature limits as per the actual battery spec.

BUG=None
TEST=Tested on Braswell Ref Design
BRANCH=None

Change-Id: I66c3dfe6166d03d2cb79d80a887168f08753d22d
Signed-off-by: Divya Jyothi <divya.jyothi@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/260631
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2015-04-01 19:38:50 +00:00
Shawn Nematbakhsh
6ee7b1e34e ACPI: Support accessing memmap data over ACPI CMD / DATA ports
Some platforms are unable to access the 900h-9ffh region over LPC and
must instead access memmap data through the ACPI CMD / DATA ports. To
avoid racing with data updates, disallow changes to multi-byte memmap
data while in burst mode.

Linux currently enables burst mode when accessing multi-byte data and
disables it immediately afterward, though the ACPI spec defines burst mode
in a more general way.

BUG=chrome-os-partner:38224
TEST=Manual on Samus. Undefine LPC_MEMMAP and modify asl to move memmap
data to ERAM at offset 0x20. Verify system boots cleanly and battery
status is updated immediately on plug / unplug.
BRANCH=None

Change-Id: Ib848bdb491fdfece96ad0cee7a44ba85b4a1a50b
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/262072
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
2015-03-25 20:09:52 +00:00
Anton Staaf
0f18989ef5 Ryu: Add support for the SPI over USB bridge
This enables the USB SPI bridge and adds Ryu specific
functions for enabling and disabling the SPI bridge.

Signed-off-by: Anton Staaf <robotboy@chromium.org>

BRANCH=None
BUG=None
TEST=make buildall -j
     Verify that a modified flashrom can read and write
     the AP SPI Flash.

Change-Id: I3ed2503e23c360c0de7a3aedd1d256be7e82df1e
Reviewed-on: https://chromium-review.googlesource.com/260965
Trybot-Ready: Anton Staaf <robotboy@chromium.org>
Tested-by: Anton Staaf <robotboy@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Commit-Queue: Anton Staaf <robotboy@chromium.org>
2015-03-25 16:57:33 +00:00
Dino Li
2c3cf4d1a9 it8380dev: add KBC/KMSC module
1. DLM 16KB.
2. Add KBC/KMSC module for emulation board.

Signed-off-by: Dino Li <dino.li@ite.com.tw>

BRANCH=none
BUG=none
TEST=EVB + x86 MB can boot into DOS and keyboard works.

Change-Id: Ia5cc2d4f1733ce07879d410b0447b2d48e50cd95
Reviewed-on: https://chromium-review.googlesource.com/259923
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Dino Li <dino.li@ite.com.tw>
Commit-Queue: Dino Li <dino.li@ite.com.tw>
2015-03-22 03:13:58 +00:00
Sheng-Liang Song
bdcc496b30 cr50: added cr50 a1 chip
cr50_a1 is for cr50 Rev A1 chip.

BUG=chrome-os-partner:33432
BRANCH=none
TEST=Compile Only

Change-Id: I5490d1a5b89fa66c8e8b969cff7538a293a7d053
Signed-off-by: Sheng-Liang Song <ssl@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/259847
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
2015-03-20 23:06:53 +00:00
Vincent Palatin
179972d2f9 honeybuns: fix CC voltage thresholds
The Rp resistor on CC1 is set for a 3.0A capability,
so Vnc (no-connection voltage) is 2.45 V.

CC2 is not connected (captive cable), so for a PD source, it's identical
to being always pulled-up to 3.3V (no sink connection).

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

BRANCH=samus
BUG=chrome-os-partner:37078
TEST=connect to Samus and see PD activity

Change-Id: I8df0561cea59896d65d9be6523d4eed953851129
Reviewed-on: https://chromium-review.googlesource.com/259301
Trybot-Ready: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Scott Collyer <scollyer@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
2015-03-12 19:27:34 +00:00
Vincent Palatin
bbdb128eae honeybuns: fix CC line sensing ADC
The CC line is connected to the ADC 1 not 0.

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

BRANCH=samus
BUG=chrome-os-partner:37078
TEST=use the "adc" command and see the pull-up to 3.3V on CC1_PD.

Change-Id: I6327adc8ea166c4fb450c6711e17d8140fd6c71d
Reviewed-on: https://chromium-review.googlesource.com/259300
Trybot-Ready: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Scott Collyer <scollyer@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
2015-03-12 19:27:27 +00:00
Vincent Palatin
df8ff35f79 honeybuns: add HX3 hub configuration
Send the Cypress HX3 Hub configuration over I2C.

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

BRANCH=none
BUG=chrome-os-partner:37078
TEST=see the Hub booting in normal mode and enumerating.

Change-Id: I7e32eecd1d69ba0899b726c0405d392602e7d8b7
Reviewed-on: https://chromium-review.googlesource.com/256697
Trybot-Ready: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Scott Collyer <scollyer@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
2015-03-12 03:42:18 +00:00
Scott Collyer
23716f05aa honeybuns: Initial /board files
Modified version of /board/fruitpie.
Attempted to capture GPIO definitions. Other changes
consisted of modifying functions to enable compilation.
No real functionality as of yet.

TEST=Serial console and I2C functions have been verified
BUG=chrome-os-partner:37078
BRANCH=samus

Change-Id: Iedfc724a058e4220176193ef0f66e5bf45eabbd9
Signed-off-by: Scott <scollyer@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/252426
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Trybot-Ready: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
2015-03-12 03:42:12 +00:00
Shawn Nematbakhsh
07d3b69413 mec1322: Add flash physical interface functions
Add physical flash interface for read / write / protection of external
SPI on mec1322.

BUG=chrome-os-partner:36167
TEST=Manual on glower:
flashread 0xf000 0x200 --> dumps 0xff
flashwrite 0xf000 0x200
flashread 0xf000 0x200 --> dumps write pattern
flasherase 0xf000 0x1000
flashread 0xf000 0x200 --> dumps 0xff
spi_flash_prot 0 0x10000
flashinfo --> shows first 64KB protected
spi_flashwrite 0xf000 0x200 --> access denied
spi_flashwrite 0x1f000 0x200 --> OK
flashread 0x1f000 0x200 --> dumps write pattern
BRANCH=None

Change-Id: I2cb20a49934999fc0dd9b3425eb99708711637c5
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/257132
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2015-03-12 00:48:20 +00:00
Shawn Nematbakhsh
27199e7b64 spi_flash: Add protect support for W25X40
W25X40 uses a different protection register encoding than our existing
W25Q64 code. Move the SPI ROM option to a config, and add support for
the new part.

BUG=chrome-os-partner:37688
TEST=`make buildall -j`. W25X40 protection code tested in a subsequent
commit.
BRANCH=None

Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Change-Id: Iaaeabf42c6c62c20debc91afd2cf8671c14244c8
Reviewed-on: https://chromium-review.googlesource.com/258440
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2015-03-11 23:18:09 +00:00
Anton Staaf
d32be0292f Ryu: Share SensorHub UART control with Servo
Previously the EC UART connected to the SensorHub console
was being driven push/pull potentially fighting with a
connected servo.  This way servo wins, but at least we
don't drive the line in opposite directions causing a
large current flow.

Signed-off-by: Anton Staaf <robotboy@chromium.org>

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

Change-Id: I02b8e09af6c902b523494b757f4bc7ea4365df2e
Reviewed-on: https://chromium-review.googlesource.com/255954
Tested-by: Anton Staaf <robotboy@chromium.org>
Reviewed-by: Vic Yang <victoryang@chromium.org>
Commit-Queue: Anton Staaf <robotboy@chromium.org>
Trybot-Ready: Anton Staaf <robotboy@chromium.org>
2015-03-10 18:52:10 +00:00
Ben Lok
9e9ccfa24b llama: enable the EC backlight override for mediatek platform.
1. Override the panel backlight enable signal from SoC in llama board,
   force the backlight off on lid close.
2. Revise the function llama_lid_event to mtk_lid_event, makes more sense.

BRANCH=master
BUG=none
TEST=lid switch to open/close, observe the LCD backlight behavior.
     the backlight should be off, when lid is close.
     the backlight should be on, when lid is open.
BOARD=llama

Change-Id: Id1bff440c8bb6cee19c82615e916b8a2f2aa62ac
Signed-off-by: Ben Lok <ben.lok@mediatek.com>
(cherry picked from commit a90516b0a5493a55536e29d550f65cc743156710)
Reviewed-on: https://chromium-review.googlesource.com/255441
Reviewed-by: Rong Chang <rongchang@chromium.org>
2015-03-09 10:41:36 +00:00
yh.huang
9eb1380d63 llama: implement battery ship shutdown mode
Support battery cut-off as host command and console command.

BUG=none
BRANCH=master
TEST=tested "cutoff" console command cuts off battery
BOARD=llama

Change-Id: Id5c67d296b7ecfac99389d5cfcdcaa79da9ad4f3
Signed-off-by: Ben Lok <ben.lok@mediatek.com>
(cherry picked from commit 0274ffd14a35b478b8efa74cdd2d3303da96ec54)
Reviewed-on: https://chromium-review.googlesource.com/255440
Reviewed-by: Alec Berg <alecaberg@chromium.org>
2015-03-09 06:15:46 +00:00
Alec Berg
d09405203f samus: ryu: allow charge ramp on CDP and proprietary chargers
Modify charge ramp so that when it ramps it ramps from 500mA and
up to the maximum allowed by that supplier. Also modify Samus and
Ryu to use charge ramping for CDP and proprietary chargers due
to the possibility that they may not be able to supply the amount
that is supposed to be guaranteed by their advertisement.

BUG=chrome-os-partner:37549
BRANCH=samus
TEST=test on a proprietary charger, make sure we can ramp. test
a DCP and make sure we also ramp as before.

Change-Id: I08fd43c8f0b21aa54d114fbe5a1296c9556357e4
Signed-off-by: Alec Berg <alecaberg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/256972
Reviewed-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Vic Yang <victoryang@chromium.org>
2015-03-07 03:38:38 +00:00
Alec Berg
91524aca91 samus: limit input current when batt near full and 5V charger
Limit input current to 2A when battery is near full and we are using
a charger below the boost bypass threshold in order to prevent
charging noise from the charge circuit.

This also changes the threshold at which 5V ramping is allowed to
90% because this is roughly the threshold at which the battery stops
drawing full current.

BUG=chrome-os-partner:36534
BRANCH=samus
TEST=load onto samus. use battfake EC console command to test
various battery states of charge:

- With zinger, verify that at 20V we never limit input current based
on battery SOC.
- With zinger at 5V, verify that >= 90% we limit input current to
2A, and < 90% it's still 3A.
- With 5V BC1.2 DCP, verify that >= 90% we don't ramp, <90% we do.

Change-Id: I868828b5807572736ea58f62bf3596f6416533d2
Signed-off-by: Alec Berg <alecaberg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/256072
Reviewed-by: Shawn N <shawnn@chromium.org>
2015-03-06 08:48:46 +00:00
Alec Berg
7cbc5a0186 samus_pd: disable i2cxfer console command to save space
Disable the i2cxfer console command by default to save space

BUG=chrome-os-partner:37167
BRANCH=samus
TEST=make -j buildall
From .map file, 576 bytes of flash saved

Change-Id: I0b50161ef0a49231e45c422da5042db77874aed1
Signed-off-by: Alec Berg <alecaberg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/256071
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Todd Broch <tbroch@chromium.org>
2015-03-06 03:50:43 +00:00