Skip to contentSkip to conversation

ARM: socfpga: Disable D cache in SPL

PATCH New Marek Vasut 3 participants 8 messages Mar 6, 2019 – Mar 8, 2019

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

PATCH 1/4 ARM: socfpga: Disable D cache in SPL

The bootrom seems to leave the D-cache in messed up state, make sure the SPL disables it so it can not interfere with operation.

Cc Chin Liang See <[email protected]>
Cc Dinh Nguyen <[email protected]>
Cc Simon Goldschmidt <[email protected]>
Cc Tien Fong Chee <[email protected]>
---
 arch/arm/mach-socfpga/spl_a10.c         | 2 ++
 include/configs/socfpga_arria10_socdk.h | 2 --
 2 files changed, 2 insertions(+), 2 deletions(-)
arch/arm/mach-socfpga/spl_a10.c +2 -0
index c97eacb424..c8e73d47c0 100644
@@ -77,6 +77,8 @@ void spl_board_init(void)
 
 void board_init_f(ulong dummy)
 {
+	dcache_disable();
+
 	socfpga_init_security_policies();
 	socfpga_sdram_remap_zero();
 
include/configs/socfpga_arria10_socdk.h +0 -2
index 58e446b60a..0f116fbf2d 100644
@@ -15,8 +15,6 @@
 /*
  * U-Boot general configurations
  */
-/* Cache options */
-#define CONFIG_SYS_DCACHE_OFF
 
 /* Memory configurations  */
 #define PHYS_SDRAM_1_SIZE		0x40000000
Signature · 1 line
2.20.1
#1 lore raw

PATCH 2/4 ARM: socfpga: Drop CONFIG_SYS_NAND_BAD_BLOCK_POS

This is not used anywhere, so drop it.

Cc Chin Liang See <[email protected]>
Cc Dinh Nguyen <[email protected]>
Cc Simon Goldschmidt <[email protected]>
Cc Tien Fong Chee <[email protected]>
---
 include/configs/socfpga_common.h | 1 -
 1 file changed, 1 deletion(-)
include/configs/socfpga_common.h +0 -1
index c9cbf8f5e3..f182e9e71b 100644
@@ -280,7 +280,6 @@ unsigned int cm_get_qspi_controller_clk_hz(void);
 
 /* SPL NAND boot support */
 #ifdef CONFIG_SPL_NAND_SUPPORT
-#define CONFIG_SYS_NAND_BAD_BLOCK_POS	0
 #define CONFIG_SYS_NAND_U_BOOT_OFFS	0x40000
 #endif
 
Signature · 1 line
2.20.1
#2 lore raw

PATCH 2/4 ARM: socfpga: Drop CONFIG_SYS_NAND_BAD_BLOCK_POS

Quoted 7 lines · Marek Vasut

This is not used anywhere, so drop it.

Cc Chin Liang See <[email protected]>
Cc Dinh Nguyen <[email protected]>
Cc Simon Goldschmidt <[email protected]>
Cc Tien Fong Chee <[email protected]>
Quoted 17 lines

---
 include/configs/socfpga_common.h | 1 -

 1 file changed, 1 deletion(-)
include/configs/socfpga_common.h +0 -0
index c9cbf8f5e3..f182e9e71b 100644
@@ -280,7 +280,6 @@ unsigned int cm_get_qspi_controller_clk_hz(void);


 /* SPL NAND boot support */
 #ifdef CONFIG_SPL_NAND_SUPPORT
-#define CONFIG_SYS_NAND_BAD_BLOCK_POS 0
 #define CONFIG_SYS_NAND_U_BOOT_OFFS 0x40000
 #endif

#3 lore raw

PATCH 3/4 ARM: socfpga: Fix Arria10 SPI and NAND U-Boot offset

In reply to Marek Vasut

The SPL size on Gen5 is 4*64kiB, but on A10 it is 4*256kiB. Handle the difference.

Cc Chin Liang See <[email protected]>
Cc Dinh Nguyen <[email protected]>
Cc Simon Goldschmidt <[email protected]>
Cc Tien Fong Chee <[email protected]>
---
 include/configs/socfpga_common.h | 8 ++++++++
 1 file changed, 8 insertions(+)
include/configs/socfpga_common.h +8 -0
index f182e9e71b..181af9b646 100644
@@ -275,12 +275,20 @@ unsigned int cm_get_qspi_controller_clk_hz(void);
 
 /* SPL QSPI boot support */
 #ifdef CONFIG_SPL_SPI_SUPPORT
+#if defined(CONFIG_TARGET_SOCFPGA_GEN5)
 #define CONFIG_SYS_SPI_U_BOOT_OFFS	0x40000
+#elif defined(CONFIG_TARGET_SOCFPGA_ARRIA10)
+#define CONFIG_SYS_SPI_U_BOOT_OFFS	0x100000
+#endif
 #endif
 
 /* SPL NAND boot support */
 #ifdef CONFIG_SPL_NAND_SUPPORT
+#if defined(CONFIG_TARGET_SOCFPGA_GEN5)
 #define CONFIG_SYS_NAND_U_BOOT_OFFS	0x40000
+#elif defined(CONFIG_TARGET_SOCFPGA_ARRIA10)
+#define CONFIG_SYS_NAND_U_BOOT_OFFS	0x100000
+#endif
 #endif
 
 /*
Signature · 1 line
2.20.1
#4 lore raw

PATCH 3/4 ARM: socfpga: Fix Arria10 SPI and NAND U-Boot offset

Quoted 9 lines · Marek Vasut

The SPL size on Gen5 is 4*64kiB, but on A10 it is 4*256kiB. Handle the difference.

Cc Chin Liang See <[email protected]>
Cc Dinh Nguyen <[email protected]>
Cc Simon Goldschmidt <[email protected]>
Cc Tien Fong Chee <[email protected]>
Quoted 32 lines
---
 include/configs/socfpga_common.h | 8 ++++++++
 1 file changed, 8 insertions(+)
include/configs/socfpga_common.h +8 -1
index f182e9e71b..181af9b646 100644
@@ -275,12 +275,20 @@ unsigned int cm_get_qspi_controller_clk_hz(void);
 
 /* SPL QSPI boot support */
 #ifdef CONFIG_SPL_SPI_SUPPORT
+#if defined(CONFIG_TARGET_SOCFPGA_GEN5)
 #define CONFIG_SYS_SPI_U_BOOT_OFFS     0x40000
+#elif defined(CONFIG_TARGET_SOCFPGA_ARRIA10)
+#define CONFIG_SYS_SPI_U_BOOT_OFFS     0x100000
+#endif
 #endif
 
 /* SPL NAND boot support */
 #ifdef CONFIG_SPL_NAND_SUPPORT
+#if defined(CONFIG_TARGET_SOCFPGA_GEN5)
 #define CONFIG_SYS_NAND_U_BOOT_OFFS    0x40000
+#elif defined(CONFIG_TARGET_SOCFPGA_ARRIA10)
+#define CONFIG_SYS_NAND_U_BOOT_OFFS    0x100000
+#endif
 #endif
 
 /*
--

2.20.1

#5 lore raw

PATCH 4/4 ARM: socfpga: Fix A10 SoCDK Kconfig

In reply to Marek Vasut

The Kconfig checked for SoCFPGA Arria10 as a platform, instead of checking for specific board configuration, which works with one single platform in tree, but not with multiple. Fix it.

Cc Chin Liang See <[email protected]>
Cc Dinh Nguyen <[email protected]>
Cc Simon Goldschmidt <[email protected]>
Cc Tien Fong Chee <[email protected]>
---
 board/altera/arria10-socdk/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
board/altera/arria10-socdk/Kconfig +1 -1
index b80cc6d6f9..621dc97024 100644
@@ -1,4 +1,4 @@
-if TARGET_SOCFPGA_ARRIA10
+if TARGET_SOCFPGA_ARRIA10_SOCDK
 
 config SYS_CPU
 	default "armv7"
Signature · 1 line
2.20.1
#6 lore raw

PATCH 4/4 ARM: socfpga: Fix A10 SoCDK Kconfig

Quoted 9 lines · Marek Vasut

The Kconfig checked for SoCFPGA Arria10 as a platform, instead of checking for specific board configuration, which works with one single platform in tree, but not with multiple. Fix it.

Cc Chin Liang See <[email protected]>
Cc Dinh Nguyen <[email protected]>
Cc Simon Goldschmidt <[email protected]>
Cc Tien Fong Chee <[email protected]>
Quoted 15 lines

---
 board/altera/arria10-socdk/Kconfig | 2 +-

 1 file changed, 1 insertion(+), 1 deletion(-)
board/altera/arria10-socdk/Kconfig +1 -1
index b80cc6d6f9..621dc97024 100644
@@ -1,4 +1,4 @@
-if TARGET_SOCFPGA_ARRIA10
+if TARGET_SOCFPGA_ARRIA10_SOCDK


 config SYS_CPU
  default "armv7"

#7 lore raw

PATCH 1/4 ARM: socfpga: Disable D cache in SPL

In reply to Marek Vasut
Quoted 8 lines · Marek Vasut

The bootrom seems to leave the D-cache in messed up state, make sure the SPL disables it so it can not interfere with operation.

Cc Chin Liang See <[email protected]>
Cc Dinh Nguyen <[email protected]>
Cc Simon Goldschmidt <[email protected]>
Cc Tien Fong Chee <[email protected]>
Quoted 33 lines

---
 arch/arm/mach-socfpga/spl_a10.c         | 2 ++
 include/configs/socfpga_arria10_socdk.h | 2 --

 2 files changed, 2 insertions(+), 2 deletions(-)
arch/arm/mach- renamed from arch/arm/mach-socfpga/spl_a10.c +0 -0

socfpga/spl_a10.c
index c97eacb424..c8e73d47c0 100644

arch/arm/mach-socfpga/spl_a10.c +0 -0
@@ -77,6 +77,8 @@ void spl_board_init(void)


 void board_init_f(ulong dummy)
 {

arch/arm/mach-socfpga/spl_a10.c +2 -0
+	dcache_disable();
+

  socfpga_init_security_policies();
  socfpga_sdram_remap_zero();

include/configs/socfpga_arria10_socdk.h +0 -2
index 58e446b60a..0f116fbf2d 100644
@@ -15,8 +15,6 @@
  /*
   * U-Boot general configurations
   */
-/* Cache options */
-#define CONFIG_SYS_DCACHE_OFF


 /* Memory configurations  */
 #define PHYS_SDRAM_1_SIZE 0x40000000