From: Heiko Schocher Date: Fri, 31 Oct 2014 07:30:56 +0000 (+0100) Subject: arm, at91: add spi dataflash support for the taurus board X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=50921cdc4474dafdcf19db54d7a669781ee5b70f;p=u-boot.git arm, at91: add spi dataflash support for the taurus board Signed-off-by: Heiko Schocher Reviewed-by: Bo Shen Reviewed-by: Jagannadha Sutradharudu Teki Signed-off-by: Andreas Bießmann --- diff --git a/board/siemens/taurus/taurus.c b/board/siemens/taurus/taurus.c index 673b3029a6..76609c7d04 100644 --- a/board/siemens/taurus/taurus.c +++ b/board/siemens/taurus/taurus.c @@ -22,6 +22,8 @@ #include #include #include +#include +#include #include #include @@ -127,6 +129,21 @@ int board_early_init_f(void) return 0; } +int spi_cs_is_valid(unsigned int bus, unsigned int cs) +{ + return bus == 0 && cs == 0; +} + +void spi_cs_activate(struct spi_slave *slave) +{ + at91_set_gpio_value(TAURUS_SPI_CS_PIN, 0); +} + +void spi_cs_deactivate(struct spi_slave *slave) +{ + at91_set_gpio_value(TAURUS_SPI_CS_PIN, 1); +} + int board_init(void) { /* adress of boot parameters */ @@ -139,6 +156,7 @@ int board_init(void) #ifdef CONFIG_MACB taurus_macb_hw_init(); #endif + at91_spi0_hw_init(TAURUS_SPI_MASK); return 0; } diff --git a/include/configs/taurus.h b/include/configs/taurus.h index aadf4cd2f8..ba9496fe5f 100644 --- a/include/configs/taurus.h +++ b/include/configs/taurus.h @@ -127,6 +127,16 @@ #define CONFIG_USB_STORAGE #endif +/* SPI EEPROM */ +#define CONFIG_SPI +#define CONFIG_CMD_SPI +#define CONFIG_CMD_SF +#define CONFIG_SPI_FLASH +#define CONFIG_ATMEL_SPI +#define CONFIG_SPI_FLASH_STMICRO +#define TAURUS_SPI_MASK (1 << 4) +#define TAURUS_SPI_CS_PIN AT91_PIN_PA3 + /* load address */ #define CONFIG_SYS_LOAD_ADDR 0x22000000