include: tizen_amlogic: fix hardcoding about device number
authorJaehoon Chung <jh80.chung@samsung.com>
Sun, 10 May 2020 22:36:53 +0000 (07:36 +0900)
committerJaehoon Chung <jh80.chung@samsung.com>
Wed, 4 Nov 2020 03:19:49 +0000 (12:19 +0900)
devnmu will be set to correct value at booting time.
SD   - devnum : 0
eMMC - devnum :1

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
arch/arm/mach-meson/board-common.c
board/amlogic/w400/w400.c
include/samsung/tizen_amlogic.h

index 7ea0ed479474f85907292000e098b2873843d200..b0f6c6886b72f28d3abcf65cc6632db8eec43c34 100644 (file)
@@ -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)
index 4fc1421970b88e946e28063b1fb74e4cf1851bc6..9e2613c37fb0e34a7679388e4e71140263832581 100644 (file)
@@ -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
index 7e513c33e97c51370e97f51df588fcd0a4aaa06b..be2a60e69bf9fb2186fa391be03299d0079ca509 100644 (file)
 #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)
 #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"    \