From ef1ac9a102adc8838c3e8ff5ec5adc12929763a7 Mon Sep 17 00:00:00 2001 From: Luke go Date: Tue, 24 Nov 2020 17:34:00 +0900 Subject: ODROID-COMMON: Removed 'ignore_mpt' flag. - The 'ignore_mpt' flag is replaced other procedure. Change-Id: I2f3a41f74044295c5deaa107499a5476769f3c93 --- common/bootm.c | 34 ++++++++-------------------------- include/configs/odroid-g12-common.h | 3 +-- 2 files changed, 9 insertions(+), 28 deletions(-) diff --git a/common/bootm.c b/common/bootm.c index 495b6a3628..ccdcbad072 100644 --- a/common/bootm.c +++ b/common/bootm.c @@ -348,42 +348,24 @@ static int get_fdto_totalsize(u32 *tz) 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"); + const char * dev_type = getenv("devtype"); + char boot_device[7]; 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"; - } - - nodeoffset = fdt_path_offset (fdth, pathp); - - if (nodeoffset < 0) { - printf("libfdt fdt_path_offset() returned %s\n", - fdt_strerror(nodeoffset)); - return 1; - } - - ret = fdt_setprop(fdth, nodeoffset, "ignore_mpt", NULL, 0); - - if (ret == -FDT_ERR_NOSPACE) { - fdt_shrink_to_minimum(fdth, 0); - ret = fdt_setprop(fdth, nodeoffset, "ignore_mpt", NULL, 0); + memset(boot_device, 0x00, sizeof(boot_device)); + if (!strncmp(dev_type, "mmc", sizeof("mmc"))) { + sprintf(boot_device, "%s%c", "mmcblk", is_emmc_boot? '0':'1'); + } else { + sprintf(boot_device, "%s%c", "sd", is_emmc_boot ? 'a': 'b'); } - if (ret < 0) { - printf("libfdt fdt_setprop(): %s\n", fdt_strerror(ret)); - return 1; - } + setenv("boot_device", boot_device); return 0; } diff --git a/include/configs/odroid-g12-common.h b/include/configs/odroid-g12-common.h index 7daf932df8..640943505f 100644 --- a/include/configs/odroid-g12-common.h +++ b/include/configs/odroid-g12-common.h @@ -179,8 +179,7 @@ "if test ${reboot_mode} = factory_reset; then " \ "run boot_recovery;" \ "else if test ${reboot_mode} = selfinstall; then " \ - "oem fdisk;" \ - "run boot_recovery;" \ + "run boot_default;" \ "else if test ${reboot_mode} = cold_boot; then " \ /*"run try_auto_burn; "*/ \ "else if test ${reboot_mode} = fastboot; then " \ -- cgit v1.2.1