diff options
Diffstat (limited to 'arch/mips/txx9/generic/setup_tx4927.c')
-rw-r--r-- | arch/mips/txx9/generic/setup_tx4927.c | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/arch/mips/txx9/generic/setup_tx4927.c b/arch/mips/txx9/generic/setup_tx4927.c index 1093549df1a8..3418b2a90f7e 100644 --- a/arch/mips/txx9/generic/setup_tx4927.c +++ b/arch/mips/txx9/generic/setup_tx4927.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <asm/txx9tmr.h> | 22 | #include <asm/txx9tmr.h> |
23 | #include <asm/txx9pio.h> | 23 | #include <asm/txx9pio.h> |
24 | #include <asm/txx9/generic.h> | 24 | #include <asm/txx9/generic.h> |
25 | #include <asm/txx9/dmac.h> | ||
25 | #include <asm/txx9/tx4927.h> | 26 | #include <asm/txx9/tx4927.h> |
26 | 27 | ||
27 | static void __init tx4927_wdr_init(void) | 28 | static void __init tx4927_wdr_init(void) |
@@ -253,6 +254,60 @@ void __init tx4927_mtd_init(int ch) | |||
253 | txx9_physmap_flash_init(ch, start, size, &pdata); | 254 | txx9_physmap_flash_init(ch, start, size, &pdata); |
254 | } | 255 | } |
255 | 256 | ||
257 | void __init tx4927_dmac_init(int memcpy_chan) | ||
258 | { | ||
259 | struct txx9dmac_platform_data plat_data = { | ||
260 | .memcpy_chan = memcpy_chan, | ||
261 | .have_64bit_regs = true, | ||
262 | }; | ||
263 | |||
264 | txx9_dmac_init(0, TX4927_DMA_REG & 0xfffffffffULL, | ||
265 | TXX9_IRQ_BASE + TX4927_IR_DMA(0), &plat_data); | ||
266 | } | ||
267 | |||
268 | void __init tx4927_aclc_init(unsigned int dma_chan_out, | ||
269 | unsigned int dma_chan_in) | ||
270 | { | ||
271 | u64 pcfg = __raw_readq(&tx4927_ccfgptr->pcfg); | ||
272 | __u64 dmasel_mask = 0, dmasel = 0; | ||
273 | unsigned long flags; | ||
274 | |||
275 | if (!(pcfg & TX4927_PCFG_SEL2)) | ||
276 | return; | ||
277 | /* setup DMASEL (playback:ACLC ch0, capture:ACLC ch1) */ | ||
278 | switch (dma_chan_out) { | ||
279 | case 0: | ||
280 | dmasel_mask |= TX4927_PCFG_DMASEL0_MASK; | ||
281 | dmasel |= TX4927_PCFG_DMASEL0_ACL0; | ||
282 | break; | ||
283 | case 2: | ||
284 | dmasel_mask |= TX4927_PCFG_DMASEL2_MASK; | ||
285 | dmasel |= TX4927_PCFG_DMASEL2_ACL0; | ||
286 | break; | ||
287 | default: | ||
288 | return; | ||
289 | } | ||
290 | switch (dma_chan_in) { | ||
291 | case 1: | ||
292 | dmasel_mask |= TX4927_PCFG_DMASEL1_MASK; | ||
293 | dmasel |= TX4927_PCFG_DMASEL1_ACL1; | ||
294 | break; | ||
295 | case 3: | ||
296 | dmasel_mask |= TX4927_PCFG_DMASEL3_MASK; | ||
297 | dmasel |= TX4927_PCFG_DMASEL3_ACL1; | ||
298 | break; | ||
299 | default: | ||
300 | return; | ||
301 | } | ||
302 | local_irq_save(flags); | ||
303 | txx9_clear64(&tx4927_ccfgptr->pcfg, dmasel_mask); | ||
304 | txx9_set64(&tx4927_ccfgptr->pcfg, dmasel); | ||
305 | local_irq_restore(flags); | ||
306 | txx9_aclc_init(TX4927_ACLC_REG & 0xfffffffffULL, | ||
307 | TXX9_IRQ_BASE + TX4927_IR_ACLC, | ||
308 | 0, dma_chan_out, dma_chan_in); | ||
309 | } | ||
310 | |||
256 | static void __init tx4927_stop_unused_modules(void) | 311 | static void __init tx4927_stop_unused_modules(void) |
257 | { | 312 | { |
258 | __u64 pcfg, rst = 0, ckd = 0; | 313 | __u64 pcfg, rst = 0, ckd = 0; |