summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorji.luo <ji.luo@nxp.com>2017-09-29 14:36:17 +0800
committerJason Liu <jason.hui.liu@nxp.com>2017-11-03 02:37:27 +0800
commit683e24fb948dbcce7ed93f1b455f7b5d2207c1f2 (patch)
treeb79ddb857b6d6c28948c83476bdae84403233b6e /drivers
parentce2b1b10aa315edcecc120fa57ea04ea69226507 (diff)
Support 'fastboot flashing get-unlock-ability' command
Change-Id: I7f3f8061da76a0a4957ff042058173b2a86da4ba Signed-off-by: ji.luo <ji.luo@nxp.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/gadget/f_fastboot.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/usb/gadget/f_fastboot.c b/drivers/usb/gadget/f_fastboot.c
index 15b110ea3f..b0b5e5435f 100644
--- a/drivers/usb/gadget/f_fastboot.c
+++ b/drivers/usb/gadget/f_fastboot.c
@@ -2658,6 +2658,7 @@ static void cb_flashing(struct usb_ep *ep, struct usb_request *req)
char response[FASTBOOT_RESPONSE_LEN];
unsigned char len = strlen(cmd);
FbLockState status;
+ FbLockEnableResult result;
if (!strncmp(cmd + len - 15, "unlock_critical", 15)) {
strcpy(response, "OKAY");
} else if (!strncmp(cmd + len - 13, "lock_critical", 13)) {
@@ -2676,6 +2677,18 @@ static void cb_flashing(struct usb_ep *ep, struct usb_request *req)
strcpy(response, "OKAY");
else
strcpy(response, "FAIL lock device failed.");
+ } else if (!strncmp(cmd + len - 18, "get_unlock_ability", 18)) {
+ result = fastboot_lock_enable();
+ if (result == FASTBOOT_UL_ENABLE) {
+ fastboot_tx_write_str("INFO1");
+ strcpy(response, "OKAY");
+ } else if (result == FASTBOOT_UL_DISABLE) {
+ fastboot_tx_write_str("INFO0");
+ strcpy(response, "OKAY");
+ } else {
+ printf("flashing get_unlock_ability fail!\n");
+ strcpy(response, "FAIL get unlock ability failed.");
+ }
} else {
printf("Unknown flashing command:%s\n", cmd);
strcpy(response, "FAIL command not defined");