* Patches for SPI support on Lilly1131 modules
@ 2009-10-17 13:12 Daniel Mack
2009-10-17 13:12 ` [PATCH 1/4] ARM: MX3: remove I2C defintions from mx31lilly.c Daniel Mack
2009-10-17 14:03 ` Patches for SPI support on Lilly1131 modules Daniel Mack
0 siblings, 2 replies; 7+ messages in thread
From: Daniel Mack @ 2009-10-17 13:12 UTC (permalink / raw)
To: linux-arm-kernel
Here come four patches to support SPI on Lilly1131 modules in general and
the mc13783 in particular.
They apply to -rc5.
Daniel
[PATCH 1/4] ARM: MX3: remove I2C defintions from mx31lilly.c
[PATCH 2/4] ARM: MX3: add SPI functions for lilly1131-db
[PATCH 3/4] ARM: MX3: add support for mc13783 on lilly-db
[PATCH 4/4] ARM: MX3: add MX3X_UART1_BASE_ADDR for uncompression on lilly1131
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/4] ARM: MX3: remove I2C defintions from mx31lilly.c
2009-10-17 13:12 Patches for SPI support on Lilly1131 modules Daniel Mack
@ 2009-10-17 13:12 ` Daniel Mack
2009-10-17 13:12 ` [PATCH 2/4] ARM: MX3: add SPI functions for lilly1131-db Daniel Mack
2009-10-17 14:03 ` Patches for SPI support on Lilly1131 modules Daniel Mack
1 sibling, 1 reply; 7+ messages in thread
From: Daniel Mack @ 2009-10-17 13:12 UTC (permalink / raw)
To: linux-arm-kernel
The module does not use these pins for I2C but for SPI.
Signed-off-by: Daniel Mack <daniel@caiaq.de>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/mach-mx3/mx31lilly.c | 3 ---
1 files changed, 0 insertions(+), 3 deletions(-)
diff --git a/arch/arm/mach-mx3/mx31lilly.c b/arch/arm/mach-mx3/mx31lilly.c
index 0a93407..e0f4cd2 100644
--- a/arch/arm/mach-mx3/mx31lilly.c
+++ b/arch/arm/mach-mx3/mx31lilly.c
@@ -245,7 +245,6 @@ static struct mxc_usbh_platform_data usbh2_pdata = {
static struct platform_device *devices[] __initdata = {
&smsc91x_device,
&physmap_flash_device,
- &mxc_i2c_device1,
};
static int mx31lilly_baseboard;
@@ -265,8 +264,6 @@ static void __init mx31lilly_board_init(void)
}
mxc_iomux_alloc_pin(MX31_PIN_CS4__CS4, "Ethernet CS");
- mxc_iomux_alloc_pin(MX31_PIN_CSPI2_MOSI__SCL, "I2C SCL");
- mxc_iomux_alloc_pin(MX31_PIN_CSPI2_MISO__SDA, "I2C SDA");
platform_add_devices(devices, ARRAY_SIZE(devices));
--
1.6.3.3
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/4] ARM: MX3: add SPI functions for lilly1131-db
2009-10-17 13:12 ` [PATCH 1/4] ARM: MX3: remove I2C defintions from mx31lilly.c Daniel Mack
@ 2009-10-17 13:12 ` Daniel Mack
2009-10-17 13:12 ` [PATCH 3/4] ARM: MX3: add support for mc13783 on lilly-db Daniel Mack
0 siblings, 1 reply; 7+ messages in thread
From: Daniel Mack @ 2009-10-17 13:12 UTC (permalink / raw)
To: linux-arm-kernel
This adds support for the two SPI busses found on the lilly1131 module.
Signed-off-by: Daniel Mack <daniel@caiaq.de>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/mach-mx3/mx31lilly.c | 37 +++++++++++++++++++++++++++++++++++++
1 files changed, 37 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-mx3/mx31lilly.c b/arch/arm/mach-mx3/mx31lilly.c
index e0f4cd2..de69a4e 100644
--- a/arch/arm/mach-mx3/mx31lilly.c
+++ b/arch/arm/mach-mx3/mx31lilly.c
@@ -47,6 +47,7 @@
#include <mach/board-mx31lilly.h>
#include <mach/mxc_ehci.h>
#include <mach/ulpi.h>
+#include <mach/spi.h>
#include "devices.h"
@@ -247,6 +248,22 @@ static struct platform_device *devices[] __initdata = {
&physmap_flash_device,
};
+static int spi_internal_chipselect[] = {
+ MXC_SPI_CS(0),
+ MXC_SPI_CS(1),
+ MXC_SPI_CS(2),
+};
+
+static struct spi_imx_master spi0_pdata = {
+ .chipselect = spi_internal_chipselect,
+ .num_chipselect = ARRAY_SIZE(spi_internal_chipselect),
+};
+
+static struct spi_imx_master spi1_pdata = {
+ .chipselect = spi_internal_chipselect,
+ .num_chipselect = ARRAY_SIZE(spi_internal_chipselect),
+};
+
static int mx31lilly_baseboard;
core_param(mx31lilly_baseboard, mx31lilly_baseboard, int, 0444);
@@ -265,6 +282,26 @@ static void __init mx31lilly_board_init(void)
mxc_iomux_alloc_pin(MX31_PIN_CS4__CS4, "Ethernet CS");
+ /* SPI */
+ mxc_iomux_alloc_pin(MX31_PIN_CSPI1_SCLK__SCLK, "SPI1_CLK");
+ mxc_iomux_alloc_pin(MX31_PIN_CSPI1_MOSI__MOSI, "SPI1_TX");
+ mxc_iomux_alloc_pin(MX31_PIN_CSPI1_MISO__MISO, "SPI1_RX");
+ mxc_iomux_alloc_pin(MX31_PIN_CSPI1_SPI_RDY__SPI_RDY, "SPI1_RDY");
+ mxc_iomux_alloc_pin(MX31_PIN_CSPI1_SS0__SS0, "SPI1_SS0");
+ mxc_iomux_alloc_pin(MX31_PIN_CSPI1_SS1__SS1, "SPI1_SS1");
+ mxc_iomux_alloc_pin(MX31_PIN_CSPI1_SS2__SS2, "SPI1_SS2");
+
+ mxc_iomux_alloc_pin(MX31_PIN_CSPI2_SCLK__SCLK, "SPI2_CLK");
+ mxc_iomux_alloc_pin(MX31_PIN_CSPI2_MOSI__MOSI, "SPI2_TX");
+ mxc_iomux_alloc_pin(MX31_PIN_CSPI2_MISO__MISO, "SPI2_RX");
+ mxc_iomux_alloc_pin(MX31_PIN_CSPI2_SPI_RDY__SPI_RDY, "SPI2_RDY");
+ mxc_iomux_alloc_pin(MX31_PIN_CSPI2_SS0__SS0, "SPI2_SS0");
+ mxc_iomux_alloc_pin(MX31_PIN_CSPI2_SS1__SS1, "SPI2_SS1");
+ mxc_iomux_alloc_pin(MX31_PIN_CSPI2_SS2__SS2, "SPI2_SS2");
+
+ mxc_register_device(&imx_spi_device0, &spi0_pdata);
+ mxc_register_device(&imx_spi_device1, &spi1_pdata);
+
platform_add_devices(devices, ARRAY_SIZE(devices));
/* USB */
--
1.6.3.3
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 3/4] ARM: MX3: add support for mc13783 on lilly-db
2009-10-17 13:12 ` [PATCH 2/4] ARM: MX3: add SPI functions for lilly1131-db Daniel Mack
@ 2009-10-17 13:12 ` Daniel Mack
2009-10-17 13:13 ` [PATCH 4/4] ARM: MX3: add MX3X_UART1_BASE_ADDR for uncompression on lilly1131 Daniel Mack
0 siblings, 1 reply; 7+ messages in thread
From: Daniel Mack @ 2009-10-17 13:12 UTC (permalink / raw)
To: linux-arm-kernel
The chip is actually located on the module, not on the base board. But
other base boards might add more SPI devices, so the spi_board_info
struct must be separated from the module code.
Signed-off-by: Daniel Mack <daniel@caiaq.de>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
---
arch/arm/mach-mx3/mx31lilly-db.c | 19 +++++++++++++++++++
1 files changed, 19 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-mx3/mx31lilly-db.c b/arch/arm/mach-mx3/mx31lilly-db.c
index 3b3a78f..60f2d15 100644
--- a/arch/arm/mach-mx3/mx31lilly-db.c
+++ b/arch/arm/mach-mx3/mx31lilly-db.c
@@ -29,6 +29,8 @@
#include <linux/init.h>
#include <linux/gpio.h>
#include <linux/platform_device.h>
+#include <linux/spi/spi.h>
+#include <linux/mfd/mc13783.h>
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
@@ -202,6 +204,22 @@ static void __init mx31lilly_init_fb(void)
gpio_direction_output(LCD_VCC_EN_GPIO, 1);
}
+/* SPI */
+
+static struct mc13783_platform_data mc13783_pdata __initdata = {
+ .flags = MC13783_USE_RTC | MC13783_USE_TOUCHSCREEN,
+};
+
+static struct spi_board_info lilly_spi_devs[] __initdata = {
+ {
+ .modalias = "mc13783",
+ .max_speed_hz = 1000000,
+ .bus_num = 1,
+ .chip_select = 0,
+ .platform_data = &mc13783_pdata,
+ },
+};
+
void __init mx31lilly_db_init(void)
{
mxc_iomux_setup_multiple_pins(lilly_db_board_pins,
@@ -212,5 +230,6 @@ void __init mx31lilly_db_init(void)
mxc_register_device(&mxc_uart_device2, &uart_pdata);
mxc_register_device(&mxcsdhc_device0, &mmc_pdata);
mx31lilly_init_fb();
+ spi_register_board_info(lilly_spi_devs, ARRAY_SIZE(lilly_spi_devs));
}
--
1.6.3.3
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 4/4] ARM: MX3: add MX3X_UART1_BASE_ADDR for uncompression on lilly1131
2009-10-17 13:12 ` [PATCH 3/4] ARM: MX3: add support for mc13783 on lilly-db Daniel Mack
@ 2009-10-17 13:13 ` Daniel Mack
0 siblings, 0 replies; 7+ messages in thread
From: Daniel Mack @ 2009-10-17 13:13 UTC (permalink / raw)
To: linux-arm-kernel
Reported-by: J?rg Knobloch <knobloch@incostartec.com>
Signed-off-by: Daniel Mack <daniel@caiaq.de>
---
arch/arm/plat-mxc/include/mach/uncompress.h | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/arch/arm/plat-mxc/include/mach/uncompress.h b/arch/arm/plat-mxc/include/mach/uncompress.h
index 082a390..0e12876 100644
--- a/arch/arm/plat-mxc/include/mach/uncompress.h
+++ b/arch/arm/plat-mxc/include/mach/uncompress.h
@@ -94,6 +94,7 @@ static __inline__ void __arch_decomp_setup(unsigned long arch_id)
case MACH_TYPE_MX31ADS:
case MACH_TYPE_MX35_3DS:
case MACH_TYPE_PCM043:
+ case MACH_TYPE_LILLY1131:
uart_base = MX3X_UART1_BASE_ADDR;
break;
case MACH_TYPE_MAGX_ZN5:
--
1.6.3.3
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Patches for SPI support on Lilly1131 modules
2009-10-17 13:12 Patches for SPI support on Lilly1131 modules Daniel Mack
2009-10-17 13:12 ` [PATCH 1/4] ARM: MX3: remove I2C defintions from mx31lilly.c Daniel Mack
@ 2009-10-17 14:03 ` Daniel Mack
2009-10-19 8:20 ` Sascha Hauer
1 sibling, 1 reply; 7+ messages in thread
From: Daniel Mack @ 2009-10-17 14:03 UTC (permalink / raw)
To: linux-arm-kernel
On Sat, Oct 17, 2009 at 03:12:56PM +0200, Daniel Mack wrote:
> Here come four patches to support SPI on Lilly1131 modules in general and
> the mc13783 in particular.
>
> They apply to -rc5.
Ah, sorry. I didn't see that my tree has the MXC USB bits which haven't
been merged yet, so these patches won't apply on your side before that
happens. Which is hopefully soon. There will be another development
round though, hopefully next week.
Daniel
^ permalink raw reply [flat|nested] 7+ messages in thread
* Patches for SPI support on Lilly1131 modules
2009-10-17 14:03 ` Patches for SPI support on Lilly1131 modules Daniel Mack
@ 2009-10-19 8:20 ` Sascha Hauer
0 siblings, 0 replies; 7+ messages in thread
From: Sascha Hauer @ 2009-10-19 8:20 UTC (permalink / raw)
To: linux-arm-kernel
On Sat, Oct 17, 2009 at 04:03:51PM +0200, Daniel Mack wrote:
> On Sat, Oct 17, 2009 at 03:12:56PM +0200, Daniel Mack wrote:
> > Here come four patches to support SPI on Lilly1131 modules in general and
> > the mc13783 in particular.
> >
> > They apply to -rc5.
>
> Ah, sorry. I didn't see that my tree has the MXC USB bits which haven't
> been merged yet, so these patches won't apply on your side before that
> happens. Which is hopefully soon. There will be another development
> round though, hopefully next week.
Ok, so I'll wait for you to ping me.
Sascha
--
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 |
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2009-10-19 8:20 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-17 13:12 Patches for SPI support on Lilly1131 modules Daniel Mack
2009-10-17 13:12 ` [PATCH 1/4] ARM: MX3: remove I2C defintions from mx31lilly.c Daniel Mack
2009-10-17 13:12 ` [PATCH 2/4] ARM: MX3: add SPI functions for lilly1131-db Daniel Mack
2009-10-17 13:12 ` [PATCH 3/4] ARM: MX3: add support for mc13783 on lilly-db Daniel Mack
2009-10-17 13:13 ` [PATCH 4/4] ARM: MX3: add MX3X_UART1_BASE_ADDR for uncompression on lilly1131 Daniel Mack
2009-10-17 14:03 ` Patches for SPI support on Lilly1131 modules Daniel Mack
2009-10-19 8:20 ` Sascha Hauer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).