From: Jaehoon Chung Date: Sun, 10 May 2020 22:36:53 +0000 (+0900) Subject: include: tizen_amlogic: fix hardcoding about device number X-Git-Tag: submit/tizen/20201110.005738~38 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=aa4ac6803fcd1c3e6aa8908145d3f52ba49d4c89;p=platform%2Fkernel%2Fu-boot.git include: tizen_amlogic: fix hardcoding about device number devnmu will be set to correct value at booting time. SD - devnum : 0 eMMC - devnum :1 Signed-off-by: Jaehoon Chung --- diff --git a/arch/arm/mach-meson/board-common.c b/arch/arm/mach-meson/board-common.c index 7ea0ed4794..b0f6c6886b 100644 --- a/arch/arm/mach-meson/board-common.c +++ b/arch/arm/mach-meson/board-common.c @@ -114,6 +114,11 @@ static void meson_set_boot_source(void) switch (meson_get_boot_device()) { case BOOT_DEVICE_EMMC: source = "emmc"; +#ifdef CONFIG_TIZEN + env_set("devnum", "1"); + env_set("mmcbootdev", "1"); + env_set("mmcrootdev", "1"); +#endif break; case BOOT_DEVICE_NAND: @@ -126,6 +131,11 @@ static void meson_set_boot_source(void) case BOOT_DEVICE_SD: source = "sd"; +#ifdef CONFIG_TIZEN + env_set("devnum", "0"); + env_set("mmcbootdev", "0"); + env_set("mmcrootdev", "0"); +#endif break; case BOOT_DEVICE_USB: @@ -137,6 +147,7 @@ static void meson_set_boot_source(void) } env_set("boot_source", source); + } __weak int meson_board_late_init(void) diff --git a/board/amlogic/w400/w400.c b/board/amlogic/w400/w400.c index 4fc1421970..9e2613c37f 100644 --- a/board/amlogic/w400/w400.c +++ b/board/amlogic/w400/w400.c @@ -43,7 +43,10 @@ static char *get_dfu_alt_boot(char *interface, char *devstr) if (mmc_init(mmc)) return NULL; - alt_boot = CONFIG_DFU_ALT_SYSTEM; + if (!strncmp(devstr, "0", 1)) + alt_boot = CONFIG_DFU_ALT_SYSTEM_SD; + else + alt_boot = CONFIG_DFU_ALT_SYSTEM; return alt_boot; } @@ -83,6 +86,7 @@ void set_dfu_alt_info(char *interface, char *devstr) } env_set("dfu_alt_info", alt_info); + puts(status); } #endif diff --git a/include/samsung/tizen_amlogic.h b/include/samsung/tizen_amlogic.h index 7e513c33e9..be2a60e69b 100644 --- a/include/samsung/tizen_amlogic.h +++ b/include/samsung/tizen_amlogic.h @@ -18,7 +18,21 @@ #define CONFIG_SYS_MEM_TOP_HIDE 0x08000000 /* DFU */ -#define CONFIG_DFU_ALT_SYSTEM \ +/* For SD */ +#define CONFIG_DFU_ALT_SYSTEM_SD \ + "Image fat 0 1;" \ + "meson64_odroidn2_drm.dtb fat 0 1;" \ + "meson64_odroidn2.dtb fat 0 1;" \ + "boot.scr.uimg fat 0 1;" \ + "boot.img part 0 1;" \ + "rootfs part 0 2;" \ + "system-data part 0 3;" \ + "user part 0 5;" \ + "module part 0 6;" \ + "ramdisk.img part 0 7\0" + +/* For eMMC */ +#define CONFIG_DFU_ALT_SYSTEM \ "Image fat 1 1;" \ "meson64_odroidn2_drm.dtb fat 1 1;" \ "meson64_odroidn2.dtb fat 1 1;" \ @@ -30,6 +44,7 @@ "module part 1 6;" \ "ramdisk.img part 1 7\0" + #define CONFIG_DFU_ALT_BOOT_EMMC "" #define CONFIG_SET_DFU_ALT_INFO #define CONFIG_SET_DFU_ALT_BUF_LEN (SZ_1K) @@ -41,12 +56,10 @@ #endif /* SD/MMC configuration */ -#define CONFIG_MMC_DEFAULT_DEV 0 +#define CONFIG_MMC_DEFAULT_DEV 1 #define TIZEN_ENV_SETTING \ - "mmcbootdev=0\0" \ "mmcbootpart=1\0" \ - "mmcrootdev=0\0" \ "mmcrootpart=2\0" \ "mmcinformpart=9\0" \ "rebootparamfile=reboot-param.bin\0" \