summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorSanshan Zhang <sanshan.zhang@nxp.com>2017-03-01 17:00:10 +0800
committerYe Li <ye.li@nxp.com>2017-04-05 19:48:36 +0800
commit4d226b92b3dd577bf02c11d1e0d32494b68a5a66 (patch)
tree896f96628e03af9c5a00f99458f102dcfeea8b3b /common
parent9fe1f23c2bcb263a91a2044cb0105963844dcc06 (diff)
downloadu-boot-imx-4d226b92b3dd577bf02c11d1e0d32494b68a5a66.zip
u-boot-imx-4d226b92b3dd577bf02c11d1e0d32494b68a5a66.tar.gz
u-boot-imx-4d226b92b3dd577bf02c11d1e0d32494b68a5a66.tar.bz2
MA-9263-3 [Android] Partition: enable GPT partition on imx devices
1. pass androidboot.storage_type to android, 'init' use it to parse different init.freescale.storage.rc. 2. store new ptable with gpt partition. 3. we use the last LBA as backup gpt table, there is many warning log when boot, change print to debug Change-Id: I84070735e9d4c2741b0e240bc1c61b357dabc5b8 Signed-off-by: Sanshan Zhang <sanshan.zhang@nxp.com> (cherry picked from commit da0ce2787256a323371641b0764266d386d767a5) Signed-off-by: Ye Li <ye.li@nxp.com>
Diffstat (limited to 'common')
-rw-r--r--common/image-android.c28
1 files changed, 24 insertions, 4 deletions
diff --git a/common/image-android.c b/common/image-android.c
index 12ae345..de5e97c 100644
--- a/common/image-android.c
+++ b/common/image-android.c
@@ -2,6 +2,7 @@
* Copyright (c) 2011 Sebastian Andrzej Siewior <bigeasy@linutronix.de>
*
* Copyright (C) 2015-2016 Freescale Semiconductor, Inc.
+ * Copyright 2017 NXP
*
* SPDX-License-Identifier: GPL-2.0+
*/
@@ -12,6 +13,7 @@
#include <malloc.h>
#include <errno.h>
#include <asm/bootm.h>
+#include <asm/imx-common/boot_mode.h>
#define ANDROID_IMAGE_DEFAULT_KERNEL_ADDR 0x10008000
@@ -92,9 +94,10 @@ int android_image_get_kernel(const struct andr_img_hdr *hdr, int verify,
}
printf("Kernel command line: %s\n", newbootargs);
+ char commandline[ANDR_BOOT_ARGS_SIZE];
+ strcpy(commandline, newbootargs);
#ifdef CONFIG_SERIAL_TAG
struct tag_serialnr serialnr;
- char commandline[ANDR_BOOT_ARGS_SIZE];
get_board_serial(&serialnr);
sprintf(commandline,
@@ -102,10 +105,27 @@ int android_image_get_kernel(const struct andr_img_hdr *hdr, int verify,
newbootargs,
serialnr.high,
serialnr.low);
- setenv("bootargs", commandline);
-#else
- setenv("bootargs", newbootargs);
+ strcpy(newbootargs, commandline);
#endif
+ int bootdev = get_boot_device();
+ if (bootdev == SD1_BOOT || bootdev == SD2_BOOT ||
+ bootdev == SD3_BOOT || bootdev == SD4_BOOT) {
+ sprintf(commandline,
+ "%s androidboot.storage_type=sd gpt",
+ newbootargs);
+ } else if (bootdev == MMC1_BOOT || bootdev == MMC2_BOOT ||
+ bootdev == MMC3_BOOT || bootdev == MMC4_BOOT) {
+ sprintf(commandline,
+ "%s androidboot.storage_type=emmc",
+ newbootargs);
+ } else if (bootdev == NAND_BOOT) {
+ sprintf(commandline,
+ "%s androidboot.storage_type=nand",
+ newbootargs);
+ } else
+ printf("boot device type is incorrect.\n");
+
+ setenv("bootargs", commandline);
if (os_data) {
*os_data = (ulong)hdr;