summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--board/caroline/usb_pd_policy.c16
-rw-r--r--board/cave/usb_pd_policy.c16
-rw-r--r--board/chell/usb_pd_policy.c16
-rw-r--r--board/glados/usb_pd_policy.c16
-rw-r--r--board/kunimitsu/usb_pd_policy.c16
-rw-r--r--board/lars/usb_pd_policy.c16
-rw-r--r--board/oak/usb_pd_policy.c16
-rw-r--r--board/sentry/usb_pd_policy.c16
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),