summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorzhang sanshan <b51434@freescale.com>2015-07-28 18:40:53 +0800
committerzhang sanshan <b51434@freescale.com>2015-07-28 19:07:59 +0800
commitd44c3b3e1f4db81b573482df0b3ec3770e831bce (patch)
tree7e07a457c1ccd64702894efefa389c88f35288a4 /common
parent748f2dbf8ff222465dfdd1db4884bafbcd8c6ffd (diff)
downloadu-boot-imx-d44c3b3e1f4db81b573482df0b3ec3770e831bce.zip
u-boot-imx-d44c3b3e1f4db81b573482df0b3ec3770e831bce.tar.gz
u-boot-imx-d44c3b3e1f4db81b573482df0b3ec3770e831bce.tar.bz2
MA-6928 Bootargs cannot be set
The bootargs is not set correctly. The final bootargs consist of uboot's bootargs and bootimg's bootargs. This patch set bootimg's bootargs as final bootargs if uboot's bootargs is not set. And take uboot's bootargs as final bootargs if uboot's bootargs is set. Signed-off-by: zhang sanshan <b51434@freescale.com>
Diffstat (limited to 'common')
-rw-r--r--common/image-android.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/common/image-android.c b/common/image-android.c
index eb1582b..5cd3a8c 100644
--- a/common/image-android.c
+++ b/common/image-android.c
@@ -9,6 +9,7 @@
#include <android_image.h>
#include <malloc.h>
#include <errno.h>
+#include <asm/bootm.h>
static char andr_tmp_str[ANDR_BOOT_ARGS_SIZE + 1];
@@ -62,12 +63,22 @@ int android_image_get_kernel(const struct andr_img_hdr *hdr, int verify,
if (bootargs) {
strcpy(newbootargs, bootargs);
- strcat(newbootargs, " ");
- }
- if (*hdr->cmdline)
+ } else if (*hdr->cmdline) {
strcat(newbootargs, hdr->cmdline);
-
- setenv("bootargs", newbootargs);
+ }
+#ifdef CONFIG_SERIAL_TAG
+ struct tag_serialnr serialnr;
+ char commandline[ANDR_BOOT_ARGS_SIZE];
+ get_board_serial(&serialnr);
+
+ sprintf(commandline,
+ "%s androidboot.serialno=%08x%08x",
+ newbootargs,
+ serialnr.high,
+ serialnr.low);
+#endif
+
+ setenv("bootargs", commandline);
if (os_data) {
*os_data = (ulong)hdr;