From 4b7e3d045cc82f7f7b6f3a19b54a814da36ac52c Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Tue, 13 Jan 2009 11:00:29 -0500 Subject: [PATCH] Blackfin: move default boot SPI CS to common code 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 --- board/bf537-stamp/spi_flash.c | 8 +------- include/asm-blackfin/blackfin-config-pre.h | 9 +++++++++ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/board/bf537-stamp/spi_flash.c b/board/bf537-stamp/spi_flash.c index b147ce77ef..7b764b497b 100644 --- a/board/bf537-stamp/spi_flash.c +++ b/board/bf537-stamp/spi_flash.c @@ -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) diff --git a/include/asm-blackfin/blackfin-config-pre.h b/include/asm-blackfin/blackfin-config-pre.h index a1fae5c9a7..9df01ad25a 100644 --- a/include/asm-blackfin/blackfin-config-pre.h +++ b/include/asm-blackfin/blackfin-config-pre.h @@ -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 -- 2.39.5