mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH 1/1] at91sam9m10g45ek: add spi dataflash supprt
@ 2013-04-15 12:28 Jean-Christophe PLAGNIOL-VILLARD
  2013-04-16 12:50 ` Sascha Hauer
  0 siblings, 1 reply; 2+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2013-04-15 12:28 UTC (permalink / raw)
  To: barebox

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
 arch/arm/boards/at91sam9m10g45ek/init.c     |   18 ++++++++++++++++++
 arch/arm/configs/at91sam9m10g45ek_defconfig |    4 +++-
 2 files changed, 21 insertions(+), 1 deletion(-)

diff --git a/arch/arm/boards/at91sam9m10g45ek/init.c b/arch/arm/boards/at91sam9m10g45ek/init.c
index f32215d..d9a2f1f 100644
--- a/arch/arm/boards/at91sam9m10g45ek/init.c
+++ b/arch/arm/boards/at91sam9m10g45ek/init.c
@@ -38,6 +38,7 @@
 #include <mach/at91sam9_smc.h>
 #include <gpio_keys.h>
 #include <readkey.h>
+#include <spi/spi.h>
 
 /*
  * board revision encoding
@@ -125,6 +126,22 @@ static void ek_add_device_mci(void)
 static void ek_add_device_mci(void) {}
 #endif
 
+static const struct spi_board_info ek_spi_devices[] = {
+	{
+		.name		= "mtd_dataflash",
+		.chip_select	= 0,
+		.max_speed_hz	= 15 * 1000 * 1000,
+		.bus_num	= 0,
+	}
+};
+
+static void ek_add_device_spi(void)
+{
+	spi_register_board_info(ek_spi_devices,
+			ARRAY_SIZE(ek_spi_devices));
+	at91_add_device_spi(0, NULL);
+}
+
 #ifdef CONFIG_LED_GPIO
 struct gpio_led ek_leds[] = {
 	{
@@ -281,6 +298,7 @@ static void ek_add_device_lcdc(void) {}
 static int at91sam9m10g45ek_devices_init(void)
 {
 	ek_add_device_nand();
+	ek_add_device_spi();
 	at91_add_device_eth(0, &macb_pdata);
 	ek_add_device_mci();
 	ek_add_device_usb();
diff --git a/arch/arm/configs/at91sam9m10g45ek_defconfig b/arch/arm/configs/at91sam9m10g45ek_defconfig
index 1df34f7..7e05e95 100644
--- a/arch/arm/configs/at91sam9m10g45ek_defconfig
+++ b/arch/arm/configs/at91sam9m10g45ek_defconfig
@@ -64,8 +64,10 @@ CONFIG_NET_RESOLV=y
 CONFIG_DRIVER_NET_MACB=y
 CONFIG_NET_USB=y
 CONFIG_NET_USB_ASIX=y
-# CONFIG_SPI is not set
+CONFIG_DRIVER_SPI_ATMEL=y
 CONFIG_MTD=y
+# CONFIG_MTD_OOB_DEVICE is not set
+CONFIG_MTD_DATAFLASH=y
 CONFIG_NAND=y
 # CONFIG_NAND_ECC_HW is not set
 # CONFIG_NAND_ECC_HW_SYNDROME is not set
-- 
1.7.10.4


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-04-16 12:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-15 12:28 [PATCH 1/1] at91sam9m10g45ek: add spi dataflash supprt Jean-Christophe PLAGNIOL-VILLARD
2013-04-16 12:50 ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox