Skip to contentSkip to conversation

i.MX35: add cspi1 support

PATCH Applied Eric Bénard 2 participants 2 messages Aug 28, 2012 – Aug 29, 2012

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 i.MX35: add cspi1 support

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

---
 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(-)
arch/arm/mach-imx/include/mach/devices-imx35.h +5 -0
index 6c0d750..9ecaa35 100644
@@ -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);
arch/arm/mach-imx/include/mach/imx35-regs.h +2 -0
index fafcd61..91d4b9b 100644
@@ -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
arch/arm/mach-imx/speed-imx35.c +5 -0
index 684dc14..5f0e229 100644
@@ -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());
drivers/spi/Kconfig +1 -1
index 609bafd..7a2f54a 100644
@@ -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
drivers/spi/imx_spi.c +1 -1
index 42358f2..06cee86 100644
@@ -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
Signature · 7 lines
1.7.7.6


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
maintainer Applied
#1 lore raw
Quoted 3 lines · Eric Bénard

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

Applied, thanks

Sascha

Quoted 94 lines
---
 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(-)
arch/arm/mach-imx/include/mach/devices-imx35.h +5 -0
index 6c0d750..9ecaa35 100644
@@ -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);
arch/arm/mach-imx/include/mach/imx35-regs.h +2 -0
index fafcd61..91d4b9b 100644
@@ -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
arch/arm/mach-imx/speed-imx35.c +5 -0
index 684dc14..5f0e229 100644
@@ -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());
drivers/spi/Kconfig +1 -1
index 609bafd..7a2f54a 100644
@@ -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
drivers/spi/imx_spi.c +1 -1
index 42358f2..06cee86 100644
@@ -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
Signature · 7 lines
1.7.7.6


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox
Signature · 9 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox