From 3b247af186aa560023c6917cbd81a9a82b2b7bea Mon Sep 17 00:00:00 2001 From: "ji.luo" Date: Fri, 20 Oct 2017 15:57:02 +0800 Subject: [PATCH] [iot] Support fastboot oem fuse at-bootloader-vboot-key command Support "fastboot oem fuse at-bootloader-vboot-key" command. Since we don't program the verified boot key in bootloader, so this command will simply return "OKAY". Change-Id: Ic750803e7780f2cb0e0eb776ddc2a46932f2be09 Signed-off-by: ji.luo --- drivers/usb/gadget/f_fastboot.c | 9 +++++++++ include/fsl_fastboot.h | 4 ++++ 2 files changed, 13 insertions(+) diff --git a/drivers/usb/gadget/f_fastboot.c b/drivers/usb/gadget/f_fastboot.c index 8fb21bf5a3..f5ceb19dbb 100755 --- a/drivers/usb/gadget/f_fastboot.c +++ b/drivers/usb/gadget/f_fastboot.c @@ -2743,7 +2743,16 @@ static void cb_flashing(struct usb_ep *ep, struct usb_request *req) unsigned char len = strlen(cmd); FbLockState status; FbLockEnableResult result; + +#ifdef CONFIG_ANDROID_THINGS_SUPPORT + if (!strncmp(cmd + len - strlen(FASTBOOT_BOOTLOADER_VBOOT_KEY), + FASTBOOT_BOOTLOADER_VBOOT_KEY, + strlen(FASTBOOT_BOOTLOADER_VBOOT_KEY))) { + strcpy(response, "OKAY"); + } else if (!strncmp(cmd + len - 15, "unlock_critical", 15)) { +#else if (!strncmp(cmd + len - 15, "unlock_critical", 15)) { +#endif strcpy(response, "OKAY"); } else if (!strncmp(cmd + len - 13, "lock_critical", 13)) { strcpy(response, "OKAY"); diff --git a/include/fsl_fastboot.h b/include/fsl_fastboot.h index 94c400e2bc..5df630ed48 100644 --- a/include/fsl_fastboot.h +++ b/include/fsl_fastboot.h @@ -72,6 +72,10 @@ #define FASTBOOT_PARTITION_FBMISC "fbmisc" #endif +#ifdef CONFIG_ANDROID_THINGS_SUPPORT +#define FASTBOOT_BOOTLOADER_VBOOT_KEY "fuse at-bootloader-vboot-key" +#endif + enum { DEV_SATA, DEV_MMC, -- 2.17.1