diff options
author | Ye.Li <B37916@freescale.com> | 2014-07-04 16:09:54 +0800 |
---|---|---|
committer | Ye.Li <B37916@freescale.com> | 2014-07-04 16:40:18 +0800 |
commit | 4ca9535c91c40da93703bd20727700cd33994f93 (patch) | |
tree | f75bb480f7ee0643d9822db3c8bb5a83ca4531ec /common | |
parent | 8d355a9d6f138e1c1cd04dbadb7b5b3e2d692701 (diff) | |
download | u-boot-imx-4ca9535c91c40da93703bd20727700cd33994f93.zip u-boot-imx-4ca9535c91c40da93703bd20727700cd33994f93.tar.gz u-boot-imx-4ca9535c91c40da93703bd20727700cd33994f93.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>
Diffstat (limited to 'common')
-rw-r--r-- | common/cmd_fastboot.c | 18 |
1 files changed, 18 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 !!! */ |