public inbox for cip-dev@lists.cip-project.org
 help / color / mirror / Atom feed
* [PATCH 4.19.y-cip] memory: renesas-rpc-if: Clear HS bit during hardware initialization
@ 2024-03-15 16:52 Lad Prabhakar
  2024-03-18 11:35 ` Pavel Machek
  2024-03-19 11:11 ` Pavel Machek
  0 siblings, 2 replies; 3+ messages in thread
From: Lad Prabhakar @ 2024-03-15 16:52 UTC (permalink / raw)
  To: cip-dev, Nobuhiro Iwamatsu, Pavel Machek; +Cc: Biju Das

From: Cong Dang <cong.dang.xn@renesas.com>

commit 5192481f908e576be42bd39ec12979b79e11f7e0 upstream.

According to the datasheet, HS bit should be specified to 1 when using
DMA transfer. As DMA transfer is not supported, it should be cleared to
0.

Previously, the driver relied on the HS bit being cleared by prior
firmware but this is not always the case.

Fix this by ensuring the bit is cleared during hardware initialization.

Fixes: ca7d8b980b67 ("memory: add Renesas RPC-IF driver")
Signed-off-by: Cong Dang <cong.dang.xn@renesas.com>
Signed-off-by: Hai Pham <hai.pham.ud@renesas.com>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Link: https://lore.kernel.org/r/08d9fb10b3051decebf871267a6e2e7cb2d4faf9.1665583089.git.geert+renesas@glider.be
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
[PL: manually applied the patch]
Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
---
 drivers/memory/renesas-rpc-if.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/memory/renesas-rpc-if.c b/drivers/memory/renesas-rpc-if.c
index 5d4d00d07d4f0..21e55c903285e 100644
--- a/drivers/memory/renesas-rpc-if.c
+++ b/drivers/memory/renesas-rpc-if.c
@@ -300,6 +300,9 @@ void rpcif_hw_init(struct rpcif *rpc, bool hyperflash)
 	regmap_write(rpc->regmap, RPCIF_PHYCNT, RPCIF_PHYCNT_STRTIM(7) |
 		     RPCIF_PHYCNT_PHYMEM(hyperflash ? 3 : 0) | 0x260);
 
+	/* DMA Transfer is not supported */
+	regmap_update_bits(rpc->regmap, RPCIF_PHYCNT, RPCIF_PHYCNT_HS, 0);
+
 	/*
 	 * NOTE: The 0x1511144 are undocumented bits, but they must be set
 	 *       for RPCIF_PHYOFFSET1.
-- 
2.34.1



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

* Re: [PATCH 4.19.y-cip] memory: renesas-rpc-if: Clear HS bit during hardware initialization
  2024-03-15 16:52 [PATCH 4.19.y-cip] memory: renesas-rpc-if: Clear HS bit during hardware initialization Lad Prabhakar
@ 2024-03-18 11:35 ` Pavel Machek
  2024-03-19 11:11 ` Pavel Machek
  1 sibling, 0 replies; 3+ messages in thread
From: Pavel Machek @ 2024-03-18 11:35 UTC (permalink / raw)
  To: Lad Prabhakar; +Cc: cip-dev, Nobuhiro Iwamatsu, Pavel Machek, Biju Das

[-- Attachment #1: Type: text/plain, Size: 755 bytes --]

Hi!

> From: Cong Dang <cong.dang.xn@renesas.com>
> 
> commit 5192481f908e576be42bd39ec12979b79e11f7e0 upstream.
> 
> According to the datasheet, HS bit should be specified to 1 when using
> DMA transfer. As DMA transfer is not supported, it should be cleared to
> 0.
> 
> Previously, the driver relied on the HS bit being cleared by prior
> firmware but this is not always the case.
> 
> Fix this by ensuring the bit is cleared during hardware
> initialization.

Patch looks ok to me, I can apply it if it passes testing and if there
are no other comments.

Best regards,
								Pavel
-- 
DENX Software Engineering GmbH,        Managing Director: Erika Unter
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

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

* Re: [PATCH 4.19.y-cip] memory: renesas-rpc-if: Clear HS bit during hardware initialization
  2024-03-15 16:52 [PATCH 4.19.y-cip] memory: renesas-rpc-if: Clear HS bit during hardware initialization Lad Prabhakar
  2024-03-18 11:35 ` Pavel Machek
@ 2024-03-19 11:11 ` Pavel Machek
  1 sibling, 0 replies; 3+ messages in thread
From: Pavel Machek @ 2024-03-19 11:11 UTC (permalink / raw)
  To: Lad Prabhakar; +Cc: cip-dev, Nobuhiro Iwamatsu, Pavel Machek, Biju Das

[-- Attachment #1: Type: text/plain, Size: 630 bytes --]

Hi!

> commit 5192481f908e576be42bd39ec12979b79e11f7e0 upstream.
> 
> According to the datasheet, HS bit should be specified to 1 when using
> DMA transfer. As DMA transfer is not supported, it should be cleared to
> 0.
> 
> Previously, the driver relied on the HS bit being cleared by prior
> firmware but this is not always the case.
> 
> Fix this by ensuring the bit is cleared during hardware
> initialization.

Thank you, applied.

Best regards,	
							Pavel
-- 
DENX Software Engineering GmbH,        Managing Director: Erika Unter
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

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

end of thread, other threads:[~2024-03-19 11:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-15 16:52 [PATCH 4.19.y-cip] memory: renesas-rpc-if: Clear HS bit during hardware initialization Lad Prabhakar
2024-03-18 11:35 ` Pavel Machek
2024-03-19 11:11 ` Pavel Machek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox