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

Change-Id: I5a6bfde742a5c698680f99f342b1696084fd002a
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>
This commit is contained in:
Todd Broch
2016-10-07 16:42:16 -07:00
committed by chrome-bot
parent 066d1b6a5f
commit 35e580b7a9
5 changed files with 75 additions and 5 deletions

View File

@@ -168,7 +168,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)
@@ -187,6 +187,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),

View File

@@ -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;
/* make sure we have some payload */
if (cnt == 0)
@@ -189,6 +189,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),

View File

@@ -186,7 +186,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)
@@ -205,6 +205,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),

View File

@@ -181,7 +181,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)
@@ -200,6 +200,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),

View File

@@ -183,7 +183,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)
@@ -202,6 +202,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),