| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
| |
BUG=none
TEST=none
Change-Id: I0f03f432ada1064ffba9595be78ca7ab4d25ecd1
Signed-off-by: Brian Norris <briannorris@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3155253
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Owners-Override: Jora Jacobi <jora@google.com>
Tested-by: Jack Rosenthal <jrosenth@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
From our measurement, it takes ~80ms for CABLE_DET to be asserted. Let's
wait for that long before giving up and declare it an USB host.
BUG=chrome-os-partner:20405
TEST=Manual
BRANCH=Spring
Change-Id: I71568ed8011f9b3f2c9c2ee67aea3c771a5dbf37
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/59566
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For Spring, we cannot rely on the battery current to decide if it's
fully charged. Therefore, we just use the battery charge level as the
sole indicator. The battery spec says it might stop charging when charge
level is 95%+, so we should show green LED when it reaches 94%.
Otherwise, show yellow LED.
BUG=chrome-os-partner:20017
TEST=Manual. Monitor the battery level and see LED turns green when it
goes from 93% to 94%.
BRANCH=spring
Original-Change-Id: Ia525b2e89ebe36cc2ccce1ea0b798ba03be258a7
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/58059
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
(cherry picked from commit 6a701c59576ace1c6a5d5f74ae661285b1773b97)
Change-Id: I4b5fdafd5ddbe0f637942b49efe7257695dd67a8
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/58651
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Now that when ID_MUX=1, DP_SNS can be connected to either ID_OUT or
CABLE_DET, we need to handle the case where a video dongle is not
reflected by DP_SNS going low. This is done by leaving ID_MUX=1 for USB
host and monitor its detachment by sensing VBUS. As for unpowered
dongle, we just ignore it when it's not recognized.
Note that due to the polarity of CABLE_DET, we now sense dongle
detachement by DP_SNS < 0.25V. To support older boards with ID_OUT
connected, we also disconnect video dongle on system suspend and
shutdown.
BUG=chrome-os-partner:19911
TEST=Powered/unpowered video dongle detected correctly.
TEST=Add a console command to simulate CABLE_DET being high. With that,
check battery charges with powered video dongle. Check nothing happens
with unpowered video dongle.
TEST=Check video dongle considered disconnected when OTG dongle plugged
in or system shutdown.
BRANCH=spring
Change-Id: If7b530b67c98c85017ca663d43c5148f0eb9163c
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/58497
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The new constants used to convert PWM duty cycle to input current,
based on a linear regression done on Aaron's characterization data
measured on DVT1 PCB.
The data points are linear enough to use the linear relationship
to set the current limitation.
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BRANCH=spring
BUG=chrome-os-partner:19281
TEST=none
Change-Id: I8378aaea21d5b3229d505caf4849257ded77e1ad
Reviewed-on: https://gerrit.chromium.org/gerrit/58143
Reviewed-by: Vic Yang <victoryang@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If the I2C transaction fails, we shouldn't cache the status because that
status is not set correctly in LP5562.
BUG=chrome-os-partner:20020
TEST=Boot and check battery LED still works.
BRANCH=spring
Original-Change-Id: I3f40c2d5c85db41e4ba4b80dc5252e5d86100823
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/58072
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
(cherry picked from commit 465b59342a026d231ffef0cfcc1efc9c8e55a4f4)
Change-Id: Ie57985b3c196ed9d1cfcf891a245c74aa0c929fa
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/58182
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Sometimes initialization may fail due to bad I2C bus status. Let's allow
for maximum 3 tries of initialization 500ms apart from previous attempt.
BUG=chrome-os-partner:20020
TEST=Boot and check device type detection still works.
BRANCH=spring
Original-Change-Id: I6ccedf77c92c4b6014ca24c7a63534316eaa7b6a
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/58071
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
(cherry picked from commit 9b981bf1afe1b8c08c46f5911e8e7269349088d3)
Change-Id: Iab9bc9b4db5ecbb8d32dca383e9891c63ebe31d4
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/58181
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Implement the EC hibernate mode by using the stm32f100 standby low power
mode.
Also add the special key combination Alt+VolUp+H to force hibernation.
As we cannot de-activate the watchdog during long hibernation, the
following workaround is implemented:
we are woken-up once by the watchdog and go back to hibernate if we
detect that condition.
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BRANCH=spring
BUG=chrome-os-partner:19595
TEST=on Spring with rework on the EC wake-up pin,
type "hibernate 10" and see the EC console going blank for 10s, then
booting with reset cause equals to "hibernate".
Press Alt+VolUp+H, then wake-up the system by pressing power key.
Change-Id: If0fa8a38df3c75b380d1e5c0092d3396b27567c7
Reviewed-on: https://gerrit.chromium.org/gerrit/58004
Reviewed-by: Todd Broch <tbroch@chromium.org>
Reviewed-by: Vic Yang <victoryang@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
the chromeos-base/ec-utils package is built for BOARD=bds,
so we need the lm4-based platforms to build properly on this branch.
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BRANCH=spring
BUG=chrome-os-partner:20065
TEST=make BOARD=bds
Change-Id: Ic9cc868f665d930bb0a7c4e5bfc1e9aa28599be9
Reviewed-on: https://gerrit.chromium.org/gerrit/58126
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When the main CPU is shutdown, if an AP/EC I2C transfer is still
on-going, the slave I2C controller on the EC will stay stuck with the
"busy" bit set and will refuse further I2C communications when the AP is
restarted.
To solve that issue, we check the busy bit everytime we shut down the
CPU and fully reset the I2C controller if it is set.
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BRANCH=spring
BUG=chromium:241094
TEST=run bootperf on a Spring board for a lot of cycles :
~/trunk/src/platform/crostestutils/bootperf-bin/bootperf 172.22.x.x 40
and see that we are not failing on a ssh connection timeout.
Change-Id: Ia691ae5bfba85ceacd58968487a89913934a3665
Reviewed-on: https://gerrit.chromium.org/gerrit/57047
Reviewed-by: Vic Yang <victoryang@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This reverts commit 154c73f32d2625d2cfbe2fa9be4e15b4f382a917.
The kernel driver to control TPS65090 FETs is now submitted in our tree,
and turning on the FET3 connected the 3G modem by default.
So let's remove the hardcoded to allow better power management policy on
the CPU side.
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BRANCH=spring
BUG=chrome-os-partner:17790
TEST=on Spring, boot and dump the TPS65090 configuration from the EC
command line by using "pmu" command.
See 0x1f in the register 0x11 for FET3.
Change-Id: I9de0f92a561397ceb81a67b8291d1e8bf04ade38
Reviewed-on: https://gerrit.chromium.org/gerrit/57978
Reviewed-by: Vic Yang <victoryang@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The two I2C commands for battery cut-off must be sent out back to back.
Thus we need to guard them with I2C port lock to prevent being
preempted.
This includes a minor refactoring to make it possible to send two
commands without releasing the lock.
BUG=chrome-os-partner:19901
TEST=Check battery cutoff still works.
TEST=In EC console, type 'battery' command and see battery status.
BRANCH=spring
Change-Id: I4dec6881b0a4dc02f81c9ca0670f5ec8bb7dbcc5
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/57697
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On Spring, we now have commands 'i2c' and 'i2cscan'. Currently if we
type 'i2c', it's rejected as it's also the prefix of 'i2cscan'. Since
'i2c' is a full match of a legal command, we should accept it.
BUG=None
TEST=On Spring, check 'i2c' invokes 'i2c' command, and 'i2cs'/'i2cscan'
invokes 'i2cscan' command. Also check 'i2' is still rejected.
BRANCH=all
Original-Change-Id: I65c4c148a5a3e9b025554fa8165ba76da7bc312f
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/57576
Reviewed-by: Randall Spangler <rspangler@chromium.org>
(cherry picked from commit 3e0e15d185f6a324451992a7c2bfc5000c4f15c8)
Change-Id: I420ce6f2a1f50c484d395b383cbcf052090f210e
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/57696
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Sometimes TSU6721 falls into a weird state where video dongle is
recognized as non-standard charger. Let's reset TSU6721 when EC boots,
so that we are guaranteed to have a clean state after initialization.
BUG=None
TEST=Keep doing Power+F3 reset. Doesn't see weird state anymore.
BRANCH=spring
Original-Change-Id: Id09bb1721ae79804dc9b3300a2f3def850c2f70a
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/57575
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
(cherry picked from commit 127b0531099f1a4ccc3dab333fdb44e792f13e74)
Change-Id: I0593019375436ebb7b75b4a86e322a7f7164fd08
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/57695
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is needed to properly notify kernel of power changes.
BUG=chrome-os-partner:19925
TEST=Attach/remove power from video dongle, and see device type changes.
BRANCH=spring
Original-Change-Id: Ic91ad43ed934be021689c4c4557914e6163e06f8
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/57569
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
(cherry picked from commit d07b0d5a5fdb1abb535f39ef2654b52c29a48fba)
Change-Id: Ia97d541ac30b57d7618fbce90c4b78c748201321
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/57694
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Hard-reset triggers a pulse on the PMIC_RESET pin but this is hard to
see when debugging. By printing error message explicitly before
resetting the board, it's easier to tell why the board is resetting.
BUG=chrome-os-partner:19778
TEST=Trivial change. Build and boot on Spring. Make sure system is
alive.
BRANCH=spring
Original-Change-Id: I26b749af2f8760339373c3e4db46c59d7b0d039e
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/57101
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
(cherry picked from commit 1806f521955623770405778a742d0398cae028a2)
Change-Id: I56e0e99e4af77dd769e05d48c97c4ba59e73f851
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/57415
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds the option to specify which LED to control as well as the
ability to query the supported LED color on the board.
BUG=chrome-os-partner:19745
TEST=On Spring:
- ectool led 0 query -> See the max value for R, G, Y is 0x80.
- ectool led 1 query -> See error message.
- ectool led 0 yellow -> See LED turns yellow.
- ectool led 0 green=0x40 red=0x40 -> See green and red lit up.
- ectool led 0 auto -> See LED turns off (without charger.)
BRANCH=spring
Original-Change-Id: Ibdde2f7450122f59383dad1030a0a2a985386f73
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/56877
(cherry picked from commit e52aba6ecac45d2c27acc78316e835620840408a)
Change-Id: Ib6bbf6b52f36c82a616c02a60296c8ec9834e382
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/57414
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We are now using solid yellow for both charging and battery assist mode.
No need to use breathing yellow effect anymore.
BUG=chrome-os-partner:19747
TEST=Manual
BRANCH=spring
Original-Change-Id: I9574ac7ef7137fc1d0ebe84316756fa28e9a84aa
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/56732
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
(cherry picked from commit dcc9d9d735c859836eb9490b9fd94da2979c6c90)
Change-Id: I9002cf53ca46ba04fc057fd343c8a4129db2c793
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/56908
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This provides a way to control LED color with ectool. We can either set
the color or switch back to automatic control.
BUG=chrome-os-partner:19745
TEST=ectool led red -> LED turns red.
ectool led green -> LED turns green.
Unplug charger -> LED turns off.
ectool led green -> LED turns of and shows green.
ectool led auto -> LED back to normal.
BRANCH=spring
Original-Change-Id: I0b455f34cea448660fe44a5fecaac1cb084f8144
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/56721
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
(cherry picked from commit 87d8f8e5b1ced8647640eef710088d453d0f0e33)
Change-Id: I912db968f030a24527ea2ddbf9c63ad56297b57a
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/56906
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When we try to set LP5562 LED to the same color as it is currently, we
should just skip the I2C commands. Let's cache its current color so that
we don't waste time on unnecessary I2C transactions.
BUG=chrome-os-partner:19705
TEST=Set LED color manually on spring and doesn't see it change. Unplug
and plug in the charger, and see LED goes back to yellow after few
seconds.
BRANCH=spring
Original-Change-Id: I87e3cf7d53bccc45048ea64dad9925a362cddab7
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/56716
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
(cherry picked from commit 99e3fc93e697d646925972790060805e72e39da5)
Change-Id: I1cb266681c19cdadcb72fe1974bf4c7858534c2f
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/56905
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When we use about the same amount of power as what the charger provides,
we sometimes show green LED. We should avoid this when the battery is
not full.
BUG=chrome-os-partner:19746
TEST=Manual
BRANCH=spring
Original-Change-Id: Id31762aefe22535de64f63a023c35995a3725ef8
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/56724
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
(cherry picked from commit 3501ccffdb28306ec77003c96df3b898fd7a9545)
Change-Id: I66ed4d1f964fead972e33c6f7e05422b6323a1e0
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/56907
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Also remove the TODO for using ADC watchdog, which proves to cause ID
voltage shift.
BUG=None
TEST=None
BRANCH=spring
Original-Change-Id: Ic664c478c3c6751f84ad1aacd81a8c286deebeb9
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/56677
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
(cherry picked from commit eb18f65941265b4c71a256a7610c36416df10032)
Change-Id: Ia43a55ed1f9ba5edf4ee2c80fd0c1b2ba3a500ff
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/56909
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If the AP is already on, the kernel should handle low-power event. We
shouldn't power off the system on sysjump.
BUG=chrome-os-partner:18318
TEST=None
BRANCH=spring
Original-Change-Id: I4e80c61a25d2fa503d0c97e22dc2f4ad9c44f716
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/56706
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
(cherry picked from commit 5d66f23d216aad16b4b908cd10b206cc2f230eb0)
Change-Id: If727757e09276fd3e28915c7e67dd5765bdceaab
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/56910
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If the user plug in the charger really slowly, VBUS and GND will make
contact before ID pin. Currently timer is set to fire in 0.6 seconds,
which means ID pin need to make contact within 0.6 seconds after VBUS
make contact. This is causing chargers to be recognized as non-standard
charger. Let's extend this to 3.6 seconds.
BUG=chrome-os-partner:19765
TEST=Plug in a charger half-way through and see device type 0x20000.
Wait for 3.6 seconds, and see it changes to 0x60000.
TEST=Plug in a charger half-way through, wait for 2 seconds, and then
plug it in all the way. See device type 0x20010.
TEST=Plug in a charger to the end. See device type 0x20010 immediately.
BRANCH=spring
Original-Change-Id: I46c408e7bc733fe4f3655db253f4065a4f12ee1a
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/56772
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
(cherry picked from commit 6759fdc3e6dd7e8901fcf8e25490e4e20273cbcb)
Change-Id: I6b72e4a9c6e0ef000aad3e833b47c53fac0005ec
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/56911
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
While in fast mode, we step on the same PWM duty cycle which caused
over-current. We should avoid this.
BUG=chrome-os-partner:18301
TEST=None
BRANCH=spring
Change-Id: I0ff29d47aa52d4e306c84e35ef0753f680403bc4
Original-Change-Id: Ib22eb7244d1f6173d4486dce7b85a55678318490
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/56675
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
From our experiments, on EVT2 hardware, we can at least boot to the
firmware low battery screen with our power brick and no battery
connected.
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BRANCH=spring
BUG=chrome-os-partner:18927
TEST=on Spring, with a drained battery, try to boot with our brick and a
random cable.
Change-Id: Ibf282a84409a25c88bf49fe6e3738b6405a638ec
Reviewed-on: https://gerrit.chromium.org/gerrit/56544
Reviewed-by: Puneet Kumar <puneetster@chromium.org>
Reviewed-by: Vic Yang <victoryang@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Starting DVT, Spring boards have updated hardware to prevent cap ringing
when a charger is plugged.
Adjust T01, T12, T23 and T34 current limit to 87.5% as expected by this
mechanism.
Push all termination voltages to 2.1v as the actual temperature range is
not related to the real charge temperature.
On pre-DVT boards, this will just reduce the max charging rate by 12.5%.
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BRANCH=spring
BUG=chrome-os-partner:18987
TEST=on Spring EVT, use "pmu" command on the EC console and see
registers 0x5 to 0x9 contain : "3e 5e be fe ff"
Change-Id: Ie078a38251cd2cb50ee605c34a6818bf994d148d
Reviewed-on: https://gerrit.chromium.org/gerrit/49484
Commit-Queue: Jon Salz <jsalz@chromium.org>
Reviewed-by: Jon Salz <jsalz@chromium.org>
Tested-by: Jon Salz <jsalz@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If the current value is lower than 500mA and voltage is higher than
4.55V, draw more current.
Also to make PWM duty cycle more stable, disable fast mode once we hit
low voltage condition.
BUG=chrome-os-partner:19486
TEST=Plug in a low voltage USB host. Check we draw more current.
BRANCH=spring
Original-Change-Id: I91ee97ca15247d49427d4db34d17a0d0c55b2684
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/55722
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
(cherry picked from commit 2d1268d891b525e71e3b268d0f90aa89137c008d)
Change-Id: I8b76cb6744e0defa446df0b675bacaf398793215
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/55863
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For Spring, the charging time can be quite long and TPS65090 ends up in
timeout state and stops charging. Let's put charge state machine back to
re-init so that the device continues charging after checking charging
condition is good.
BUG=chrome-os-partner:19405
TEST=Pass charger test
BRANCH=spring
Change-Id: Ie670086bea2c5f14119610e72a87a3977bddc933
Original-Change-Id: I838741e7283eb31ed76cf3979dbad7f070947aea
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/55721
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The order of high byte and low byte was incorrect.
BUG=None
TEST=Dump interrupt value and check manually.
BRANCH=spring
Change-Id: I89dcaf39b1a67534081101807d8887ae91157b44
Original-Change-Id: I08657ad42bdc747cff2dd7d0e8be76fa44fc9563
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/55718
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This reverts commit a041fe062a1122301fb0f5a7113b14dc8c33e782.
ADC watchdog is sourcing too much current onto ID_OUT net, and causes
voltage to rise by 0.4V. Let's revert this and use the monitoring loop.
BUG=chrome-os-partner:18397
TEST=Plug in the dongle and see kernel message about cable detect.
BRANCH=spring
Change-Id: I01d9cace1febc91140d302fe9572e6f0bbb8a036
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/55713
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The current sense resistor has changed. Update constant here to reflect
the new values for DVT1.
BUG=None
TEST=Build Spring
BRANCH=Spring
Original-Change-Id: Ib27c45cef569fa758db2fbb428150c8c2b6732ef
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/49892
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Change-Id: I176346f13880a63c611fc70dcdb4c462e729b146
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/51476
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When system is locked, the console is disabled. However, we need console
for debugging and testing. This CL uses a bit from back-up register to
indicate if the console should always be enabled. (This bit is currently
used by fake WP, which is removed in this CL.) With this, we can set
this bit with console command 'forceen 1' to ensure console is never
disabled.
To prevent device shipped in this state, the chip name is postfixed with
'-unsafe' so that the device is not able to pass HWID check.
BUG=chrome-os-partner:19293
TEST=Manual
BRANCH=spring
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/51086
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
(cherry picked from commit c8b7b430fe5e4aa3d5f27fbd160dfee31254e36d)
Change-Id: I095c5e2ac548d6dbc825ac7a141065ec2b8588c1
Reviewed-on: https://gerrit.chromium.org/gerrit/51474
Tested-by: Vic Yang <victoryang@chromium.org>
Commit-Queue: Vic Yang <victoryang@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We cannot know how much current we can pull from video dongle, so let's
just try to pull as much as possible up to 2A.
BUG=chrome-os-partner:19324
TEST=Plug in video dongle and see 3.3V output.
TEST=Plug in video dongle with supplied charger, and see 50% PWM duty
cycle.
TEST=Plug in video dongle with normal charger, and see 70~80% PWM duty
cycle.
BRANCH=spring
Original-Change-Id: I8b503f886fcafaa11e6757a5059ce673a8ed53cc
Signed-off-by: Vic Yang <victoryang@chromium.org>
Change-Id: I480e0e0cce604306ab00e98f0f5ea81772607a60
Reviewed-on: https://gerrit.chromium.org/gerrit/50965
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If the user unplug video dongle before it is detected and handled, we
may be stuck with ID_MUX=1 and interrupt from TSU6721 disabled. This
essentially breaks charging.
BUG=chrome-os-partner:18997
TEST=Build and check charging port still works.
BRANCH=spring
Original-Change-Id: I93e69287d07947fef743b4674857e52c26513835
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/50969
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
(cherry picked from commit 8ab12847b55b34e07e35eba11b74f1ef1ce25a78)
Change-Id: I7f15973af27439e6a603b6f0473ab43dcf40cc90
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/51098
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This includes:
- Increase overcurrent retry count from 1 to 2.
- Mark overcurrent event regardless of what current PWM duty cycle is.
- PWM duty cycle settles faster.
- PWM duty cycle starts from ~100%.
BUG=chrome-os-partner:19001, chrome-os-partner:19037
TEST=Manual
BRANCH=spring
Original-Change-Id: Idf007fb589fde3baef6c8975dfa1f2fc1ec6e95d
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/50262
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
(cherry picked from commit ac3488cd0b41ade3dd38ec61c4b07db6489f2260)
Change-Id: I0fee98efa05d0f7f801242ec129740c8f0e5f2f8
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/50964
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The spec suggests we cannot reliably go over 1.5A and gracefully
recover. Let's avoid going over that limit.
BUG=chrome-os-partner:19267
TEST=Build spring
BRANCH=spring
Original-Change-Id: I07411ff3ce4107e0289c5af5365ef5a23fd23e4e
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/50321
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
(cherry picked from commit b1b91c82b6b110f6325c82d42a1f9673b0653ea4)
Change-Id: Ic01052f0b178e2e8403ee482e91d2853da88797f
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/50543
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When the user powers off the device with power button, the keyscan mutex
gets locked by GAIA power task and is never unlocked until next boot.
This blocks charger task when it tries to send battery key. Let's not
try to do anything with keyscan when the system is off.
BUG=None
TEST=Power off with power button. Plug/unplug charger and see console
output.
BRANCH=spring
Change-Id: Ic6808bd669f054ba48208566de99e837518274fb
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/50364
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Todd Broch <tbroch@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The EC currently assumes the AP only provides USB power during S0, which
is incorrect. This CL adds S3 so that it behaves when the device is
suspended.
BUG=chrome-os-partner:19190
TEST=Suspend and unplug power. Doesn't hear clicking sound.
BRANCH=Spring
Original-Change-Id: Ice1421bda55b2fee408ba062ed3de7a697ccd0c8
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/50093
Reviewed-by: Todd Broch <tbroch@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
(cherry picked from commit 2dfccc7d28af188cdd7cb6e422bc09173caa3de9)
Change-Id: I4ae19bc5813ce4d5ff096cf564f455eb988815e3
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/50193
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
BUG=chrome-os-partner:18818
TEST='ectool batterycutoff' on Spring.
BRANCH=spring
Original-Change-Id: Idf315562930744ae1e7425d6e15915b0477c2343
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/49651
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
(cherry picked from commit 8961ef44e4c11b65df5bab93281825d374c87d81)
Change-Id: Ia01b29342b7154264eab548f5e03a8ff824600a5
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/49785
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This fixes a bug in ADC watchdog that sample sequence is not set before
enabling ADC watchdog. Also, current sample time isn't long enough for
some weakly driven net. This extends ADC sample time to 13.5 cycles.
BUG=chrome-os-partner:17928
TEST=Test with Toad cable and video dongle on Spring
BRANCH=spring
Original-Change-Id: Iecdfd4aada4e974225a41144e213e92897f4797b
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/49680
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
(cherry picked from commit 23cb9982058092993f319b2b30fefd52639af288)
Change-Id: Iaf29f247db713469b19173c67f7cafae6793f96b
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/49714
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This eliminates a per-second hook and removes a duplicated ADC read per
second. Also, TSU6721 is now reset after every detachment. This way, we
don't suffer from TSU6721 dirty state (most commonly seen after OTG
dongle detached.)
BUG=chrome-os-partner:17928
TEST=1. Test plugging/unplugging video dongle.
2. Test Toad cable mode switching.
3. Test charging with 200K charger.
BRANCH=spring
Original-Change-Id: Ic035b7332e07ca385d766c735ce39efd31e46034
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/49578
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Change-Id: Ia6cbbe102491642c514cb47919793b96e20efbbe
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/49715
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With a Toad cable, the user can access the EC serial console through the
micro-B connector.
We probably need to de-activate the input on the EC serial console when
the Write-Protect is on, since we have fairly "powerful" commands on the
EC command-line.
Add a new CONFIG_CONSOLE_RESTRICTED_INPUT on platforms with externally
accessible EC serial port.
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BRANCH=spring
BUG=chrome-os-partner:18716
TEST=on Spring with CONFIG_CONSOLE_RESTRICTED_INPUT set, try with and without
write-protect, use successfully the EC console in the former case, and see
"Console is DISABLED" in the latter case.
Original-Change-Id: Ic9646d5468183f4d8f94b5e5e1d2a727941d7bbe
Reviewed-on: https://gerrit.chromium.org/gerrit/49537
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
(cherry picked from commit 980df549794785ebadd2f4c26323e3f1bf3d3b02)
Change-Id: I2c0c26eda540232f442c1d676ad311b8e29778f5
Reviewed-on: https://gerrit.chromium.org/gerrit/49637
Reviewed-by: Vic Yang <victoryang@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Spring supports Toad cable on the micro-B connector.
So let's define CONFIG_CONSOLE_RESTRICTED_INPUT on this platform
in order to de-activate the input on the EC serial console when
the Write-Protect is on.
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BRANCH=spring
BUG=chrome-os-partner:18716
TEST=on Spring, try with and without write-protect, use successfully
the EC console in the former case, and see "Console is DISABLED" in
the latter case.
Change-Id: I843582dd4950ce235db5cbb62dad2cad1fabf72c
Reviewed-on: https://gerrit.chromium.org/gerrit/49638
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Vic Yang <victoryang@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When battery flags TERMINATE_CHARGE or OVER_CHARGED alarm, we should
treat them as a signal of battery fully charged.
BUG=chrome-os-partner:18914
TEST=On Spring:
1. Plug in adapter when battery if full, see green LED.
2. Plug in adapter when battery is not full, see yellow LED.
BRANCH=spring
Original-Change-Id: Ica414a0e1667b8f30a0cc9a5d66dba1b119a59ba
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/49456
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
(cherry picked from commit 115ab924fc16e8d8403433b243b1fabb53e42dac)
Change-Id: Ie611fe9e59f2e9981de9674999efbae0acace2a1
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/49580
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We are moving video power from VFET2 to VFET4. To support old boards, we
need to enable both of them. When new boards are in place, we can then
drop VFET2.
BUG=chrome-os-partner:18186
TEST=Build spring
BRANCH=spring
Original-Change-Id: If0cbc1ac49affc1e3c7ec9650a661f80be826f97
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/49431
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
(cherry picked from commit 6d19c024a9fc813a81193f1eef065af8dc855ae9)
Change-Id: I6b8f9cc9db020b9452ca623f89ae43968b29f206
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/49579
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently INIT state can mean different things. This change introduces
two new states to demultiplex INIT. Now, REINIT means charge state
machine is deciding the next state. BAD_COND means it's waiting for
acceptable charging condition. Note that the three states are doing the
same thing so there is no functional change.
BUG=chrome-os-partner:18914
TEST=none
BRANCH=spring
CQ-DEPEND=CL:49430
Original-Change-Id: Ia783e76cf27e28103ef44fe7b8a43674dadccc54
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/49326
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
(cherry picked from commit 92bd863d8dcd1d006d39b9f95547af5c7347c254)
Change-Id: I51a25fcf6350eb4d00bb93241545a58b0f821722
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/49429
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This includes two situations:
1. When charge state machine is still trying to decide the next state.
2. When we are waiting for acceptable condition to start charging.
For now, we show yellow for both.
BUG=chrome-os-partner:18914
TEST=none
BRANCH=spring
Original-Change-Id: I5dd97c735a1ecfee29d506452695014c85d2da0b
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/49327
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
(cherry picked from commit 0d645f105e330ef502cbe01c88561c4d1fd1ae9f)
Change-Id: I7ab3ba7d7173b4bfb906c4efa85f27b4c3c26147
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/49430
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When the fake battery key is asserted, the special runtime key
combination detection is counting the number of keys and getting 4
keys instead of 3.
In order to get the proper action in that case, relax the condition.
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BRANCH=spring
BUG=chrome-os-partner:18919
TEST=on Spring, press alt+VolUp+R with and without charger plugged and
see the machine rebooting in both cases.
Change-Id: I6dc0787f48aa3802f1f2804be6ee50a013b35575
Reviewed-on: https://gerrit.chromium.org/gerrit/49187
Tested-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Todd Broch <tbroch@chromium.org>
Reviewed-by: Sameer Nanda <snanda@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When lid is closed, any key press is very likely bogus. Let's disable
keyboard in this case.
BUG=chrome-os-partner:17653
TEST=Check keyboard still works. Use a magnet to suspend the system, and
check any keypress is discarded.
BRANCH=spring
Change-Id: I24d40059b851f020ff1f93fe3282e955eeb0e526
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/49034
Reviewed-by: Randall Spangler <rspangler@chromium.org>
|