ldr     r3, =boot_params
        strb    r2, [r3, #BOOT_DEVICE_OFFSET]   @ spl_boot_device <- r1
 
-       /* boot mode is passed only for devices that can raw/fat mode */
-       cmp     r2, #BOOT_DEVICE_XIP
+       /*
+        * boot mode is only valid for device that can be raw or FAT booted.
+        * in other cases it may be fatal to look.  While platforms differ
+        * in the values used for each MMC slot, they are contiguous.
+        */
+       cmp     r2, #MMC_BOOT_DEVICES_START
        blt     2f
-       cmp     r2, #BOOT_DEVICE_MMC2
+       cmp     r2, #MMC_BOOT_DEVICES_END
        bgt     2f
        /* Store the boot mode (raw/FAT) in omap_bootmode */
        ldr     r2, [r0, #DEV_DESC_PTR_OFFSET]  @ get the device descriptor ptr
 
 #define BOOT_DEVICE_USBETH     68
 #define BOOT_DEVICE_CPGMAC     70
 #define BOOT_DEVICE_MMC2_2      0xFF
+
+#define MMC_BOOT_DEVICES_START BOOT_DEVICE_MMC1
+#define MMC_BOOT_DEVICES_END   BOOT_DEVICE_MMC2
 #endif
 
 #define BOOT_DEVICE_MMC1       6
 #define BOOT_DEVICE_XIPWAIT    7
 #define BOOT_DEVICE_MMC2_2      0xFF
+
+#define MMC_BOOT_DEVICES_START BOOT_DEVICE_MMC2
+#define MMC_BOOT_DEVICES_END   BOOT_DEVICE_MMC1
 #endif
 
 #define BOOT_DEVICE_MMC2       6
 #define BOOT_DEVICE_MMC2_2     0xFF
 
+#define MMC_BOOT_DEVICES_START BOOT_DEVICE_MMC1
+#define MMC_BOOT_DEVICES_END   BOOT_DEVICE_MMC2
 #endif
 
 #define BOOT_DEVICE_MMC2        6
 #define BOOT_DEVICE_MMC2_2     7
 
+#define MMC_BOOT_DEVICES_START BOOT_DEVICE_MMC1
+#define MMC_BOOT_DEVICES_END   BOOT_DEVICE_MMC2_2
 #endif