From 66af587cbcbc5e3075cd003db6032dd54ac6e8a2 Mon Sep 17 00:00:00 2001 From: Bill Richardson Date: Sat, 9 Apr 2016 20:53:35 -0700 Subject: [PATCH] Cr50: Enable RW FW updates over USB This enables the Cr50 to accept RW firmware updates over USB. BUG=chrome-os-partner:50707, chrome-os-partner:50712 BRANCH=none TEST=make buildall; test on Cr50 Build and run the extra/usb_updater utility. Watch the console, and observe that the Cr50 updates and reboots into the new image correctly. Note that you'll have to rebuild the ec.bin image in order for the update to take effect. Just reflashing the same image doesn't cause the bootloader to change its selection. All the previously existing endpoints continue to function normally. Change-Id: I7bd22eae803c2ceeb14a767c06d3d5c9f1ac7c7a Signed-off-by: Bill Richardson Reviewed-on: https://chromium-review.googlesource.com/338089 Commit-Ready: Vadim Bendebury --- board/cr50/board.h | 7 +++++-- board/cr50/ec.tasklist | 2 +- chip/g/build.mk | 1 + include/config.h | 1 + 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/board/cr50/board.h b/board/cr50/board.h index 54726c9227..3857515714 100644 --- a/board/cr50/board.h +++ b/board/cr50/board.h @@ -85,7 +85,8 @@ enum usb_strings { #define USB_IFACE_HID 1 #define USB_IFACE_AP 2 #define USB_IFACE_EC 3 -#define USB_IFACE_COUNT 4 +#define USB_IFACE_UPGRADE 4 +#define USB_IFACE_COUNT 5 /* USB endpoint indexes (use define rather than enum to expand them) */ #define USB_EP_CONTROL 0 @@ -93,7 +94,8 @@ enum usb_strings { #define USB_EP_HID 2 #define USB_EP_AP 3 #define USB_EP_EC 4 -#define USB_EP_COUNT 5 +#define USB_EP_UPGRADE 5 +#define USB_EP_COUNT 6 /* UART indexes (use define rather than enum to expand them) */ #define UART_CR50 0 @@ -123,5 +125,6 @@ enum usb_strings { /* Firmware upgrade options. */ #define CONFIG_NON_HC_FW_UPDATE +#define CONFIG_USB_FW_UPDATE #endif /* __CROS_EC_BOARD_H */ diff --git a/board/cr50/ec.tasklist b/board/cr50/ec.tasklist index c350701b65..1c55c48ea5 100644 --- a/board/cr50/ec.tasklist +++ b/board/cr50/ec.tasklist @@ -17,7 +17,7 @@ * 's' is the stack size in bytes; must be a multiple of 8 */ #define CONFIG_TASK_LIST \ - TASK_ALWAYS(HOOKS, hook_task, NULL, TASK_STACK_SIZE) \ + TASK_ALWAYS(HOOKS, hook_task, NULL, LARGER_TASK_STACK_SIZE) \ TASK_NOTEST(TPM, tpm_task, NULL, 8192) \ TASK_NOTEST(HOSTCMD, host_command_task, NULL, TASK_STACK_SIZE) \ TASK_ALWAYS(CONSOLE, console_task, NULL, TASK_STACK_SIZE) diff --git a/chip/g/build.mk b/chip/g/build.mk index e4a7d60fa8..9ba32a9964 100644 --- a/chip/g/build.mk +++ b/chip/g/build.mk @@ -40,6 +40,7 @@ chip-$(CONFIG_SPI_MASTER)+=spi_master.o chip-y+= pmu.o chip-y+= trng.o +chip-$(CONFIG_USB_FW_UPDATE)+= usb_upgrade.o chip-$(CONFIG_NON_HC_FW_UPDATE)+= upgrade_fw.o chip-$(CONFIG_SPS)+= sps.o chip-$(CONFIG_TPM_SPS)+=sps_tpm.o diff --git a/include/config.h b/include/config.h index 2d5cac6189..3b61e679f0 100644 --- a/include/config.h +++ b/include/config.h @@ -2088,6 +2088,7 @@ /* Firmware upgrade options. */ /* Firmware updates using other than HC channel(s). */ #undef CONFIG_NON_HC_FW_UPDATE +#undef CONFIG_USB_FW_UPDATE /*****************************************************************************/ /*