summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorzhang sanshan <b51434@freescale.com>2015-07-28 18:40:53 +0800
committerMax Krummenacher <max.krummenacher@toradex.com>2016-03-09 14:42:44 +0100
commitdf078ea0139ad405b02ef6bcabd7890d0e87c023 (patch)
treed380ad01e80f9dcc113bf849e582b4b219cd951f /common
parent05aad0388392a38f9c9746758c87cc4fe0958616 (diff)
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 eb1582b698a..5cd3a8c6ed9 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;