diff mbox

[4/6] DaVinci: Enabling SPI0 on the DM365 EVM

Message ID 1247501630-2487-1-git-send-email-s-paulraj@ti.com (mailing list archive)
State Superseded
Headers show

Commit Message

s-paulraj@ti.com July 13, 2009, 4:13 p.m. UTC
From: Sandeep Paulraj <s-paulraj@ti.com>

This patch enables SPI0 on the DM365 EVM.
SPI0 is conencted to an ATMEL EEPROM on the
DM365 EVM

Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
---
 arch/arm/mach-davinci/board-dm365-evm.c |   25 ++++++++++++++++++++++++-
 1 files changed, 24 insertions(+), 1 deletions(-)
diff mbox

Patch

diff --git a/arch/arm/mach-davinci/board-dm365-evm.c b/arch/arm/mach-davinci/board-dm365-evm.c
index f6adf79..59ddb58 100644
--- a/arch/arm/mach-davinci/board-dm365-evm.c
+++ b/arch/arm/mach-davinci/board-dm365-evm.c
@@ -24,6 +24,8 @@ 
 #include <linux/mtd/mtd.h>
 #include <linux/mtd/partitions.h>
 #include <linux/mtd/nand.h>
+#include <linux/spi/spi.h>
+#include <linux/spi/eeprom.h>
 #include <asm/setup.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
@@ -38,7 +40,7 @@ 
 #include <mach/common.h>
 #include <mach/mmc.h>
 #include <mach/nand.h>
-
+#include <mach/spi.h>
 
 static inline int have_imager(void)
 {
@@ -464,6 +466,24 @@  static void __init dm365_evm_map_io(void)
 	dm365_init();
 }
 
+static struct spi_eeprom at25640 = {
+	.byte_len	= SZ_64K / 8,
+	.name		= "at25640",
+	.page_size	= 32,
+	.flags		= EE_ADDR2,
+};
+
+static struct spi_board_info dm365_evm_spi_info[] __initconst = {
+	{
+		.modalias	= "at25",
+		.platform_data	= &at25640,
+		.max_speed_hz	= 10 * 1000 * 1000,	/* at 3v3 */
+		.bus_num	= 0,
+		.chip_select	= 0,
+		.mode		= SPI_MODE_1,
+	},
+};
+
 static __init void dm365_evm_init(void)
 {
 	evm_init_i2c();
@@ -476,6 +496,9 @@  static __init void dm365_evm_init(void)
 
 	/* maybe setup mmc1/etc ... _after_ mmc0 */
 	evm_init_cpld();
+
+	dm365_init_spi0(BIT(0), dm365_evm_spi_info,
+			ARRAY_SIZE(dm365_evm_spi_info));
 }
 
 static __init void dm365_evm_irq_init(void)