[iot] Support fastboot oem fuse at-bootloader-vboot-key command
authorji.luo <ji.luo@nxp.com>
Fri, 20 Oct 2017 07:57:02 +0000 (15:57 +0800)
committerLuo Ji <ji.luo@nxp.com>
Thu, 25 Jan 2018 11:38:53 +0000 (19:38 +0800)
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 <ji.luo@nxp.com>
drivers/usb/gadget/f_fastboot.c
include/fsl_fastboot.h

index 8fb21bf..f5ceb19 100755 (executable)
@@ -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");
index 94c400e..5df630e 100644 (file)
 #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,