From 2e7771568dc2fa5b3ac256a45bcb5d2f24f75996 Mon Sep 17 00:00:00 2001 From: Jaehoon Chung Date: Mon, 11 May 2020 07:36:53 +0900 Subject: [PATCH] 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 --- arch/arm/mach-meson/board-common.c | 11 +++++++++++ board/amlogic/w400/w400.c | 6 +++++- include/samsung/tizen_amlogic.h | 21 +++++++++++++++++---- 3 files changed, 33 insertions(+), 5 deletions(-) diff --git a/arch/arm/mach-meson/board-common.c b/arch/arm/mach-meson/board-common.c index 7ceba7c..8b769f5 100644 --- a/arch/arm/mach-meson/board-common.c +++ b/arch/arm/mach-meson/board-common.c @@ -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) diff --git a/board/amlogic/w400/w400.c b/board/amlogic/w400/w400.c index 2fc34d6..ec3f35d 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 6d0819e..d5e33e5 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,17 +44,16 @@ "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" \ -- 2.7.4