| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch adds EC_CMD_PCHG_UPDATE, which allows the host to update
firmware of ctn730 via I2C.
An updater (e.g. ectool) is expected to issue EC_PCHG_UPDATE_CMD_OPEN,
multiple EC_PCHG_UPDATE_CMD_WRITEs, then EC_PCHG_UPDATE_CLOSE. Each
sub-command completion is notified to the host via EC_MKBP_EVENT_PCHG.
An updater is supposed to wait for the previous sub-command to
complete before proceeding to the next.
Example:
localhost ~ # ectool pchg 0
State: DOWNLOAD (6)
FW Version: 0x104
localhost ~ # ectool pchg 0 update 0x207000 0x105 /path/to/image.bin
Update file /path/to/image.bin (85632 bytes) is opened.
Writing firmware (port=0 ver=0x105 addr=0x207000 bsize=128):
**********************************************************************
FW update session closed (CRC32=0x7bd5c66f).
localhost ~ # ectool pchg 0 reset
Reset port 0 complete
localhost ~ # ectool pchg 0
State: ENABLED (2)
FW Version: 0x105
BUG=b:182600604, b:173235954
BRANCH=trogdor
TEST=ectool pchg 0 update 0x201200 0x105 /tmp/user_ee_X0.1_V1.5.bin
TEST=ectool pchg 0 reset
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Change-Id: I9c62f1714dd69428ab5870c443cb4eb77881a6c6
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2757099
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch makes ctn730 driver print the firmware version.
EC_CMD_PCHG is updated to version 1 and returns firmware version
of a charger chip. Version 0 of EC_CMD_PCHG is deprecated.
BUG=b:182600604, b:173235954, b:183151376
BRANCH=Trogdor
TEST=Verify firmware version is printed on EC console.
TEST=ectool pchg 0 (for version 1)
TEST=cat /sys/class/power_supply/PCHG0/* (for version 0)
"ERR kernel: [ 33.394847] cros-ec-pchg cros-ec-pchg.13.auto:
Unable to get port.0 status (err:-524)"
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Change-Id: Ib7bb9a7225fe914bc6c8d600d0f4766dbf75ace8
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2757098
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch allows a charger chip to reset to firmware update mode
(a.k.a. download mode). Actual firmware update will be added
in a separate patch.
Currently, a reset event causes the state machine to unconditionally
transition to normal mode. This patch makes the state machine check
'mode' field in the context to decide whether it transitions to
normal mode or not.
This patch also makes ctn730 driver explicitly return
PCHG_EVENT_*_ERROR while PCHG_EVENT_NONE was returned previously.
BUG=b:173235954
BRANCH=trogdor
TEST=Stylus connect, disconnect, charge events are triggered as
expected.
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Change-Id: I10dbd25d0b3d5284952e57d4ade2949e9594c8d1
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2770503
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently, dropped events are counted for all ports combined. This
patch makes them counted for each port separately.
BUG=b:173235954
BRANCH=trogdor
TEST=Verify 'pchg 0' prints dropped event count.
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Change-Id: I09380927613defe34bef0fece022fc9d47ebb8a1
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2770502
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch makes a compiler check array sizes used to stringify
PCHG states and events.
BUG=b:173235954
BRANCH=trogdor
TEST=make
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Change-Id: I13dc399dc973d8a661492236668c22b323e7c1c4
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2765423
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently, PCHG assumes PCHG chips are reset only on POR and ignores
reset events. This can cause the state machine to be in an unexpected
state when a reset happens asynchronously.
This patch allows PCHG to handle chip reset events. It also makes the
task explicitly reset PCHG chips at start-up so that everything will
start in known & clean states.
BUG=b:181745891,b:181036152,b:173235954
BRANCH=trogdor
TEST=Verify PCHG behaves expectedly across cold reset, warm reset,
suspend & resume. Repeat the test with and without stylus.
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Change-Id: Ia3dd1fe7ebc8dd6f4ee8149a4c25918922143fc3
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2741282
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch makes PCHG send CHG_CTRL_CHARGING_INFO_CMD when a stylus
is detected. This will allow the EC to report 'full' to the host
even if charging doesn't start (because the stylus is already
charged).
BUG=b:179390065,b:173235954
BRANCH=trogdor
TEST=CoachZ. Re-attach charged stylus and verify PCHG_STATE_FULL
is reported.
Change-Id: Id8578e2d3d21294fb08a21933f12ecee7f2bd062
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2691729
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently, full charge status is implied by capacity = 100 and
PCHG_STATE_DETECTED (i.e. state='not charging'). If the charger
stops charging before 100% (for battery health control), this
condition doesn't work.
This patch makes PCHG send PCHG_STATE_FULL explicitly when it sees
the soc goes above the threshold in PCHG_STATE_DETECTED.
BUG=b:179390065,b:173235954
BRANCH=trogdor
TEST=CoachZ. Charge till 96% and verify PCHG0/state becomes 'Full'.
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Change-Id: I634f96992cdc7ef44b5e43544603cc5cc9b3a62d
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2691366
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch adds a host command to get the peripheral charge port
count and status.
$ ectool pchg
1
$ ectool pchg 0
State: CHARGING (4)
Battery: 50%
Flags: 0x0
$ ectool pchg 0 foo
Invalid parameter count
Usage1: pchg
Usage2: pchg <port>
Usage1 prints the number of ports.
Usage2 prints the status of a port.
$ ectool pchg 100
Bad port index
BUG=b:173235954
BRANCH=Trogdor
TEST=Done on CoachZ. See the description above.
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Change-Id: I33f261e48b16d5933b6f3ca9f3c12fec476edda3
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2555628
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
|
|
Peripheral charge manager communicates with peripheral charge chips
to charge batteries of peripheral devices.
Tested using Coachz proto and a listener evaluation board from NXP demo
kit as follows:
1. Attach device then battery percentage is reported periodically.
2. Detach device then re-attach device to stop and resume charging.
3. Disable port by 'pchg 0 disable' to stop charging.
4. Enable disabled port by 'pchg 0 enable' to resume charging while
device is in proximity.
5. When port is disabled, a device isn't detected or charged.
BUG=b:173235954
BRANCH=Trogdor
TEST=See the description above.
Signed-off-by: Daisuke Nojiri <dnojiri@chromium.org>
Change-Id: I0c2b583e5f7736b26ec7d1fb9cd9b6c59c7e8177
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2538536
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
|