summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Go <sangch.go@gmail.com>2020-06-15 09:25:19 +0300
committerLuke Go <sangch.go@gmail.com>2020-06-15 09:28:30 +0300
commite0725c1dce0c3dbbae47478c13d968c41014fac8 (patch)
treee459ae35ef30123448706d82e462ac3609f18f46
parent0b6bf33fea7abf83541c35e6512b6e0cf550a4ca (diff)
downloadu-boot-aml64_buildroot_master_c4.tar.xz
- In some boot sequence, 'mmc_dev' value is not available. So in that sequence, boot device is should detected by 'get_boot_device' method. - The 'movi' command not use 'mmc dev' command. So removed a 'mmc dev' command and for loops. Change-Id: I4ab576823440d066069c46171e9fbf424f37eb3c
-rw-r--r--common/bootm.c10
-rw-r--r--include/configs/odroid-g12-common.h28
2 files changed, 20 insertions, 18 deletions
diff --git a/common/bootm.c b/common/bootm.c
index ade859df1d..495b6a3628 100644
--- a/common/bootm.c
+++ b/common/bootm.c
@@ -345,13 +345,21 @@ static int get_fdto_totalsize(u32 *tz)
#endif
#if defined(CONFIG_ODROID_COMMON)
+extern int get_boot_device(void);
static int bootm_add_ignore_mpt_to_fdt(void *fdth)
{
char *pathp = NULL;
int nodeoffset;
int ret;
+ bool is_emmc_boot = false;
+ const char * mmc_dev = getenv("mmc_dev");
- if (simple_strtol(getenv("mmc_dev"), NULL, 10) == 0) { // emmc boot
+ if (mmc_dev == NULL)
+ is_emmc_boot = get_boot_device() == 1;
+ else
+ is_emmc_boot = simple_strtol(mmc_dev, NULL, 10) == 0;
+
+ if (is_emmc_boot) { // emmc boot
pathp = "/sd/sd";
} else { // sd boot
pathp = "/emmc/emmc";
diff --git a/include/configs/odroid-g12-common.h b/include/configs/odroid-g12-common.h
index 43aa748667..ec234de9a4 100644
--- a/include/configs/odroid-g12-common.h
+++ b/include/configs/odroid-g12-common.h
@@ -197,28 +197,23 @@
"androidboot.selinux=permissive jtag=disable "\
"androidboot.hardware=" CONFIG_DEVICE_PRODUCT " "\
"recovery_part=recovery recovery_offset=0; "\
- "for n in ${mmc_list}; do "\
- "mmc dev ${n}; " \
- "movi read dtbs 0 ${cramfsaddr}; " \
- "cramfsload ${dtb_mem_addr} meson64_" CONFIG_DEVICE_PRODUCT "_android.dtb;" \
- "if test ${variant} != c4; then " \
- "cramfsload ${loadaddr} odroid${variant}-opp.dtbo;" \
- "fdt addr ${dtb_mem_addr};" \
- "fdt resize 8192;" \
- "fdt apply ${loadaddr};" \
- "fi;" \
- "movi read recovery 0 ${loadaddr}; " \
- "booti ${loadaddr} - ${dtb_mem_addr}; " \
- "bootm ${loadaddr};" \
- "done\0" \
+ "movi read dtbs 0 ${cramfsaddr}; " \
+ "cramfsload ${dtb_mem_addr} meson64_" CONFIG_DEVICE_PRODUCT "_android.dtb;" \
+ "if test ${variant} != c4; then " \
+ "cramfsload ${loadaddr} odroid${variant}-opp.dtbo;" \
+ "fdt addr ${dtb_mem_addr};" \
+ "fdt resize 8192;" \
+ "fdt apply ${loadaddr};" \
+ "fi;" \
+ "movi read recovery 0 ${loadaddr}; " \
+ "booti ${loadaddr} - ${dtb_mem_addr}; " \
+ "bootm ${loadaddr};" \
"boot_rawimage=" \
"setenv bootargs ${initargs} logo=${display_layer},loaded,${fb_addr} " \
"vout=${outputmode},enable cvbsmode=${cvbsmode} " \
"hdmimode=${hdmimode} osd_reverse=${osd_reverse} video_reverse=${video_reverse} " \
"androidboot.selinux=permissive androidboot.firstboot=${firstboot} jtag=disable " \
"androidboot.hardware=" CONFIG_DEVICE_PRODUCT "; " \
- "for n in ${mmc_list}; do " \
- "mmc dev ${n}; " \
"movi read dtbs 0 ${cramfsaddr}; " \
"cramfsload ${dtb_mem_addr} meson64_" CONFIG_DEVICE_PRODUCT "_android.dtb;" \
"if test ${variant} != c4; then " \
@@ -230,7 +225,6 @@
"movi read boot 0 ${loadaddr}; " \
"booti ${loadaddr} - ${dtb_mem_addr}; " \
"bootm ${loadaddr}; " \
- "done\0" \
"init_display="\
"osd open; osd clear; " \
"for n in ${mmc_list}; do " \