summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorji.luo <ji.luo@nxp.com>2017-10-10 23:08:48 +0000
committerandroid-build-merger <android-build-merger@google.com>2017-10-10 23:08:48 +0000
commit701580386cfec1a427f983837b6eab6abb1ac75a (patch)
tree5511c89c6a7e766d60c8a76fdd613b2f046756c5
parenta057500ef220565e062da6f972bc99cb31cfa139 (diff)
parente10db57f282e8739404d4e39988689d0aac45d27 (diff)
downloaduboot-imx-701580386cfec1a427f983837b6eab6abb1ac75a.tar.gz
Support 'fastboot flashing get-unlock-ability' command am: 72d5f80add
am: e10db57f28 Change-Id: I4b5c6ce7d9e158137aea6eb07a93f43e811924bc
-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 020b510a38..f66362c696 100644
--- a/drivers/usb/gadget/f_fastboot.c
+++ b/drivers/usb/gadget/f_fastboot.c
@@ -3427,6 +3427,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)) {
@@ -3445,6 +3446,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");