summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfaqiang.zhu <faqiang.zhu@nxp.com>2018-08-06 20:10:33 +0800
committerNeal Ostrem <nealo@google.com>2018-08-24 05:49:55 +0000
commitcc7104b6506434c336254135fad095161f700c7e (patch)
tree2b30d81660394394e30bc51e363dc550071fd17c
parent0105deb5739e81b029ccfb4a7c7dfb0a78042e87 (diff)
downloaduboot-imx-cc7104b6506434c336254135fad095161f700c7e.tar.gz
Set different bootargs for imx8m_phanbell based on ram capacity
for 1GB ram: cma=296M galcore.contiguousSize=8388608 for 3GB ram: cma=384M Test: Boot successfully on AIY-1G & AIY-3G Change-Id: If082d5b751b5a5e06efe301c0b8e49ec4ac3dfb7 Signed-off-by: faqiang.zhu <faqiang.zhu@nxp.com> Reviewed-on: http://androidsource.ap.freescale.net/project/5262 Reviewed-by: Wang Haoran <elven.wang@nxp.com> Signed-off-by: faqiang.zhu <faqiang.zhu@nxp.com>
-rw-r--r--board/freescale/imx8mq_phanbell/imx8m_phanbell.c10
-rw-r--r--common/image-android.c8
2 files changed, 18 insertions, 0 deletions
diff --git a/board/freescale/imx8mq_phanbell/imx8m_phanbell.c b/board/freescale/imx8mq_phanbell/imx8m_phanbell.c
index e274c36b44..230fcf09c1 100644
--- a/board/freescale/imx8mq_phanbell/imx8m_phanbell.c
+++ b/board/freescale/imx8mq_phanbell/imx8m_phanbell.c
@@ -349,6 +349,16 @@ int board_late_init(void)
#ifdef CONFIG_ENV_IS_IN_MMC
board_late_mmc_env_init();
#endif
+ int baseboard_id;
+ baseboard_id = get_imx8m_baseboard_id();
+ if ((baseboard_id == ENTERPRISE_MICRON_1G) ||
+ (baseboard_id == ENTERPRISE_HYNIX_1G)) {
+ /* 1G DDR size */
+ setenv("bootargs_ram_capacity", "cma=296M galcore.contiguousSize=8388608");
+ } else {
+ /* 3G DDR size */
+ setenv("bootargs_ram_capacity", "cma=384M");
+ }
return 0;
}
diff --git a/common/image-android.c b/common/image-android.c
index 5045cfe83f..9a2ad470fa 100644
--- a/common/image-android.c
+++ b/common/image-android.c
@@ -83,6 +83,14 @@ int android_image_get_kernel(const struct andr_img_hdr *hdr, int verify,
strcat(commandline, hdr->cmdline);
}
+ /* Add 'bootargs_ram_capacity' to hold the parameters based on different ram capacity */
+ char *bootargs_ram_capacity = getenv("bootargs_ram_capacity");
+ if (bootargs_ram_capacity) {
+ strncat(commandline, " ", sizeof(commandline) - strlen(commandline));
+ strncat(commandline, bootargs_ram_capacity,
+ sizeof(commandline) - strlen(commandline));
+ }
+
#ifdef CONFIG_SERIAL_TAG
struct tag_serialnr serialnr;
get_board_serial(&serialnr);