mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-09 17:11:42 +00:00
pd: ectool: Allow different payload sizes for flashpd.
Dingdong & Hoho have different sized internal flash so the RW payload can't be fixed. CL removes check as operators should know be capable of picking correct payload. Signed-off-by: Todd Broch <tbroch@chromium.org> BRANCH=samus BUG=chrome-os-partner:31192,chrome-os-partner:31193 TEST=manual, <copy build/zinger/ec.RW.bin to samus> # reserved dev_id w/ zinger RW payload. ectool --name cros_pd flashpd 0 1 /tmp/ec.RW.bin Reading 65536 bytes from /tmp/ec.RW.bin... payload size 65536 but expected 0 # hoho dev_id w/ zinger RW payload. ectool --name cros_pd flashpd 4 1 /tmp/ec.RW.bin Reading 16384 bytes from /tmp/ec.RW.bin... payload size 16384 but expected 65536 # bogus dev_id ectool --name cros_pd flashpd 99 1 /tmp/ec.RW.bin Unknown device ID 99 # zinger dev_id w/ zinger RW payload ectool --name cros_pd flashpd 1 1 /tmp/ec.RW.bin Reading 16384 bytes from /tmp/ec.RW.bin... Erasing expected RW hash Rebooting Erasing RW flash Writing RW flash Change-Id: I49ad81edb04f359154fbff6710484c0d095069f7 Reviewed-on: https://chromium-review.googlesource.com/231831 Reviewed-by: Vincent Palatin <vpalatin@chromium.org> Reviewed-by: Alec Berg <alecaberg@chromium.org> Reviewed-by: Todd Broch <tbroch@chromium.org> Commit-Queue: Todd Broch <tbroch@chromium.org> Tested-by: Todd Broch <tbroch@chromium.org>
This commit is contained in:
committed by
chrome-internal-fetch
parent
f6e45879d7
commit
63277d145b
@@ -484,6 +484,8 @@ struct pd_policy {
|
||||
#define USB_PD_HW_DEV_ID_RESERVED 0
|
||||
#define USB_PD_HW_DEV_ID_ZINGER 1
|
||||
#define USB_PD_HW_DEV_ID_MINIMUFFIN 2
|
||||
#define USB_PD_HW_DEV_ID_DINGDONG 3
|
||||
#define USB_PD_HW_DEV_ID_HOHO 4
|
||||
|
||||
/*
|
||||
* ChromeOS specific VDO_CMD_READ_INFO responds with device info including:
|
||||
|
||||
@@ -886,9 +886,6 @@ int cmd_pd_device_info(int argc, char *argv[])
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
||||
/* PD image size is 16k minus 32 bits for the RW hash */
|
||||
#define PD_RW_IMAGE_SIZE (16 * 1024)
|
||||
int cmd_flash_pd(int argc, char *argv[])
|
||||
{
|
||||
struct ec_params_usb_pd_fw_update *p =
|
||||
@@ -922,10 +919,6 @@ int cmd_flash_pd(int argc, char *argv[])
|
||||
if (!buf)
|
||||
return -1;
|
||||
|
||||
/* Verify size of file */
|
||||
if (fsize != PD_RW_IMAGE_SIZE)
|
||||
goto pd_flash_error;
|
||||
|
||||
/* Erase the current RW RSA signature */
|
||||
fprintf(stderr, "Erasing expected RW hash\n");
|
||||
p->cmd = USB_PD_FW_ERASE_SIG;
|
||||
|
||||
Reference in New Issue
Block a user