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>
Tue, 17 Oct 2023 04:19:23 +0000 (13: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 7ceba7c..8b769f5 100644 (file)
@@ -112,6 +112,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:
@@ -124,6 +129,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:
@@ -135,6 +145,7 @@ static void meson_set_boot_source(void)
        }
 
        env_set("boot_source", source);
+
 }
 
 __weak int meson_board_late_init(void)
index 2fc34d6..ec3f35d 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 6d0819e..d5e33e5 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;"         \
        "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)
 
 /* 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"    \