]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - arch/arm/cpu/armv7/exynos/spl_boot.c
Merge branch 'karo-tx-uboot' into kc-merge
[karo-tx-uboot.git] / arch / arm / cpu / armv7 / exynos / spl_boot.c
index 79166303d13c4bad88cfb0aa6f590c5acb343c13..bc237c969fc9eba89e50fe36eb4164bf283c9a07 100644 (file)
@@ -20,7 +20,6 @@
 #include "clock_init.h"
 
 DECLARE_GLOBAL_DATA_PTR;
-#define OM_STAT         (0x1f << 1)
 
 /* Index into irom ptr table */
 enum index {
@@ -152,7 +151,7 @@ static void exynos_spi_copy(unsigned int uboot_size, unsigned int uboot_addr)
        }
 
        for (upto = 0, i = 0; upto < uboot_size; upto += todo, i++) {
-               todo = min(uboot_size - upto, (1 << 15));
+               todo = min(uboot_size - upto, (unsigned int)(1 << 15));
                spi_rx_tx(regs, todo, (void *)(uboot_addr),
                          (void *)(SPI_FLASH_UBOOT_POS), i);
        }
@@ -184,7 +183,7 @@ static void exynos_spi_copy(unsigned int uboot_size, unsigned int uboot_addr)
 */
 void copy_uboot_to_ram(void)
 {
-       enum boot_mode bootmode = BOOT_MODE_OM;
+       unsigned int bootmode = BOOT_MODE_OM;
 
        u32 (*copy_bl2)(u32 offset, u32 nblock, u32 dst) = NULL;
        u32 offset = 0, size = 0;
@@ -196,10 +195,16 @@ void copy_uboot_to_ram(void)
        void (*end_bootop_from_emmc)(void);
 #endif
 #ifdef CONFIG_USB_BOOTING
-       u32 (*usb_copy)(void);
        int is_cr_z_set;
        unsigned int sec_boot_check;
 
+       /*
+        * Note that older hardware (before Exynos5800) does not expect any
+        * arguments, but it does not hurt to pass them, so a common function
+        * prototype is used.
+        */
+       u32 (*usb_copy)(u32 num_of_block, u32 *dst);
+
        /* Read iRAM location to check for secondary USB boot mode */
        sec_boot_check = readl(EXYNOS_IRAM_SECONDARY_BASE);
        if (sec_boot_check == EXYNOS_USB_SECONDARY_BOOT)
@@ -207,7 +212,7 @@ void copy_uboot_to_ram(void)
 #endif
 
        if (bootmode == BOOT_MODE_OM)
-               bootmode = readl(samsung_get_base_power()) & OM_STAT;
+               bootmode = get_boot_mode();
 
        switch (bootmode) {
 #ifdef CONFIG_SPI_BOOTING
@@ -216,7 +221,7 @@ void copy_uboot_to_ram(void)
                exynos_spi_copy(param->uboot_size, CONFIG_SYS_TEXT_BASE);
                break;
 #endif
-       case BOOT_MODE_MMC:
+       case BOOT_MODE_SD:
                offset = BL2_START_OFFSET;
                size = BL2_SIZE_BLOC_COUNT;
                copy_bl2 = get_irom_func(MMC_INDEX);
@@ -241,7 +246,7 @@ void copy_uboot_to_ram(void)
                 */
                is_cr_z_set = config_branch_prediction(0);
                usb_copy = get_irom_func(USB_INDEX);
-               usb_copy();
+               usb_copy(0, (u32 *)CONFIG_SYS_TEXT_BASE);
                config_branch_prediction(is_cr_z_set);
                break;
 #endif