mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: "Eric Bénard" <eric@eukrea.com>
To: barebox@lists.infradead.org
Subject: [PATCH] i.MX35: add cspi1 support
Date: Tue, 28 Aug 2012 23:35:17 +0200	[thread overview]
Message-ID: <1346189717-10476-1-git-send-email-eric@eukrea.com> (raw)

tested with a m25p128 flash both in nand boot & spi boot.

Signed-off-by: Eric Bénard <eric@eukrea.com>
---
 arch/arm/mach-imx/include/mach/devices-imx35.h |    5 +++++
 arch/arm/mach-imx/include/mach/imx35-regs.h    |    2 ++
 arch/arm/mach-imx/speed-imx35.c                |    5 +++++
 drivers/spi/Kconfig                            |    2 +-
 drivers/spi/imx_spi.c                          |    2 +-
 5 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-imx/include/mach/devices-imx35.h b/arch/arm/mach-imx/include/mach/devices-imx35.h
index 6c0d750..9ecaa35 100644
--- a/arch/arm/mach-imx/include/mach/devices-imx35.h
+++ b/arch/arm/mach-imx/include/mach/devices-imx35.h
@@ -16,6 +16,11 @@ static inline struct device_d *imx35_add_i2c2(struct i2c_platform_data *pdata)
 	return imx_add_i2c((void *)IMX_I2C3_BASE, 2, pdata);
 }
 
+static inline struct device_d *imx35_add_spi0(struct spi_imx_master *pdata)
+{
+	return imx_add_spi((void *)IMX_CSPI1_BASE, 0, pdata);
+}
+
 static inline struct device_d *imx35_add_uart0(void)
 {
 	return imx_add_uart((void *)IMX_UART1_BASE, 0);
diff --git a/arch/arm/mach-imx/include/mach/imx35-regs.h b/arch/arm/mach-imx/include/mach/imx35-regs.h
index fafcd61..91d4b9b 100644
--- a/arch/arm/mach-imx/include/mach/imx35-regs.h
+++ b/arch/arm/mach-imx/include/mach/imx35-regs.h
@@ -49,6 +49,7 @@
 #define IMX_I2C1_BASE		0x43F80000
 #define IMX_I2C2_BASE		0x43F98000
 #define IMX_I2C3_BASE		0x43F84000
+#define IMX_CSPI1_BASE		0x43FA4000
 #define IMX_SDHC1_BASE		0x53FB4000
 #define IMX_SDHC2_BASE		0x53FB8000
 #define IMX_SDHC3_BASE		0x53FBC000
@@ -75,6 +76,7 @@
 #define CCM_CGR2	0x34
 #define CCM_CGR3	0x38
 
+#define CCM_CGR0_CSPI1_SHIFT	10
 #define CCM_CGR1_FEC_SHIFT	0
 #define CCM_CGR1_I2C1_SHIFT	10
 #define CCM_CGR1_SDHC1_SHIFT	26
diff --git a/arch/arm/mach-imx/speed-imx35.c b/arch/arm/mach-imx/speed-imx35.c
index 684dc14..5f0e229 100644
--- a/arch/arm/mach-imx/speed-imx35.c
+++ b/arch/arm/mach-imx/speed-imx35.c
@@ -186,6 +186,11 @@ ulong imx_get_i2cclk(void)
 	return imx_get_ipg_perclk();
 }
 
+unsigned long imx_get_cspiclk(void)
+{
+	return imx_get_ipgclk();
+}
+
 void imx_dump_clocks(void)
 {
 	printf("mpll:    %10ld Hz\n", imx_get_mpllclk());
diff --git a/drivers/spi/Kconfig b/drivers/spi/Kconfig
index 609bafd..7a2f54a 100644
--- a/drivers/spi/Kconfig
+++ b/drivers/spi/Kconfig
@@ -16,7 +16,7 @@ config DRIVER_SPI_IMX_0_0
 
 config DRIVER_SPI_IMX_0_7
 	bool
-	depends on ARCH_IMX25
+	depends on ARCH_IMX25 || ARCH_IMX35
 	default y
 
 config DRIVER_SPI_IMX_2_3
diff --git a/drivers/spi/imx_spi.c b/drivers/spi/imx_spi.c
index 42358f2..06cee86 100644
--- a/drivers/spi/imx_spi.c
+++ b/drivers/spi/imx_spi.c
@@ -517,7 +517,7 @@ static int imx_spi_probe(struct device_d *dev)
 		version = SPI_IMX_VER_0_0;
 #endif
 #ifdef CONFIG_DRIVER_SPI_IMX_0_7
-	if (cpu_is_mx25())
+	if (cpu_is_mx25() || cpu_is_mx35())
 		version = SPI_IMX_VER_0_7;
 #endif
 #ifdef CONFIG_DRIVER_SPI_IMX_2_3
-- 
1.7.7.6


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

             reply	other threads:[~2012-08-28 21:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-28 21:35 Eric Bénard [this message]
2012-08-29  7:00 ` Sascha Hauer

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=1346189717-10476-1-git-send-email-eric@eukrea.com \
    --to=eric@eukrea.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