diff options
author | Paul Mundt <lethal@linux-sh.org> | 2011-08-29 03:42:06 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2011-08-29 03:42:06 -0400 |
commit | b58c580d996655658975aa8042b43b7d579f3986 (patch) | |
tree | 60ddd845ad49ad99702a7d7d7721ce3aebb37394 /arch/arm | |
parent | 09dafe9e4e266c7868454a532c9ca762aa5c40a5 (diff) | |
parent | a408baea3cdd2a7b5ad3d70080dff454b8883f62 (diff) |
Merge branch 'rmobile-fixes-for-linus' into rmobile-latest
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/mach-shmobile/clock-sh7372.c | 23 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/clock-sh73a0.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/include/mach/sh7372.h | 4 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/intc-sh7372.c | 7 | ||||
-rw-r--r-- | arch/arm/mach-shmobile/setup-sh7372.c | 146 |
5 files changed, 173 insertions, 9 deletions
diff --git a/arch/arm/mach-shmobile/clock-sh7372.c b/arch/arm/mach-shmobile/clock-sh7372.c index dc8c899aa5eb..c250e23ce373 100644 --- a/arch/arm/mach-shmobile/clock-sh7372.c +++ b/arch/arm/mach-shmobile/clock-sh7372.c | |||
@@ -503,16 +503,17 @@ static struct clk *late_main_clks[] = { | |||
503 | &sh7372_fsidivb_clk, | 503 | &sh7372_fsidivb_clk, |
504 | }; | 504 | }; |
505 | 505 | ||
506 | enum { MSTP001, | 506 | enum { MSTP001, MSTP000, |
507 | MSTP131, MSTP130, | 507 | MSTP131, MSTP130, |
508 | MSTP129, MSTP128, MSTP127, MSTP126, MSTP125, | 508 | MSTP129, MSTP128, MSTP127, MSTP126, MSTP125, |
509 | MSTP118, MSTP117, MSTP116, MSTP113, | 509 | MSTP118, MSTP117, MSTP116, MSTP113, |
510 | MSTP106, MSTP101, MSTP100, | 510 | MSTP106, MSTP101, MSTP100, |
511 | MSTP223, | 511 | MSTP223, |
512 | MSTP218, MSTP217, MSTP216, | 512 | MSTP218, MSTP217, MSTP216, MSTP214, MSTP208, MSTP207, |
513 | MSTP207, MSTP206, MSTP204, MSTP203, MSTP202, MSTP201, MSTP200, | 513 | MSTP206, MSTP205, MSTP204, MSTP203, MSTP202, MSTP201, MSTP200, |
514 | MSTP328, MSTP323, MSTP322, MSTP314, MSTP313, MSTP312, | 514 | MSTP328, MSTP323, MSTP322, MSTP314, MSTP313, MSTP312, |
515 | MSTP423, MSTP415, MSTP413, MSTP411, MSTP410, MSTP406, MSTP403, MSTP400, | 515 | MSTP423, MSTP415, MSTP413, MSTP411, MSTP410, MSTP407, MSTP406, |
516 | MSTP405, MSTP404, MSTP403, MSTP400, | ||
516 | MSTP_NR }; | 517 | MSTP_NR }; |
517 | 518 | ||
518 | #define MSTP(_parent, _reg, _bit, _flags) \ | 519 | #define MSTP(_parent, _reg, _bit, _flags) \ |
@@ -520,6 +521,7 @@ enum { MSTP001, | |||
520 | 521 | ||
521 | static struct clk mstp_clks[MSTP_NR] = { | 522 | static struct clk mstp_clks[MSTP_NR] = { |
522 | [MSTP001] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR0, 1, 0), /* IIC2 */ | 523 | [MSTP001] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR0, 1, 0), /* IIC2 */ |
524 | [MSTP000] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR0, 0, 0), /* MSIOF0 */ | ||
523 | [MSTP131] = MSTP(&div4_clks[DIV4_B], SMSTPCR1, 31, 0), /* VEU3 */ | 525 | [MSTP131] = MSTP(&div4_clks[DIV4_B], SMSTPCR1, 31, 0), /* VEU3 */ |
524 | [MSTP130] = MSTP(&div4_clks[DIV4_B], SMSTPCR1, 30, 0), /* VEU2 */ | 526 | [MSTP130] = MSTP(&div4_clks[DIV4_B], SMSTPCR1, 30, 0), /* VEU2 */ |
525 | [MSTP129] = MSTP(&div4_clks[DIV4_B], SMSTPCR1, 29, 0), /* VEU1 */ | 527 | [MSTP129] = MSTP(&div4_clks[DIV4_B], SMSTPCR1, 29, 0), /* VEU1 */ |
@@ -538,8 +540,11 @@ static struct clk mstp_clks[MSTP_NR] = { | |||
538 | [MSTP218] = MSTP(&div4_clks[DIV4_HP], SMSTPCR2, 18, 0), /* DMAC1 */ | 540 | [MSTP218] = MSTP(&div4_clks[DIV4_HP], SMSTPCR2, 18, 0), /* DMAC1 */ |
539 | [MSTP217] = MSTP(&div4_clks[DIV4_HP], SMSTPCR2, 17, 0), /* DMAC2 */ | 541 | [MSTP217] = MSTP(&div4_clks[DIV4_HP], SMSTPCR2, 17, 0), /* DMAC2 */ |
540 | [MSTP216] = MSTP(&div4_clks[DIV4_HP], SMSTPCR2, 16, 0), /* DMAC3 */ | 542 | [MSTP216] = MSTP(&div4_clks[DIV4_HP], SMSTPCR2, 16, 0), /* DMAC3 */ |
543 | [MSTP214] = MSTP(&div4_clks[DIV4_HP], SMSTPCR2, 14, 0), /* USBDMAC */ | ||
544 | [MSTP208] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 8, 0), /* MSIOF1 */ | ||
541 | [MSTP207] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 7, 0), /* SCIFA5 */ | 545 | [MSTP207] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 7, 0), /* SCIFA5 */ |
542 | [MSTP206] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 6, 0), /* SCIFB */ | 546 | [MSTP206] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 6, 0), /* SCIFB */ |
547 | [MSTP205] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 5, 0), /* MSIOF2 */ | ||
543 | [MSTP204] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 4, 0), /* SCIFA0 */ | 548 | [MSTP204] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 4, 0), /* SCIFA0 */ |
544 | [MSTP203] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 3, 0), /* SCIFA1 */ | 549 | [MSTP203] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 3, 0), /* SCIFA1 */ |
545 | [MSTP202] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 2, 0), /* SCIFA2 */ | 550 | [MSTP202] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR2, 2, 0), /* SCIFA2 */ |
@@ -556,7 +561,10 @@ static struct clk mstp_clks[MSTP_NR] = { | |||
556 | [MSTP413] = MSTP(&pllc1_div2_clk, SMSTPCR4, 13, 0), /* HDMI */ | 561 | [MSTP413] = MSTP(&pllc1_div2_clk, SMSTPCR4, 13, 0), /* HDMI */ |
557 | [MSTP411] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR4, 11, 0), /* IIC3 */ | 562 | [MSTP411] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR4, 11, 0), /* IIC3 */ |
558 | [MSTP410] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR4, 10, 0), /* IIC4 */ | 563 | [MSTP410] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR4, 10, 0), /* IIC4 */ |
564 | [MSTP407] = MSTP(&div4_clks[DIV4_HP], SMSTPCR4, 7, 0), /* USB-DMAC1 */ | ||
559 | [MSTP406] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR4, 6, 0), /* USB1 */ | 565 | [MSTP406] = MSTP(&div6_clks[DIV6_SUB], SMSTPCR4, 6, 0), /* USB1 */ |
566 | [MSTP405] = MSTP(&r_clk, SMSTPCR4, 5, 0), /* CMT4 */ | ||
567 | [MSTP404] = MSTP(&r_clk, SMSTPCR4, 4, 0), /* CMT3 */ | ||
560 | [MSTP403] = MSTP(&r_clk, SMSTPCR4, 3, 0), /* KEYSC */ | 568 | [MSTP403] = MSTP(&r_clk, SMSTPCR4, 3, 0), /* KEYSC */ |
561 | [MSTP400] = MSTP(&r_clk, SMSTPCR4, 0, 0), /* CMT2 */ | 569 | [MSTP400] = MSTP(&r_clk, SMSTPCR4, 0, 0), /* CMT2 */ |
562 | }; | 570 | }; |
@@ -609,6 +617,7 @@ static struct clk_lookup lookups[] = { | |||
609 | 617 | ||
610 | /* MSTP32 clocks */ | 618 | /* MSTP32 clocks */ |
611 | CLKDEV_DEV_ID("i2c-sh_mobile.2", &mstp_clks[MSTP001]), /* IIC2 */ | 619 | CLKDEV_DEV_ID("i2c-sh_mobile.2", &mstp_clks[MSTP001]), /* IIC2 */ |
620 | CLKDEV_DEV_ID("spi_sh_msiof.0", &mstp_clks[MSTP000]), /* MSIOF0 */ | ||
612 | CLKDEV_DEV_ID("uio_pdrv_genirq.4", &mstp_clks[MSTP131]), /* VEU3 */ | 621 | CLKDEV_DEV_ID("uio_pdrv_genirq.4", &mstp_clks[MSTP131]), /* VEU3 */ |
613 | CLKDEV_DEV_ID("uio_pdrv_genirq.3", &mstp_clks[MSTP130]), /* VEU2 */ | 622 | CLKDEV_DEV_ID("uio_pdrv_genirq.3", &mstp_clks[MSTP130]), /* VEU2 */ |
614 | CLKDEV_DEV_ID("uio_pdrv_genirq.2", &mstp_clks[MSTP129]), /* VEU1 */ | 623 | CLKDEV_DEV_ID("uio_pdrv_genirq.2", &mstp_clks[MSTP129]), /* VEU1 */ |
@@ -629,8 +638,11 @@ static struct clk_lookup lookups[] = { | |||
629 | CLKDEV_DEV_ID("sh-dma-engine.0", &mstp_clks[MSTP218]), /* DMAC1 */ | 638 | CLKDEV_DEV_ID("sh-dma-engine.0", &mstp_clks[MSTP218]), /* DMAC1 */ |
630 | CLKDEV_DEV_ID("sh-dma-engine.1", &mstp_clks[MSTP217]), /* DMAC2 */ | 639 | CLKDEV_DEV_ID("sh-dma-engine.1", &mstp_clks[MSTP217]), /* DMAC2 */ |
631 | CLKDEV_DEV_ID("sh-dma-engine.2", &mstp_clks[MSTP216]), /* DMAC3 */ | 640 | CLKDEV_DEV_ID("sh-dma-engine.2", &mstp_clks[MSTP216]), /* DMAC3 */ |
641 | CLKDEV_DEV_ID("sh-dma-engine.3", &mstp_clks[MSTP214]), /* USB-DMAC0 */ | ||
642 | CLKDEV_DEV_ID("spi_sh_msiof.1", &mstp_clks[MSTP208]), /* MSIOF1 */ | ||
632 | CLKDEV_DEV_ID("sh-sci.5", &mstp_clks[MSTP207]), /* SCIFA5 */ | 643 | CLKDEV_DEV_ID("sh-sci.5", &mstp_clks[MSTP207]), /* SCIFA5 */ |
633 | CLKDEV_DEV_ID("sh-sci.6", &mstp_clks[MSTP206]), /* SCIFB */ | 644 | CLKDEV_DEV_ID("sh-sci.6", &mstp_clks[MSTP206]), /* SCIFB */ |
645 | CLKDEV_DEV_ID("spi_sh_msiof.2", &mstp_clks[MSTP205]), /* MSIOF2 */ | ||
634 | CLKDEV_DEV_ID("sh-sci.0", &mstp_clks[MSTP204]), /* SCIFA0 */ | 646 | CLKDEV_DEV_ID("sh-sci.0", &mstp_clks[MSTP204]), /* SCIFA0 */ |
635 | CLKDEV_DEV_ID("sh-sci.1", &mstp_clks[MSTP203]), /* SCIFA1 */ | 647 | CLKDEV_DEV_ID("sh-sci.1", &mstp_clks[MSTP203]), /* SCIFA1 */ |
636 | CLKDEV_DEV_ID("sh-sci.2", &mstp_clks[MSTP202]), /* SCIFA2 */ | 648 | CLKDEV_DEV_ID("sh-sci.2", &mstp_clks[MSTP202]), /* SCIFA2 */ |
@@ -649,9 +661,12 @@ static struct clk_lookup lookups[] = { | |||
649 | CLKDEV_DEV_ID("sh-mobile-hdmi", &mstp_clks[MSTP413]), /* HDMI */ | 661 | CLKDEV_DEV_ID("sh-mobile-hdmi", &mstp_clks[MSTP413]), /* HDMI */ |
650 | CLKDEV_DEV_ID("i2c-sh_mobile.3", &mstp_clks[MSTP411]), /* IIC3 */ | 662 | CLKDEV_DEV_ID("i2c-sh_mobile.3", &mstp_clks[MSTP411]), /* IIC3 */ |
651 | CLKDEV_DEV_ID("i2c-sh_mobile.4", &mstp_clks[MSTP410]), /* IIC4 */ | 663 | CLKDEV_DEV_ID("i2c-sh_mobile.4", &mstp_clks[MSTP410]), /* IIC4 */ |
664 | CLKDEV_DEV_ID("sh-dma-engine.4", &mstp_clks[MSTP407]), /* USB-DMAC1 */ | ||
652 | CLKDEV_DEV_ID("r8a66597_hcd.1", &mstp_clks[MSTP406]), /* USB1 */ | 665 | CLKDEV_DEV_ID("r8a66597_hcd.1", &mstp_clks[MSTP406]), /* USB1 */ |
653 | CLKDEV_DEV_ID("r8a66597_udc.1", &mstp_clks[MSTP406]), /* USB1 */ | 666 | CLKDEV_DEV_ID("r8a66597_udc.1", &mstp_clks[MSTP406]), /* USB1 */ |
654 | CLKDEV_DEV_ID("renesas_usbhs.1", &mstp_clks[MSTP406]), /* USB1 */ | 667 | CLKDEV_DEV_ID("renesas_usbhs.1", &mstp_clks[MSTP406]), /* USB1 */ |
668 | CLKDEV_DEV_ID("sh_cmt.4", &mstp_clks[MSTP405]), /* CMT4 */ | ||
669 | CLKDEV_DEV_ID("sh_cmt.3", &mstp_clks[MSTP404]), /* CMT3 */ | ||
655 | CLKDEV_DEV_ID("sh_keysc.0", &mstp_clks[MSTP403]), /* KEYSC */ | 670 | CLKDEV_DEV_ID("sh_keysc.0", &mstp_clks[MSTP403]), /* KEYSC */ |
656 | CLKDEV_DEV_ID("sh_cmt.2", &mstp_clks[MSTP400]), /* CMT2 */ | 671 | CLKDEV_DEV_ID("sh_cmt.2", &mstp_clks[MSTP400]), /* CMT2 */ |
657 | 672 | ||
diff --git a/arch/arm/mach-shmobile/clock-sh73a0.c b/arch/arm/mach-shmobile/clock-sh73a0.c index 6db2ccabc2bf..61a846bb30f2 100644 --- a/arch/arm/mach-shmobile/clock-sh73a0.c +++ b/arch/arm/mach-shmobile/clock-sh73a0.c | |||
@@ -365,7 +365,7 @@ void __init sh73a0_clock_init(void) | |||
365 | __raw_writel(0x108, SD2CKCR); | 365 | __raw_writel(0x108, SD2CKCR); |
366 | 366 | ||
367 | /* detect main clock parent */ | 367 | /* detect main clock parent */ |
368 | switch ((__raw_readl(CKSCR) >> 24) & 0x03) { | 368 | switch ((__raw_readl(CKSCR) >> 28) & 0x03) { |
369 | case 0: | 369 | case 0: |
370 | main_clk.parent = &sh73a0_extal1_clk; | 370 | main_clk.parent = &sh73a0_extal1_clk; |
371 | break; | 371 | break; |
diff --git a/arch/arm/mach-shmobile/include/mach/sh7372.h b/arch/arm/mach-shmobile/include/mach/sh7372.h index ce595cee86cd..24e63a85e669 100644 --- a/arch/arm/mach-shmobile/include/mach/sh7372.h +++ b/arch/arm/mach-shmobile/include/mach/sh7372.h | |||
@@ -459,6 +459,10 @@ enum { | |||
459 | SHDMA_SLAVE_SDHI2_TX, | 459 | SHDMA_SLAVE_SDHI2_TX, |
460 | SHDMA_SLAVE_MMCIF_RX, | 460 | SHDMA_SLAVE_MMCIF_RX, |
461 | SHDMA_SLAVE_MMCIF_TX, | 461 | SHDMA_SLAVE_MMCIF_TX, |
462 | SHDMA_SLAVE_USB0_TX, | ||
463 | SHDMA_SLAVE_USB0_RX, | ||
464 | SHDMA_SLAVE_USB1_TX, | ||
465 | SHDMA_SLAVE_USB1_RX, | ||
462 | }; | 466 | }; |
463 | 467 | ||
464 | extern struct clk sh7372_extal1_clk; | 468 | extern struct clk sh7372_extal1_clk; |
diff --git a/arch/arm/mach-shmobile/intc-sh7372.c b/arch/arm/mach-shmobile/intc-sh7372.c index 3b28743c77eb..739315e30eb9 100644 --- a/arch/arm/mach-shmobile/intc-sh7372.c +++ b/arch/arm/mach-shmobile/intc-sh7372.c | |||
@@ -379,7 +379,7 @@ enum { | |||
379 | /* BBIF2 */ | 379 | /* BBIF2 */ |
380 | VPU, | 380 | VPU, |
381 | TSIF1, | 381 | TSIF1, |
382 | _3DG_SGX530, | 382 | /* 3DG */ |
383 | _2DDMAC, | 383 | _2DDMAC, |
384 | IIC2_ALI2, IIC2_TACKI2, IIC2_WAITI2, IIC2_DTEI2, | 384 | IIC2_ALI2, IIC2_TACKI2, IIC2_WAITI2, IIC2_DTEI2, |
385 | IPMMU_IPMMUR, IPMMU_IPMMUR2, | 385 | IPMMU_IPMMUR, IPMMU_IPMMUR2, |
@@ -436,7 +436,7 @@ static struct intc_vect intcs_vectors[] = { | |||
436 | /* BBIF2 */ | 436 | /* BBIF2 */ |
437 | INTCS_VECT(VPU, 0x980), | 437 | INTCS_VECT(VPU, 0x980), |
438 | INTCS_VECT(TSIF1, 0x9a0), | 438 | INTCS_VECT(TSIF1, 0x9a0), |
439 | INTCS_VECT(_3DG_SGX530, 0x9e0), | 439 | /* 3DG */ |
440 | INTCS_VECT(_2DDMAC, 0xa00), | 440 | INTCS_VECT(_2DDMAC, 0xa00), |
441 | INTCS_VECT(IIC2_ALI2, 0xa80), INTCS_VECT(IIC2_TACKI2, 0xaa0), | 441 | INTCS_VECT(IIC2_ALI2, 0xa80), INTCS_VECT(IIC2_TACKI2, 0xaa0), |
442 | INTCS_VECT(IIC2_WAITI2, 0xac0), INTCS_VECT(IIC2_DTEI2, 0xae0), | 442 | INTCS_VECT(IIC2_WAITI2, 0xac0), INTCS_VECT(IIC2_DTEI2, 0xae0), |
@@ -521,7 +521,7 @@ static struct intc_mask_reg intcs_mask_registers[] = { | |||
521 | RTDMAC_1_DEI3, RTDMAC_1_DEI2, RTDMAC_1_DEI1, RTDMAC_1_DEI0 } }, | 521 | RTDMAC_1_DEI3, RTDMAC_1_DEI2, RTDMAC_1_DEI1, RTDMAC_1_DEI0 } }, |
522 | { 0xffd20198, 0xffd201d8, 8, /* IMR6SA / IMCR6SA */ | 522 | { 0xffd20198, 0xffd201d8, 8, /* IMR6SA / IMCR6SA */ |
523 | { 0, 0, MSIOF, 0, | 523 | { 0, 0, MSIOF, 0, |
524 | _3DG_SGX530, 0, 0, 0 } }, | 524 | 0, 0, 0, 0 } }, |
525 | { 0xffd2019c, 0xffd201dc, 8, /* IMR7SA / IMCR7SA */ | 525 | { 0xffd2019c, 0xffd201dc, 8, /* IMR7SA / IMCR7SA */ |
526 | { 0, TMU_TUNI2, TMU_TUNI1, TMU_TUNI0, | 526 | { 0, TMU_TUNI2, TMU_TUNI1, TMU_TUNI0, |
527 | 0, 0, 0, 0 } }, | 527 | 0, 0, 0, 0 } }, |
@@ -561,7 +561,6 @@ static struct intc_prio_reg intcs_prio_registers[] = { | |||
561 | TMU_TUNI2, TSIF1 } }, | 561 | TMU_TUNI2, TSIF1 } }, |
562 | { 0xffd2001c, 0, 16, 4, /* IPRHS */ { 0, 0, VEU, BEU } }, | 562 | { 0xffd2001c, 0, 16, 4, /* IPRHS */ { 0, 0, VEU, BEU } }, |
563 | { 0xffd20020, 0, 16, 4, /* IPRIS */ { 0, MSIOF, TSIF0, IIC0 } }, | 563 | { 0xffd20020, 0, 16, 4, /* IPRIS */ { 0, MSIOF, TSIF0, IIC0 } }, |
564 | { 0xffd20024, 0, 16, 4, /* IPRJS */ { 0, _3DG_SGX530, 0, 0 } }, | ||
565 | { 0xffd20028, 0, 16, 4, /* IPRKS */ { 0, 0, LMB, 0 } }, | 564 | { 0xffd20028, 0, 16, 4, /* IPRKS */ { 0, 0, LMB, 0 } }, |
566 | { 0xffd2002c, 0, 16, 4, /* IPRLS */ { IPMMU, 0, 0, 0 } }, | 565 | { 0xffd2002c, 0, 16, 4, /* IPRLS */ { IPMMU, 0, 0, 0 } }, |
567 | { 0xffd20030, 0, 16, 4, /* IPRMS */ { IIC2, 0, 0, 0 } }, | 566 | { 0xffd20030, 0, 16, 4, /* IPRMS */ { IIC2, 0, 0, 0 } }, |
diff --git a/arch/arm/mach-shmobile/setup-sh7372.c b/arch/arm/mach-shmobile/setup-sh7372.c index d17d0d2ba5eb..2d9b1b1a2538 100644 --- a/arch/arm/mach-shmobile/setup-sh7372.c +++ b/arch/arm/mach-shmobile/setup-sh7372.c | |||
@@ -602,6 +602,150 @@ static struct platform_device dma2_device = { | |||
602 | }, | 602 | }, |
603 | }; | 603 | }; |
604 | 604 | ||
605 | /* | ||
606 | * USB-DMAC | ||
607 | */ | ||
608 | |||
609 | unsigned int usbts_shift[] = {3, 4, 5}; | ||
610 | |||
611 | enum { | ||
612 | XMIT_SZ_8BYTE = 0, | ||
613 | XMIT_SZ_16BYTE = 1, | ||
614 | XMIT_SZ_32BYTE = 2, | ||
615 | }; | ||
616 | |||
617 | #define USBTS_INDEX2VAL(i) (((i) & 3) << 6) | ||
618 | |||
619 | static const struct sh_dmae_channel sh7372_usb_dmae_channels[] = { | ||
620 | { | ||
621 | .offset = 0, | ||
622 | }, { | ||
623 | .offset = 0x20, | ||
624 | }, | ||
625 | }; | ||
626 | |||
627 | /* USB DMAC0 */ | ||
628 | static const struct sh_dmae_slave_config sh7372_usb_dmae0_slaves[] = { | ||
629 | { | ||
630 | .slave_id = SHDMA_SLAVE_USB0_TX, | ||
631 | .chcr = USBTS_INDEX2VAL(XMIT_SZ_8BYTE), | ||
632 | }, { | ||
633 | .slave_id = SHDMA_SLAVE_USB0_RX, | ||
634 | .chcr = USBTS_INDEX2VAL(XMIT_SZ_8BYTE), | ||
635 | }, | ||
636 | }; | ||
637 | |||
638 | static struct sh_dmae_pdata usb_dma0_platform_data = { | ||
639 | .slave = sh7372_usb_dmae0_slaves, | ||
640 | .slave_num = ARRAY_SIZE(sh7372_usb_dmae0_slaves), | ||
641 | .channel = sh7372_usb_dmae_channels, | ||
642 | .channel_num = ARRAY_SIZE(sh7372_usb_dmae_channels), | ||
643 | .ts_low_shift = 6, | ||
644 | .ts_low_mask = 0xc0, | ||
645 | .ts_high_shift = 0, | ||
646 | .ts_high_mask = 0, | ||
647 | .ts_shift = usbts_shift, | ||
648 | .ts_shift_num = ARRAY_SIZE(usbts_shift), | ||
649 | .dmaor_init = DMAOR_DME, | ||
650 | .chcr_offset = 0x14, | ||
651 | .chcr_ie_bit = 1 << 5, | ||
652 | .dmaor_is_32bit = 1, | ||
653 | .needs_tend_set = 1, | ||
654 | .no_dmars = 1, | ||
655 | }; | ||
656 | |||
657 | static struct resource sh7372_usb_dmae0_resources[] = { | ||
658 | { | ||
659 | /* Channel registers and DMAOR */ | ||
660 | .start = 0xe68a0020, | ||
661 | .end = 0xe68a0064 - 1, | ||
662 | .flags = IORESOURCE_MEM, | ||
663 | }, | ||
664 | { | ||
665 | /* VCR/SWR/DMICR */ | ||
666 | .start = 0xe68a0000, | ||
667 | .end = 0xe68a0014 - 1, | ||
668 | .flags = IORESOURCE_MEM, | ||
669 | }, | ||
670 | { | ||
671 | /* IRQ for channels */ | ||
672 | .start = evt2irq(0x0a00), | ||
673 | .end = evt2irq(0x0a00), | ||
674 | .flags = IORESOURCE_IRQ, | ||
675 | }, | ||
676 | }; | ||
677 | |||
678 | static struct platform_device usb_dma0_device = { | ||
679 | .name = "sh-dma-engine", | ||
680 | .id = 3, | ||
681 | .resource = sh7372_usb_dmae0_resources, | ||
682 | .num_resources = ARRAY_SIZE(sh7372_usb_dmae0_resources), | ||
683 | .dev = { | ||
684 | .platform_data = &usb_dma0_platform_data, | ||
685 | }, | ||
686 | }; | ||
687 | |||
688 | /* USB DMAC1 */ | ||
689 | static const struct sh_dmae_slave_config sh7372_usb_dmae1_slaves[] = { | ||
690 | { | ||
691 | .slave_id = SHDMA_SLAVE_USB1_TX, | ||
692 | .chcr = USBTS_INDEX2VAL(XMIT_SZ_8BYTE), | ||
693 | }, { | ||
694 | .slave_id = SHDMA_SLAVE_USB1_RX, | ||
695 | .chcr = USBTS_INDEX2VAL(XMIT_SZ_8BYTE), | ||
696 | }, | ||
697 | }; | ||
698 | |||
699 | static struct sh_dmae_pdata usb_dma1_platform_data = { | ||
700 | .slave = sh7372_usb_dmae1_slaves, | ||
701 | .slave_num = ARRAY_SIZE(sh7372_usb_dmae1_slaves), | ||
702 | .channel = sh7372_usb_dmae_channels, | ||
703 | .channel_num = ARRAY_SIZE(sh7372_usb_dmae_channels), | ||
704 | .ts_low_shift = 6, | ||
705 | .ts_low_mask = 0xc0, | ||
706 | .ts_high_shift = 0, | ||
707 | .ts_high_mask = 0, | ||
708 | .ts_shift = usbts_shift, | ||
709 | .ts_shift_num = ARRAY_SIZE(usbts_shift), | ||
710 | .dmaor_init = DMAOR_DME, | ||
711 | .chcr_offset = 0x14, | ||
712 | .chcr_ie_bit = 1 << 5, | ||
713 | .dmaor_is_32bit = 1, | ||
714 | .needs_tend_set = 1, | ||
715 | .no_dmars = 1, | ||
716 | }; | ||
717 | |||
718 | static struct resource sh7372_usb_dmae1_resources[] = { | ||
719 | { | ||
720 | /* Channel registers and DMAOR */ | ||
721 | .start = 0xe68c0020, | ||
722 | .end = 0xe68c0064 - 1, | ||
723 | .flags = IORESOURCE_MEM, | ||
724 | }, | ||
725 | { | ||
726 | /* VCR/SWR/DMICR */ | ||
727 | .start = 0xe68c0000, | ||
728 | .end = 0xe68c0014 - 1, | ||
729 | .flags = IORESOURCE_MEM, | ||
730 | }, | ||
731 | { | ||
732 | /* IRQ for channels */ | ||
733 | .start = evt2irq(0x1d00), | ||
734 | .end = evt2irq(0x1d00), | ||
735 | .flags = IORESOURCE_IRQ, | ||
736 | }, | ||
737 | }; | ||
738 | |||
739 | static struct platform_device usb_dma1_device = { | ||
740 | .name = "sh-dma-engine", | ||
741 | .id = 4, | ||
742 | .resource = sh7372_usb_dmae1_resources, | ||
743 | .num_resources = ARRAY_SIZE(sh7372_usb_dmae1_resources), | ||
744 | .dev = { | ||
745 | .platform_data = &usb_dma1_platform_data, | ||
746 | }, | ||
747 | }; | ||
748 | |||
605 | /* VPU */ | 749 | /* VPU */ |
606 | static struct uio_info vpu_platform_data = { | 750 | static struct uio_info vpu_platform_data = { |
607 | .name = "VPU5HG", | 751 | .name = "VPU5HG", |
@@ -829,6 +973,8 @@ static struct platform_device *sh7372_late_devices[] __initdata = { | |||
829 | &dma0_device, | 973 | &dma0_device, |
830 | &dma1_device, | 974 | &dma1_device, |
831 | &dma2_device, | 975 | &dma2_device, |
976 | &usb_dma0_device, | ||
977 | &usb_dma1_device, | ||
832 | &vpu_device, | 978 | &vpu_device, |
833 | &veu0_device, | 979 | &veu0_device, |
834 | &veu1_device, | 980 | &veu1_device, |