| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add flag for whether or not device plugged into a given port is a
dual-role PD device. For now, the dual-role flag is always 0, but
need to add the flag to the host command now for compatibility
in the future.
BUG=chrome-os-partner:32650
BRANCH=samus
TEST=load onto samus, run ectool --name=cros_pd usbpdpower and
verify that for anything plugged in it says "dedicated charger"
Change-Id: I2d3c8c149802492f27a87a47aaa68fbf505ee7a9
Signed-off-by: Alec Berg <alecaberg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/226820
Reviewed-by: Sameer Nanda <snanda@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The serial console works. Nothing else is implemented yet.
BUG=none
BRANCH=ToT
TEST=make buildall -j
To build,
make BOARD=cr50 hex
Testing the result requires a development board. I have one. It
works with HW revision m3.dist_20140918_094011
Change-Id: I718d93572d315d13e96ef6f296c3c2796e928e66
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/226268
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When sysjump between RO and RW code, the motion sensor global
data structure get reset to 0. The motion sensor task does not
get notification from the power state change event.
Added chipset S0 state check logic to re-init sensor active flag to S0.
BUG=chrome-os-partner:33370
BRANCH=ToT
TEST=sysjump RW; accelread 0
Test Cases:
1 - press power cycle button; checked with powerinfo,accelread
2 - press power cycle button + F3 (refresh) key; checked with powerinfo,accelread
3 - Go to G3, S0, S3; checked with powerinfo, accelread
4 - boot up to S0; sysjump RW; accelread 0|1|2
Change-Id: Ibfe4ba581c8b771be15adb7440374d09fdf03953
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/226698
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Commit-Queue: Sheng-liang Song <ssl@chromium.org>
Tested-by: Sheng-liang Song <ssl@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add support for more host events and add a host command for the host
to use to get which host events have fired. The EC only uses one
real host command to notify the AP whenever the PD MCU needs attention
so the EC_CMD_PD_HOST_EVENT_STATUS host command can be used to
differentiate the possible triggers for the host event.
Current events include: PD remote device needs update, type-C power info
changed, and PD identity response received.
Added host event for power info change, which fires whenever a charger
or device is plugged into a type-C port.
BUG=chrome-os-partner:32650
BRANCH=samus
TEST=tested on samus by connected various peripherals to type-C ports
and verifying on EC console that a host event is sent.
Change-Id: Ibfc2cafe5826a0ab41aee96a68fdb561c0a2b4ab
Signed-off-by: Alec Berg <alecaberg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/225841
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Per table 6-24 of USB PD spec an alternate mode adapter (AMA) should
include both product & AMA VDOs.
BRANCH=samus
BUG=chrome-os-partner:31192,chrome-os-partner:31193
TEST=manual,
Connect hoho/dingdong to fpie/samus and see product VDO proceed the
AMA VDO in DFP_U console output:
Product VDO -----------------------------v
|------|
SVDM/5 [1] ff008041 340018d1 00000000 50100001 1100000b
Note, hoho's PID == 0x5010
And dingdong (0x5011)
SVDM/5 [1] ff008041 340018d1 00000000 50110001 1100000b
Also see bcdDevice field in descriptor match above data.
$ lsusb -v -d 18d1: | egrep -i "idproduct|bcddev"
idProduct 0x5011
bcdDevice 0.01
Change-Id: I4d898816a45c68c7ff75a54fd348fc11be408ae0
Signed-off-by: Todd Broch <tbroch@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/226125
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
USB Billboard class can be used to advertise an alternate mode capable
device that hasn't entered a mode. Additionally it can remain after
mode entry providing its Billboard capabilities descriptor is
updated.
This CL postpones enumeration which previously occurred after boot
until tAMETimeout has passed and alternate mode has NOT been entered.
Future CL could choose to also (re)enumerate with mode capabilities
although this is not required by the USB PD specification.
BRANCH=none
BUG=chrome-os-partner:31192,chrome-os-partner:31193
TEST=manual,
With DFP_U which does not enter mode see Billboard class enumerate
else it does not.
Change-Id: I59a0815cd0ea551ba9a878907c0184df4ba9480c
Signed-off-by: Todd Broch <tbroch@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/224663
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix bug in tap gesture. When turning on tap detection, don't
clear the history circular array index. This was causing inconsitent
tap for battery recognition because the inner window sum of z-axis
data (sum_z_inner) was relying on subtracting out old historical
data and adding in the new data, but when the array index changed,
it was subtracting out the wrong old data. This really only came in
to play if there was significant z motion before the last wakeup.
BUG=none
BRANCH=samus
TEST=keep going to sleep and waking up and test that tap for
battery works every time.
Change-Id: I55e00c805d504dd6d257a81f2cd25fe384a53257
Signed-off-by: Alec Berg <alecaberg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/226591
Reviewed-by: Sheng-liang Song <ssl@chromium.org>
Reviewed-by: Gwendal Grignou <gwendal@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
BRANCH=samus
BUG=chrome-os-partner:31192,chrome-os-partner:31193
TEST=manual
Attach hoho/dingdong to samus and see AMA VDO bits <2:0> set to 0x3
during the discover identity response.
AMA VDO
|------|
SVDM/4 [1] ff008041 340018d1 00000000 1100000b
Change-Id: I1e2459b87cceca88ab3ae09440b689041ae03c7c
Signed-off-by: Todd Broch <tbroch@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/226101
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
HPD needs to be transported of USB PD as both SBU lines are consumed
for differential AUX signalling.
This CL does the following:
1. Enables GPIO DP_HPD as interrupt
2. Sends debounced HPD across CC via the SVDM DP status message
BRANCH=none
BUG=chrome-os-partner:31192,chrome-os-partner:31193
TEST=manual,
From servo w/ GPIO attached to HPD drove the following transactions
after inserting with HPD low initially:
# e1: hpd_high
# e2: hpd_low
# non-registered glitch
# e3: hpd_high followed by hpd_low
# e4: hpd high
# non-registered glitch
# e5: hpd_irq
# e6: hpd_irq
# e7: hpd_irq
# e8: hpd_low followed by hpd_high
From fruitpie console (marked up to show result of above)
----> enter-mode, dp status, dp config
[6.774108 DONE] SVDM/1 [4] ff018144
[6.777467 DONE] SVDM/2 [16] ff018150 00000002
[6.780637 DONE] SVDM/1 [17] ff018051
----> attentions start arriving
----> e1 [18.966741 DONE] SVDM/2 [6] ff018106 0000008a
----> e2 [33.724367 DONE] SVDM/2 [6] ff018106 0000000a
----> e3 [64.550398 DONE] SVDM/2 [6] ff018106 0000008a
----> e3 [64.752452 DONE] SVDM/2 [6] ff018106 0000000a
----> e4 [74.247127 DONE] SVDM/2 [6] ff018106 0000008a
----> e5 [88.906254 DONE] SVDM/2 [6] ff018106 0000010a
----> e6 [100.938738 DONE] SVDM/2 [6] ff018106 0000010a
----> e7 [123.693414 DONE] SVDM/2 [6] ff018106 0000010a
----> e8 [130.050074 DONE] SVDM/2 [6] ff018106 0000000a
----> e8 [130.254087 DONE] SVDM/2 [6] ff018106 0000008a
Change-Id: I976c268467ece84cedab7ba4943fb59d1e48c113
Signed-off-by: Todd Broch <tbroch@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/223262
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Properly set the comparator output when using CC2.
Also add some basic LED color to display the current power contract when
we are a sink :
- green : 5V
- red : 20V
- blue : other voltage
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BRANCH=none
BUG=none
TEST=plug to Zinger in each plug direction and see green then red LED.
type "pd 0 dev 12" and see the blue LED.
Change-Id: I4eb4339568eda5871c7f3df75bedebd97238e941
Reviewed-on: https://chromium-review.googlesource.com/226385
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Update the INA naming in the optional PD code to use Twinkie as PD
source/sink.
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BRANCH=none
BUG=none
TEST=none
Change-Id: Ib06e274c0d916d6c84107546a8701fc80b4e6ab1
Reviewed-on: https://chromium-review.googlesource.com/226363
Reviewed-by: Vic Yang <victoryang@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Get type-c port power info including power role, charger type,
and charging info. Also added host command to get number of type-c
ports.
Also adds new charging suppliers for pericom identified chargers
including DCP, CDP, SDP, proprietary, and other chargers. Priority
of these for charging is set in samus board file.
BUG=chrome-os-partner:32650
BRANCH=samus
TEST=run 'ectool --name=cros_pd usbpdpower' and verify correct
status with minimuffin, zinger, and type-C to type-A adapter.
Change-Id: I1dabbe7de4185a23df5684a5ea9a2d944f1f6ff5
Signed-off-by: Alec Berg <alecaberg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/223523
Tested-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-by: Todd Broch <tbroch@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Now that the problem with UART in STOP mode is fixed, let's enable low
power idle for Ryu P2 boards.
BRANCH=None
BUG=chrome-os-partner:33219
TEST=Shut down the AP and unplug AC power. Check the EC goes into
deep-sleep by 'idlestat'.
TEST=Power up the AP and check the EC stays awake.
Change-Id: Ib8ad3763407315ec0f95551fa0fdd258a060e113
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/226312
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Alec Berg <alecaberg@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This isn't really an EC as Vincent pointed out,
rename this endpoint serial interface to Shell.
Signed-off-by: Anton Staaf <robotboy@chromium.org>
BRANCH=None
BUG=None
TEST=make buildall -j
Change-Id: Id4605b782cdb8e1be5293f4b6b88357bd653c770
Reviewed-on: https://chromium-review.googlesource.com/226331
Tested-by: Anton Staaf <robotboy@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Commit-Queue: Anton Staaf <robotboy@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Set state or numeric when needed
Add debug for the idle state.
BUG=None
BRANCH=ToT
TEST=Check debug appears when enabled. Check tap still works.
Change-Id: Ic4660f70a27464dc68c02fdaef60dc36d7c2edad
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/225487
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Reviewed-by: Sheng-liang Song <ssl@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Split motion_sense.c.
Translate the accel data in the Android coordinate right away.
BUG=chrome-os-partner:32002
BRANCH=ToT
TEST=On samus, check lid angle are still correct.
Change-Id: If743e25245dc1ce4cdacb8a4d5af22616c4a79e4
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/225486
Reviewed-by: Sheng-liang Song <ssl@chromium.org>
Reviewed-by: Alec Berg <alecaberg@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
These subcommands allow accessing sensor (accel+gyro)
over i2c.
BRANCH=ToT
BUG=chrome-os-partner:31071
TEST=Compile.
Change-Id: Ic6c3e9bf9c23f369de9f540c50daab7f2e4582ee
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/225653
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Move gesture to common directory, 1st step to be reused by
other board.
Cleanup motion_sense shutdown path.
BUG=chrome-os-partner:33102
TEST=Double tap still works on Samus
BRANCH=ToT
Change-Id: I0a3b38c4a7dbe95c27dcdebff04c1176aaf932d1
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/225235
Reviewed-by: Sheng-liang Song <ssl@chromium.org>
Reviewed-by: Alec Berg <alecaberg@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a simple kernel module and Makefile for
building it out of tree. This module just uses
the existing kernel usb serial driver and probes
for the Google VID/Class/SubClass/Protocol that
identifies a valid simple serial interface.
This code should be rolled into the existing kernel
driver at: drivers/usb/serial/usb-serial-simple.c
While that happens, this module is still useful to
developers.
Signed-off-by: Anton Staaf <robotboy@chromium.org>
BRANCH=None
BUG=None
TEST=cd extra/usb_serial; make; sudo insmod raiden.ko
Connect the discovery-stm32f072 over USB and see
that its console is discovered and works.
Change-Id: I83661b816643c43b3e2dc9fdc825bc3a796af2f4
Reviewed-on: https://chromium-review.googlesource.com/225923
Reviewed-by: Olof Johansson <olofj@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Anton Staaf <robotboy@chromium.org>
Commit-Queue: Anton Staaf <robotboy@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Signed-off-by: Anton Staaf <robotboy@chromium.org>
BRANCH=None
BUG=None
TEST=make buildall -j
Verify that the console is discovered and works.
Change-Id: I7bdf85c4435a6423acc915a61c1d1302052113a0
Reviewed-on: https://chromium-review.googlesource.com/225951
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Anton Staaf <robotboy@chromium.org>
Commit-Queue: Anton Staaf <robotboy@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
These names can be used to uniquely identify an interface
as being a console forwarded from the AP, or the EC's
console or some other console. This makes it possible to
connect to the correct console from servo without knowing
what board is attached. These strings could also be used
by udev rules to create appropriate symlinks.
Signed-off-by: Anton Staaf <robotboy@chromium.org>
BRANCH=None
BUG=None
TEST=make buildall -j
Change-Id: I1abd36f952782a03606b09485917be8e154534ce
Reviewed-on: https://chromium-review.googlesource.com/225950
Tested-by: Anton Staaf <robotboy@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Commit-Queue: Anton Staaf <robotboy@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This uses the newly allocated simple serial SubClass
and Protocol identifiers to make enumeration of serial
consoles over USB easier. The simple usb serial kernel
driver can select based on vid/class/subclass/protocol,
making it trivial to attach to serial consoles.
Signed-off-by: Anton Staaf <robotboy@chromium.org>
BRANCH=None
BUG=None
TEST=make buildall -j
Enable USB console on discovery-stm32f072 and verify
that a new ttyUSB? device is discovered.
Change-Id: I6d3e414a20753573c2ee90a48fb1d5dce2c3972d
Reviewed-on: https://chromium-review.googlesource.com/225869
Tested-by: Anton Staaf <robotboy@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Commit-Queue: Anton Staaf <robotboy@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously the USB console code used two separate
bidirectional endpoints. Using the STM32 USB perihperals
endpoints in this manner means that there are only 8 total
endpoints available. But the STM32 USB peripheral allows
for a single endpoint number to be used for both IN and
OUT transactions, and while this (re-using an endpoint
number for both IN and OUT endpoints) appears to be not
compliant with the letter of the law with respect to the
USB spec, it is supported by USB stacks, and is used in a
number of USB devices.
So this change makes the USB console driver share a single
endpoint number between the IN and OUT bulk endpoints used
to implement the console.
Signed-off-by: Anton Staaf <robotboy@chromium.org>
BRANCH=None
BUG=None
TEST=make buildall -j
Enable USB console on discovery board and manually test.
Change-Id: I511e56de2162a6c04ddba80d26b37b4f0cd993fd
Reviewed-on: https://chromium-review.googlesource.com/225868
Tested-by: Anton Staaf <robotboy@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Commit-Queue: Anton Staaf <robotboy@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When calling the ep_undefined function, the linker was not considering
it as a Thumb function and not setting the LSB in the address pointer.
This was causing an exception at runtime.
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BRANCH=all
BUG=none
TEST=inspect assembly
Change-Id: I8f4d1e351081032e138f593f0b61294031fc09b1
Reviewed-on: https://chromium-review.googlesource.com/226093
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add pwm control module for emulation board.
Signed-off-by: Dino Li <dino.li@ite.com.tw>
BRANCH=none
BUG=none
TEST=console manual test, pwm channels output correctly.
Change-Id: I6eb1a9e4fdcb9279e9d0cbd67f7a92afed21c889
Reviewed-on: https://chromium-review.googlesource.com/223921
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Commit-Queue: Dino Li <dino.li@ite.com.tw>
Tested-by: Dino Li <dino.li@ite.com.tw>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
BRANCH=master
BUG=chrome-os-partner:29139
TEST=Buiid an EC FW image and run on Rambi to test if key loss is
improved and any side effect somes with this change. Need more test
units to confirm this.
Signed-off-by: Kenji Chen <kenji.chen@intel.com>
Change-Id: I2399e33d2ca3defe8cd9b1f94ab0af1db7f84635
Reviewed-on: https://chromium-review.googlesource.com/225557
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Mohammed Habibulla <moch@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously the USB console code would wait for up to
30 ms for the USB packet buffer to become available
for transmission, even if it was called from an interrupt
context. This doesn't work because, even if we were OK
with waiting this long in interrupt contexts, which we are
not, we rightly assert that we are not in an interrupt
context in task_wait_event, which usleep calls.
This solution is a quick fix to only wait when not called
from within an interrupt context. The correct solution
is likely to decouple the printf code from directly calling
the console driver code, instead we should place a queue
between the driver and printf logic.
Signed-off-by: Anton Staaf <robotboy@chromium.org>
BRANCH=None
BUG=None
TEST=make buildall -j
Enable USB console on discovery board and manually test.
Change-Id: I5b6f7bbb77f75132c75935f8fda01e652a236ae0
Reviewed-on: https://chromium-review.googlesource.com/225867
Tested-by: Anton Staaf <robotboy@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Commit-Queue: Anton Staaf <robotboy@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Update the sniffer code to sample both CC lines at the same time.
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BRANCH=none
BUG=chrome-os-partner:28337
TEST=make BOARD=twinkie
do an on a sample pattern from the function generator on both channels
and verify that the waveform looks good.
Change-Id: I30c607591775531e432e757f61209733804b55e5
Reviewed-on: https://chromium-review.googlesource.com/224583
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@google.com>
Tested-by: Vincent Palatin <vpalatin@google.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
By default, UART wakes the chip up on RXNE interrupt. This means when
the chip wakes up, RDR is full and only the shift register is empty, and
this leaves us only the time of a single character to process the
character in RDR. On some system, this is not enough and the first (or
even the second) character is overrun, and thus any multi-character keys
(e.g. arrow keys) break.
To avoid this problem, let's change the wake source to wake on start bit
detection. This gives us the time for one more character to wake up and
process the console input.
BRANCH=None
BUG=chrome-os-partner:33219
TEST=Enable low power mode on Ryu P2. In STOP mode, hit up arrow key and
see the last command show up.
Change-Id: Idce4c0bdfcf3e04ad84152ba525f704a0909f115
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/225771
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@google.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Send the current limit chosen by charge manager to the EC so
that it can set the current limit appropriately. Note, before
this change, only the PD negotiated current limit was sent to
EC.
BUG=none
BRANCH=samus
TEST=use a non-PD type-C charger and verify current limit gets
set appropriately on EC.
Change-Id: Ic4bfce052ec8150cad07d35e2cb2fcbfd3d3e6c8
Signed-off-by: Alec Berg <alecaberg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/225667
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Wait until we have a confirmed PD charger before setting the PD charge
limit to non-zero.
BUG=None
TEST=Manual on samus_pd. Insert type C non-PD charger, verify that
current limit is correctly set to to 3000 mA.
BRANCH=Samus
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Change-Id: Ib4ec663d926e6ed955427e4a77123caac0e20252
Reviewed-on: https://chromium-review.googlesource.com/225691
Reviewed-by: Alec Berg <alecaberg@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Allow the list of charge suppliers and port selection priority to be
specified at the board level.
BUG=chrome-os-partner:32650
TEST=Manual on samus_pd. Plug + unplug PD and BC1.2 chargers, verify
that PD is always preferred and higher power port / supplier is always
selected.
BRANCH=Samus
Change-Id: Ic867a40120c809111bf76bf290ed6f204eab1168
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/225292
Reviewed-by: Alec Berg <alecaberg@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Added return parameter to enter mode functions. For DP mode on
samus and fruitpie, only send enter mode if device is a DP
sink (DFP_U).
BUG=none
BRANCH=samus
TEST=make buildall. tested a simpler version of this with a
third-party DFP_D capable device and verified we don't send
enter mode.
Change-Id: I5caf008b7b3711232aeb1a1012cde2022584109b
Signed-off-by: Alec Berg <alecaberg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/225288
Reviewed-by: Todd Broch <tbroch@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Shorten the hard reset timeout so that we transition out of hard
reset state faster.
BUG=none
BRANCH=samus
TEST=test on third-party product that sends source cap very soon
after we send hard reset. without this patch we weren't responding
to the first few source caps, with this change we respond right
away.
Change-Id: I285aaf0296604da22438e31bc962629701694b7b
Signed-off-by: Alec Berg <alecaberg@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/225247
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
| |
BUG=chrome-os-partner:33269
TEST=make BOARD=jerry; ./util/flash_ec BOARD=jerry
(on a pinky rev2 as a sanity)
Change-Id: I2c54e4044a65a0014adb32dd46f74bf5ed11b02d
Signed-off-by: Katie Roberts-Hoffman <katierh@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/225300
Reviewed-by: Alexandru Stan <amstan@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Once alternate mode is entered the DFP will make an initial status
request to the UFP. Future status changes on the UFP are then sent to
the DFP via the attention command. This VDM consists of the VDM
header plus another VDO containing mode specific information.
CL adds ability of DFP to consume the attention VDMs status message
and in the case of DisplayPort SID toggle the necessary HPD gpio
accordingly.
BRANCH=samus
BUG=chrome-os-partner:30645
TEST=manual, for DFP w/ HPD over CC see HPD toggle correctly without
manually driving it providing cable connected when AMA is inserted.
Change-Id: Ifef60b5d0170cbcc1b518e3b13e84bac99a17e32
Signed-off-by: Todd Broch <tbroch@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/224769
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Before entering STOP mode, we need to ensure UART Tx has completed.
Otherwise, we may lose some characters or some bits within a character.
For Tx DMA mode, this is already done as we wait until TC (Tx complete)
is set before disabling Tx. However, when not using DMA, we enable sleep
when TXE is set. At this moment, the last character is still in the
shift register and going into sleep causes loss of the whole or part of
the last character.
To avoid this, let's enable TC interrupt and enable sleep only if we
have no more characters to send and TC is set.
BRANCH=None
BUG=chrome-os-partner:33219
TEST=Enable low power mode on Ryu P2. Type when the EC is in STOP mode
and check there is no broken character.
Change-Id: Ife42671882b7f1d1d17734d7d20fb4ba7dffb371
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/225283
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We have several unused timer. Let's use TIM19 for watchdog helper.
BRANCH=None
BUG=chrome-os-partner:32660
TEST='waitms 3000' and see debug message.
Change-Id: I638a4de7d2729ffb10cb5cf2b3fb9c458dd588a5
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/225254
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Alec Berg <alecaberg@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds the option to use one 16-bit timer for watchdog helper when
using 32-bit hwtimer. With this, a debug message is dumped before
watchdog fires and we can easily see the task hogging the processor.
BRANCH=None
BUG=None
TEST=On Ryu P2, 'waitms 3000' and see debug message before the EC
reboots.
Change-Id: I498f63a105a0ba1ab7ec7d274dc8b1f16a44140f
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/225253
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When we are a UFP with a plug, for the supported DisplayPort pinout,
we need to state which DFP pin configuration we support.
Update the field used for declaring pin configuration in our display
dongles.
HoHo is a protocol converter : update the pin assignment to C.
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BRANCH=samus
BUG=chrome-os-partner:30645
TEST=none
Change-Id: Ie5484f228bd39666c6b01055bd11f68eb9acad88
Reviewed-on: https://chromium-review.googlesource.com/225231
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Reviewed-by: Todd Broch <tbroch@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A USB type-C to DisplayPort dongle can support either DPv1.3 or
USB Gen 2 signaling.
Our dongles need to advertise that they support DPv1.3 and only this.
Our DFP needs to request DPv1.3 signaling.
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BRANCH=samus
BUG=chrome-os-partner:30645
TEST=Plug a type-C to DP dongle from another vendor to Samus and see a
display output.
Change-Id: Ie0ac16b675e86f635220a954a2c03442777cc527
Reviewed-on: https://chromium-review.googlesource.com/225250
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Reviewed-by: Todd Broch <tbroch@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We defined the DMA channel for UART Rx DMA to use, but we didn't
actually enable it.
BRANCH=None
BUG=chrome-os-partner:32660
TEST=Check the console is still responsive
Change-Id: I0dcbeeccb3a4213305c84ec5238e6e9dbee09b33
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/225280
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This modifies the stray hard-coded DMA channel for UART Rx to the
correct config flag.
BRANCH=None
BUG=chrome-os-partner:32660
TEST=On Ryu, enable UART Rx DMA and check console is still responsive
Change-Id: Icec2de6ad4d34c6e0f8df2a1d51d9fefd982c9f4
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/225239
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This implements a new API for EC modules to define MKBP event sources
and send MKBP event to the AP. Also, a new host command
EC_CMD_GET_NEXT_EVENT is added for the AP to query the pending MKBP
events. Each event type may have custom event data sent along with the
event.
BRANCH=None
BUG=chrome-os-partner:33194
TEST=Enable MKBP event on Ryu. Set a host event from EC console, run
'ectool nextevent', and see MKBP event 0x01 (HOST_EVENT) and the set
host event.
Signed-off-by: Vic Yang <victoryang@chromium.org>
Change-Id: I28a1b7e826bcc102bbe39016c9bb3e37d125664c
Reviewed-on: https://chromium-review.googlesource.com/224905
Reviewed-by: Randall Spangler <rspangler@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Udelay function might get delay less than the time indicated by the
input parameter. udelay(4) sometimes get the tick like, 6->7->7->
8->8->9->A and then the udelay return. But, the sampling point of 6
could be at the end of 6(close to 7) and the point of A could be
right at the beginning of A(close to A). This function could get
delay from (us - 1) to (us + 1). This change is to ensure the delay
at least over the parameter, us.
BRANCH=master
BUG=None
TEST=Build an EC FW iamge and run on Rambi to ensure at the time
duration indicated by the parameter is elaspsed and satisfied.
Signed-off-by: Kenji Chen <kenji.chen@intel.com>
Change-Id: I797f80c577d7e29e75a304aec1e02d2c750f8a23
Reviewed-on: https://chromium-review.googlesource.com/224660
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Reviewed-by: Mohammed Habibulla <moch@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There is no external pull-up on UART signals and this could lead to
garbage characters received. Let's enable the internal pull-up to avoid
this.
BRANCH=None
BUG=None
TEST=On a Ryu board with which UART Rx gets garbage when servo is not
connected, check that we don't get garbage characters anymore.
Change-Id: I014b399dfecc1b8495cce7c80c481c3668976084
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/225095
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Make board kitty to use flash_stm32.
BUG=chrome-os-partner:33035
BRANCH=None
TEST=Run util/flash_ec on kitty, verify flashing
complete successfully.
Change-Id: I302cfc85bfe5fa36fdf1a61d59b4dc21b36cc06a
Signed-off-by: Ken Chang <kenc@nvidia.com>
Reviewed-on: https://chromium-review.googlesource.com/224231
Reviewed-by: Randall Spangler <rspangler@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We updated the source PDO indices and we also need to update the output
voltage selection function.
BRANCH=None
BUG=chrome-os-partner:33133
TEST=On Plankton, output 5V and measure with INA.
Change-Id: I771c04cf929a8e473cf09ae3eb222518f042600a
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/225154
Reviewed-by: Pin-chih Lin <johnylin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On STM32F0, a single IRQ is used for all RTC events, including RTC_ALARM
and RTC_WAKEUP, and this IRQ is named RTC_WAKEUP. We use RTC_WAKEUP IRQ
in our code while we actually meant to capture RTC alarm event. On
STM32F3, RTC_WAKEUP and RTC_ALARM are separate IRQs and thus we're
having problem. Let's make it explicit which RTC IRQ we want to use and
fix our code to use RTC_ALARM.
BRANCH=None
BUG=chrome-os-partner:33219
TEST=Run 'rtc_alarm' on Ryu and verify the EC gets interrupted after a
second.
Change-Id: Ib1a14a5da49d709a4d071d44fbfa46544cc5929b
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/224998
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The battery cut-off is achieved by putting BQ27742 in SHUTDOWN mode.
BRANCH=None
BUG=None
TEST=Unplug AC and do 'cutoff' in EC console. The EC console goes
unresponsive.
Change-Id: I4a1aa359d79333d47aaf53b685a52960e5dfd652
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/225007
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
|