summaryrefslogtreecommitdiff
path: root/lib_arm/bootm.c
diff options
context:
space:
mode:
authorguoyin.chen <guoyin.chen@freescale.com>2014-01-23 11:42:52 +0800
committerguoyin.chen <guoyin.chen@freescale.com>2014-01-23 13:29:55 +0800
commitbc1148f504898d851e5bfdbdc7dcde754d94adba (patch)
tree3aa986d73116d4fc310eabfd8a1988e71acd1c0c /lib_arm/bootm.c
parentaa2be38ed4a16a6c3c100ac2d0449d54360cb892 (diff)
downloadu-boot-imx-bc1148f504898d851e5bfdbdc7dcde754d94adba.zip
u-boot-imx-bc1148f504898d851e5bfdbdc7dcde754d94adba.tar.gz
u-boot-imx-bc1148f504898d851e5bfdbdc7dcde754d94adba.tar.bz2
ENGR00296231 com.android.cts.usb.TestUsbTest#testUsbSerial failed
The case failed on the satement "adb serial" != "ro.serialno" "adb serial" will read /sys/class/android_usb/android0/iSerial "ro.serialno" will be set by passing "androidboot.serialno=" in bootargs init.freescale.usb.rc will update the /sys/class/android_usb/android0/iSerial from "ro.serialno" Set the serialno to be as board's serial, which customer should customized it Signed-off-by: guoyin.chen <guoyin.chen@freescale.com>
Diffstat (limited to 'lib_arm/bootm.c')
-rw-r--r--lib_arm/bootm.c27
1 files changed, 25 insertions, 2 deletions
diff --git a/lib_arm/bootm.c b/lib_arm/bootm.c
index 6b70367..7e2218e 100644
--- a/lib_arm/bootm.c
+++ b/lib_arm/bootm.c
@@ -4,7 +4,7 @@
* Marius Groeger <mgroeger@sysgo.de>
*
* Copyright (C) 2001 Erik Mouw (J.A.K.Mouw@its.tudelft.nl)
- * Copyright (C) 2013 Freescale Semiconductor, Inc.
+ * Copyright (C) 2013-2014 Freescale Semiconductor, Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -137,14 +137,37 @@ int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images)
void do_booti_linux (boot_img_hdr *hdr)
{
ulong initrd_start, initrd_end;
+#ifdef CONFIG_SERIAL_TAG
+ char appended_cmd_line[512];
+#endif
void (*theKernel)(int zero, int arch, uint params);
bd_t *bd = gd->bd;
#ifdef CONFIG_CMDLINE_TAG
char *commandline = getenv("bootargs");
/* If no bootargs env, just use hdr command line */
- if (!commandline)
+ if (!commandline) {
commandline = (char *)hdr->cmdline;
+#ifdef CONFIG_SERIAL_TAG
+ struct tag_serialnr serialnr;
+ void get_board_serial(struct tag_serialnr *serialnr);
+ get_board_serial(&serialnr);
+ /* append androidboot.serialno=chipserial number */
+ /* customer need to customize the serial number here*/
+ if (strlen((char *)hdr->cmdline) +
+ strlen("androidboot.serialno") + 17 < 512) {
+ 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");
+ }
+
+#endif
+ }
/* XXX: in production, you should always use boot.img 's cmdline !!! */
printf("kernel cmdline: \n");