| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Normally we don't do this, but enough changes have accumulated that
we're doing a tree-wide one-off update of the name & style.
BRANCH=none
BUG=chromium:1098010
TEST=`repo upload` works
Change-Id: I5b357b85ae9473a192b80983871bef4ae0d4b16f
Signed-off-by: Mike Frysinger <vapier@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3893394
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In order to prevent high current spikes when the OCPC PID loop runs,
this commit sets the initial VSYS voltage to that of the battery.
BUG=b:175334490
BRANCH=dedede
TEST=Build and flash DUT. Using a Type-C breakout board and a current
probe, plug in charger to sub board, verify that no initial current
spike exceeds that of the contract.
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Change-Id: Idb6e7d2e51acd0c5279bbb055b75774c6dab6901
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2628573
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Diana Z <dzigterman@chromium.org>
Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit adds a ocpc_init() function which will also chain off to a
board specific init function as well. Currently, the init function
sets up the initial resistances. The board specific init functions
may set up charger specific parameters.
BUG=b:147440290
BRANCH=None
TEST=Enable on waddledee, build and flash and verify charging still
works. Verify that initial resistances are seeded.
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Change-Id: Ia25aff9d2032746f42cbf0f7b6c5707d20362203
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2336173
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
Auto-Submit: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Diana Z <dzigterman@chromium.org>
Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit adds a charger flags member variable to the OCPC data
structure. This allows boards to define certain features that the
chargers that they are using have or don't have. To start, the
attribute of no Isys measurement is added.
BUG=b:155224387
BRANCH=None
TEST=With other CLs, build and flash waddledee, verify that DUT can
calculate combined resistance.
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Change-Id: I6b8f0a9501e0d79747e42f3444397d7516f01b2f
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2335892
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
Auto-Submit: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Diana Z <dzigterman@chromium.org>
Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In order to optimize charging from the auxiliary charger, we need to
calculate the system resistance as well as the battery resistance.
This allows some charger ICs to compensate for the losses from their
output node to the battery.
In order to perform this calculation, we must do it when the AP is off
(or in suspend) which provides the condition that nearly all of the
charge current is entering the battery and isn't being largely
consumed by the rest of the system. The combined Rsys+Rbatt
calculation is relatively straightforward as it's the delta between
the VSYS output and the battery voltage divided by the current
entering the battery. In order to separate out the two terms, we can
look at the delta between the VSYS output and the VSYS node that's
connected to the BFET as well as look at the egress current from the
auxiliary charger and the current entering the battery.
This commit adds this system resistance measurements and enables it
for the RAA489000. The resistances are updated in S5/G3 when charging
from the auxiliary charger every ~2.4s.
BUG=b:148980020
BRANCH=None
TEST=Build and flash waddledoo, verify that charging continues to work
in all power states and battery can become full.
TEST=Verify that charge current is still close to the target without
excessively exceeding it.
TEST=Verify charging in constant load via `stressapptest`.
TEST=Verify charging in bursty workload via `stressapptest` with
pauses for power spikes while monitoring charge current with a current
probe.
TEST=Verify charging works out of battery cutoff from the auxiliary
charger.
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Change-Id: I1faa3a0b2b3d8f4fd44d72cd1f546226268df0c6
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2290058
Reviewed-by: Diana Z <dzigterman@chromium.org>
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Remove redundancy between the OCPC header and "enum chg_id"
BRANCH=None
BUG=None
TEST=make -j buildall
Signed-off-by: Diana Z <dzigterman@chromium.org>
Change-Id: I4058e2395ec1cbd50ce197775eb07d3bcfad95f3
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2277834
Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Aseda Aboagye <aaboagye@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit adds the bulk of the work in getting OCPC functional.
Since the secondary charger IC cannot directly sense the current
entering the battery, with OCPC, we recruit the EC to do this work
instead.
Essentially, VSYS needs to be chosen such that we induce the desired
current in the battery while also accounting for losses in the system
between the output of the secondary charger IC and the battery.
To start, a board needs to define the following CONFIG_* option:
CONFIG_OCPC_DEF_RBATT_MOHMS
This should be at least the R_ds(on) resistance of the BFET and the
series sense resistance. The board should also define CONFIG_OCPC.
With the combined system resistance, we can calculate the VSYS
required to induce the desired current. However, we will also use a
PID control loop to help drive our VSYS target to what it should
actually be accounting for our error.
The PID constants were found by tuning on a waddledoo board. It
remains to be seen whether or not these will differ on a board to
board basis.
BUG=b:148980016,b:147440290
BRANCH=None
TEST=Enable on waddledoo, verify that we can charge the battery from
the sub-board.
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Change-Id: Icd323546836fe41fa1fcc7c3b6071d822663ed05
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2135964
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Diana Z <dzigterman@chromium.org>
Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
|
|
With OCPC, one charger IC per Type-C port, there are now multiple
charger ICs present in the system. This commit adds the beginning of
OCPC support by adding the notion of an active charger IC. Charge
Manager will select the active charger IC based upon the charge port.
Boards must define this mapping in a board specific function.
Additionally, this commit adds chgnum as a parameter to
charger_set_input_current_limit().
BUG=b:148981052
BRANCH=None
TEST=With other patches, verify that the active charger IC is able to
be saved and retrieved.
Change-Id: Iba4a8958171ad6e1630b0ca3d07d128bc1f2c4dd
Signed-off-by: Aseda Aboagye <aaboagye@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2135963
Tested-by: Aseda Aboagye <aaboagye@chromium.org>
Reviewed-by: Diana Z <dzigterman@chromium.org>
Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
|