diff options
author | Syed Rafiuddin <rafiuddin.syed@ti.com> | 2009-07-28 09:27:10 -0400 |
---|---|---|
committer | Santosh Shilimkar <santosh.shilimkar@ti.com> | 2009-07-28 09:27:10 -0400 |
commit | a5b92cc348299c20be215b9f4b50853ecfbf3864 (patch) | |
tree | e74bfd52986bad6775c79dc98338fb3d849828c6 | |
parent | 4fef5f90edc80aae92efec049750de93be9e25cb (diff) |
ARM: OMAP4: Add McBSP support
This patch creates McBSP support on OMAP4430 development platform. This patch
includes corresponding base address changes for OMAP4.
Signed-off-by: Syed Rafiuddin <rafiuddin.syed@ti.com>
-rw-r--r-- | arch/arm/mach-omap2/mcbsp.c | 41 | ||||
-rw-r--r-- | arch/arm/plat-omap/include/mach/mcbsp.h | 8 | ||||
-rw-r--r-- | arch/arm/plat-omap/mcbsp.c | 2 |
3 files changed, 49 insertions, 2 deletions
diff --git a/arch/arm/mach-omap2/mcbsp.c b/arch/arm/mach-omap2/mcbsp.c index a5c0f0435cd6..d49dfb5e931f 100644 --- a/arch/arm/mach-omap2/mcbsp.c +++ b/arch/arm/mach-omap2/mcbsp.c | |||
@@ -169,6 +169,42 @@ static struct omap_mcbsp_platform_data omap34xx_mcbsp_pdata[] = { | |||
169 | #define OMAP34XX_MCBSP_PDATA_SZ 0 | 169 | #define OMAP34XX_MCBSP_PDATA_SZ 0 |
170 | #endif | 170 | #endif |
171 | 171 | ||
172 | static struct omap_mcbsp_platform_data omap44xx_mcbsp_pdata[] = { | ||
173 | { | ||
174 | .phys_base = OMAP44XX_MCBSP1_BASE, | ||
175 | .dma_rx_sync = OMAP44XX_DMA_MCBSP1_RX, | ||
176 | .dma_tx_sync = OMAP44XX_DMA_MCBSP1_TX, | ||
177 | .rx_irq = INT_24XX_MCBSP1_IRQ_RX, | ||
178 | .tx_irq = INT_24XX_MCBSP1_IRQ_TX, | ||
179 | .ops = &omap2_mcbsp_ops, | ||
180 | }, | ||
181 | { | ||
182 | .phys_base = OMAP44XX_MCBSP2_BASE, | ||
183 | .dma_rx_sync = OMAP44XX_DMA_MCBSP2_RX, | ||
184 | .dma_tx_sync = OMAP44XX_DMA_MCBSP2_TX, | ||
185 | .rx_irq = INT_24XX_MCBSP2_IRQ_RX, | ||
186 | .tx_irq = INT_24XX_MCBSP2_IRQ_TX, | ||
187 | .ops = &omap2_mcbsp_ops, | ||
188 | }, | ||
189 | { | ||
190 | .phys_base = OMAP44XX_MCBSP3_BASE, | ||
191 | .dma_rx_sync = OMAP44XX_DMA_MCBSP3_RX, | ||
192 | .dma_tx_sync = OMAP44XX_DMA_MCBSP3_TX, | ||
193 | .rx_irq = INT_24XX_MCBSP3_IRQ_RX, | ||
194 | .tx_irq = INT_24XX_MCBSP3_IRQ_TX, | ||
195 | .ops = &omap2_mcbsp_ops, | ||
196 | }, | ||
197 | { | ||
198 | .phys_base = OMAP44XX_MCBSP4_BASE, | ||
199 | .dma_rx_sync = OMAP44XX_DMA_MCBSP4_RX, | ||
200 | .dma_tx_sync = OMAP44XX_DMA_MCBSP4_TX, | ||
201 | .rx_irq = INT_24XX_MCBSP4_IRQ_RX, | ||
202 | .tx_irq = INT_24XX_MCBSP4_IRQ_TX, | ||
203 | .ops = &omap2_mcbsp_ops, | ||
204 | }, | ||
205 | }; | ||
206 | #define OMAP44XX_MCBSP_PDATA_SZ ARRAY_SIZE(omap44xx_mcbsp_pdata) | ||
207 | |||
172 | static int __init omap2_mcbsp_init(void) | 208 | static int __init omap2_mcbsp_init(void) |
173 | { | 209 | { |
174 | if (cpu_is_omap2420()) | 210 | if (cpu_is_omap2420()) |
@@ -177,6 +213,8 @@ static int __init omap2_mcbsp_init(void) | |||
177 | omap_mcbsp_count = OMAP2430_MCBSP_PDATA_SZ; | 213 | omap_mcbsp_count = OMAP2430_MCBSP_PDATA_SZ; |
178 | if (cpu_is_omap34xx()) | 214 | if (cpu_is_omap34xx()) |
179 | omap_mcbsp_count = OMAP34XX_MCBSP_PDATA_SZ; | 215 | omap_mcbsp_count = OMAP34XX_MCBSP_PDATA_SZ; |
216 | if (cpu_is_omap44xx()) | ||
217 | omap_mcbsp_count = OMAP44XX_MCBSP_PDATA_SZ; | ||
180 | 218 | ||
181 | mcbsp_ptr = kzalloc(omap_mcbsp_count * sizeof(struct omap_mcbsp *), | 219 | mcbsp_ptr = kzalloc(omap_mcbsp_count * sizeof(struct omap_mcbsp *), |
182 | GFP_KERNEL); | 220 | GFP_KERNEL); |
@@ -192,6 +230,9 @@ static int __init omap2_mcbsp_init(void) | |||
192 | if (cpu_is_omap34xx()) | 230 | if (cpu_is_omap34xx()) |
193 | omap_mcbsp_register_board_cfg(omap34xx_mcbsp_pdata, | 231 | omap_mcbsp_register_board_cfg(omap34xx_mcbsp_pdata, |
194 | OMAP34XX_MCBSP_PDATA_SZ); | 232 | OMAP34XX_MCBSP_PDATA_SZ); |
233 | if (cpu_is_omap44xx()) | ||
234 | omap_mcbsp_register_board_cfg(omap44xx_mcbsp_pdata, | ||
235 | OMAP44XX_MCBSP_PDATA_SZ); | ||
195 | 236 | ||
196 | return omap_mcbsp_init(); | 237 | return omap_mcbsp_init(); |
197 | } | 238 | } |
diff --git a/arch/arm/plat-omap/include/mach/mcbsp.h b/arch/arm/plat-omap/include/mach/mcbsp.h index bb154ea76769..ec6f81e06d39 100644 --- a/arch/arm/plat-omap/include/mach/mcbsp.h +++ b/arch/arm/plat-omap/include/mach/mcbsp.h | |||
@@ -53,6 +53,11 @@ | |||
53 | #define OMAP34XX_MCBSP4_BASE 0x49026000 | 53 | #define OMAP34XX_MCBSP4_BASE 0x49026000 |
54 | #define OMAP34XX_MCBSP5_BASE 0x48096000 | 54 | #define OMAP34XX_MCBSP5_BASE 0x48096000 |
55 | 55 | ||
56 | #define OMAP44XX_MCBSP1_BASE 0x49022000 | ||
57 | #define OMAP44XX_MCBSP2_BASE 0x49024000 | ||
58 | #define OMAP44XX_MCBSP3_BASE 0x49026000 | ||
59 | #define OMAP44XX_MCBSP4_BASE 0x48074000 | ||
60 | |||
56 | #if defined(CONFIG_ARCH_OMAP15XX) || defined(CONFIG_ARCH_OMAP16XX) || defined(CONFIG_ARCH_OMAP730) | 61 | #if defined(CONFIG_ARCH_OMAP15XX) || defined(CONFIG_ARCH_OMAP16XX) || defined(CONFIG_ARCH_OMAP730) |
57 | 62 | ||
58 | #define OMAP_MCBSP_REG_DRR2 0x00 | 63 | #define OMAP_MCBSP_REG_DRR2 0x00 |
@@ -98,7 +103,8 @@ | |||
98 | #define AUDIO_DMA_TX OMAP_DMA_MCBSP1_TX | 103 | #define AUDIO_DMA_TX OMAP_DMA_MCBSP1_TX |
99 | #define AUDIO_DMA_RX OMAP_DMA_MCBSP1_RX | 104 | #define AUDIO_DMA_RX OMAP_DMA_MCBSP1_RX |
100 | 105 | ||
101 | #elif defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) | 106 | #elif defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) || \ |
107 | defined(CONFIG_ARCH_OMAP4) | ||
102 | 108 | ||
103 | #define OMAP_MCBSP_REG_DRR2 0x00 | 109 | #define OMAP_MCBSP_REG_DRR2 0x00 |
104 | #define OMAP_MCBSP_REG_DRR1 0x04 | 110 | #define OMAP_MCBSP_REG_DRR1 0x04 |
diff --git a/arch/arm/plat-omap/mcbsp.c b/arch/arm/plat-omap/mcbsp.c index efa0e0111f38..e42fa7cfc795 100644 --- a/arch/arm/plat-omap/mcbsp.c +++ b/arch/arm/plat-omap/mcbsp.c | |||
@@ -191,7 +191,7 @@ void omap_mcbsp_config(unsigned int id, const struct omap_mcbsp_reg_cfg *config) | |||
191 | OMAP_MCBSP_WRITE(io_base, MCR2, config->mcr2); | 191 | OMAP_MCBSP_WRITE(io_base, MCR2, config->mcr2); |
192 | OMAP_MCBSP_WRITE(io_base, MCR1, config->mcr1); | 192 | OMAP_MCBSP_WRITE(io_base, MCR1, config->mcr1); |
193 | OMAP_MCBSP_WRITE(io_base, PCR0, config->pcr0); | 193 | OMAP_MCBSP_WRITE(io_base, PCR0, config->pcr0); |
194 | if (cpu_is_omap2430() || cpu_is_omap34xx()) { | 194 | if (cpu_is_omap2430() || cpu_is_omap34xx() || cpu_is_omap44xx()) { |
195 | OMAP_MCBSP_WRITE(io_base, XCCR, config->xccr); | 195 | OMAP_MCBSP_WRITE(io_base, XCCR, config->xccr); |
196 | OMAP_MCBSP_WRITE(io_base, RCCR, config->rccr); | 196 | OMAP_MCBSP_WRITE(io_base, RCCR, config->rccr); |
197 | } | 197 | } |