linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RESEND PATCH] ASoC: rsnd: dma: fix SSI9 4/5/6/7 busif dma address
@ 2019-10-22 18:54 Eugeniu Rosca
  2019-10-23  0:51 ` Kuninori Morimoto
  2019-10-23 18:56 ` Applied "ASoC: rsnd: dma: fix SSI9 4/5/6/7 busif dma address" to the asoc tree Mark Brown
  0 siblings, 2 replies; 4+ messages in thread
From: Eugeniu Rosca @ 2019-10-22 18:54 UTC (permalink / raw)
  To: Kuninori Morimoto, Liam Girdwood, Mark Brown, Jaroslav Kysela,
	Takashi Iwai, alsa-devel, linux-kernel
  Cc: Eugeniu Rosca, Eugeniu Rosca, Jiada Wang, Timo Wischer,
	Andrew Gabbasov, stable

From: Jiada Wang <jiada_wang@mentor.com>

Currently each SSI unit's busif dma address is calculated by
following calculation formula:
0xec540000 + 0x1000 * id + busif / 4 * 0xA000 + busif % 4 * 0x400

But according to R-Car3 HW manual 41.1.4 Register Configuration,
ssi9 4/5/6/7 busif data register address
(SSI9_4_BUSIF/SSI9_5_BUSIF/SSI9_6_BUSIF/SSI9_7_BUSIF)
are out of this rule.

This patch updates the calculation formula to correct
ssi9 4/5/6/7 busif data register address.

Fixes: 5e45a6fab3b9 ("ASoc: rsnd: dma: Calculate dma address with consider of BUSIF")
Signed-off-by: Jiada Wang <jiada_wang@mentor.com>
Signed-off-by: Timo Wischer <twischer@de.adit-jv.com>
[erosca: minor improvements in commit description]
Cc: Andrew Gabbasov <andrew_gabbasov@mentor.com>
Cc: stable@vger.kernel.org # v4.20+
Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com>
---

Originally submitted as https://patchwork.kernel.org/patch/10825513/
("ASoC: rsnd: dma: fix SSI9 4/5/6/7 busif dma address")

---
 sound/soc/sh/rcar/dma.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/sh/rcar/dma.c b/sound/soc/sh/rcar/dma.c
index 0324a5c39619..28f65eba2bb4 100644
--- a/sound/soc/sh/rcar/dma.c
+++ b/sound/soc/sh/rcar/dma.c
@@ -508,10 +508,10 @@ static struct rsnd_mod_ops rsnd_dmapp_ops = {
 #define RDMA_SSI_I_N(addr, i)	(addr ##_reg - 0x00300000 + (0x40 * i) + 0x8)
 #define RDMA_SSI_O_N(addr, i)	(addr ##_reg - 0x00300000 + (0x40 * i) + 0xc)
 
-#define RDMA_SSIU_I_N(addr, i, j) (addr ##_reg - 0x00441000 + (0x1000 * (i)) + (((j) / 4) * 0xA000) + (((j) % 4) * 0x400))
+#define RDMA_SSIU_I_N(addr, i, j) (addr ##_reg - 0x00441000 + (0x1000 * (i)) + (((j) / 4) * 0xA000) + (((j) % 4) * 0x400) - (0x4000 * ((i) / 9) * ((j) / 4)))
 #define RDMA_SSIU_O_N(addr, i, j) RDMA_SSIU_I_N(addr, i, j)
 
-#define RDMA_SSIU_I_P(addr, i, j) (addr ##_reg - 0x00141000 + (0x1000 * (i)) + (((j) / 4) * 0xA000) + (((j) % 4) * 0x400))
+#define RDMA_SSIU_I_P(addr, i, j) (addr ##_reg - 0x00141000 + (0x1000 * (i)) + (((j) / 4) * 0xA000) + (((j) % 4) * 0x400) - (0x4000 * ((i) / 9) * ((j) / 4)))
 #define RDMA_SSIU_O_P(addr, i, j) RDMA_SSIU_I_P(addr, i, j)
 
 #define RDMA_SRC_I_N(addr, i)	(addr ##_reg - 0x00500000 + (0x400 * i))
-- 
2.23.0


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

* Re: [RESEND PATCH] ASoC: rsnd: dma: fix SSI9 4/5/6/7 busif dma address
  2019-10-22 18:54 [RESEND PATCH] ASoC: rsnd: dma: fix SSI9 4/5/6/7 busif dma address Eugeniu Rosca
@ 2019-10-23  0:51 ` Kuninori Morimoto
  2019-10-23  9:55   ` Eugeniu Rosca
  2019-10-23 18:56 ` Applied "ASoC: rsnd: dma: fix SSI9 4/5/6/7 busif dma address" to the asoc tree Mark Brown
  1 sibling, 1 reply; 4+ messages in thread
From: Kuninori Morimoto @ 2019-10-23  0:51 UTC (permalink / raw)
  To: Eugeniu Rosca
  Cc: Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
	alsa-devel, linux-kernel, Eugeniu Rosca, Jiada Wang,
	Timo Wischer, Andrew Gabbasov, stable


Hi

> From: Jiada Wang <jiada_wang@mentor.com>
> 
> Currently each SSI unit's busif dma address is calculated by
> following calculation formula:
> 0xec540000 + 0x1000 * id + busif / 4 * 0xA000 + busif % 4 * 0x400
> 
> But according to R-Car3 HW manual 41.1.4 Register Configuration,
> ssi9 4/5/6/7 busif data register address
> (SSI9_4_BUSIF/SSI9_5_BUSIF/SSI9_6_BUSIF/SSI9_7_BUSIF)
> are out of this rule.
> 
> This patch updates the calculation formula to correct
> ssi9 4/5/6/7 busif data register address.
> 
> Fixes: 5e45a6fab3b9 ("ASoc: rsnd: dma: Calculate dma address with consider of BUSIF")
> Signed-off-by: Jiada Wang <jiada_wang@mentor.com>
> Signed-off-by: Timo Wischer <twischer@de.adit-jv.com>
> [erosca: minor improvements in commit description]
> Cc: Andrew Gabbasov <andrew_gabbasov@mentor.com>
> Cc: stable@vger.kernel.org # v4.20+
> Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com>
> ---

Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>


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

* Re: [RESEND PATCH] ASoC: rsnd: dma: fix SSI9 4/5/6/7 busif dma address
  2019-10-23  0:51 ` Kuninori Morimoto
@ 2019-10-23  9:55   ` Eugeniu Rosca
  0 siblings, 0 replies; 4+ messages in thread
From: Eugeniu Rosca @ 2019-10-23  9:55 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: Eugeniu Rosca, Liam Girdwood, Mark Brown, Jaroslav Kysela,
	Takashi Iwai, alsa-devel, linux-kernel, Eugeniu Rosca,
	Jiada Wang, Timo Wischer, Andrew Gabbasov, stable

Hi Morimoto-san,

On Wed, Oct 23, 2019 at 09:51:36AM +0900, Kuninori Morimoto wrote:
> 
> Hi
> 
> > From: Jiada Wang <jiada_wang@mentor.com>
> > 
> > Currently each SSI unit's busif dma address is calculated by
> > following calculation formula:
> > 0xec540000 + 0x1000 * id + busif / 4 * 0xA000 + busif % 4 * 0x400
> > 
> > But according to R-Car3 HW manual 41.1.4 Register Configuration,
> > ssi9 4/5/6/7 busif data register address
> > (SSI9_4_BUSIF/SSI9_5_BUSIF/SSI9_6_BUSIF/SSI9_7_BUSIF)
> > are out of this rule.
> > 
> > This patch updates the calculation formula to correct
> > ssi9 4/5/6/7 busif data register address.
> > 
> > Fixes: 5e45a6fab3b9 ("ASoc: rsnd: dma: Calculate dma address with consider of BUSIF")
> > Signed-off-by: Jiada Wang <jiada_wang@mentor.com>
> > Signed-off-by: Timo Wischer <twischer@de.adit-jv.com>
> > [erosca: minor improvements in commit description]
> > Cc: Andrew Gabbasov <andrew_gabbasov@mentor.com>
> > Cc: stable@vger.kernel.org # v4.20+
> > Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com>
> > ---
> 
> Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

Many thanks for the prompt responses.

-- 
Best Regards,
Eugeniu

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

* Applied "ASoC: rsnd: dma: fix SSI9 4/5/6/7 busif dma address" to the asoc tree
  2019-10-22 18:54 [RESEND PATCH] ASoC: rsnd: dma: fix SSI9 4/5/6/7 busif dma address Eugeniu Rosca
  2019-10-23  0:51 ` Kuninori Morimoto
@ 2019-10-23 18:56 ` Mark Brown
  1 sibling, 0 replies; 4+ messages in thread
From: Mark Brown @ 2019-10-23 18:56 UTC (permalink / raw)
  To: Jiada Wang
  Cc: alsa-devel, Andrew Gabbasov, Eugeniu Rosca, Eugeniu Rosca,
	Jaroslav Kysela, Kuninori Morimoto, Liam Girdwood, linux-kernel,
	Mark Brown, stable, stable, Takashi Iwai, Timo Wischer

The patch

   ASoC: rsnd: dma: fix SSI9 4/5/6/7 busif dma address

has been applied to the asoc tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.4

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

From d10be65f87fc9d98ad3cbdc406e86745fe8c59e2 Mon Sep 17 00:00:00 2001
From: Jiada Wang <jiada_wang@mentor.com>
Date: Tue, 22 Oct 2019 20:54:29 +0200
Subject: [PATCH] ASoC: rsnd: dma: fix SSI9 4/5/6/7 busif dma address

Currently each SSI unit's busif dma address is calculated by
following calculation formula:
0xec540000 + 0x1000 * id + busif / 4 * 0xA000 + busif % 4 * 0x400

But according to R-Car3 HW manual 41.1.4 Register Configuration,
ssi9 4/5/6/7 busif data register address
(SSI9_4_BUSIF/SSI9_5_BUSIF/SSI9_6_BUSIF/SSI9_7_BUSIF)
are out of this rule.

This patch updates the calculation formula to correct
ssi9 4/5/6/7 busif data register address.

Fixes: 5e45a6fab3b9 ("ASoc: rsnd: dma: Calculate dma address with consider of BUSIF")
Signed-off-by: Jiada Wang <jiada_wang@mentor.com>
Signed-off-by: Timo Wischer <twischer@de.adit-jv.com>
[erosca: minor improvements in commit description]
Cc: Andrew Gabbasov <andrew_gabbasov@mentor.com>
Cc: stable@vger.kernel.org # v4.20+
Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com>
Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://lore.kernel.org/r/20191022185429.12769-1-erosca@de.adit-jv.com
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/sh/rcar/dma.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/soc/sh/rcar/dma.c b/sound/soc/sh/rcar/dma.c
index 0324a5c39619..28f65eba2bb4 100644
--- a/sound/soc/sh/rcar/dma.c
+++ b/sound/soc/sh/rcar/dma.c
@@ -508,10 +508,10 @@ static struct rsnd_mod_ops rsnd_dmapp_ops = {
 #define RDMA_SSI_I_N(addr, i)	(addr ##_reg - 0x00300000 + (0x40 * i) + 0x8)
 #define RDMA_SSI_O_N(addr, i)	(addr ##_reg - 0x00300000 + (0x40 * i) + 0xc)
 
-#define RDMA_SSIU_I_N(addr, i, j) (addr ##_reg - 0x00441000 + (0x1000 * (i)) + (((j) / 4) * 0xA000) + (((j) % 4) * 0x400))
+#define RDMA_SSIU_I_N(addr, i, j) (addr ##_reg - 0x00441000 + (0x1000 * (i)) + (((j) / 4) * 0xA000) + (((j) % 4) * 0x400) - (0x4000 * ((i) / 9) * ((j) / 4)))
 #define RDMA_SSIU_O_N(addr, i, j) RDMA_SSIU_I_N(addr, i, j)
 
-#define RDMA_SSIU_I_P(addr, i, j) (addr ##_reg - 0x00141000 + (0x1000 * (i)) + (((j) / 4) * 0xA000) + (((j) % 4) * 0x400))
+#define RDMA_SSIU_I_P(addr, i, j) (addr ##_reg - 0x00141000 + (0x1000 * (i)) + (((j) / 4) * 0xA000) + (((j) % 4) * 0x400) - (0x4000 * ((i) / 9) * ((j) / 4)))
 #define RDMA_SSIU_O_P(addr, i, j) RDMA_SSIU_I_P(addr, i, j)
 
 #define RDMA_SRC_I_N(addr, i)	(addr ##_reg - 0x00500000 + (0x400 * i))
-- 
2.20.1


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

end of thread, other threads:[~2019-10-23 18:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-22 18:54 [RESEND PATCH] ASoC: rsnd: dma: fix SSI9 4/5/6/7 busif dma address Eugeniu Rosca
2019-10-23  0:51 ` Kuninori Morimoto
2019-10-23  9:55   ` Eugeniu Rosca
2019-10-23 18:56 ` Applied "ASoC: rsnd: dma: fix SSI9 4/5/6/7 busif dma address" to the asoc tree Mark Brown

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