Commit Graph

16 Commits

Author SHA1 Message Date
Shawn Nematbakhsh
b234b9ecc7 pd: Cleanup PD port-to-task macros
Cleanup our port-to-task and task-to-port macros to allow cleanly adding
a third port.

BUG=chromium:554243
BRANCH=None
TEST=Manual on glados / glados_pd. Verify that both USB-C ports are
functional for charging.

Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Change-Id: Ib833de0dfaa9490f4de8efb08d2cdddd86d57896
Reviewed-on: https://chromium-review.googlesource.com/311785
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2015-11-11 08:05:40 -08:00
Gwendal Grignou
828b55a735 common: Add magnetometer online calibration.
Code for hard iron calibration: Every seconds (or faster if enough
samples), find a sphere that fit the compass data.

Based on Android code.

BRANCH=smaug
BUG=chrome-os-partner:39900
TEST=Check hard-iron bias is removed. Works better outside.

Change-Id: Iab479d5113b6560b4f01b0fd87373d2eecdb9b54
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/299583
Reviewed-by: Anton Staaf <robotboy@chromium.org>
2015-10-13 05:28:54 -07:00
Gwendal Grignou
dbfb5c1dee stm32: Define a larger task size for HOST_CMD
The current largest task size is not big enough,
we get stack overflow after one or several calibration requests.

BRANCH=smaug
BUG=chrome-os-partner:45570
TEST=After the change a loop of calibrate does not crash the EC.

Change-Id: I9681a890eddf274ab496e8ca6249c7ebca5edab5
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/301215
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2015-09-20 23:33:18 -07:00
Gwendal Grignou
456d1baa25 Ryu: increase HOST_CMD stack size
Hit overflow while sending autocalibrate command.

At rest, we were already close to the limit:
   7   HOSTCMD          00000000    0.104035  472/488
Increase to 640 bytes.

BUG=chrome-os-partner:44381
BRANCH=ryu
TEST=Check auto calibrate works.

Change-Id: Ife014baf4316cdca952104c5158f38cd106e023f
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/295590
Reviewed-by: Sheng-liang Song <ssl@chromium.org>
2015-08-26 08:28:24 +00:00
Gwendal Grignou
fb131573bd ryu: Increase CHIPSET stack size
We are very close from the current limit (456 bytes).
Increase the limit to 640 bytes.

BRANCH=smaug
TEST=Hit the limit while debugging, check the new limit.
BUG=none

Change-Id: I6673000bcac48b88599082eb797f0782c4fee454
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/289837
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2015-08-01 02:50:46 +00:00
Gwendal Grignou
e7b2d5bcea ryu: sensor hub: Add FIFO and interrupt support
Enable code to use BMI150 FIFO and interrupt support on Smaug

BUG=chrome-os-partner:39900
BRANCH=smaug
TEST=Check fifo is working, interrupts are enabled.

Change-Id: Ifc07da793d3ece4806895db4aff5d880c0f3d9b0
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/274228
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2015-07-10 03:40:24 +00:00
Shawn Nematbakhsh
e05ed041cf charger: Move USB charger / BC1.2 task to common code
Move the task responsible for detection of USB chargers to common code
to reduce code duplication.

BUG=chrome-os-partner:40920
TEST=Manual on samus_pd. Plug USB charger, verify detection is correct
on both charge ports.
BRANCH=None

Change-Id: I362f8b5b51741509e459c66928131f1f6d2a3b1d
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/276210
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Alec Berg <alecaberg@chromium.org>
2015-06-10 19:48:08 +00:00
Gwendal Grignou
5dd0f62c31 ryu: Add bosh sensor to smaug EC.
Add Primitive support for Bosh Sensor.
Neither gesture nor FIFO are supported.

BUG=chrome-os-partner:39900
BRANCH=none
TEST=Running accelinfo.
From user space, check values via /sys/class/iio/devices/...

Change-Id: I62dbe230c9064ec7c0fa8e343bbe6eae843e3ac0
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/270455
Reviewed-by: Sheng-liang Song <ssl@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2015-05-12 23:36:00 +00:00
Vincent Palatin
b9222ae924 ryu: remove charge ramping
The charger chip is supposed to handle this feature in hardware.
Let's disable the software version to exercise the hardware.

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

BRANCH=none
BUG=chrome-os-partner:38603
TEST=on Ryu P6, plug BC1.2 chargers through legacy A-to-C cable.

Change-Id: I074eee0621ba8d23c7ef87dd251ce8fbf86a0265
Reviewed-on: https://chromium-review.googlesource.com/269518
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
2015-05-06 04:40:10 +00:00
Alec Berg
777867a40f ryu: add charge ramp module
Add charge ramp module to samus. For BC1.2 DCPs allow ramping
up to 2A, and for BC1.2 SDPs allow ramping to 1A.

BUG=chrome-os-partner:34946
BRANCH=none
TEST=tested with a variety of BC1.2 chargers, type-C only chargers,
and PD chargers to make sure we always stabilize charging at an
appropriate current limit.

Change-Id: I63d4ba38f2e137aff32831386f1bde2cc7c57850
Signed-off-by: Alec Berg <alecaberg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/249934
Commit-Queue: Vic Yang <victoryang@chromium.org>
Tested-by: Vic Yang <victoryang@chromium.org>
2015-02-21 09:20:03 +00:00
Vic Yang
f153ad69ed ryu: Debounce BC1.2 charger detection due to asynchronous pin contact
This is basically ryu version of CL:237241.

BRANCH=ryu
BUG=None
TEST=Repeatedly plug in a DCP charger, and verify that it's detected
correctly.

Change-Id: I036d1b2a52249234f38428e98a3e5fd5db2354b9
Signed-off-by: Vic Yang <victoryang@google.com>
Reviewed-on: https://chromium-review.googlesource.com/239914
Tested-by: Vic Yang <victoryang@chromium.org>
Reviewed-by: Shawn N <shawnn@chromium.org>
Commit-Queue: Vic Yang <victoryang@chromium.org>
2015-01-09 22:38:19 +00:00
Vic Yang
3bcc5673c9 ryu: switch default firmware to use STM32F373
This simply renames ryu to ryu_p1, and ryu_p2 to ryu. 'ryu_p1' will be
kept for a while and will be decommisioned when most developers make
switch to the new boards.

BRANCH=None
BUG=chrome-os-partner:33583
TEST=Build ryu and boot on P2 board.

Change-Id: Ief61c64c6aefdaeae76ac7b86e0ea28131810aa1
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/229291
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2014-11-12 23:08:12 +00:00
Vic Yang
9a2afe9f78 ryu: plankton: Increase PD task stack size
The PD task is using more space in the stack and I'm seeing frequent
stack overflow on Plankton. On Samus, we already increased the stack
size. Let's also increase this on Ryu and Plankton.

BUG=None
TEST=make buildall
BRANCH=None

Change-Id: I468985303b7fd38455dd1fed9db54544581c49cf
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/223368
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
2014-10-15 18:22:15 +00:00
Vincent Palatin
4ecdf8fc0b ryu: add power sequencing
Update the Ryu board configuration to re-use the Tegra power state
machine.
Add the new HOLD GPIO which is wired to PE14 (TP2).

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

BRANCH=none
BUG=none
TEST=on Ryu, use the power button to switch on and off the AP.

Change-Id: I310438e0b923956d1539fb919c266a94909e3461
Reviewed-on: https://chromium-review.googlesource.com/206854
Reviewed-by: Vic Yang <victoryang@chromium.org>
Tested-by: Vic Yang <victoryang@chromium.org>
Commit-Queue: Vic Yang <victoryang@chromium.org>
2014-07-29 02:20:19 +00:00
Vincent Palatin
bc4973c1f9 ryu: bringup fixes
- tune stack sizes
- re-order properly the ADC definitions
- select the right battery gas gauge

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

BRANCH=none
BUG=none
TEST=on Ryu, exercise ADC and battery using the EC command-line.

Change-Id: Idc307b1c1ce1d35e7b5fa2c86f956cc4c8b08783
Reviewed-on: https://chromium-review.googlesource.com/207272
Tested-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
2014-07-10 21:21:00 +00:00
Vincent Palatin
88e0d79cf2 Add board support for Ryu
Add the Ryu board configuration and USB Power Delivery configuration.

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

BRANCH=none
BUG=none
TEST=make BOARD=ryu

Change-Id: I61f6f19dc9fe19e1d9f9017c1050fc8a30a862e7
Reviewed-on: https://chromium-review.googlesource.com/206586
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
2014-07-09 05:32:00 +00:00