diff options
author | Shawn Nematbakhsh <shawnn@chromium.org> | 2015-01-15 15:57:46 -0800 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2015-01-17 20:55:58 +0000 |
commit | 6c938998fdfd15dd2dc0466ff8fae7997333b483 (patch) | |
tree | 82ced1a25eca354715482374d7e0b3d498669644 /board/samus_pd | |
parent | cd90837bb7009fa87e79e56f5497853ad4d2ea2e (diff) | |
download | chrome-ec-6c938998fdfd15dd2dc0466ff8fae7997333b483.tar.gz |
samus_pd: Don't re-request FW update if RW is already the latest
The AP informs us of the latest update image for a given device through
the EC_CMD_USB_PD_RW_HASH_ENTRY command. If the latest update image is
equivalent to our RW, we don't need to request an update.
BUG=chrome-os-partner:35510
TEST=Manual on Samus. Flash latest RW FW to Zinger. Verify that
subsequent Zinger insertion doesn't trigger the FW update host event.
Insert RO-stuck Zinger and verify that FW update host event is
triggered.
BRANCH=Samus
Change-Id: I300b150b3469e3fe32307e61273880a1a052ac5a
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/241172
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Diffstat (limited to 'board/samus_pd')
-rw-r--r-- | board/samus_pd/usb_pd_policy.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/board/samus_pd/usb_pd_policy.c b/board/samus_pd/usb_pd_policy.c index 5ae82f1f28..ee2091ed31 100644 --- a/board/samus_pd/usb_pd_policy.c +++ b/board/samus_pd/usb_pd_policy.c @@ -170,7 +170,7 @@ int pd_custom_vdm(int port, int cnt, uint32_t *payload, { int cmd = PD_VDO_CMD(payload[0]); uint16_t dev_id = 0; - int is_rw; + int is_rw, is_latest; CPRINTF("VDM/%d [%d] %08x\n", cnt, cmd, payload[0]); /* make sure we have some payload */ @@ -189,11 +189,20 @@ int pd_custom_vdm(int port, int cnt, uint32_t *payload, if (cnt == 7) { dev_id = VDO_INFO_HW_DEV_ID(payload[6]); is_rw = VDO_INFO_IS_RW(payload[6]); - pd_dev_store_rw_hash(port, dev_id, payload + 1, - is_rw ? SYSTEM_IMAGE_RW : - SYSTEM_IMAGE_RO); + is_latest = pd_dev_store_rw_hash(port, + dev_id, + payload + 1, + is_rw ? + SYSTEM_IMAGE_RW : + SYSTEM_IMAGE_RO); + + /* + * Send update host event unless our RW hash is + * already known to be the latest update RW. + */ + if (!is_rw || !is_latest) + pd_send_host_event(PD_EVENT_UPDATE_DEVICE); - pd_send_host_event(PD_EVENT_UPDATE_DEVICE); CPRINTF("DevId:%d.%d SW:%d RW:%d\n", HW_DEV_ID_MAJ(dev_id), HW_DEV_ID_MIN(dev_id), |