return 0;
}
-
-#ifdef CONFIG_SET_DFU_ALT_INFO
-#include <mmc.h>
-#include <config.h>
-#include <memalign.h>
-static char *get_dfu_alt_system(char *interface, char *devstr)
-{
- if (!strncmp(devstr, "0", 1))
- return env_get("dfu_alt_system_sd");
- else
- return env_get("dfu_alt_system");
-}
-
-static char *get_dfu_alt_boot(char *interface, char *devstr)
-{
- struct mmc *mmc;
- char *alt_boot;
- int dev_num;
-
- dev_num = simple_strtoul(devstr, NULL, 10);
-
- mmc = find_mmc_device(dev_num);
- if (!mmc)
- return NULL;
-
- if (mmc_init(mmc))
- return NULL;
-
- if (CONFIG_IS_ENABLED(TIZEN_CONFIG_N2))
- alt_boot = DFU_ALT_BOOT_EMMC_ODROID_N2;
- else
- alt_boot = DFU_ALT_BOOT_EMMC_ODROID_C4;
-
- return alt_boot;
-}
-
-void set_dfu_alt_info(char *interface, char *devstr)
-{
- size_t buf_size = CONFIG_SET_DFU_ALT_BUF_LEN;
- ALLOC_CACHE_ALIGN_BUFFER(char, buf, buf_size);
- char *alt_info = "Settings not found!";
- char *status = "error!\n";
- char *alt_setting;
- char *alt_sep;
- int offset = 0;
-
- puts("DFU alt info setting: ");
-
- alt_setting = get_dfu_alt_boot(interface, devstr);
- if (alt_setting) {
- env_set("dfu_alt_boot", alt_setting);
- offset = snprintf(buf, buf_size, "%s", alt_setting);
- }
-
- alt_setting = get_dfu_alt_system(interface, devstr);
- if (alt_setting) {
- if (offset)
- alt_sep = ";";
- else
- alt_sep = "";
-
- offset += snprintf(buf + offset, buf_size - offset,
- "%s%s", alt_sep, alt_setting);
- }
-
- if (offset) {
- alt_info = buf;
- status = "done\n";
- }
-
- env_set("dfu_alt_info", alt_info);
-
- puts(status);
-}
-#endif
return 0;
}
-
-#ifdef CONFIG_SET_DFU_ALT_INFO
-#include <mmc.h>
-#include <config.h>
-#include <memalign.h>
-static char *get_dfu_alt_system(char *interface, char *devstr)
-{
- if (!strncmp(devstr, "0", 1))
- return env_get("dfu_alt_system_sd");
- else
- return env_get("dfu_alt_system");
-}
-
-static char *get_dfu_alt_boot(char *interface, char *devstr)
-{
- struct mmc *mmc;
- char *alt_boot;
- int dev_num;
-
- dev_num = simple_strtoul(devstr, NULL, 10);
-
- mmc = find_mmc_device(dev_num);
- if (!mmc)
- return NULL;
-
- if (mmc_init(mmc))
- return NULL;
-
- alt_boot = DFU_ALT_BOOT_EMMC_KVIM3;
-
- return alt_boot;
-}
-
-void set_dfu_alt_info(char *interface, char *devstr)
-{
- size_t buf_size = CONFIG_SET_DFU_ALT_BUF_LEN;
- ALLOC_CACHE_ALIGN_BUFFER(char, buf, buf_size);
- char *alt_info = "Settings not found!";
- char *status = "error!\n";
- char *alt_setting;
- char *alt_sep;
- int offset = 0;
-
- puts("DFU alt info setting: ");
-
- alt_setting = get_dfu_alt_boot(interface, devstr);
- if (alt_setting) {
- env_set("dfu_alt_boot", alt_setting);
- offset = snprintf(buf, buf_size, "%s", alt_setting);
- }
-
- alt_setting = get_dfu_alt_system(interface, devstr);
- if (alt_setting) {
- if (offset)
- alt_sep = ";";
- else
- alt_sep = "";
-
- offset += snprintf(buf + offset, buf_size - offset,
- "%s%s", alt_sep, alt_setting);
- }
-
- if (offset) {
- alt_info = buf;
- status = "done\n";
- }
-
- env_set("dfu_alt_info", alt_info);
-
- puts(status);
-}
-#endif
#define CONFIG_SYS_MEM_TOP_HIDE 0x08000000
/* DFU */
-/* For SD */
-#define DFU_ALT_SYSTEM_SD \
- "Image.gz fat 0 1;" \
- "meson64_odroidn2_drm.dtb fat 0 1;" \
- "meson64_odroidn2.dtb fat 0 1;" \
- "meson64_odroidc4.dtb fat 0 1;" \
- "kvim3_linux.dtb fat 0 1;" \
- "boot.scr.uimg fat 0 1;" \
- "params.bin fat 0 1;" \
- "vim3/Image.gz fat 0 1;" \
- "odroid-n2/Image.gz fat 0 1;" \
- "odroid-c4/Image.gz fat 0 1;" \
- "vim3/params.bin fat 0 1;" \
- "odroid-n2/params.bin fat 0 1;" \
- "odroid-c4/params.bin fat 0 1;" \
- "vim3/boot.scr.uimg fat 0 1;" \
- "odroid-n2/boot.scr.uimg fat 0 1;" \
- "odroid-c4/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;" \
- "ramdisk-recovery.img part 0 8\0"
+#define DFU_ALT_SYSTEM \
+ "Image.gz fat -1 1;" \
+ "meson64_odroidn2_drm.dtb fat -1 1;" \
+ "meson64_odroidn2.dtb fat -1 1;" \
+ "meson64_odroidc4.dtb fat -1 1;" \
+ "kvim3_linux.dtb fat -1 1;" \
+ "boot.scr.uimg fat -1 1;" \
+ "params.bin fat -1 1;" \
+ "vim3/Image.gz fat -1 1;" \
+ "odroid-n2/Image.gz fat -1 1;" \
+ "odroid-c4/Image.gz fat -1 1;" \
+ "vim3/params.bin fat -1 1;" \
+ "odroid-n2/params.bin fat -1 1;" \
+ "odroid-c4/params.bin fat -1 1;" \
+ "vim3/boot.scr.uimg fat -1 1;" \
+ "odroid-n2/boot.scr.uimg fat -1 1;" \
+ "odroid-c4/boot.scr.uimg fat -1 1;" \
+ "boot.img part -1 1;" \
+ "rootfs part -1 2;" \
+ "system-data part -1 3;" \
+ "user part -1 5;" \
+ "module part -1 6;" \
+ "ramdisk.img part -1 7;" \
+ "ramdisk-recovery.img part -1 8"
-/* For eMMC */
-#define DFU_ALT_SYSTEM \
- "Image.gz fat 1 1;" \
- "meson64_odroidn2_drm.dtb fat 1 1;" \
- "meson64_odroidn2.dtb fat 1 1;" \
- "meson64_odroidc4.dtb fat 1 1;" \
- "kvim3_linux.dtb fat 1 1;" \
- "boot.scr.uimg fat 1 1;" \
- "boot.img part 1 1;" \
- "params.bin fat 1 1;" \
- "vim3/Image.gz fat 1 1;" \
- "odroid-n2/Image.gz fat 1 1;" \
- "odroid-c4/Image.gz fat 1 1;" \
- "vim3/params.bin fat 1 1;" \
- "odroid-n2/params.bin fat 1 1;" \
- "odroid-c4/params.bin fat 1 1;" \
- "vim3/boot.scr.uimg fat 1 1;" \
- "odroid-n2/boot.scr.uimg fat 1 1;" \
- "odroid-c4/boot.scr.uimg fat 1 1;" \
- "rootfs part 1 2;" \
- "system-data part 1 3;" \
- "user part 1 5;" \
- "module part 1 6;" \
- "ramdisk.img part 1 7;" \
- "ramdisk-recovery.img part 1 8\0"
-
-
-#define DFU_ALT_BOOT_EMMC_ODROID_N2 "u-boot.bin raw 0x1 0x850;" \
- "u-boot-n2.bin raw 0x1 0x850;" \
+#define DFU_ALT_BOOT_ODROID_N2 "u-boot.bin raw 0x1 0x850;" \
+ "u-boot-n2.bin raw 0x1 0x850;" \
"u-boot-c4.bin skip 0 0;" \
"u-boot-kvim3.bin skip 0 0"
-#define DFU_ALT_BOOT_EMMC_KVIM3 "u-boot.bin raw 0x1 0x850;" \
- "u-boot-kvim3.bin raw 0x1 0x850;" \
+#define DFU_ALT_BOOT_KVIM3 "u-boot.bin raw 0x1 0x850;" \
+ "u-boot-kvim3.bin raw 0x1 0x850;" \
"u-boot-c4.bin skip 0 0;" \
"u-boot-n2.bin skip 0 0"
-#define DFU_ALT_BOOT_EMMC_ODROID_C4 "u-boot.bin raw 0x1 0x850;" \
+#define DFU_ALT_BOOT_ODROID_C4 "u-boot.bin raw 0x1 0x850;" \
"u-boot-c4.bin raw 0x1 0x850;" \
"u-boot-kvim3.bin skip 0 0;" \
"u-boot-n2.bin skip 0 0"
-#define DFU_ALT_BOOT_SD ""
#define CONFIG_SET_DFU_ALT_BUF_LEN (SZ_1K)
/* DFU over USB/UDC */
#ifdef CONFIG_TIZEN_KHADAS_VIM3
#define TIZEN_BOOT_PREFIX "/vim3/ /"
+#define DFU_ALT_BOOT DFU_ALT_BOOT_VIM3
#elif CONFIG_TIZEN_ODROID_N2
#define TIZEN_BOOT_PREFIX "/odroid-n2/ /"
+#define DFU_ALT_BOOT DFU_ALT_BOOT_ODROID_N2
#elif CONFIG_TIZEN_ODROID_C4
#define TIZEN_BOOT_PREFIX "/odroid-c4/ /"
+#define DFU_ALT_BOOT DFU_ALT_BOOT_ODROID_C4
#else
#define TIZEN_BOOT_PREFIX "/ /boot/"
+#define DFU_ALT_BOOT "u-boot.bin skip 0 0"
#endif
#define TIZEN_ENV_SETTING \
"bootmode=ramdisk\0" \
"bootdev=mmc\0" \
"tfm=setenv bootmode download; run bootcmd\0" \
- "dfu_alt_system="DFU_ALT_SYSTEM \
- "dfu_alt_system_sd="DFU_ALT_SYSTEM_SD \
+ "dfu_alt_info=" DFU_ALT_SYSTEM ";" DFU_ALT_BOOT "\0"\
"fdt_high=0x20000000\0" \
"initrd_high=0x3d800000\0" \
"opts=loglevel=4\0" \