From: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
To: barebox@lists.infradead.org
Subject: [PATCH 3/5] at91sam9261ek: add spi support
Date: Sat, 26 Jan 2013 19:19:57 +0100 [thread overview]
Message-ID: <1359224399-569-3-git-send-email-plagnioj@jcrosoft.com> (raw)
In-Reply-To: <1359224399-569-1-git-send-email-plagnioj@jcrosoft.com>
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
arch/arm/boards/at91sam9261ek/init.c | 42 ++++++++++++++++++++++++++++++
arch/arm/configs/at91sam9261ek_defconfig | 3 ++-
arch/arm/mach-at91/Kconfig | 1 +
3 files changed, 45 insertions(+), 1 deletion(-)
diff --git a/arch/arm/boards/at91sam9261ek/init.c b/arch/arm/boards/at91sam9261ek/init.c
index 7c95435..ef13828 100644
--- a/arch/arm/boards/at91sam9261ek/init.c
+++ b/arch/arm/boards/at91sam9261ek/init.c
@@ -37,6 +37,7 @@
#include <gpio_keys.h>
#include <readkey.h>
#include <led.h>
+#include <spi/spi.h>
static struct atmel_nand_data nand_pdata = {
.ale = 22,
@@ -229,6 +230,46 @@ static void ek_device_add_leds(void)
static void ek_device_add_leds(void) {}
#endif
+/*
+ * SPI related devices
+ */
+#if defined(CONFIG_DRIVER_SPI_ATMEL)
+/*
+ * SPI devices
+ */
+static struct spi_board_info ek_spi_devices[] = {
+ { /* DataFlash chip */
+ .name = "mtd_dataflash",
+ .chip_select = 0,
+ .max_speed_hz = 15 * 1000 * 1000,
+ .bus_num = 0,
+ },
+#if defined(CONFIG_MTD_AT91_DATAFLASH_CARD)
+ { /* DataFlash card - jumper (J12) configurable to CS3 or CS0 */
+ .name = "mtd_dataflash",
+ .chip_select = 1,
+ .max_speed_hz = 15 * 1000 * 1000,
+ .bus_num = 0,
+ },
+#endif
+};
+
+static unsigned spi0_standard_cs[] = { AT91_PIN_PA3, AT91_PIN_PA6};
+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)
+{
+ spi_register_board_info(ek_spi_devices,
+ ARRAY_SIZE(ek_spi_devices));
+ at91_add_device_spi(0, &spi_pdata);
+}
+#else
+static void ek_add_device_spi(void) {}
+#endif
+
static int at91sam9261ek_mem_init(void)
{
at91_add_device_sdram(0);
@@ -245,6 +286,7 @@ static int at91sam9261ek_devices_init(void)
ek_add_device_udc();
ek_add_device_buttons();
ek_device_add_leds();
+ ek_add_device_spi();
devfs_add_partition("nand0", 0x00000, SZ_128K, DEVFS_PARTITION_FIXED, "at91bootstrap_raw");
devfs_add_partition("nand0", SZ_128K, SZ_256K, DEVFS_PARTITION_FIXED, "self_raw");
diff --git a/arch/arm/configs/at91sam9261ek_defconfig b/arch/arm/configs/at91sam9261ek_defconfig
index 5daa47b..259e060 100644
--- a/arch/arm/configs/at91sam9261ek_defconfig
+++ b/arch/arm/configs/at91sam9261ek_defconfig
@@ -51,9 +51,10 @@ CONFIG_CMD_TFTP=y
CONFIG_FS_TFTP=y
CONFIG_NET_RESOLV=y
CONFIG_DRIVER_NET_DM9K=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
diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
index 661ff35..a964fd6 100644
--- a/arch/arm/mach-at91/Kconfig
+++ b/arch/arm/mach-at91/Kconfig
@@ -266,6 +266,7 @@ choice
config MACH_AT91SAM9261EK
bool "Atmel AT91SAM9261-EK Evaluation Kit"
select HAS_DM9000
+ select HAVE_AT91_DATAFLASH_CARD
select HAVE_NAND_ATMEL_BUSWIDTH_16
help
Select this if you are using Atmel's AT91SAM9261-EK Evaluation Kit.
--
1.7.10.4
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2013-01-26 18:21 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-26 18:18 [PATCH 0/5] at91sam9261: add bootstrap and firstage support Jean-Christophe PLAGNIOL-VILLARD
2013-01-26 18:19 ` [PATCH 1/5] at91sam9260/9g20/9261/9g10/9263: split soc lowlevel_init from generic Jean-Christophe PLAGNIOL-VILLARD
2013-01-26 18:19 ` [PATCH 2/5] at91: introduce AT91_LOAD_BAREBOX_SRAM to specifcy which size load for external boot Jean-Christophe PLAGNIOL-VILLARD
2013-01-26 18:19 ` Jean-Christophe PLAGNIOL-VILLARD [this message]
2013-01-26 18:19 ` [PATCH 4/5] at91sam9261ek: add boostrap support Jean-Christophe PLAGNIOL-VILLARD
2013-01-26 18:19 ` [PATCH 5/5] at91sam9261ek: add first stage support Jean-Christophe PLAGNIOL-VILLARD
2013-01-26 21:59 ` Sascha Hauer
2013-01-26 23:14 ` Jean-Christophe PLAGNIOL-VILLARD
2013-01-31 13:22 ` Jean-Christophe PLAGNIOL-VILLARD
2013-01-31 13:23 ` [PATCH 0/5] at91sam9261: add bootstrap and firstage support Jean-Christophe PLAGNIOL-VILLARD
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1359224399-569-3-git-send-email-plagnioj@jcrosoft.com \
--to=plagnioj@jcrosoft.com \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox