summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMihai Serban <mihai.serban@intel.com>2016-03-29 16:53:58 +0300
committerSerban, Mihai <mihai.serban@intel.com>2016-03-29 16:47:57 +0100
commitf15b2b67274cb3d1affa340a5284a0fe68ec8e67 (patch)
tree2825d65936ae776967d9c98353690514cfa0eb23
parenta6a4cc1f87b37500edd7e8446e6e9fadf6049be8 (diff)
downloadedison-u-boot-f15b2b67274cb3d1affa340a5284a0fe68ec8e67.tar.gz
fastboot: add product option to getvar/getvar_all functions
Change-Id: I3ff496aebd32d07ff07616f9565df37a79585c15 Tracked-On: https://jira01.devtools.intel.com/browse/BP-345 Signed-off-by: Mihai Serban <mihai.serban@intel.com> Reviewed-on: https://android.intel.com/487503 Reviewed-by: Patru, Irina <irina.patru@intel.com> Tested-by: Patru, Irina <irina.patru@intel.com>
-rw-r--r--arch/x86/cpu/tangier/tangier.c5
-rw-r--r--board/intel/edison/edison.c2
-rw-r--r--drivers/usb/gadget/f_fastboot.c18
3 files changed, 21 insertions, 4 deletions
diff --git a/arch/x86/cpu/tangier/tangier.c b/arch/x86/cpu/tangier/tangier.c
index fe423537fb..8494c4deb5 100644
--- a/arch/x86/cpu/tangier/tangier.c
+++ b/arch/x86/cpu/tangier/tangier.c
@@ -21,6 +21,7 @@
DECLARE_GLOBAL_DATA_PTR;
+extern const char* fb_get_product_name(void);
/*
* Miscellaneous platform dependent initializations
*/
@@ -109,8 +110,6 @@ int board_final_cleanup(void)
return 0;
}
-__weak char* get_product_name(void) { return ""; }
-
int board_late_init(void)
{
if (!getenv("serial#")) {
@@ -122,7 +121,7 @@ int board_late_init(void)
char product_name[20];
int offset = 0;
- snprintf(product_name, sizeof(product_name), "%s", get_product_name());
+ snprintf(product_name, sizeof(product_name), "%s", fb_get_product_name());
offset = strlen(product_name);
if (offset)
sprintf(ssn, "%s", product_name);
diff --git a/board/intel/edison/edison.c b/board/intel/edison/edison.c
index e5387d12de..0d73824cfe 100644
--- a/board/intel/edison/edison.c
+++ b/board/intel/edison/edison.c
@@ -84,7 +84,7 @@ int board_usb_cleanup(int index, enum usb_init_type init)
return -EINVAL;
}
-char* get_product_name(void)
+const char* fb_get_product_name(void)
{
return PRODUCT_NAME;
}
diff --git a/drivers/usb/gadget/f_fastboot.c b/drivers/usb/gadget/f_fastboot.c
index b2e9b1eb19..aca1b7408e 100644
--- a/drivers/usb/gadget/f_fastboot.c
+++ b/drivers/usb/gadget/f_fastboot.c
@@ -123,6 +123,11 @@ static struct usb_gadget_strings *fastboot_strings[] = {
NULL,
};
+__weak const char* fb_get_product_name(void)
+{
+ return "";
+}
+
static void rx_handler_command(struct usb_ep *ep, struct usb_request *req);
static int strcmp_l1(const char *s1, const char *s2);
@@ -448,6 +453,10 @@ static void getvar_serialno(char *response, char *cmd, size_t chars_left) {
strcpy(response, "FAILValue not set");
}
+static void getvar_product(char *response, char *cmd, size_t chars_left) {
+ strncat(response, fb_get_product_name(), chars_left);
+}
+
static void getvar_partition_type(char *response, char *cmd, size_t chars_left) {
var_partition_type(cmd + 15, response);
}
@@ -524,6 +533,11 @@ static void getvar_all(char *response, char *cmd, size_t chars_left) {
req6->complete = fastboot_complete2;
fastboot_tx_write_str2(req6, response);
+ snprintf(response, RESPONSE_LEN, "INFOproduct: %s", fb_get_product_name());
+ struct usb_request *req7 = fastboot_start_ep(fastboot_func->in_ep);
+ req7->complete = fastboot_complete2;
+ fastboot_tx_write_str2(req7, response);
+
struct usb_request *req9 = fastboot_start_ep(fastboot_func->in_ep);
req9->complete = fastboot_complete2;
fastboot_tx_write_str2(req9, "OKAY");
@@ -552,6 +566,10 @@ static struct get_var_command_t list_of_commands[] = {
getvar_serialno,
},
{
+ "product",
+ getvar_product,
+ },
+ {
"partition-type",
getvar_partition_type,
},