* [PATCH 2/2] McSPI Slave and DMA,FIFO support
@ 2009-05-20 5:56 Hemanth V
2009-05-20 6:14 ` Gadiyar, Anand
0 siblings, 1 reply; 11+ messages in thread
From: Hemanth V @ 2009-05-20 5:56 UTC (permalink / raw)
To: linux-omap
This patch adds MUX changes for SPI2 and also adds an
option for test driver
Signed-off-by: Hemanth V <hemanthv@ti.com>
---
arch/arm/mach-omap2/board-3430sdp.c | 26 ++++++++++++++++++++++++++
arch/arm/mach-omap2/mux.c | 11 +++++++++++
arch/arm/plat-omap/include/mach/mux.h | 7 +++++++
3 files changed, 44 insertions(+)
Index: linux-omap-2.6/arch/arm/mach-omap2/board-3430sdp.c
===================================================================
--- linux-omap-2.6.orig/arch/arm/mach-omap2/board-3430sdp.c 2009-05-20
11:02:34.000000000 +0530
+++ linux-omap-2.6/arch/arm/mach-omap2/board-3430sdp.c 2009-05-20
11:05:22.000000000 +0530
@@ -228,6 +228,13 @@
.single_channel = 1, /* 0: slave, 1: master */
};
+#ifdef CONFIG_SPI_DEBUG
+static struct omap2_mcspi_device_config dummy_mcspi_config = {
+ .turbo_mode = 0,
+ .single_channel = 1, /* 0: slave, 1: master */
+};
+#endif
+
static struct spi_board_info sdp3430_spi_board_info[] __initdata = {
[0] = {
/*
@@ -242,6 +249,18 @@
.irq = 0,
.platform_data = &tsc2046_config,
},
+#ifdef CONFIG_SPI_DEBUG
+ [1] = {
+ /* SPI test driver attached to SPI2 controller by
+ * default
+ */
+ .modalias = "spitst",
+ .bus_num = 2,
+ .chip_select = 0,
+ .max_speed_hz = 1500000,
+ .controller_data = &dummy_mcspi_config,
+ },
+#endif
};
static struct platform_device sdp3430_lcd_device = {
@@ -666,6 +685,13 @@
static void __init omap_3430sdp_init(void)
{
+
+ /* SPI2 Pin MUX */
+ omap_cfg_reg(AA3_3430_McSPI2_CLK);
+ omap_cfg_reg(Y2_3430_McSPI2_SIMO);
+ omap_cfg_reg(Y3_3430_McSPI2_SOMI);
+ omap_cfg_reg(Y4_3430_McSPI2_CS0);
+
omap3430_i2c_init();
platform_add_devices(sdp3430_devices, ARRAY_SIZE(sdp3430_devices));
omap_board_config = sdp3430_config;
Index: linux-omap-2.6/arch/arm/mach-omap2/mux.c
===================================================================
--- linux-omap-2.6.orig/arch/arm/mach-omap2/mux.c 2009-05-20 11:02:34.000000000
+0530
+++ linux-omap-2.6/arch/arm/mach-omap2/mux.c 2009-05-20 11:05:22.000000000 +0530
@@ -486,6 +486,17 @@
OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_OUTPUT)
MUX_CFG_34XX("J25_34XX_GPIO170", 0x1c6,
OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT)
+
+/* McSPI */
+MUX_CFG_34XX("AA3_3430_McSPI2_CLK", 0x1d6,
+ OMAP34XX_MUX_MODE0 | OMAP34XX_PIN_INPUT)
+MUX_CFG_34XX("Y2_3430_McSPI2_SIMO", 0x1d8,
+ OMAP34XX_MUX_MODE0 | OMAP34XX_PIN_INPUT)
+MUX_CFG_34XX("Y3_3430_McSPI2_SOMI", 0x1da,
+ OMAP34XX_MUX_MODE0 | OMAP34XX_PIN_INPUT)
+MUX_CFG_34XX("Y4_3430_McSPI2_CS0", 0x1dc,
+ OMAP34XX_MUX_MODE0 | OMAP34XX_PIN_INPUT_PULLDOWN)
+
};
#define OMAP34XX_PINS_SZ ARRAY_SIZE(omap34xx_pins)
Index: linux-omap-2.6/arch/arm/plat-omap/include/mach/mux.h
===================================================================
--- linux-omap-2.6.orig/arch/arm/plat-omap/include/mach/mux.h 2009-05-20
11:02:34.000000000 +0530
+++ linux-omap-2.6/arch/arm/plat-omap/include/mach/mux.h 2009-05-20
11:05:22.000000000 +0530
@@ -853,6 +853,13 @@
AE5_34XX_GPIO143,
H19_34XX_GPIO164_OUT,
J25_34XX_GPIO170,
+
+ /* McSPI */
+ AA3_3430_McSPI2_CLK,
+ Y2_3430_McSPI2_SIMO,
+ Y3_3430_McSPI2_SOMI,
+ Y4_3430_McSPI2_CS0,
+
};
struct omap_mux_cfg {
^ permalink raw reply [flat|nested] 11+ messages in thread
* RE: [PATCH 2/2] McSPI Slave and DMA,FIFO support
2009-05-20 5:56 [PATCH 2/2] McSPI Slave and DMA,FIFO support Hemanth V
@ 2009-05-20 6:14 ` Gadiyar, Anand
2009-05-20 6:18 ` Shilimkar, Santosh
` (2 more replies)
0 siblings, 3 replies; 11+ messages in thread
From: Gadiyar, Anand @ 2009-05-20 6:14 UTC (permalink / raw)
To: V, Hemanth, linux-omap@vger.kernel.org
> -----Original Message-----
> From: linux-omap-owner@vger.kernel.org
> [mailto:linux-omap-owner@vger.kernel.org] On Behalf Of Hemanth V
> Sent: Wednesday, May 20, 2009 11:27 AM
> To: linux-omap@vger.kernel.org
> Subject: [PATCH 2/2] McSPI Slave and DMA,FIFO support
>
> This patch adds MUX changes for SPI2 and also adds an
> option for test driver
>
> Signed-off-by: Hemanth V <hemanthv@ti.com>
> ---
> arch/arm/mach-omap2/board-3430sdp.c | 26 ++++++++++++++++++++++++++
> arch/arm/mach-omap2/mux.c | 11 +++++++++++
> arch/arm/plat-omap/include/mach/mux.h | 7 +++++++
> 3 files changed, 44 insertions(+)
>
> Index: linux-omap-2.6/arch/arm/mach-omap2/board-3430sdp.c
> ===================================================================
> --- linux-omap-2.6.orig/arch/arm/mach-omap2/board-3430sdp.c 2009-05-20 11:02:34.000000000 +0530
> +++ linux-omap-2.6/arch/arm/mach-omap2/board-3430sdp.c 2009-05-20 11:05:22.000000000 +0530
> @@ -228,6 +228,13 @@
> .single_channel = 1, /* 0: slave, 1: master */
> };
>
> +#ifdef CONFIG_SPI_DEBUG
> +static struct omap2_mcspi_device_config dummy_mcspi_config = {
> + .turbo_mode = 0,
> + .single_channel = 1, /* 0: slave, 1: master */
> +};
> +#endif
> +
> static struct spi_board_info sdp3430_spi_board_info[] __initdata = {
> [0] = {
> /*
> @@ -242,6 +249,18 @@
> .irq = 0,
> .platform_data = &tsc2046_config,
> },
> +#ifdef CONFIG_SPI_DEBUG
> + [1] = {
> + /* SPI test driver attached to SPI2 controller by
> + * default
> + */
> + .modalias = "spitst",
> + .bus_num = 2,
> + .chip_select = 0,
> + .max_speed_hz = 1500000,
> + .controller_data = &dummy_mcspi_config,
> + },
> +#endif
> };
>
> static struct platform_device sdp3430_lcd_device = {
> @@ -666,6 +685,13 @@
>
> static void __init omap_3430sdp_init(void)
> {
> +
> + /* SPI2 Pin MUX */
> + omap_cfg_reg(AA3_3430_McSPI2_CLK);
> + omap_cfg_reg(Y2_3430_McSPI2_SIMO);
> + omap_cfg_reg(Y3_3430_McSPI2_SOMI);
> + omap_cfg_reg(Y4_3430_McSPI2_CS0);
> +
This will still change the padconf for this port unconditionally.
How do we handle the case where the same platform (SDP in this case)
could have different configurations McSPI2 vs USBHOST2, etc? Is there
a clean way, or do we have no option but to use a CONFIG option?
- Anand
> omap3430_i2c_init();
> platform_add_devices(sdp3430_devices, ARRAY_SIZE(sdp3430_devices));
> omap_board_config = sdp3430_config;
> Index: linux-omap-2.6/arch/arm/mach-omap2/mux.c
> ===================================================================
> --- linux-omap-2.6.orig/arch/arm/mach-omap2/mux.c 2009-05-20 11:02:34.000000000 +0530
> +++ linux-omap-2.6/arch/arm/mach-omap2/mux.c 2009-05-20 11:05:22.000000000 +0530
> @@ -486,6 +486,17 @@
> OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_OUTPUT)
> MUX_CFG_34XX("J25_34XX_GPIO170", 0x1c6,
> OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT)
> +
> +/* McSPI */
> +MUX_CFG_34XX("AA3_3430_McSPI2_CLK", 0x1d6,
> + OMAP34XX_MUX_MODE0 | OMAP34XX_PIN_INPUT)
> +MUX_CFG_34XX("Y2_3430_McSPI2_SIMO", 0x1d8,
> + OMAP34XX_MUX_MODE0 | OMAP34XX_PIN_INPUT)
> +MUX_CFG_34XX("Y3_3430_McSPI2_SOMI", 0x1da,
> + OMAP34XX_MUX_MODE0 | OMAP34XX_PIN_INPUT)
> +MUX_CFG_34XX("Y4_3430_McSPI2_CS0", 0x1dc,
> + OMAP34XX_MUX_MODE0 | OMAP34XX_PIN_INPUT_PULLDOWN)
> +
> };
>
> #define OMAP34XX_PINS_SZ ARRAY_SIZE(omap34xx_pins)
> Index: linux-omap-2.6/arch/arm/plat-omap/include/mach/mux.h
> ===================================================================
> --- linux-omap-2.6.orig/arch/arm/plat-omap/include/mach/mux.h 2009-05-20 11:02:34.000000000 +0530
> +++ linux-omap-2.6/arch/arm/plat-omap/include/mach/mux.h 2009-05-20 11:05:22.000000000 +0530
> @@ -853,6 +853,13 @@
> AE5_34XX_GPIO143,
> H19_34XX_GPIO164_OUT,
> J25_34XX_GPIO170,
> +
> + /* McSPI */
> + AA3_3430_McSPI2_CLK,
> + Y2_3430_McSPI2_SIMO,
> + Y3_3430_McSPI2_SOMI,
> + Y4_3430_McSPI2_CS0,
> +
> };
>
> struct omap_mux_cfg {
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe
> linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* RE: [PATCH 2/2] McSPI Slave and DMA,FIFO support
2009-05-20 6:14 ` Gadiyar, Anand
@ 2009-05-20 6:18 ` Shilimkar, Santosh
2009-05-20 16:10 ` Tony Lindgren
2009-05-20 17:03 ` Kevin Hilman
2 siblings, 0 replies; 11+ messages in thread
From: Shilimkar, Santosh @ 2009-05-20 6:18 UTC (permalink / raw)
To: Gadiyar, Anand, V, Hemanth, linux-omap@vger.kernel.org
> > +
> > + /* SPI2 Pin MUX */
> > + omap_cfg_reg(AA3_3430_McSPI2_CLK);
> > + omap_cfg_reg(Y2_3430_McSPI2_SIMO);
> > + omap_cfg_reg(Y3_3430_McSPI2_SOMI);
> > + omap_cfg_reg(Y4_3430_McSPI2_CS0);
> > +
>
> This will still change the padconf for this port unconditionally.
>
> How do we handle the case where the same platform (SDP in this case)
> could have different configurations McSPI2 vs USBHOST2, etc? Is there
> a clean way, or do we have no option but to use a CONFIG option?
How about boot_arg or in case usb is a loadable module then module argument ?
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 2/2] McSPI Slave and DMA,FIFO support
2009-05-20 6:14 ` Gadiyar, Anand
2009-05-20 6:18 ` Shilimkar, Santosh
@ 2009-05-20 16:10 ` Tony Lindgren
2009-05-20 17:03 ` Kevin Hilman
2 siblings, 0 replies; 11+ messages in thread
From: Tony Lindgren @ 2009-05-20 16:10 UTC (permalink / raw)
To: Gadiyar, Anand; +Cc: V, Hemanth, linux-omap@vger.kernel.org
* Gadiyar, Anand <gadiyar@ti.com> [090519 23:15]:
> > -----Original Message-----
> > From: linux-omap-owner@vger.kernel.org
> > [mailto:linux-omap-owner@vger.kernel.org] On Behalf Of Hemanth V
> > Sent: Wednesday, May 20, 2009 11:27 AM
> > To: linux-omap@vger.kernel.org
> > Subject: [PATCH 2/2] McSPI Slave and DMA,FIFO support
> >
> > This patch adds MUX changes for SPI2 and also adds an
> > option for test driver
> >
> > Signed-off-by: Hemanth V <hemanthv@ti.com>
> > ---
> > arch/arm/mach-omap2/board-3430sdp.c | 26 ++++++++++++++++++++++++++
> > arch/arm/mach-omap2/mux.c | 11 +++++++++++
> > arch/arm/plat-omap/include/mach/mux.h | 7 +++++++
> > 3 files changed, 44 insertions(+)
> >
> > Index: linux-omap-2.6/arch/arm/mach-omap2/board-3430sdp.c
> > ===================================================================
> > --- linux-omap-2.6.orig/arch/arm/mach-omap2/board-3430sdp.c 2009-05-20 11:02:34.000000000 +0530
> > +++ linux-omap-2.6/arch/arm/mach-omap2/board-3430sdp.c 2009-05-20 11:05:22.000000000 +0530
> > @@ -228,6 +228,13 @@
> > .single_channel = 1, /* 0: slave, 1: master */
> > };
> >
> > +#ifdef CONFIG_SPI_DEBUG
> > +static struct omap2_mcspi_device_config dummy_mcspi_config = {
> > + .turbo_mode = 0,
> > + .single_channel = 1, /* 0: slave, 1: master */
> > +};
> > +#endif
> > +
> > static struct spi_board_info sdp3430_spi_board_info[] __initdata = {
> > [0] = {
> > /*
> > @@ -242,6 +249,18 @@
> > .irq = 0,
> > .platform_data = &tsc2046_config,
> > },
> > +#ifdef CONFIG_SPI_DEBUG
> > + [1] = {
> > + /* SPI test driver attached to SPI2 controller by
> > + * default
> > + */
> > + .modalias = "spitst",
> > + .bus_num = 2,
> > + .chip_select = 0,
> > + .max_speed_hz = 1500000,
> > + .controller_data = &dummy_mcspi_config,
> > + },
> > +#endif
> > };
> >
> > static struct platform_device sdp3430_lcd_device = {
> > @@ -666,6 +685,13 @@
> >
> > static void __init omap_3430sdp_init(void)
> > {
> > +
> > + /* SPI2 Pin MUX */
> > + omap_cfg_reg(AA3_3430_McSPI2_CLK);
> > + omap_cfg_reg(Y2_3430_McSPI2_SIMO);
> > + omap_cfg_reg(Y3_3430_McSPI2_SOMI);
> > + omap_cfg_reg(Y4_3430_McSPI2_CS0);
> > +
>
> This will still change the padconf for this port unconditionally.
>
> How do we handle the case where the same platform (SDP in this case)
> could have different configurations McSPI2 vs USBHOST2, etc? Is there
> a clean way, or do we have no option but to use a CONFIG option?
Sounds like a cmdline option would do the trick.
Tony
>
> - Anand
>
>
> > omap3430_i2c_init();
> > platform_add_devices(sdp3430_devices, ARRAY_SIZE(sdp3430_devices));
> > omap_board_config = sdp3430_config;
> > Index: linux-omap-2.6/arch/arm/mach-omap2/mux.c
> > ===================================================================
> > --- linux-omap-2.6.orig/arch/arm/mach-omap2/mux.c 2009-05-20 11:02:34.000000000 +0530
> > +++ linux-omap-2.6/arch/arm/mach-omap2/mux.c 2009-05-20 11:05:22.000000000 +0530
> > @@ -486,6 +486,17 @@
> > OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_OUTPUT)
> > MUX_CFG_34XX("J25_34XX_GPIO170", 0x1c6,
> > OMAP34XX_MUX_MODE4 | OMAP34XX_PIN_INPUT)
> > +
> > +/* McSPI */
> > +MUX_CFG_34XX("AA3_3430_McSPI2_CLK", 0x1d6,
> > + OMAP34XX_MUX_MODE0 | OMAP34XX_PIN_INPUT)
> > +MUX_CFG_34XX("Y2_3430_McSPI2_SIMO", 0x1d8,
> > + OMAP34XX_MUX_MODE0 | OMAP34XX_PIN_INPUT)
> > +MUX_CFG_34XX("Y3_3430_McSPI2_SOMI", 0x1da,
> > + OMAP34XX_MUX_MODE0 | OMAP34XX_PIN_INPUT)
> > +MUX_CFG_34XX("Y4_3430_McSPI2_CS0", 0x1dc,
> > + OMAP34XX_MUX_MODE0 | OMAP34XX_PIN_INPUT_PULLDOWN)
> > +
> > };
> >
> > #define OMAP34XX_PINS_SZ ARRAY_SIZE(omap34xx_pins)
> > Index: linux-omap-2.6/arch/arm/plat-omap/include/mach/mux.h
> > ===================================================================
> > --- linux-omap-2.6.orig/arch/arm/plat-omap/include/mach/mux.h 2009-05-20 11:02:34.000000000 +0530
> > +++ linux-omap-2.6/arch/arm/plat-omap/include/mach/mux.h 2009-05-20 11:05:22.000000000 +0530
> > @@ -853,6 +853,13 @@
> > AE5_34XX_GPIO143,
> > H19_34XX_GPIO164_OUT,
> > J25_34XX_GPIO170,
> > +
> > + /* McSPI */
> > + AA3_3430_McSPI2_CLK,
> > + Y2_3430_McSPI2_SIMO,
> > + Y3_3430_McSPI2_SOMI,
> > + Y4_3430_McSPI2_CS0,
> > +
> > };
> >
> > struct omap_mux_cfg {
> >
> >
> > --
> > To unsubscribe from this list: send the line "unsubscribe
> > linux-omap" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at http://vger.kernel.org/majordomo-info.html
> >
> > --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 2/2] McSPI Slave and DMA,FIFO support
2009-05-20 6:14 ` Gadiyar, Anand
2009-05-20 6:18 ` Shilimkar, Santosh
2009-05-20 16:10 ` Tony Lindgren
@ 2009-05-20 17:03 ` Kevin Hilman
2009-05-20 17:13 ` Philip Balister
2009-05-21 9:39 ` Hemanth V
2 siblings, 2 replies; 11+ messages in thread
From: Kevin Hilman @ 2009-05-20 17:03 UTC (permalink / raw)
To: Gadiyar, Anand; +Cc: V, Hemanth, linux-omap@vger.kernel.org
"Gadiyar, Anand" <gadiyar@ti.com> writes:
>> -----Original Message-----
>> From: linux-omap-owner@vger.kernel.org
>> [mailto:linux-omap-owner@vger.kernel.org] On Behalf Of Hemanth V
>> Sent: Wednesday, May 20, 2009 11:27 AM
>> To: linux-omap@vger.kernel.org
>> Subject: [PATCH 2/2] McSPI Slave and DMA,FIFO support
>>
>> This patch adds MUX changes for SPI2 and also adds an
>> option for test driver
>>
>> Signed-off-by: Hemanth V <hemanthv@ti.com>
>> ---
>> arch/arm/mach-omap2/board-3430sdp.c | 26 ++++++++++++++++++++++++++
>> arch/arm/mach-omap2/mux.c | 11 +++++++++++
>> arch/arm/plat-omap/include/mach/mux.h | 7 +++++++
>> 3 files changed, 44 insertions(+)
>>
>> Index: linux-omap-2.6/arch/arm/mach-omap2/board-3430sdp.c
>> ===================================================================
>> --- linux-omap-2.6.orig/arch/arm/mach-omap2/board-3430sdp.c 2009-05-20 11:02:34.000000000 +0530
>> +++ linux-omap-2.6/arch/arm/mach-omap2/board-3430sdp.c 2009-05-20 11:05:22.000000000 +0530
>> @@ -228,6 +228,13 @@
>> .single_channel = 1, /* 0: slave, 1: master */
>> };
>>
>> +#ifdef CONFIG_SPI_DEBUG
>> +static struct omap2_mcspi_device_config dummy_mcspi_config = {
>> + .turbo_mode = 0,
>> + .single_channel = 1, /* 0: slave, 1: master */
>> +};
>> +#endif
>> +
>> static struct spi_board_info sdp3430_spi_board_info[] __initdata = {
>> [0] = {
>> /*
>> @@ -242,6 +249,18 @@
>> .irq = 0,
>> .platform_data = &tsc2046_config,
>> },
>> +#ifdef CONFIG_SPI_DEBUG
>> + [1] = {
>> + /* SPI test driver attached to SPI2 controller by
>> + * default
>> + */
>> + .modalias = "spitst",
>> + .bus_num = 2,
>> + .chip_select = 0,
>> + .max_speed_hz = 1500000,
>> + .controller_data = &dummy_mcspi_config,
>> + },
>> +#endif
>> };
>>
>> static struct platform_device sdp3430_lcd_device = {
>> @@ -666,6 +685,13 @@
>>
>> static void __init omap_3430sdp_init(void)
>> {
>> +
>> + /* SPI2 Pin MUX */
>> + omap_cfg_reg(AA3_3430_McSPI2_CLK);
>> + omap_cfg_reg(Y2_3430_McSPI2_SIMO);
>> + omap_cfg_reg(Y3_3430_McSPI2_SOMI);
>> + omap_cfg_reg(Y4_3430_McSPI2_CS0);
>> +
>
> This will still change the padconf for this port unconditionally.
>
> How do we handle the case where the same platform (SDP in this case)
> could have different configurations McSPI2 vs USBHOST2, etc? Is there
> a clean way, or do we have no option but to use a CONFIG option?
What about building both as modules and doing the muxing on module
load with a warning if it's taking the pins away from antother
feature.
Longer term, we need a more dynamic way to request pins when there are
conflicts like this.
Kevin
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 2/2] McSPI Slave and DMA,FIFO support
2009-05-20 17:03 ` Kevin Hilman
@ 2009-05-20 17:13 ` Philip Balister
2009-05-21 14:08 ` Kevin Hilman
2009-05-21 9:39 ` Hemanth V
1 sibling, 1 reply; 11+ messages in thread
From: Philip Balister @ 2009-05-20 17:13 UTC (permalink / raw)
To: linux-omap@vger.kernel.org
[-- Attachment #1: Type: text/plain, Size: 2872 bytes --]
Kevin Hilman wrote:
> "Gadiyar, Anand" <gadiyar@ti.com> writes:
>
>>> -----Original Message-----
>>> From: linux-omap-owner@vger.kernel.org
>>> [mailto:linux-omap-owner@vger.kernel.org] On Behalf Of Hemanth V
>>> Sent: Wednesday, May 20, 2009 11:27 AM
>>> To: linux-omap@vger.kernel.org
>>> Subject: [PATCH 2/2] McSPI Slave and DMA,FIFO support
>>>
>>> This patch adds MUX changes for SPI2 and also adds an
>>> option for test driver
>>>
>>> Signed-off-by: Hemanth V <hemanthv@ti.com>
>>> ---
>>> arch/arm/mach-omap2/board-3430sdp.c | 26 ++++++++++++++++++++++++++
>>> arch/arm/mach-omap2/mux.c | 11 +++++++++++
>>> arch/arm/plat-omap/include/mach/mux.h | 7 +++++++
>>> 3 files changed, 44 insertions(+)
>>>
>>> Index: linux-omap-2.6/arch/arm/mach-omap2/board-3430sdp.c
>>> ===================================================================
>>> --- linux-omap-2.6.orig/arch/arm/mach-omap2/board-3430sdp.c 2009-05-20 11:02:34.000000000 +0530
>>> +++ linux-omap-2.6/arch/arm/mach-omap2/board-3430sdp.c 2009-05-20 11:05:22.000000000 +0530
>>> @@ -228,6 +228,13 @@
>>> .single_channel = 1, /* 0: slave, 1: master */
>>> };
>>>
>>> +#ifdef CONFIG_SPI_DEBUG
>>> +static struct omap2_mcspi_device_config dummy_mcspi_config = {
>>> + .turbo_mode = 0,
>>> + .single_channel = 1, /* 0: slave, 1: master */
>>> +};
>>> +#endif
>>> +
>>> static struct spi_board_info sdp3430_spi_board_info[] __initdata = {
>>> [0] = {
>>> /*
>>> @@ -242,6 +249,18 @@
>>> .irq = 0,
>>> .platform_data = &tsc2046_config,
>>> },
>>> +#ifdef CONFIG_SPI_DEBUG
>>> + [1] = {
>>> + /* SPI test driver attached to SPI2 controller by
>>> + * default
>>> + */
>>> + .modalias = "spitst",
>>> + .bus_num = 2,
>>> + .chip_select = 0,
>>> + .max_speed_hz = 1500000,
>>> + .controller_data = &dummy_mcspi_config,
>>> + },
>>> +#endif
>>> };
>>>
>>> static struct platform_device sdp3430_lcd_device = {
>>> @@ -666,6 +685,13 @@
>>>
>>> static void __init omap_3430sdp_init(void)
>>> {
>>> +
>>> + /* SPI2 Pin MUX */
>>> + omap_cfg_reg(AA3_3430_McSPI2_CLK);
>>> + omap_cfg_reg(Y2_3430_McSPI2_SIMO);
>>> + omap_cfg_reg(Y3_3430_McSPI2_SOMI);
>>> + omap_cfg_reg(Y4_3430_McSPI2_CS0);
>>> +
>> This will still change the padconf for this port unconditionally.
>>
>> How do we handle the case where the same platform (SDP in this case)
>> could have different configurations McSPI2 vs USBHOST2, etc? Is there
>> a clean way, or do we have no option but to use a CONFIG option?
>
> What about building both as modules and doing the muxing on module
> load with a warning if it's taking the pins away from antother
> feature.
>
> Longer term, we need a more dynamic way to request pins when there are
> conflicts like this.
I'm tempted to leave the pinmux setup to u-boot even. That is the
approach I'm using setting up SPI for the beagleboard.
Philip
[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/x-pkcs7-signature, Size: 3303 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 2/2] McSPI Slave and DMA,FIFO support
2009-05-20 17:03 ` Kevin Hilman
2009-05-20 17:13 ` Philip Balister
@ 2009-05-21 9:39 ` Hemanth V
2009-05-21 14:08 ` Kevin Hilman
2009-05-22 13:37 ` Hemanth V
1 sibling, 2 replies; 11+ messages in thread
From: Hemanth V @ 2009-05-21 9:39 UTC (permalink / raw)
To: Gadiyar, Anand, Kevin Hilman, Tony Lindgren; +Cc: linux-omap
----- Original Message -----
From: "Kevin Hilman" <khilman@deeprootsystems.com>
To: "Gadiyar, Anand" <gadiyar@ti.com>
Cc: "V, Hemanth" <hemanthv@ti.com>; <linux-omap@vger.kernel.org>
Sent: Wednesday, May 20, 2009 10:33 PM
Subject: Re: [PATCH 2/2] McSPI Slave and DMA,FIFO support
> "Gadiyar, Anand" <gadiyar@ti.com> writes:
>
>>> -----Original Message-----
>>> From: linux-omap-owner@vger.kernel.org
>>> [mailto:linux-omap-owner@vger.kernel.org] On Behalf Of Hemanth V
>>> Sent: Wednesday, May 20, 2009 11:27 AM
>>> To: linux-omap@vger.kernel.org
>>> Subject: [PATCH 2/2] McSPI Slave and DMA,FIFO support
>>>
>>> This patch adds MUX changes for SPI2 and also adds an
>>> option for test driver
>>>
>>> Signed-off-by: Hemanth V <hemanthv@ti.com>
>>> ---
>>> arch/arm/mach-omap2/board-3430sdp.c | 26 ++++++++++++++++++++++++++
>>> arch/arm/mach-omap2/mux.c | 11 +++++++++++
>>> arch/arm/plat-omap/include/mach/mux.h | 7 +++++++
>>> 3 files changed, 44 insertions(+)
>>>
>>> Index: linux-omap-2.6/arch/arm/mach-omap2/board-3430sdp.c
>>> ===================================================================
>>> --- linux-omap-2.6.orig/arch/arm/mach-omap2/board-3430sdp.c 2009-05-20
>>> 11:02:34.000000000 +0530
>>> +++ linux-omap-2.6/arch/arm/mach-omap2/board-3430sdp.c 2009-05-20
>>> 11:05:22.000000000 +0530
>>> @@ -228,6 +228,13 @@
>>> .single_channel = 1, /* 0: slave, 1: master */
>>> };
>>>
>>> +#ifdef CONFIG_SPI_DEBUG
>>> +static struct omap2_mcspi_device_config dummy_mcspi_config = {
>>> + .turbo_mode = 0,
>>> + .single_channel = 1, /* 0: slave, 1: master */
>>> +};
>>> +#endif
>>> +
>>> static struct spi_board_info sdp3430_spi_board_info[] __initdata = {
>>> [0] = {
>>> /*
>>> @@ -242,6 +249,18 @@
>>> .irq = 0,
>>> .platform_data = &tsc2046_config,
>>> },
>>> +#ifdef CONFIG_SPI_DEBUG
>>> + [1] = {
>>> + /* SPI test driver attached to SPI2 controller by
>>> + * default
>>> + */
>>> + .modalias = "spitst",
>>> + .bus_num = 2,
>>> + .chip_select = 0,
>>> + .max_speed_hz = 1500000,
>>> + .controller_data = &dummy_mcspi_config,
>>> + },
>>> +#endif
>>> };
>>>
>>> static struct platform_device sdp3430_lcd_device = {
>>> @@ -666,6 +685,13 @@
>>>
>>> static void __init omap_3430sdp_init(void)
>>> {
>>> +
>>> + /* SPI2 Pin MUX */
>>> + omap_cfg_reg(AA3_3430_McSPI2_CLK);
>>> + omap_cfg_reg(Y2_3430_McSPI2_SIMO);
>>> + omap_cfg_reg(Y3_3430_McSPI2_SOMI);
>>> + omap_cfg_reg(Y4_3430_McSPI2_CS0);
>>> +
>>
>> This will still change the padconf for this port unconditionally.
>>
>> How do we handle the case where the same platform (SDP in this case)
>> could have different configurations McSPI2 vs USBHOST2, etc? Is there
>> a clean way, or do we have no option but to use a CONFIG option?
>
> What about building both as modules and doing the muxing on module
> load with a warning if it's taking the pins away from antother
> feature.
>
> Longer term, we need a more dynamic way to request pins when there are
> conflicts like this.
>
> Kevin
Might be the easiest option right now is to remove omap_cfg_reg calls and
allow
users to add it when required.
Hemanth
>
>
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 2/2] McSPI Slave and DMA,FIFO support
2009-05-21 9:39 ` Hemanth V
@ 2009-05-21 14:08 ` Kevin Hilman
2009-05-22 13:37 ` Hemanth V
1 sibling, 0 replies; 11+ messages in thread
From: Kevin Hilman @ 2009-05-21 14:08 UTC (permalink / raw)
To: Hemanth V; +Cc: Gadiyar, Anand, Tony Lindgren, linux-omap
"Hemanth V" <hemanthv@ti.com> writes:
>
>> "Gadiyar, Anand" <gadiyar@ti.com> writes:
>>
>>>> -----Original Message-----
>>>> From: linux-omap-owner@vger.kernel.org
>>>> [mailto:linux-omap-owner@vger.kernel.org] On Behalf Of Hemanth V
>>>> Sent: Wednesday, May 20, 2009 11:27 AM
>>>> To: linux-omap@vger.kernel.org
>>>> Subject: [PATCH 2/2] McSPI Slave and DMA,FIFO support
>>>>
>>>> This patch adds MUX changes for SPI2 and also adds an
>>>> option for test driver
>>>>
[...]
>>>> static void __init omap_3430sdp_init(void)
>>>> {
>>>> +
>>>> + /* SPI2 Pin MUX */
>>>> + omap_cfg_reg(AA3_3430_McSPI2_CLK);
>>>> + omap_cfg_reg(Y2_3430_McSPI2_SIMO);
>>>> + omap_cfg_reg(Y3_3430_McSPI2_SOMI);
>>>> + omap_cfg_reg(Y4_3430_McSPI2_CS0);
>>>> +
>>>
>>> This will still change the padconf for this port unconditionally.
>>>
>>> How do we handle the case where the same platform (SDP in this case)
>>> could have different configurations McSPI2 vs USBHOST2, etc? Is there
>>> a clean way, or do we have no option but to use a CONFIG option?
>>
>> What about building both as modules and doing the muxing on module
>> load with a warning if it's taking the pins away from antother
>> feature.
>>
>> Longer term, we need a more dynamic way to request pins when there are
>> conflicts like this.
>>
>> Kevin
>
> Might be the easiest option right now is to remove omap_cfg_reg
> calls and allow users to add it when required.
Those calls are required for a functioning SPI driver, no? If we
leave them out, isn't the first question going to be "why doesn't SPI2
work on my board."
That being said, I guess I'm ok with waiting a little for adding he
muxing. Not sure what others think
My "partial fix" suggestion for today was for the driver to mux them at
runtime when the module loads. However, I don't really like that
solution either since that puts board/chip specific code into the
driver.
The real solution is to have the muxing done as part of a
device_enable call which will come as part of the forthcoming omapdev.
Then the muxing can be done as part of a generic device enable, along
clocks etc.
However, this still doesn't solve the problem of conflicting users.
If you're using McSPI2 and you enable USBHOST, then your McSPI2 will
just stop working. At some point, we'll need some sort of
request/free mechanism for pins.
Kevin
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 2/2] McSPI Slave and DMA,FIFO support
2009-05-20 17:13 ` Philip Balister
@ 2009-05-21 14:08 ` Kevin Hilman
0 siblings, 0 replies; 11+ messages in thread
From: Kevin Hilman @ 2009-05-21 14:08 UTC (permalink / raw)
To: Philip Balister; +Cc: linux-omap@vger.kernel.org
Philip Balister <philip@balister.org> writes:
> Kevin Hilman wrote:
>> "Gadiyar, Anand" <gadiyar@ti.com> writes:
>>
>>>> -----Original Message-----
>>>> From: linux-omap-owner@vger.kernel.org
>>>> [mailto:linux-omap-owner@vger.kernel.org] On Behalf Of Hemanth V
>>>> Sent: Wednesday, May 20, 2009 11:27 AM
>>>> To: linux-omap@vger.kernel.org
>>>> Subject: [PATCH 2/2] McSPI Slave and DMA,FIFO support
>>>>
>>>> This patch adds MUX changes for SPI2 and also adds an
>>>> option for test driver
>>>>
>>>> Signed-off-by: Hemanth V <hemanthv@ti.com>
>>>> ---
>>>> arch/arm/mach-omap2/board-3430sdp.c | 26 ++++++++++++++++++++++++++
>>>> arch/arm/mach-omap2/mux.c | 11 +++++++++++
>>>> arch/arm/plat-omap/include/mach/mux.h | 7 +++++++
>>>> 3 files changed, 44 insertions(+)
>>>>
>>>> Index: linux-omap-2.6/arch/arm/mach-omap2/board-3430sdp.c
>>>> ===================================================================
>>>> --- linux-omap-2.6.orig/arch/arm/mach-omap2/board-3430sdp.c 2009-05-20 11:02:34.000000000 +0530
>>>> +++ linux-omap-2.6/arch/arm/mach-omap2/board-3430sdp.c 2009-05-20 11:05:22.000000000 +0530
>>>> @@ -228,6 +228,13 @@
>>>> .single_channel = 1, /* 0: slave, 1: master */
>>>> };
>>>>
>>>> +#ifdef CONFIG_SPI_DEBUG
>>>> +static struct omap2_mcspi_device_config dummy_mcspi_config = {
>>>> + .turbo_mode = 0,
>>>> + .single_channel = 1, /* 0: slave, 1: master */
>>>> +};
>>>> +#endif
>>>> +
>>>> static struct spi_board_info sdp3430_spi_board_info[] __initdata = {
>>>> [0] = {
>>>> /*
>>>> @@ -242,6 +249,18 @@
>>>> .irq = 0,
>>>> .platform_data = &tsc2046_config,
>>>> },
>>>> +#ifdef CONFIG_SPI_DEBUG
>>>> + [1] = {
>>>> + /* SPI test driver attached to SPI2 controller by
>>>> + * default
>>>> + */
>>>> + .modalias = "spitst",
>>>> + .bus_num = 2,
>>>> + .chip_select = 0,
>>>> + .max_speed_hz = 1500000,
>>>> + .controller_data = &dummy_mcspi_config,
>>>> + },
>>>> +#endif
>>>> };
>>>>
>>>> static struct platform_device sdp3430_lcd_device = {
>>>> @@ -666,6 +685,13 @@
>>>>
>>>> static void __init omap_3430sdp_init(void)
>>>> {
>>>> +
>>>> + /* SPI2 Pin MUX */
>>>> + omap_cfg_reg(AA3_3430_McSPI2_CLK);
>>>> + omap_cfg_reg(Y2_3430_McSPI2_SIMO);
>>>> + omap_cfg_reg(Y3_3430_McSPI2_SOMI);
>>>> + omap_cfg_reg(Y4_3430_McSPI2_CS0);
>>>> +
>>> This will still change the padconf for this port unconditionally.
>>>
>>> How do we handle the case where the same platform (SDP in this case)
>>> could have different configurations McSPI2 vs USBHOST2, etc? Is there
>>> a clean way, or do we have no option but to use a CONFIG option?
>>
>> What about building both as modules and doing the muxing on module
>> load with a warning if it's taking the pins away from antother
>> feature.
>>
>> Longer term, we need a more dynamic way to request pins when there are
>> conflicts like this.
>
> I'm tempted to leave the pinmux setup to u-boot even. That is the
> approach I'm using setting up SPI for the beagleboard.
That's cheating ;)
And in any case, that doesn't solve the problem if you have two
different uses for the same pins on a given board.
In this case, what if someone wants to use the pins for two different
things (in this case McSPI2 and USB host) at switch between them at
runtime?
Kevin
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 2/2] McSPI Slave and DMA,FIFO support
2009-05-21 9:39 ` Hemanth V
2009-05-21 14:08 ` Kevin Hilman
@ 2009-05-22 13:37 ` Hemanth V
2009-06-02 18:11 ` Tony Lindgren
1 sibling, 1 reply; 11+ messages in thread
From: Hemanth V @ 2009-05-22 13:37 UTC (permalink / raw)
To: Tony Lindgren; +Cc: linux-omap
Tony, would you be able merge the two patches if I removed omap_cfg_reg
calls
Thanks
Hemnath
----- Original Message -----
From: "Hemanth V" <hemanthv@ti.com>
To: "Gadiyar, Anand" <gadiyar@ti.com>; "Kevin Hilman"
<khilman@deeprootsystems.com>; "Tony Lindgren" <tony@atomide.com>
Cc: <linux-omap@vger.kernel.org>
Sent: Thursday, May 21, 2009 3:09 PM
Subject: Re: [PATCH 2/2] McSPI Slave and DMA,FIFO support
> ----- Original Message -----
> From: "Kevin Hilman" <khilman@deeprootsystems.com>
> To: "Gadiyar, Anand" <gadiyar@ti.com>
> Cc: "V, Hemanth" <hemanthv@ti.com>; <linux-omap@vger.kernel.org>
> Sent: Wednesday, May 20, 2009 10:33 PM
> Subject: Re: [PATCH 2/2] McSPI Slave and DMA,FIFO support
>
>
>> "Gadiyar, Anand" <gadiyar@ti.com> writes:
>>
>>>> -----Original Message-----
>>>> From: linux-omap-owner@vger.kernel.org
>>>> [mailto:linux-omap-owner@vger.kernel.org] On Behalf Of Hemanth V
>>>> Sent: Wednesday, May 20, 2009 11:27 AM
>>>> To: linux-omap@vger.kernel.org
>>>> Subject: [PATCH 2/2] McSPI Slave and DMA,FIFO support
>>>>
>>>> This patch adds MUX changes for SPI2 and also adds an
>>>> option for test driver
>>>>
>>>> Signed-off-by: Hemanth V <hemanthv@ti.com>
>>>> ---
>>>> arch/arm/mach-omap2/board-3430sdp.c | 26
>>>> ++++++++++++++++++++++++++
>>>> arch/arm/mach-omap2/mux.c | 11 +++++++++++
>>>> arch/arm/plat-omap/include/mach/mux.h | 7 +++++++
>>>> 3 files changed, 44 insertions(+)
>>>>
>>>> Index: linux-omap-2.6/arch/arm/mach-omap2/board-3430sdp.c
>>>> ===================================================================
>>>> --- linux-omap-2.6.orig/arch/arm/mach-omap2/board-3430sdp.c 2009-05-20
>>>> 11:02:34.000000000 +0530
>>>> +++ linux-omap-2.6/arch/arm/mach-omap2/board-3430sdp.c 2009-05-20
>>>> 11:05:22.000000000 +0530
>>>> @@ -228,6 +228,13 @@
>>>> .single_channel = 1, /* 0: slave, 1: master */
>>>> };
>>>>
>>>> +#ifdef CONFIG_SPI_DEBUG
>>>> +static struct omap2_mcspi_device_config dummy_mcspi_config = {
>>>> + .turbo_mode = 0,
>>>> + .single_channel = 1, /* 0: slave, 1: master */
>>>> +};
>>>> +#endif
>>>> +
>>>> static struct spi_board_info sdp3430_spi_board_info[] __initdata = {
>>>> [0] = {
>>>> /*
>>>> @@ -242,6 +249,18 @@
>>>> .irq = 0,
>>>> .platform_data = &tsc2046_config,
>>>> },
>>>> +#ifdef CONFIG_SPI_DEBUG
>>>> + [1] = {
>>>> + /* SPI test driver attached to SPI2 controller by
>>>> + * default
>>>> + */
>>>> + .modalias = "spitst",
>>>> + .bus_num = 2,
>>>> + .chip_select = 0,
>>>> + .max_speed_hz = 1500000,
>>>> + .controller_data = &dummy_mcspi_config,
>>>> + },
>>>> +#endif
>>>> };
>>>>
>>>> static struct platform_device sdp3430_lcd_device = {
>>>> @@ -666,6 +685,13 @@
>>>>
>>>> static void __init omap_3430sdp_init(void)
>>>> {
>>>> +
>>>> + /* SPI2 Pin MUX */
>>>> + omap_cfg_reg(AA3_3430_McSPI2_CLK);
>>>> + omap_cfg_reg(Y2_3430_McSPI2_SIMO);
>>>> + omap_cfg_reg(Y3_3430_McSPI2_SOMI);
>>>> + omap_cfg_reg(Y4_3430_McSPI2_CS0);
>>>> +
>>>
>>> This will still change the padconf for this port unconditionally.
>>>
>>> How do we handle the case where the same platform (SDP in this case)
>>> could have different configurations McSPI2 vs USBHOST2, etc? Is there
>>> a clean way, or do we have no option but to use a CONFIG option?
>>
>> What about building both as modules and doing the muxing on module
>> load with a warning if it's taking the pins away from antother
>> feature.
>>
>> Longer term, we need a more dynamic way to request pins when there are
>> conflicts like this.
>>
>> Kevin
>
> Might be the easiest option right now is to remove omap_cfg_reg calls and
> allow
> users to add it when required.
>
> Hemanth
>>
>>
>>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH 2/2] McSPI Slave and DMA,FIFO support
2009-05-22 13:37 ` Hemanth V
@ 2009-06-02 18:11 ` Tony Lindgren
0 siblings, 0 replies; 11+ messages in thread
From: Tony Lindgren @ 2009-06-02 18:11 UTC (permalink / raw)
To: Hemanth V; +Cc: linux-omap
* Hemanth V <hemanthv@ti.com> [090522 06:37]:
> Tony, would you be able merge the two patches if I removed omap_cfg_reg
> calls
Please provide just the mux.[ch] patch separately, that way we can
patch it where needed.
<snip snip>
>>>>> @@ -666,6 +685,13 @@
>>>>>
>>>>> static void __init omap_3430sdp_init(void)
>>>>> {
>>>>> +
>>>>> + /* SPI2 Pin MUX */
>>>>> + omap_cfg_reg(AA3_3430_McSPI2_CLK);
>>>>> + omap_cfg_reg(Y2_3430_McSPI2_SIMO);
>>>>> + omap_cfg_reg(Y3_3430_McSPI2_SOMI);
>>>>> + omap_cfg_reg(Y4_3430_McSPI2_CS0);
>>>>> +
>>>>
>>>> This will still change the padconf for this port unconditionally.
>>>>
>>>> How do we handle the case where the same platform (SDP in this case)
>>>> could have different configurations McSPI2 vs USBHOST2, etc? Is there
>>>> a clean way, or do we have no option but to use a CONFIG option?
>>>
>>> What about building both as modules and doing the muxing on module
>>> load with a warning if it's taking the pins away from antother
>>> feature.
>>>
>>> Longer term, we need a more dynamic way to request pins when there are
>>> conflicts like this.
Yeah.
>>> Kevin
>>
>> Might be the easiest option right now is to remove omap_cfg_reg calls
>> and allow
>> users to add it when required.
We could just have a pointer for set_pins() in the platform data,
then the driver could just do if (pdev->set_pins()) pdev->set_pins();
Just like we have set_power() for some devices.
Regards,
Tony
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2009-06-02 18:11 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-20 5:56 [PATCH 2/2] McSPI Slave and DMA,FIFO support Hemanth V
2009-05-20 6:14 ` Gadiyar, Anand
2009-05-20 6:18 ` Shilimkar, Santosh
2009-05-20 16:10 ` Tony Lindgren
2009-05-20 17:03 ` Kevin Hilman
2009-05-20 17:13 ` Philip Balister
2009-05-21 14:08 ` Kevin Hilman
2009-05-21 9:39 ` Hemanth V
2009-05-21 14:08 ` Kevin Hilman
2009-05-22 13:37 ` Hemanth V
2009-06-02 18:11 ` Tony Lindgren
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox