OMAP4: McSPI Support for OMAP_4430
RFC PATCH 1/1 OMAP4: McSPI Support for OMAP_4430
This patch adds McSPI support for OMAP4430 SDP platform. All the base addresses are changed between OMAP1/2/3 and OMAP4.The fields of the resource structures are filled at runtime to have McSPI support on OMAP4.
--- arch/arm/mach-omap2/devices.c | 25 +++++++++++++++++++++---- drivers/spi/omap2_mcspi.c | 10 ++++++---- 2 files changed, 27 insertions(+), 8 deletions(-)
Index: omap4_dev/arch/arm/mach-omap2/devices.c
===================================================================
--- omap4_dev.orig/arch/arm/mach-omap2/devices.c 2009-06-24 19:22:04.000000000
+0530
+++ omap4_dev/arch/arm/mach-omap2/devices.c 2009-06-25 10:05:39.000000000 +0530
@@ -257,6 +257,11 @@
#define OMAP2_MCSPI3_BASE 0x480b8000
#define OMAP2_MCSPI4_BASE 0x480ba000
+#define OMAP4_MCSPI1_BASE 0x48098100
+#define OMAP4_MCSPI2_BASE 0x4809a100
+#define OMAP4_MCSPI3_BASE 0x480b8100
+#define OMAP4_MCSPI4_BASE 0x480ba100
+
static struct omap2_mcspi_platform_config omap2_mcspi1_config = {
.num_cs = 4,
};
@@ -301,7 +306,8 @@
},
};
-#if defined(CONFIG_ARCH_OMAP2430) || defined(CONFIG_ARCH_OMAP3) +#if defined(CONFIG_ARCH_OMAP2430) || defined(CONFIG_ARCH_OMAP3) || \
+ defined(CONFIG_ARCH_OMAP4)
static struct omap2_mcspi_platform_config omap2_mcspi3_config = {
.num_cs = 2,
};
@@ -325,7 +331,7 @@
};
#endif
-#ifdef CONFIG_ARCH_OMAP3
+#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4)
static struct omap2_mcspi_platform_config omap2_mcspi4_config = {
.num_cs = 1,
};
@@ -351,12 +357,23 @@
static void omap_init_mcspi(void)
{
+ if (cpu_is_omap44xx()) {
+ omap2_mcspi1_resources[0].start = OMAP4_MCSPI1_BASE;
+ omap2_mcspi1_resources[0].end = OMAP4_MCSPI1_BASE + 0xff;
+ omap2_mcspi2_resources[0].start = OMAP4_MCSPI2_BASE;
+ omap2_mcspi2_resources[0].end = OMAP4_MCSPI2_BASE + 0xff;
+ omap2_mcspi3_resources[0].start = OMAP4_MCSPI3_BASE;
+ omap2_mcspi3_resources[0].end = OMAP4_MCSPI3_BASE + 0xff;
+ omap2_mcspi4_resources[0].start = OMAP4_MCSPI4_BASE;
+ omap2_mcspi4_resources[0].end = OMAP4_MCSPI4_BASE + 0xff;
+ }
platform_device_register(&omap2_mcspi1);
platform_device_register(&omap2_mcspi2);
-#if defined(CONFIG_ARCH_OMAP2430) || defined(CONFIG_ARCH_OMAP3) +#if defined(CONFIG_ARCH_OMAP2430) || defined(CONFIG_ARCH_OMAP3) || \
+ defined(CONFIG_ARCH_OMAP4)
platform_device_register(&omap2_mcspi3);
#endif
-#ifdef CONFIG_ARCH_OMAP3
+#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4)
platform_device_register(&omap2_mcspi4);
#endif
}
drivers/spi/omap2_mcspi.c +6 -4
@@ -918,7 +918,8 @@ OMAP24XX_DMA_SPI2_TX1, }; -#if defined(CONFIG_ARCH_OMAP2430 ) || defined(CONFIG_ARCH_OMAP34XX ) +#if defined(CONFIG_ARCH_OMAP2430 ) || defined(CONFIG_ARCH_OMAP34XX ) || \ + defined(CONFIG_ARCH_OMAP4 )static u8 __initdata spi3_rxdma_id[] = {OMAP24XX_DMA_SPI3_RX0 , OMAP24XX_DMA_SPI3_RX1,
@@ -930,7 +931,7 @@ };#endif -#ifdef CONFIG_ARCH_OMAP3 +#if defined(CONFIG_ARCH_OMAP3 ) || defined(CONFIG_ARCH_OMAP4 )static u8 __initdata spi4_rxdma_id[] = {OMAP34XX_DMA_SPI4_RX0 , };
@@ -960,14 +961,15 @@ txdma_id = spi2_txdma_id; num_chipselect =2 ;break ; -#if defined(CONFIG_ARCH_OMAP2430 ) || defined(CONFIG_ARCH_OMAP3 ) +#if defined(CONFIG_ARCH_OMAP2430 ) || defined(CONFIG_ARCH_OMAP3 ) || \ + defined(CONFIG_ARCH_OMAP4 )case 3 : rxdma_id = spi3_rxdma_id; txdma_id = spi3_txdma_id; num_chipselect =2 ;break ;#endif -#ifdef CONFIG_ARCH_OMAP3 +#if defined(CONFIG_ARCH_OMAP3 ) || defined(CONFIG_ARCH_OMAP4 )case 4 : rxdma_id = spi4_rxdma_id; txdma_id = spi4_txdma_id;
Quoted 5 lines · Syed Rafiuddin
This patch adds McSPI support for OMAP4430 SDP platform. All the base addresses are changed between OMAP1/2/3 and OMAP4.The fields of the resource structures are filled at runtime to have McSPI support on OMAP4.
Signed-off-by Syed Rafiuddin <[email protected]>
This driver needs some help for multi-omap, but that problem existed before this patch, so
Quoted 114 lines
--- arch/arm/mach-omap2/devices.c | 25 +++++++++++++++++++++---- drivers/spi/omap2_mcspi.c | 10 ++++++---- 2 files changed, 27 insertions(+), 8 deletions(-)Index:
omap4_dev/arch/arm/mach-omap2/devices.c
===================================================================
---omap4_dev.orig/arch/arm/mach-omap2/devices.c2009-06-24 19:22:04.000000000
+0530
+++omap4_dev/arch/arm/mach-omap2/devices.c2009-06-25 10:05:39.000000000 +0530drivers/spi/omap2_mcspi.c +21
-4@@ -257,6 +257,11 @@#define OMAP2_MCSPI3_BASE 0x480b8000#define OMAP2_MCSPI4_BASE 0x480ba000 +#define OMAP4_MCSPI1_BASE 0x48098100 +#define OMAP4_MCSPI2_BASE 0x4809a100 +#define OMAP4_MCSPI3_BASE 0x480b8100 +#define OMAP4_MCSPI4_BASE 0x480ba100 +static struct omap2_mcspi_platform_config omap2_mcspi1_config = { .num_cs =4 , };@@ -301,7 +306,8 @@ }, }; -#if defined(CONFIG_ARCH_OMAP2430 ) || defined(CONFIG_ARCH_OMAP3 ) +#if defined(CONFIG_ARCH_OMAP2430 ) || defined(CONFIG_ARCH_OMAP3 ) || \ + defined(CONFIG_ARCH_OMAP4 )static struct omap2_mcspi_platform_config omap2_mcspi3_config = { .num_cs =2 , };@@ -325,7 +331,7 @@ };#endif -#ifdef CONFIG_ARCH_OMAP3 +#if defined(CONFIG_ARCH_OMAP3 ) || defined(CONFIG_ARCH_OMAP4 )static struct omap2_mcspi_platform_config omap2_mcspi4_config = { .num_cs =1 , };@@ -351,12 +357,23 @@static void omap_init_mcspi (void ) { +if (cpu_is_omap44xx ()) { + omap2_mcspi1_resources[0 ].start =OMAP4_MCSPI1_BASE ; + omap2_mcspi1_resources[0 ].end =OMAP4_MCSPI1_BASE +0xff ; + omap2_mcspi2_resources[0 ].start =OMAP4_MCSPI2_BASE ; + omap2_mcspi2_resources[0 ].end =OMAP4_MCSPI2_BASE +0xff ; + omap2_mcspi3_resources[0 ].start =OMAP4_MCSPI3_BASE ; + omap2_mcspi3_resources[0 ].end =OMAP4_MCSPI3_BASE +0xff ; + omap2_mcspi4_resources[0 ].start =OMAP4_MCSPI4_BASE ; + omap2_mcspi4_resources[0 ].end =OMAP4_MCSPI4_BASE +0xff ; + }platform_device_register (&omap2_mcspi1);platform_device_register (&omap2_mcspi2); -#if defined(CONFIG_ARCH_OMAP2430 ) || defined(CONFIG_ARCH_OMAP3 ) +#if defined(CONFIG_ARCH_OMAP2430 ) || defined(CONFIG_ARCH_OMAP3 ) || \ + defined(CONFIG_ARCH_OMAP4 )platform_device_register (&omap2_mcspi3);#endif -#ifdef CONFIG_ARCH_OMAP3 +#if defined(CONFIG_ARCH_OMAP3 ) || defined(CONFIG_ARCH_OMAP4 )platform_device_register (&omap2_mcspi4);#endif }Index:
omap4_dev/drivers/spi/omap2_mcspi.c
===================================================================drivers/spi/omap2_mcspi.c +6
-5@@ -918,7 +918,8 @@ OMAP24XX_DMA_SPI2_TX1, }; -#if defined(CONFIG_ARCH_OMAP2430 ) || defined(CONFIG_ARCH_OMAP34XX ) +#if defined(CONFIG_ARCH_OMAP2430 ) || defined(CONFIG_ARCH_OMAP34XX ) || \ + defined(CONFIG_ARCH_OMAP4 )static u8 __initdata spi3_rxdma_id[] = {OMAP24XX_DMA_SPI3_RX0 , OMAP24XX_DMA_SPI3_RX1,@@ -930,7 +931,7 @@ };#endif -#ifdef CONFIG_ARCH_OMAP3 +#if defined(CONFIG_ARCH_OMAP3 ) || defined(CONFIG_ARCH_OMAP4 )static u8 __initdata spi4_rxdma_id[] = {OMAP34XX_DMA_SPI4_RX0 , };@@ -960,14 +961,15 @@ txdma_id = spi2_txdma_id; num_chipselect =2 ;break ; -#if defined(CONFIG_ARCH_OMAP2430 ) || defined(CONFIG_ARCH_OMAP3 ) +#if defined(CONFIG_ARCH_OMAP2430 ) || defined(CONFIG_ARCH_OMAP3 ) || \ + defined(CONFIG_ARCH_OMAP4 )case 3 : rxdma_id = spi3_rxdma_id; txdma_id = spi3_txdma_id; num_chipselect =2 ;break ;#endif -#ifdef CONFIG_ARCH_OMAP3 +#if defined(CONFIG_ARCH_OMAP3 ) || defined(CONFIG_ARCH_OMAP4 )case 4 : rxdma_id = spi4_rxdma_id; txdma_id = spi4_txdma_id; --To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 14 lines
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Kevin Hilman
Sent: Thursday, June 25, 2009 10:15 PM
To: Syed, Rafiuddin
Cc: [email protected]
Subject: Re: [RESUBMIT][PATCH][RFC] OMAP4: McSPI Support forOMAP_4430Quoted 1 line · Syed Rafiuddin
This patch adds McSPI support for OMAP4430 SDP platform.
All the base addresses
Quoted 1 line
are changed between OMAP1/2/3 and OMAP4.The fields of the
resource structures
Quoted 14 lines
Quoted 3 lines
are filled at runtime to have McSPI support on OMAP4.
Signed-off-by Syed Rafiuddin <[email protected]>This driver needs some help for multi-omap, but that problem existed before this patch, so
Acked-by Kevin Hilman <[email protected]>Quoted 4 lines
--- arch/arm/mach-omap2/devices.c | 25 +++++++++++++++++++++---- drivers/spi/omap2_mcspi.c | 10 ++++++---- 2 files changed, 27 insertions(+), 8 deletions(-)
Not sure but looks like the patch needs split since different upstream paths
1. arch/arm/mach-omap2/devices.c -- linux-arm
2. drivers/spi/omap2_mcspi.c --- Don't know the list but should be some driver list.
Is that correct ?
Regards,
Santosh
Tony Lindgren
Acked-byQuoted 28 lines · Shilimkar, Santosh
Quoted 14 lines
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Kevin Hilman
Sent: Thursday, June 25, 2009 10:15 PM
To: Syed, Rafiuddin
Cc: [email protected]
Subject: Re: [RESUBMIT][PATCH][RFC] OMAP4: McSPI Support forOMAP_4430Quoted 1 line · Syed Rafiuddin
This patch adds McSPI support for OMAP4430 SDP platform.
All the base addresses
Quoted 1 line
are changed between OMAP1/2/3 and OMAP4.The fields of the
resource structures
Quoted 14 lines
Quoted 3 lines
are filled at runtime to have McSPI support on OMAP4.
Signed-off-by Syed Rafiuddin <[email protected]>This driver needs some help for multi-omap, but that problem existed before this patch, so
Acked-by Kevin Hilman <[email protected]>Quoted 4 lines
--- arch/arm/mach-omap2/devices.c | 25 +++++++++++++++++++++---- drivers/spi/omap2_mcspi.c | 10 ++++++---- 2 files changed, 27 insertions(+), 8 deletions(-)
Quoted 5 lines
Not sure but looks like the patch needs split since different upstream paths
1.arch/arm/mach-omap2/devices.c-- linux-arm
2.drivers/spi/omap2_mcspi.c--- Don't know the list but should be some driver list.Is that correct ?
I think this is OK to send as a single patch via the SPI list.
Quoted 44 lines
-----Original Message-----
From: Tony Lindgren [mailto:[email protected]]
Sent: Friday, June 26, 2009 11:21 AM
To: Shilimkar, Santosh
Cc: Kevin Hilman; Syed, Rafiuddin; [email protected]
Subject: Re: [RESUBMIT][PATCH][RFC] OMAP4: McSPI Support forOMAP_4430Quoted 3 lines · Shilimkar, Santosh
Quoted 3 lines
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf OfKevin Hilman
Quoted 4 lines
Quoted 4 lines
Sent: Thursday, June 25, 2009 10:15 PM
To: Syed, Rafiuddin
Cc: [email protected]
Subject: Re: [RESUBMIT][PATCH][RFC] OMAP4: McSPI Supportfor
OMAP_4430Quoted 4 lines
Quoted 4 lines
Quoted 1 line · Syed Rafiuddin
This patch adds McSPI support for OMAP4430 SDP platform.
Quoted 8 lines
Quoted 8 lines
All the base addresses
Quoted 1 line
are changed between OMAP1/2/3 and OMAP4.The fields of the
resource structures
Quoted 3 lines
are filled at runtime to have McSPI support on OMAP4.
Signed-off-by Syed Rafiuddin <[email protected]>This driver needs some help for multi-omap, but that
problem existed
Quoted 10 lines
Quoted 9 lines
before this patch, so
Acked-by Kevin Hilman <[email protected]>Quoted 4 lines
--- arch/arm/mach-omap2/devices.c | 25 +++++++++++++++++++++---- drivers/spi/omap2_mcspi.c | 10 ++++++---- 2 files changed, 27 insertions(+), 8 deletions(-)Not sure but looks like the patch needs split since
different upstream paths
Quoted 2 lines
1.
arch/arm/mach-omap2/devices.c-- linux-arm
2.drivers/spi/omap2_mcspi.c--- Don't know the list but
Quoted 7 lines
should be some driver list.
Quoted 2 lines
Is that correct ?
I think this is OK to send as a single patch via the SPI list.
Acked-by Tony Lindgren <[email protected]>
Cool !!
Thanks Kevin, Tony for ACK.