Commit 7869c0b9 authored by Syed Rafiuddin's avatar Syed Rafiuddin Committed by Linus Torvalds

spi: McSPI support for OMAP4

tAdd 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: default avatarSyed Rafiuddin <rafiuddin.syed@ti.com>
Acked-by: default avatarKevin Hilman <khilman@deeprootsystems.com>
Acked-by: default avatarTony Lindgren <tony@atomide.com>
Acked-by: default avatarSantosh Shilimkar <santosh.shilimkar@ti.com>
Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 89c05372
...@@ -257,6 +257,11 @@ static inline void omap_init_sti(void) {} ...@@ -257,6 +257,11 @@ static inline void omap_init_sti(void) {}
#define OMAP2_MCSPI3_BASE 0x480b8000 #define OMAP2_MCSPI3_BASE 0x480b8000
#define OMAP2_MCSPI4_BASE 0x480ba000 #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 = { static struct omap2_mcspi_platform_config omap2_mcspi1_config = {
.num_cs = 4, .num_cs = 4,
}; };
...@@ -301,7 +306,8 @@ static struct platform_device omap2_mcspi2 = { ...@@ -301,7 +306,8 @@ static struct platform_device omap2_mcspi2 = {
}, },
}; };
#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 = { static struct omap2_mcspi_platform_config omap2_mcspi3_config = {
.num_cs = 2, .num_cs = 2,
}; };
...@@ -325,7 +331,7 @@ static struct platform_device omap2_mcspi3 = { ...@@ -325,7 +331,7 @@ static struct platform_device omap2_mcspi3 = {
}; };
#endif #endif
#ifdef CONFIG_ARCH_OMAP3 #if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4)
static struct omap2_mcspi_platform_config omap2_mcspi4_config = { static struct omap2_mcspi_platform_config omap2_mcspi4_config = {
.num_cs = 1, .num_cs = 1,
}; };
...@@ -351,14 +357,25 @@ static struct platform_device omap2_mcspi4 = { ...@@ -351,14 +357,25 @@ static struct platform_device omap2_mcspi4 = {
static void omap_init_mcspi(void) 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_mcspi1);
platform_device_register(&omap2_mcspi2); platform_device_register(&omap2_mcspi2);
#if defined(CONFIG_ARCH_OMAP2430) || defined(CONFIG_ARCH_OMAP3) #if defined(CONFIG_ARCH_OMAP2430) || defined(CONFIG_ARCH_OMAP3) || \
if (cpu_is_omap2430() || cpu_is_omap343x()) defined(CONFIG_ARCH_OMAP4)
if (cpu_is_omap2430() || cpu_is_omap343x() || cpu_is_omap44xx())
platform_device_register(&omap2_mcspi3); platform_device_register(&omap2_mcspi3);
#endif #endif
#ifdef CONFIG_ARCH_OMAP3 #if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4)
if (cpu_is_omap343x()) if (cpu_is_omap343x() || cpu_is_omap44xx())
platform_device_register(&omap2_mcspi4); platform_device_register(&omap2_mcspi4);
#endif #endif
} }
......
...@@ -1014,7 +1014,8 @@ static u8 __initdata spi2_txdma_id[] = { ...@@ -1014,7 +1014,8 @@ static u8 __initdata spi2_txdma_id[] = {
OMAP24XX_DMA_SPI2_TX1, 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[] = { static u8 __initdata spi3_rxdma_id[] = {
OMAP24XX_DMA_SPI3_RX0, OMAP24XX_DMA_SPI3_RX0,
OMAP24XX_DMA_SPI3_RX1, OMAP24XX_DMA_SPI3_RX1,
...@@ -1026,7 +1027,7 @@ static u8 __initdata spi3_txdma_id[] = { ...@@ -1026,7 +1027,7 @@ static u8 __initdata spi3_txdma_id[] = {
}; };
#endif #endif
#ifdef CONFIG_ARCH_OMAP3 #if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4)
static u8 __initdata spi4_rxdma_id[] = { static u8 __initdata spi4_rxdma_id[] = {
OMAP34XX_DMA_SPI4_RX0, OMAP34XX_DMA_SPI4_RX0,
}; };
...@@ -1056,14 +1057,15 @@ static int __init omap2_mcspi_probe(struct platform_device *pdev) ...@@ -1056,14 +1057,15 @@ static int __init omap2_mcspi_probe(struct platform_device *pdev)
txdma_id = spi2_txdma_id; txdma_id = spi2_txdma_id;
num_chipselect = 2; num_chipselect = 2;
break; 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: case 3:
rxdma_id = spi3_rxdma_id; rxdma_id = spi3_rxdma_id;
txdma_id = spi3_txdma_id; txdma_id = spi3_txdma_id;
num_chipselect = 2; num_chipselect = 2;
break; break;
#endif #endif
#ifdef CONFIG_ARCH_OMAP3 #if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4)
case 4: case 4:
rxdma_id = spi4_rxdma_id; rxdma_id = spi4_rxdma_id;
txdma_id = spi4_txdma_id; txdma_id = spi4_txdma_id;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment