summaryrefslogtreecommitdiff
authorXindong Xu <xindong.xu@amlogic.com>2019-07-11 05:34:24 (GMT)
committer Xindong Xu <xindong.xu@amlogic.com>2019-07-11 05:36:35 (GMT)
commit3588d2dc5bcf7902a56cc7a8b28cf95ec1321d1c (patch)
tree991dcc5739b67687693f278dd45f6048db038a98
parent2eee715313b60021a9311639605dac55ef681672 (diff)
downloaduboot-3588d2dc5bcf7902a56cc7a8b28cf95ec1321d1c.zip
uboot-3588d2dc5bcf7902a56cc7a8b28cf95ec1321d1c.tar.gz
uboot-3588d2dc5bcf7902a56cc7a8b28cf95ec1321d1c.tar.bz2
fastboot: sync fastboot getvar all to google [1/1]
PD#SWPL-11141 Problem: cmd fastboot getvar all do not print out all required variables Solution: sync fastboot getvar all to google Vefify: franklin Change-Id: I6659f2147fadbcad10b26a983b095a43c8a56bad
Diffstat
-rwxr-xr-x[-rw-r--r--]drivers/usb/gadget/f_fastboot.c29
1 files changed, 26 insertions, 3 deletions
diff --git a/drivers/usb/gadget/f_fastboot.c b/drivers/usb/gadget/f_fastboot.c
index 8596480..dce201c 100644..100755
--- a/drivers/usb/gadget/f_fastboot.c
+++ b/drivers/usb/gadget/f_fastboot.c
@@ -496,6 +496,19 @@ static const char* getvar_list[] = {
"partition-type:odm", "partition-size:odm", "partition-type:data", "partition-size:data",
"erase-block-size", "logical-block-size", "secure", "unlocked",
};
+
+static const char* getvar_list_dynamic[] = {
+ "hw-revision", "battery-voltage", "is-userspace", "is-logical:data",
+ "is-logical:metadata", "is-logical:misc", "is-logical:super", "is-logical:boot",
+ "is-logical:system", "is-logical:vendor", "is-logical:product", "is-logical:odm",
+ "slot-count", "max-download-size", "serialno", "product", "unlocked", "has-slot:data",
+ "has-slot:metadata", "has-slot:misc", "has-slot:super", "has-slot:boot",
+ "has-slot:system", "has-slot:vendor", "has-slot:product", "has-slot:odm",
+ "secure", "super-partition-name", "version-baseband", "version-bootloader",
+ "partition-size:boot", "partition-size:metadata", "partition-size:misc",
+ "partition-size:super", "partition-size:data", "version",
+};
+
static const char* getvar_list_ab[] = {
"version-baseband", "version-bootloader", "version", "hw-revision", "max-download-size",
"serialno", "product", "off-mode-charge", "variant", "battery-soc-ok",
@@ -543,6 +556,9 @@ static void cb_getvar(struct usb_ep *ep, struct usb_request *req)
if (has_boot_slot == 1) {
strcpy(cmd, getvar_list_ab[cmdIndex]);
getvar_num = (sizeof(getvar_list_ab) / sizeof(getvar_list_ab[0]));
+ } else if (dynamic_partition) {
+ strcpy(cmd, getvar_list_dynamic[cmdIndex]);//only support no-arg cmd
+ getvar_num = (sizeof(getvar_list_dynamic) / sizeof(getvar_list_dynamic[0]));
} else {
strcpy(cmd, getvar_list[cmdIndex]);//only support no-arg cmd
getvar_num = (sizeof(getvar_list) / sizeof(getvar_list[0]));
@@ -566,7 +582,7 @@ static void cb_getvar(struct usb_ep *ep, struct usb_request *req)
} else if (!strcmp_l1("version-bootloader", cmd)) {
strncat(response, s_version, chars_left);
} else if (!strcmp_l1("hw-revision", cmd)) {
- strncat(response, "EVT", chars_left);
+ strncat(response, "0", chars_left);
} else if (!strcmp_l1("version", cmd)) {
strncat(response, FASTBOOT_VERSION, chars_left);
} else if (!strcmp_l1("bootloader-version", cmd)) {
@@ -578,7 +594,7 @@ static void cb_getvar(struct usb_ep *ep, struct usb_request *req)
} else if (!strcmp_l1("battery-soc-ok", cmd)) {
strncat(response, "yes", chars_left);
} else if (!strcmp_l1("battery-voltage", cmd)) {
- strncat(response, "4.2V", chars_left);
+ strncat(response, "4", chars_left);
} else if (!strcmp_l1("is-userspace", cmd)) {
strncat(response, "no", chars_left);
} else if (!strcmp_l1("is-logical", cmd)) {
@@ -632,7 +648,10 @@ static void cb_getvar(struct usb_ep *ep, struct usb_request *req)
#endif
strncat(response, s1, chars_left);
} else if (!strcmp_l1("slot-count", cmd)) {
- strncat(response, "2", chars_left);
+ if (has_boot_slot == 1)
+ strncat(response, "2", chars_left);
+ else
+ strncat(response, "0", chars_left);
} else if (!strcmp_l1("slot-suffixes", cmd)) {
s2 = getenv("slot-suffixes");
printf("slot-suffixes: %s\n", s2);
@@ -721,6 +740,10 @@ static void cb_getvar(struct usb_ep *ep, struct usb_request *req)
strncat(response, "yes", chars_left);
} else
strncat(response, "no", chars_left);
+ } else if (!strcmp_l1("has-slot:data", cmd)) {
+ strncat(response, "no", chars_left);
+ } else if (!strcmp_l1("has-slot:misc", cmd)) {
+ strncat(response, "no", chars_left);
} else if (!strcmp_l1("has-slot:odm", cmd)) {
if (has_boot_slot == 1) {
printf("has odm slot\n");