USB: DM: Convert i.MX5 ehci code to driver model
[oweals/u-boot.git] / arch / arm / mach-mvebu / spl.c
index d16a62d2dd32f8d8d51369c664d1716b770f2c08..9dd7c84b6874d6ba09729279a2227276463e3c9a 100644 (file)
@@ -1,7 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Copyright (C) 2014-2016 Stefan Roese <sr@denx.de>
- *
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
@@ -26,17 +25,18 @@ static u32 get_boot_device(void)
        val = readl(CONFIG_BOOTROM_ERR_REG);
        boot_device = (val & BOOTROM_ERR_MODE_MASK) >> BOOTROM_ERR_MODE_OFFS;
        debug("BOOTROM_REG=0x%08x boot_device=0x%x\n", val, boot_device);
-#if defined(CONFIG_ARMADA_38X)
+       if (boot_device == BOOTROM_ERR_MODE_UART)
+               return BOOT_DEVICE_UART;
+
+#ifdef CONFIG_ARMADA_38X
        /*
-        * If the bootrom error register contains any else than zeros
-        * in the first 8 bits it's an error condition. And in that case
-        * try to boot from UART.
+        * If the bootrom error code contains any other than zeros it's an
+        * error condition and the bootROM has fallen back to UART boot
         */
+       boot_device = (val & BOOTROM_ERR_CODE_MASK) >> BOOTROM_ERR_CODE_OFFS;
        if (boot_device)
-#else
-       if (boot_device == BOOTROM_ERR_MODE_UART)
-#endif
                return BOOT_DEVICE_UART;
+#endif
 
        /*
         * Now check the SAR register for the strapped boot-device
@@ -70,13 +70,6 @@ u32 spl_boot_device(void)
        return get_boot_device();
 }
 
-#ifdef CONFIG_SPL_MMC_SUPPORT
-u32 spl_boot_mode(const u32 boot_device)
-{
-       return MMCSD_MODE_RAW;
-}
-#endif
-
 void board_init_f(ulong dummy)
 {
        int ret;