summaryrefslogtreecommitdiffstats
path: root/arch/arm/boards/at91sam9x5ek/init.c
diff options
context:
space:
mode:
authorJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>2012-11-03 12:36:31 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2012-11-15 20:20:29 +0100
commit10b4aade9a83f8a9db5d3d0aed4b709f80c81f32 (patch)
treef262c6ebbb720f8bb1f456c001a52dbeec4d5689 /arch/arm/boards/at91sam9x5ek/init.c
parent5d23be6498e5803cbd4e4b9a1be92b8a8598f139 (diff)
downloadbarebox-10b4aade9a83f8a9db5d3d0aed4b709f80c81f32.tar.gz
barebox-10b4aade9a83f8a9db5d3d0aed4b709f80c81f32.tar.xz
at91sam9x5ek: add spi support
on all the cpu module we have a at25 except on the cogent where we have a at45 Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/boards/at91sam9x5ek/init.c')
-rw-r--r--arch/arm/boards/at91sam9x5ek/init.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/arch/arm/boards/at91sam9x5ek/init.c b/arch/arm/boards/at91sam9x5ek/init.c
index dc8853ee2e..0db17245f1 100644
--- a/arch/arm/boards/at91sam9x5ek/init.c
+++ b/arch/arm/boards/at91sam9x5ek/init.c
@@ -41,6 +41,7 @@
#include <readkey.h>
#include <linux/w1-gpio.h>
#include <w1_mac_address.h>
+#include <spi/spi.h>
#include "hw_version.h"
@@ -134,6 +135,41 @@ static void ek_add_device_i2c(void)
at91_add_device_i2c(0, i2c_devices, ARRAY_SIZE(i2c_devices));
}
+static const struct spi_board_info ek_cm_cogent_spi_devices[] = {
+ {
+ .name = "mtd_dataflash",
+ .chip_select = 0,
+ .max_speed_hz = 15 * 1000 * 1000,
+ .bus_num = 0,
+ }
+};
+
+static const struct spi_board_info ek_spi_devices[] = {
+ {
+ .name = "m25p80",
+ .chip_select = 0,
+ .max_speed_hz = 30 * 1000 * 1000,
+ .bus_num = 0,
+ }
+};
+
+static unsigned spi0_standard_cs[] = { AT91_PIN_PA14};
+static struct at91_spi_platform_data spi_pdata = {
+ .chipselect = spi0_standard_cs,
+ .num_chipselect = ARRAY_SIZE(spi0_standard_cs),
+};
+
+static void ek_add_device_spi(void)
+{
+ if (at91sam9x5ek_cm_is_vendor(VENDOR_COGENT))
+ spi_register_board_info(ek_cm_cogent_spi_devices,
+ ARRAY_SIZE(ek_cm_cogent_spi_devices));
+ else
+ spi_register_board_info(ek_spi_devices,
+ ARRAY_SIZE(ek_spi_devices));
+ at91_add_device_spi(0, &spi_pdata);
+}
+
/*
* USB Host port
*/
@@ -190,6 +226,7 @@ static int at91sam9x5ek_devices_init(void)
ek_add_device_w1();
ek_add_device_nand();
ek_add_device_eth();
+ ek_add_device_spi();
at91_add_device_usbh_ohci(&ek_usbh_data);
ek_add_led();
ek_add_device_i2c();