fastboot: add FASTBOOT_OEM_UNLOCK option
This enables the following fastboot commands: fastboot oem unlock fastboot oem unlock_accept fastboot oem lock fastboot getvar oem-unlock Android 8.1 need the oem unlock status attach to bootargs on boot. Change-Id: Icc83451336a4dea2cbcf4927287de23bc8e28cb1 Signed-off-by: Jian Qiu <qiujian@rock-chips.com>
This commit is contained in:
parent
f6d4196e0f
commit
65413a00f9
|
|
@ -41,7 +41,7 @@ static int do_boot_rockchip(cmd_tbl_t *cmdtp, int flag, int argc,
|
||||||
load_attestation_key(dev_desc, &misc_part_info);
|
load_attestation_key(dev_desc, &misc_part_info);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_OPTEE_CLIENT
|
#ifdef CONFIG_FASTBOOT_OEM_UNLOCK
|
||||||
/* read oem unlock status and attach to bootargs */
|
/* read oem unlock status and attach to bootargs */
|
||||||
uint8_t unlock = 0;
|
uint8_t unlock = 0;
|
||||||
TEEC_Result result;
|
TEEC_Result result;
|
||||||
|
|
|
||||||
|
|
@ -82,6 +82,15 @@ config FASTBOOT_FLASH_MMC_DEV
|
||||||
regarding the non-volatile storage device. Define this to
|
regarding the non-volatile storage device. Define this to
|
||||||
the eMMC device that fastboot should use to store the image.
|
the eMMC device that fastboot should use to store the image.
|
||||||
|
|
||||||
|
config FASTBOOT_OEM_UNLOCK
|
||||||
|
bool "Enable FASTBOOT OEM UNLOCK command"
|
||||||
|
depends on OPTEE_CLIENT
|
||||||
|
help
|
||||||
|
This enables the command "fastboot oem unlock" the fastboot
|
||||||
|
oem unlock command requires tee security storage to store
|
||||||
|
unlock status. oem unlock status attach to bootargs on boot.
|
||||||
|
|
||||||
|
|
||||||
endif # USB_FUNCTION_FASTBOOT || UDP_FUNCTION_FASTBOOT
|
endif # USB_FUNCTION_FASTBOOT || UDP_FUNCTION_FASTBOOT
|
||||||
|
|
||||||
endif # FASTBOOT
|
endif # FASTBOOT
|
||||||
|
|
|
||||||
|
|
@ -582,7 +582,7 @@ int android_bootloader_boot_flow(struct blk_desc *dev_desc,
|
||||||
env_set_ulong("android_root_devnum", dev_desc->devnum);
|
env_set_ulong("android_root_devnum", dev_desc->devnum);
|
||||||
env_set("android_slotsufix", slot_suffix);
|
env_set("android_slotsufix", slot_suffix);
|
||||||
|
|
||||||
#ifdef CONFIG_OPTEE_CLIENT
|
#ifdef CONFIG_FASTBOOT_OEM_UNLOCK
|
||||||
/* read oem unlock status and attach to bootargs */
|
/* read oem unlock status and attach to bootargs */
|
||||||
uint8_t unlock = 0;
|
uint8_t unlock = 0;
|
||||||
TEEC_Result result;
|
TEEC_Result result;
|
||||||
|
|
|
||||||
|
|
@ -688,7 +688,7 @@ static void cb_getvar(struct usb_ep *ep, struct usb_request *req)
|
||||||
strncat(response, part_size_str, chars_left);
|
strncat(response, part_size_str, chars_left);
|
||||||
}
|
}
|
||||||
} else if (!strncmp("oem-unlock", cmd, 10)) {
|
} else if (!strncmp("oem-unlock", cmd, 10)) {
|
||||||
#ifdef CONFIG_OPTEE_CLIENT
|
#ifdef CONFIG_FASTBOOT_OEM_UNLOCK
|
||||||
#ifdef CONFIG_RK_AVB_LIBAVB_USER
|
#ifdef CONFIG_RK_AVB_LIBAVB_USER
|
||||||
fastboot_tx_write_str("FAILnot implemented");
|
fastboot_tx_write_str("FAILnot implemented");
|
||||||
return;
|
return;
|
||||||
|
|
@ -1182,7 +1182,7 @@ static void cb_oem(struct usb_ep *ep, struct usb_request *req)
|
||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
if (strncmp("unlock", cmd + 4, 8) == 0) {
|
if (strncmp("unlock", cmd + 4, 8) == 0) {
|
||||||
#ifdef CONFIG_OPTEE_CLIENT
|
#ifdef CONFIG_FASTBOOT_OEM_UNLOCK
|
||||||
#ifdef CONFIG_RK_AVB_LIBAVB_USER
|
#ifdef CONFIG_RK_AVB_LIBAVB_USER
|
||||||
fastboot_tx_write_str("FAILnot implemented");
|
fastboot_tx_write_str("FAILnot implemented");
|
||||||
return;
|
return;
|
||||||
|
|
@ -1214,7 +1214,7 @@ static void cb_oem(struct usb_ep *ep, struct usb_request *req)
|
||||||
return;
|
return;
|
||||||
#endif
|
#endif
|
||||||
} else if (strncmp("unlock_accept", cmd + 4, 13) == 0) {
|
} else if (strncmp("unlock_accept", cmd + 4, 13) == 0) {
|
||||||
#ifdef CONFIG_OPTEE_CLIENT
|
#ifdef CONFIG_FASTBOOT_OEM_UNLOCK
|
||||||
#ifdef CONFIG_RK_AVB_LIBAVB_USER
|
#ifdef CONFIG_RK_AVB_LIBAVB_USER
|
||||||
fastboot_tx_write_str("FAILnot implemented");
|
fastboot_tx_write_str("FAILnot implemented");
|
||||||
return;
|
return;
|
||||||
|
|
@ -1271,7 +1271,7 @@ static void cb_oem(struct usb_ep *ep, struct usb_request *req)
|
||||||
return;
|
return;
|
||||||
#endif
|
#endif
|
||||||
} else if (strncmp("lock", cmd + 4, 8) == 0) {
|
} else if (strncmp("lock", cmd + 4, 8) == 0) {
|
||||||
#ifdef CONFIG_OPTEE_CLIENT
|
#ifdef CONFIG_FASTBOOT_OEM_UNLOCK
|
||||||
#ifdef CONFIG_RK_AVB_LIBAVB_USER
|
#ifdef CONFIG_RK_AVB_LIBAVB_USER
|
||||||
fastboot_tx_write_str("FAILnot implemented");
|
fastboot_tx_write_str("FAILnot implemented");
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue