| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In the interest of making long-term branch maintenance incur as little
technical debt on us as possible, we should not maintain any files on
the branch we are not actually using.
This has the added effect of making it extremely clear when merging CLs
from the main branch when changes have the possibility to affect us.
The follow-on CL adds a convenience script to actually pull updates from
the main branch and generate a CL for the update.
BUG=b:204206272
BRANCH=ish
TEST=make BOARD=arcada_ish && make BOARD=drallion_ish
Signed-off-by: Jack Rosenthal <jrosenth@chromium.org>
Change-Id: I17e4694c38219b5a0823e0a3e55a28d1348f4b18
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3262038
Reviewed-by: Jett Rink <jettrink@chromium.org>
Reviewed-by: Tom Hughes <tomhughes@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This path was hitted by ec_usb_pd_fuzzer.
BUG=b:198325864
TEST=cros_fuzz --board=amd64-generic reproduce \
--fuzzer ec_usb_pd_fuzzer \
--testcase /build/amd64-generic/tmp/\
clusterfuzz-testcase-minimized-ec_usb_pd_fuzzer-6223286274490368 \
--package chromeos-ec --build-type ubsanh
BRANCH=main
Change-Id: I9575a890bba16145f3d92d1ecc84afcf12d72d67
Signed-off-by: Eric Yilun Lin <yllin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3159850
Tested-by: Eric Yilun Lin <yllin@google.com>
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Commit-Queue: Eric Yilun Lin <yllin@google.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Support dynamic PDO selection CONFIG_USB_PD_DPS.
This config controls the charging voltage and power according to the
input power and battery configuration.
DPS would continuously evaluate the system load and current charging
voltage, and decide a new one by below:
1. If the PDO can fulfill system desired power.
2. If the PDO is efficient for the battery configuration.
To detect if the system load cannot be fulfilled by the current PDO,
it checks:
1. if the input current closes to the PDO current limit.
2. if the input power closes to the PDO maximum power.
To detect if the system load can be fulfilled by a more efficient PDO,
it checks:
- if the voltage of a new PDO is closer to the battery voltage than the
current PDO, and the power is able fulfill the system load.
BUG=b:169532537
TEST=1. tested on asurada, the charging voltage is able to switch to
different PDOs under different system loads
2. tested that the DPS is able to switch charge port
(e.g. C1 12V -> C0 9V) based on the provided PDOs.
BRANCH=asurada
Change-Id: I7c7706b331dc0d4f8ac68569dc7ed852fc9308e3
Signed-off-by: Eric Yilun Lin <yllin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2897064
Tested-by: Eric Yilun Lin <yllin@google.com>
Reviewed-by: Diana Z <dzigterman@chromium.org>
Commit-Queue: Eric Yilun Lin <yllin@google.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Chromeboxes may Try.SRC when a dedicated charger is present. However,
they should not Try.SRC at a time when they are note dual-role toggling.
This likely represents a time when they are unable to source Vbus and
should therefore not attempt to become the source.
BRANCH=None
BUG=b:188710940
TEST=on mancomb, power on with the BJ charger and then connect a dock in
G3. Observe we do not attempt to source the dock sans Vbus
Signed-off-by: Diana Z <dzigterman@chromium.org>
Change-Id: Ia9062f8f833d678b5b3c9daf576dc6ad2f2a8c74
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2912113
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add a new config CONFIG_USB_PD_ONLY_FIXED_PDOS. If that config is
enabled, ignore non-FIXED PDOs in both the console command `ada_srccaps`
and also when selecting the preferred PDO for a voltage.
Enable CONFIG_USB_PD_ONLY_FIXED_PDOS for servo_v4 and servo_v4p1, since
they don't expose non-fixed PDO in their srccaps. Without this change,
there is a risk that the "best" PDO for a given voltage will be
non-FIXED and then that voltage just won't be supported at all.
BRANCH=none
BUG=b:178484932
TEST=added
Change-Id: I0d1187ca372120c7fe21d627e1b82b59f6334add
Signed-off-by: Jeremy Bettis <jbettis@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2809353
Tested-by: Jeremy Bettis <jbettis@chromium.org>
Commit-Queue: Keith Short <keithshort@chromium.org>
Reviewed-by: Keith Short <keithshort@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fixes pd_extract_pdo_power() to output the correct voltage and current
for non-fixed PDOs. Add unit test.
BRANCH=none
BUG=b:178484932
TEST=added
Signed-off-by: Jeremy Bettis <jbettis@google.com>
Change-Id: I6de55be3c753e01ef26424896c6fd41b8df8f94b
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2805226
Commit-Queue: Jeremy Bettis <jbettis@chromium.org>
Tested-by: Jeremy Bettis <jbettis@chromium.org>
Reviewed-by: Keith Short <keithshort@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Change the function signature to
void pd_extract_pdo_power(uint32_t pdo, uint32_t *ma,
uint32_t *max_mv, uint32_t *min_mv);
Replace the original caller with an extra unused parameter, no
functional changes.
BUG=none
TEST=`pd 0 srccaps` prints the correct PDO info
BRANCH=asurada
Change-Id: I9b508e1a13737fe3ed61e6086416cff0c8ffb9a9
Signed-off-by: Eric Yilun Lin <yllin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2810660
Reviewed-by: Wai-Hong Tam <waihong@google.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This CL backports CL:2535217 to TCPMv1, and completely removes charging
allow list.
BRANCH=kukui
BUG=b:175364716
TEST=on Burnet, verify DUT can charge from power bank.
Signed-off-by: Ting Shen <phoenixshen@google.com>
Change-Id: I89476c89fd4ab6d46acf880f7573b5deb8b2c0f4
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2603614
Reviewed-by: Diana Z <dzigterman@chromium.org>
Tested-by: Ting Shen <phoenixshen@chromium.org>
Commit-Queue: Ting Shen <phoenixshen@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
To process source capabilities received from charger we just find the
most appropriate PDO and inform charge manager about our choice
(pd_process_source_cap() function). This function doesn't respect any
voltage limits, so even when such a limit exists charge manager will be
informed about higher voltage. Of course PD stack will request correct
voltage from charger and charge manager will be notified about that
fact, but providing wrong information about voltage can cause
unnecessary new power requests.
This issue was found during debugging EC hibernate issue on casta.
BUG=b:161775827
BRANCH=none
TEST=Flash EC ToT on casta. Set voltage limit to 5V. Observe if
charge manager reports voltage changes from 5V to 15V (in my case)
when received capabilities from ServoV4.
NOTE: ServoV4 will send capabilities to DUT as a result of voltage
transition (requested by ServoV4).
Signed-off-by: Patryk Duda <pdk@semihalf.com>
Change-Id: I5fe30f7a1b86fb1d934a29429147d9d7c9a84337
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2592496
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Not all partners will reply to DiscoverIdentity, so only print out their
VID/PID combination when the VID is non-zero.
BRANCH=None
BUG=None
TEST=on drawcia, plug in a charger which does not reply to
DiscoverIdentity and verify it doesn't print
Signed-off-by: Diana Z <dzigterman@chromium.org>
Change-Id: I1ea114794ada20b68cb6f902b085a2fd02650912
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2535216
Reviewed-by: Denis Brockus <dbrockus@chromium.org>
Commit-Queue: Denis Brockus <dbrockus@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Move the allow_list not found message from the CONSOLE to the USBPD
channel. This allows the message to be disabled during tests.
BUG=none
BRANCH=none
TEST=make buildall
TEST=Run "chan 0" and connect a charger that isn't in the allow list to
volteer.
Signed-off-by: Keith Short <keithshort@chromium.org>
Change-Id: I395a701ee955200ad183dcb7da64d662d3611a4b
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2518730
Reviewed-by: Denis Brockus <dbrockus@chromium.org>
Commit-Queue: Denis Brockus <dbrockus@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Added three additional monitors and renamed the
defines to tell what the PID is.
BUG=b:171013724
BRANCH=zork
TEST=connect new devices and make sure they source us
Signed-off-by: Denis Brockus <dbrockus@google.com>
Change-Id: Iaf18d6aaad40ff5ac8d8bb57bc2568a9256712bb
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2509974
Commit-Queue: Denis Brockus <dbrockus@chromium.org>
Commit-Queue: Edward Hill <ecgh@chromium.org>
Tested-by: Denis Brockus <dbrockus@chromium.org>
Auto-Submit: Denis Brockus <dbrockus@chromium.org>
Reviewed-by: Edward Hill <ecgh@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The charge allow_list is for partner devices that
do not advertise Unconstrained Power in their
SRC_Caps but we should still charge from them
if they are the SRC.
The allow_list should be constrained to partners
that perform dual role and do not present
Unconstrained Power in their SRC_Caps. It is
preferred for the partner to send this
correctly but for products that are already out
in the wild, it may be a really bad user
experience for this to fail.
BUG=b:170644500,b:170848849,b:170970249
BRANCH=zork
TEST=connect E24d monitor and verify it charges DUT
Signed-off-by: Denis Brockus <dbrockus@google.com>
Change-Id: Ib4f2c62af3bb2c1ed066ea4353ec26cd536a4c26
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2490729
Tested-by: Denis Brockus <dbrockus@chromium.org>
Reviewed-by: Jett Rink <jettrink@chromium.org>
Reviewed-by: Diana Z <dzigterman@chromium.org>
Commit-Queue: Denis Brockus <dbrockus@chromium.org>
Auto-Submit: Denis Brockus <dbrockus@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Move the battery checks to a common function, which is used to enable
Try.SRC and enable PD comm for CONFIG_SYSTEM_LOCKED.
BRANCH=None
BUG=b:169453974
TEST=On a board with battery which takes longer time to enable its
discharge FET, cut off the battery and booted the board. Checked
on startup the Try.SRC was disabled and the PD comm was disabled.
When the battery discharge FET became active, PD comm was enabled.
Change-Id: I236d5f8a462ece056b4adedd0b6e6ef1e402966c
Signed-off-by: Wai-Hong Tam <waihong@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2461942
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Change the comparison from soc > CONFIG_USB_PD_TRY_SRC_MIN_BATT_SOC
to soc >= CONFIG_USB_PD_TRY_SRC_MIN_BATT_SOC. It accepts the case
of configuring CONFIG_USB_PD_TRY_SRC_MIN_BATT_SOC to 0, meaning it
skips the check.
BRANCH=None
BUG=None
TEST=Trivial change; built an image without error.
Change-Id: I1781f168aedfa9b061c6effe468b141f04d82687
Signed-off-by: Wai-Hong Tam <waihong@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2404477
Reviewed-by: Jett Rink <jettrink@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The active charge_port is selected in a delayed call to
charge_manager_refresh. This leaves a big window allowing
a better charger to be detected but not acted upon as
the soon to be active charge_port. This leads to the PD
Policy Engine deciding this better port is not the current
active charge_port and down grading the current limit for
the port to no longer be the best choice. So when the
charge_manager_refresh is called, it starts changing ports
and then later checks for the best port and then swaps
back to a lesser charger.
BUG=b:166228326
BRANCH=none
TEST=USB-C0 45W then attach USB-C1 65W charger
Signed-off-by: Denis Brockus <dbrockus@google.com>
Change-Id: I23dad1e4690285b3867bd046d9416db9522002e8
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2393863
Commit-Queue: Denis Brockus <dbrockus@chromium.org>
Commit-Queue: Edward Hill <ecgh@chromium.org>
Tested-by: Denis Brockus <dbrockus@chromium.org>
Reviewed-by: Edward Hill <ecgh@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Align the CONFIG_USB_PD_TRY_SRC_MIN_BATT_SOC to the value of
BATTERY_LEVEL_CRITICAL, which is 5%.
The BATTERY_LEVEL_CRITICAL is 5% that means EC will send battery-
critical host event when the battery level <= 5%.
CrOS PD policies state that the system doesn't source power to
any external USB devices when AP is shutdown.
So the current CONFIG_USB_PD_TRY_SRC_MIN_BATT_SOC 1% default has
no point. When the battery level is <= 5%, AP should be shutdown
soon and the system should not be a source, so should not enable
Try.SRC.
Also change the comparison from
soc >= CONFIG_USB_PD_TRY_SRC_MIN_BATT_SOC
to
soc > CONFIG_USB_PD_TRY_SRC_MIN_BATT_SOC
as the battery critical check is
soc <= BATTERY_LEVEL_CRITICAL.
BRANCH=None
BUG=b:165057418
TEST=Plugging a PD charger to a board with the battery level very low,
the system boots up (was failed),
Change-Id: If6b11feacd62fd003e13b1756eb5c33d2f9bbce4
Signed-off-by: Wai-Hong Tam <waihong@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2360543
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Google is working to change its source code to use more inclusive
language. To that end, replace the terms "whitelist", "blacklist",
and similar with inclusive alternatives.
BUG=b:162262297
BRANCH=None
TEST=`grep -Eirl "(white|black)[ _\-]*list" .`
The only results are in "private/nordic_keyboard/sdk8.0.0"
which is not our code.
Signed-off-by: Paul Fagerburg <pfagerburg@google.com>
Change-Id: Ie5210b98e1096c22d0e9284c101a42820bd3d79d
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2321549
Tested-by: Paul Fagerburg <pfagerburg@chromium.org>
Reviewed-by: Jett Rink <jettrink@chromium.org>
Commit-Queue: Paul Fagerburg <pfagerburg@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When in dual role, check the charger supplier rather than the
port number to verify it is a dedicated charger.
BUG=b:155368947
TEST=Build and verify on puff that dual role is selected.
BRANCH=none
Signed-off-by: Andrew McRae <amcrae@google.com>
Change-Id: If23594a4321da2370bd8f2f787a6091041073189
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2173930
Reviewed-by: Andrew McRae <amcrae@chromium.org>
Commit-Queue: Andrew McRae <amcrae@chromium.org>
Tested-by: Andrew McRae <amcrae@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When a PD explicit contract is negotiated in RO,
the contract is maintained while performing a
sysjump to RW. This is done by serializing
the PD Power, Data, and VCONN Roles, along with
the explicit contract flag. After jumping to RW,
deserialization is performed by restoring the
power roles and setting the explicit contract
flag.
BUG=b:152350558,b:152027807,b:152967274
BRANCH=none
TEST=make -j buildall
Manual tests:
Used total phase to verify that charging voltage
was maintained across sysjump from RO to RW and
that DP was reestablished when a dock was used.
Tested that Kohaku booted properly without a
battery and a charger connected to port 0. This
test was repeated with a charger connected to port 1.
Signed-off-by: Sam Hurst <shurst@google.com>
Change-Id: I349c41f2279e9af9830564d44ac73ad8435f1f80
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2119131
Tested-by: Sam Hurst <shurst@google.com>
Reviewed-by: Denis Brockus <dbrockus@chromium.org>
Commit-Queue: Denis Brockus <dbrockus@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
| |
BUG=b:148528713
BRANCH=none
TEST=make buildall -j
Change-Id: I79f75d23f6091a264c11b4da6cf0cea26205df60
Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2052648
Reviewed-by: Denis Brockus <dbrockus@chromium.org>
Reviewed-by: Diana Z <dzigterman@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
BUG=b:148528713
BRANCH=none
TEST=Manually tested on Volteer
1. When only one charger connected:
Able to negotiate to PD max.
2. When two chargers are connected (one on each port):
Non charging port is rejected
Swaps the charging port based on charger's priority
Change-Id: Ib7fdc5d31bf36189a85f8cd3217bec78f83a9efe
Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2051318
Reviewed-by: Keith Short <keithshort@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
| |
BUG=b:148528713
BRANCH=none
TEST=make buildall -j
Change-Id: I6bd6b5875a322ca4ba6d77a4cfc96a72630e5f5c
Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2051220
Reviewed-by: Keith Short <keithshort@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
| |
BUG=b:148528713
BRANCH=none
TEST=make buildall -j
Change-Id: Ib43a83084b087905a8322bfd2bea2fe70ec33c1d
Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2051219
Reviewed-by: Keith Short <keithshort@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
| |
BUG=b:148528713
BRANCH=none
TEST=make buildall -j
Change-Id: I6fd4c870b8821a2393c67fda7003583b91ef7f5c
Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2051218
Reviewed-by: Keith Short <keithshort@chromium.org>
|
|
BUG=b:148528713
BRANCH=none
TEST=make buildall -j
Change-Id: I2327ceaf6be76a0428981106aaeb3ffbb2018049
Signed-off-by: Vijay Hiremath <vijay.p.hiremath@intel.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2051217
Reviewed-by: Keith Short <keithshort@chromium.org>
|