summaryrefslogtreecommitdiffstats
path: root/board
diff options
context:
space:
mode:
authorWolfgang Denk <wd@denx.de>2008-07-07 00:39:43 +0200
committerWolfgang Denk <wd@denx.de>2008-07-07 00:39:43 +0200
commitb223017f081d7e0daa33ad17a3cd05b0c1f7d9ba (patch)
tree1dd125cc150e22b887d06a31334685cdb9d59e98 /board
parent3070a9a3cb41ed6b19f79590f7713d5685ab1066 (diff)
parent5f723a3b98c630bde33de74351f2121691fdef14 (diff)
downloadu-boot-b223017f081d7e0daa33ad17a3cd05b0c1f7d9ba.tar.gz
u-boot-b223017f081d7e0daa33ad17a3cd05b0c1f7d9ba.tar.xz
u-boot-b223017f081d7e0daa33ad17a3cd05b0c1f7d9ba.zip
Merge branch 'master' of git://www.denx.de/git/u-boot-avr32
Diffstat (limited to 'board')
-rw-r--r--board/atmel/atngw100/atngw100.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/board/atmel/atngw100/atngw100.c b/board/atmel/atngw100/atngw100.c
index 375f0e7e17..f2c3e79799 100644
--- a/board/atmel/atngw100/atngw100.c
+++ b/board/atmel/atngw100/atngw100.c
@@ -60,6 +60,9 @@ int board_early_init_f(void)
#if defined(CONFIG_MMC)
gpio_enable_mmci();
#endif
+#if defined(CONFIG_ATMEL_SPI)
+ gpio_enable_spi0(1 << 0);
+#endif
return 0;
}
@@ -89,3 +92,25 @@ void board_init_info(void)
gd->bd->bi_phy_id[0] = 0x01;
gd->bd->bi_phy_id[1] = 0x03;
}
+
+/* SPI chip select control */
+#ifdef CONFIG_ATMEL_SPI
+#include <spi.h>
+
+#define ATNGW100_DATAFLASH_CS_PIN GPIO_PIN_PA3
+
+int spi_cs_is_valid(unsigned int bus, unsigned int cs)
+{
+ return bus == 0 && cs == 0;
+}
+
+void spi_cs_activate(struct spi_slave *slave)
+{
+ gpio_set_value(ATNGW100_DATAFLASH_CS_PIN, 0);
+}
+
+void spi_cs_deactivate(struct spi_slave *slave)
+{
+ gpio_set_value(ATNGW100_DATAFLASH_CS_PIN, 1);
+}
+#endif /* CONFIG_ATMEL_SPI */