diff options
author | Daisuke Nojiri <dnojiri@chromium.org> | 2021-03-11 13:17:35 -0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-04-05 20:50:07 +0000 |
commit | 362e02845295c56a3c1fbb4c5fd39b318a45253c (patch) | |
tree | e87d8533d0d27ce8513d407320ea9de58f353f86 /board | |
parent | a801f6505a207ff5f0787cfb89e1810eacf4a1db (diff) | |
download | chrome-ec-362e02845295c56a3c1fbb4c5fd39b318a45253c.tar.gz |
PCHG: Support firmware update
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
Diffstat (limited to 'board')
-rw-r--r-- | board/coachz/board.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/board/coachz/board.c b/board/coachz/board.c index d927afd8b1..1442b5b147 100644 --- a/board/coachz/board.c +++ b/board/coachz/board.c @@ -60,6 +60,7 @@ struct pchg pchgs[] = { .i2c_port = I2C_PORT_WLC, .irq_pin = GPIO_WLC_IRQ_CONN, .full_percent = 96, + .block_size = 128, }, .events = QUEUE_NULL(PCHG_EVENT_QUEUE_SIZE, enum pchg_event), }, |