From 8e952cbb5153948f65e81a09a68bf8e0568a7eb2 Mon Sep 17 00:00:00 2001 From: Wenyou Yang Date: Thu, 14 Sep 2017 11:07:43 +0800 Subject: [PATCH] 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 --- arch/arm/mach-at91/spl.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/arch/arm/mach-at91/spl.c b/arch/arm/mach-at91/spl.c index 98337aebbe..7e7e24bbe6 100644 --- a/arch/arm/mach-at91/spl.c +++ b/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; -- 2.39.5