ARM: at91: spl: Add macro CONFIG_XXXX_BOOT support

Use the CONFIG_XXXX_BOOT to indicate the boot media, instead of
the CONFIG_SYS_USE_XXXX option, which is declared by
CONFIG_SYS_EXTRA_OPTIONS option.

Signed-off-by: Wenyou Yang <wenyou.yang@microchip.com>
master
Wenyou Yang 7 years ago committed by Tom Rini
parent e61ed48ff5
commit a35c34025e
  1. 16
      arch/arm/mach-at91/spl.c

@ -37,7 +37,7 @@ u32 spl_boot_device(void)
u32 off = (bootrom_stash.r4 >> ATMEL_SAMA5_BOOT_DEV_ID_OFF) &
ATMEL_SAMA5_BOOT_DEV_ID_MASK;
#if defined(CONFIG_SYS_USE_MMC)
#if defined(CONFIG_SYS_USE_MMC) || defined(CONFIG_SD_BOOT)
if (dev == ATMEL_SAMA5_BOOT_FROM_MCI) {
#if defined(CONFIG_SPL_OF_CONTROL)
return BOOT_DEVICE_MMC1;
@ -52,7 +52,9 @@ u32 spl_boot_device(void)
}
#endif
#if defined(CONFIG_SYS_USE_SERIALFLASH) || defined(CONFIG_SYS_USE_SPIFLASH)
#if defined(CONFIG_SYS_USE_SERIALFLASH) || \
defined(CONFIG_SYS_USE_SPIFLASH) || \
defined(CONFIG_SPI_BOOT)
if (dev == ATMEL_SAMA5_BOOT_FROM_SPI)
return BOOT_DEVICE_SPI;
#endif
@ -73,11 +75,13 @@ u32 spl_boot_device(void)
#else
u32 spl_boot_device(void)
{
#ifdef CONFIG_SYS_USE_MMC
#if defined(CONFIG_SYS_USE_MMC) || defined(CONFIG_SD_BOOT)
return BOOT_DEVICE_MMC1;
#elif CONFIG_SYS_USE_NANDFLASH
#elif defined(CONFIG_SYS_USE_NANDFLASH) || defined(CONFIG_NAND_BOOT)
return BOOT_DEVICE_NAND;
#elif CONFIG_SYS_USE_SERIALFLASH || CONFIG_SYS_USE_SPIFLASH
#elif defined(CONFIG_SYS_USE_SERIALFLASH) || \
defined(CONFIG_SYS_USE_SPIFLASH) || \
defined(CONFIG_SPI_BOOT)
return BOOT_DEVICE_SPI;
#endif
return BOOT_DEVICE_NONE;
@ -87,7 +91,7 @@ u32 spl_boot_device(void)
u32 spl_boot_mode(const u32 boot_device)
{
switch (boot_device) {
#ifdef CONFIG_SYS_USE_MMC
#if defined(CONFIG_SYS_USE_MMC) || defined(CONFIG_SD_BOOT)
case BOOT_DEVICE_MMC1:
case BOOT_DEVICE_MMC2:
return MMCSD_MODE_FS;

Loading…
Cancel
Save