]> git.sur5r.net Git - u-boot/commitdiff
odroid: adjust get_dfu_alt_*() functions to new declarations
authorInha Song <ideal.song@samsung.com>
Tue, 17 Feb 2015 11:24:12 +0000 (12:24 +0100)
committerMarek Vasut <marex@denx.de>
Wed, 25 Feb 2015 16:47:02 +0000 (17:47 +0100)
This change is required after updated dfu_alt_system/boot declarations.

Signed-off-by: Inha Song <ideal.song@samsung.com>
Tested-by: Lukasz Majewski <l.majewski@samsung.com>
[Test HW: Odroid U3 (Exynos 4412)]
Acked-by: Minkyu Kang <mk7.kang@samsung.com>
board/samsung/odroid/odroid.c

index bff6ac928ca4ce376b0ce278194f022fbc9b07f7..6f4b8caea545149505ace8d7da6fd22a3f335732 100644 (file)
@@ -15,6 +15,7 @@
 #include <power/pmic.h>
 #include <power/max77686_pmic.h>
 #include <errno.h>
+#include <mmc.h>
 #include <usb.h>
 #include <usb/s3c_udc.h>
 #include <samsung/misc.h>
@@ -61,27 +62,29 @@ const char *get_board_type(void)
 #endif
 
 #ifdef CONFIG_SET_DFU_ALT_INFO
-char *get_dfu_alt_system(void)
+char *get_dfu_alt_system(char *interface, char *devstr)
 {
        return getenv("dfu_alt_system");
 }
 
-char *get_dfu_alt_boot(void)
+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 = IS_SD(mmc) ? CONFIG_DFU_ALT_BOOT_SD :
+                               CONFIG_DFU_ALT_BOOT_EMMC;
 
-       switch (get_boot_mode()) {
-       case BOOT_MODE_SD:
-               alt_boot = CONFIG_DFU_ALT_BOOT_SD;
-               break;
-       case BOOT_MODE_EMMC:
-       case BOOT_MODE_EMMC_SD:
-               alt_boot = CONFIG_DFU_ALT_BOOT_EMMC;
-               break;
-       default:
-               alt_boot = NULL;
-               break;
-       }
        return alt_boot;
 }
 #endif