Blackfin: move default boot SPI CS to common code
authorMike Frysinger <vapier@gentoo.org>
Tue, 13 Jan 2009 16:00:29 +0000 (11:00 -0500)
committerMike Frysinger <vapier@gentoo.org>
Fri, 6 Feb 2009 02:25:36 +0000 (21:25 -0500)
Move the default SPI CS that we boot from into common code so that it can
be used in other SPI drivers and environment settings.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
board/bf537-stamp/spi_flash.c
include/asm-blackfin/blackfin-config-pre.h

index b147ce77efd8a3eb075a951f24c12e95a118456b..7b764b497be4941649f186d9976f3d1c96f17147 100644 (file)
@@ -180,13 +180,7 @@ static struct manufacturer_info flash_manufacturers[] = {
  *     BF51x, BF533, BF561: SSEL2
  */
 #ifndef CONFIG_SPI_FLASH_SSEL
-# if defined(__ADSPBF531__) || defined(__ADSPBF532__) || defined(__ADSPBF533__) || \
-     defined(__ADSPBF538__) || defined(__ADSPBF539__) || defined(__ADSPBF561__) || \
-     defined(__ADSPBF51x__)
-#  define CONFIG_SPI_FLASH_SSEL 2
-# else
-#  define CONFIG_SPI_FLASH_SSEL 1
-# endif
+# define CONFIG_SPI_FLASH_SSEL BFIN_BOOT_SPI_SSEL
 #endif
 #define SSEL_MASK (1 << CONFIG_SPI_FLASH_SSEL)
 
index a1fae5c9a7a56fb7be63bc0dcf85c02091e29fee..9df01ad25aaa7f45245eb4c235332c0d5c9016df 100644 (file)
@@ -60,4 +60,13 @@ static inline const char *get_bfin_boot_mode(int bfin_boot)
 }
 #endif
 
+/* Define the default SPI CS used when booting out of SPI */
+#if defined(__ADSPBF531__) || defined(__ADSPBF532__) || defined(__ADSPBF533__) || \
+    defined(__ADSPBF538__) || defined(__ADSPBF539__) || defined(__ADSPBF561__) || \
+    defined(__ADSPBF51x__)
+# define BFIN_BOOT_SPI_SSEL 2
+#else
+# define BFIN_BOOT_SPI_SSEL 1
+#endif
+
 #endif