[U-Boot,v3,4/5] ARM: at91: spl: Add macro CONFIG_XXXX_BOOT support

Message ID 20170914030744.8956-5-wenyou.yang@microchip.com
State Accepted
Delegated to: Tom Rini
Headers show
Series
  • configs: at91: Remove value of CONFIG_SYS_EXTRA_OPTIONS option
Related show

Commit Message

Wenyou Yang Sept. 14, 2017, 3:07 a.m.
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>
---

Changes in v3: None
Changes in v2: None

 arch/arm/mach-at91/spl.c | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

Comments

Tom Rini Sept. 15, 2017, 12:48 a.m. | #1
On Thu, Sep 14, 2017 at 11:07:43AM +0800, Wenyou Yang wrote:

> 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>

Applied to u-boot/master, thanks!

Patch

diff --git a/arch/arm/mach-at91/spl.c b/arch/arm/mach-at91/spl.c
index e113336b7b..c2e2d90a89 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
@@ -71,11 +73,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;
@@ -85,7 +89,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;