linux-sh.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH/RFC] spi: sh-msiof: Fix MSIOF address for DMAC
@ 2015-03-15 14:36 Yoshihiro Kaneko
       [not found] ` <1426430192-3271-1-git-send-email-ykaneko0929-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Yoshihiro Kaneko @ 2015-03-15 14:36 UTC (permalink / raw)
  To: linux-spi
  Cc: Geert Uytterhoeven, Mark Brown, Simon Horman, Magnus Damm,
	linux-sh

From: Ryo Kataoka <ryo.kataoka.wt@renesas.com>

MSIOF Base Address H'E6xx can be accessed by CPU and DMAC.
MSIOF Base Address H'E7xx for DMAC was removed from H/W manual.

Signed-off-by: Ryo Kataoka <ryo.kataoka.wt@renesas.com>
Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
---

Hi Geert-san,

I have also found patches to address this problem in DTS files
which seems to be a good way to handle this problem. I plan to send
them separately. I'm unsure if this driver change is also appropriate.


This patch is based on the for-next branch of Mark Brown's spi tree.

 drivers/spi/spi-sh-msiof.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/spi/spi-sh-msiof.c b/drivers/spi/spi-sh-msiof.c
index e57eec0..88ec049 100644
--- a/drivers/spi/spi-sh-msiof.c
+++ b/drivers/spi/spi-sh-msiof.c
@@ -1,6 +1,7 @@
 /*
  * SuperH MSIOF SPI Master Interface
  *
+ * Copyright (C) 2014-2015 Renesas Electronics Corporation
  * Copyright (c) 2009 Magnus Damm
  * Copyright (C) 2014 Glider bvba
  *
@@ -1072,10 +1073,7 @@ static int sh_msiof_request_dma(struct sh_msiof_spi_priv *p)
 		return 0;
 	}
 
-	/* The DMA engine uses the second register set, if present */
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 1);
-	if (!res)
-		res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 
 	master = p->master;
 	master->dma_tx = sh_msiof_request_dma_chan(dev, DMA_MEM_TO_DEV,
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH/RFC] spi: sh-msiof: Fix MSIOF address for DMAC
       [not found] ` <1426430192-3271-1-git-send-email-ykaneko0929-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2015-03-17  9:28   ` Geert Uytterhoeven
  2015-03-19  6:52     ` Simon Horman
  0 siblings, 1 reply; 3+ messages in thread
From: Geert Uytterhoeven @ 2015-03-17  9:28 UTC (permalink / raw)
  To: Yoshihiro Kaneko, Ryo Kataoka
  Cc: linux-spi, Mark Brown, Simon Horman, Magnus Damm, Linux-sh list

Hi Kaneko-san, Kataoka-san,

On Sun, Mar 15, 2015 at 3:36 PM, Yoshihiro Kaneko <ykaneko0929@gmail.com> wrote:
> From: Ryo Kataoka <ryo.kataoka.wt@renesas.com>
>
> MSIOF Base Address H'E6xx can be accessed by CPU and DMAC.
> MSIOF Base Address H'E7xx for DMAC was removed from H/W manual.

"Address 0xE7xx can be accesses only from DMA." was indeed removed.
However, "Note: Address H'E6xx can be accessed only by CPU." is still
there in the latest version of the R-Car Gen2 manual I have (v1.01).
Presumably all of this was copied from another SoC (see below)?

MSIOF DMA seems to work fine on my Koelsch (R-Car M2-W ES1.0) with this patch
(and the DTS changes) applied, though.

> Signed-off-by: Ryo Kataoka <ryo.kataoka.wt@renesas.com>
> Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
> ---
>
> Hi Geert-san,
>
> I have also found patches to address this problem in DTS files
> which seems to be a good way to handle this problem. I plan to send
> them separately. I'm unsure if this driver change is also appropriate.

If there really exist no SoCs where the DMA engine has to access a different
register set than the CPU, then it can be removed from the driver, and from
the binding docs in Documentation/devicetree/bindings/spi/sh-msiof.txt.

However, according to the manuals, SH-Mobile AG5 (sh73a0), R-Mobile APE6
(r8a73a4), and R-Mobile A1 (r8a7740) also have MSIOF blocks with two register
banks?

Thanks!

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH/RFC] spi: sh-msiof: Fix MSIOF address for DMAC
  2015-03-17  9:28   ` Geert Uytterhoeven
@ 2015-03-19  6:52     ` Simon Horman
  0 siblings, 0 replies; 3+ messages in thread
From: Simon Horman @ 2015-03-19  6:52 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Yoshihiro Kaneko, Ryo Kataoka, linux-spi, Mark Brown, Magnus Damm,
	Linux-sh list

Hi Geert,

On Tue, Mar 17, 2015 at 10:28:22AM +0100, Geert Uytterhoeven wrote:
> Hi Kaneko-san, Kataoka-san,
> 
> On Sun, Mar 15, 2015 at 3:36 PM, Yoshihiro Kaneko <ykaneko0929@gmail.com> wrote:
> > From: Ryo Kataoka <ryo.kataoka.wt@renesas.com>
> >
> > MSIOF Base Address H'E6xx can be accessed by CPU and DMAC.
> > MSIOF Base Address H'E7xx for DMAC was removed from H/W manual.
> 
> "Address 0xE7xx can be accesses only from DMA." was indeed removed.
> However, "Note: Address H'E6xx can be accessed only by CPU." is still
> there in the latest version of the R-Car Gen2 manual I have (v1.01).

Thanks, somehow I miss-read the H'E6xx portion of the manual when
I looked over this patch prior to Kaneko-san posting it.

> Presumably all of this was copied from another SoC (see below)?
>
> MSIOF DMA seems to work fine on my Koelsch (R-Car M2-W ES1.0) with this patch
> (and the DTS changes) applied, though.
>
> > Signed-off-by: Ryo Kataoka <ryo.kataoka.wt@renesas.com>
> > Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
> > ---
> >
> > Hi Geert-san,
> >
> > I have also found patches to address this problem in DTS files
> > which seems to be a good way to handle this problem. I plan to send
> > them separately. I'm unsure if this driver change is also appropriate.
> 
> If there really exist no SoCs where the DMA engine has to access a different
> register set than the CPU, then it can be removed from the driver, and from
> the binding docs in Documentation/devicetree/bindings/spi/sh-msiof.txt.
> 
> However, according to the manuals, SH-Mobile AG5 (sh73a0), R-Mobile APE6
> (r8a73a4), and R-Mobile A1 (r8a7740) also have MSIOF blocks with two register
> banks?

Looking over the documentation for those SoCs, yes that does seem to be the
case. And for the APE6 (I have v0.7 of the manual) it specifies 0xE6xx can
only be accessed by CPU while 0xE7xx can be accessed only from DMA. Unless
that documentation is wrong then it seems to support leaving the driver as is.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-03-19  6:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-15 14:36 [PATCH/RFC] spi: sh-msiof: Fix MSIOF address for DMAC Yoshihiro Kaneko
     [not found] ` <1426430192-3271-1-git-send-email-ykaneko0929-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-03-17  9:28   ` Geert Uytterhoeven
2015-03-19  6:52     ` Simon Horman

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).