summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYe.Li <B37916@freescale.com>2014-07-04 16:09:54 +0800
committerYe.Li <B37916@freescale.com>2014-07-04 17:24:15 +0800
commit538d681a71debc2004f07c10479e3a5b5d02f6bb (patch)
tree9ec16366fcc2cf4402dc010b4adcaadaef2107bd
parente5c6f2f9a3210635633065b8ebe55bb6f6c0a1b6 (diff)
downloadu-boot-imx-538d681a71debc2004f07c10479e3a5b5d02f6bb.zip
u-boot-imx-538d681a71debc2004f07c10479e3a5b5d02f6bb.tar.gz
u-boot-imx-538d681a71debc2004f07c10479e3a5b5d02f6bb.tar.bz2
ENGR00321260-2 iMX6:Android: Append the "androidboot.serialno" to bootargs
Android supports to two ways to pass serialno: 1. ATAG_SERIAL 2. "androidboot.serialno=" argument in boot commandline. Since we support the DTB for android, so the ATAGS can't work. We have to choose the second way. This patch only applys the bootargs in bootimg, while the bootargs saved in u-boot env variables won't have this argument appended. Signed-off-by: Ye.Li <B37916@freescale.com> (cherry picked from commit 4ca9535c91c40da93703bd20727700cd33994f93)
-rw-r--r--common/cmd_fastboot.c18
-rw-r--r--include/configs/mx6sabreandroid_common.h2
-rw-r--r--include/configs/mx6slevkandroid.h2
-rw-r--r--include/configs/mx6sxsabresdandroid.h2
4 files changed, 24 insertions, 0 deletions
diff --git a/common/cmd_fastboot.c b/common/cmd_fastboot.c
index fc3bdba..a8ad8e2 100644
--- a/common/cmd_fastboot.c
+++ b/common/cmd_fastboot.c
@@ -67,6 +67,7 @@
#include <libfdt.h>
#include <fdt_support.h>
#endif
+#include <asm/bootm.h>
#ifdef CONFIG_FASTBOOT
@@ -1748,7 +1749,24 @@ int do_booti(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
/* If no bootargs env, just use hdr command line */
if (!commandline) {
commandline = (char *)hdr->cmdline;
+#ifdef CONFIG_SERIAL_TAG
+ char appended_cmd_line[FASTBOOT_BOOT_ARGS_SIZE];
+ struct tag_serialnr serialnr;
+ get_board_serial(&serialnr);
+ if (strlen((char *)hdr->cmdline) +
+ strlen("androidboot.serialno") + 17 < FASTBOOT_BOOT_ARGS_SIZE) {
+ sprintf(appended_cmd_line,
+ "%s androidboot.serialno=%08x%08x",
+ (char *)hdr->cmdline,
+ serialnr.high,
+ serialnr.low);
+ commandline = appended_cmd_line;
+ } else {
+ printf("Cannot append androidboot.serialno\n");
+ }
+
setenv("bootargs", commandline);
+#endif
}
/* XXX: in production, you should always use boot.img 's cmdline !!! */
diff --git a/include/configs/mx6sabreandroid_common.h b/include/configs/mx6sabreandroid_common.h
index 1645b1b..6602c7d 100644
--- a/include/configs/mx6sabreandroid_common.h
+++ b/include/configs/mx6sabreandroid_common.h
@@ -7,6 +7,8 @@
#ifndef MX6_SABRE_ANDROID_COMMON_H
#define MX6_SABRE_ANDROID_COMMON_H
+#define CONFIG_SERIAL_TAG
+
#define CONFIG_USB_DEVICE
#define CONFIG_IMX_UDC 1
diff --git a/include/configs/mx6slevkandroid.h b/include/configs/mx6slevkandroid.h
index 0bf67c5..a2447c1 100644
--- a/include/configs/mx6slevkandroid.h
+++ b/include/configs/mx6slevkandroid.h
@@ -10,6 +10,8 @@
#include <asm/imx-common/mxc_key_defs.h>
+#define CONFIG_SERIAL_TAG
+
#define CONFIG_USB_DEVICE
#define CONFIG_IMX_UDC 1
diff --git a/include/configs/mx6sxsabresdandroid.h b/include/configs/mx6sxsabresdandroid.h
index bf78de4..0c16fe8 100644
--- a/include/configs/mx6sxsabresdandroid.h
+++ b/include/configs/mx6sxsabresdandroid.h
@@ -8,6 +8,8 @@
#ifndef __MX6SX_SABRESD_ANDROID_H
#define __MX6SX_SABRESD_ANDROID_H
+#define CONFIG_SERIAL_TAG
+
#define CONFIG_USB_DEVICE
#define CONFIG_IMX_UDC 1