mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-12-27 18:25:05 +00:00
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:
@@ -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),
|
||||
|
||||
@@ -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),
|
||||
|
||||
@@ -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),
|
||||
|
||||
@@ -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),
|
||||
|
||||
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user