Skip to contentSkip to conversation

Add Intel N5X SoC support

PATCH Superseded Siew Chin Lim 2 participants 24 messages Jun 13, 2021 – Jul 9, 2021

Subsystems (5)

v3 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

v3 cover Add Intel N5X SoC support

This is the 3rd version of patchset to add Intel N5X SoC[1] support.

Intel N5X SoC is with a 64-bit quad core ARM Cortex-A53 MPCore hard processor system (HPS). New IPs in N5X are clock manager and DDR subsystem, other IPs have minor changes compared to Agilex.

Intel N5X SoC supports legacy boot without ATF for debugging purpose, ATF boot, and ATF boot with VAB enabled.

[1]: https://www.intel.com/content/www/us/en/products/programmable/asic/easic-devices/diamond-mesa-soc-devices.html

Patch status:
Have changes: Patch 4, 5, 7, 12, 15
Other patches unchanged.

Detail changelog can find in commit message.

v2->v3:
--------
Patch 4:
- Adding helper function for getting endianness type.

Patch 5:
- Use BIT() macro for CLKMGR_INTER_*_MASK macro

Patch 7:
- Use BIT() and GENMASK() macro for all *MASK macro

Patch 12:
- Sorting header
- Used prefix OPM_xxx
- Simplify the code with do...while loop.
- Created common function for processing handoff
- Adding function of calibration data feedback to LPDDR4 controllers

Patch 15:
- Update comment for memory example code
- Move all common dts settings for N5X from socfpga_n5x_socdk.dts to socfpga_n5x-u-boot.dtsi
- Remove unused parameter "u-boot,boot0"

History:
--------
[v1] https://patchwork.ozlabs.org/project/uboot/cover/[email protected]/
[v2] https://patchwork.ozlabs.org/project/uboot/cover/[email protected]/

Siew Chin Lim (14):
arm: socfpga: Move linux_qspi_enable from bootcommand to
board_prep_linux function
arm: socfpga: Changed base_addr_s10.h to base_addr_soc64.h
arm: socfpga: Add base address for Intel N5X device
drivers: clk: Add clock driver for Intel N5X device
arm: socfpga: Get clock manager base address for Intel N5X device
drivers: clk: Add memory clock driver for Intel N5X device
arm: socfpga: Move cm_get_mpu_clk_hz function declaration to
clock_manager.h
arm: socfpga: Add clock manager for Intel N5X device
arm: socfpga: Changed misc_s10.c to misc_soc64.c
arm: socfpga: Add SPL for Intel N5X device
board: intel: Add socdk board support for Intel N5X device
arm: dts: Add base dtsi and devkit dts for Intel N5X device
include: configs: Add Intel N5X device CONFIGs
arm: socfpga: Enable Intel N5X device build

Tien Fong Chee (3):
arm: socfpga: Add handoff data support for Intel N5X device
ddr: socfpga: Enable memory test on memory size less than 1GB
ddr: altera: Add SDRAM driver for Intel N5X device

 arch/arm/dts/Makefile                         |    1 +
 arch/arm/dts/socfpga_n5x-u-boot.dtsi          |  175 ++
 arch/arm/dts/socfpga_n5x_socdk-u-boot.dtsi    |   67 +
 arch/arm/dts/socfpga_n5x_socdk.dts            |  154 ++
 arch/arm/mach-socfpga/Kconfig                 |   21 +-
 arch/arm/mach-socfpga/Makefile                |   32 +-
 arch/arm/mach-socfpga/board.c                 |   17 +-
 arch/arm/mach-socfpga/clock_manager_n5x.c     |   80 +
 .../{base_addr_s10.h => base_addr_soc64.h}    |   11 +-
 .../mach-socfpga/include/mach/clock_manager.h |    3 +
 .../include/mach/clock_manager_agilex.h       |    2 -
 .../include/mach/clock_manager_arria10.h      |    1 -
 .../include/mach/clock_manager_gen5.h         |    1 -
 .../include/mach/clock_manager_n5x.h          |   12 +
 .../include/mach/clock_manager_s10.h          |    1 -
 arch/arm/mach-socfpga/include/mach/firewall.h |    6 +
 .../mach-socfpga/include/mach/handoff_soc64.h |   38 +-
 .../include/mach/system_manager_soc64.h       |   10 +-
 arch/arm/mach-socfpga/misc.c                  |    3 +
 .../mach-socfpga/{misc_s10.c => misc_soc64.c} |   12 +-
 arch/arm/mach-socfpga/spl_n5x.c               |   94 +
 arch/arm/mach-socfpga/system_manager_soc64.c  |   18 +-
 arch/arm/mach-socfpga/wrap_handoff_soc64.c    |  132 +-
 board/intel/n5x-socdk/MAINTAINERS             |    7 +
 board/intel/n5x-socdk/Makefile                |    7 +
 board/intel/n5x-socdk/socfpga.c               |    7 +
 configs/socfpga_agilex_atf_defconfig          |    2 +-
 ...tf_defconfig => socfpga_n5x_atf_defconfig} |   13 +-
 ...ex_atf_defconfig => socfpga_n5x_defconfig} |   29 +-
 ...tf_defconfig => socfpga_n5x_vab_defconfig} |   14 +-
 configs/socfpga_stratix10_atf_defconfig       |    2 +-
 drivers/clk/altera/Makefile                   |    4 +-
 drivers/clk/altera/clk-mem-n5x.c              |  136 +
 drivers/clk/altera/clk-mem-n5x.h              |   84 +
 drivers/clk/altera/clk-n5x.c                  |  489 ++++
 drivers/clk/altera/clk-n5x.h                  |  217 ++
 drivers/ddr/altera/Makefile                   |    3 +-
 drivers/ddr/altera/sdram_n5x.c                | 2298 +++++++++++++++++
 drivers/ddr/altera/sdram_soc64.c              |   94 +-
 drivers/ddr/altera/sdram_soc64.h              |    1 +
 include/configs/socfpga_n5x_socdk.h           |   45 +
 include/configs/socfpga_soc64_common.h        |    2 +-
 include/dt-bindings/clock/n5x-clock.h         |   71 +
 43 files changed, 4296 insertions(+), 120 deletions(-)
 create mode 100644 arch/arm/dts/socfpga_n5x-u-boot.dtsi
 create mode 100644 arch/arm/dts/socfpga_n5x_socdk-u-boot.dtsi
 create mode 100644 arch/arm/dts/socfpga_n5x_socdk.dts
 create mode 100644 arch/arm/mach-socfpga/clock_manager_n5x.c
 rename arch/arm/mach-socfpga/include/mach/{base_addr_s10.h => base_addr_soc64.h} (85%)
 create mode 100644 arch/arm/mach-socfpga/include/mach/clock_manager_n5x.h
 rename arch/arm/mach-socfpga/{misc_s10.c => misc_soc64.c} (100%)
 create mode 100644 arch/arm/mach-socfpga/spl_n5x.c
 create mode 100644 board/intel/n5x-socdk/MAINTAINERS
 create mode 100644 board/intel/n5x-socdk/Makefile
 create mode 100644 board/intel/n5x-socdk/socfpga.c
 copy configs/{socfpga_agilex_atf_defconfig => socfpga_n5x_atf_defconfig} (83%)
 copy configs/{socfpga_agilex_atf_defconfig => socfpga_n5x_defconfig} (63%)
 copy configs/{socfpga_agilex_atf_defconfig => socfpga_n5x_vab_defconfig} (82%)
 create mode 100644 drivers/clk/altera/clk-mem-n5x.c
 create mode 100644 drivers/clk/altera/clk-mem-n5x.h
 create mode 100644 drivers/clk/altera/clk-n5x.c
 create mode 100644 drivers/clk/altera/clk-n5x.h
 create mode 100644 drivers/ddr/altera/sdram_n5x.c
 create mode 100644 include/configs/socfpga_n5x_socdk.h
 create mode 100644 include/dt-bindings/clock/n5x-clock.h
Signature · 1 line
2.19.0
#1 lore raw

PATCH v3 1/17 arm: socfpga: Move linux_qspi_enable from bootcommand to board_prep_linux function

Move 'linux_qspi_enable' from bootcommand to board_prep_linux function when OS booted from FIT image for Stratix 10 and Agilex. This flow is common for all Intel SOC64 devices.

U-Boot will update 'fdt_addr' environment value based on FIT image in board_prep_linux function, and 'linux_qspi_enable' will refer to 'fdt_addr' environment value to retrieve the device tree node.

---
 arch/arm/mach-socfpga/board.c           | 17 +++++++++--------
 configs/socfpga_agilex_atf_defconfig    |  2 +-
 configs/socfpga_stratix10_atf_defconfig |  2 +-
 3 files changed, 11 insertions(+), 10 deletions(-)
arch/arm/mach-socfpga/board.c +9 -8
index 650122fcd4..f5a3f2ad62 100644
@@ -115,17 +115,18 @@ void board_fit_image_post_process(void **p_image, size_t *p_size)
 #if !IS_ENABLED(CONFIG_SPL_BUILD) && IS_ENABLED(CONFIG_FIT)
 void board_prep_linux(bootm_headers_t *images)
 {
-	if (IS_ENABLED(CONFIG_SOCFPGA_SECURE_VAB_AUTH) &&
-	    !IS_ENABLED(CONFIG_SOCFPGA_SECURE_VAB_AUTH_ALLOW_NON_FIT_IMAGE)) {
-		/*
-		 * Ensure the OS is always booted from FIT and with
-		 * VAB signed certificate
-		 */
-		if (!images->fit_uname_cfg) {
+	if (!images->fit_uname_cfg) {
+		if (IS_ENABLED(CONFIG_SOCFPGA_SECURE_VAB_AUTH) &&
+		    !IS_ENABLED(CONFIG_SOCFPGA_SECURE_VAB_AUTH_ALLOW_NON_FIT_IMAGE)) {
+			/*
+			 * Ensure the OS is always booted from FIT and with
+			 * VAB signed certificate
+			 */
 			printf("Please use FIT with VAB signed images!\n");
 			hang();
 		}
-
+	} else {
+		/* Update fdt_addr in enviroment variable */
 		env_set_hex("fdt_addr", (ulong)images->ft_addr);
 		debug("images->ft_addr = 0x%08lx\n", (ulong)images->ft_addr);
 	}
configs/socfpga_agilex_atf_defconfig +1 -1
index 29e3fb865e..a4b9c23919 100644
@@ -22,7 +22,7 @@ CONFIG_BOOTDELAY=5
 CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="earlycon"
 CONFIG_USE_BOOTCOMMAND=y
-CONFIG_BOOTCOMMAND="run fatscript; run mmcfitload; run linux_qspi_enable; run mmcfitboot"
+CONFIG_BOOTCOMMAND="run fatscript; run mmcfitload; run mmcfitboot"
 CONFIG_SPL_CRC32_SUPPORT=y
 CONFIG_SPL_CACHE=y
 CONFIG_SPL_SPI_LOAD=y
configs/socfpga_stratix10_atf_defconfig +1 -1
index 9f2f220c3a..3a05d4f486 100644
@@ -22,7 +22,7 @@ CONFIG_BOOTDELAY=5
 CONFIG_USE_BOOTARGS=y
 CONFIG_BOOTARGS="earlycon"
 CONFIG_USE_BOOTCOMMAND=y
-CONFIG_BOOTCOMMAND="run fatscript; run mmcfitload; run linux_qspi_enable; run mmcfitboot"
+CONFIG_BOOTCOMMAND="run fatscript; run mmcfitload; run mmcfitboot"
 CONFIG_SPL_CRC32_SUPPORT=y
 CONFIG_SPL_SPI_LOAD=y
 CONFIG_SPL_ATF=y
Signature · 1 line
2.19.0
#2 lore raw

PATCH v3 2/17 arm: socfpga: Changed base_addr_s10.h to base_addr_soc64.h

In reply to Siew Chin Lim

Rename to common file name to used by all SOC64 devices and change "_S10_" to "_SOC64_" in base_addr_soc64.h.

---
 .../include/mach/{base_addr_s10.h => base_addr_soc64.h}   | 8 ++++----
 include/configs/socfpga_soc64_common.h                    | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)
 rename arch/arm/mach-socfpga/include/mach/{base_addr_s10.h => base_addr_soc64.h} (89%)
arch/arm/mach-socfpga/include/mach/base_addr_soc64.h renamed from arch/arm/mach-socfpga/include/mach/base_addr_s10.h +4 -4
similarity index 89%
rename from arch/arm/mach-socfpga/include/mach/base_addr_s10.h
rename to arch/arm/mach-socfpga/include/mach/base_addr_soc64.h
index d3eca65e97..f89066d771 100644
@@ -1,10 +1,10 @@
 /* SPDX-License-Identifier: GPL-2.0 */
 /*
- * Copyright (C) 2016-2017 Intel Corporation <www.intel.com>
+ * Copyright (C) 2016-2021 Intel Corporation <www.intel.com>
  */
 
-#ifndef _SOCFPGA_S10_BASE_HARDWARE_H_
-#define _SOCFPGA_S10_BASE_HARDWARE_H_
+#ifndef _SOCFPGA_SOC64_BASE_HARDWARE_H_
+#define _SOCFPGA_SOC64_BASE_HARDWARE_H_
 
 #define SOCFPGA_CCU_ADDRESS			0xf7000000
 #define SOCFPGA_SDR_SCHEDULER_ADDRESS		0xf8000400
@@ -44,4 +44,4 @@
 #define GICD_BASE				0xfffc1000
 #define GICC_BASE				0xfffc2000
 
-#endif /* _SOCFPGA_S10_BASE_HARDWARE_H_ */
+#endif /* _SOCFPGA_SOC64_BASE_HARDWARE_H_ */
include/configs/socfpga_soc64_common.h +1 -1
index 5afdb10454..f0b7884ebc 100644
@@ -7,7 +7,7 @@
 #ifndef __CONFIG_SOCFPGA_SOC64_COMMON_H__
 #define __CONFIG_SOCFPGA_SOC64_COMMON_H__
 
-#include <asm/arch/base_addr_s10.h>
+#include <asm/arch/base_addr_soc64.h>
 #include <asm/arch/handoff_soc64.h>
 #include <linux/stringify.h>
 
Signature · 1 line
2.19.0
#3 lore raw

PATCH v3 3/17 arm: socfpga: Add base address for Intel N5X device

In reply to Siew Chin Lim

Reuse base_addr_soc64.h for Intel N5X device, the address is the same as Agilex.

---
 arch/arm/mach-socfpga/include/mach/base_addr_soc64.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/arm/mach-socfpga/include/mach/base_addr_soc64.h +2 -1
index f89066d771..3f899fcfa3 100644
@@ -10,7 +10,8 @@
 #define SOCFPGA_SDR_SCHEDULER_ADDRESS		0xf8000400
 #define SOCFPGA_HMC_MMR_IO48_ADDRESS		0xf8010000
 #define SOCFPGA_SDR_ADDRESS			0xf8011000
-#ifdef CONFIG_TARGET_SOCFPGA_AGILEX
+#if IS_ENABLED(CONFIG_TARGET_SOCFPGA_AGILEX) || \
+	IS_ENABLED(CONFIG_TARGET_SOCFPGA_N5X)
 #define SOCFPGA_FW_MPU_DDR_SCR_ADDRESS		0xf8020200
 #else
 #define SOCFPGA_FW_MPU_DDR_SCR_ADDRESS		0xf8020100
Signature · 1 line
2.19.0
#4 lore raw

PATCH v3 4/17 arm: socfpga: Add handoff data support for Intel N5X device

In reply to Siew Chin Lim

From: Tien Fong Chee <[email protected]>

N5X support both HPS handoff data and DDR handoff data. Existing HPS handoff functions are restructured to support both existing devices and N5X device.

---
v3
- Adding helper function for getting endianness type.

v2:
- Enabled auto detect the endianness from the magic word
- Merged and simplifying the big and little endian flow

---
 .../mach-socfpga/include/mach/handoff_soc64.h |  38 ++++-
 arch/arm/mach-socfpga/system_manager_soc64.c  |  18 +--
 arch/arm/mach-socfpga/wrap_handoff_soc64.c    | 132 +++++++++++++-----
 3 files changed, 140 insertions(+), 48 deletions(-)
arch/arm/mach-socfpga/include/mach/handoff_soc64.h +33 -5
index 3750216a9a..902fc6bfb5 100644
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0
  *
- * Copyright (C) 2016-2020 Intel Corporation <www.intel.com>
+ * Copyright (C) 2016-2021 Intel Corporation <www.intel.com>
  *
  */
 
@@ -23,8 +23,36 @@
 #define SOC64_HANDOFF_OFFSET_DATA	0x10
 #define SOC64_HANDOFF_SIZE		4096
 
+#if IS_ENABLED(CONFIG_TARGET_SOCFPGA_STRATIX10) || \
+	IS_ENABLED(CONFIG_TARGET_SOCFPGA_AGILEX)
 #define SOC64_HANDOFF_BASE		0xFFE3F000
 #define SOC64_HANDOFF_MISC		(SOC64_HANDOFF_BASE + 0x610)
+#elif IS_ENABLED(CONFIG_TARGET_SOCFPGA_N5X)
+#define SOC64_HANDOFF_BASE		0xFFE5F000
+#define SOC64_HANDOFF_MISC		(SOC64_HANDOFF_BASE + 0x630)
+
+/* DDR handoff */
+#define SOC64_HANDOFF_DDR_BASE			0xFFE5C000
+#define SOC64_HANDOFF_DDR_MAGIC			0x48524444
+#define SOC64_HANDOFF_DDR_UMCTL2_MAGIC		0x4C54434D
+#define SOC64_HANDOFF_DDR_UMCTL2_DDR4_TYPE	0x34524444
+#define SOC64_HANDOFF_DDR_UMCTL2_LPDDR4_0_TYPE	0x3044504C
+#define SOC64_HANDOFF_DDR_UMCTL2_LPDDR4_1_TYPE	0x3144504C
+#define SOC64_HANDOFF_DDR_MEMRESET_BASE		(SOC64_HANDOFF_DDR_BASE + 0xC)
+#define SOC64_HANDOFF_DDR_UMCTL2_SECTION	(SOC64_HANDOFF_DDR_BASE + 0x10)
+#define SOC64_HANDOFF_DDR_PHY_MAGIC		0x43594850
+#define SOC64_HANDOFF_DDR_PHY_INIT_ENGINE_MAGIC	0x45594850
+#define SOC64_HANDOFF_DDR_PHY_BASE_OFFSET	0x8
+#define SOC64_HANDOFF_DDR_UMCTL2_TYPE_OFFSET	0x8
+#define SOC64_HANDOFF_DDR_UMCTL2_BASE_ADDR_OFFSET	0xC
+#define SOC64_HANDOFF_DDR_TRAIN_IMEM_1D_SECTION	0xFFE50000
+#define SOC64_HANDOFF_DDR_TRAIN_DMEM_1D_SECTION	0xFFE58000
+#define SOC64_HANDOFF_DDR_TRAIN_IMEM_2D_SECTION	0xFFE44000
+#define SOC64_HANDOFF_DDR_TRAIN_DMEM_2D_SECTION	0xFFE4C000
+#define SOC64_HANDOFF_DDR_TRAIN_IMEM_LENGTH	SZ_32K
+#define SOC64_HANDOFF_DDR_TRAIN_DMEM_LENGTH	SZ_16K
+#endif
+
 #define SOC64_HANDOFF_MUX		(SOC64_HANDOFF_BASE + 0x10)
 #define SOC64_HANDOFF_IOCTL		(SOC64_HANDOFF_BASE + 0x1A0)
 #define SOC64_HANDOFF_FPGA		(SOC64_HANDOFF_BASE + 0x330)
@@ -52,11 +80,11 @@
 #include <asm/types.h>
 enum endianness {
 	LITTLE_ENDIAN = 0,
-	BIG_ENDIAN
+	BIG_ENDIAN,
+	UNKNOWN_ENDIANNESS
 };
 
-int socfpga_get_handoff_size(void *handoff_address, enum endianness endian);
-int socfpga_handoff_read(void *handoff_address, void *table, u32 table_len,
-			 enum endianness big_endian);
+int socfpga_get_handoff_size(void *handoff_address);
+int socfpga_handoff_read(void *handoff_address, void *table, u32 table_len);
 #endif
 #endif /* _HANDOFF_SOC64_H_ */
arch/arm/mach-socfpga/system_manager_soc64.c +9 -9
index 3b5e774e2d..958bb5107b 100644
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0
 /*
- * Copyright (C) 2016-2018 Intel Corporation <www.intel.com>
+ * Copyright (C) 2016-2021 Intel Corporation <www.intel.com>
  *
  */
 
@@ -66,10 +66,10 @@ void populate_sysmgr_fpgaintf_module(void)
 void populate_sysmgr_pinmux(void)
 {
 	u32 len, i;
-	u32 len_mux = socfpga_get_handoff_size((void *)SOC64_HANDOFF_MUX, BIG_ENDIAN);
-	u32 len_ioctl = socfpga_get_handoff_size((void *)SOC64_HANDOFF_IOCTL, BIG_ENDIAN);
-	u32 len_fpga = socfpga_get_handoff_size((void *)SOC64_HANDOFF_FPGA, BIG_ENDIAN);
-	u32 len_delay = socfpga_get_handoff_size((void *)SOC64_HANDOFF_DELAY, BIG_ENDIAN);
+	u32 len_mux = socfpga_get_handoff_size((void *)SOC64_HANDOFF_MUX);
+	u32 len_ioctl = socfpga_get_handoff_size((void *)SOC64_HANDOFF_IOCTL);
+	u32 len_fpga = socfpga_get_handoff_size((void *)SOC64_HANDOFF_FPGA);
+	u32 len_delay = socfpga_get_handoff_size((void *)SOC64_HANDOFF_DELAY);
 
 	len = (len_mux > len_ioctl) ? len_mux : len_ioctl;
 	len = (len > len_fpga) ? len : len_fpga;
@@ -79,7 +79,7 @@ void populate_sysmgr_pinmux(void)
 
 	/* setup the pin sel */
 	len = (len_mux < SOC64_HANDOFF_MUX_LEN) ? len_mux : SOC64_HANDOFF_MUX_LEN;
-	socfpga_handoff_read((void *)SOC64_HANDOFF_MUX, handoff_table, len, BIG_ENDIAN);
+	socfpga_handoff_read((void *)SOC64_HANDOFF_MUX, handoff_table, len);
 	for (i = 0; i < len; i = i + 2) {
 		writel(handoff_table[i + 1],
 		       handoff_table[i] +
@@ -89,7 +89,7 @@ void populate_sysmgr_pinmux(void)
 
 	/* setup the pin ctrl */
 	len = (len_ioctl < SOC64_HANDOFF_IOCTL_LEN) ? len_ioctl : SOC64_HANDOFF_IOCTL_LEN;
-	socfpga_handoff_read((void *)SOC64_HANDOFF_IOCTL, handoff_table, len, BIG_ENDIAN);
+	socfpga_handoff_read((void *)SOC64_HANDOFF_IOCTL, handoff_table, len);
 	for (i = 0; i < len; i = i + 2) {
 		writel(handoff_table[i + 1],
 		       handoff_table[i] +
@@ -99,7 +99,7 @@ void populate_sysmgr_pinmux(void)
 
 	/* setup the fpga use */
 	len = (len_fpga < SOC64_HANDOFF_FPGA_LEN) ? len_fpga : SOC64_HANDOFF_FPGA_LEN;
-	socfpga_handoff_read((void *)SOC64_HANDOFF_FPGA, handoff_table, len, BIG_ENDIAN);
+	socfpga_handoff_read((void *)SOC64_HANDOFF_FPGA, handoff_table, len);
 	for (i = 0; i < len; i = i + 2) {
 		writel(handoff_table[i + 1],
 		       handoff_table[i] +
@@ -109,7 +109,7 @@ void populate_sysmgr_pinmux(void)
 
 	/* setup the IO delay */
 	len = (len_delay < SOC64_HANDOFF_DELAY_LEN) ? len_delay : SOC64_HANDOFF_DELAY_LEN;
-	socfpga_handoff_read((void *)SOC64_HANDOFF_DELAY, handoff_table, len, BIG_ENDIAN);
+	socfpga_handoff_read((void *)SOC64_HANDOFF_DELAY, handoff_table, len);
 	for (i = 0; i < len; i = i + 2) {
 		writel(handoff_table[i + 1],
 		       handoff_table[i] +
arch/arm/mach-socfpga/wrap_handoff_soc64.c +98 -34

157 lines not on this page · raw message

Signature · 1 line
2.19.0
Reviewed-by on v3 4/17
#5 lore raw

Re: [v3 04/17] arm: socfpga: Add handoff data support for Intel N5X device

Quoted 14 lines · Siew Chin Lim

From: Tien Fong Chee <[email protected]>

N5X support both HPS handoff data and DDR handoff data. Existing HPS handoff functions are restructured to support both existing devices and N5X device.

---
v3
- Adding helper function for getting endianness type.

Quoted 7 lines

v2:
- Enabled auto detect the endianness from the magic word
- Merged and simplifying the big and little endian flow

---
 .../mach-socfpga/include/mach/handoff_soc64.h |  38 ++++-
 arch/arm/mach-socfpga/system_manager_soc64.c  |  18 +--
 arch/arm/mach-socfpga/wrap_handoff_soc64.c    | 132 +++++++++++++-----

Regards
Ley Foon

#6 lore raw

PATCH v3 5/17 drivers: clk: Add clock driver for Intel N5X device

In reply to Siew Chin Lim

Add clock manager driver for N5X. Provides clock initialization and get_rate functions.

---
v3:
- Use BIT() macro for CLKMGR_INTER_*_MASK macro

v2:
- common.h need to be included before clock_manager.h
- Remove unnecessary comment : write 1 to clear
- Remove unnecessary () in the code

---
 drivers/clk/altera/Makefile           |   3 +-
 drivers/clk/altera/clk-n5x.c          | 489 ++++++++++++++++++++++++++
 drivers/clk/altera/clk-n5x.h          | 217 ++++++++++++
 include/dt-bindings/clock/n5x-clock.h |  71 ++++
 4 files changed, 779 insertions(+), 1 deletion(-)
 create mode 100644 drivers/clk/altera/clk-n5x.c
 create mode 100644 drivers/clk/altera/clk-n5x.h
 create mode 100644 include/dt-bindings/clock/n5x-clock.h
drivers/clk/altera/Makefile +2 -1
index 96215ad5c4..38cd730685 100644
@@ -1,7 +1,8 @@
 # SPDX-License-Identifier: GPL-2.0+
 #
-# Copyright (C) 2018 Marek Vasut <[email protected]>
+# Copyright (C) 2018-2021 Marek Vasut <[email protected]>
 #
 
 obj-$(CONFIG_TARGET_SOCFPGA_AGILEX) += clk-agilex.o
 obj-$(CONFIG_TARGET_SOCFPGA_ARRIA10) += clk-arria10.o
+obj-$(CONFIG_TARGET_SOCFPGA_N5X) += clk-n5x.o
drivers/clk/altera/clk-n5x.c new file +489 -0

489 lines not on this page · raw message

drivers/clk/altera/clk-n5x.h new file +217 -0

217 lines not on this page · raw message

include/dt-bindings/clock/n5x-clock.h new file +71 -0

71 lines not on this page · raw message

Signature · 1 line
2.19.0
Reviewed-by on v3 5/17
#7 lore raw

Re: [v3 05/17] drivers: clk: Add clock driver for Intel N5X device

Quoted 14 lines · Siew Chin Lim

Add clock manager driver for N5X. Provides clock initialization and get_rate functions.

---
v3:
- Use BIT() macro for CLKMGR_INTER_*_MASK macro

v2:
- common.h need to be included before clock_manager.h
- Remove unnecessary comment : write 1 to clear
- Remove unnecessary () in the code

Quoted 9 lines
---
 drivers/clk/altera/Makefile           |   3 +-
 drivers/clk/altera/clk-n5x.c          | 489 ++++++++++++++++++++++++++
 drivers/clk/altera/clk-n5x.h          | 217 ++++++++++++
 include/dt-bindings/clock/n5x-clock.h |  71 ++++
 4 files changed, 779 insertions(+), 1 deletion(-)
 create mode 100644 drivers/clk/altera/clk-n5x.c
 create mode 100644 drivers/clk/altera/clk-n5x.h
 create mode 100644 include/dt-bindings/clock/n5x-clock.h

Regards
Ley Foon

#8 lore raw

PATCH v3 6/17 arm: socfpga: Get clock manager base address for Intel N5X device

In reply to Siew Chin Lim

Add N5X clock manager to socfpga_get_managers_addr function.

---
 arch/arm/mach-socfpga/misc.c | 3 +++
 1 file changed, 3 insertions(+)
arch/arm/mach-socfpga/misc.c +3 -0
index 64a7c9d652..9305bec38a 100644
@@ -254,6 +254,9 @@ void socfpga_get_managers_addr(void)
 #ifdef CONFIG_TARGET_SOCFPGA_AGILEX
 	ret = socfpga_get_base_addr("intel,agilex-clkmgr",
 				    &socfpga_clkmgr_base);
+#elif IS_ENABLED(CONFIG_TARGET_SOCFPGA_N5X)
+	ret = socfpga_get_base_addr("intel,n5x-clkmgr",
+				    &socfpga_clkmgr_base);
 #else
 	ret = socfpga_get_base_addr("altr,clk-mgr", &socfpga_clkmgr_base);
 #endif
Signature · 1 line
2.19.0
#9 lore raw

PATCH v3 7/17 drivers: clk: Add memory clock driver for Intel N5X device

In reply to Siew Chin Lim

Add memory clock manager driver for N5X. Provides memory clock initialization and enable functions.

---
v3:
- Use BIT() and GENMASK() macro for all *MASK macro

v2:
- common.h need to be included before clock_manager.h
- For consistency, use small letter fo 0x0c and 0x1c in macros

---
 drivers/clk/altera/Makefile      |   1 +
 drivers/clk/altera/clk-mem-n5x.c | 136 +++++++++++++++++++++++++++++++
 drivers/clk/altera/clk-mem-n5x.h |  84 +++++++++++++++++++
 3 files changed, 221 insertions(+)
 create mode 100644 drivers/clk/altera/clk-mem-n5x.c
 create mode 100644 drivers/clk/altera/clk-mem-n5x.h
drivers/clk/altera/Makefile +1 -0
index 38cd730685..33db092918 100644
@@ -6,3 +6,4 @@
 obj-$(CONFIG_TARGET_SOCFPGA_AGILEX) += clk-agilex.o
 obj-$(CONFIG_TARGET_SOCFPGA_ARRIA10) += clk-arria10.o
 obj-$(CONFIG_TARGET_SOCFPGA_N5X) += clk-n5x.o
+obj-$(CONFIG_TARGET_SOCFPGA_N5X) += clk-mem-n5x.o
drivers/clk/altera/clk-mem-n5x.c new file +136 -0

136 lines not on this page · raw message

drivers/clk/altera/clk-mem-n5x.h new file +84 -0

84 lines not on this page · raw message

Signature · 1 line
2.19.0
Reviewed-by on v3 7/17
#10 lore raw

Re: [v3 07/17] drivers: clk: Add memory clock driver for Intel N5X device

Quoted 13 lines · Siew Chin Lim

Add memory clock manager driver for N5X. Provides memory clock initialization and enable functions.

---
v3:
- Use BIT() and GENMASK() macro for all *MASK macro

v2:
- common.h need to be included before clock_manager.h
- For consistency, use small letter fo 0x0c and 0x1c in macros

Quoted 8 lines
---
 drivers/clk/altera/Makefile      |   1 +
 drivers/clk/altera/clk-mem-n5x.c | 136 +++++++++++++++++++++++++++++++
 drivers/clk/altera/clk-mem-n5x.h |  84 +++++++++++++++++++
 3 files changed, 221 insertions(+)
 create mode 100644 drivers/clk/altera/clk-mem-n5x.c
 create mode 100644 drivers/clk/altera/clk-mem-n5x.h

Regards
Ley Foon

#11 lore raw

PATCH v3 8/17 arm: socfpga: Move cm_get_mpu_clk_hz function declaration to clock_manager.h

In reply to Siew Chin Lim

Move cm_get_mpu_clk_hz function declaration from individual device's clock manager header file to common clock_manager.h.

---
 arch/arm/mach-socfpga/include/mach/clock_manager.h         | 1 +
 arch/arm/mach-socfpga/include/mach/clock_manager_agilex.h  | 2 --
 arch/arm/mach-socfpga/include/mach/clock_manager_arria10.h | 1 -
 arch/arm/mach-socfpga/include/mach/clock_manager_gen5.h    | 1 -
 arch/arm/mach-socfpga/include/mach/clock_manager_s10.h     | 1 -
 5 files changed, 1 insertion(+), 5 deletions(-)
arch/arm/mach-socfpga/include/mach/clock_manager.h +1 -0
index 2f9b471af3..d0b172a30e 100644
@@ -12,6 +12,7 @@ phys_addr_t socfpga_get_clkmgr_addr(void);
 void cm_wait_for_lock(u32 mask);
 int cm_wait_for_fsm(void);
 void cm_print_clock_quick_summary(void);
+unsigned long cm_get_mpu_clk_hz(void);
 unsigned int cm_get_qspi_controller_clk_hz(void);
 
 #if defined(CONFIG_TARGET_SOCFPGA_SOC64)
arch/arm/mach-socfpga/include/mach/clock_manager_agilex.h +0 -2
index 386e82a4e3..4feae3dda9 100644
@@ -6,8 +6,6 @@
 #ifndef _CLOCK_MANAGER_AGILEX_
 #define _CLOCK_MANAGER_AGILEX_
 
-unsigned long cm_get_mpu_clk_hz(void);
-
 #include <asm/arch/clock_manager_soc64.h>
 #include "../../../../../drivers/clk/altera/clk-agilex.h"
 
arch/arm/mach-socfpga/include/mach/clock_manager_arria10.h +0 -1
index 798d3741bd..553ebe660d 100644
@@ -68,7 +68,6 @@ int cm_basic_init(const void *blob);
 
 #include <linux/bitops.h>
 unsigned int cm_get_l4_sp_clk_hz(void);
-unsigned long cm_get_mpu_clk_hz(void);
 
 #endif /* __ASSEMBLY__ */
 
arch/arm/mach-socfpga/include/mach/clock_manager_gen5.h +0 -1
index 4cc1268b4c..d53095a7da 100644
@@ -96,7 +96,6 @@ struct cm_config {
 #define CLKMGR_PERPLL_EN			CLKMGR_GEN5_PERPLL_EN
 
 /* Clock speed accessors */
-unsigned long cm_get_mpu_clk_hz(void);
 unsigned long cm_get_sdram_clk_hz(void);
 unsigned int cm_get_l4_sp_clk_hz(void);
 unsigned int cm_get_mmc_controller_clk_hz(void);
arch/arm/mach-socfpga/include/mach/clock_manager_s10.h +0 -1
index 98c3bf1b03..7f10296dc7 100644
@@ -11,7 +11,6 @@
 #include <linux/bitops.h>
 
 /* Clock speed accessors */
-unsigned long cm_get_mpu_clk_hz(void);
 unsigned long cm_get_sdram_clk_hz(void);
 unsigned int cm_get_l4_sp_clk_hz(void);
 unsigned int cm_get_mmc_controller_clk_hz(void);
Signature · 1 line
2.19.0
#12 lore raw

PATCH v3 9/17 arm: socfpga: Add clock manager for Intel N5X device

In reply to Siew Chin Lim

Add clock manager for N5X.

---
 ...k_manager_agilex.c => clock_manager_n5x.c} | 32 +++++++++----------
 .../mach-socfpga/include/mach/clock_manager.h |  2 ++
 .../include/mach/clock_manager_n5x.h          | 12 +++++++
 3 files changed, 29 insertions(+), 17 deletions(-)
 copy arch/arm/mach-socfpga/{clock_manager_agilex.c => clock_manager_n5x.c} (64%)
 create mode 100644 arch/arm/mach-socfpga/include/mach/clock_manager_n5x.h
arch/arm/mach-socfpga/clock_manager_n5x.c renamed from arch/arm/mach-socfpga/clock_manager_agilex.c +15 -17
similarity index 64%
copy from arch/arm/mach-socfpga/clock_manager_agilex.c
copy to arch/arm/mach-socfpga/clock_manager_n5x.c
index e035c09aae..4f098533e7 100644
@@ -1,19 +1,18 @@
 // SPDX-License-Identifier: GPL-2.0
 /*
- * Copyright (C) 2019 Intel Corporation <www.intel.com>
+ * Copyright (C) 2020-2021 Intel Corporation <www.intel.com>
  *
  */
 
-#include <clk.h>
 #include <common.h>
-#include <dm.h>
-#include <log.h>
-#include <malloc.h>
 #include <asm/arch/clock_manager.h>
 #include <asm/arch/system_manager.h>
 #include <asm/global_data.h>
 #include <asm/io.h>
-#include <dt-bindings/clock/agilex-clock.h>
+#include <clk.h>
+#include <dm.h>
+#include <dt-bindings/clock/n5x-clock.h>
+#include <malloc.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -25,7 +24,7 @@ static ulong cm_get_rate_dm(u32 id)
 	int ret;
 
 	ret = uclass_get_device_by_driver(UCLASS_CLK,
-					  DM_DRIVER_GET(socfpga_agilex_clk),
+					  DM_DRIVER_GET(socfpga_n5x_clk),
 					  &dev);
 	if (ret)
 		return 0;
@@ -39,8 +38,7 @@ static ulong cm_get_rate_dm(u32 id)
 
 	clk_free(&clk);
 
-	if ((rate == (unsigned long)-ENOSYS) ||
-	    (rate == (unsigned long)-ENXIO) ||
+	if ((rate == (unsigned long)-ENXIO) ||
 	    (rate == (unsigned long)-EIO)) {
 		debug("%s id %u: clk_get_rate err: %ld\n",
 		      __func__, id, rate);
@@ -57,26 +55,26 @@ static u32 cm_get_rate_dm_khz(u32 id)
 
 unsigned long cm_get_mpu_clk_hz(void)
 {
-	return cm_get_rate_dm(AGILEX_MPU_CLK);
+	return cm_get_rate_dm(N5X_MPU_CLK);
 }
 
 unsigned int cm_get_l4_sys_free_clk_hz(void)
 {
-	return cm_get_rate_dm(AGILEX_L4_SYS_FREE_CLK);
+	return cm_get_rate_dm(N5X_L4_SYS_FREE_CLK);
 }
 
 void cm_print_clock_quick_summary(void)
 {
 	printf("MPU       %10d kHz\n",
-	       cm_get_rate_dm_khz(AGILEX_MPU_CLK));
+	       cm_get_rate_dm_khz(N5X_MPU_CLK));
 	printf("L4 Main	    %8d kHz\n",
-	       cm_get_rate_dm_khz(AGILEX_L4_MAIN_CLK));
+	       cm_get_rate_dm_khz(N5X_L4_MAIN_CLK));
 	printf("L4 sys free %8d kHz\n",
-	       cm_get_rate_dm_khz(AGILEX_L4_SYS_FREE_CLK));
+	       cm_get_rate_dm_khz(N5X_L4_SYS_FREE_CLK));
 	printf("L4 MP       %8d kHz\n",
-	       cm_get_rate_dm_khz(AGILEX_L4_MP_CLK));
+	       cm_get_rate_dm_khz(N5X_L4_MP_CLK));
 	printf("L4 SP       %8d kHz\n",
-	       cm_get_rate_dm_khz(AGILEX_L4_SP_CLK));
+	       cm_get_rate_dm_khz(N5X_L4_SP_CLK));
 	printf("SDMMC       %8d kHz\n",
-	       cm_get_rate_dm_khz(AGILEX_SDMMC_CLK));
+	       cm_get_rate_dm_khz(N5X_SDMMC_CLK));
 }
arch/arm/mach-socfpga/include/mach/clock_manager.h +2 -0
index d0b172a30e..a8cb07a1c4 100644
@@ -28,6 +28,8 @@ int cm_set_qspi_controller_clk_hz(u32 clk_hz);
 #include <asm/arch/clock_manager_s10.h>
 #elif defined(CONFIG_TARGET_SOCFPGA_AGILEX)
 #include <asm/arch/clock_manager_agilex.h>
+#elif IS_ENABLED(CONFIG_TARGET_SOCFPGA_N5X)
+#include <asm/arch/clock_manager_n5x.h>
 #endif
 
 #endif /* _CLOCK_MANAGER_H_ */
arch/arm/mach-socfpga/include/mach/clock_manager_n5x.h new file +12 -0
new file mode 100644
index 0000000000..54615ae8f7
@@ -0,0 +1,12 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright (C) 2020-2021 Intel Corporation <www.intel.com>
+ */
+
+#ifndef _CLOCK_MANAGER_N5X_
+#define _CLOCK_MANAGER_N5X_
+
+#include <asm/arch/clock_manager_soc64.h>
+#include "../../../../../drivers/clk/altera/clk-n5x.h"
+
+#endif /* _CLOCK_MANAGER_N5X_ */
Signature · 1 line
2.19.0
#13 lore raw

PATCH v3 10/17 arm: socfpga: Changed misc_s10.c to misc_soc64.c

In reply to Siew Chin Lim

Rename to common file name to used by all SOC64 devices. No functionality change.

---
 arch/arm/mach-socfpga/Makefile                     |  4 ++--
 arch/arm/mach-socfpga/{misc_s10.c => misc_soc64.c} | 12 ++++++------
 2 files changed, 8 insertions(+), 8 deletions(-)
 rename arch/arm/mach-socfpga/{misc_s10.c => misc_soc64.c} (100%)
arch/arm/mach-socfpga/Makefile +2 -2
index 5779c55621..58afde950f 100644
@@ -32,7 +32,7 @@ ifdef CONFIG_TARGET_SOCFPGA_STRATIX10
 obj-y	+= clock_manager_s10.o
 obj-y	+= lowlevel_init_soc64.o
 obj-y	+= mailbox_s10.o
-obj-y	+= misc_s10.o
+obj-y	+= misc_soc64.o
 obj-y	+= mmu-arm64_s10.o
 obj-y	+= reset_manager_s10.o
 obj-y	+= system_manager_soc64.o
@@ -45,7 +45,7 @@ ifdef CONFIG_TARGET_SOCFPGA_AGILEX
 obj-y	+= clock_manager_agilex.o
 obj-y	+= lowlevel_init_soc64.o
 obj-y	+= mailbox_s10.o
-obj-y	+= misc_s10.o
+obj-y	+= misc_soc64.o
 obj-y	+= mmu-arm64_s10.o
 obj-y	+= reset_manager_s10.o
 obj-$(CONFIG_SOCFPGA_SECURE_VAB_AUTH)	+= secure_vab.o
arch/arm/mach-socfpga/misc_soc64.c renamed from arch/arm/mach-socfpga/misc_s10.c +6 -6
similarity index 100%
rename from arch/arm/mach-socfpga/misc_s10.c
rename to arch/arm/mach-socfpga/misc_soc64.c
index 50c7f19ae1..7b973a79e8 100644
@@ -6,16 +6,16 @@
 
 #include <altera.h>
 #include <common.h>
-#include <env.h>
-#include <errno.h>
-#include <init.h>
-#include <log.h>
-#include <asm/global_data.h>
-#include <asm/io.h>
 #include <asm/arch/mailbox_s10.h>
 #include <asm/arch/misc.h>
 #include <asm/arch/reset_manager.h>
 #include <asm/arch/system_manager.h>
+#include <asm/io.h>
+#include <asm/global_data.h>
+#include <env.h>
+#include <errno.h>
+#include <init.h>
+#include <log.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
Signature · 1 line
2.19.0
#14 lore raw

PATCH v3 11/17 ddr: socfpga: Enable memory test on memory size less than 1GB

In reply to Siew Chin Lim

From: Tien Fong Chee <[email protected]>

Minimum 1GB memory size is required in current memory test, so this patch improves the memory test for processing memory size less than 1GB, and the size in power of two.

---
 drivers/ddr/altera/sdram_soc64.c | 24 +++++++++++++++++++++---
 1 file changed, 21 insertions(+), 3 deletions(-)
drivers/ddr/altera/sdram_soc64.c +21 -3
index a08f0953e5..cc656db97c 100644
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0
 /*
- * Copyright (C) 2016-2019 Intel Corporation <www.intel.com>
+ * Copyright (C) 2016-2021 Intel Corporation <www.intel.com>
  *
  */
 
@@ -182,6 +182,7 @@ void sdram_size_check(struct bd_info *bd)
 	phys_size_t total_ram_check = 0;
 	phys_size_t ram_check = 0;
 	phys_addr_t start = 0;
+	phys_size_t size, remaining_size;
 	int bank;
 
 	/* Sanity check ensure correct SDRAM size specified */
@@ -189,10 +190,27 @@ void sdram_size_check(struct bd_info *bd)
 
 	for (bank = 0; bank < CONFIG_NR_DRAM_BANKS; bank++) {
 		start = bd->bi_dram[bank].start;
+		remaining_size = bd->bi_dram[bank].size;
 		while (ram_check < bd->bi_dram[bank].size) {
-			ram_check += get_ram_size((void *)(start + ram_check),
-						 (phys_size_t)SZ_1G);
+			size = min((phys_addr_t)SZ_1G,
+				   (phys_addr_t)remaining_size);
+
+			/*
+			 * Ensure the size is power of two, this is requirement
+			 * to run get_ram_size() / memory test
+			 */
+			if (size != 0 && ((size & (size - 1)) == 0)) {
+				ram_check += get_ram_size((void *)
+						(start + ram_check), size);
+				remaining_size = bd->bi_dram[bank].size -
+							ram_check;
+			} else {
+				puts("DDR: Memory test requires SDRAM size ");
+				puts("in power of two!\n");
+				hang();
+			}
 		}
+
 		total_ram_check += ram_check;
 		ram_check = 0;
 	}
Signature · 1 line
2.19.0
#15 lore raw

PATCH v3 12/17 ddr: altera: Add SDRAM driver for Intel N5X device

In reply to Siew Chin Lim

From: Tien Fong Chee <[email protected]>

The DDR subsystem in Diamond Mesa is consisted of controller, PHY, memory reset manager and memory clock manager.

Configuration settings of controller, PHY and memory reset manager is come from DDR handoff data in bitstream, which contain the register base addresses and user settings from tool.

Configuration settings of memory clock manager is come from the HPS handoff data in bitstream, however the register base address is defined in device tree.

The calibration is fully done in HPS, which requires IMEM and DMEM binaries loading to PHY SRAM for running this calibration, both IMEM and DMEM binaries are also part of bitstream, this bitstream would be loaded to OCRAM by SDM, and configured by DDR driver.

---
v3:
- Sorting header
- Used prefix OPM_xxx
- Simplify the code with do...while loop.
- Created common function for processing handoff
- Adding function of calibration data feedback to LPDDR4 controllers

v2:
- Move is_ddr_init_skipped and its helper functions to DDR driver and converted function to positive checking
- Using GENMASK() macro
- Fixed typo
- Return status of subfunction
- Changed dm to n5x

---
 arch/arm/mach-socfpga/include/mach/firewall.h |    6 +
 .../include/mach/system_manager_soc64.h       |   10 +-
 drivers/ddr/altera/Makefile                   |    3 +-
 drivers/ddr/altera/sdram_n5x.c                | 2298 +++++++++++++++++
 drivers/ddr/altera/sdram_soc64.c              |   70 +
 drivers/ddr/altera/sdram_soc64.h              |    1 +
 6 files changed, 2386 insertions(+), 2 deletions(-)
 create mode 100644 drivers/ddr/altera/sdram_n5x.c
arch/arm/mach-socfpga/include/mach/firewall.h +6 -0
index adab65bc96..5cb7f23f8f 100644
@@ -115,10 +115,16 @@ struct socfpga_firwall_l4_sys {
 /* Firewall MPU DDR SCR registers */
 #define FW_MPU_DDR_SCR_EN				0x00
 #define FW_MPU_DDR_SCR_EN_SET				0x04
+#define FW_MPU_DDR_SCR_MPUREGION0ADDR_BASE		0x10
+#define FW_MPU_DDR_SCR_MPUREGION0ADDR_BASEEXT		0x14
 #define FW_MPU_DDR_SCR_MPUREGION0ADDR_LIMIT		0x18
 #define FW_MPU_DDR_SCR_MPUREGION0ADDR_LIMITEXT		0x1c
+
+#define FW_MPU_DDR_SCR_NONMPUREGION0ADDR_BASE		0x90
+#define FW_MPU_DDR_SCR_NONMPUREGION0ADDR_BASEEXT	0x94
 #define FW_MPU_DDR_SCR_NONMPUREGION0ADDR_LIMIT		0x98
 #define FW_MPU_DDR_SCR_NONMPUREGION0ADDR_LIMITEXT	0x9c
+#define FW_MPU_DDR_SCR_NONMPUREGION0ADDR_LIMITEXT_FIELD	0xff
 
 #define MPUREGION0_ENABLE				BIT(0)
 #define NONMPUREGION0_ENABLE				BIT(8)
arch/arm/mach-socfpga/include/mach/system_manager_soc64.h +9 -1
index fc4e17821b..a8009664fe 100644
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0 */
 /*
- * Copyright (C) 2019 Intel Corporation <www.intel.com>
+ * Copyright (C) 2019-2021 Intel Corporation <www.intel.com>
  */
 
 #ifndef _SYSTEM_MANAGER_SOC64_H_
@@ -28,8 +28,12 @@ void populate_sysmgr_pinmux(void);
 #define SYSMGR_SOC64_FPGAINTF_EN2		0x6c
 #define SYSMGR_SOC64_FPGAINTF_EN3		0x70
 #define SYSMGR_SOC64_DMA_L3MASTER		0x74
+#if IS_ENABLED(CONFIG_TARGET_SOCFPGA_N5X)
+#define SYSMGR_SOC64_DDR_MODE			0xb8
+#else
 #define SYSMGR_SOC64_HMC_CLK			0xb4
 #define SYSMGR_SOC64_IO_PA_CTRL			0xb8
+#endif
 #define SYSMGR_SOC64_NOC_TIMEOUT		0xc0
 #define SYSMGR_SOC64_NOC_IDLEREQ_SET		0xc4
 #define SYSMGR_SOC64_NOC_IDLEREQ_CLR		0xc8
@@ -143,4 +147,8 @@ void populate_sysmgr_pinmux(void);
 
 #define SYSMGR_WDDBG_PAUSE_ALL_CPU	0x0F0F0F0F
 
+#if IS_ENABLED(CONFIG_TARGET_SOCFPGA_N5X)
+#define	SYSMGR_SOC64_DDR_MODE_MSK	BIT(0)
+#endif
+
 #endif /* _SYSTEM_MANAGER_SOC64_H_ */
drivers/ddr/altera/Makefile +2 -1
index 39dfee5d5a..9fa5d85a27 100644
@@ -4,11 +4,12 @@
 # Wolfgang Denk, DENX Software Engineering, [email protected].
 #
 # (C) Copyright 2010, Thomas Chou <[email protected]>
-# Copyright (C) 2014 Altera Corporation <www.altera.com>
+# Copyright (C) 2014-2021 Altera Corporation <www.altera.com>
 
 ifdef CONFIG_$(SPL_)ALTERA_SDRAM
 obj-$(CONFIG_TARGET_SOCFPGA_GEN5) += sdram_gen5.o sequencer.o
 obj-$(CONFIG_TARGET_SOCFPGA_ARRIA10) += sdram_arria10.o
 obj-$(CONFIG_TARGET_SOCFPGA_STRATIX10) += sdram_soc64.o sdram_s10.o
 obj-$(CONFIG_TARGET_SOCFPGA_AGILEX) += sdram_soc64.o sdram_agilex.o
+obj-$(CONFIG_TARGET_SOCFPGA_N5X) += sdram_soc64.o sdram_n5x.o
 endif
drivers/ddr/altera/sdram_n5x.c new file +2298 -0

2,298 lines not on this page · raw message

drivers/ddr/altera/sdram_soc64.c +70 -0

99 lines not on this page · raw message

drivers/ddr/altera/sdram_soc64.h +1 -0
index 8af0afc410..7460f8c220 100644
@@ -180,6 +180,7 @@ int emif_reset(struct altera_sdram_plat *plat);
 int poll_hmc_clock_status(void);
 void sdram_clear_mem(phys_addr_t addr, phys_size_t size);
 void sdram_init_ecc_bits(struct bd_info *bd);
+void sdram_set_firewall(struct bd_info *bd);
 void sdram_size_check(struct bd_info *bd);
 phys_size_t sdram_calculate_size(struct altera_sdram_plat *plat);
 int sdram_mmr_init_full(struct udevice *dev);
Signature · 1 line
2.19.0
Reviewed-by on v3 12/17
#16 lore raw

Re: [v3 12/17] ddr: altera: Add SDRAM driver for Intel N5X device

Quoted 37 lines · Siew Chin Lim

From: Tien Fong Chee <[email protected]>

The DDR subsystem in Diamond Mesa is consisted of controller, PHY, memory reset manager and memory clock manager.

Configuration settings of controller, PHY and memory reset manager is come from DDR handoff data in bitstream, which contain the register base addresses and user settings from tool.

Configuration settings of memory clock manager is come from the HPS handoff data in bitstream, however the register base address is defined in device tree.

The calibration is fully done in HPS, which requires IMEM and DMEM binaries loading to PHY SRAM for running this calibration, both IMEM and DMEM binaries are also part of bitstream, this bitstream would be loaded to OCRAM by SDM, and configured by DDR driver.

---
v3:
- Sorting header
- Used prefix OPM_xxx
- Simplify the code with do...while loop.
- Created common function for processing handoff
- Adding function of calibration data feedback to LPDDR4 controllers

v2:
- Move is_ddr_init_skipped and its helper functions to DDR driver and converted function to positive checking
- Using GENMASK() macro
- Fixed typo
- Return status of subfunction
- Changed dm to n5x

Quoted 10 lines
---
 arch/arm/mach-socfpga/include/mach/firewall.h |    6 +
 .../include/mach/system_manager_soc64.h       |   10 +-
 drivers/ddr/altera/Makefile                   |    3 +-
 drivers/ddr/altera/sdram_n5x.c                | 2298 +++++++++++++++++
 drivers/ddr/altera/sdram_soc64.c              |   70 +
 drivers/ddr/altera/sdram_soc64.h              |    1 +
 6 files changed, 2386 insertions(+), 2 deletions(-)
 create mode 100644 drivers/ddr/altera/sdram_n5x.c

Regards
Ley Foon

#17 lore raw

PATCH v3 13/17 arm: socfpga: Add SPL for Intel N5X device

In reply to Siew Chin Lim

Add SPL for N5X.

---
 .../mach-socfpga/{spl_agilex.c => spl_n5x.c}  | 37 +++++++++++--------
 1 file changed, 22 insertions(+), 15 deletions(-)
 copy arch/arm/mach-socfpga/{spl_agilex.c => spl_n5x.c} (83%)
arch/arm/mach-socfpga/spl_n5x.c renamed from arch/arm/mach-socfpga/spl_agilex.c +22 -15
similarity index 83%
copy from arch/arm/mach-socfpga/spl_agilex.c
copy to arch/arm/mach-socfpga/spl_n5x.c
index ee5a9dc1e2..d056871d29 100644
@@ -1,27 +1,26 @@
 // SPDX-License-Identifier: GPL-2.0
 /*
- * Copyright (C) 2019 Intel Corporation <www.intel.com>
+ * Copyright (C) 2020-2021 Intel Corporation <www.intel.com>
  *
  */
 
-#include <init.h>
-#include <log.h>
-#include <asm/global_data.h>
-#include <asm/io.h>
-#include <asm/u-boot.h>
-#include <asm/utils.h>
 #include <common.h>
-#include <hang.h>
-#include <image.h>
-#include <spl.h>
 #include <asm/arch/clock_manager.h>
 #include <asm/arch/firewall.h>
 #include <asm/arch/mailbox_s10.h>
 #include <asm/arch/misc.h>
 #include <asm/arch/reset_manager.h>
 #include <asm/arch/system_manager.h>
-#include <watchdog.h>
+#include <asm/global_data.h>
+#include <asm/io.h>
+#include <asm/u-boot.h>
+#include <asm/utils.h>
 #include <dm/uclass.h>
+#include <hang.h>
+#include <image.h>
+#include <init.h>
+#include <spl.h>
+#include <watchdog.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -54,27 +53,35 @@ void board_init_f(ulong dummy)
 
 	sysmgr_pinmux_init();
 
+	preloader_console_init();
+
 	ret = uclass_get_device(UCLASS_CLK, 0, &dev);
 	if (ret) {
-		debug("Clock init failed: %d\n", ret);
+		printf("Clock init failed: %d\n", ret);
+		hang();
+	}
+
+	ret = uclass_get_device(UCLASS_CLK, 1, &dev);
+	if (ret) {
+		printf("Memory clock init failed: %d\n", ret);
 		hang();
 	}
 
-	preloader_console_init();
 	print_reset_info();
 	cm_print_clock_quick_summary();
 
 	firewall_setup();
+
 	ret = uclass_get_device(UCLASS_CACHE, 0, &dev);
 	if (ret) {
-		debug("CCU init failed: %d\n", ret);
+		printf("CCU init failed: %d\n", ret);
 		hang();
 	}
 
 #if CONFIG_IS_ENABLED(ALTERA_SDRAM)
 	ret = uclass_get_device(UCLASS_RAM, 0, &dev);
 	if (ret) {
-		debug("DRAM init failed: %d\n", ret);
+		printf("DRAM init failed: %d\n", ret);
 		hang();
 	}
 #endif
Signature · 1 line
2.19.0
#18 lore raw

PATCH v3 14/17 board: intel: Add socdk board support for Intel N5X device

In reply to Siew Chin Lim

Add N5X SoC devkit board.

---
 board/intel/n5x-socdk/MAINTAINERS                          | 7 +++++++
 board/{altera/stratix10-socdk => intel/n5x-socdk}/Makefile | 2 +-
 .../{altera/stratix10-socdk => intel/n5x-socdk}/socfpga.c  | 2 +-
 3 files changed, 9 insertions(+), 2 deletions(-)
 create mode 100644 board/intel/n5x-socdk/MAINTAINERS
 copy board/{altera/stratix10-socdk => intel/n5x-socdk}/Makefile (50%)
 copy board/{altera/stratix10-socdk => intel/n5x-socdk}/socfpga.c (52%)
board/intel/n5x-socdk/MAINTAINERS new file +7 -0
new file mode 100644
index 0000000000..c1059f092c
@@ -0,0 +1,7 @@
+SOCFPGA BOARD
+M:	Chee Tien Fong <[email protected]>
+M:	Lim Siew Chin <[email protected]>
+S:	Maintained
+F:	board/intel/n5x-socdk/
+F:	include/configs/socfpga_n5x_socdk.h
+F:	configs/socfpga_n5x_atf_defconfig
board/intel/n5x-socdk/Makefile renamed from board/altera/stratix10-socdk/Makefile +1 -1
similarity index 50%
copy from board/altera/stratix10-socdk/Makefile
copy to board/intel/n5x-socdk/Makefile
index 02a9cadf76..accfdcddcb 100644
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2016-2017 Intel Corporation <www.intel.com>
+# Copyright (C) 2020-2021 Intel Corporation <www.intel.com>
 #
 # SPDX-License-Identifier:	GPL-2.0
 #
board/intel/n5x-socdk/socfpga.c renamed from board/altera/stratix10-socdk/socfpga.c +1 -1
similarity index 52%
copy from board/altera/stratix10-socdk/socfpga.c
copy to board/intel/n5x-socdk/socfpga.c
index 043fc543f1..985ba190d0 100644
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0
 /*
- * Copyright (C) 2016-2018 Intel Corporation <www.intel.com>
+ * Copyright (C) 2020-2021 Intel Corporation <www.intel.com>
  *
  */
 
Signature · 1 line
2.19.0
#19 lore raw

PATCH v3 15/17 arm: dts: Add base dtsi and devkit dts for Intel N5X device

In reply to Siew Chin Lim

Add device tree for N5X.

---
v3:
- Update comment for memory example code
- Move all common dts settings for N5X from socfpga_n5x_socdk.dts to socfpga_n5x-u-boot.dtsi
- Remove unused parameter "u-boot,boot0"

v2:
- Remove socfpga_n5x.dtsi
- Reuse socfpga_agilex.dtsi in socfpga_n5x_socdk.dts and update n5x data accordingly.

---
 arch/arm/dts/Makefile                         |   1 +
 arch/arm/dts/socfpga_n5x-u-boot.dtsi          | 175 ++++++++++++++++++
 arch/arm/dts/socfpga_n5x_socdk-u-boot.dtsi    |  67 +++++++
 ...agilex_socdk.dts => socfpga_n5x_socdk.dts} |  25 ++-
 4 files changed, 262 insertions(+), 6 deletions(-)
 create mode 100644 arch/arm/dts/socfpga_n5x-u-boot.dtsi
 create mode 100644 arch/arm/dts/socfpga_n5x_socdk-u-boot.dtsi
 copy arch/arm/dts/{socfpga_agilex_socdk.dts => socfpga_n5x_socdk.dts} (81%)
arch/arm/dts/Makefile +1 -0
index 096068261d..8a513e2a87 100644
@@ -393,6 +393,7 @@ dtb-$(CONFIG_ARCH_SOCFPGA) +=				\
 	socfpga_cyclone5_socrates.dtb			\
 	socfpga_cyclone5_sr1500.dtb			\
 	socfpga_cyclone5_vining_fpga.dtb		\
+	socfpga_n5x_socdk.dtb				\
 	socfpga_stratix10_socdk.dtb
 
 dtb-$(CONFIG_TARGET_DRA7XX_EVM) += dra72-evm.dtb dra7-evm.dtb	\
arch/arm/dts/socfpga_n5x-u-boot.dtsi new file +175 -0

175 lines not on this page · raw message

arch/arm/dts/socfpga_n5x_socdk-u-boot.dtsi new file +67 -0

67 lines not on this page · raw message

arch/arm/dts/socfpga_n5x_socdk.dts renamed from arch/arm/dts/socfpga_agilex_socdk.dts +19 -6
similarity index 81%
copy from arch/arm/dts/socfpga_agilex_socdk.dts
copy to arch/arm/dts/socfpga_n5x_socdk.dts
index bcdeecc0e0..4cb71b5de3 100644
@@ -1,11 +1,12 @@
 // SPDX-License-Identifier:     GPL-2.0
 /*
- * Copyright (C) 2019, Intel Corporation
+ * Copyright (C) 2020-2021, Intel Corporation
  */
 #include "socfpga_agilex.dtsi"
+#include <dt-bindings/clock/n5x-clock.h>
 
 / {
-	model = "SoCFPGA Agilex SoCDK";
+	model = "eASIC N5X SoCDK";
 
 	aliases {
 		serial0 = &uart0;
@@ -47,6 +48,18 @@
 			osc1 {
 				clock-frequency = <25000000>;
 			};
+
+			dram_eosc_clk: dram-eosc-clk {
+				#clock-cells = <0>;
+				compatible = "fixed-clock";
+			};
+		};
+
+		memclkmgr: mem-clock-controller@f8040000 {
+			compatible = "intel,n5x-mem-clkmgr";
+			reg = <0xf8040000 0x1000>;
+			#clock-cells = <0>;
+			clocks = <&dram_eosc_clk>, <&f2s_free_clk>;
 		};
 	};
 };
@@ -59,8 +72,8 @@
 	status = "okay";
 	phy-mode = "rgmii";
 	phy-handle = <&phy0>;
-
 	max-frame-size = <9000>;
+	clocks = <&clkmgr N5X_EMAC0_CLK>;
 
 	mdio0 {
 		#address-cells = <1>;
@@ -98,14 +111,14 @@
 
 &usb0 {
 	status = "okay";
-	disable-over-current;
 };
 
-&watchdog0 {
+&usb1 {
 	status = "okay";
 };
 
 &qspi {
+	status = "okay";
 	flash0: flash@0 {
 		#address-cells = <1>;
 		#size-cells = <1>;
@@ -116,7 +129,7 @@
 		m25p,fast-read;
 		cdns,page-size = <256>;
 		cdns,block-size = <16>;
-		cdns,read-delay = <1>;
+		cdns,read-delay = <3>;
 		cdns,tshsl-ns = <50>;
 		cdns,tsd2d-ns = <50>;
 		cdns,tchsh-ns = <4>;
Signature · 1 line
2.19.0
#20 lore raw

Re: [v3 15/17] arm: dts: Add base dtsi and devkit dts for Intel N5X device

Quoted 371 lines · Siew Chin Lim

Add device tree for N5X.

---
v3:
- Update comment for memory example code
- Move all common dts settings for N5X from socfpga_n5x_socdk.dts to socfpga_n5x-u-boot.dtsi
- Remove unused parameter "u-boot,boot0"

v2:
- Remove socfpga_n5x.dtsi
- Reuse socfpga_agilex.dtsi in socfpga_n5x_socdk.dts and update n5x data accordingly.

---
 arch/arm/dts/Makefile                         |   1 +
 arch/arm/dts/socfpga_n5x-u-boot.dtsi          | 175 ++++++++++++++++++
 arch/arm/dts/socfpga_n5x_socdk-u-boot.dtsi    |  67 +++++++
 ...agilex_socdk.dts => socfpga_n5x_socdk.dts} |  25 ++-
 4 files changed, 262 insertions(+), 6 deletions(-)
 create mode 100644 arch/arm/dts/socfpga_n5x-u-boot.dtsi
 create mode 100644 arch/arm/dts/socfpga_n5x_socdk-u-boot.dtsi
 copy arch/arm/dts/{socfpga_agilex_socdk.dts => socfpga_n5x_socdk.dts} (81%)
arch/arm/dts/Makefile +1 -0
index 096068261d..8a513e2a87 100644
@@ -393,6 +393,7 @@ dtb-$(CONFIG_ARCH_SOCFPGA) +=                               \
        socfpga_cyclone5_socrates.dtb                   \
        socfpga_cyclone5_sr1500.dtb                     \
        socfpga_cyclone5_vining_fpga.dtb                \
+       socfpga_n5x_socdk.dtb                           \
        socfpga_stratix10_socdk.dtb
 
 dtb-$(CONFIG_TARGET_DRA7XX_EVM) += dra72-evm.dtb dra7-evm.dtb  \
arch/arm/dts/socfpga_n5x-u-boot.dtsi new file +175 -0
new file mode 100644
index 0000000000..d144116e71
@@ -0,0 +1,175 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * U-Boot additions
+ *
+ * Copyright (C) 2020-2021 Intel Corporation <www.intel.com>
+ */
+
+#include "socfpga_soc64_fit-u-boot.dtsi"
+
+/{
+       memory {
+               #address-cells = <2>;
+               #size-cells = <2>;
+               u-boot,dm-pre-reloc;
+       };
+
+       soc {
+               u-boot,dm-pre-reloc;
+
+               ccu: cache-controller@f7000000 {
+                       compatible = "arteris,ncore-ccu";
+                       reg = <0xf7000000 0x100900>;
+                       u-boot,dm-pre-reloc;
+               };
+       };
+};
+
+&clkmgr {
+       compatible = "intel,n5x-clkmgr";
+       u-boot,dm-pre-reloc;
+};
+
+
+&gmac1 {
+       altr,sysmgr-syscon = <&sysmgr 0x48 0>;
+       clocks = <&clkmgr N5X_EMAC1_CLK>;
+};
+
+&gmac2 {
+       altr,sysmgr-syscon = <&sysmgr 0x4c 0>;
+       clocks = <&clkmgr N5X_EMAC2_CLK>;
+};
+
+&i2c0 {
+       clocks = <&clkmgr N5X_L4_SP_CLK>;
+       reset-names = "i2c";
+};
+
+&i2c1 {
+       clocks = <&clkmgr N5X_L4_SP_CLK>;
+       reset-names = "i2c";
+};
+
+&i2c2 {
+       clocks = <&clkmgr N5X_L4_SP_CLK>;
+       reset-names = "i2c";
+};
+
+&i2c3 {
+       clocks = <&clkmgr N5X_L4_SP_CLK>;
+       reset-names = "i2c";
+};
+
+&i2c4 {
+       clocks = <&clkmgr N5X_L4_SP_CLK>;
+       reset-names = "i2c";
+};
+
+&memclkmgr {
+       u-boot,dm-pre-reloc;
+};
+
+
+&mmc {
+       clocks = <&clkmgr N5X_L4_MP_CLK>,
+                <&clkmgr N5X_SDMMC_CLK>;
+       resets = <&rst SDMMC_RESET>, <&rst SDMMC_OCP_RESET>;
+};
+
+&pdma {
+       clocks = <&clkmgr N5X_L4_MAIN_CLK>;
+};
+
+&spi0 {
+       clocks = <&clkmgr N5X_L4_MAIN_CLK>;
+};
+
+&spi1 {
+       clocks = <&clkmgr N5X_L4_MAIN_CLK>;
+};
+
+&timer0 {
+       clocks = <&clkmgr N5X_L4_SP_CLK>;
+};
+
+&timer1 {
+       clocks = <&clkmgr N5X_L4_SP_CLK>;
+};
+
+&timer2 {
+       clocks = <&clkmgr N5X_L4_SP_CLK>;
+};
+
+&timer3 {
+       clocks = <&clkmgr N5X_L4_SP_CLK>;
+};
+
+&porta {
+       bank-name = "porta";
+};
+
+&portb {
+       bank-name = "portb";
+};
+
+&qspi {
+       u-boot,dm-pre-reloc;
+};
+
+&rst {
+       compatible = "altr,rst-mgr";
+       altr,modrst-offset = <0x20>;
+       u-boot,dm-pre-reloc;
+};
+
+&sdr {
+       compatible = "intel,sdr-ctl-n5x";
+       resets = <&rst DDRSCH_RESET>;
+       clocks = <&memclkmgr>;
+       clock-names = "mem_clk";
+       u-boot,dm-pre-reloc;
+};
+
+&sysmgr {
+       compatible = "altr,sys-mgr", "syscon";
+       u-boot,dm-pre-reloc;
+};
+
+&uart0 {
+       clocks = <&clkmgr N5X_L4_SP_CLK>;
+       u-boot,dm-pre-reloc;
+};
+
+&uart1 {
+       clocks = <&clkmgr N5X_L4_SP_CLK>;
+};
+
+&usb0 {
+       clocks = <&clkmgr N5X_USB_CLK>;
+       disable-over-current;
+       u-boot,dm-pre-reloc;
+};
+
+&usb1 {
+       clocks = <&clkmgr N5X_USB_CLK>;
+       u-boot,dm-pre-reloc;
+};
+
+&watchdog0 {
+       clocks = <&clkmgr N5X_L4_SYS_FREE_CLK>;
+       u-boot,dm-pre-reloc;
+};
+
+&watchdog1 {
+       clocks = <&clkmgr N5X_L4_SYS_FREE_CLK>;
+};
+
+&watchdog2 {
+       clocks = <&clkmgr N5X_L4_SYS_FREE_CLK>;
+};
+
+&watchdog3 {
+       clocks = <&clkmgr N5X_L4_SYS_FREE_CLK>;
+};
+
arch/arm/dts/socfpga_n5x_socdk-u-boot.dtsi new file +67 -0
new file mode 100644
index 0000000000..612d394019
@@ -0,0 +1,67 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * U-Boot additions
+ *
+ * Copyright (C) 2020-2021 Intel Corporation <www.intel.com>
+ */
+
+#include "socfpga_n5x-u-boot.dtsi"
+
+/{
+       aliases {
+               spi0 = &qspi;
+               i2c0 = &i2c1;
+       };
+
+       memory {
+               /*
+                * Memory type: DDR4 (interleaving mode)
+                * 16GB
+                *     <0 0x00000000 0 0x80000000>,
+                *     <4 0x80000000 3 0x80000000>;
+                *
+                * 8GB
+                *     <0 0x00000000 0 0x80000000>,
+                *     <2 0x80000000 1 0x80000000>;
+                *
+                * 4GB
+                *     <0 0x00000000 0 0x80000000>,
+                *     <1 0x80000000 0 0x80000000>;
+                *
+                * Memory type: LPDDR4 (non-interleaving mode)
+                * Total memory size 3GB, usable = 2.5GB, 0.5GB trade off for secure
+                * region.
+                */
+               reg = <0 0x00000000 0 0x60000000>,
+                         <0x10 0x00100000 0 0x40000000>;
+       };
+};
+
+&flash0 {
+       compatible = "jedec,spi-nor";
+       spi-tx-bus-width = <4>;
+       spi-rx-bus-width = <4>;
+       u-boot,dm-pre-reloc;
+};
+
+&i2c1 {
+       status = "okay";
+};
+
+&nand {
+       u-boot,dm-pre-reloc;
+};
+
+&mmc {
+       drvsel = <3>;
+       smplsel = <0>;
+       u-boot,dm-pre-reloc;
+};
+
+&qspi {
+       status = "okay";
+};
+
+&watchdog0 {
+       u-boot,dm-pre-reloc;
+};
arch/arm/dts/socfpga_n5x_socdk.dts renamed from arch/arm/dts/socfpga_agilex_socdk.dts +19 -7
similarity index 81%
copy from arch/arm/dts/socfpga_agilex_socdk.dts
copy to arch/arm/dts/socfpga_n5x_socdk.dts
index bcdeecc0e0..4cb71b5de3 100644
@@ -1,11 +1,12 @@
 // SPDX-License-Identifier:     GPL-2.0
 /*
- * Copyright (C) 2019, Intel Corporation
+ * Copyright (C) 2020-2021, Intel Corporation
  */
 #include "socfpga_agilex.dtsi"
+#include <dt-bindings/clock/n5x-clock.h>
 
 / {
-       model = "SoCFPGA Agilex SoCDK";
+       model = "eASIC N5X SoCDK";
 
        aliases {
                serial0 = &uart0;
@@ -47,6 +48,18 @@
                        osc1 {
                                clock-frequency = <25000000>;
                        };
+
+                       dram_eosc_clk: dram-eosc-clk {
+                               #clock-cells = <0>;
+                               compatible = "fixed-clock";
+                       };
+               };
+
+               memclkmgr: mem-clock-controller@f8040000 {
+                       compatible = "intel,n5x-mem-clkmgr";
+                       reg = <0xf8040000 0x1000>;
+                       #clock-cells = <0>;
+                       clocks = <&dram_eosc_clk>, <&f2s_free_clk>;
                };
        };
 };
@@ -59,8 +72,8 @@
        status = "okay";
        phy-mode = "rgmii";
        phy-handle = <&phy0>;
-
        max-frame-size = <9000>;
+       clocks = <&clkmgr N5X_EMAC0_CLK>;
 
        mdio0 {
                #address-cells = <1>;
@@ -98,14 +111,14 @@
 
 &usb0 {
        status = "okay";
-       disable-over-current;
 };
 
-&watchdog0 {
+&usb1 {
        status = "okay";
 };
 
 &qspi {
+       status = "okay";
        flash0: flash@0 {
                #address-cells = <1>;
                #size-cells = <1>;
@@ -116,7 +129,7 @@
                m25p,fast-read;
                cdns,page-size = <256>;
                cdns,block-size = <16>;
-               cdns,read-delay = <1>;
+               cdns,read-delay = <3>;
                cdns,tshsl-ns = <50>;
                cdns,tsd2d-ns = <50>;
                cdns,tchsh-ns = <4>;
--
Quoted 2 lines

2.19.0

socfpga_n5x_socdk.dts is not imported from
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm64/boot/dts/intel/socfpga_n5x_socdk.dts?
Reuse socfpga_n5x_socdk.dts from Linux and add U-boot specifc dts to u-boot.dtsi.

Regards
Ley Foon

#21 lore raw

RE: [v3 15/17] arm: dts: Add base dtsi and devkit dts for Intel N5X device

Quoted 387 lines

-----Original Message-----
From: Ley Foon Tan <[email protected]>
Sent: Friday, July 9, 2021 12:33 AM
To: Lim, Elly Siew Chin <[email protected]>
Cc: ZY - u-boot <[email protected]>; Marek Vasut <[email protected]>; Simon Goldschmidt <[email protected]>; Chee, Tien Fong <[email protected]>; Westergreen, Dalon <[email protected]>; Simon Glass <[email protected]>; Gan, Yau Wai <[email protected]>
Subject: Re: [v3 15/17] arm: dts: Add base dtsi and devkit dts for Intel N5X device

arch/arm/dts/Makefile dtb-$(CONFIG_ARCH_SOCFPGA) +=

Quoted 33 lines · Siew Chin Lim

Add device tree for N5X.

---
v3:
- Update comment for memory example code
- Move all common dts settings for N5X from socfpga_n5x_socdk.dts to socfpga_n5x-u-boot.dtsi
- Remove unused parameter "u-boot,boot0"

v2:
- Remove socfpga_n5x.dtsi
- Reuse socfpga_agilex.dtsi in socfpga_n5x_socdk.dts and update n5x data accordingly.

---
 arch/arm/dts/Makefile                         |   1 +
 arch/arm/dts/socfpga_n5x-u-boot.dtsi          | 175 ++++++++++++++++++
 arch/arm/dts/socfpga_n5x_socdk-u-boot.dtsi    |  67 +++++++
 ...agilex_socdk.dts => socfpga_n5x_socdk.dts} |  25 ++-
 4 files changed, 262 insertions(+), 6 deletions(-)  create mode
100644 arch/arm/dts/socfpga_n5x-u-boot.dtsi
 create mode 100644 arch/arm/dts/socfpga_n5x_socdk-u-boot.dtsi
 copy arch/arm/dts/{socfpga_agilex_socdk.dts => socfpga_n5x_socdk.dts}

(81%)

arch/arm/dts/Makefile index renamed from arch/arm/dts/Makefile +0 -0

096068261d..8a513e2a87 100644

arch/arm/dts/Makefile +0 -0
@@ -393,6 +393,7 @@ dtb-$(CONFIG_ARCH_SOCFPGA) +=

\

arch/arm/dts/Makefile dtb-$(CONFIG_ARCH_SOCFPGA) += \ · line 399

Quoted 7 lines
arch/arm/dts/Makefile +1 -0
        socfpga_cyclone5_socrates.dtb                   \
        socfpga_cyclone5_sr1500.dtb                     \
        socfpga_cyclone5_vining_fpga.dtb                \
+       socfpga_n5x_socdk.dtb                           \
        socfpga_stratix10_socdk.dtb
 
 dtb-$(CONFIG_TARGET_DRA7XX_EVM) += dra72-evm.dtb dra7-evm.dtb  \

diff

Quoted 195 lines

--git a/arch/arm/dts/socfpga_n5x-u-boot.dtsi
b/arch/arm/dts/socfpga_n5x-u-boot.dtsi
new file mode 100644
index 0000000000..d144116e71

arch/arm/dts/socfpga_n5x-u-boot.dtsi new file +160 -0
@@ -0,0 +1,175 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * U-Boot additions
+ *
+ * Copyright (C) 2020-2021 Intel Corporation <www.intel.com>  */
+
+#include "socfpga_soc64_fit-u-boot.dtsi"
+
+/{
+       memory {
+               #address-cells = <2>;
+               #size-cells = <2>;
+               u-boot,dm-pre-reloc;
+       };
+
+       soc {
+               u-boot,dm-pre-reloc;
+
+               ccu: cache-controller@f7000000 {
+                       compatible = "arteris,ncore-ccu";
+                       reg = <0xf7000000 0x100900>;
+                       u-boot,dm-pre-reloc;
+               };
+       };
+};
+
+&clkmgr {
+       compatible = "intel,n5x-clkmgr";
+       u-boot,dm-pre-reloc;
+};
+
+
+&gmac1 {
+       altr,sysmgr-syscon = <&sysmgr 0x48 0>;
+       clocks = <&clkmgr N5X_EMAC1_CLK>; };
+
+&gmac2 {
+       altr,sysmgr-syscon = <&sysmgr 0x4c 0>;
+       clocks = <&clkmgr N5X_EMAC2_CLK>; };
+
+&i2c0 {
+       clocks = <&clkmgr N5X_L4_SP_CLK>;
+       reset-names = "i2c";
+};
+
+&i2c1 {
+       clocks = <&clkmgr N5X_L4_SP_CLK>;
+       reset-names = "i2c";
+};
+
+&i2c2 {
+       clocks = <&clkmgr N5X_L4_SP_CLK>;
+       reset-names = "i2c";
+};
+
+&i2c3 {
+       clocks = <&clkmgr N5X_L4_SP_CLK>;
+       reset-names = "i2c";
+};
+
+&i2c4 {
+       clocks = <&clkmgr N5X_L4_SP_CLK>;
+       reset-names = "i2c";
+};
+
+&memclkmgr {
+       u-boot,dm-pre-reloc;
+};
+
+
+&mmc {
+       clocks = <&clkmgr N5X_L4_MP_CLK>,
+                <&clkmgr N5X_SDMMC_CLK>;
+       resets = <&rst SDMMC_RESET>, <&rst SDMMC_OCP_RESET>; };
+
+&pdma {
+       clocks = <&clkmgr N5X_L4_MAIN_CLK>; };
+
+&spi0 {
+       clocks = <&clkmgr N5X_L4_MAIN_CLK>; };
+
+&spi1 {
+       clocks = <&clkmgr N5X_L4_MAIN_CLK>; };
+
+&timer0 {
+       clocks = <&clkmgr N5X_L4_SP_CLK>; };
+
+&timer1 {
+       clocks = <&clkmgr N5X_L4_SP_CLK>; };
+
+&timer2 {
+       clocks = <&clkmgr N5X_L4_SP_CLK>; };
+
+&timer3 {
+       clocks = <&clkmgr N5X_L4_SP_CLK>; };
+
+&porta {
+       bank-name = "porta";
+};
+
+&portb {
+       bank-name = "portb";
+};
+
+&qspi {
+       u-boot,dm-pre-reloc;
+};
+
+&rst {
+       compatible = "altr,rst-mgr";
+       altr,modrst-offset = <0x20>;
+       u-boot,dm-pre-reloc;
+};
+
+&sdr {
+       compatible = "intel,sdr-ctl-n5x";
+       resets = <&rst DDRSCH_RESET>;
+       clocks = <&memclkmgr>;
+       clock-names = "mem_clk";
+       u-boot,dm-pre-reloc;
+};
+
+&sysmgr {
+       compatible = "altr,sys-mgr", "syscon";
+       u-boot,dm-pre-reloc;
+};
+
+&uart0 {
+       clocks = <&clkmgr N5X_L4_SP_CLK>;
+       u-boot,dm-pre-reloc;
+};
+
+&uart1 {
+       clocks = <&clkmgr N5X_L4_SP_CLK>; };
+
+&usb0 {
+       clocks = <&clkmgr N5X_USB_CLK>;
+       disable-over-current;
+       u-boot,dm-pre-reloc;
+};
+
+&usb1 {
+       clocks = <&clkmgr N5X_USB_CLK>;
+       u-boot,dm-pre-reloc;
+};
+
+&watchdog0 {
+       clocks = <&clkmgr N5X_L4_SYS_FREE_CLK>;
+       u-boot,dm-pre-reloc;
+};
+
+&watchdog1 {
+       clocks = <&clkmgr N5X_L4_SYS_FREE_CLK>; };
+
+&watchdog2 {
+       clocks = <&clkmgr N5X_L4_SYS_FREE_CLK>; };
+
+&watchdog3 {
+       clocks = <&clkmgr N5X_L4_SYS_FREE_CLK>; };
+
arch/arm/dts/socfpga_n5x_socdk-u-boot.dtsi new file +21 -0
new file mode 100644
index 0000000000..612d394019
@@ -0,0 +1,67 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * U-Boot additions
+ *
+ * Copyright (C) 2020-2021 Intel Corporation <www.intel.com>  */
+
+#include "socfpga_n5x-u-boot.dtsi"
+
+/{
+       aliases {
+               spi0 = &qspi;
+               i2c0 = &i2c1;
+       };
+
+       memory {
+               /*
+                * Memory type: DDR4 (interleaving mode)
+                * 16GB
+                *     <0 0x00000000 0 0x80000000>,
+                *     <4 0x80000000 3 0x80000000>;
+                *

arch/arm/dts/socfpga_n5x_socdk-u-boot.dtsi line 31

Quoted 10 lines
arch/arm/dts/socfpga_n5x_socdk-u-boot.dtsi new file +10 -0
+                * 8GB
+                *     <0 0x00000000 0 0x80000000>,
+                *     <2 0x80000000 1 0x80000000>;
+                *
+                * 4GB
+                *     <0 0x00000000 0 0x80000000>,
+                *     <1 0x80000000 0 0x80000000>;
+                *
+                * Memory type: LPDDR4 (non-interleaving mode)
+                * Total memory size 3GB, usable = 2.5GB, 0.5GB trade off for

secure

Quoted 114 lines
arch/arm/dts/socfpga_n5x_socdk-u-boot.dtsi new file +35 -0
+                * region.
+                */
+               reg = <0 0x00000000 0 0x60000000>,
+                         <0x10 0x00100000 0 0x40000000>;
+       };
+};
+
+&flash0 {
+       compatible = "jedec,spi-nor";
+       spi-tx-bus-width = <4>;
+       spi-rx-bus-width = <4>;
+       u-boot,dm-pre-reloc;
+};
+
+&i2c1 {
+       status = "okay";
+};
+
+&nand {
+       u-boot,dm-pre-reloc;
+};
+
+&mmc {
+       drvsel = <3>;
+       smplsel = <0>;
+       u-boot,dm-pre-reloc;
+};
+
+&qspi {
+       status = "okay";
+};
+
+&watchdog0 {
+       u-boot,dm-pre-reloc;
+};
arch/arm/dts/socfpga_n5x_socdk.dts renamed from arch/arm/dts/socfpga_agilex_socdk.dts +19 -7
similarity index 81%
copy from arch/arm/dts/socfpga_agilex_socdk.dts
copy to arch/arm/dts/socfpga_n5x_socdk.dts
index bcdeecc0e0..4cb71b5de3 100644
@@ -1,11 +1,12 @@
 // SPDX-License-Identifier:     GPL-2.0
 /*
- * Copyright (C) 2019, Intel Corporation
+ * Copyright (C) 2020-2021, Intel Corporation
  */
 #include "socfpga_agilex.dtsi"
+#include <dt-bindings/clock/n5x-clock.h>
 
 / {
-       model = "SoCFPGA Agilex SoCDK";
+       model = "eASIC N5X SoCDK";
 
        aliases {
                serial0 = &uart0;
@@ -47,6 +48,18 @@
                        osc1 {
                                clock-frequency = <25000000>;
                        };
+
+                       dram_eosc_clk: dram-eosc-clk {
+                               #clock-cells = <0>;
+                               compatible = "fixed-clock";
+                       };
+               };
+
+               memclkmgr: mem-clock-controller@f8040000 {
+                       compatible = "intel,n5x-mem-clkmgr";
+                       reg = <0xf8040000 0x1000>;
+                       #clock-cells = <0>;
+                       clocks = <&dram_eosc_clk>, <&f2s_free_clk>;
                };
        };
 };
@@ -59,8 +72,8 @@
        status = "okay";
        phy-mode = "rgmii";
        phy-handle = <&phy0>;
-
        max-frame-size = <9000>;
+       clocks = <&clkmgr N5X_EMAC0_CLK>;
 
        mdio0 {
                #address-cells = <1>;
@@ -98,14 +111,14 @@
 
 &usb0 {
        status = "okay";
-       disable-over-current;
 };
 
-&watchdog0 {
+&usb1 {
        status = "okay";
 };
 
 &qspi {
+       status = "okay";
        flash0: flash@0 {
                #address-cells = <1>;
                #size-cells = <1>;
@@ -116,7 +129,7 @@
                m25p,fast-read;
                cdns,page-size = <256>;
                cdns,block-size = <16>;
-               cdns,read-delay = <1>;
+               cdns,read-delay = <3>;
                cdns,tshsl-ns = <50>;
                cdns,tsd2d-ns = <50>;
                cdns,tchsh-ns = <4>;
--
Quoted 2 lines

2.19.0

socfpga_n5x_socdk.dts is not imported from
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/
arm64/boot/dts/intel/socfpga_n5x_socdk.dts?
Reuse socfpga_n5x_socdk.dts from Linux and add U-boot specifc dts to u- boot.dtsi.

Quoted 2 lines

Regards
Ley Foon

Noted.

Thanks,
Siew Chin

#22 lore raw

PATCH v3 16/17 include: configs: Add Intel N5X device CONFIGs

In reply to Siew Chin Lim

Add CONFIGs for N5X.

---
 include/configs/socfpga_n5x_socdk.h | 45 +++++++++++++++++++++++++++++
 1 file changed, 45 insertions(+)
 create mode 100644 include/configs/socfpga_n5x_socdk.h
include/configs/socfpga_n5x_socdk.h new file +45 -0
new file mode 100644
index 0000000000..c295e91e3d
@@ -0,0 +1,45 @@
+/* SPDX-License-Identifier: GPL-2.0
+ *
+ * Copyright (C) 2020-2021 Intel Corporation <www.intel.com>
+ *
+ */
+
+#ifndef __CONFIG_SOCFGPA_N5X_H__
+#define __CONFIG_SOCFGPA_N5X_H__
+
+#include <configs/socfpga_soc64_common.h>
+
+#undef CONFIG_EXTRA_ENV_SETTINGS
+#define CONFIG_EXTRA_ENV_SETTINGS \
+	"loadaddr=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \
+	"bootfile=" CONFIG_BOOTFILE "\0" \
+	"fdt_addr=1100000\0" \
+	"fdtimage=" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0" \
+	"mmcroot=/dev/mmcblk0p2\0" \
+	"mmcboot=setenv bootargs " CONFIG_BOOTARGS \
+		" root=${mmcroot} rw rootwait;" \
+		"booti ${loadaddr} - ${fdt_addr}\0" \
+	"mmcload=mmc rescan;" \
+		"load mmc 0:1 ${loadaddr} ${bootfile};" \
+		"load mmc 0:1 ${fdt_addr} ${fdtimage}\0" \
+	"mmcfitboot=setenv bootargs " CONFIG_BOOTARGS \
+		" root=${mmcroot} rw rootwait;" \
+		"bootm ${loadaddr}\0" \
+	"mmcfitload=mmc rescan;" \
+		"load mmc 0:1 ${loadaddr} ${bootfile}\0" \
+	"ramboot=setenv bootargs " CONFIG_BOOTARGS";" \
+		"booti ${loadaddr} - ${fdt_addr}\0" \
+	"linux_qspi_enable=if sf probe; then " \
+		"echo Enabling QSPI at Linux DTB...;" \
+		"fdt addr ${fdt_addr}; fdt resize;" \
+		"fdt set /soc/spi@ff8d2000 status okay;" \
+		"if fdt set /soc/clocks/qspi-clk clock-frequency" \
+		" ${qspi_clock}; then" \
+		" else fdt set /soc/clkmgr/clocks/qspi_clk clock-frequency" \
+		" ${qspi_clock}; fi; fi\0" \
+	"scriptaddr=0x02100000\0" \
+	"scriptfile=u-boot.scr\0" \
+	"fatscript=if fatload mmc 0:1 ${scriptaddr} ${scriptfile};" \
+		   "then source ${scriptaddr}; fi\0"
+
+#endif	/* __CONFIG_SOCFGPA_N5X_H__ */
Signature · 1 line
2.19.0
#23 lore raw

PATCH v3 17/17 arm: socfpga: Enable Intel N5X device build

In reply to Siew Chin Lim

Add defconfig for N5X to support legacy, ATF and VAB boot flow.

---
 arch/arm/mach-socfpga/Kconfig                 | 21 +++++++++++++-
 arch/arm/mach-socfpga/Makefile                | 28 +++++++++++++++----
 ...ab_defconfig => socfpga_n5x_atf_defconfig} | 12 ++++----
 ...agilex_defconfig => socfpga_n5x_defconfig} | 14 ++++------
 ...ab_defconfig => socfpga_n5x_vab_defconfig} | 11 ++++----
 5 files changed, 61 insertions(+), 25 deletions(-)
 copy configs/{socfpga_agilex_vab_defconfig => socfpga_n5x_atf_defconfig} (87%)
 copy configs/{socfpga_agilex_defconfig => socfpga_n5x_defconfig} (82%)
 copy configs/{socfpga_agilex_vab_defconfig => socfpga_n5x_vab_defconfig} (87%)
arch/arm/mach-socfpga/Kconfig +20 -1
index 0c35406232..a4d733c756 100644
@@ -8,7 +8,7 @@ config NR_DRAM_BANKS
 
 config SOCFPGA_SECURE_VAB_AUTH
 	bool "Enable boot image authentication with Secure Device Manager"
-	depends on TARGET_SOCFPGA_AGILEX
+	depends on TARGET_SOCFPGA_AGILEX || TARGET_SOCFPGA_N5X
 	select FIT_IMAGE_POST_PROCESS
 	select SHA384
 	select SHA512_ALGO
@@ -91,6 +91,22 @@ config TARGET_SOCFPGA_GEN5
 	imply SPL_SYS_MALLOC_SIMPLE
 	imply SPL_USE_TINY_PRINTF
 
+config TARGET_SOCFPGA_N5X
+	bool
+	select ARMV8_MULTIENTRY
+	select ARMV8_SET_SMPEN
+	select BINMAN if SPL_ATF
+	select CLK
+	select FPGA_INTEL_SDM_MAILBOX
+	select NCORE_CACHE
+	select SPL_ALTERA_SDRAM
+	select SPL_CLK if SPL
+	select TARGET_SOCFPGA_SOC64
+
+config TARGET_SOCFPGA_N5X_SOCDK
+	bool "Intel eASIC SoCDK (N5X)"
+	select TARGET_SOCFPGA_N5X
+
 config TARGET_SOCFPGA_SOC64
 	bool
 
@@ -183,6 +199,7 @@ config SYS_BOARD
 	default "de0-nano-soc" if TARGET_SOCFPGA_TERASIC_DE0_NANO
 	default "de1-soc" if TARGET_SOCFPGA_TERASIC_DE1_SOC
 	default "de10-nano" if TARGET_SOCFPGA_TERASIC_DE10_NANO
+	default "n5x-socdk" if TARGET_SOCFPGA_N5X_SOCDK
 	default "is1" if TARGET_SOCFPGA_IS1
 	default "mcvevk" if TARGET_SOCFPGA_ARIES_MCVEVK
 	default "secu1" if TARGET_SOCFPGA_ARRIA5_SECU1
@@ -194,6 +211,7 @@ config SYS_BOARD
 
 config SYS_VENDOR
 	default "intel" if TARGET_SOCFPGA_AGILEX_SOCDK
+	default "intel" if TARGET_SOCFPGA_N5X_SOCDK
 	default "altera" if TARGET_SOCFPGA_ARRIA5_SOCDK
 	default "altera" if TARGET_SOCFPGA_ARRIA10_SOCDK
 	default "altera" if TARGET_SOCFPGA_CYCLONE5_SOCDK
@@ -221,6 +239,7 @@ config SYS_CONFIG_NAME
 	default "socfpga_de0_nano_soc" if TARGET_SOCFPGA_TERASIC_DE0_NANO
 	default "socfpga_de1_soc" if TARGET_SOCFPGA_TERASIC_DE1_SOC
 	default "socfpga_de10_nano" if TARGET_SOCFPGA_TERASIC_DE10_NANO
+	default "socfpga_n5x_socdk" if TARGET_SOCFPGA_N5X_SOCDK
 	default "socfpga_is1" if TARGET_SOCFPGA_IS1
 	default "socfpga_mcvevk" if TARGET_SOCFPGA_ARIES_MCVEVK
 	default "socfpga_sockit" if TARGET_SOCFPGA_TERASIC_SOCKIT
arch/arm/mach-socfpga/Makefile +23 -5
index 58afde950f..ec38b64dd4 100644
@@ -4,7 +4,7 @@
 # Wolfgang Denk, DENX Software Engineering, [email protected].
 #
 # Copyright (C) 2012-2017 Altera Corporation <www.altera.com>
-# Copyright (C) 2017-2020 Intel Corporation <www.intel.com>
+# Copyright (C) 2017-2021 Intel Corporation <www.intel.com>
 
 obj-y	+= board.o
 obj-y	+= clock_manager.o
@@ -56,6 +56,21 @@ obj-y	+= wrap_handoff_soc64.o
 obj-y	+= wrap_pll_config_soc64.o
 endif
 
+ifdef CONFIG_TARGET_SOCFPGA_N5X
+obj-y	+= clock_manager_n5x.o
+obj-y	+= lowlevel_init_soc64.o
+obj-y	+= mailbox_s10.o
+obj-y	+= misc_soc64.o
+obj-y	+= mmu-arm64_s10.o
+obj-y	+= reset_manager_s10.o
+obj-$(CONFIG_SOCFPGA_SECURE_VAB_AUTH)	+= secure_vab.o
+obj-y	+= system_manager_soc64.o
+obj-y	+= timer_s10.o
+obj-$(CONFIG_SOCFPGA_SECURE_VAB_AUTH)	+= vab.o
+obj-y	+= wrap_handoff_soc64.o
+obj-y	+= wrap_pll_config_soc64.o
+endif
+
 ifdef CONFIG_SPL_BUILD
 ifdef CONFIG_TARGET_SOCFPGA_GEN5
 obj-y	+= spl_gen5.o
@@ -64,18 +79,21 @@ obj-y	+= wrap_iocsr_config.o
 obj-y	+= wrap_pinmux_config.o
 obj-y	+= wrap_sdram_config.o
 endif
+ifdef CONFIG_TARGET_SOCFPGA_SOC64
+obj-y	+= firewall.o
+obj-y	+= spl_soc64.o
+endif
 ifdef CONFIG_TARGET_SOCFPGA_ARRIA10
 obj-y	+= spl_a10.o
 endif
 ifdef CONFIG_TARGET_SOCFPGA_STRATIX10
-obj-y	+= firewall.o
 obj-y	+= spl_s10.o
-obj-y	+= spl_soc64.o
 endif
 ifdef CONFIG_TARGET_SOCFPGA_AGILEX
-obj-y	+= firewall.o
 obj-y	+= spl_agilex.o
-obj-y	+= spl_soc64.o
+endif
+ifdef CONFIG_TARGET_SOCFPGA_N5X
+obj-y	+= spl_n5x.o
 endif
 else
 obj-$(CONFIG_SPL_ATF) += secure_reg_helper.o
configs/socfpga_n5x_atf_defconfig renamed from configs/socfpga_agilex_vab_defconfig +6 -6
similarity index 87%
copy from configs/socfpga_agilex_vab_defconfig
copy to configs/socfpga_n5x_atf_defconfig
index af726bab69..b65ed00006 100644
@@ -9,11 +9,10 @@ CONFIG_ENV_OFFSET=0x200
 CONFIG_SYS_SPI_U_BOOT_OFFS=0x02000000
 CONFIG_DM_GPIO=y
 CONFIG_SPL_TEXT_BASE=0xFFE00000
-CONFIG_SOCFPGA_SECURE_VAB_AUTH=y
-CONFIG_TARGET_SOCFPGA_AGILEX_SOCDK=y
-CONFIG_IDENT_STRING="socfpga_agilex"
+CONFIG_TARGET_SOCFPGA_N5X_SOCDK=y
+CONFIG_IDENT_STRING="socfpga_n5x"
 CONFIG_SPL_FS_FAT=y
-CONFIG_DEFAULT_DEVICE_TREE="socfpga_agilex_socdk"
+CONFIG_DEFAULT_DEVICE_TREE="socfpga_n5x_socdk"
 CONFIG_FIT=y
 CONFIG_SPL_FIT_SIGNATURE=y
 CONFIG_SPL_LOAD_FIT=y
@@ -21,7 +20,7 @@ CONFIG_SPL_LOAD_FIT_ADDRESS=0x02000000
 # CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_BOOTDELAY=5
 CONFIG_USE_BOOTARGS=y
-CONFIG_BOOTARGS="earlycon"
+CONFIG_BOOTARGS="earlycon panic=-1 earlyprintk=ttyS0,115200"
 CONFIG_USE_BOOTCOMMAND=y
 CONFIG_BOOTCOMMAND="run fatscript; run mmcfitload; run mmcfitboot"
 CONFIG_SPL_CRC32_SUPPORT=y
@@ -30,7 +29,7 @@ CONFIG_SPL_SPI_LOAD=y
 CONFIG_SPL_ATF=y
 CONFIG_SPL_ATF_NO_PLATFORM_PARAM=y
 CONFIG_HUSH_PARSER=y
-CONFIG_SYS_PROMPT="SOCFPGA_AGILEX # "
+CONFIG_SYS_PROMPT="SOCFPGA_N5X # "
 CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
@@ -44,6 +43,7 @@ CONFIG_CMD_CACHE=y
 CONFIG_CMD_EXT4=y
 CONFIG_CMD_FAT=y
 CONFIG_CMD_FS_GENERIC=y
+CONFIG_CMD_WDT=y
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_SPL_DM_SEQ_ALIAS=y
configs/socfpga_n5x_defconfig renamed from configs/socfpga_agilex_defconfig +6 -8
similarity index 82%
copy from configs/socfpga_agilex_defconfig
copy to configs/socfpga_n5x_defconfig
index 0e5ef062a5..1f6e23e08d 100644
@@ -3,27 +3,25 @@ CONFIG_ARCH_SOCFPGA=y
 CONFIG_SYS_TEXT_BASE=0x1000
 CONFIG_SYS_MALLOC_F_LEN=0x2000
 CONFIG_NR_DRAM_BANKS=2
-CONFIG_SYS_MEMTEST_START=0x00000000
-CONFIG_SYS_MEMTEST_END=0x3fe00000
 CONFIG_ENV_SIZE=0x1000
 CONFIG_ENV_OFFSET=0x200
 CONFIG_SYS_SPI_U_BOOT_OFFS=0x3c00000
 CONFIG_DM_GPIO=y
 CONFIG_SPL_TEXT_BASE=0xFFE00000
-CONFIG_TARGET_SOCFPGA_AGILEX_SOCDK=y
-CONFIG_IDENT_STRING="socfpga_agilex"
+CONFIG_TARGET_SOCFPGA_N5X_SOCDK=y
+CONFIG_IDENT_STRING="socfpga_n5x"
 CONFIG_SPL_FS_FAT=y
 # CONFIG_PSCI_RESET is not set
-CONFIG_DEFAULT_DEVICE_TREE="socfpga_agilex_socdk"
+CONFIG_DEFAULT_DEVICE_TREE="socfpga_n5x_socdk"
 CONFIG_BOOTDELAY=5
 CONFIG_USE_BOOTARGS=y
-CONFIG_BOOTARGS="earlycon"
+CONFIG_BOOTARGS="earlycon panic=-1 earlyprintk=ttyS0,115200"
 CONFIG_USE_BOOTCOMMAND=y
 CONFIG_BOOTCOMMAND="run fatscript; run mmcload; run linux_qspi_enable; run mmcboot"
 CONFIG_SPL_CACHE=y
 CONFIG_SPL_SPI_LOAD=y
 CONFIG_HUSH_PARSER=y
-CONFIG_SYS_PROMPT="SOCFPGA_AGILEX # "
+CONFIG_SYS_PROMPT="SOCFPGA_N5X # "
 CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
@@ -37,10 +35,10 @@ CONFIG_CMD_CACHE=y
 CONFIG_CMD_EXT4=y
 CONFIG_CMD_FAT=y
 CONFIG_CMD_FS_GENERIC=y
+CONFIG_CMD_WDT=y
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_SPL_DM_SEQ_ALIAS=y
-CONFIG_SPL_ALTERA_SDRAM=y
 CONFIG_DWAPB_GPIO=y
 CONFIG_DM_I2C=y
 CONFIG_SYS_I2C_DW=y
configs/socfpga_n5x_vab_defconfig renamed from configs/socfpga_agilex_vab_defconfig +6 -5
similarity index 87%
copy from configs/socfpga_agilex_vab_defconfig
copy to configs/socfpga_n5x_vab_defconfig
index af726bab69..987d5ce58c 100644
@@ -10,10 +10,10 @@ CONFIG_SYS_SPI_U_BOOT_OFFS=0x02000000
 CONFIG_DM_GPIO=y
 CONFIG_SPL_TEXT_BASE=0xFFE00000
 CONFIG_SOCFPGA_SECURE_VAB_AUTH=y
-CONFIG_TARGET_SOCFPGA_AGILEX_SOCDK=y
-CONFIG_IDENT_STRING="socfpga_agilex"
+CONFIG_TARGET_SOCFPGA_N5X_SOCDK=y
+CONFIG_IDENT_STRING="socfpga_n5x"
 CONFIG_SPL_FS_FAT=y
-CONFIG_DEFAULT_DEVICE_TREE="socfpga_agilex_socdk"
+CONFIG_DEFAULT_DEVICE_TREE="socfpga_n5x_socdk"
 CONFIG_FIT=y
 CONFIG_SPL_FIT_SIGNATURE=y
 CONFIG_SPL_LOAD_FIT=y
@@ -21,7 +21,7 @@ CONFIG_SPL_LOAD_FIT_ADDRESS=0x02000000
 # CONFIG_USE_SPL_FIT_GENERATOR is not set
 CONFIG_BOOTDELAY=5
 CONFIG_USE_BOOTARGS=y
-CONFIG_BOOTARGS="earlycon"
+CONFIG_BOOTARGS="earlycon panic=-1 earlyprintk=ttyS0,115200"
 CONFIG_USE_BOOTCOMMAND=y
 CONFIG_BOOTCOMMAND="run fatscript; run mmcfitload; run mmcfitboot"
 CONFIG_SPL_CRC32_SUPPORT=y
@@ -30,7 +30,7 @@ CONFIG_SPL_SPI_LOAD=y
 CONFIG_SPL_ATF=y
 CONFIG_SPL_ATF_NO_PLATFORM_PARAM=y
 CONFIG_HUSH_PARSER=y
-CONFIG_SYS_PROMPT="SOCFPGA_AGILEX # "
+CONFIG_SYS_PROMPT="SOCFPGA_N5X # "
 CONFIG_CMD_MEMTEST=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_I2C=y
@@ -44,6 +44,7 @@ CONFIG_CMD_CACHE=y
 CONFIG_CMD_EXT4=y
 CONFIG_CMD_FAT=y
 CONFIG_CMD_FS_GENERIC=y
+CONFIG_CMD_WDT=y
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_SPL_DM_SEQ_ALIAS=y
Signature · 1 line
2.19.0