Skip to contentSkip to conversation

ARM: rmobile: Fix SD divider settings on Gen3

PATCH In review Marek Vasut 2 participants 2 messages Sep 5, 2017 – Sep 8, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: rmobile: Fix SD divider settings on Gen3

On RCar M3 and on RCar H3 newer than and not including ES1.0, the SD clock must be divided by 4 rather than 2 because a hardware workaround present only in the H3 ES1.0 has been removed from these chips. U-Boot currently only supports M3 and H3 ES 2.0 and newer, so configure the SD pre-divider to 4 to prevent SD instability.

Cc Nobuhiro Iwamatsu <[email protected]>
---
 board/renesas/salvator-x/salvator-x.c | 8 ++++----
 board/renesas/ulcb/ulcb.c             | 8 ++++----
 2 files changed, 8 insertions(+), 8 deletions(-)
board/renesas/salvator-x/salvator-x.c +4 -4
index 2695de5dbf..e260117802 100644
@@ -74,10 +74,10 @@ int board_early_init_f(void)
 	/* SDHI0, 3 */
 	mstp_clrbits_le32(MSTPSR3, SMSTPCR3, SD0_MSTP314 | SD3_MSTP311);
 
-	writel(0, SD0CKCR);
-	writel(0, SD1CKCR);
-	writel(0, SD2CKCR);
-	writel(0, SD3CKCR);
+	writel(1, SD0CKCR);
+	writel(1, SD1CKCR);
+	writel(1, SD2CKCR);
+	writel(1, SD3CKCR);
 
 #if defined(CONFIG_SYS_I2C) && defined(CONFIG_SYS_I2C_SH)
 	/* DVFS for reset */
board/renesas/ulcb/ulcb.c +4 -4
index 2b6cc612c8..dc23228f4f 100644
@@ -72,10 +72,10 @@ int board_early_init_f(void)
 	/* SDHI0 */
 	mstp_clrbits_le32(MSTPSR3, SMSTPCR3, SD0_MSTP314);
 
-	writel(0, SD0CKCR);
-	writel(0, SD1CKCR);
-	writel(0, SD2CKCR);
-	writel(0, SD3CKCR);
+	writel(1, SD0CKCR);
+	writel(1, SD1CKCR);
+	writel(1, SD2CKCR);
+	writel(1, SD3CKCR);
 
 #if defined(CONFIG_SYS_I2C) && defined(CONFIG_SYS_I2C_SH)
 	/* DVFS for reset */
Signature · 1 line
2.13.2
#1 lore raw
Quoted 8 lines · Marek Vasut

On RCar M3 and on RCar H3 newer than and not including ES1.0, the SD clock must be divided by 4 rather than 2 because a hardware workaround present only in the H3 ES1.0 has been removed from these chips. U-Boot currently only supports M3 and H3 ES 2.0 and newer, so configure the SD pre-divider to 4 to prevent SD instability.

Cc Nobuhiro Iwamatsu <[email protected]>

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170907/c75c70c4/attachment.sig>