Skip to contentSkip to conversation

ARM: socfpga: Unreset NAND in SPL on Gen5

PATCH New Marek Vasut 2 participants 5 messages Nov 20, 2019 – Nov 22, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: socfpga: Unreset NAND in SPL on Gen5

In case the SPL on Gen5 loads U-Boot from NAND, unreset the NAND IP explicitly in the platform code as the denali-spl driver is not aware of DM at all.

Cc Chin Liang See <[email protected]>
Cc Dalon Westergreen <[email protected]>
Cc Dinh Nguyen <[email protected]>
Cc Ley Foon Tan <[email protected]>
Cc Simon Goldschmidt <[email protected]>
Cc Tien Fong Chee <[email protected]>
---
 arch/arm/mach-socfpga/spl_gen5.c | 7 +++++++
 1 file changed, 7 insertions(+)
arch/arm/mach-socfpga/spl_gen5.c +7 -0
index 47e63709ad..408e409375 100644
@@ -138,6 +138,13 @@ void board_init_f(ulong dummy)
 	if (ret)
 		debug("Reset init failed: %d\n", ret);
 
+#ifdef CONFIG_SPL_NAND_DENALI
+	struct socfpga_reset_manager *reset_manager_base =
+		(struct socfpga_reset_manager *)SOCFPGA_RSTMGR_ADDRESS;
+
+	clrbits_le32(&reset_manager_base->per_mod_reset, BIT(4));
+#endif
+
 	/* enable console uart printing */
 	preloader_console_init();
 
Signature · 1 line
2.24.0.432.g9d3f5f5b63
#1 lore raw

PATCH 1/1 ARM: socfpga: Unreset NAND in SPL on Gen5

Quoted 35 lines

-----Original Message-----
From: Marek Vasut <[email protected]>
Sent: Thursday, November 21, 2019 5:36 AM
To: u-boot at lists.denx.de
Cc: Marek Vasut <[email protected]>; See, Chin Liang <[email protected]>; Dalon Westergreen <[email protected]>; Dinh Nguyen <[email protected]>; Tan, Ley Foon <[email protected]>; Simon Goldschmidt <[email protected]>; Chee, Tien Fong <[email protected]>
Subject: [PATCH] ARM: socfpga: Unreset NAND in SPL on Gen5

In case the SPL on Gen5 loads U-Boot from NAND, unreset the NAND IP explicitly in the platform code as the denali-spl driver is not aware of DM at all.

Cc Chin Liang See <[email protected]>
Cc Dalon Westergreen <[email protected]>
Cc Dinh Nguyen <[email protected]>
Cc Ley Foon Tan <[email protected]>
Cc Simon Goldschmidt <[email protected]>
Cc Tien Fong Chee <[email protected]>
---
 arch/arm/mach-socfpga/spl_gen5.c | 7 +++++++
 1 file changed, 7 insertions(+)
arch/arm/mach- renamed from arch/arm/mach-socfpga/spl_gen5.c +0 -0

socfpga/spl_gen5.c
index 47e63709ad..408e409375 100644

arch/arm/mach-socfpga/spl_gen5.c void board_init_f(ulong dummy) · line 147

Quoted 10 lines
arch/arm/mach-socfpga/spl_gen5.c +6 -0
@@ -138,6 +138,13 @@ void board_init_f(ulong dummy)
 	if (ret)
 		debug("Reset init failed: %d\n", ret);
 
+#ifdef CONFIG_SPL_NAND_DENALI
+	struct socfpga_reset_manager *reset_manager_base =
+		(struct socfpga_reset_manager
 *)SOCFPGA_RSTMGR_ADDRESS;
+
+	clrbits_le32(&reset_manager_base->per_mod_reset, BIT(4)); #endif
+

Normal Denali Nand driver (denali_dt_probe()) is not running in SPL Gen5?
I am enabling NAND for Agilex recently, but didn't notice need to de-assert NAND reset outside of denali nand driver.

Regards
Ley Foon

#2 lore raw

PATCH 1/1 ARM: socfpga: Unreset NAND in SPL on Gen5

On 11/21/19 11:08 AM, Tan, Ley Foon wrote:
[...]

Hi,

Quoted 24 lines
Quoted 24 lines

In case the SPL on Gen5 loads U-Boot from NAND, unreset the NAND IP explicitly in the platform code as the denali-spl driver is not aware of DM at all.

Cc Chin Liang See <[email protected]>
Cc Dalon Westergreen <[email protected]>
Cc Dinh Nguyen <[email protected]>
Cc Ley Foon Tan <[email protected]>
Cc Simon Goldschmidt <[email protected]>
Cc Tien Fong Chee <[email protected]>
---
 arch/arm/mach-socfpga/spl_gen5.c | 7 +++++++
 1 file changed, 7 insertions(+)
arch/arm/mach- renamed from arch/arm/mach-socfpga/spl_gen5.c +0 -0

socfpga/spl_gen5.c
index 47e63709ad..408e409375 100644

arch/arm/mach-socfpga/spl_gen5.c +0 -0
@@ -138,6 +138,13 @@ void board_init_f(ulong dummy)
 	if (ret)
 		debug("Reset init failed: %d\n", ret);
 
Quoted 8 lines

arch/arm/mach-socfpga/spl_gen5.c void board_init_f(ulong dummy) · line 147

Quoted 7 lines
arch/arm/mach-socfpga/spl_gen5.c +6 -0
+#ifdef CONFIG_SPL_NAND_DENALI
+	struct socfpga_reset_manager *reset_manager_base =
+		(struct socfpga_reset_manager
 *)SOCFPGA_RSTMGR_ADDRESS;
+
+	clrbits_le32(&reset_manager_base->per_mod_reset, BIT(4)); #endif
+

Normal Denali Nand driver (denali_dt_probe()) is not running in SPL Gen5?

Nope, I tried to put the whole MTD subsystem into SPL, but it just does not fit into the 64 kiB we have on Gen5. It does fit on A10 which has 256 kiB of OCRAM, but I can't easily replace the SoC here. Hence this denali-spl.

Quoted 1 line

I am enabling NAND for Agilex recently, but didn't notice need to de-assert NAND reset outside of denali nand driver.

How much OCRAM does Agilex have again ? :-)

Signature · 2 lines
Best regards,
Marek Vasut
#3 lore raw

PATCH 1/1 ARM: socfpga: Unreset NAND in SPL on Gen5

Quoted 12 lines

-----Original Message-----
From: Marek Vasut <[email protected]>
Sent: Thursday, November 21, 2019 6:12 PM
To: Tan, Ley Foon <[email protected]>; u-boot at lists.denx.de
Cc: See, Chin Liang <[email protected]>; Dalon Westergreen <[email protected]>; Dinh Nguyen <[email protected]>; Simon Goldschmidt <[email protected]>; Chee, Tien Fong <[email protected]>
Subject: Re: [PATCH] ARM: socfpga: Unreset NAND in SPL on Gen5

Quoted 16 lines

On 11/21/19 11:08 AM, Tan, Ley Foon wrote:
[...]

Hi,

Quoted 11 lines
Quoted 11 lines

In case the SPL on Gen5 loads U-Boot from NAND, unreset the NAND IP explicitly in the platform code as the denali-spl driver is not aware of DM at all.

Cc Chin Liang See <[email protected]>
Cc Dalon Westergreen <[email protected]>
Cc Dinh Nguyen <[email protected]>
Cc Ley Foon Tan <[email protected]>
Cc Simon Goldschmidt <[email protected]>
Cc Tien Fong Chee <[email protected]>
Quoted 21 lines
Quoted 12 lines
Quoted 12 lines
---
 arch/arm/mach-socfpga/spl_gen5.c | 7 +++++++
 1 file changed, 7 insertions(+)
arch/arm/mach- renamed from arch/arm/mach-socfpga/spl_gen5.c +0 -0

socfpga/spl_gen5.c index 47e63709ad..408e409375 100644

arch/arm/mach-socfpga/spl_gen5.c +0 -0
@@ -138,6 +138,13 @@ void board_init_f(ulong dummy)
 	if (ret)
 		debug("Reset init failed: %d\n", ret);
 
Quoted 8 lines

arch/arm/mach-socfpga/spl_gen5.c void board_init_f(ulong dummy) · line 147

Quoted 7 lines
arch/arm/mach-socfpga/spl_gen5.c +6 -0
+#ifdef CONFIG_SPL_NAND_DENALI
+	struct socfpga_reset_manager *reset_manager_base =
+		(struct socfpga_reset_manager
 *)SOCFPGA_RSTMGR_ADDRESS;
+
+	clrbits_le32(&reset_manager_base->per_mod_reset, BIT(4)); #endif
+

Normal Denali Nand driver (denali_dt_probe()) is not running in SPL Gen5?

Quoted 4 lines

Nope, I tried to put the whole MTD subsystem into SPL, but it just does not fit into the 64 kiB we have on Gen5. It does fit on A10 which has
256 kiB of OCRAM, but I can't easily replace the SoC here. Hence this denali- spl.

Okay, now I understand your problem here.

Quoted 5 lines
Quoted 2 lines

I am enabling NAND for Agilex recently, but didn't notice need to de-assert

NAND reset outside of denali nand driver.

How much OCRAM does Agilex have again ? :-)

Agilex have 256KB OCRAM as in S10.

Regards
Ley Foon

#4 lore raw

PATCH 1/1 ARM: socfpga: Unreset NAND in SPL on Gen5

On 11/22/19 2:44 AM, Tan, Ley Foon wrote:

Hi,

[...]

Quoted 45 lines
Quoted 17 lines · Ley Foon

[...]

Hi,

Quoted 11 lines
Quoted 11 lines

In case the SPL on Gen5 loads U-Boot from NAND, unreset the NAND IP explicitly in the platform code as the denali-spl driver is not aware of DM at all.

Cc Chin Liang See <[email protected]>
Cc Dalon Westergreen <[email protected]>
Cc Dinh Nguyen <[email protected]>
Cc Ley Foon Tan <[email protected]>
Cc Simon Goldschmidt <[email protected]>
Cc Tien Fong Chee <[email protected]>
Quoted 21 lines
Quoted 12 lines
Quoted 12 lines
---
 arch/arm/mach-socfpga/spl_gen5.c | 7 +++++++
 1 file changed, 7 insertions(+)
arch/arm/mach- renamed from arch/arm/mach-socfpga/spl_gen5.c +0 -0

socfpga/spl_gen5.c index 47e63709ad..408e409375 100644

arch/arm/mach-socfpga/spl_gen5.c +0 -0
@@ -138,6 +138,13 @@ void board_init_f(ulong dummy)
 	if (ret)
 		debug("Reset init failed: %d\n", ret);
 
Quoted 8 lines

arch/arm/mach-socfpga/spl_gen5.c void board_init_f(ulong dummy) · line 147

Quoted 7 lines
arch/arm/mach-socfpga/spl_gen5.c +6 -0
+#ifdef CONFIG_SPL_NAND_DENALI
+	struct socfpga_reset_manager *reset_manager_base =
+		(struct socfpga_reset_manager
 *)SOCFPGA_RSTMGR_ADDRESS;
+
+	clrbits_le32(&reset_manager_base->per_mod_reset, BIT(4)); #endif
+

Normal Denali Nand driver (denali_dt_probe()) is not running in SPL Gen5?

Quoted 4 lines

Nope, I tried to put the whole MTD subsystem into SPL, but it just does not fit into the 64 kiB we have on Gen5. It does fit on A10 which has
256 kiB of OCRAM, but I can't easily replace the SoC here. Hence this denali- spl.

Quoted 8 lines

Okay, now I understand your problem here.

Quoted 5 lines
Quoted 2 lines

I am enabling NAND for Agilex recently, but didn't notice need to de-assert

NAND reset outside of denali nand driver.

How much OCRAM does Agilex have again ? :-)

Agilex have 256KB OCRAM as in S10.

I wish I had that much OCRAM here too :)