diff options
author | Todd Broch <tbroch@chromium.org> | 2016-10-07 16:42:16 -0700 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2017-05-18 17:05:13 +0000 |
commit | f504f5af435780355a95b5387296983a6204ad34 (patch) | |
tree | ed1708b7c9c9a5505dec35b73a21b6d6995060a8 | |
parent | 711f4545f857152594b28dce4756cb59489397b6 (diff) | |
download | chrome-ec-f504f5af435780355a95b5387296983a6204ad34.tar.gz |
Re-enable Google USBC peripheral FW updates.
Signed-off-by: Todd Broch <tbroch@chromium.org>
BRANCH=glados,gru,oak
BUG=chrome-os-partner:57458
TEST=usbpd_GFU
Original-Change-Id: I5a6bfde742a5c698680f99f342b1696084fd002a
Originally-Reviewed-on: https://chromium-review.googlesource.com/397862
Commit-Ready: Todd Broch <tbroch@chromium.org>
Tested-by: Todd Broch <tbroch@chromium.org>
Reviewed-by: Benson Leung <bleung@google.com>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
(cherry picked from commit 35e580b7a9d0dedbb2664dbfd694ab5bd3a87226)
Change-Id: I41c8b453daa755d00287933f98b6f8dad129655c
Reviewed-on: https://chromium-review.googlesource.com/506661
Tested-by: Todd Broch <tbroch@chromium.org>
Reviewed-by: Benson Leung <bleung@chromium.org>
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Commit-Queue: Todd Broch <tbroch@chromium.org>
-rw-r--r-- | board/caroline/usb_pd_policy.c | 16 | ||||
-rw-r--r-- | board/cave/usb_pd_policy.c | 16 | ||||
-rw-r--r-- | board/chell/usb_pd_policy.c | 16 | ||||
-rw-r--r-- | board/glados/usb_pd_policy.c | 16 | ||||
-rw-r--r-- | board/kunimitsu/usb_pd_policy.c | 16 | ||||
-rw-r--r-- | board/lars/usb_pd_policy.c | 16 | ||||
-rw-r--r-- | board/oak/usb_pd_policy.c | 16 | ||||
-rw-r--r-- | board/sentry/usb_pd_policy.c | 16 |
8 files changed, 120 insertions, 8 deletions
diff --git a/board/caroline/usb_pd_policy.c b/board/caroline/usb_pd_policy.c index 1c1c1388e4..dc415ed7ac 100644 --- a/board/caroline/usb_pd_policy.c +++ b/board/caroline/usb_pd_policy.c @@ -178,7 +178,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; /* make sure we have some payload */ if (cnt == 0) @@ -197,6 +197,20 @@ int pd_custom_vdm(int port, int cnt, uint32_t *payload, dev_id = VDO_INFO_HW_DEV_ID(payload[6]); is_rw = VDO_INFO_IS_RW(payload[6]); + 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); + CPRINTF("DevId:%d.%d SW:%d RW:%d\n", HW_DEV_ID_MAJ(dev_id), HW_DEV_ID_MIN(dev_id), diff --git a/board/cave/usb_pd_policy.c b/board/cave/usb_pd_policy.c index 1c1c1388e4..dc415ed7ac 100644 --- a/board/cave/usb_pd_policy.c +++ b/board/cave/usb_pd_policy.c @@ -178,7 +178,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; /* make sure we have some payload */ if (cnt == 0) @@ -197,6 +197,20 @@ int pd_custom_vdm(int port, int cnt, uint32_t *payload, dev_id = VDO_INFO_HW_DEV_ID(payload[6]); is_rw = VDO_INFO_IS_RW(payload[6]); + 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); + CPRINTF("DevId:%d.%d SW:%d RW:%d\n", HW_DEV_ID_MAJ(dev_id), HW_DEV_ID_MIN(dev_id), diff --git a/board/chell/usb_pd_policy.c b/board/chell/usb_pd_policy.c index cc2c87d239..eaa02b723a 100644 --- a/board/chell/usb_pd_policy.c +++ b/board/chell/usb_pd_policy.c @@ -178,7 +178,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; /* make sure we have some payload */ if (cnt == 0) @@ -197,6 +197,20 @@ int pd_custom_vdm(int port, int cnt, uint32_t *payload, dev_id = VDO_INFO_HW_DEV_ID(payload[6]); is_rw = VDO_INFO_IS_RW(payload[6]); + 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); + CPRINTF("DevId:%d.%d SW:%d RW:%d\n", HW_DEV_ID_MAJ(dev_id), HW_DEV_ID_MIN(dev_id), diff --git a/board/glados/usb_pd_policy.c b/board/glados/usb_pd_policy.c index e07454e887..f3602fd2ce 100644 --- a/board/glados/usb_pd_policy.c +++ b/board/glados/usb_pd_policy.c @@ -175,7 +175,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; /* make sure we have some payload */ if (cnt == 0) @@ -194,6 +194,20 @@ int pd_custom_vdm(int port, int cnt, uint32_t *payload, dev_id = VDO_INFO_HW_DEV_ID(payload[6]); is_rw = VDO_INFO_IS_RW(payload[6]); + 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); + CPRINTF("DevId:%d.%d SW:%d RW:%d\n", HW_DEV_ID_MAJ(dev_id), HW_DEV_ID_MIN(dev_id), diff --git a/board/kunimitsu/usb_pd_policy.c b/board/kunimitsu/usb_pd_policy.c index e07454e887..f3602fd2ce 100644 --- a/board/kunimitsu/usb_pd_policy.c +++ b/board/kunimitsu/usb_pd_policy.c @@ -175,7 +175,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; /* make sure we have some payload */ if (cnt == 0) @@ -194,6 +194,20 @@ int pd_custom_vdm(int port, int cnt, uint32_t *payload, dev_id = VDO_INFO_HW_DEV_ID(payload[6]); is_rw = VDO_INFO_IS_RW(payload[6]); + 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); + CPRINTF("DevId:%d.%d SW:%d RW:%d\n", HW_DEV_ID_MAJ(dev_id), HW_DEV_ID_MIN(dev_id), diff --git a/board/lars/usb_pd_policy.c b/board/lars/usb_pd_policy.c index 3010df52fb..1a8a5429df 100644 --- a/board/lars/usb_pd_policy.c +++ b/board/lars/usb_pd_policy.c @@ -169,7 +169,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; /* make sure we have some payload */ if (cnt == 0) @@ -188,6 +188,20 @@ int pd_custom_vdm(int port, int cnt, uint32_t *payload, dev_id = VDO_INFO_HW_DEV_ID(payload[6]); is_rw = VDO_INFO_IS_RW(payload[6]); + 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); + CPRINTF("DevId:%d.%d SW:%d RW:%d\n", HW_DEV_ID_MAJ(dev_id), HW_DEV_ID_MIN(dev_id), diff --git a/board/oak/usb_pd_policy.c b/board/oak/usb_pd_policy.c index 38db163b58..e170611b16 100644 --- a/board/oak/usb_pd_policy.c +++ b/board/oak/usb_pd_policy.c @@ -180,7 +180,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; /* make sure we have some payload */ if (cnt == 0) @@ -199,6 +199,20 @@ int pd_custom_vdm(int port, int cnt, uint32_t *payload, dev_id = VDO_INFO_HW_DEV_ID(payload[6]); is_rw = VDO_INFO_IS_RW(payload[6]); + 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); + CPRINTF("DevId:%d.%d SW:%d RW:%d\n", HW_DEV_ID_MAJ(dev_id), HW_DEV_ID_MIN(dev_id), diff --git a/board/sentry/usb_pd_policy.c b/board/sentry/usb_pd_policy.c index 737c5ba1f5..115796fbe0 100644 --- a/board/sentry/usb_pd_policy.c +++ b/board/sentry/usb_pd_policy.c @@ -178,7 +178,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; /* make sure we have some payload */ if (cnt == 0) @@ -197,6 +197,20 @@ int pd_custom_vdm(int port, int cnt, uint32_t *payload, dev_id = VDO_INFO_HW_DEV_ID(payload[6]); is_rw = VDO_INFO_IS_RW(payload[6]); + 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); + CPRINTF("DevId:%d.%d SW:%d RW:%d\n", HW_DEV_ID_MAJ(dev_id), HW_DEV_ID_MIN(dev_id), |