* [PATCH v4 2/6] sh: add a resource name for shdma
@ 2012-01-11 7:27 Shimoda, Yoshihiro
2012-01-11 9:05 ` Guennadi Liakhovetski
2012-01-12 1:09 ` Shimoda, Yoshihiro
0 siblings, 2 replies; 3+ messages in thread
From: Shimoda, Yoshihiro @ 2012-01-11 7:27 UTC (permalink / raw)
To: linux-sh
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
---
about v4:
- use defination macros for IRQ resource
arch/sh/kernel/cpu/sh4a/setup-sh7722.c | 3 +++
arch/sh/kernel/cpu/sh4a/setup-sh7724.c | 6 ++++++
arch/sh/kernel/cpu/sh4a/setup-sh7757.c | 16 ++++++++++++++++
arch/sh/kernel/cpu/sh4a/setup-sh7780.c | 2 ++
arch/sh/kernel/cpu/sh4a/setup-sh7785.c | 2 ++
arch/sh/kernel/cpu/sh4a/setup-sh7786.c | 2 ++
6 files changed, 31 insertions(+), 0 deletions(-)
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7722.c b/arch/sh/kernel/cpu/sh4a/setup-sh7722.c
index 278a0e5..8d9c809 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7722.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7722.c
@@ -147,18 +147,21 @@ static struct resource sh7722_dmae_resources[] = {
},
{
/* DMA error IRQ */
+ .name = SH_DMA_IRQ_ERROR,
.start = 78,
.end = 78,
.flags = IORESOURCE_IRQ,
},
{
/* IRQ for channels 0-3 */
+ .name = SH_DMA_IRQ_CHANNEL,
.start = 48,
.end = 51,
.flags = IORESOURCE_IRQ,
},
{
/* IRQ for channels 4-5 */
+ .name = SH_DMA_IRQ_CHANNEL,
.start = 76,
.end = 77,
.flags = IORESOURCE_IRQ,
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7724.c b/arch/sh/kernel/cpu/sh4a/setup-sh7724.c
index a37dd72..f657054 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7724.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7724.c
@@ -215,18 +215,21 @@ static struct resource sh7724_dmae0_resources[] = {
},
{
/* DMA error IRQ */
+ .name = SH_DMA_IRQ_ERROR,
.start = 78,
.end = 78,
.flags = IORESOURCE_IRQ,
},
{
/* IRQ for channels 0-3 */
+ .name = SH_DMA_IRQ_CHANNEL,
.start = 48,
.end = 51,
.flags = IORESOURCE_IRQ,
},
{
/* IRQ for channels 4-5 */
+ .name = SH_DMA_IRQ_CHANNEL,
.start = 76,
.end = 77,
.flags = IORESOURCE_IRQ,
@@ -249,18 +252,21 @@ static struct resource sh7724_dmae1_resources[] = {
},
{
/* DMA error IRQ */
+ .name = SH_DMA_IRQ_ERROR,
.start = 74,
.end = 74,
.flags = IORESOURCE_IRQ,
},
{
/* IRQ for channels 0-3 */
+ .name = SH_DMA_IRQ_CHANNEL,
.start = 40,
.end = 43,
.flags = IORESOURCE_IRQ,
},
{
/* IRQ for channels 4-5 */
+ .name = SH_DMA_IRQ_CHANNEL,
.start = 72,
.end = 73,
.flags = IORESOURCE_IRQ,
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7757.c b/arch/sh/kernel/cpu/sh4a/setup-sh7757.c
index 0555929..cf2667a 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7757.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7757.c
@@ -465,6 +465,7 @@ static struct resource sh7757_dmae0_resources[] = {
.flags = IORESOURCE_MEM,
},
{
+ .name = SH_DMA_IRQ_ERROR,
.start = 34,
.end = 34,
.flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE,
@@ -487,54 +488,63 @@ static struct resource sh7757_dmae1_resources[] = {
},
{
/* DMA error */
+ .name = SH_DMA_IRQ_ERROR,
.start = 34,
.end = 34,
.flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE,
},
{
/* IRQ for channels 4 */
+ .name = SH_DMA_IRQ_CHANNEL,
.start = 46,
.end = 46,
.flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE,
},
{
/* IRQ for channels 5 */
+ .name = SH_DMA_IRQ_CHANNEL,
.start = 46,
.end = 46,
.flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE,
},
{
/* IRQ for channels 6 */
+ .name = SH_DMA_IRQ_CHANNEL,
.start = 88,
.end = 88,
.flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE,
},
{
/* IRQ for channels 7 */
+ .name = SH_DMA_IRQ_CHANNEL,
.start = 88,
.end = 88,
.flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE,
},
{
/* IRQ for channels 8 */
+ .name = SH_DMA_IRQ_CHANNEL,
.start = 88,
.end = 88,
.flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE,
},
{
/* IRQ for channels 9 */
+ .name = SH_DMA_IRQ_CHANNEL,
.start = 88,
.end = 88,
.flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE,
},
{
/* IRQ for channels 10 */
+ .name = SH_DMA_IRQ_CHANNEL,
.start = 88,
.end = 88,
.flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE,
},
{
/* IRQ for channels 11 */
+ .name = SH_DMA_IRQ_CHANNEL,
.start = 88,
.end = 88,
.flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE,
@@ -557,18 +567,21 @@ static struct resource sh7757_dmae2_resources[] = {
},
{
/* DMA error */
+ .name = SH_DMA_IRQ_ERROR,
.start = 323,
.end = 323,
.flags = IORESOURCE_IRQ,
},
{
/* IRQ for channels 12 to 16 */
+ .name = SH_DMA_IRQ_CHANNEL,
.start = 272,
.end = 276,
.flags = IORESOURCE_IRQ,
},
{
/* IRQ for channel 17 */
+ .name = SH_DMA_IRQ_CHANNEL,
.start = 279,
.end = 279,
.flags = IORESOURCE_IRQ,
@@ -591,18 +604,21 @@ static struct resource sh7757_dmae3_resources[] = {
},
{
/* DMA error */
+ .name = SH_DMA_IRQ_ERROR,
.start = 324,
.end = 324,
.flags = IORESOURCE_IRQ,
},
{
/* IRQ for channels 18 to 22 */
+ .name = SH_DMA_IRQ_CHANNEL,
.start = 280,
.end = 284,
.flags = IORESOURCE_IRQ,
},
{
/* IRQ for channel 23 */
+ .name = SH_DMA_IRQ_CHANNEL,
.start = 288,
.end = 288,
.flags = IORESOURCE_IRQ,
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7780.c b/arch/sh/kernel/cpu/sh4a/setup-sh7780.c
index 3d4d207..cd8d1e9 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7780.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7780.c
@@ -322,6 +322,7 @@ static struct resource sh7780_dmae0_resources[] = {
},
{
/* Real DMA error IRQ is 38, and channel IRQs are 34-37, 44-45 */
+ .name = SH_DMA_IRQ_ERROR,
.start = 34,
.end = 34,
.flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE,
@@ -338,6 +339,7 @@ static struct resource sh7780_dmae1_resources[] = {
/* DMAC1 has no DMARS */
{
/* Real DMA error IRQ is 38, and channel IRQs are 46-47, 92-95 */
+ .name = SH_DMA_IRQ_ERROR,
.start = 46,
.end = 46,
.flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE,
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7785.c b/arch/sh/kernel/cpu/sh4a/setup-sh7785.c
index b29e634..1cdb9ec 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7785.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7785.c
@@ -376,6 +376,7 @@ static struct resource sh7785_dmae0_resources[] = {
},
{
/* Real DMA error IRQ is 39, and channel IRQs are 33-38 */
+ .name = SH_DMA_IRQ_ERROR,
.start = 33,
.end = 33,
.flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE,
@@ -392,6 +393,7 @@ static struct resource sh7785_dmae1_resources[] = {
/* DMAC1 has no DMARS */
{
/* Real DMA error IRQ is 58, and channel IRQs are 52-57 */
+ .name = SH_DMA_IRQ_ERROR,
.start = 52,
.end = 52,
.flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE,
diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7786.c b/arch/sh/kernel/cpu/sh4a/setup-sh7786.c
index dd5e709..6025d26 100644
--- a/arch/sh/kernel/cpu/sh4a/setup-sh7786.c
+++ b/arch/sh/kernel/cpu/sh4a/setup-sh7786.c
@@ -519,11 +519,13 @@ static struct resource dmac0_resources[] = {
.flags = IORESOURCE_MEM,
}, {
/* DMA error IRQ */
+ .name = SH_DMA_IRQ_ERROR,
.start = evt2irq(0x5c0),
.end = evt2irq(0x5c0),
.flags = IORESOURCE_IRQ,
}, {
/* IRQ for channels 0-5 */
+ .name = SH_DMA_IRQ_CHANNEL,
.start = evt2irq(0x500),
.end = evt2irq(0x5a0),
.flags = IORESOURCE_IRQ,
--
1.7.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v4 2/6] sh: add a resource name for shdma
2012-01-11 7:27 [PATCH v4 2/6] sh: add a resource name for shdma Shimoda, Yoshihiro
@ 2012-01-11 9:05 ` Guennadi Liakhovetski
2012-01-12 1:09 ` Shimoda, Yoshihiro
1 sibling, 0 replies; 3+ messages in thread
From: Guennadi Liakhovetski @ 2012-01-11 9:05 UTC (permalink / raw)
To: linux-sh
Unrelated to your patch, just something that caught my eye:
On Wed, 11 Jan 2012, Shimoda, Yoshihiro wrote:
> Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
> ---
> about v4:
> - use defination macros for IRQ resource
>
> arch/sh/kernel/cpu/sh4a/setup-sh7722.c | 3 +++
> arch/sh/kernel/cpu/sh4a/setup-sh7724.c | 6 ++++++
> arch/sh/kernel/cpu/sh4a/setup-sh7757.c | 16 ++++++++++++++++
> arch/sh/kernel/cpu/sh4a/setup-sh7780.c | 2 ++
> arch/sh/kernel/cpu/sh4a/setup-sh7785.c | 2 ++
> arch/sh/kernel/cpu/sh4a/setup-sh7786.c | 2 ++
> 6 files changed, 31 insertions(+), 0 deletions(-)
[snip]
> diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7780.c b/arch/sh/kernel/cpu/sh4a/setup-sh7780.c
> index 3d4d207..cd8d1e9 100644
> --- a/arch/sh/kernel/cpu/sh4a/setup-sh7780.c
> +++ b/arch/sh/kernel/cpu/sh4a/setup-sh7780.c
> @@ -322,6 +322,7 @@ static struct resource sh7780_dmae0_resources[] = {
> },
> {
> /* Real DMA error IRQ is 38, and channel IRQs are 34-37, 44-45 */
> + .name = SH_DMA_IRQ_ERROR,
> .start = 34,
> .end = 34,
> .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE,
> @@ -338,6 +339,7 @@ static struct resource sh7780_dmae1_resources[] = {
> /* DMAC1 has no DMARS */
> {
> /* Real DMA error IRQ is 38, and channel IRQs are 46-47, 92-95 */
> + .name = SH_DMA_IRQ_ERROR,
> .start = 46,
> .end = 46,
> .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE,
> diff --git a/arch/sh/kernel/cpu/sh4a/setup-sh7785.c b/arch/sh/kernel/cpu/sh4a/setup-sh7785.c
> index b29e634..1cdb9ec 100644
> --- a/arch/sh/kernel/cpu/sh4a/setup-sh7785.c
> +++ b/arch/sh/kernel/cpu/sh4a/setup-sh7785.c
> @@ -376,6 +376,7 @@ static struct resource sh7785_dmae0_resources[] = {
> },
> {
> /* Real DMA error IRQ is 39, and channel IRQs are 33-38 */
> + .name = SH_DMA_IRQ_ERROR,
> .start = 33,
> .end = 33,
> .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE,
> @@ -392,6 +393,7 @@ static struct resource sh7785_dmae1_resources[] = {
> /* DMAC1 has no DMARS */
> {
> /* Real DMA error IRQ is 58, and channel IRQs are 52-57 */
> + .name = SH_DMA_IRQ_ERROR,
> .start = 52,
> .end = 52,
> .flags = IORESOURCE_IRQ | IORESOURCE_IRQ_SHAREABLE,
The above two platforms seem incorrect. Back then, as I switched sh_dma.c
to use resources for interrupts [1], I just reproduced the behaviour of
the original driver, but a verification with the header or the datasheet
shows, that sh7780 and sh7785 have separate interrupts per channel, so, if
anyone cares about those platforms, they might need a fix.
Thanks
Guennadi
[1] http://thread.gmane.org/gmane.linux.ports.sh.devel/7269/focusr70
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v4 2/6] sh: add a resource name for shdma
2012-01-11 7:27 [PATCH v4 2/6] sh: add a resource name for shdma Shimoda, Yoshihiro
2012-01-11 9:05 ` Guennadi Liakhovetski
@ 2012-01-12 1:09 ` Shimoda, Yoshihiro
1 sibling, 0 replies; 3+ messages in thread
From: Shimoda, Yoshihiro @ 2012-01-12 1:09 UTC (permalink / raw)
To: linux-sh
2012/01/11 18:05, Guennadi Liakhovetski wrote:
> Unrelated to your patch, just something that caught my eye:
>
[ snip ]
>
> The above two platforms seem incorrect. Back then, as I switched sh_dma.c
> to use resources for interrupts [1], I just reproduced the behaviour of
> the original driver, but a verification with the header or the datasheet
> shows, that sh7780 and sh7785 have separate interrupts per channel, so, if
> anyone cares about those platforms, they might need a fix.
The interrupts of SH7780 DMAC and Sh7785 DMAC are strange.
Would you check the commit bdaa6e8062 "sh: multiple vectors per irq - base"?
- The SH7780 and SH7785 have separate INTEVT per channel, but the INT2MSKR
for the DMAC has one bit.
-- In this case, the commit log says:
"If multiple vectors shar the same enum then only the
first vector will be avilable as a linux irq."
- I think that the DMTE4_IRQ of SH7780 and SH7785 in
the "arch/sh/include/cpu-sh4/cpu/dma-sh4a.h" is breaking.
But, the old DMA API driver doesn't use this actually because the get_dmte_irq()
in dma-sh.c will change the IRQ number...
Best regards,
Yoshihiro Shimoda
> Thanks
> Guennadi
>
> [1] http://thread.gmane.org/gmane.linux.ports.sh.devel/7269/focusr70
> ---
> Guennadi Liakhovetski, Ph.D.
> Freelance Open-Source Software Developer
> http://www.open-technology.de/
>
--
Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
EC No.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-01-12 1:09 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-11 7:27 [PATCH v4 2/6] sh: add a resource name for shdma Shimoda, Yoshihiro
2012-01-11 9:05 ` Guennadi Liakhovetski
2012-01-12 1:09 ` Shimoda, Yoshihiro
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).