Skip to contentSkip to conversation

Add Intel Agilex SoC support

PATCH New Ley Foon Tan 3 participants 27 messages Nov 27, 2019 – Nov 28, 2019

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

v8 cover Add Intel Agilex SoC support

This is 8th version of patchset to add Intel Agilex SoC[1] support.

This patchset needs to apply after patchset in [2] for manager driver struct to defines conversion and [3] for enable cache driver build in SPL.

Patch status:
Have changes: Patch 12, 17
Other patches unchanged.

Detail changelog can find in commit message.

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

Intel Agilex HPS TRM:
https://www.intel.com/content/dam/www/programmable/us/en/pdfs/literature/hb/agilex/mnl-1100.pdf

v7->v8:
-------
Patch 12:
- Fixed missing CONFIG_ prefix for TARGET_SOCFPGA_STRATIX10. Patch 17:
- Include socfpga_agilex-u-boot.dtsi in socfpga_agilex_socdk-u-boot.dtsi, instead of include it in socfpga_agilex_socdk.dts.

History:
---------
[v1]: https://patchwork.ozlabs.org/cover/1097830/
[v2]: https://patchwork.ozlabs.org/cover/1127440/
[v3]: https://patchwork.ozlabs.org/cover/1149863/
[v4]: https://patchwork.ozlabs.org/cover/1161483/
[v5]: https://patchwork.ozlabs.org/cover/1175076/
[v6]: https://patchwork.ozlabs.org/cover/1191577/
[v7]: https://patchwork.ozlabs.org/cover/1200811/

[1]: https://www.intel.com/content/www/us/en/products/programmable/fpga/agilex.html
[2]: https://patchwork.ozlabs.org/cover/1191562/ ("arm: socfpga: Convert drivers from struct to defines") [3]: https://patchwork.ozlabs.org/patch/1191569/ ("spl: Allow cache drivers to be used in SPL")

Ley Foon Tan (19):
arm: socfpga: agilex: Add base address for Intel Agilex SoC
arm: socfpga: Move firewall code to firewall file
arm: socfpga: Move Stratix10 and Agilex reset manager common code
arm: socfpga: agilex: Add reset manager support
arm: socfpga: Move Stratix10 and Agilex system manager common code
arm: socfpga: agilex: Add system manager support
arm: socfpga: Move Stratix10 and Agilex clock manager common code
arm: socfpga: Fix CLKMGR_INTOSC_HZ to 400MHz
clk: agilex: Add clock driver for Agilex
arm: socfpga: agilex: Add clock wrapper functions
cache: Add Arteris Ncore cache coherent unit driver
arm: agilex: Add clock handoff offset for Agilex
ddr: altera: Restructure Stratix 10 SDRAM driver
ddr: altera: agilex: Add SDRAM driver for Agilex
board: intel: agilex: Add socdk board support for Intel Agilex SoC
arm: socfpga: agilex: Add SPL for Agilex SoC
arm: dts: agilex: Add base dtsi and devkit dts
configs: socfpga: Move Stratix10 and Agilex common CONFIGs
arm: socfpga: agilex: Enable Agilex SoC build

 arch/arm/Kconfig                              |   4 +-
 arch/arm/dts/Makefile                         |   1 +
 arch/arm/dts/socfpga_agilex-u-boot.dtsi       |  96 +++
 arch/arm/dts/socfpga_agilex.dtsi              | 622 ++++++++++++++++++
 arch/arm/dts/socfpga_agilex_socdk-u-boot.dtsi |  39 ++
 arch/arm/dts/socfpga_agilex_socdk.dts         | 141 ++++
 arch/arm/mach-socfpga/Kconfig                 |  16 +
 arch/arm/mach-socfpga/Makefile                |  17 +
 arch/arm/mach-socfpga/clock_manager_agilex.c  |  85 +++
 arch/arm/mach-socfpga/clock_manager_s10.c     |   3 +-
 .../mach-socfpga/{spl_s10.c => firewall.c}    | 122 +---
 .../mach-socfpga/include/mach/base_addr_s10.h |   4 +
 .../mach-socfpga/include/mach/clock_manager.h |   2 +
 .../include/mach/clock_manager_agilex.h       |  14 +
 .../include/mach/clock_manager_s10.h          |  16 +-
 .../include/mach/clock_manager_soc64.h        |  21 +
 .../mach/{firewall_s10.h => firewall.h}       |  10 +-
 .../mach-socfpga/include/mach/handoff_s10.h   |   9 +-
 .../mach-socfpga/include/mach/reset_manager.h |   5 +-
 .../include/mach/reset_manager_s10.h          |  95 ---
 .../include/mach/reset_manager_soc64.h        |  38 ++
 .../include/mach/system_manager.h             |   5 +-
 .../include/mach/system_manager_s10.h         | 124 ----
 .../include/mach/system_manager_soc64.h       | 123 ++++
 arch/arm/mach-socfpga/mailbox_s10.c           |   2 +-
 arch/arm/mach-socfpga/misc.c                  |   5 +
 arch/arm/mach-socfpga/misc_s10.c              |   2 +-
 arch/arm/mach-socfpga/reset_manager_s10.c     |  35 +-
 arch/arm/mach-socfpga/spl_agilex.c            |  98 +++
 arch/arm/mach-socfpga/spl_s10.c               |  95 +--
 arch/arm/mach-socfpga/system_manager_s10.c    |  26 +-
 arch/arm/mach-socfpga/wrap_pll_config_s10.c   |  15 +-
 board/intel/agilex-socdk/MAINTAINERS          |   7 +
 board/intel/agilex-socdk/Makefile             |   7 +
 board/intel/agilex-socdk/socfpga.c            |   7 +
 configs/socfpga_agilex_defconfig              |  60 ++
 drivers/cache/Kconfig                         |   8 +
 drivers/cache/Makefile                        |   1 +
 drivers/cache/cache-ncore.c                   | 164 +++++
 drivers/clk/altera/Makefile                   |   1 +
 drivers/clk/altera/clk-agilex.c               | 579 ++++++++++++++++
 drivers/clk/altera/clk-agilex.h               | 237 +++++++
 drivers/ddr/altera/Kconfig                    |   6 +-
 drivers/ddr/altera/Makefile                   |   3 +-
 drivers/ddr/altera/sdram_agilex.c             | 168 +++++
 drivers/ddr/altera/sdram_s10.c                | 298 +--------
 drivers/ddr/altera/sdram_s10.h                | 148 +----
 drivers/ddr/altera/sdram_soc64.c              | 304 +++++++++
 .../ddr/altera/{sdram_s10.h => sdram_soc64.h} |  71 +-
 include/configs/socfpga_agilex_socdk.h        |  12 +
 ...ratix10_socdk.h => socfpga_soc64_common.h} |  14 +-
 include/configs/socfpga_stratix10_socdk.h     | 193 +-----
 include/dt-bindings/clock/agilex-clock.h      |  71 ++
 53 files changed, 3091 insertions(+), 1158 deletions(-)
 create mode 100644 arch/arm/dts/socfpga_agilex-u-boot.dtsi
 create mode 100644 arch/arm/dts/socfpga_agilex.dtsi
 create mode 100644 arch/arm/dts/socfpga_agilex_socdk-u-boot.dtsi
 create mode 100644 arch/arm/dts/socfpga_agilex_socdk.dts
 create mode 100644 arch/arm/mach-socfpga/clock_manager_agilex.c
 copy arch/arm/mach-socfpga/{spl_s10.c => firewall.c} (53%)
 create mode 100644 arch/arm/mach-socfpga/include/mach/clock_manager_agilex.h
 create mode 100644 arch/arm/mach-socfpga/include/mach/clock_manager_soc64.h
 rename arch/arm/mach-socfpga/include/mach/{firewall_s10.h => firewall.h} (94%)
 delete mode 100644 arch/arm/mach-socfpga/include/mach/reset_manager_s10.h
 create mode 100644 arch/arm/mach-socfpga/include/mach/reset_manager_soc64.h
 delete mode 100644 arch/arm/mach-socfpga/include/mach/system_manager_s10.h
 create mode 100644 arch/arm/mach-socfpga/include/mach/system_manager_soc64.h
 create mode 100644 arch/arm/mach-socfpga/spl_agilex.c
 create mode 100644 board/intel/agilex-socdk/MAINTAINERS
 create mode 100644 board/intel/agilex-socdk/Makefile
 create mode 100644 board/intel/agilex-socdk/socfpga.c
 create mode 100644 configs/socfpga_agilex_defconfig
 create mode 100644 drivers/cache/cache-ncore.c
 create mode 100644 drivers/clk/altera/clk-agilex.c
 create mode 100644 drivers/clk/altera/clk-agilex.h
 create mode 100644 drivers/ddr/altera/sdram_agilex.c
 create mode 100644 drivers/ddr/altera/sdram_soc64.c
 copy drivers/ddr/altera/{sdram_s10.h => sdram_soc64.h} (79%)
 create mode 100644 include/configs/socfpga_agilex_socdk.h
 copy include/configs/{socfpga_stratix10_socdk.h => socfpga_soc64_common.h} (94%)
 create mode 100644 include/dt-bindings/clock/agilex-clock.h
Signature · 1 line
2.19.0
#1 lore raw

PATCH v8 1/19 arm: socfpga: agilex: Add base address for Intel Agilex SoC

Add base address for Intel Agilex SoC.

Reuse base_addr_s10.h for Agilex, only one base address is different from S10.

---
v2:
- Reuse base_addr_s10.h and add #ifdef Agilex for SOCFPGA_FW_MPU_DDR_SCR_ADDRESS

---
 arch/arm/mach-socfpga/include/mach/base_addr_s10.h | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm/mach-socfpga/include/mach/base_addr_s10.h +4 -0
index 1f549d7e70..d3eca65e97 100644
@@ -10,7 +10,11 @@
 #define SOCFPGA_SDR_SCHEDULER_ADDRESS		0xf8000400
 #define SOCFPGA_HMC_MMR_IO48_ADDRESS		0xf8010000
 #define SOCFPGA_SDR_ADDRESS			0xf8011000
+#ifdef CONFIG_TARGET_SOCFPGA_AGILEX
+#define SOCFPGA_FW_MPU_DDR_SCR_ADDRESS		0xf8020200
+#else
 #define SOCFPGA_FW_MPU_DDR_SCR_ADDRESS		0xf8020100
+#endif
 #define SOCFPGA_SMMU_ADDRESS			0xfa000000
 #define SOCFPGA_MAILBOX_ADDRESS			0xffa30000
 #define SOCFPGA_UART0_ADDRESS			0xffc02000
Signature · 1 line
2.19.0
#2 lore raw

PATCH v8 2/19 arm: socfpga: Move firewall code to firewall file

In reply to Ley Foon Tan

Move firewall related code to new firewall.c, to share code in Stratix 10 and Agilex.

SDMMC will transfer data to OCRAM in SPL. So, enable privilege for SDMMC to allow DMA transfer to OCRAM.

---
v4:
- Move SYSMGR_DMA* to firewall.c

v3:
- Move SOCFPGA_FIREWALL_TCU to firewall.c

---
 arch/arm/mach-socfpga/Makefile                |   1 +
 .../mach-socfpga/{spl_s10.c => firewall.c}    | 120 +++---------------
 .../mach/{firewall_s10.h => firewall.h}       |  10 +-
 arch/arm/mach-socfpga/spl_s10.c               |  93 +-------------
 drivers/ddr/altera/sdram_s10.c                |   2 +-
 5 files changed, 26 insertions(+), 200 deletions(-)
 copy arch/arm/mach-socfpga/{spl_s10.c => firewall.c} (56%)
 rename arch/arm/mach-socfpga/include/mach/{firewall_s10.h => firewall.h} (94%)
arch/arm/mach-socfpga/Makefile +1 -0
index fc1181cb27..dab34d0ef2 100644
@@ -51,6 +51,7 @@ 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
 endif
 endif
arch/arm/mach-socfpga/firewall.c renamed from arch/arm/mach-socfpga/spl_s10.c +16 -104

151 lines not on this page · raw message

arch/arm/mach-socfpga/include/mach/firewall.h renamed from arch/arm/mach-socfpga/include/mach/firewall_s10.h +6 -4
similarity index 94%
rename from arch/arm/mach-socfpga/include/mach/firewall_s10.h
rename to arch/arm/mach-socfpga/include/mach/firewall.h
index b96f779f14..516bd1c0e1 100644
@@ -1,11 +1,11 @@
 /* SPDX-License-Identifier: GPL-2.0
  *
- * Copyright (C) 2017-2018 Intel Corporation <www.intel.com>
+ * Copyright (C) 2017-2019 Intel Corporation <www.intel.com>
  *
  */
 
-#ifndef	_FIREWALL_S10_
-#define	_FIREWALL_S10_
+#ifndef	_FIREWALL_H_
+#define	_FIREWALL_H_
 
 struct socfpga_firwall_l4_per {
 	u32	nand;		/* 0x00 */
@@ -117,4 +117,6 @@ struct socfpga_firwall_l4_sys {
 #define FW_MPU_DDR_SCR_WRITEL(data, reg)		\
 	writel(data, SOCFPGA_FW_MPU_DDR_SCR_ADDRESS + (reg))
 
-#endif /* _FIREWALL_S10_ */
+void firewall_setup(void);
+
+#endif /* _FIREWALL_H_ */
arch/arm/mach-socfpga/spl_s10.c +2 -91

111 lines not on this page · raw message

drivers/ddr/altera/sdram_s10.c +1 -1
index e43562adde..3fbbb06d67 100644
@@ -13,7 +13,7 @@
 #include <reset.h>
 #include "sdram_s10.h"
 #include <wait_bit.h>
-#include <asm/arch/firewall_s10.h>
+#include <asm/arch/firewall.h>
 #include <asm/arch/system_manager.h>
 #include <asm/arch/reset_manager.h>
 #include <asm/io.h>
Signature · 1 line
2.19.0
#3 lore raw

PATCH v8 3/19 arm: socfpga: Move Stratix10 and Agilex reset manager common code

In reply to Ley Foon Tan

Move Stratix10 and Agilex reset manager common code to reset_manager_soc64.h. Changed macros to RSTMGR_SOC64_*.

Remove unused RSTMGR_XXX defines.

---
v5:
- Remove reset_manager_s10.h and use reset_manager_soc64.h directly.

v4:
- Change prefix from RSTMGR_S10* to RSTMGR_SOC64*.

v3:
- Add new reset_manager_soc64.h
- Convert to use defines instead of struct.

---
 .../mach-socfpga/include/mach/reset_manager.h |  2 +-
 .../include/mach/reset_manager_s10.h          | 95 -------------------
 .../include/mach/reset_manager_soc64.h        | 38 ++++++++
 arch/arm/mach-socfpga/reset_manager_s10.c     | 20 ++--
 4 files changed, 49 insertions(+), 106 deletions(-)
 delete mode 100644 arch/arm/mach-socfpga/include/mach/reset_manager_s10.h
 create mode 100644 arch/arm/mach-socfpga/include/mach/reset_manager_soc64.h
arch/arm/mach-socfpga/include/mach/reset_manager.h +1 -1
index 96052d94b4..af57ab0a32 100644
@@ -44,7 +44,7 @@ void socfpga_per_reset_all(void);
 #elif defined(CONFIG_TARGET_SOCFPGA_ARRIA10)
 #include <asm/arch/reset_manager_arria10.h>
 #elif defined(CONFIG_TARGET_SOCFPGA_STRATIX10)
-#include <asm/arch/reset_manager_s10.h>
+#include <asm/arch/reset_manager_soc64.h>
 #endif
 
 #endif /* _RESET_MANAGER_H_ */
arch/arm/mach-socfpga/include/mach/reset_manager_s10.h deleted +0 -95

95 lines not on this page · raw message

arch/arm/mach-socfpga/include/mach/reset_manager_soc64.h new file +38 -0
new file mode 100644
index 0000000000..3f952bcc6e
@@ -0,0 +1,38 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ *  Copyright (C) 2016-2019 Intel Corporation <www.intel.com>
+ */
+
+#ifndef _RESET_MANAGER_SOC64_H_
+#define _RESET_MANAGER_SOC64_H_
+
+void reset_deassert_peripherals_handoff(void);
+int cpu_has_been_warmreset(void);
+void socfpga_bridges_reset(int enable);
+
+#define RSTMGR_SOC64_STATUS	0x00
+#define RSTMGR_SOC64_MPUMODRST	0x20
+#define RSTMGR_SOC64_PER0MODRST	0x24
+#define RSTMGR_SOC64_PER1MODRST	0x28
+#define RSTMGR_SOC64_BRGMODRST	0x2c
+
+#define RSTMGR_MPUMODRST_CORE0		0
+#define RSTMGR_PER0MODRST_OCP_MASK	0x0020bf00
+#define RSTMGR_BRGMODRST_DDRSCH_MASK	0X00000040
+#define RSTMGR_BRGMODRST_FPGA2SOC_MASK	0x00000004
+
+/* Watchdogs and MPU warm reset mask */
+#define RSTMGR_L4WD_MPU_WARMRESET_MASK	0x000F0F00
+
+/*
+ * SocFPGA Stratix10 reset IDs, bank mapping is as follows:
+ * 0 ... mpumodrst
+ * 1 ... per0modrst
+ * 2 ... per1modrst
+ * 3 ... brgmodrst
+ */
+#define RSTMGR_L4WD0		RSTMGR_DEFINE(2, 0)
+#define RSTMGR_OSC1TIMER0	RSTMGR_DEFINE(2, 4)
+#define RSTMGR_UART0		RSTMGR_DEFINE(2, 16)
+
+#endif /* _RESET_MANAGER_SOC64_H_ */
arch/arm/mach-socfpga/reset_manager_s10.c +10 -10
index e92de3d84e..f449cb67d7 100644
@@ -18,13 +18,13 @@ void socfpga_per_reset(u32 reset, int set)
 	unsigned long reg;
 
 	if (RSTMGR_BANK(reset) == 0)
-		reg = RSTMGR_S10_MPUMODRST;
+		reg = RSTMGR_SOC64_MPUMODRST;
 	else if (RSTMGR_BANK(reset) == 1)
-		reg = RSTMGR_S10_PER0MODRST;
+		reg = RSTMGR_SOC64_PER0MODRST;
 	else if (RSTMGR_BANK(reset) == 2)
-		reg = RSTMGR_S10_PER1MODRST;
+		reg = RSTMGR_SOC64_PER1MODRST;
 	else if (RSTMGR_BANK(reset) == 3)
-		reg = RSTMGR_S10_BRGMODRST;
+		reg = RSTMGR_SOC64_BRGMODRST;
 	else	/* Invalid reset register, do nothing */
 		return;
 
@@ -47,9 +47,9 @@ void socfpga_per_reset_all(void)
 
 	/* disable all except OCP and l4wd0. OCP disable later */
 	writel(~(l4wd0 | RSTMGR_PER0MODRST_OCP_MASK),
-		      socfpga_get_rstmgr_addr() + RSTMGR_S10_PER0MODRST);
-	writel(~l4wd0, socfpga_get_rstmgr_addr() + RSTMGR_S10_PER0MODRST);
-	writel(0xffffffff, socfpga_get_rstmgr_addr() + RSTMGR_S10_PER1MODRST);
+		      socfpga_get_rstmgr_addr() + RSTMGR_SOC64_PER0MODRST);
+	writel(~l4wd0, socfpga_get_rstmgr_addr() + RSTMGR_SOC64_PER0MODRST);
+	writel(0xffffffff, socfpga_get_rstmgr_addr() + RSTMGR_SOC64_PER1MODRST);
 }
 
 void socfpga_bridges_reset(int enable)
@@ -60,7 +60,7 @@ void socfpga_bridges_reset(int enable)
 			     SYSMGR_S10_NOC_IDLEREQ_CLR, ~0);
 
 		/* Release all bridges from reset state */
-		clrbits_le32(socfpga_get_rstmgr_addr() + RSTMGR_S10_BRGMODRST,
+		clrbits_le32(socfpga_get_rstmgr_addr() + RSTMGR_SOC64_BRGMODRST,
 			     ~0);
 
 		/* Poll until all idleack to 0 */
@@ -86,7 +86,7 @@ void socfpga_bridges_reset(int enable)
 			;
 
 		/* Reset all bridges (except NOR DDR scheduler & F2S) */
-		setbits_le32(socfpga_get_rstmgr_addr() + RSTMGR_S10_BRGMODRST,
+		setbits_le32(socfpga_get_rstmgr_addr() + RSTMGR_SOC64_BRGMODRST,
 			     ~(RSTMGR_BRGMODRST_DDRSCH_MASK |
 			       RSTMGR_BRGMODRST_FPGA2SOC_MASK));
 
@@ -100,6 +100,6 @@ void socfpga_bridges_reset(int enable)
  */
 int cpu_has_been_warmreset(void)
 {
-	return readl(socfpga_get_rstmgr_addr() + RSTMGR_S10_STATUS) &
+	return readl(socfpga_get_rstmgr_addr() + RSTMGR_SOC64_STATUS) &
 			RSTMGR_L4WD_MPU_WARMRESET_MASK;
 }
Signature · 1 line
2.19.0
#4 lore raw

PATCH v8 4/19 arm: socfpga: agilex: Add reset manager support

In reply to Ley Foon Tan

Add reset manager support for Agilex.

---
v5:
- Remove reset_reset_manager_agilex.h and use reset_manager_soc64.h.

v3:
- Add reset_manager_soc64.h
- Convert to use defines instead of struct.

---
 arch/arm/mach-socfpga/include/mach/reset_manager.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/arm/mach-socfpga/include/mach/reset_manager.h +2 -1
index af57ab0a32..7844ad14cb 100644
@@ -43,7 +43,8 @@ void socfpga_per_reset_all(void);
 #include <asm/arch/reset_manager_gen5.h>
 #elif defined(CONFIG_TARGET_SOCFPGA_ARRIA10)
 #include <asm/arch/reset_manager_arria10.h>
-#elif defined(CONFIG_TARGET_SOCFPGA_STRATIX10)
+#elif defined(CONFIG_TARGET_SOCFPGA_STRATIX10) || \
+	defined(CONFIG_TARGET_SOCFPGA_AGILEX)
 #include <asm/arch/reset_manager_soc64.h>
 #endif
 
Signature · 1 line
2.19.0
#5 lore raw

PATCH v8 5/19 arm: socfpga: Move Stratix10 and Agilex system manager common code

In reply to Ley Foon Tan

Move Stratix10 and Agilex system manager common code to system_manager_soc64.h. Changed macros to use SYSMGR_SOC64_*.

---
v5:
- Remove system_manager_s10.h and use system_manager_soc64.h.

v4:
- Change prefix from SYSMGR_S10* to SYSMGR_SOC64*.

v3:
- Change filename to system_manager_soc64.h
- Move to use defines instead of struct.

v2:
- Move common defines for Stratix 10 and Agilex to system_manager_s10_agilex_common.h

---
 arch/arm/mach-socfpga/clock_manager_s10.c     |   3 +-
 arch/arm/mach-socfpga/firewall.c              |   4 +-
 .../include/mach/system_manager.h             |   2 +-
 .../include/mach/system_manager_s10.h         | 124 ------------------
 .../include/mach/system_manager_soc64.h       | 123 +++++++++++++++++
 arch/arm/mach-socfpga/mailbox_s10.c           |   2 +-
 arch/arm/mach-socfpga/misc_s10.c              |   2 +-
 arch/arm/mach-socfpga/reset_manager_s10.c     |  15 ++-
 arch/arm/mach-socfpga/spl_s10.c               |   2 +-
 arch/arm/mach-socfpga/system_manager_s10.c    |  26 ++--
 arch/arm/mach-socfpga/wrap_pll_config_s10.c   |  10 +-
 drivers/ddr/altera/sdram_s10.c                |   2 +-
 12 files changed, 159 insertions(+), 156 deletions(-)
 delete mode 100644 arch/arm/mach-socfpga/include/mach/system_manager_s10.h
 create mode 100644 arch/arm/mach-socfpga/include/mach/system_manager_soc64.h
arch/arm/mach-socfpga/clock_manager_s10.c +2 -1
index 5edeab1792..05e42127b5 100644
@@ -385,7 +385,8 @@ unsigned int cm_get_l4_sp_clk_hz(void)
 
 unsigned int cm_get_qspi_controller_clk_hz(void)
 {
-	return readl(socfpga_get_sysmgr_addr() + SYSMGR_S10_BOOT_SCRATCH_COLD0);
+	return readl(socfpga_get_sysmgr_addr() +
+		     SYSMGR_SOC64_BOOT_SCRATCH_COLD0);
 }
 
 unsigned int cm_get_spi_controller_clk_hz(void)
arch/arm/mach-socfpga/firewall.c +2 -2
index 9a4111a931..69229dc651 100644
@@ -101,7 +101,7 @@ void firewall_setup(void)
 
 	/* enable non-secure interface to DMA330 DMA and peripherals */
 	writel(SYSMGR_DMA_IRQ_NS | SYSMGR_DMA_MGR_NS,
-	       socfpga_get_sysmgr_addr() + SYSMGR_S10_DMA);
+	       socfpga_get_sysmgr_addr() + SYSMGR_SOC64_DMA);
 	writel(SYSMGR_DMAPERIPH_ALL_NS,
-	       socfpga_get_sysmgr_addr() + SYSMGR_S10_DMA_PERIPH);
+	       socfpga_get_sysmgr_addr() + SYSMGR_SOC64_DMA_PERIPH);
 }
arch/arm/mach-socfpga/include/mach/system_manager.h +1 -1
index 7f05029a67..242ef2e8be 100644
@@ -9,7 +9,7 @@
 phys_addr_t socfpga_get_sysmgr_addr(void);
 
 #if defined(CONFIG_TARGET_SOCFPGA_STRATIX10)
-#include <asm/arch/system_manager_s10.h>
+#include <asm/arch/system_manager_soc64.h>
 #else
 #define SYSMGR_ROMCODEGRP_CTRL_WARMRSTCFGPINMUX	BIT(0)
 #define SYSMGR_ROMCODEGRP_CTRL_WARMRSTCFGIO	BIT(1)
arch/arm/mach-socfpga/include/mach/system_manager_s10.h deleted +0 -124

124 lines not on this page · raw message

arch/arm/mach-socfpga/include/mach/system_manager_soc64.h new file +123 -0

123 lines not on this page · raw message

arch/arm/mach-socfpga/mailbox_s10.c +1 -1
index 3b9a2ecb01..3254bc1805 100644
@@ -316,7 +316,7 @@ int mbox_qspi_open(void)
 	/* We are getting QSPI ref clock and set into sysmgr boot register */
 	printf("QSPI: Reference clock at %d Hz\n", resp_buf[0]);
 	writel(resp_buf[0],
-	       socfpga_get_sysmgr_addr() + SYSMGR_S10_BOOT_SCRATCH_COLD0);
+	       socfpga_get_sysmgr_addr() + SYSMGR_SOC64_BOOT_SCRATCH_COLD0);
 
 	return 0;
 
arch/arm/mach-socfpga/misc_s10.c +1 -1
index 1849e53931..a3f5b4364e 100644
@@ -65,7 +65,7 @@ static u32 socfpga_phymode_setup(u32 gmac_index, const char *phymode)
 	else
 		return -EINVAL;
 
-	clrsetbits_le32(socfpga_get_sysmgr_addr() + SYSMGR_S10_EMAC0 +
+	clrsetbits_le32(socfpga_get_sysmgr_addr() + SYSMGR_SOC64_EMAC0 +
 			gmac_index,
 			SYSMGR_EMACGRP_CTRL_PHYSEL_MASK, modereg);
 
arch/arm/mach-socfpga/reset_manager_s10.c +8 -7
index f449cb67d7..c7430777b2 100644
@@ -57,7 +57,7 @@ void socfpga_bridges_reset(int enable)
 	if (enable) {
 		/* clear idle request to all bridges */
 		setbits_le32(socfpga_get_sysmgr_addr() +
-			     SYSMGR_S10_NOC_IDLEREQ_CLR, ~0);
+			     SYSMGR_SOC64_NOC_IDLEREQ_CLR, ~0);
 
 		/* Release all bridges from reset state */
 		clrbits_le32(socfpga_get_rstmgr_addr() + RSTMGR_SOC64_BRGMODRST,
@@ -65,23 +65,24 @@ void socfpga_bridges_reset(int enable)
 
 		/* Poll until all idleack to 0 */
 		while (readl(socfpga_get_sysmgr_addr() +
-			     SYSMGR_S10_NOC_IDLEACK))
+			     SYSMGR_SOC64_NOC_IDLEACK))
 			;
 	} else {
 		/* set idle request to all bridges */
 		writel(~0,
-		       socfpga_get_sysmgr_addr() + SYSMGR_S10_NOC_IDLEREQ_SET);
+		       socfpga_get_sysmgr_addr() +
+		       SYSMGR_SOC64_NOC_IDLEREQ_SET);
 
 		/* Enable the NOC timeout */
-		writel(1, socfpga_get_sysmgr_addr() + SYSMGR_S10_NOC_TIMEOUT);
+		writel(1, socfpga_get_sysmgr_addr() + SYSMGR_SOC64_NOC_TIMEOUT);
 
 		/* Poll until all idleack to 1 */
-		while ((readl(socfpga_get_sysmgr_addr() + SYSMGR_S10_NOC_IDLEACK) ^
+		while ((readl(socfpga_get_sysmgr_addr() + SYSMGR_SOC64_NOC_IDLEACK) ^
 			(SYSMGR_NOC_H2F_MSK | SYSMGR_NOC_LWH2F_MSK)))
 			;
 
 		/* Poll until all idlestatus to 1 */
-		while ((readl(socfpga_get_sysmgr_addr() + SYSMGR_S10_NOC_IDLESTATUS) ^
+		while ((readl(socfpga_get_sysmgr_addr() + SYSMGR_SOC64_NOC_IDLESTATUS) ^
 			(SYSMGR_NOC_H2F_MSK | SYSMGR_NOC_LWH2F_MSK)))
 			;
 
@@ -91,7 +92,7 @@ void socfpga_bridges_reset(int enable)
 			       RSTMGR_BRGMODRST_FPGA2SOC_MASK));
 
 		/* Disable NOC timeout */
-		writel(0, socfpga_get_sysmgr_addr() + SYSMGR_S10_NOC_TIMEOUT);
+		writel(0, socfpga_get_sysmgr_addr() + SYSMGR_SOC64_NOC_TIMEOUT);
 	}
 }
 
arch/arm/mach-socfpga/spl_s10.c +1 -1
index caff0895ac..8d96918cb4 100644
@@ -53,7 +53,7 @@ void board_init_f(ulong dummy)
 #ifdef CONFIG_HW_WATCHDOG
 	/* Ensure watchdog is paused when debugging is happening */
 	writel(SYSMGR_WDDBG_PAUSE_ALL_CPU,
-	       socfpga_get_sysmgr_addr() + SYSMGR_S10_WDDBG);
+	       socfpga_get_sysmgr_addr() + SYSMGR_SOC64_WDDBG);
 
 	/* Enable watchdog before initializing the HW */
 	socfpga_per_reset(SOCFPGA_RESET(L4WD0), 1);
arch/arm/mach-socfpga/system_manager_s10.c +13 -13
index 72b10946c6..cdda881efd 100644
@@ -29,33 +29,33 @@ void populate_sysmgr_fpgaintf_module(void)
 	u32 handoff_val = 0;
 
 	/* Enable the signal for those HPS peripherals that use FPGA. */
-	if (readl(socfpga_get_sysmgr_addr() + SYSMGR_S10_NAND_USEFPGA) ==
+	if (readl(socfpga_get_sysmgr_addr() + SYSMGR_SOC64_NAND_USEFPGA) ==
 	    SYSMGR_FPGAINTF_USEFPGA)
 		handoff_val |= SYSMGR_FPGAINTF_NAND;
-	if (readl(socfpga_get_sysmgr_addr() + SYSMGR_S10_SDMMC_USEFPGA) ==
+	if (readl(socfpga_get_sysmgr_addr() + SYSMGR_SOC64_SDMMC_USEFPGA) ==
 	    SYSMGR_FPGAINTF_USEFPGA)
 		handoff_val |= SYSMGR_FPGAINTF_SDMMC;
-	if (readl(socfpga_get_sysmgr_addr() + SYSMGR_S10_SPIM0_USEFPGA) ==
+	if (readl(socfpga_get_sysmgr_addr() + SYSMGR_SOC64_SPIM0_USEFPGA) ==
 	    SYSMGR_FPGAINTF_USEFPGA)
 		handoff_val |= SYSMGR_FPGAINTF_SPIM0;
-	if (readl(socfpga_get_sysmgr_addr() + SYSMGR_S10_SPIM1_USEFPGA) ==
+	if (readl(socfpga_get_sysmgr_addr() + SYSMGR_SOC64_SPIM1_USEFPGA) ==
 	    SYSMGR_FPGAINTF_USEFPGA)
 		handoff_val |= SYSMGR_FPGAINTF_SPIM1;
 	writel(handoff_val,
-	       socfpga_get_sysmgr_addr() + SYSMGR_S10_FPGAINTF_EN2);
+	       socfpga_get_sysmgr_addr() + SYSMGR_SOC64_FPGAINTF_EN2);
 
 	handoff_val = 0;
-	if (readl(socfpga_get_sysmgr_addr() + SYSMGR_S10_EMAC0_USEFPGA) ==
+	if (readl(socfpga_get_sysmgr_addr() + SYSMGR_SOC64_EMAC0_USEFPGA) ==
 	    SYSMGR_FPGAINTF_USEFPGA)
 		handoff_val |= SYSMGR_FPGAINTF_EMAC0;
-	if (readl(socfpga_get_sysmgr_addr() + SYSMGR_S10_EMAC1_USEFPGA) ==
+	if (readl(socfpga_get_sysmgr_addr() + SYSMGR_SOC64_EMAC1_USEFPGA) ==
 	    SYSMGR_FPGAINTF_USEFPGA)
 		handoff_val |= SYSMGR_FPGAINTF_EMAC1;
-	if (readl(socfpga_get_sysmgr_addr() + SYSMGR_S10_EMAC2_USEFPGA) ==
+	if (readl(socfpga_get_sysmgr_addr() + SYSMGR_SOC64_EMAC2_USEFPGA) ==
 	    SYSMGR_FPGAINTF_USEFPGA)
 		handoff_val |= SYSMGR_FPGAINTF_EMAC2;
 	writel(handoff_val,
-	       socfpga_get_sysmgr_addr() + SYSMGR_S10_FPGAINTF_EN3);
+	       socfpga_get_sysmgr_addr() + SYSMGR_SOC64_FPGAINTF_EN3);
 }
 
 /*
@@ -71,7 +71,7 @@ void populate_sysmgr_pinmux(void)
 	for (i = 0; i < len; i = i + 2) {
 		writel(sys_mgr_table_u32[i + 1],
 		       sys_mgr_table_u32[i] +
-		       (u8 *)socfpga_get_sysmgr_addr() + SYSMGR_S10_PINSEL0);
+		       (u8 *)socfpga_get_sysmgr_addr() + SYSMGR_SOC64_PINSEL0);
 	}
 
 	/* setup the pin ctrl */
@@ -79,7 +79,7 @@ void populate_sysmgr_pinmux(void)
 	for (i = 0; i < len; i = i + 2) {
 		writel(sys_mgr_table_u32[i + 1],
 		       sys_mgr_table_u32[i] +
-		       (u8 *)socfpga_get_sysmgr_addr() + SYSMGR_S10_IOCTRL0);
+		       (u8 *)socfpga_get_sysmgr_addr() + SYSMGR_SOC64_IOCTRL0);
 	}
 
 	/* setup the fpga use */
@@ -88,7 +88,7 @@ void populate_sysmgr_pinmux(void)
 		writel(sys_mgr_table_u32[i + 1],
 		       sys_mgr_table_u32[i] +
 		       (u8 *)socfpga_get_sysmgr_addr() +
-		       SYSMGR_S10_EMAC0_USEFPGA);
+		       SYSMGR_SOC64_EMAC0_USEFPGA);
 	}
 
 	/* setup the IO delay */
@@ -96,6 +96,6 @@ void populate_sysmgr_pinmux(void)
 	for (i = 0; i < len; i = i + 2) {
 		writel(sys_mgr_table_u32[i + 1],
 		       sys_mgr_table_u32[i] +
-		       (u8 *)socfpga_get_sysmgr_addr() + SYSMGR_S10_IODELAY0);
+		       (u8 *)socfpga_get_sysmgr_addr() + SYSMGR_SOC64_IODELAY0);
 	}
 }
arch/arm/mach-socfpga/wrap_pll_config_s10.c +6 -4
index 2478321c27..b266a5817b 100644
@@ -36,9 +36,10 @@ const unsigned int cm_get_osc_clk_hz(void)
 	u32 clock = readl(S10_HANDOFF_CLOCK_OSC);
 
 	writel(clock,
-	       socfpga_get_sysmgr_addr() + SYSMGR_S10_BOOT_SCRATCH_COLD1);
+	       socfpga_get_sysmgr_addr() + SYSMGR_SOC64_BOOT_SCRATCH_COLD1);
 #endif
-	return readl(socfpga_get_sysmgr_addr() + SYSMGR_S10_BOOT_SCRATCH_COLD1);
+	return readl(socfpga_get_sysmgr_addr() +
+		     SYSMGR_SOC64_BOOT_SCRATCH_COLD1);
 }
 
 const unsigned int cm_get_intosc_clk_hz(void)
@@ -52,7 +53,8 @@ const unsigned int cm_get_fpga_clk_hz(void)
 	u32 clock = readl(S10_HANDOFF_CLOCK_FPGA);
 
 	writel(clock,
-	       socfpga_get_sysmgr_addr() + SYSMGR_S10_BOOT_SCRATCH_COLD2);
+	       socfpga_get_sysmgr_addr() + SYSMGR_SOC64_BOOT_SCRATCH_COLD2);
 #endif
-	return readl(socfpga_get_sysmgr_addr() + SYSMGR_S10_BOOT_SCRATCH_COLD2);
+	return readl(socfpga_get_sysmgr_addr() +
+		     SYSMGR_SOC64_BOOT_SCRATCH_COLD2);
 }
drivers/ddr/altera/sdram_s10.c +1 -1
index 3fbbb06d67..d7e6371ddb 100644
@@ -148,7 +148,7 @@ static int emif_reset(struct altera_sdram_platdata *plat)
 static int poll_hmc_clock_status(void)
 {
 	return wait_for_bit_le32((const void *)(socfpga_get_sysmgr_addr() +
-				 SYSMGR_S10_HMC_CLK),
+				 SYSMGR_SOC64_HMC_CLK),
 				 SYSMGR_HMC_CLK_STATUS_MSK, true, 1000, false);
 }
 
Signature · 1 line
2.19.0
#6 lore raw

PATCH v8 6/19 arm: socfpga: agilex: Add system manager support

In reply to Ley Foon Tan

Add system manager support for Agilex.

---
v5:
- Remove system_manager_agilex.h and use system_manager_soc64.h directly.

v3:
- Change include filename to system_manager_soc64.h.
- Move to use defines instead of struct.

v2:
- Include system_manager_s10_agilex_common.h in system_manager_agilex.h

---
 arch/arm/mach-socfpga/include/mach/system_manager.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/arm/mach-socfpga/include/mach/system_manager.h +2 -1
index 242ef2e8be..6de0a08131 100644
@@ -8,7 +8,8 @@
 
 phys_addr_t socfpga_get_sysmgr_addr(void);
 
-#if defined(CONFIG_TARGET_SOCFPGA_STRATIX10)
+#if defined(CONFIG_TARGET_SOCFPGA_STRATIX10) || \
+	defined(CONFIG_TARGET_SOCFPGA_AGILEX)
 #include <asm/arch/system_manager_soc64.h>
 #else
 #define SYSMGR_ROMCODEGRP_CTRL_WARMRSTCFGPINMUX	BIT(0)
Signature · 1 line
2.19.0
#7 lore raw

PATCH v8 7/19 arm: socfpga: Move Stratix10 and Agilex clock manager common code

In reply to Ley Foon Tan

Move Stratix10 and Agilex clock manager common code to new header file.

---
v6:
- Move #include <asm/arch/clock_manager_soc64.h> to top of header file.

v5:
- Revert CLKMGR_INTOSC_HZ to 460MHz.

---
 .../include/mach/clock_manager_s10.h          | 16 +++----------
 .../include/mach/clock_manager_soc64.h        | 23 +++++++++++++++++++
 2 files changed, 26 insertions(+), 13 deletions(-)
 create mode 100644 arch/arm/mach-socfpga/include/mach/clock_manager_soc64.h
arch/arm/mach-socfpga/include/mach/clock_manager_s10.h +3 -13
index 13eb23569c..e710aa2f94 100644
@@ -1,12 +1,14 @@
 /* SPDX-License-Identifier: GPL-2.0
  *
- * Copyright (C) 2016-2018 Intel Corporation <www.intel.com>
+ * Copyright (C) 2016-2019 Intel Corporation <www.intel.com>
  *
  */
 
 #ifndef	_CLOCK_MANAGER_S10_
 #define	_CLOCK_MANAGER_S10_
 
+#include <asm/arch/clock_manager_soc64.h>
+
 /* Clock speed accessors */
 unsigned long cm_get_mpu_clk_hz(void);
 unsigned long cm_get_sdram_clk_hz(void);
@@ -14,18 +16,6 @@ unsigned int cm_get_l4_sp_clk_hz(void);
 unsigned int cm_get_mmc_controller_clk_hz(void);
 unsigned int cm_get_qspi_controller_clk_hz(void);
 unsigned int cm_get_spi_controller_clk_hz(void);
-const unsigned int cm_get_osc_clk_hz(void);
-const unsigned int cm_get_f2s_per_ref_clk_hz(void);
-const unsigned int cm_get_f2s_sdr_ref_clk_hz(void);
-const unsigned int cm_get_intosc_clk_hz(void);
-const unsigned int cm_get_fpga_clk_hz(void);
-
-#define CLKMGR_EOSC1_HZ		25000000
-#define CLKMGR_INTOSC_HZ	460000000
-#define CLKMGR_FPGA_CLK_HZ	50000000
-
-/* Clock configuration accessors */
-const struct cm_config * const cm_get_default_config(void);
 
 struct cm_config {
 	/* main group */
arch/arm/mach-socfpga/include/mach/clock_manager_soc64.h new file +23 -0
new file mode 100644
index 0000000000..3b4bb62ca5
@@ -0,0 +1,23 @@
+/* SPDX-License-Identifier: GPL-2.0
+ *
+ * Copyright (C) 2016-2019 Intel Corporation <www.intel.com>
+ *
+ */
+
+#ifndef _CLOCK_MANAGER_SOC64_
+#define _CLOCK_MANAGER_SOC64_
+
+const unsigned int cm_get_osc_clk_hz(void);
+const unsigned int cm_get_f2s_per_ref_clk_hz(void);
+const unsigned int cm_get_f2s_sdr_ref_clk_hz(void);
+const unsigned int cm_get_intosc_clk_hz(void);
+const unsigned int cm_get_fpga_clk_hz(void);
+
+#define CLKMGR_EOSC1_HZ		25000000
+#define CLKMGR_INTOSC_HZ	460000000
+#define CLKMGR_FPGA_CLK_HZ	50000000
+
+/* Clock configuration accessors */
+const struct cm_config * const cm_get_default_config(void);
+
+#endif /* _CLOCK_MANAGER_SOC64_ */
Signature · 1 line
2.19.0
#8 lore raw

PATCH v8 8/19 arm: socfpga: Fix CLKMGR_INTOSC_HZ to 400MHz

In reply to Ley Foon Tan

CLKMGR_INTOSC_HZ should be 400MHz, instead of 460MHz. Removed also unused macros CLKMGR_EOSC1_HZ and CLKMGR_FPGA_CLK_HZ.

---
v6:
- Remove unused macros CLKMGR_EOSC1_HZ and CLKMGR_FPGA_CLK_HZ.

---
 arch/arm/mach-socfpga/include/mach/clock_manager_soc64.h | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
arch/arm/mach-socfpga/include/mach/clock_manager_soc64.h +1 -3
index 3b4bb62ca5..71fbaa7667 100644
@@ -13,9 +13,7 @@ const unsigned int cm_get_f2s_sdr_ref_clk_hz(void);
 const unsigned int cm_get_intosc_clk_hz(void);
 const unsigned int cm_get_fpga_clk_hz(void);
 
-#define CLKMGR_EOSC1_HZ		25000000
-#define CLKMGR_INTOSC_HZ	460000000
-#define CLKMGR_FPGA_CLK_HZ	50000000
+#define CLKMGR_INTOSC_HZ	400000000
 
 /* Clock configuration accessors */
 const struct cm_config * const cm_get_default_config(void);
Signature · 1 line
2.19.0
#9 lore raw

PATCH v8 9/19 clk: agilex: Add clock driver for Agilex

In reply to Ley Foon Tan

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

agilex-clock.h is from Linux commit ID cd2e1ad12247.

---
v6:
- Use agilex-clock.h from Linux instead of using stratix10-clock.h.

v4:
- Get address from DT.

v3:
- Fixed clear PLL's lostlock bypass mode to ensure the clock manager provide glitchless clock to downstream logic
- Changed CM_REG_CLRBITS(), CM_REG_SETBITS() and CM_REG_CLRSETBITS() macros argument ordering, to match with clrbits_le32, setbits_le32 and clrsetbits_le32.
- Rename stratix10-clock.h to socfpga-soc64-clock.h.
- Convert struct to defines and move defines to clk-agilex.h

v2:
- Convert Clock driver to DM

---
 arch/arm/mach-socfpga/misc.c             |   5 +
 drivers/clk/altera/Makefile              |   1 +
 drivers/clk/altera/clk-agilex.c          | 579 +++++++++++++++++++++++
 drivers/clk/altera/clk-agilex.h          | 237 ++++++++++
 include/dt-bindings/clock/agilex-clock.h |  71 +++
 5 files changed, 893 insertions(+)
 create mode 100644 drivers/clk/altera/clk-agilex.c
 create mode 100644 drivers/clk/altera/clk-agilex.h
 create mode 100644 include/dt-bindings/clock/agilex-clock.h
arch/arm/mach-socfpga/misc.c +5 -0
index 1c6a0032dd..c95d9f6f43 100644
@@ -244,7 +244,12 @@ void socfpga_get_managers_addr(void)
 	if (ret)
 		hang();
 
+#ifdef CONFIG_TARGET_SOCFPGA_AGILEX
+	ret = socfpga_get_base_addr("intel,agilex-clkmgr",
+				    &socfpga_clkmgr_base);
+#else
 	ret = socfpga_get_base_addr("altr,clk-mgr", &socfpga_clkmgr_base);
+#endif
 	if (ret)
 		hang();
 }
drivers/clk/altera/Makefile +1 -0
index a3ae8b24b0..96215ad5c4 100644
@@ -3,4 +3,5 @@
 # Copyright (C) 2018 Marek Vasut <[email protected]>
 #
 
+obj-$(CONFIG_TARGET_SOCFPGA_AGILEX) += clk-agilex.o
 obj-$(CONFIG_TARGET_SOCFPGA_ARRIA10) += clk-arria10.o
drivers/clk/altera/clk-agilex.c new file +579 -0

579 lines not on this page · raw message

drivers/clk/altera/clk-agilex.h new file +237 -0

237 lines not on this page · raw message

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

71 lines not on this page · raw message

Signature · 1 line
2.19.0
#10 lore raw

PATCH v8 10/19 arm: socfpga: agilex: Add clock wrapper functions

In reply to Ley Foon Tan

Add clock wrapper functions call to clock DM functions to get clock frequency and used in cm_print_clock_quick_summary().

---
v6:
- Use new macro names from agilex-clock.h.

v4:
- Change to use SYSMGR_SOC64* prefix.

v3:
- Improved commit message.
- Rename STRATIX10_* to SOCFPGA_SOC64_*
- Include clock_manager_soc64.h and clk-agilex.h.

v2:
- Get clocks from clock DM.

---
 arch/arm/mach-socfpga/Makefile                |  4 +
 arch/arm/mach-socfpga/clock_manager_agilex.c  | 85 +++++++++++++++++++
 .../mach-socfpga/include/mach/clock_manager.h |  2 +
 .../include/mach/clock_manager_agilex.h       | 14 +++
 4 files changed, 105 insertions(+)
 create mode 100644 arch/arm/mach-socfpga/clock_manager_agilex.c
 create mode 100644 arch/arm/mach-socfpga/include/mach/clock_manager_agilex.h
arch/arm/mach-socfpga/Makefile +4 -0
index dab34d0ef2..a403b46b47 100644
@@ -39,6 +39,10 @@ obj-y	+= wrap_pinmux_config_s10.o
 obj-y	+= wrap_pll_config_s10.o
 endif
 
+ifdef CONFIG_TARGET_SOCFPGA_AGILEX
+obj-y	+= clock_manager_agilex.o
+endif
+
 ifdef CONFIG_SPL_BUILD
 ifdef CONFIG_TARGET_SOCFPGA_GEN5
 obj-y	+= spl_gen5.o
arch/arm/mach-socfpga/clock_manager_agilex.c new file +85 -0

85 lines not on this page · raw message

arch/arm/mach-socfpga/include/mach/clock_manager.h +2 -0
index 6de7caef19..c6830582a5 100644
@@ -20,6 +20,8 @@ void cm_print_clock_quick_summary(void);
 #include <asm/arch/clock_manager_arria10.h>
 #elif defined(CONFIG_TARGET_SOCFPGA_STRATIX10)
 #include <asm/arch/clock_manager_s10.h>
+#elif defined(CONFIG_TARGET_SOCFPGA_AGILEX)
+#include <asm/arch/clock_manager_agilex.h>
 #endif
 
 #endif /* _CLOCK_MANAGER_H_ */
arch/arm/mach-socfpga/include/mach/clock_manager_agilex.h new file +14 -0
new file mode 100644
index 0000000000..386e82a4e3
@@ -0,0 +1,14 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright (C) 2019 Intel Corporation <www.intel.com>
+ */
+
+#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"
+
+#endif /* _CLOCK_MANAGER_AGILEX_ */
Signature · 1 line
2.19.0
#11 lore raw

PATCH v8 11/19 cache: Add Arteris Ncore cache coherent unit driver

In reply to Ley Foon Tan

Add Cache Coherency Unit (CCU) driver.
CCU is to ensures consistency of shared data between multi masters in the system.

Driver initializes CCU's directories and coherency agent interfaces in CCU IP.

---
v5:
- Move CCU driver to DM.

---
 drivers/cache/Kconfig       |   8 ++
 drivers/cache/Makefile      |   1 +
 drivers/cache/cache-ncore.c | 164 ++++++++++++++++++++++++++++++++++++
 3 files changed, 173 insertions(+)
 create mode 100644 drivers/cache/cache-ncore.c
drivers/cache/Kconfig +8 -0
index 629039e7a8..1e452ad6d9 100644
@@ -31,4 +31,12 @@ config V5L2_CACHE
 	  It will configure tag and data ram timing control from the
 	  device tree and enable L2 cache.
 
+config NCORE_CACHE
+	bool "Arteris Ncore cache coherent unit driver"
+	select CACHE
+	help
+	  This driver is for the Arteris Ncore cache coherent unit (CCU)
+	  controller. The driver initializes cache directories and coherent
+	  agent interfaces.
+
 endmenu
drivers/cache/Makefile +1 -0
index c1f766cfca..6be895a5f7 100644
@@ -2,4 +2,5 @@
 obj-$(CONFIG_$(SPL_)CACHE) += cache-uclass.o
 obj-$(CONFIG_SANDBOX) += sandbox_cache.o
 obj-$(CONFIG_L2X0_CACHE) += cache-l2x0.o
+obj-$(CONFIG_NCORE_CACHE) += cache-ncore.o
 obj-$(CONFIG_V5L2_CACHE) += cache-v5l2.o
drivers/cache/cache-ncore.c new file +164 -0

164 lines not on this page · raw message

Signature · 1 line
2.19.0
#12 lore raw

PATCH v8 12/19 arm: agilex: Add clock handoff offset for Agilex

In reply to Ley Foon Tan

Add clock handoff offset for Agilex. Remove S10 prefix to avoid confusion.

---
v8:
- Fixed missing CONFIG_ prefix for TARGET_SOCFPGA_STRATIX10.

---
 arch/arm/mach-socfpga/include/mach/handoff_s10.h | 9 +++++++--
 arch/arm/mach-socfpga/wrap_pll_config_s10.c      | 5 +++--
 2 files changed, 10 insertions(+), 4 deletions(-)
arch/arm/mach-socfpga/include/mach/handoff_s10.h +7 -2
index ba0f1fd1b2..3e9b606ce2 100644
@@ -26,8 +26,13 @@
 #define S10_HANDOFF_OFFSET_LENGTH	0x4
 #define S10_HANDOFF_OFFSET_DATA	0x10
 
-#define S10_HANDOFF_CLOCK_OSC	(S10_HANDOFF_BASE + 0x608)
-#define S10_HANDOFF_CLOCK_FPGA	(S10_HANDOFF_BASE + 0x60C)
+#ifdef CONFIG_TARGET_SOCFPGA_STRATIX10
+#define HANDOFF_CLOCK_OSC	(S10_HANDOFF_BASE + 0x608)
+#define HANDOFF_CLOCK_FPGA	(S10_HANDOFF_BASE + 0x60C)
+#else
+#define HANDOFF_CLOCK_OSC	(S10_HANDOFF_BASE + 0x5fc)
+#define HANDOFF_CLOCK_FPGA	(S10_HANDOFF_BASE + 0x600)
+#endif
 
 #define S10_HANDOFF_SIZE	4096
 
arch/arm/mach-socfpga/wrap_pll_config_s10.c +3 -2
index b266a5817b..3da85791a1 100644
@@ -33,7 +33,8 @@ const struct cm_config * const cm_get_default_config(void)
 const unsigned int cm_get_osc_clk_hz(void)
 {
 #ifdef CONFIG_SPL_BUILD
-	u32 clock = readl(S10_HANDOFF_CLOCK_OSC);
+
+	u32 clock = readl(HANDOFF_CLOCK_OSC);
 
 	writel(clock,
 	       socfpga_get_sysmgr_addr() + SYSMGR_SOC64_BOOT_SCRATCH_COLD1);
@@ -50,7 +51,7 @@ const unsigned int cm_get_intosc_clk_hz(void)
 const unsigned int cm_get_fpga_clk_hz(void)
 {
 #ifdef CONFIG_SPL_BUILD
-	u32 clock = readl(S10_HANDOFF_CLOCK_FPGA);
+	u32 clock = readl(HANDOFF_CLOCK_FPGA);
 
 	writel(clock,
 	       socfpga_get_sysmgr_addr() + SYSMGR_SOC64_BOOT_SCRATCH_COLD2);
Signature · 1 line
2.19.0
#13 lore raw

PATCH v8 13/19 ddr: altera: Restructure Stratix 10 SDRAM driver

In reply to Ley Foon Tan

Restructure Stratix 10 SDRAM driver. Move common code to separate file, in preparation to support SDRAM driver for Agilex.

---
v6:
- Remove compatible "intel,sdr-ctl-agilex" from this patch.

v3:
- Change sdram_common.* to sdram_soc64.*

---
 drivers/ddr/altera/Makefile                   |   2 +-
 drivers/ddr/altera/sdram_s10.c                | 296 +----------------
 drivers/ddr/altera/sdram_s10.h                | 148 +--------
 drivers/ddr/altera/sdram_soc64.c              | 303 ++++++++++++++++++
 .../ddr/altera/{sdram_s10.h => sdram_soc64.h} |  70 ++--
 5 files changed, 340 insertions(+), 479 deletions(-)
 create mode 100644 drivers/ddr/altera/sdram_soc64.c
 copy drivers/ddr/altera/{sdram_s10.h => sdram_soc64.h} (79%)
drivers/ddr/altera/Makefile +1 -1
index 341ac0d73b..eb8da13b7d 100644
@@ -9,5 +9,5 @@
 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_s10.o
+obj-$(CONFIG_TARGET_SOCFPGA_STRATIX10) += sdram_soc64.o sdram_s10.o
 endif
drivers/ddr/altera/sdram_s10.c +1 -295

330 lines not on this page · raw message

drivers/ddr/altera/sdram_s10.h +1 -147

159 lines not on this page · raw message

drivers/ddr/altera/sdram_soc64.c new file +303 -0

303 lines not on this page · raw message

drivers/ddr/altera/sdram_soc64.h renamed from drivers/ddr/altera/sdram_s10.h +34 -36

85 lines not on this page · raw message

Signature · 1 line
2.19.0
#14 lore raw

PATCH v8 14/19 ddr: altera: agilex: Add SDRAM driver for Agilex

In reply to Ley Foon Tan

Add SDRAM driver for Agilex SoC.

---
v6:
- Add compatible "intel,sdr-ctl-agilex".

v4:
- Fixed checkpatch warnings

v3:
- Use sdmmc_soc64.*
- Change compatible string to use "intel" (intel,sdr-ctl-agilex).
- Improve error handing if DDR size mismatched.

---
 drivers/ddr/altera/Kconfig        |   6 +-
 drivers/ddr/altera/Makefile       |   1 +
 drivers/ddr/altera/sdram_agilex.c | 168 ++++++++++++++++++++++++++++++
 drivers/ddr/altera/sdram_soc64.c  |   1 +
 drivers/ddr/altera/sdram_soc64.h  |   1 +
 5 files changed, 174 insertions(+), 3 deletions(-)
 create mode 100644 drivers/ddr/altera/sdram_agilex.c
drivers/ddr/altera/Kconfig +3 -3
index 2b1c1be3b5..8f590dc5f6 100644
@@ -1,8 +1,8 @@
 config SPL_ALTERA_SDRAM
 	bool "SoCFPGA DDR SDRAM driver in SPL"
 	depends on SPL
-	depends on TARGET_SOCFPGA_GEN5 || TARGET_SOCFPGA_ARRIA10 || TARGET_SOCFPGA_STRATIX10
-	select RAM if TARGET_SOCFPGA_GEN5 || TARGET_SOCFPGA_STRATIX10
-	select SPL_RAM if TARGET_SOCFPGA_GEN5 || TARGET_SOCFPGA_STRATIX10
+	depends on TARGET_SOCFPGA_GEN5 || TARGET_SOCFPGA_ARRIA10 || TARGET_SOCFPGA_STRATIX10 || TARGET_SOCFPGA_AGILEX
+	select RAM if TARGET_SOCFPGA_GEN5 || TARGET_SOCFPGA_STRATIX10 || TARGET_SOCFPGA_AGILEX
+	select SPL_RAM if TARGET_SOCFPGA_GEN5 || TARGET_SOCFPGA_STRATIX10 || TARGET_SOCFPGA_AGILEX
 	help
 	  Enable DDR SDRAM controller for the SoCFPGA devices.
drivers/ddr/altera/Makefile +1 -0
index eb8da13b7d..39dfee5d5a 100644
@@ -10,4 +10,5 @@ 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
 endif
drivers/ddr/altera/sdram_agilex.c new file +168 -0

168 lines not on this page · raw message

drivers/ddr/altera/sdram_soc64.c +1 -0
index 1ae088b547..e62f7d2c5d 100644
@@ -288,6 +288,7 @@ static struct ram_ops altera_sdram_ops = {
 
 static const struct udevice_id altera_sdram_ids[] = {
 	{ .compatible = "altr,sdr-ctl-s10" },
+	{ .compatible = "intel,sdr-ctl-agilex" },
 	{ /* sentinel */ }
 };
 
drivers/ddr/altera/sdram_soc64.h +1 -0
index 7d018e76d8..7b25a80ae2 100644
@@ -65,6 +65,7 @@ struct altera_sdram_platdata {
 /* HMC MMR IO48 registers */
 #define CTRLCFG0			0x28
 #define CTRLCFG1			0x2c
+#define CTRLCFG3                        0x34
 #define DRAMTIMING0			0x50
 #define CALTIMING0			0x7c
 #define CALTIMING1			0x80
Signature · 1 line
2.19.0
#15 lore raw

PATCH v8 15/19 board: intel: agilex: Add socdk board support for Intel Agilex SoC

In reply to Ley Foon Tan

Add socdk board support for Intel Agilex SoC

---
 board/intel/agilex-socdk/MAINTAINERS | 7 +++++++
 board/intel/agilex-socdk/Makefile    | 7 +++++++
 board/intel/agilex-socdk/socfpga.c   | 7 +++++++
 3 files changed, 21 insertions(+)
 create mode 100644 board/intel/agilex-socdk/MAINTAINERS
 create mode 100644 board/intel/agilex-socdk/Makefile
 create mode 100644 board/intel/agilex-socdk/socfpga.c
board/intel/agilex-socdk/MAINTAINERS new file +7 -0
new file mode 100644
index 0000000000..b8e28f0b24
@@ -0,0 +1,7 @@
+SOCFPGA BOARD
+M:	Ley Foon Tan <[email protected]>
+M:	Chee Hong Ang <[email protected]>
+S:	Maintained
+F:	board/intel/agilex-socdk/
+F:	include/configs/socfpga_agilex_socdk.h
+F:	configs/socfpga_agilex_defconfig
board/intel/agilex-socdk/Makefile new file +7 -0
new file mode 100644
index 0000000000..b86223a571
@@ -0,0 +1,7 @@
+#
+# Copyright (C) 2019 Intel Corporation <www.intel.com>
+#
+# SPDX-License-Identifier:	GPL-2.0
+#
+
+obj-y	:= socfpga.o
board/intel/agilex-socdk/socfpga.c new file +7 -0
new file mode 100644
index 0000000000..72a3e0836d
@@ -0,0 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (C) 2019 Intel Corporation <www.intel.com>
+ *
+ */
+
+#include <common.h>
Signature · 1 line
2.19.0
#16 lore raw

PATCH v8 16/19 arm: socfpga: agilex: Add SPL for Agilex SoC

In reply to Ley Foon Tan

Add SPL support for Agilex SoC.

---
v5:
- Probe CCU driver with DM method.

v4:
- Move spl_early_init() to entry of board_init_f
- Add socfpga_get_manager_addr().
- Remove SYSMGR_DMA and SYSMGR_DMA_PERIPH, already set in firewall_setup().

v2:
- Change clock driver probing to DM.
- Remove unused OSC1TIMER0 reset
- Remove debug_uart_init(). UART depends on clock driver setup, no point to call debug_uart_init() after spl_early_init() and clock driver initialization.

---
 arch/arm/mach-socfpga/Makefile     |  3 +
 arch/arm/mach-socfpga/spl_agilex.c | 98 ++++++++++++++++++++++++++++++
 2 files changed, 101 insertions(+)
 create mode 100644 arch/arm/mach-socfpga/spl_agilex.c
arch/arm/mach-socfpga/Makefile +3 -0
index a403b46b47..81b6ffc675 100644
@@ -58,6 +58,9 @@ ifdef CONFIG_TARGET_SOCFPGA_STRATIX10
 obj-y	+= firewall.o
 obj-y	+= spl_s10.o
 endif
+ifdef CONFIG_TARGET_SOCFPGA_AGILEX
+obj-y	+= spl_agilex.o
+endif
 endif
 
 ifdef CONFIG_TARGET_SOCFPGA_GEN5
arch/arm/mach-socfpga/spl_agilex.c new file +98 -0

98 lines not on this page · raw message

Signature · 1 line
2.19.0
#17 lore raw

PATCH v8 17/19 arm: dts: agilex: Add base dtsi and devkit dts

In reply to Ley Foon Tan

Add device tree files for Agilex SoC platform.

socfpga_agilex-u-boot.dtsi and socfpga_agilex_socdk-u-boot.dts contains Uboot specific DT properties.

socfpga_agilex.dtsi and socfpga_agilex_socdk.dts are from Linux (kernel/git/dinguyen/linux.git, commit 6f0bf971bacacc)

---
v8:
- Include socfpga_agilex-u-boot.dtsi in socfpga_agilex_socdk-u-boot.dtsi, instead of include it in socfpga_agilex_socdk.dts.

v7:
- Update socfpga_agilex.dtsi and socfpga_agilex_socdk.dts from Linux.
- Add new socfpga_agilex_socdk-u-boot.dts file for Uboot specific DT properties.

v6:
- Use new macro names from agilex-clock.h.

v5:
- Add CCU DT node.

v4:
- Add u-boot,dm-pre-reloc to sysmgr node.

v3:
- Fixed bank 1 memory alias base address to 0x280000000.
- Rename STRATIX10_*_CLK to SOCFPGA_SOC64_*_CLK.
- Include socfpga-soc64-clock.h
- Change to "intel,sdr-ctl-agilex" for SDRAM node.

v2:
- Add clock property to device node.
- Change memory size to 8GB
- Enable i2c1

---
 arch/arm/dts/Makefile                         |   1 +
 arch/arm/dts/socfpga_agilex-u-boot.dtsi       |  96 +++
 arch/arm/dts/socfpga_agilex.dtsi              | 622 ++++++++++++++++++
 arch/arm/dts/socfpga_agilex_socdk-u-boot.dtsi |  39 ++
 arch/arm/dts/socfpga_agilex_socdk.dts         | 141 ++++
 5 files changed, 899 insertions(+)
 create mode 100644 arch/arm/dts/socfpga_agilex-u-boot.dtsi
 create mode 100644 arch/arm/dts/socfpga_agilex.dtsi
 create mode 100644 arch/arm/dts/socfpga_agilex_socdk-u-boot.dtsi
 create mode 100644 arch/arm/dts/socfpga_agilex_socdk.dts
arch/arm/dts/Makefile +1 -0
index d8846df1bd..e76f7c1407 100644
@@ -328,6 +328,7 @@ dtb-$(CONFIG_TI816X) += dm8168-evm.dtb
 dtb-$(CONFIG_THUNDERX) += thunderx-88xx.dtb
 
 dtb-$(CONFIG_ARCH_SOCFPGA) +=				\
+	socfpga_agilex_socdk.dtb			\
 	socfpga_arria5_socdk.dtb			\
 	socfpga_arria10_socdk_sdmmc.dtb			\
 	socfpga_cyclone5_mcvevk.dtb			\
arch/arm/dts/socfpga_agilex-u-boot.dtsi new file +96 -0

96 lines not on this page · raw message

arch/arm/dts/socfpga_agilex.dtsi new file +622 -0

622 lines not on this page · raw message

arch/arm/dts/socfpga_agilex_socdk-u-boot.dtsi new file +39 -0
new file mode 100644
index 0000000000..1908be4b8b
@@ -0,0 +1,39 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * U-Boot additions
+ *
+ * Copyright (C) 2019 Intel Corporation <www.intel.com>
+ */
+
+#include "socfpga_agilex-u-boot.dtsi"
+
+/{
+	aliases {
+		spi0 = &qspi;
+		i2c0 = &i2c1;
+	};
+
+	memory {
+		/* 8GB */
+		reg = <0 0x00000000 0 0x80000000>,
+		      <2 0x80000000 1 0x80000000>;
+	};
+};
+
+&flash0 {
+	compatible = "jedec,spi-nor";
+	spi-tx-bus-width = <4>;
+	spi-rx-bus-width = <4>;
+	u-boot,dm-pre-reloc;
+};
+
+&i2c1 {
+	status = "okay";
+};
+
+&mmc {
+	drvsel = <3>;
+	smplsel = <0>;
+	u-boot,dm-pre-reloc;
+};
+
arch/arm/dts/socfpga_agilex_socdk.dts new file +141 -0

141 lines not on this page · raw message

Signature · 1 line
2.19.0
#18 lore raw

PATCH v8 17/19 arm: dts: agilex: Add base dtsi and devkit dts

Quoted 131 lines · Ley Foon Tan

Add device tree files for Agilex SoC platform.

socfpga_agilex-u-boot.dtsi and socfpga_agilex_socdk-u-boot.dts contains Uboot specific DT properties.

socfpga_agilex.dtsi and socfpga_agilex_socdk.dts are from Linux (kernel/git/dinguyen/linux.git, commit 6f0bf971bacacc)

---
v8:
- Include socfpga_agilex-u-boot.dtsi in socfpga_agilex_socdk-u-boot.dtsi, instead of include it in socfpga_agilex_socdk.dts.

v7:
- Update socfpga_agilex.dtsi and socfpga_agilex_socdk.dts from Linux.
- Add new socfpga_agilex_socdk-u-boot.dts file for Uboot specific DT properties.

v6:
- Use new macro names from agilex-clock.h.

v5:
- Add CCU DT node.

v4:
- Add u-boot,dm-pre-reloc to sysmgr node.

v3:
- Fixed bank 1 memory alias base address to 0x280000000.
- Rename STRATIX10_*_CLK to SOCFPGA_SOC64_*_CLK.
- Include socfpga-soc64-clock.h
- Change to "intel,sdr-ctl-agilex" for SDRAM node.

v2:
- Add clock property to device node.
- Change memory size to 8GB
- Enable i2c1

---
 arch/arm/dts/Makefile                         |   1 +
 arch/arm/dts/socfpga_agilex-u-boot.dtsi       |  96 +++
 arch/arm/dts/socfpga_agilex.dtsi              | 622 ++++++++++++++++++
 arch/arm/dts/socfpga_agilex_socdk-u-boot.dtsi |  39 ++
 arch/arm/dts/socfpga_agilex_socdk.dts         | 141 ++++
 5 files changed, 899 insertions(+)
 create mode 100644 arch/arm/dts/socfpga_agilex-u-boot.dtsi
 create mode 100644 arch/arm/dts/socfpga_agilex.dtsi
 create mode 100644 arch/arm/dts/socfpga_agilex_socdk-u-boot.dtsi
 create mode 100644 arch/arm/dts/socfpga_agilex_socdk.dts
arch/arm/dts/Makefile +1 -0
index d8846df1bd..e76f7c1407 100644
@@ -328,6 +328,7 @@ dtb-$(CONFIG_TI816X) += dm8168-evm.dtb
 dtb-$(CONFIG_THUNDERX) += thunderx-88xx.dtb
 
 dtb-$(CONFIG_ARCH_SOCFPGA) +=                          \
+       socfpga_agilex_socdk.dtb                        \
        socfpga_arria5_socdk.dtb                        \
        socfpga_arria10_socdk_sdmmc.dtb                 \
        socfpga_cyclone5_mcvevk.dtb                     \
arch/arm/dts/socfpga_agilex-u-boot.dtsi new file +61 -0
new file mode 100644
index 0000000000..f0528a9ad9
@@ -0,0 +1,96 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * U-Boot additions
+ *
+ * Copyright (C) 2019 Intel Corporation <www.intel.com>
+ */
+
+/{
+       memory {
+               #address-cells = <2>;
+               #size-cells = <2>;
+               u-boot,dm-pre-reloc;
+       };
+
+       soc {
+               u-boot,dm-pre-reloc;
+
+               ccu: cache-controller at f7000000 {
+                       compatible = "arteris,ncore-ccu";
+                       reg = <0xf7000000 0x100900>;
+                       u-boot,dm-pre-reloc;
+               };
+       };
+};
+
+&clkmgr {
+       u-boot,dm-pre-reloc;
+};
+
+&gmac1 {
+       altr,sysmgr-syscon = <&sysmgr 0x48 0>;
+};
+
+&gmac2 {
+       altr,sysmgr-syscon = <&sysmgr 0x4c 0>;
+};
+
+&i2c0 {
+       reset-names = "i2c";
+};
+
+&i2c1 {
+       reset-names = "i2c";
+};
+
+&i2c2 {
+       reset-names = "i2c";
+};
+
+&i2c3 {
+       reset-names = "i2c";
+};
+
+&mmc {
+       resets = <&rst SDMMC_RESET>, <&rst SDMMC_OCP_RESET>;
+};
+
+&porta {
+       bank-name = "porta";
+};
+

arch/arm/dts/socfpga_agilex-u-boot.dtsi line 71

Quoted 10 lines
arch/arm/dts/socfpga_agilex-u-boot.dtsi new file +10 -0
+&portb {
+       bank-name = "portb";
+};
+
+&qspi {
+       u-boot,dm-pre-reloc;
+};
+
+&rst {
+       compatible = "altr,rst-mgr";

This and other compatible-changing lines in this file should be synced to the correct string in all DTs, so please fix this in the upstream Linux DTs.

arch/arm/dts/socfpga_agilex-u-boot.dtsi line 77

Quoted 6 lines
arch/arm/dts/socfpga_agilex-u-boot.dtsi new file +6 -0
+       altr,modrst-offset = <0x20>;
+       u-boot,dm-pre-reloc;
+};
+
+&sdr {
+       compatible = "intel,sdr-ctl-agilex";

See above.

arch/arm/dts/socfpga_agilex-u-boot.dtsi line 86

Quoted 9 lines
arch/arm/dts/socfpga_agilex-u-boot.dtsi new file +9 -0
+       reg = <0xf8000400 0x80>,
+             <0xf8010000 0x190>,
+             <0xf8011000 0x500>;
+       resets = <&rst DDRSCH_RESET>;
+       u-boot,dm-pre-reloc;
+};
+
+&sysmgr {
+       compatible = "altr,sys-mgr", "syscon";

See above.

Ultimately, you should onle need 'u-boot,dm-pre-reloc' tags in this file and probably some boot source defititions.

However, until that is done, it's probably ok to have this here, so:

Quoted 833 lines
arch/arm/dts/socfpga_agilex-u-boot.dtsi new file +10 -0
+       u-boot,dm-pre-reloc;
+};
+
+&uart0 {
+       u-boot,dm-pre-reloc;
+};
+
+&watchdog0 {
+       u-boot,dm-pre-reloc;
+};
arch/arm/dts/socfpga_agilex.dtsi new file +622 -0
new file mode 100644
index 0000000000..179b4d5591
@@ -0,0 +1,622 @@
+// SPDX-License-Identifier:     GPL-2.0
+/*
+ * Copyright (C) 2019, Intel Corporation
+ */
+
+/dts-v1/;
+#include <dt-bindings/reset/altr,rst-mgr-s10.h>
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/clock/agilex-clock.h>
+
+/ {
+       compatible = "intel,socfpga-agilex";
+       #address-cells = <2>;
+       #size-cells = <2>;
+
+       reserved-memory {
+               #address-cells = <2>;
+               #size-cells = <2>;
+               ranges;
+
+               service_reserved: svcbuffer at 0 {
+                       compatible = "shared-dma-pool";
+                       reg = <0x0 0x0 0x0 0x1000000>;
+                       alignment = <0x1000>;
+                       no-map;
+               };
+       };
+
+       cpus {
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               cpu0: cpu at 0 {
+                       compatible = "arm,cortex-a53";
+                       device_type = "cpu";
+                       enable-method = "psci";
+                       reg = <0x0>;
+               };
+
+               cpu1: cpu at 1 {
+                       compatible = "arm,cortex-a53";
+                       device_type = "cpu";
+                       enable-method = "psci";
+                       reg = <0x1>;
+               };
+
+               cpu2: cpu at 2 {
+                       compatible = "arm,cortex-a53";
+                       device_type = "cpu";
+                       enable-method = "psci";
+                       reg = <0x2>;
+               };
+
+               cpu3: cpu at 3 {
+                       compatible = "arm,cortex-a53";
+                       device_type = "cpu";
+                       enable-method = "psci";
+                       reg = <0x3>;
+               };
+       };
+
+       pmu {
+               compatible = "arm,armv8-pmuv3";
+               interrupts = <0 170 4>,
+                            <0 171 4>,
+                            <0 172 4>,
+                            <0 173 4>;
+               interrupt-affinity = <&cpu0>,
+                                    <&cpu1>,
+                                    <&cpu2>,
+                                    <&cpu3>;
+               interrupt-parent = <&intc>;
+       };
+
+       psci {
+               compatible = "arm,psci-0.2";
+               method = "smc";
+       };
+
+       intc: intc at fffc1000 {
+               compatible = "arm,gic-400", "arm,cortex-a15-gic";
+               #interrupt-cells = <3>;
+               interrupt-controller;
+               reg = <0x0 0xfffc1000 0x0 0x1000>,
+                     <0x0 0xfffc2000 0x0 0x2000>,
+                     <0x0 0xfffc4000 0x0 0x2000>,
+                     <0x0 0xfffc6000 0x0 0x2000>;
+       };
+
+       soc {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               compatible = "simple-bus";
+               device_type = "soc";
+               interrupt-parent = <&intc>;
+               ranges = <0 0 0 0xffffffff>;
+
+               base_fpga_region {
+                       #address-cells = <0x1>;
+                       #size-cells = <0x1>;
+                       compatible = "fpga-region";
+                       fpga-mgr = <&fpga_mgr>;
+               };
+
+               clkmgr: clock-controller at ffd10000 {
+                       compatible = "intel,agilex-clkmgr";
+                       reg = <0xffd10000 0x1000>;
+                       #clock-cells = <1>;
+               };
+
+               clocks {
+                       cb_intosc_hs_div2_clk: cb-intosc-hs-div2-clk {
+                               #clock-cells = <0>;
+                               compatible = "fixed-clock";
+                       };
+
+                       cb_intosc_ls_clk: cb-intosc-ls-clk {
+                               #clock-cells = <0>;
+                               compatible = "fixed-clock";
+                       };
+
+                       f2s_free_clk: f2s-free-clk {
+                               #clock-cells = <0>;
+                               compatible = "fixed-clock";
+                       };
+
+                       osc1: osc1 {
+                               #clock-cells = <0>;
+                               compatible = "fixed-clock";
+                       };
+
+                       qspi_clk: qspi-clk {
+                               #clock-cells = <0>;
+                               compatible = "fixed-clock";
+                               clock-frequency = <200000000>;
+                       };
+               };
+               gmac0: ethernet at ff800000 {
+                       compatible = "altr,socfpga-stmmac", "snps,dwmac-3.74a", "snps,dwmac";
+                       reg = <0xff800000 0x2000>;
+                       interrupts = <0 90 4>;
+                       interrupt-names = "macirq";
+                       mac-address = [00 00 00 00 00 00];
+                       resets = <&rst EMAC0_RESET>, <&rst EMAC0_OCP_RESET>;
+                       reset-names = "stmmaceth", "stmmaceth-ocp";
+                       tx-fifo-depth = <16384>;
+                       rx-fifo-depth = <16384>;
+                       snps,multicast-filter-bins = <256>;
+                       iommus = <&smmu 1>;
+                       altr,sysmgr-syscon = <&sysmgr 0x44 0>;
+                       clocks = <&clkmgr AGILEX_EMAC0_CLK>;
+                       clock-names = "stmmaceth";
+                       status = "disabled";
+               };
+
+               gmac1: ethernet at ff802000 {
+                       compatible = "altr,socfpga-stmmac", "snps,dwmac-3.74a", "snps,dwmac";
+                       reg = <0xff802000 0x2000>;
+                       interrupts = <0 91 4>;
+                       interrupt-names = "macirq";
+                       mac-address = [00 00 00 00 00 00];
+                       resets = <&rst EMAC1_RESET>, <&rst EMAC1_OCP_RESET>;
+                       reset-names = "stmmaceth", "stmmaceth-ocp";
+                       tx-fifo-depth = <16384>;
+                       rx-fifo-depth = <16384>;
+                       snps,multicast-filter-bins = <256>;
+                       iommus = <&smmu 2>;
+                       altr,sysmgr-syscon = <&sysmgr 0x48 8>;
+                       clocks = <&clkmgr AGILEX_EMAC1_CLK>;
+                       clock-names = "stmmaceth";
+                       status = "disabled";
+               };
+
+               gmac2: ethernet at ff804000 {
+                       compatible = "altr,socfpga-stmmac", "snps,dwmac-3.74a", "snps,dwmac";
+                       reg = <0xff804000 0x2000>;
+                       interrupts = <0 92 4>;
+                       interrupt-names = "macirq";
+                       mac-address = [00 00 00 00 00 00];
+                       resets = <&rst EMAC2_RESET>, <&rst EMAC2_OCP_RESET>;
+                       reset-names = "stmmaceth", "stmmaceth-ocp";
+                       tx-fifo-depth = <16384>;
+                       rx-fifo-depth = <16384>;
+                       snps,multicast-filter-bins = <256>;
+                       iommus = <&smmu 3>;
+                       altr,sysmgr-syscon = <&sysmgr 0x4c 16>;
+                       clocks = <&clkmgr AGILEX_EMAC2_CLK>;
+                       clock-names = "stmmaceth";
+                       status = "disabled";
+               };
+
+               gpio0: gpio at ffc03200 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "snps,dw-apb-gpio";
+                       reg = <0xffc03200 0x100>;
+                       resets = <&rst GPIO0_RESET>;
+                       status = "disabled";
+
+                       porta: gpio-controller at 0 {
+                               compatible = "snps,dw-apb-gpio-port";
+                               gpio-controller;
+                               #gpio-cells = <2>;
+                               snps,nr-gpios = <24>;
+                               reg = <0>;
+                               interrupt-controller;
+                               #interrupt-cells = <2>;
+                               interrupts = <0 110 4>;
+                       };
+               };
+
+               gpio1: gpio at ffc03300 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "snps,dw-apb-gpio";
+                       reg = <0xffc03300 0x100>;
+                       resets = <&rst GPIO1_RESET>;
+                       status = "disabled";
+
+                       portb: gpio-controller at 0 {
+                               compatible = "snps,dw-apb-gpio-port";
+                               gpio-controller;
+                               #gpio-cells = <2>;
+                               snps,nr-gpios = <24>;
+                               reg = <0>;
+                               interrupt-controller;
+                               #interrupt-cells = <2>;
+                               interrupts = <0 111 4>;
+                       };
+               };
+
+               i2c0: i2c at ffc02800 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "snps,designware-i2c";
+                       reg = <0xffc02800 0x100>;
+                       interrupts = <0 103 4>;
+                       resets = <&rst I2C0_RESET>;
+                       clocks = <&clkmgr AGILEX_L4_SP_CLK>;
+                       status = "disabled";
+               };
+
+               i2c1: i2c at ffc02900 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "snps,designware-i2c";
+                       reg = <0xffc02900 0x100>;
+                       interrupts = <0 104 4>;
+                       resets = <&rst I2C1_RESET>;
+                       clocks = <&clkmgr AGILEX_L4_SP_CLK>;
+                       status = "disabled";
+               };
+
+               i2c2: i2c at ffc02a00 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "snps,designware-i2c";
+                       reg = <0xffc02a00 0x100>;
+                       interrupts = <0 105 4>;
+                       resets = <&rst I2C2_RESET>;
+                       clocks = <&clkmgr AGILEX_L4_SP_CLK>;
+                       status = "disabled";
+               };
+
+               i2c3: i2c at ffc02b00 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "snps,designware-i2c";
+                       reg = <0xffc02b00 0x100>;
+                       interrupts = <0 106 4>;
+                       resets = <&rst I2C3_RESET>;
+                       clocks = <&clkmgr AGILEX_L4_SP_CLK>;
+                       status = "disabled";
+               };
+
+               i2c4: i2c at ffc02c00 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "snps,designware-i2c";
+                       reg = <0xffc02c00 0x100>;
+                       interrupts = <0 107 4>;
+                       resets = <&rst I2C4_RESET>;
+                       clocks = <&clkmgr AGILEX_L4_SP_CLK>;
+                       status = "disabled";
+               };
+
+               mmc: dwmmc0 at ff808000 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "altr,socfpga-dw-mshc";
+                       reg = <0xff808000 0x1000>;
+                       interrupts = <0 96 4>;
+                       fifo-depth = <0x400>;
+                       resets = <&rst SDMMC_RESET>;
+                       reset-names = "reset";
+                       clocks = <&clkmgr AGILEX_L4_MP_CLK>,
+                                <&clkmgr AGILEX_SDMMC_CLK>;
+                       clock-names = "biu", "ciu";
+                       iommus = <&smmu 5>;
+                       status = "disabled";
+               };
+
+               nand: nand at ffb90000 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "altr,socfpga-denali-nand";
+                       reg = <0xffb90000 0x10000>,
+                             <0xffb80000 0x1000>;
+                       reg-names = "nand_data", "denali_reg";
+                       interrupts = <0 97 4>;
+                       resets = <&rst NAND_RESET>, <&rst NAND_OCP_RESET>;
+                       status = "disabled";
+               };
+
+               ocram: sram at ffe00000 {
+                       compatible = "mmio-sram";
+                       reg = <0xffe00000 0x40000>;
+               };
+
+               pdma: pdma at ffda0000 {
+                       compatible = "arm,pl330", "arm,primecell";
+                       reg = <0xffda0000 0x1000>;
+                       interrupts = <0 81 4>,
+                                    <0 82 4>,
+                                    <0 83 4>,
+                                    <0 84 4>,
+                                    <0 85 4>,
+                                    <0 86 4>,
+                                    <0 87 4>,
+                                    <0 88 4>,
+                                    <0 89 4>;
+                       #dma-cells = <1>;
+                       #dma-channels = <8>;
+                       #dma-requests = <32>;
+                       resets = <&rst DMA_RESET>, <&rst DMA_OCP_RESET>;
+                       reset-names = "dma", "dma-ocp";
+                       clocks = <&clkmgr AGILEX_L4_MAIN_CLK>;
+                       clock-names = "apb_pclk";
+               };
+
+               rst: rstmgr at ffd11000 {
+                       #reset-cells = <1>;
+                       compatible = "altr,stratix10-rst-mgr";
+                       reg = <0xffd11000 0x100>;
+               };
+
+               smmu: iommu at fa000000 {
+                       compatible = "arm,mmu-500", "arm,smmu-v2";
+                       reg = <0xfa000000 0x40000>;
+                       #global-interrupts = <2>;
+                       #iommu-cells = <1>;
+                       interrupt-parent = <&intc>;
+                       interrupts = <0 128 4>, /* Global Secure Fault */
+                               <0 129 4>, /* Global Non-secure Fault */
+                               /* Non-secure Context Interrupts (32) */
+                               <0 138 4>, <0 139 4>, <0 140 4>, <0 141 4>,
+                               <0 142 4>, <0 143 4>, <0 144 4>, <0 145 4>,
+                               <0 146 4>, <0 147 4>, <0 148 4>, <0 149 4>,
+                               <0 150 4>, <0 151 4>, <0 152 4>, <0 153 4>,
+                               <0 154 4>, <0 155 4>, <0 156 4>, <0 157 4>,
+                               <0 158 4>, <0 159 4>, <0 160 4>, <0 161 4>,
+                               <0 162 4>, <0 163 4>, <0 164 4>, <0 165 4>,
+                               <0 166 4>, <0 167 4>, <0 168 4>, <0 169 4>;
+                       stream-match-mask = <0x7ff0>;
+                       status = "disabled";
+               };
+
+               spi0: spi at ffda4000 {
+                       compatible = "snps,dw-apb-ssi";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <0xffda4000 0x1000>;
+                       interrupts = <0 99 4>;
+                       resets = <&rst SPIM0_RESET>;
+                       reg-io-width = <4>;
+                       num-cs = <4>;
+                       clocks = <&clkmgr AGILEX_L4_MAIN_CLK>;
+                       status = "disabled";
+               };
+
+               spi1: spi at ffda5000 {
+                       compatible = "snps,dw-apb-ssi";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <0xffda5000 0x1000>;
+                       interrupts = <0 100 4>;
+                       resets = <&rst SPIM1_RESET>;
+                       reg-io-width = <4>;
+                       num-cs = <4>;
+                       clocks = <&clkmgr AGILEX_L4_MAIN_CLK>;
+                       status = "disabled";
+               };
+
+               sysmgr: sysmgr at ffd12000 {
+                       compatible = "altr,sys-mgr-s10","altr,sys-mgr";
+                       reg = <0xffd12000 0x500>;
+               };
+
+               /* Local timer */
+               timer {
+                       compatible = "arm,armv8-timer";
+                       interrupts = <1 13 0xf08>,
+                                    <1 14 0xf08>,
+                                    <1 11 0xf08>,
+                                    <1 10 0xf08>;
+               };
+
+               timer0: timer0 at ffc03000 {
+                       compatible = "snps,dw-apb-timer";
+                       interrupts = <0 113 4>;
+                       reg = <0xffc03000 0x100>;
+                       clocks = <&clkmgr AGILEX_L4_SP_CLK>;
+                       clock-names = "timer";
+               };
+
+               timer1: timer1 at ffc03100 {
+                       compatible = "snps,dw-apb-timer";
+                       interrupts = <0 114 4>;
+                       reg = <0xffc03100 0x100>;
+                       clocks = <&clkmgr AGILEX_L4_SP_CLK>;
+                       clock-names = "timer";
+               };
+
+               timer2: timer2 at ffd00000 {
+                       compatible = "snps,dw-apb-timer";
+                       interrupts = <0 115 4>;
+                       reg = <0xffd00000 0x100>;
+                       clocks = <&clkmgr AGILEX_L4_SP_CLK>;
+                       clock-names = "timer";
+               };
+
+               timer3: timer3 at ffd00100 {
+                       compatible = "snps,dw-apb-timer";
+                       interrupts = <0 116 4>;
+                       reg = <0xffd00100 0x100>;
+                       clocks = <&clkmgr AGILEX_L4_SP_CLK>;
+                       clock-names = "timer";
+               };
+
+               uart0: serial0 at ffc02000 {
+                       compatible = "snps,dw-apb-uart";
+                       reg = <0xffc02000 0x100>;
+                       interrupts = <0 108 4>;
+                       reg-shift = <2>;
+                       reg-io-width = <4>;
+                       resets = <&rst UART0_RESET>;
+                       status = "disabled";
+                       clocks = <&clkmgr AGILEX_L4_SP_CLK>;
+                       clock-frequency = <100000000>;
+               };
+
+               uart1: serial1 at ffc02100 {
+                       compatible = "snps,dw-apb-uart";
+                       reg = <0xffc02100 0x100>;
+                       interrupts = <0 109 4>;
+                       reg-shift = <2>;
+                       reg-io-width = <4>;
+                       resets = <&rst UART1_RESET>;
+                       clocks = <&clkmgr AGILEX_L4_SP_CLK>;
+                       status = "disabled";
+               };
+
+               usbphy0: usbphy at 0 {
+                       #phy-cells = <0>;
+                       compatible = "usb-nop-xceiv";
+                       status = "okay";
+               };
+
+               usb0: usb at ffb00000 {
+                       compatible = "snps,dwc2";
+                       reg = <0xffb00000 0x40000>;
+                       interrupts = <0 93 4>;
+                       phys = <&usbphy0>;
+                       phy-names = "usb2-phy";
+                       resets = <&rst USB0_RESET>, <&rst USB0_OCP_RESET>;
+                       reset-names = "dwc2", "dwc2-ecc";
+                       clocks = <&clkmgr AGILEX_USB_CLK>;
+                       iommus = <&smmu 6>;
+                       status = "disabled";
+               };
+
+               usb1: usb at ffb40000 {
+                       compatible = "snps,dwc2";
+                       reg = <0xffb40000 0x40000>;
+                       interrupts = <0 94 4>;
+                       phys = <&usbphy0>;
+                       phy-names = "usb2-phy";
+                       resets = <&rst USB1_RESET>, <&rst USB1_OCP_RESET>;
+                       reset-names = "dwc2", "dwc2-ecc";
+                       iommus = <&smmu 7>;
+                       clocks = <&clkmgr AGILEX_USB_CLK>;
+                       status = "disabled";
+               };
+
+               watchdog0: watchdog at ffd00200 {
+                       compatible = "snps,dw-wdt";
+                       reg = <0xffd00200 0x100>;
+                       interrupts = <0 117 4>;
+                       resets = <&rst WATCHDOG0_RESET>;
+                       clocks = <&clkmgr AGILEX_L4_SYS_FREE_CLK>;
+                       status = "disabled";
+               };
+
+               watchdog1: watchdog at ffd00300 {
+                       compatible = "snps,dw-wdt";
+                       reg = <0xffd00300 0x100>;
+                       interrupts = <0 118 4>;
+                       resets = <&rst WATCHDOG1_RESET>;
+                       clocks = <&clkmgr AGILEX_L4_SYS_FREE_CLK>;
+                       status = "disabled";
+               };
+
+               watchdog2: watchdog at ffd00400 {
+                       compatible = "snps,dw-wdt";
+                       reg = <0xffd00400 0x100>;
+                       interrupts = <0 125 4>;
+                       resets = <&rst WATCHDOG2_RESET>;
+                       clocks = <&clkmgr AGILEX_L4_SYS_FREE_CLK>;
+                       status = "disabled";
+               };
+
+               watchdog3: watchdog at ffd00500 {
+                       compatible = "snps,dw-wdt";
+                       reg = <0xffd00500 0x100>;
+                       interrupts = <0 126 4>;
+                       resets = <&rst WATCHDOG3_RESET>;
+                       clocks = <&clkmgr AGILEX_L4_SYS_FREE_CLK>;
+                       status = "disabled";
+               };
+
+               sdr: sdr at f8011100 {
+                       compatible = "altr,sdr-ctl", "syscon";
+                       reg = <0xf8011100 0xc0>;
+               };
+
+               eccmgr {
+                       compatible = "altr,socfpga-s10-ecc-manager",
+                                    "altr,socfpga-a10-ecc-manager";
+                       altr,sysmgr-syscon = <&sysmgr>;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       interrupts = <0 15 4>;
+                       interrupt-controller;
+                       #interrupt-cells = <2>;
+                       ranges;
+
+                       sdramedac {
+                               compatible = "altr,sdram-edac-s10";
+                               altr,sdr-syscon = <&sdr>;
+                               interrupts = <16 4>;
+                       };
+
+                       ocram-ecc at ff8cc000 {
+                               compatible = "altr,socfpga-s10-ocram-ecc",
+                                            "altr,socfpga-a10-ocram-ecc";
+                               reg = <0xff8cc000 0x100>;
+                               altr,ecc-parent = <&ocram>;
+                               interrupts = <1 4>;
+                       };
+
+                       usb0-ecc at ff8c4000 {
+                               compatible = "altr,socfpga-s10-usb-ecc",
+                                            "altr,socfpga-usb-ecc";
+                               reg = <0xff8c4000 0x100>;
+                               altr,ecc-parent = <&usb0>;
+                               interrupts = <2 4>;
+                       };
+
+                       emac0-rx-ecc at ff8c0000 {
+                               compatible = "altr,socfpga-s10-eth-mac-ecc",
+                                            "altr,socfpga-eth-mac-ecc";
+                               reg = <0xff8c0000 0x100>;
+                               altr,ecc-parent = <&gmac0>;
+                               interrupts = <4 4>;
+                       };
+
+                       emac0-tx-ecc at ff8c0400 {
+                               compatible = "altr,socfpga-s10-eth-mac-ecc",
+                                            "altr,socfpga-eth-mac-ecc";
+                               reg = <0xff8c0400 0x100>;
+                               altr,ecc-parent = <&gmac0>;
+                               interrupts = <5 4>;
+                       };
+
+                       sdmmca-ecc at ff8c8c00 {
+                               compatible = "altr,socfpga-s10-sdmmc-ecc",
+                                            "altr,socfpga-sdmmc-ecc";
+                               reg = <0xff8c8c00 0x100>;
+                               altr,ecc-parent = <&mmc>;
+                               interrupts = <14 4>,
+                                            <15 4>;
+                       };
+               };
+
+               qspi: spi at ff8d2000 {
+                       compatible = "cdns,qspi-nor";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <0xff8d2000 0x100>,
+                             <0xff900000 0x100000>;
+                       interrupts = <0 3 4>;
+                       cdns,fifo-depth = <128>;
+                       cdns,fifo-width = <4>;
+                       cdns,trigger-address = <0x00000000>;
+                       clocks = <&qspi_clk>;
+
+                       status = "disabled";
+               };
+
+               firmware {
+                       svc {
+                               compatible = "intel,stratix10-svc";
+                               method = "smc";
+                               memory-region = <&service_reserved>;
+
+                               fpga_mgr: fpga-mgr {
+                                       compatible = "intel,stratix10-soc-fpga-mgr";
+                               };
+                       };
+               };
+       };
+};
arch/arm/dts/socfpga_agilex_socdk-u-boot.dtsi new file +39 -0
new file mode 100644
index 0000000000..1908be4b8b
@@ -0,0 +1,39 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * U-Boot additions
+ *
+ * Copyright (C) 2019 Intel Corporation <www.intel.com>
+ */
+
+#include "socfpga_agilex-u-boot.dtsi"
+
+/{
+       aliases {
+               spi0 = &qspi;
+               i2c0 = &i2c1;
+       };
+
+       memory {
+               /* 8GB */
+               reg = <0 0x00000000 0 0x80000000>,
+                     <2 0x80000000 1 0x80000000>;
+       };
+};
+
+&flash0 {
+       compatible = "jedec,spi-nor";
+       spi-tx-bus-width = <4>;
+       spi-rx-bus-width = <4>;
+       u-boot,dm-pre-reloc;
+};
+
+&i2c1 {
+       status = "okay";
+};
+
+&mmc {
+       drvsel = <3>;
+       smplsel = <0>;
+       u-boot,dm-pre-reloc;
+};
+
arch/arm/dts/socfpga_agilex_socdk.dts new file +141 -1
new file mode 100644
index 0000000000..bcdeecc0e0
@@ -0,0 +1,141 @@
+// SPDX-License-Identifier:     GPL-2.0
+/*
+ * Copyright (C) 2019, Intel Corporation
+ */
+#include "socfpga_agilex.dtsi"
+
+/ {
+       model = "SoCFPGA Agilex SoCDK";
+
+       aliases {
+               serial0 = &uart0;
+               ethernet0 = &gmac0;
+               ethernet1 = &gmac1;
+               ethernet2 = &gmac2;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+
+       leds {
+               compatible = "gpio-leds";
+               hps0 {
+                       label = "hps_led0";
+                       gpios = <&portb 20 GPIO_ACTIVE_HIGH>;
+               };
+
+               hps1 {
+                       label = "hps_led1";
+                       gpios = <&portb 19 GPIO_ACTIVE_HIGH>;
+               };
+
+               hps2 {
+                       label = "hps_led2";
+                       gpios = <&portb 21 GPIO_ACTIVE_HIGH>;
+               };
+       };
+
+       memory {
+               device_type = "memory";
+               /* We expect the bootloader to fill in the reg */
+               reg = <0 0 0 0>;
+       };
+
+       soc {
+               clocks {
+                       osc1 {
+                               clock-frequency = <25000000>;
+                       };
+               };
+       };
+};
+
+&gpio1 {
+       status = "okay";
+};
+
+&gmac0 {
+       status = "okay";
+       phy-mode = "rgmii";
+       phy-handle = <&phy0>;
+
+       max-frame-size = <9000>;
+
+       mdio0 {
+               #address-cells = <1>;
+               #size-cells = <0>;
+               compatible = "snps,dwmac-mdio";
+               phy0: ethernet-phy at 0 {
+                       reg = <4>;
+
+                       txd0-skew-ps = <0>; /* -420ps */
+                       txd1-skew-ps = <0>; /* -420ps */
+                       txd2-skew-ps = <0>; /* -420ps */
+                       txd3-skew-ps = <0>; /* -420ps */
+                       rxd0-skew-ps = <420>; /* 0ps */
+                       rxd1-skew-ps = <420>; /* 0ps */
+                       rxd2-skew-ps = <420>; /* 0ps */
+                       rxd3-skew-ps = <420>; /* 0ps */
+                       txen-skew-ps = <0>; /* -420ps */
+                       txc-skew-ps = <900>; /* 0ps */
+                       rxdv-skew-ps = <420>; /* 0ps */
+                       rxc-skew-ps = <1680>; /* 780ps */
+               };
+       };
+};
+
+&mmc {
+       status = "okay";
+       cap-sd-highspeed;
+       broken-cd;
+       bus-width = <4>;
+};
+
+&uart0 {
+       status = "okay";
+};
+
+&usb0 {
+       status = "okay";
+       disable-over-current;
+};
+
+&watchdog0 {
+       status = "okay";
+};
+
+&qspi {
+       flash0: flash at 0 {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               compatible = "mt25qu02g";
+               reg = <0>;
+               spi-max-frequency = <100000000>;
+
+               m25p,fast-read;
+               cdns,page-size = <256>;
+               cdns,block-size = <16>;
+               cdns,read-delay = <1>;
+               cdns,tshsl-ns = <50>;
+               cdns,tsd2d-ns = <50>;
+               cdns,tchsh-ns = <4>;
+               cdns,tslch-ns = <4>;
+
+               partitions {
+                       compatible = "fixed-partitions";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+
+                       qspi_boot: partition at 0 {
+                               label = "Boot and fpga data";
+                               reg = <0x0 0x034B0000>;
+                       };
+
+                       qspi_rootfs: partition at 34B0000 {
+                               label = "Root Filesystem - JFFS2";
+                               reg = <0x034B0000 0x0EB50000>;
+                       };
+               };
+       };
+};
--

2.19.0

#19 lore raw

PATCH v8 17/19 arm: dts: agilex: Add base dtsi and devkit dts

Quoted 138 lines · Simon Goldschmidt
Quoted 136 lines · Ley Foon Tan

Add device tree files for Agilex SoC platform.

socfpga_agilex-u-boot.dtsi and socfpga_agilex_socdk-u-boot.dts contains Uboot specific DT properties.

socfpga_agilex.dtsi and socfpga_agilex_socdk.dts are from Linux (kernel/git/dinguyen/linux.git, commit 6f0bf971bacacc)

---
v8:
- Include socfpga_agilex-u-boot.dtsi in socfpga_agilex_socdk-u-boot.dtsi, instead of include it in socfpga_agilex_socdk.dts.

v7:
- Update socfpga_agilex.dtsi and socfpga_agilex_socdk.dts from Linux.
- Add new socfpga_agilex_socdk-u-boot.dts file for Uboot specific DT properties.

v6:
- Use new macro names from agilex-clock.h.

v5:
- Add CCU DT node.

v4:
- Add u-boot,dm-pre-reloc to sysmgr node.

v3:
- Fixed bank 1 memory alias base address to 0x280000000.
- Rename STRATIX10_*_CLK to SOCFPGA_SOC64_*_CLK.
- Include socfpga-soc64-clock.h
- Change to "intel,sdr-ctl-agilex" for SDRAM node.

v2:
- Add clock property to device node.
- Change memory size to 8GB
- Enable i2c1

---
 arch/arm/dts/Makefile                         |   1 +
 arch/arm/dts/socfpga_agilex-u-boot.dtsi       |  96 +++
 arch/arm/dts/socfpga_agilex.dtsi              | 622 ++++++++++++++++++
 arch/arm/dts/socfpga_agilex_socdk-u-boot.dtsi |  39 ++
 arch/arm/dts/socfpga_agilex_socdk.dts         | 141 ++++
 5 files changed, 899 insertions(+)
 create mode 100644 arch/arm/dts/socfpga_agilex-u-boot.dtsi
 create mode 100644 arch/arm/dts/socfpga_agilex.dtsi
 create mode 100644 arch/arm/dts/socfpga_agilex_socdk-u-boot.dtsi
 create mode 100644 arch/arm/dts/socfpga_agilex_socdk.dts
arch/arm/dts/Makefile +1 -0
index d8846df1bd..e76f7c1407 100644
@@ -328,6 +328,7 @@ dtb-$(CONFIG_TI816X) += dm8168-evm.dtb
 dtb-$(CONFIG_THUNDERX) += thunderx-88xx.dtb
 
 dtb-$(CONFIG_ARCH_SOCFPGA) +=                          \
+       socfpga_agilex_socdk.dtb                        \
        socfpga_arria5_socdk.dtb                        \
        socfpga_arria10_socdk_sdmmc.dtb                 \
        socfpga_cyclone5_mcvevk.dtb                     \
arch/arm/dts/socfpga_agilex-u-boot.dtsi new file +66 -0
new file mode 100644
index 0000000000..f0528a9ad9
@@ -0,0 +1,96 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * U-Boot additions
+ *
+ * Copyright (C) 2019 Intel Corporation <www.intel.com>
+ */
+
+/{
+       memory {
+               #address-cells = <2>;
+               #size-cells = <2>;
+               u-boot,dm-pre-reloc;
+       };
+
+       soc {
+               u-boot,dm-pre-reloc;
+
+               ccu: cache-controller at f7000000 {
+                       compatible = "arteris,ncore-ccu";
+                       reg = <0xf7000000 0x100900>;
+                       u-boot,dm-pre-reloc;
+               };
+       };
+};
+
+&clkmgr {
+       u-boot,dm-pre-reloc;
+};
+
+&gmac1 {
+       altr,sysmgr-syscon = <&sysmgr 0x48 0>;
+};
+
+&gmac2 {
+       altr,sysmgr-syscon = <&sysmgr 0x4c 0>;
+};
+
+&i2c0 {
+       reset-names = "i2c";
+};
+
+&i2c1 {
+       reset-names = "i2c";
+};
+
+&i2c2 {
+       reset-names = "i2c";
+};
+
+&i2c3 {
+       reset-names = "i2c";
+};
+
+&mmc {
+       resets = <&rst SDMMC_RESET>, <&rst SDMMC_OCP_RESET>;
+};
+
+&porta {
+       bank-name = "porta";
+};
+
+&portb {
+       bank-name = "portb";
+};
+
+&qspi {
Quoted 8 lines

arch/arm/dts/socfpga_agilex-u-boot.dtsi line 71

Quoted 5 lines
arch/arm/dts/socfpga_agilex-u-boot.dtsi new file +5 -0
+       u-boot,dm-pre-reloc;
+};
+
+&rst {
+       compatible = "altr,rst-mgr";

This and other compatible-changing lines in this file should be synced to the correct string in all DTs, so please fix this in the upstream Linux DTs.

Linux uses "altr,rst-mgr" for Gen5 and Arria10, "altr,stratix10-rst-mgr" for S10 and Agilex.
But, Uboot uses "altr,rst-mgr" for all Gen5/Arria10/S10/Agilex platforms.

Quoted 9 lines

arch/arm/dts/socfpga_agilex-u-boot.dtsi line 77

Quoted 7 lines
arch/arm/dts/socfpga_agilex-u-boot.dtsi new file +6 -0
+       altr,modrst-offset = <0x20>;
+       u-boot,dm-pre-reloc;
+};
+
+&sdr {
+       compatible = "intel,sdr-ctl-agilex";

See above.

Linux doesn't have DDR device tree node. DDR driver is only needed in Uboot.

Quoted 12 lines

arch/arm/dts/socfpga_agilex-u-boot.dtsi line 86

Quoted 10 lines
arch/arm/dts/socfpga_agilex-u-boot.dtsi new file +9 -0
+       reg = <0xf8000400 0x80>,
+             <0xf8010000 0x190>,
+             <0xf8011000 0x500>;
+       resets = <&rst DDRSCH_RESET>;
+       u-boot,dm-pre-reloc;
+};
+
+&sysmgr {
+       compatible = "altr,sys-mgr", "syscon";

See above.

Linux dts just removed "syscon" recently. But, Uboot needs it.

Regards
Ley Foon

Quoted 840 lines

Ultimately, you should onle need 'u-boot,dm-pre-reloc' tags in this file and probably some boot source defititions.

However, until that is done, it's probably ok to have this here, so:

Quoted 833 lines
arch/arm/dts/socfpga_agilex-u-boot.dtsi new file +10 -0
+       u-boot,dm-pre-reloc;
+};
+
+&uart0 {
+       u-boot,dm-pre-reloc;
+};
+
+&watchdog0 {
+       u-boot,dm-pre-reloc;
+};
arch/arm/dts/socfpga_agilex.dtsi new file +622 -0
new file mode 100644
index 0000000000..179b4d5591
@@ -0,0 +1,622 @@
+// SPDX-License-Identifier:     GPL-2.0
+/*
+ * Copyright (C) 2019, Intel Corporation
+ */
+
+/dts-v1/;
+#include <dt-bindings/reset/altr,rst-mgr-s10.h>
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/clock/agilex-clock.h>
+
+/ {
+       compatible = "intel,socfpga-agilex";
+       #address-cells = <2>;
+       #size-cells = <2>;
+
+       reserved-memory {
+               #address-cells = <2>;
+               #size-cells = <2>;
+               ranges;
+
+               service_reserved: svcbuffer at 0 {
+                       compatible = "shared-dma-pool";
+                       reg = <0x0 0x0 0x0 0x1000000>;
+                       alignment = <0x1000>;
+                       no-map;
+               };
+       };
+
+       cpus {
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               cpu0: cpu at 0 {
+                       compatible = "arm,cortex-a53";
+                       device_type = "cpu";
+                       enable-method = "psci";
+                       reg = <0x0>;
+               };
+
+               cpu1: cpu at 1 {
+                       compatible = "arm,cortex-a53";
+                       device_type = "cpu";
+                       enable-method = "psci";
+                       reg = <0x1>;
+               };
+
+               cpu2: cpu at 2 {
+                       compatible = "arm,cortex-a53";
+                       device_type = "cpu";
+                       enable-method = "psci";
+                       reg = <0x2>;
+               };
+
+               cpu3: cpu at 3 {
+                       compatible = "arm,cortex-a53";
+                       device_type = "cpu";
+                       enable-method = "psci";
+                       reg = <0x3>;
+               };
+       };
+
+       pmu {
+               compatible = "arm,armv8-pmuv3";
+               interrupts = <0 170 4>,
+                            <0 171 4>,
+                            <0 172 4>,
+                            <0 173 4>;
+               interrupt-affinity = <&cpu0>,
+                                    <&cpu1>,
+                                    <&cpu2>,
+                                    <&cpu3>;
+               interrupt-parent = <&intc>;
+       };
+
+       psci {
+               compatible = "arm,psci-0.2";
+               method = "smc";
+       };
+
+       intc: intc at fffc1000 {
+               compatible = "arm,gic-400", "arm,cortex-a15-gic";
+               #interrupt-cells = <3>;
+               interrupt-controller;
+               reg = <0x0 0xfffc1000 0x0 0x1000>,
+                     <0x0 0xfffc2000 0x0 0x2000>,
+                     <0x0 0xfffc4000 0x0 0x2000>,
+                     <0x0 0xfffc6000 0x0 0x2000>;
+       };
+
+       soc {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               compatible = "simple-bus";
+               device_type = "soc";
+               interrupt-parent = <&intc>;
+               ranges = <0 0 0 0xffffffff>;
+
+               base_fpga_region {
+                       #address-cells = <0x1>;
+                       #size-cells = <0x1>;
+                       compatible = "fpga-region";
+                       fpga-mgr = <&fpga_mgr>;
+               };
+
+               clkmgr: clock-controller at ffd10000 {
+                       compatible = "intel,agilex-clkmgr";
+                       reg = <0xffd10000 0x1000>;
+                       #clock-cells = <1>;
+               };
+
+               clocks {
+                       cb_intosc_hs_div2_clk: cb-intosc-hs-div2-clk {
+                               #clock-cells = <0>;
+                               compatible = "fixed-clock";
+                       };
+
+                       cb_intosc_ls_clk: cb-intosc-ls-clk {
+                               #clock-cells = <0>;
+                               compatible = "fixed-clock";
+                       };
+
+                       f2s_free_clk: f2s-free-clk {
+                               #clock-cells = <0>;
+                               compatible = "fixed-clock";
+                       };
+
+                       osc1: osc1 {
+                               #clock-cells = <0>;
+                               compatible = "fixed-clock";
+                       };
+
+                       qspi_clk: qspi-clk {
+                               #clock-cells = <0>;
+                               compatible = "fixed-clock";
+                               clock-frequency = <200000000>;
+                       };
+               };
+               gmac0: ethernet at ff800000 {
+                       compatible = "altr,socfpga-stmmac", "snps,dwmac-3.74a", "snps,dwmac";
+                       reg = <0xff800000 0x2000>;
+                       interrupts = <0 90 4>;
+                       interrupt-names = "macirq";
+                       mac-address = [00 00 00 00 00 00];
+                       resets = <&rst EMAC0_RESET>, <&rst EMAC0_OCP_RESET>;
+                       reset-names = "stmmaceth", "stmmaceth-ocp";
+                       tx-fifo-depth = <16384>;
+                       rx-fifo-depth = <16384>;
+                       snps,multicast-filter-bins = <256>;
+                       iommus = <&smmu 1>;
+                       altr,sysmgr-syscon = <&sysmgr 0x44 0>;
+                       clocks = <&clkmgr AGILEX_EMAC0_CLK>;
+                       clock-names = "stmmaceth";
+                       status = "disabled";
+               };
+
+               gmac1: ethernet at ff802000 {
+                       compatible = "altr,socfpga-stmmac", "snps,dwmac-3.74a", "snps,dwmac";
+                       reg = <0xff802000 0x2000>;
+                       interrupts = <0 91 4>;
+                       interrupt-names = "macirq";
+                       mac-address = [00 00 00 00 00 00];
+                       resets = <&rst EMAC1_RESET>, <&rst EMAC1_OCP_RESET>;
+                       reset-names = "stmmaceth", "stmmaceth-ocp";
+                       tx-fifo-depth = <16384>;
+                       rx-fifo-depth = <16384>;
+                       snps,multicast-filter-bins = <256>;
+                       iommus = <&smmu 2>;
+                       altr,sysmgr-syscon = <&sysmgr 0x48 8>;
+                       clocks = <&clkmgr AGILEX_EMAC1_CLK>;
+                       clock-names = "stmmaceth";
+                       status = "disabled";
+               };
+
+               gmac2: ethernet at ff804000 {
+                       compatible = "altr,socfpga-stmmac", "snps,dwmac-3.74a", "snps,dwmac";
+                       reg = <0xff804000 0x2000>;
+                       interrupts = <0 92 4>;
+                       interrupt-names = "macirq";
+                       mac-address = [00 00 00 00 00 00];
+                       resets = <&rst EMAC2_RESET>, <&rst EMAC2_OCP_RESET>;
+                       reset-names = "stmmaceth", "stmmaceth-ocp";
+                       tx-fifo-depth = <16384>;
+                       rx-fifo-depth = <16384>;
+                       snps,multicast-filter-bins = <256>;
+                       iommus = <&smmu 3>;
+                       altr,sysmgr-syscon = <&sysmgr 0x4c 16>;
+                       clocks = <&clkmgr AGILEX_EMAC2_CLK>;
+                       clock-names = "stmmaceth";
+                       status = "disabled";
+               };
+
+               gpio0: gpio at ffc03200 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "snps,dw-apb-gpio";
+                       reg = <0xffc03200 0x100>;
+                       resets = <&rst GPIO0_RESET>;
+                       status = "disabled";
+
+                       porta: gpio-controller at 0 {
+                               compatible = "snps,dw-apb-gpio-port";
+                               gpio-controller;
+                               #gpio-cells = <2>;
+                               snps,nr-gpios = <24>;
+                               reg = <0>;
+                               interrupt-controller;
+                               #interrupt-cells = <2>;
+                               interrupts = <0 110 4>;
+                       };
+               };
+
+               gpio1: gpio at ffc03300 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "snps,dw-apb-gpio";
+                       reg = <0xffc03300 0x100>;
+                       resets = <&rst GPIO1_RESET>;
+                       status = "disabled";
+
+                       portb: gpio-controller at 0 {
+                               compatible = "snps,dw-apb-gpio-port";
+                               gpio-controller;
+                               #gpio-cells = <2>;
+                               snps,nr-gpios = <24>;
+                               reg = <0>;
+                               interrupt-controller;
+                               #interrupt-cells = <2>;
+                               interrupts = <0 111 4>;
+                       };
+               };
+
+               i2c0: i2c at ffc02800 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "snps,designware-i2c";
+                       reg = <0xffc02800 0x100>;
+                       interrupts = <0 103 4>;
+                       resets = <&rst I2C0_RESET>;
+                       clocks = <&clkmgr AGILEX_L4_SP_CLK>;
+                       status = "disabled";
+               };
+
+               i2c1: i2c at ffc02900 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "snps,designware-i2c";
+                       reg = <0xffc02900 0x100>;
+                       interrupts = <0 104 4>;
+                       resets = <&rst I2C1_RESET>;
+                       clocks = <&clkmgr AGILEX_L4_SP_CLK>;
+                       status = "disabled";
+               };
+
+               i2c2: i2c at ffc02a00 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "snps,designware-i2c";
+                       reg = <0xffc02a00 0x100>;
+                       interrupts = <0 105 4>;
+                       resets = <&rst I2C2_RESET>;
+                       clocks = <&clkmgr AGILEX_L4_SP_CLK>;
+                       status = "disabled";
+               };
+
+               i2c3: i2c at ffc02b00 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "snps,designware-i2c";
+                       reg = <0xffc02b00 0x100>;
+                       interrupts = <0 106 4>;
+                       resets = <&rst I2C3_RESET>;
+                       clocks = <&clkmgr AGILEX_L4_SP_CLK>;
+                       status = "disabled";
+               };
+
+               i2c4: i2c at ffc02c00 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "snps,designware-i2c";
+                       reg = <0xffc02c00 0x100>;
+                       interrupts = <0 107 4>;
+                       resets = <&rst I2C4_RESET>;
+                       clocks = <&clkmgr AGILEX_L4_SP_CLK>;
+                       status = "disabled";
+               };
+
+               mmc: dwmmc0 at ff808000 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "altr,socfpga-dw-mshc";
+                       reg = <0xff808000 0x1000>;
+                       interrupts = <0 96 4>;
+                       fifo-depth = <0x400>;
+                       resets = <&rst SDMMC_RESET>;
+                       reset-names = "reset";
+                       clocks = <&clkmgr AGILEX_L4_MP_CLK>,
+                                <&clkmgr AGILEX_SDMMC_CLK>;
+                       clock-names = "biu", "ciu";
+                       iommus = <&smmu 5>;
+                       status = "disabled";
+               };
+
+               nand: nand at ffb90000 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "altr,socfpga-denali-nand";
+                       reg = <0xffb90000 0x10000>,
+                             <0xffb80000 0x1000>;
+                       reg-names = "nand_data", "denali_reg";
+                       interrupts = <0 97 4>;
+                       resets = <&rst NAND_RESET>, <&rst NAND_OCP_RESET>;
+                       status = "disabled";
+               };
+
+               ocram: sram at ffe00000 {
+                       compatible = "mmio-sram";
+                       reg = <0xffe00000 0x40000>;
+               };
+
+               pdma: pdma at ffda0000 {
+                       compatible = "arm,pl330", "arm,primecell";
+                       reg = <0xffda0000 0x1000>;
+                       interrupts = <0 81 4>,
+                                    <0 82 4>,
+                                    <0 83 4>,
+                                    <0 84 4>,
+                                    <0 85 4>,
+                                    <0 86 4>,
+                                    <0 87 4>,
+                                    <0 88 4>,
+                                    <0 89 4>;
+                       #dma-cells = <1>;
+                       #dma-channels = <8>;
+                       #dma-requests = <32>;
+                       resets = <&rst DMA_RESET>, <&rst DMA_OCP_RESET>;
+                       reset-names = "dma", "dma-ocp";
+                       clocks = <&clkmgr AGILEX_L4_MAIN_CLK>;
+                       clock-names = "apb_pclk";
+               };
+
+               rst: rstmgr at ffd11000 {
+                       #reset-cells = <1>;
+                       compatible = "altr,stratix10-rst-mgr";
+                       reg = <0xffd11000 0x100>;
+               };
+
+               smmu: iommu at fa000000 {
+                       compatible = "arm,mmu-500", "arm,smmu-v2";
+                       reg = <0xfa000000 0x40000>;
+                       #global-interrupts = <2>;
+                       #iommu-cells = <1>;
+                       interrupt-parent = <&intc>;
+                       interrupts = <0 128 4>, /* Global Secure Fault */
+                               <0 129 4>, /* Global Non-secure Fault */
+                               /* Non-secure Context Interrupts (32) */
+                               <0 138 4>, <0 139 4>, <0 140 4>, <0 141 4>,
+                               <0 142 4>, <0 143 4>, <0 144 4>, <0 145 4>,
+                               <0 146 4>, <0 147 4>, <0 148 4>, <0 149 4>,
+                               <0 150 4>, <0 151 4>, <0 152 4>, <0 153 4>,
+                               <0 154 4>, <0 155 4>, <0 156 4>, <0 157 4>,
+                               <0 158 4>, <0 159 4>, <0 160 4>, <0 161 4>,
+                               <0 162 4>, <0 163 4>, <0 164 4>, <0 165 4>,
+                               <0 166 4>, <0 167 4>, <0 168 4>, <0 169 4>;
+                       stream-match-mask = <0x7ff0>;
+                       status = "disabled";
+               };
+
+               spi0: spi at ffda4000 {
+                       compatible = "snps,dw-apb-ssi";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <0xffda4000 0x1000>;
+                       interrupts = <0 99 4>;
+                       resets = <&rst SPIM0_RESET>;
+                       reg-io-width = <4>;
+                       num-cs = <4>;
+                       clocks = <&clkmgr AGILEX_L4_MAIN_CLK>;
+                       status = "disabled";
+               };
+
+               spi1: spi at ffda5000 {
+                       compatible = "snps,dw-apb-ssi";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <0xffda5000 0x1000>;
+                       interrupts = <0 100 4>;
+                       resets = <&rst SPIM1_RESET>;
+                       reg-io-width = <4>;
+                       num-cs = <4>;
+                       clocks = <&clkmgr AGILEX_L4_MAIN_CLK>;
+                       status = "disabled";
+               };
+
+               sysmgr: sysmgr at ffd12000 {
+                       compatible = "altr,sys-mgr-s10","altr,sys-mgr";
+                       reg = <0xffd12000 0x500>;
+               };
+
+               /* Local timer */
+               timer {
+                       compatible = "arm,armv8-timer";
+                       interrupts = <1 13 0xf08>,
+                                    <1 14 0xf08>,
+                                    <1 11 0xf08>,
+                                    <1 10 0xf08>;
+               };
+
+               timer0: timer0 at ffc03000 {
+                       compatible = "snps,dw-apb-timer";
+                       interrupts = <0 113 4>;
+                       reg = <0xffc03000 0x100>;
+                       clocks = <&clkmgr AGILEX_L4_SP_CLK>;
+                       clock-names = "timer";
+               };
+
+               timer1: timer1 at ffc03100 {
+                       compatible = "snps,dw-apb-timer";
+                       interrupts = <0 114 4>;
+                       reg = <0xffc03100 0x100>;
+                       clocks = <&clkmgr AGILEX_L4_SP_CLK>;
+                       clock-names = "timer";
+               };
+
+               timer2: timer2 at ffd00000 {
+                       compatible = "snps,dw-apb-timer";
+                       interrupts = <0 115 4>;
+                       reg = <0xffd00000 0x100>;
+                       clocks = <&clkmgr AGILEX_L4_SP_CLK>;
+                       clock-names = "timer";
+               };
+
+               timer3: timer3 at ffd00100 {
+                       compatible = "snps,dw-apb-timer";
+                       interrupts = <0 116 4>;
+                       reg = <0xffd00100 0x100>;
+                       clocks = <&clkmgr AGILEX_L4_SP_CLK>;
+                       clock-names = "timer";
+               };
+
+               uart0: serial0 at ffc02000 {
+                       compatible = "snps,dw-apb-uart";
+                       reg = <0xffc02000 0x100>;
+                       interrupts = <0 108 4>;
+                       reg-shift = <2>;
+                       reg-io-width = <4>;
+                       resets = <&rst UART0_RESET>;
+                       status = "disabled";
+                       clocks = <&clkmgr AGILEX_L4_SP_CLK>;
+                       clock-frequency = <100000000>;
+               };
+
+               uart1: serial1 at ffc02100 {
+                       compatible = "snps,dw-apb-uart";
+                       reg = <0xffc02100 0x100>;
+                       interrupts = <0 109 4>;
+                       reg-shift = <2>;
+                       reg-io-width = <4>;
+                       resets = <&rst UART1_RESET>;
+                       clocks = <&clkmgr AGILEX_L4_SP_CLK>;
+                       status = "disabled";
+               };
+
+               usbphy0: usbphy at 0 {
+                       #phy-cells = <0>;
+                       compatible = "usb-nop-xceiv";
+                       status = "okay";
+               };
+
+               usb0: usb at ffb00000 {
+                       compatible = "snps,dwc2";
+                       reg = <0xffb00000 0x40000>;
+                       interrupts = <0 93 4>;
+                       phys = <&usbphy0>;
+                       phy-names = "usb2-phy";
+                       resets = <&rst USB0_RESET>, <&rst USB0_OCP_RESET>;
+                       reset-names = "dwc2", "dwc2-ecc";
+                       clocks = <&clkmgr AGILEX_USB_CLK>;
+                       iommus = <&smmu 6>;
+                       status = "disabled";
+               };
+
+               usb1: usb at ffb40000 {
+                       compatible = "snps,dwc2";
+                       reg = <0xffb40000 0x40000>;
+                       interrupts = <0 94 4>;
+                       phys = <&usbphy0>;
+                       phy-names = "usb2-phy";
+                       resets = <&rst USB1_RESET>, <&rst USB1_OCP_RESET>;
+                       reset-names = "dwc2", "dwc2-ecc";
+                       iommus = <&smmu 7>;
+                       clocks = <&clkmgr AGILEX_USB_CLK>;
+                       status = "disabled";
+               };
+
+               watchdog0: watchdog at ffd00200 {
+                       compatible = "snps,dw-wdt";
+                       reg = <0xffd00200 0x100>;
+                       interrupts = <0 117 4>;
+                       resets = <&rst WATCHDOG0_RESET>;
+                       clocks = <&clkmgr AGILEX_L4_SYS_FREE_CLK>;
+                       status = "disabled";
+               };
+
+               watchdog1: watchdog at ffd00300 {
+                       compatible = "snps,dw-wdt";
+                       reg = <0xffd00300 0x100>;
+                       interrupts = <0 118 4>;
+                       resets = <&rst WATCHDOG1_RESET>;
+                       clocks = <&clkmgr AGILEX_L4_SYS_FREE_CLK>;
+                       status = "disabled";
+               };
+
+               watchdog2: watchdog at ffd00400 {
+                       compatible = "snps,dw-wdt";
+                       reg = <0xffd00400 0x100>;
+                       interrupts = <0 125 4>;
+                       resets = <&rst WATCHDOG2_RESET>;
+                       clocks = <&clkmgr AGILEX_L4_SYS_FREE_CLK>;
+                       status = "disabled";
+               };
+
+               watchdog3: watchdog at ffd00500 {
+                       compatible = "snps,dw-wdt";
+                       reg = <0xffd00500 0x100>;
+                       interrupts = <0 126 4>;
+                       resets = <&rst WATCHDOG3_RESET>;
+                       clocks = <&clkmgr AGILEX_L4_SYS_FREE_CLK>;
+                       status = "disabled";
+               };
+
+               sdr: sdr at f8011100 {
+                       compatible = "altr,sdr-ctl", "syscon";
+                       reg = <0xf8011100 0xc0>;
+               };
+
+               eccmgr {
+                       compatible = "altr,socfpga-s10-ecc-manager",
+                                    "altr,socfpga-a10-ecc-manager";
+                       altr,sysmgr-syscon = <&sysmgr>;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       interrupts = <0 15 4>;
+                       interrupt-controller;
+                       #interrupt-cells = <2>;
+                       ranges;
+
+                       sdramedac {
+                               compatible = "altr,sdram-edac-s10";
+                               altr,sdr-syscon = <&sdr>;
+                               interrupts = <16 4>;
+                       };
+
+                       ocram-ecc at ff8cc000 {
+                               compatible = "altr,socfpga-s10-ocram-ecc",
+                                            "altr,socfpga-a10-ocram-ecc";
+                               reg = <0xff8cc000 0x100>;
+                               altr,ecc-parent = <&ocram>;
+                               interrupts = <1 4>;
+                       };
+
+                       usb0-ecc at ff8c4000 {
+                               compatible = "altr,socfpga-s10-usb-ecc",
+                                            "altr,socfpga-usb-ecc";
+                               reg = <0xff8c4000 0x100>;
+                               altr,ecc-parent = <&usb0>;
+                               interrupts = <2 4>;
+                       };
+
+                       emac0-rx-ecc at ff8c0000 {
+                               compatible = "altr,socfpga-s10-eth-mac-ecc",
+                                            "altr,socfpga-eth-mac-ecc";
+                               reg = <0xff8c0000 0x100>;
+                               altr,ecc-parent = <&gmac0>;
+                               interrupts = <4 4>;
+                       };
+
+                       emac0-tx-ecc at ff8c0400 {
+                               compatible = "altr,socfpga-s10-eth-mac-ecc",
+                                            "altr,socfpga-eth-mac-ecc";
+                               reg = <0xff8c0400 0x100>;
+                               altr,ecc-parent = <&gmac0>;
+                               interrupts = <5 4>;
+                       };
+
+                       sdmmca-ecc at ff8c8c00 {
+                               compatible = "altr,socfpga-s10-sdmmc-ecc",
+                                            "altr,socfpga-sdmmc-ecc";
+                               reg = <0xff8c8c00 0x100>;
+                               altr,ecc-parent = <&mmc>;
+                               interrupts = <14 4>,
+                                            <15 4>;
+                       };
+               };
+
+               qspi: spi at ff8d2000 {
+                       compatible = "cdns,qspi-nor";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <0xff8d2000 0x100>,
+                             <0xff900000 0x100000>;
+                       interrupts = <0 3 4>;
+                       cdns,fifo-depth = <128>;
+                       cdns,fifo-width = <4>;
+                       cdns,trigger-address = <0x00000000>;
+                       clocks = <&qspi_clk>;
+
+                       status = "disabled";
+               };
+
+               firmware {
+                       svc {
+                               compatible = "intel,stratix10-svc";
+                               method = "smc";
+                               memory-region = <&service_reserved>;
+
+                               fpga_mgr: fpga-mgr {
+                                       compatible = "intel,stratix10-soc-fpga-mgr";
+                               };
+                       };
+               };
+       };
+};
arch/arm/dts/socfpga_agilex_socdk-u-boot.dtsi new file +39 -0
new file mode 100644
index 0000000000..1908be4b8b
@@ -0,0 +1,39 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * U-Boot additions
+ *
+ * Copyright (C) 2019 Intel Corporation <www.intel.com>
+ */
+
+#include "socfpga_agilex-u-boot.dtsi"
+
+/{
+       aliases {
+               spi0 = &qspi;
+               i2c0 = &i2c1;
+       };
+
+       memory {
+               /* 8GB */
+               reg = <0 0x00000000 0 0x80000000>,
+                     <2 0x80000000 1 0x80000000>;
+       };
+};
+
+&flash0 {
+       compatible = "jedec,spi-nor";
+       spi-tx-bus-width = <4>;
+       spi-rx-bus-width = <4>;
+       u-boot,dm-pre-reloc;
+};
+
+&i2c1 {
+       status = "okay";
+};
+
+&mmc {
+       drvsel = <3>;
+       smplsel = <0>;
+       u-boot,dm-pre-reloc;
+};
+
arch/arm/dts/socfpga_agilex_socdk.dts new file +141 -1
new file mode 100644
index 0000000000..bcdeecc0e0
@@ -0,0 +1,141 @@
+// SPDX-License-Identifier:     GPL-2.0
+/*
+ * Copyright (C) 2019, Intel Corporation
+ */
+#include "socfpga_agilex.dtsi"
+
+/ {
+       model = "SoCFPGA Agilex SoCDK";
+
+       aliases {
+               serial0 = &uart0;
+               ethernet0 = &gmac0;
+               ethernet1 = &gmac1;
+               ethernet2 = &gmac2;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+
+       leds {
+               compatible = "gpio-leds";
+               hps0 {
+                       label = "hps_led0";
+                       gpios = <&portb 20 GPIO_ACTIVE_HIGH>;
+               };
+
+               hps1 {
+                       label = "hps_led1";
+                       gpios = <&portb 19 GPIO_ACTIVE_HIGH>;
+               };
+
+               hps2 {
+                       label = "hps_led2";
+                       gpios = <&portb 21 GPIO_ACTIVE_HIGH>;
+               };
+       };
+
+       memory {
+               device_type = "memory";
+               /* We expect the bootloader to fill in the reg */
+               reg = <0 0 0 0>;
+       };
+
+       soc {
+               clocks {
+                       osc1 {
+                               clock-frequency = <25000000>;
+                       };
+               };
+       };
+};
+
+&gpio1 {
+       status = "okay";
+};
+
+&gmac0 {
+       status = "okay";
+       phy-mode = "rgmii";
+       phy-handle = <&phy0>;
+
+       max-frame-size = <9000>;
+
+       mdio0 {
+               #address-cells = <1>;
+               #size-cells = <0>;
+               compatible = "snps,dwmac-mdio";
+               phy0: ethernet-phy at 0 {
+                       reg = <4>;
+
+                       txd0-skew-ps = <0>; /* -420ps */
+                       txd1-skew-ps = <0>; /* -420ps */
+                       txd2-skew-ps = <0>; /* -420ps */
+                       txd3-skew-ps = <0>; /* -420ps */
+                       rxd0-skew-ps = <420>; /* 0ps */
+                       rxd1-skew-ps = <420>; /* 0ps */
+                       rxd2-skew-ps = <420>; /* 0ps */
+                       rxd3-skew-ps = <420>; /* 0ps */
+                       txen-skew-ps = <0>; /* -420ps */
+                       txc-skew-ps = <900>; /* 0ps */
+                       rxdv-skew-ps = <420>; /* 0ps */
+                       rxc-skew-ps = <1680>; /* 780ps */
+               };
+       };
+};
+
+&mmc {
+       status = "okay";
+       cap-sd-highspeed;
+       broken-cd;
+       bus-width = <4>;
+};
+
+&uart0 {
+       status = "okay";
+};
+
+&usb0 {
+       status = "okay";
+       disable-over-current;
+};
+
+&watchdog0 {
+       status = "okay";
+};
+
+&qspi {
+       flash0: flash at 0 {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               compatible = "mt25qu02g";
+               reg = <0>;
+               spi-max-frequency = <100000000>;
+
+               m25p,fast-read;
+               cdns,page-size = <256>;
+               cdns,block-size = <16>;
+               cdns,read-delay = <1>;
+               cdns,tshsl-ns = <50>;
+               cdns,tsd2d-ns = <50>;
+               cdns,tchsh-ns = <4>;
+               cdns,tslch-ns = <4>;
+
+               partitions {
+                       compatible = "fixed-partitions";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+
+                       qspi_boot: partition at 0 {
+                               label = "Boot and fpga data";
+                               reg = <0x0 0x034B0000>;
+                       };
+
+                       qspi_rootfs: partition at 34B0000 {
+                               label = "Root Filesystem - JFFS2";
+                               reg = <0x034B0000 0x0EB50000>;
+                       };
+               };
+       };
+};
--

2.19.0

#20 lore raw

PATCH v8 17/19 arm: dts: agilex: Add base dtsi and devkit dts

Quoted 149 lines · Ley Foon Tan
Quoted 138 lines · Simon Goldschmidt
Quoted 136 lines · Ley Foon Tan

Add device tree files for Agilex SoC platform.

socfpga_agilex-u-boot.dtsi and socfpga_agilex_socdk-u-boot.dts contains Uboot specific DT properties.

socfpga_agilex.dtsi and socfpga_agilex_socdk.dts are from Linux (kernel/git/dinguyen/linux.git, commit 6f0bf971bacacc)

---
v8:
- Include socfpga_agilex-u-boot.dtsi in socfpga_agilex_socdk-u-boot.dtsi, instead of include it in socfpga_agilex_socdk.dts.

v7:
- Update socfpga_agilex.dtsi and socfpga_agilex_socdk.dts from Linux.
- Add new socfpga_agilex_socdk-u-boot.dts file for Uboot specific DT properties.

v6:
- Use new macro names from agilex-clock.h.

v5:
- Add CCU DT node.

v4:
- Add u-boot,dm-pre-reloc to sysmgr node.

v3:
- Fixed bank 1 memory alias base address to 0x280000000.
- Rename STRATIX10_*_CLK to SOCFPGA_SOC64_*_CLK.
- Include socfpga-soc64-clock.h
- Change to "intel,sdr-ctl-agilex" for SDRAM node.

v2:
- Add clock property to device node.
- Change memory size to 8GB
- Enable i2c1

---
 arch/arm/dts/Makefile                         |   1 +
 arch/arm/dts/socfpga_agilex-u-boot.dtsi       |  96 +++
 arch/arm/dts/socfpga_agilex.dtsi              | 622 ++++++++++++++++++
 arch/arm/dts/socfpga_agilex_socdk-u-boot.dtsi |  39 ++
 arch/arm/dts/socfpga_agilex_socdk.dts         | 141 ++++
 5 files changed, 899 insertions(+)
 create mode 100644 arch/arm/dts/socfpga_agilex-u-boot.dtsi
 create mode 100644 arch/arm/dts/socfpga_agilex.dtsi
 create mode 100644 arch/arm/dts/socfpga_agilex_socdk-u-boot.dtsi
 create mode 100644 arch/arm/dts/socfpga_agilex_socdk.dts
arch/arm/dts/Makefile +1 -0
index d8846df1bd..e76f7c1407 100644
@@ -328,6 +328,7 @@ dtb-$(CONFIG_TI816X) += dm8168-evm.dtb
 dtb-$(CONFIG_THUNDERX) += thunderx-88xx.dtb
 
 dtb-$(CONFIG_ARCH_SOCFPGA) +=                          \
+       socfpga_agilex_socdk.dtb                        \
        socfpga_arria5_socdk.dtb                        \
        socfpga_arria10_socdk_sdmmc.dtb                 \
        socfpga_cyclone5_mcvevk.dtb                     \
arch/arm/dts/socfpga_agilex-u-boot.dtsi new file +66 -0
new file mode 100644
index 0000000000..f0528a9ad9
@@ -0,0 +1,96 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * U-Boot additions
+ *
+ * Copyright (C) 2019 Intel Corporation <www.intel.com>
+ */
+
+/{
+       memory {
+               #address-cells = <2>;
+               #size-cells = <2>;
+               u-boot,dm-pre-reloc;
+       };
+
+       soc {
+               u-boot,dm-pre-reloc;
+
+               ccu: cache-controller at f7000000 {
+                       compatible = "arteris,ncore-ccu";
+                       reg = <0xf7000000 0x100900>;
+                       u-boot,dm-pre-reloc;
+               };
+       };
+};
+
+&clkmgr {
+       u-boot,dm-pre-reloc;
+};
+
+&gmac1 {
+       altr,sysmgr-syscon = <&sysmgr 0x48 0>;
+};
+
+&gmac2 {
+       altr,sysmgr-syscon = <&sysmgr 0x4c 0>;
+};
+
+&i2c0 {
+       reset-names = "i2c";
+};
+
+&i2c1 {
+       reset-names = "i2c";
+};
+
+&i2c2 {
+       reset-names = "i2c";
+};
+
+&i2c3 {
+       reset-names = "i2c";
+};
+
+&mmc {
+       resets = <&rst SDMMC_RESET>, <&rst SDMMC_OCP_RESET>;
+};
+
+&porta {
+       bank-name = "porta";
+};
+
+&portb {
+       bank-name = "portb";
+};
+
+&qspi {
Quoted 8 lines

arch/arm/dts/socfpga_agilex-u-boot.dtsi line 71

Quoted 5 lines
arch/arm/dts/socfpga_agilex-u-boot.dtsi new file +5 -0
+       u-boot,dm-pre-reloc;
+};
+
+&rst {
+       compatible = "altr,rst-mgr";

This and other compatible-changing lines in this file should be synced to the correct string in all DTs, so please fix this in the upstream Linux DTs.

Quoted 3 lines

Linux uses "altr,rst-mgr" for Gen5 and Arria10, "altr,stratix10-rst-mgr" for S10 and Agilex.
But, Uboot uses "altr,rst-mgr" for all Gen5/Arria10/S10/Agilex platforms.

What prevents you from fixing the Linux drivers to use "altr,stratix10-rst-mgr", too?

A devicetree should describe the hardware in a generic, OS-agnostic way as much as possible.

Quoted 11 lines
Quoted 10 lines

arch/arm/dts/socfpga_agilex-u-boot.dtsi line 77

Quoted 8 lines
arch/arm/dts/socfpga_agilex-u-boot.dtsi new file +6 -0
+       altr,modrst-offset = <0x20>;
+       u-boot,dm-pre-reloc;
+};
+
+&sdr {
+       compatible = "intel,sdr-ctl-agilex";

See above.

Linux doesn't have DDR device tree node. DDR driver is only needed in Uboot.

That's not the point. As written above, a devicetree describes hardware. The fact that Linux does not use this piece of hardware doesn't mean it must be removed from the dts in the Linux sources.

Quoted 13 lines
Quoted 13 lines

arch/arm/dts/socfpga_agilex-u-boot.dtsi line 86

Quoted 11 lines
arch/arm/dts/socfpga_agilex-u-boot.dtsi new file +9 -0
+       reg = <0xf8000400 0x80>,
+             <0xf8010000 0x190>,
+             <0xf8011000 0x500>;
+       resets = <&rst DDRSCH_RESET>;
+       u-boot,dm-pre-reloc;
+};
+
+&sysmgr {
+       compatible = "altr,sys-mgr", "syscon";

See above.

Quoted 1 line

Linux dts just removed "syscon" recently. But, Uboot needs it.

Hmm, can we fix the sysmgr driver to behave as syscon? Than we could remove this for U-Boot, too.

Regards,
Simon

Quoted 844 lines

Regards
Ley Foon

Quoted 840 lines

Ultimately, you should onle need 'u-boot,dm-pre-reloc' tags in this file and probably some boot source defititions.

However, until that is done, it's probably ok to have this here, so:

Quoted 833 lines
arch/arm/dts/socfpga_agilex-u-boot.dtsi new file +10 -0
+       u-boot,dm-pre-reloc;
+};
+
+&uart0 {
+       u-boot,dm-pre-reloc;
+};
+
+&watchdog0 {
+       u-boot,dm-pre-reloc;
+};
arch/arm/dts/socfpga_agilex.dtsi new file +622 -0
new file mode 100644
index 0000000000..179b4d5591
@@ -0,0 +1,622 @@
+// SPDX-License-Identifier:     GPL-2.0
+/*
+ * Copyright (C) 2019, Intel Corporation
+ */
+
+/dts-v1/;
+#include <dt-bindings/reset/altr,rst-mgr-s10.h>
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/clock/agilex-clock.h>
+
+/ {
+       compatible = "intel,socfpga-agilex";
+       #address-cells = <2>;
+       #size-cells = <2>;
+
+       reserved-memory {
+               #address-cells = <2>;
+               #size-cells = <2>;
+               ranges;
+
+               service_reserved: svcbuffer at 0 {
+                       compatible = "shared-dma-pool";
+                       reg = <0x0 0x0 0x0 0x1000000>;
+                       alignment = <0x1000>;
+                       no-map;
+               };
+       };
+
+       cpus {
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               cpu0: cpu at 0 {
+                       compatible = "arm,cortex-a53";
+                       device_type = "cpu";
+                       enable-method = "psci";
+                       reg = <0x0>;
+               };
+
+               cpu1: cpu at 1 {
+                       compatible = "arm,cortex-a53";
+                       device_type = "cpu";
+                       enable-method = "psci";
+                       reg = <0x1>;
+               };
+
+               cpu2: cpu at 2 {
+                       compatible = "arm,cortex-a53";
+                       device_type = "cpu";
+                       enable-method = "psci";
+                       reg = <0x2>;
+               };
+
+               cpu3: cpu at 3 {
+                       compatible = "arm,cortex-a53";
+                       device_type = "cpu";
+                       enable-method = "psci";
+                       reg = <0x3>;
+               };
+       };
+
+       pmu {
+               compatible = "arm,armv8-pmuv3";
+               interrupts = <0 170 4>,
+                            <0 171 4>,
+                            <0 172 4>,
+                            <0 173 4>;
+               interrupt-affinity = <&cpu0>,
+                                    <&cpu1>,
+                                    <&cpu2>,
+                                    <&cpu3>;
+               interrupt-parent = <&intc>;
+       };
+
+       psci {
+               compatible = "arm,psci-0.2";
+               method = "smc";
+       };
+
+       intc: intc at fffc1000 {
+               compatible = "arm,gic-400", "arm,cortex-a15-gic";
+               #interrupt-cells = <3>;
+               interrupt-controller;
+               reg = <0x0 0xfffc1000 0x0 0x1000>,
+                     <0x0 0xfffc2000 0x0 0x2000>,
+                     <0x0 0xfffc4000 0x0 0x2000>,
+                     <0x0 0xfffc6000 0x0 0x2000>;
+       };
+
+       soc {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               compatible = "simple-bus";
+               device_type = "soc";
+               interrupt-parent = <&intc>;
+               ranges = <0 0 0 0xffffffff>;
+
+               base_fpga_region {
+                       #address-cells = <0x1>;
+                       #size-cells = <0x1>;
+                       compatible = "fpga-region";
+                       fpga-mgr = <&fpga_mgr>;
+               };
+
+               clkmgr: clock-controller at ffd10000 {
+                       compatible = "intel,agilex-clkmgr";
+                       reg = <0xffd10000 0x1000>;
+                       #clock-cells = <1>;
+               };
+
+               clocks {
+                       cb_intosc_hs_div2_clk: cb-intosc-hs-div2-clk {
+                               #clock-cells = <0>;
+                               compatible = "fixed-clock";
+                       };
+
+                       cb_intosc_ls_clk: cb-intosc-ls-clk {
+                               #clock-cells = <0>;
+                               compatible = "fixed-clock";
+                       };
+
+                       f2s_free_clk: f2s-free-clk {
+                               #clock-cells = <0>;
+                               compatible = "fixed-clock";
+                       };
+
+                       osc1: osc1 {
+                               #clock-cells = <0>;
+                               compatible = "fixed-clock";
+                       };
+
+                       qspi_clk: qspi-clk {
+                               #clock-cells = <0>;
+                               compatible = "fixed-clock";
+                               clock-frequency = <200000000>;
+                       };
+               };
+               gmac0: ethernet at ff800000 {
+                       compatible = "altr,socfpga-stmmac", "snps,dwmac-3.74a", "snps,dwmac";
+                       reg = <0xff800000 0x2000>;
+                       interrupts = <0 90 4>;
+                       interrupt-names = "macirq";
+                       mac-address = [00 00 00 00 00 00];
+                       resets = <&rst EMAC0_RESET>, <&rst EMAC0_OCP_RESET>;
+                       reset-names = "stmmaceth", "stmmaceth-ocp";
+                       tx-fifo-depth = <16384>;
+                       rx-fifo-depth = <16384>;
+                       snps,multicast-filter-bins = <256>;
+                       iommus = <&smmu 1>;
+                       altr,sysmgr-syscon = <&sysmgr 0x44 0>;
+                       clocks = <&clkmgr AGILEX_EMAC0_CLK>;
+                       clock-names = "stmmaceth";
+                       status = "disabled";
+               };
+
+               gmac1: ethernet at ff802000 {
+                       compatible = "altr,socfpga-stmmac", "snps,dwmac-3.74a", "snps,dwmac";
+                       reg = <0xff802000 0x2000>;
+                       interrupts = <0 91 4>;
+                       interrupt-names = "macirq";
+                       mac-address = [00 00 00 00 00 00];
+                       resets = <&rst EMAC1_RESET>, <&rst EMAC1_OCP_RESET>;
+                       reset-names = "stmmaceth", "stmmaceth-ocp";
+                       tx-fifo-depth = <16384>;
+                       rx-fifo-depth = <16384>;
+                       snps,multicast-filter-bins = <256>;
+                       iommus = <&smmu 2>;
+                       altr,sysmgr-syscon = <&sysmgr 0x48 8>;
+                       clocks = <&clkmgr AGILEX_EMAC1_CLK>;
+                       clock-names = "stmmaceth";
+                       status = "disabled";
+               };
+
+               gmac2: ethernet at ff804000 {
+                       compatible = "altr,socfpga-stmmac", "snps,dwmac-3.74a", "snps,dwmac";
+                       reg = <0xff804000 0x2000>;
+                       interrupts = <0 92 4>;
+                       interrupt-names = "macirq";
+                       mac-address = [00 00 00 00 00 00];
+                       resets = <&rst EMAC2_RESET>, <&rst EMAC2_OCP_RESET>;
+                       reset-names = "stmmaceth", "stmmaceth-ocp";
+                       tx-fifo-depth = <16384>;
+                       rx-fifo-depth = <16384>;
+                       snps,multicast-filter-bins = <256>;
+                       iommus = <&smmu 3>;
+                       altr,sysmgr-syscon = <&sysmgr 0x4c 16>;
+                       clocks = <&clkmgr AGILEX_EMAC2_CLK>;
+                       clock-names = "stmmaceth";
+                       status = "disabled";
+               };
+
+               gpio0: gpio at ffc03200 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "snps,dw-apb-gpio";
+                       reg = <0xffc03200 0x100>;
+                       resets = <&rst GPIO0_RESET>;
+                       status = "disabled";
+
+                       porta: gpio-controller at 0 {
+                               compatible = "snps,dw-apb-gpio-port";
+                               gpio-controller;
+                               #gpio-cells = <2>;
+                               snps,nr-gpios = <24>;
+                               reg = <0>;
+                               interrupt-controller;
+                               #interrupt-cells = <2>;
+                               interrupts = <0 110 4>;
+                       };
+               };
+
+               gpio1: gpio at ffc03300 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "snps,dw-apb-gpio";
+                       reg = <0xffc03300 0x100>;
+                       resets = <&rst GPIO1_RESET>;
+                       status = "disabled";
+
+                       portb: gpio-controller at 0 {
+                               compatible = "snps,dw-apb-gpio-port";
+                               gpio-controller;
+                               #gpio-cells = <2>;
+                               snps,nr-gpios = <24>;
+                               reg = <0>;
+                               interrupt-controller;
+                               #interrupt-cells = <2>;
+                               interrupts = <0 111 4>;
+                       };
+               };
+
+               i2c0: i2c at ffc02800 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "snps,designware-i2c";
+                       reg = <0xffc02800 0x100>;
+                       interrupts = <0 103 4>;
+                       resets = <&rst I2C0_RESET>;
+                       clocks = <&clkmgr AGILEX_L4_SP_CLK>;
+                       status = "disabled";
+               };
+
+               i2c1: i2c at ffc02900 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "snps,designware-i2c";
+                       reg = <0xffc02900 0x100>;
+                       interrupts = <0 104 4>;
+                       resets = <&rst I2C1_RESET>;
+                       clocks = <&clkmgr AGILEX_L4_SP_CLK>;
+                       status = "disabled";
+               };
+
+               i2c2: i2c at ffc02a00 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "snps,designware-i2c";
+                       reg = <0xffc02a00 0x100>;
+                       interrupts = <0 105 4>;
+                       resets = <&rst I2C2_RESET>;
+                       clocks = <&clkmgr AGILEX_L4_SP_CLK>;
+                       status = "disabled";
+               };
+
+               i2c3: i2c at ffc02b00 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "snps,designware-i2c";
+                       reg = <0xffc02b00 0x100>;
+                       interrupts = <0 106 4>;
+                       resets = <&rst I2C3_RESET>;
+                       clocks = <&clkmgr AGILEX_L4_SP_CLK>;
+                       status = "disabled";
+               };
+
+               i2c4: i2c at ffc02c00 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "snps,designware-i2c";
+                       reg = <0xffc02c00 0x100>;
+                       interrupts = <0 107 4>;
+                       resets = <&rst I2C4_RESET>;
+                       clocks = <&clkmgr AGILEX_L4_SP_CLK>;
+                       status = "disabled";
+               };
+
+               mmc: dwmmc0 at ff808000 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "altr,socfpga-dw-mshc";
+                       reg = <0xff808000 0x1000>;
+                       interrupts = <0 96 4>;
+                       fifo-depth = <0x400>;
+                       resets = <&rst SDMMC_RESET>;
+                       reset-names = "reset";
+                       clocks = <&clkmgr AGILEX_L4_MP_CLK>,
+                                <&clkmgr AGILEX_SDMMC_CLK>;
+                       clock-names = "biu", "ciu";
+                       iommus = <&smmu 5>;
+                       status = "disabled";
+               };
+
+               nand: nand at ffb90000 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "altr,socfpga-denali-nand";
+                       reg = <0xffb90000 0x10000>,
+                             <0xffb80000 0x1000>;
+                       reg-names = "nand_data", "denali_reg";
+                       interrupts = <0 97 4>;
+                       resets = <&rst NAND_RESET>, <&rst NAND_OCP_RESET>;
+                       status = "disabled";
+               };
+
+               ocram: sram at ffe00000 {
+                       compatible = "mmio-sram";
+                       reg = <0xffe00000 0x40000>;
+               };
+
+               pdma: pdma at ffda0000 {
+                       compatible = "arm,pl330", "arm,primecell";
+                       reg = <0xffda0000 0x1000>;
+                       interrupts = <0 81 4>,
+                                    <0 82 4>,
+                                    <0 83 4>,
+                                    <0 84 4>,
+                                    <0 85 4>,
+                                    <0 86 4>,
+                                    <0 87 4>,
+                                    <0 88 4>,
+                                    <0 89 4>;
+                       #dma-cells = <1>;
+                       #dma-channels = <8>;
+                       #dma-requests = <32>;
+                       resets = <&rst DMA_RESET>, <&rst DMA_OCP_RESET>;
+                       reset-names = "dma", "dma-ocp";
+                       clocks = <&clkmgr AGILEX_L4_MAIN_CLK>;
+                       clock-names = "apb_pclk";
+               };
+
+               rst: rstmgr at ffd11000 {
+                       #reset-cells = <1>;
+                       compatible = "altr,stratix10-rst-mgr";
+                       reg = <0xffd11000 0x100>;
+               };
+
+               smmu: iommu at fa000000 {
+                       compatible = "arm,mmu-500", "arm,smmu-v2";
+                       reg = <0xfa000000 0x40000>;
+                       #global-interrupts = <2>;
+                       #iommu-cells = <1>;
+                       interrupt-parent = <&intc>;
+                       interrupts = <0 128 4>, /* Global Secure Fault */
+                               <0 129 4>, /* Global Non-secure Fault */
+                               /* Non-secure Context Interrupts (32) */
+                               <0 138 4>, <0 139 4>, <0 140 4>, <0 141 4>,
+                               <0 142 4>, <0 143 4>, <0 144 4>, <0 145 4>,
+                               <0 146 4>, <0 147 4>, <0 148 4>, <0 149 4>,
+                               <0 150 4>, <0 151 4>, <0 152 4>, <0 153 4>,
+                               <0 154 4>, <0 155 4>, <0 156 4>, <0 157 4>,
+                               <0 158 4>, <0 159 4>, <0 160 4>, <0 161 4>,
+                               <0 162 4>, <0 163 4>, <0 164 4>, <0 165 4>,
+                               <0 166 4>, <0 167 4>, <0 168 4>, <0 169 4>;
+                       stream-match-mask = <0x7ff0>;
+                       status = "disabled";
+               };
+
+               spi0: spi at ffda4000 {
+                       compatible = "snps,dw-apb-ssi";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <0xffda4000 0x1000>;
+                       interrupts = <0 99 4>;
+                       resets = <&rst SPIM0_RESET>;
+                       reg-io-width = <4>;
+                       num-cs = <4>;
+                       clocks = <&clkmgr AGILEX_L4_MAIN_CLK>;
+                       status = "disabled";
+               };
+
+               spi1: spi at ffda5000 {
+                       compatible = "snps,dw-apb-ssi";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <0xffda5000 0x1000>;
+                       interrupts = <0 100 4>;
+                       resets = <&rst SPIM1_RESET>;
+                       reg-io-width = <4>;
+                       num-cs = <4>;
+                       clocks = <&clkmgr AGILEX_L4_MAIN_CLK>;
+                       status = "disabled";
+               };
+
+               sysmgr: sysmgr at ffd12000 {
+                       compatible = "altr,sys-mgr-s10","altr,sys-mgr";
+                       reg = <0xffd12000 0x500>;
+               };
+
+               /* Local timer */
+               timer {
+                       compatible = "arm,armv8-timer";
+                       interrupts = <1 13 0xf08>,
+                                    <1 14 0xf08>,
+                                    <1 11 0xf08>,
+                                    <1 10 0xf08>;
+               };
+
+               timer0: timer0 at ffc03000 {
+                       compatible = "snps,dw-apb-timer";
+                       interrupts = <0 113 4>;
+                       reg = <0xffc03000 0x100>;
+                       clocks = <&clkmgr AGILEX_L4_SP_CLK>;
+                       clock-names = "timer";
+               };
+
+               timer1: timer1 at ffc03100 {
+                       compatible = "snps,dw-apb-timer";
+                       interrupts = <0 114 4>;
+                       reg = <0xffc03100 0x100>;
+                       clocks = <&clkmgr AGILEX_L4_SP_CLK>;
+                       clock-names = "timer";
+               };
+
+               timer2: timer2 at ffd00000 {
+                       compatible = "snps,dw-apb-timer";
+                       interrupts = <0 115 4>;
+                       reg = <0xffd00000 0x100>;
+                       clocks = <&clkmgr AGILEX_L4_SP_CLK>;
+                       clock-names = "timer";
+               };
+
+               timer3: timer3 at ffd00100 {
+                       compatible = "snps,dw-apb-timer";
+                       interrupts = <0 116 4>;
+                       reg = <0xffd00100 0x100>;
+                       clocks = <&clkmgr AGILEX_L4_SP_CLK>;
+                       clock-names = "timer";
+               };
+
+               uart0: serial0 at ffc02000 {
+                       compatible = "snps,dw-apb-uart";
+                       reg = <0xffc02000 0x100>;
+                       interrupts = <0 108 4>;
+                       reg-shift = <2>;
+                       reg-io-width = <4>;
+                       resets = <&rst UART0_RESET>;
+                       status = "disabled";
+                       clocks = <&clkmgr AGILEX_L4_SP_CLK>;
+                       clock-frequency = <100000000>;
+               };
+
+               uart1: serial1 at ffc02100 {
+                       compatible = "snps,dw-apb-uart";
+                       reg = <0xffc02100 0x100>;
+                       interrupts = <0 109 4>;
+                       reg-shift = <2>;
+                       reg-io-width = <4>;
+                       resets = <&rst UART1_RESET>;
+                       clocks = <&clkmgr AGILEX_L4_SP_CLK>;
+                       status = "disabled";
+               };
+
+               usbphy0: usbphy at 0 {
+                       #phy-cells = <0>;
+                       compatible = "usb-nop-xceiv";
+                       status = "okay";
+               };
+
+               usb0: usb at ffb00000 {
+                       compatible = "snps,dwc2";
+                       reg = <0xffb00000 0x40000>;
+                       interrupts = <0 93 4>;
+                       phys = <&usbphy0>;
+                       phy-names = "usb2-phy";
+                       resets = <&rst USB0_RESET>, <&rst USB0_OCP_RESET>;
+                       reset-names = "dwc2", "dwc2-ecc";
+                       clocks = <&clkmgr AGILEX_USB_CLK>;
+                       iommus = <&smmu 6>;
+                       status = "disabled";
+               };
+
+               usb1: usb at ffb40000 {
+                       compatible = "snps,dwc2";
+                       reg = <0xffb40000 0x40000>;
+                       interrupts = <0 94 4>;
+                       phys = <&usbphy0>;
+                       phy-names = "usb2-phy";
+                       resets = <&rst USB1_RESET>, <&rst USB1_OCP_RESET>;
+                       reset-names = "dwc2", "dwc2-ecc";
+                       iommus = <&smmu 7>;
+                       clocks = <&clkmgr AGILEX_USB_CLK>;
+                       status = "disabled";
+               };
+
+               watchdog0: watchdog at ffd00200 {
+                       compatible = "snps,dw-wdt";
+                       reg = <0xffd00200 0x100>;
+                       interrupts = <0 117 4>;
+                       resets = <&rst WATCHDOG0_RESET>;
+                       clocks = <&clkmgr AGILEX_L4_SYS_FREE_CLK>;
+                       status = "disabled";
+               };
+
+               watchdog1: watchdog at ffd00300 {
+                       compatible = "snps,dw-wdt";
+                       reg = <0xffd00300 0x100>;
+                       interrupts = <0 118 4>;
+                       resets = <&rst WATCHDOG1_RESET>;
+                       clocks = <&clkmgr AGILEX_L4_SYS_FREE_CLK>;
+                       status = "disabled";
+               };
+
+               watchdog2: watchdog at ffd00400 {
+                       compatible = "snps,dw-wdt";
+                       reg = <0xffd00400 0x100>;
+                       interrupts = <0 125 4>;
+                       resets = <&rst WATCHDOG2_RESET>;
+                       clocks = <&clkmgr AGILEX_L4_SYS_FREE_CLK>;
+                       status = "disabled";
+               };
+
+               watchdog3: watchdog at ffd00500 {
+                       compatible = "snps,dw-wdt";
+                       reg = <0xffd00500 0x100>;
+                       interrupts = <0 126 4>;
+                       resets = <&rst WATCHDOG3_RESET>;
+                       clocks = <&clkmgr AGILEX_L4_SYS_FREE_CLK>;
+                       status = "disabled";
+               };
+
+               sdr: sdr at f8011100 {
+                       compatible = "altr,sdr-ctl", "syscon";
+                       reg = <0xf8011100 0xc0>;
+               };
+
+               eccmgr {
+                       compatible = "altr,socfpga-s10-ecc-manager",
+                                    "altr,socfpga-a10-ecc-manager";
+                       altr,sysmgr-syscon = <&sysmgr>;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       interrupts = <0 15 4>;
+                       interrupt-controller;
+                       #interrupt-cells = <2>;
+                       ranges;
+
+                       sdramedac {
+                               compatible = "altr,sdram-edac-s10";
+                               altr,sdr-syscon = <&sdr>;
+                               interrupts = <16 4>;
+                       };
+
+                       ocram-ecc at ff8cc000 {
+                               compatible = "altr,socfpga-s10-ocram-ecc",
+                                            "altr,socfpga-a10-ocram-ecc";
+                               reg = <0xff8cc000 0x100>;
+                               altr,ecc-parent = <&ocram>;
+                               interrupts = <1 4>;
+                       };
+
+                       usb0-ecc at ff8c4000 {
+                               compatible = "altr,socfpga-s10-usb-ecc",
+                                            "altr,socfpga-usb-ecc";
+                               reg = <0xff8c4000 0x100>;
+                               altr,ecc-parent = <&usb0>;
+                               interrupts = <2 4>;
+                       };
+
+                       emac0-rx-ecc at ff8c0000 {
+                               compatible = "altr,socfpga-s10-eth-mac-ecc",
+                                            "altr,socfpga-eth-mac-ecc";
+                               reg = <0xff8c0000 0x100>;
+                               altr,ecc-parent = <&gmac0>;
+                               interrupts = <4 4>;
+                       };
+
+                       emac0-tx-ecc at ff8c0400 {
+                               compatible = "altr,socfpga-s10-eth-mac-ecc",
+                                            "altr,socfpga-eth-mac-ecc";
+                               reg = <0xff8c0400 0x100>;
+                               altr,ecc-parent = <&gmac0>;
+                               interrupts = <5 4>;
+                       };
+
+                       sdmmca-ecc at ff8c8c00 {
+                               compatible = "altr,socfpga-s10-sdmmc-ecc",
+                                            "altr,socfpga-sdmmc-ecc";
+                               reg = <0xff8c8c00 0x100>;
+                               altr,ecc-parent = <&mmc>;
+                               interrupts = <14 4>,
+                                            <15 4>;
+                       };
+               };
+
+               qspi: spi at ff8d2000 {
+                       compatible = "cdns,qspi-nor";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <0xff8d2000 0x100>,
+                             <0xff900000 0x100000>;
+                       interrupts = <0 3 4>;
+                       cdns,fifo-depth = <128>;
+                       cdns,fifo-width = <4>;
+                       cdns,trigger-address = <0x00000000>;
+                       clocks = <&qspi_clk>;
+
+                       status = "disabled";
+               };
+
+               firmware {
+                       svc {
+                               compatible = "intel,stratix10-svc";
+                               method = "smc";
+                               memory-region = <&service_reserved>;
+
+                               fpga_mgr: fpga-mgr {
+                                       compatible = "intel,stratix10-soc-fpga-mgr";
+                               };
+                       };
+               };
+       };
+};
arch/arm/dts/socfpga_agilex_socdk-u-boot.dtsi new file +39 -0
new file mode 100644
index 0000000000..1908be4b8b
@@ -0,0 +1,39 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * U-Boot additions
+ *
+ * Copyright (C) 2019 Intel Corporation <www.intel.com>
+ */
+
+#include "socfpga_agilex-u-boot.dtsi"
+
+/{
+       aliases {
+               spi0 = &qspi;
+               i2c0 = &i2c1;
+       };
+
+       memory {
+               /* 8GB */
+               reg = <0 0x00000000 0 0x80000000>,
+                     <2 0x80000000 1 0x80000000>;
+       };
+};
+
+&flash0 {
+       compatible = "jedec,spi-nor";
+       spi-tx-bus-width = <4>;
+       spi-rx-bus-width = <4>;
+       u-boot,dm-pre-reloc;
+};
+
+&i2c1 {
+       status = "okay";
+};
+
+&mmc {
+       drvsel = <3>;
+       smplsel = <0>;
+       u-boot,dm-pre-reloc;
+};
+
arch/arm/dts/socfpga_agilex_socdk.dts new file +141 -1
new file mode 100644
index 0000000000..bcdeecc0e0
@@ -0,0 +1,141 @@
+// SPDX-License-Identifier:     GPL-2.0
+/*
+ * Copyright (C) 2019, Intel Corporation
+ */
+#include "socfpga_agilex.dtsi"
+
+/ {
+       model = "SoCFPGA Agilex SoCDK";
+
+       aliases {
+               serial0 = &uart0;
+               ethernet0 = &gmac0;
+               ethernet1 = &gmac1;
+               ethernet2 = &gmac2;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+
+       leds {
+               compatible = "gpio-leds";
+               hps0 {
+                       label = "hps_led0";
+                       gpios = <&portb 20 GPIO_ACTIVE_HIGH>;
+               };
+
+               hps1 {
+                       label = "hps_led1";
+                       gpios = <&portb 19 GPIO_ACTIVE_HIGH>;
+               };
+
+               hps2 {
+                       label = "hps_led2";
+                       gpios = <&portb 21 GPIO_ACTIVE_HIGH>;
+               };
+       };
+
+       memory {
+               device_type = "memory";
+               /* We expect the bootloader to fill in the reg */
+               reg = <0 0 0 0>;
+       };
+
+       soc {
+               clocks {
+                       osc1 {
+                               clock-frequency = <25000000>;
+                       };
+               };
+       };
+};
+
+&gpio1 {
+       status = "okay";
+};
+
+&gmac0 {
+       status = "okay";
+       phy-mode = "rgmii";
+       phy-handle = <&phy0>;
+
+       max-frame-size = <9000>;
+
+       mdio0 {
+               #address-cells = <1>;
+               #size-cells = <0>;
+               compatible = "snps,dwmac-mdio";
+               phy0: ethernet-phy at 0 {
+                       reg = <4>;
+
+                       txd0-skew-ps = <0>; /* -420ps */
+                       txd1-skew-ps = <0>; /* -420ps */
+                       txd2-skew-ps = <0>; /* -420ps */
+                       txd3-skew-ps = <0>; /* -420ps */
+                       rxd0-skew-ps = <420>; /* 0ps */
+                       rxd1-skew-ps = <420>; /* 0ps */
+                       rxd2-skew-ps = <420>; /* 0ps */
+                       rxd3-skew-ps = <420>; /* 0ps */
+                       txen-skew-ps = <0>; /* -420ps */
+                       txc-skew-ps = <900>; /* 0ps */
+                       rxdv-skew-ps = <420>; /* 0ps */
+                       rxc-skew-ps = <1680>; /* 780ps */
+               };
+       };
+};
+
+&mmc {
+       status = "okay";
+       cap-sd-highspeed;
+       broken-cd;
+       bus-width = <4>;
+};
+
+&uart0 {
+       status = "okay";
+};
+
+&usb0 {
+       status = "okay";
+       disable-over-current;
+};
+
+&watchdog0 {
+       status = "okay";
+};
+
+&qspi {
+       flash0: flash at 0 {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               compatible = "mt25qu02g";
+               reg = <0>;
+               spi-max-frequency = <100000000>;
+
+               m25p,fast-read;
+               cdns,page-size = <256>;
+               cdns,block-size = <16>;
+               cdns,read-delay = <1>;
+               cdns,tshsl-ns = <50>;
+               cdns,tsd2d-ns = <50>;
+               cdns,tchsh-ns = <4>;
+               cdns,tslch-ns = <4>;
+
+               partitions {
+                       compatible = "fixed-partitions";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+
+                       qspi_boot: partition at 0 {
+                               label = "Boot and fpga data";
+                               reg = <0x0 0x034B0000>;
+                       };
+
+                       qspi_rootfs: partition at 34B0000 {
+                               label = "Root Filesystem - JFFS2";
+                               reg = <0x034B0000 0x0EB50000>;
+                       };
+               };
+       };
+};
--

2.19.0

#21 lore raw

PATCH v8 17/19 arm: dts: agilex: Add base dtsi and devkit dts

Quoted 151 lines · Simon Goldschmidt
Quoted 149 lines · Ley Foon Tan
Quoted 146 lines · Simon Goldschmidt
Quoted 131 lines · Ley Foon Tan

Add device tree files for Agilex SoC platform.

socfpga_agilex-u-boot.dtsi and socfpga_agilex_socdk-u-boot.dts contains Uboot specific DT properties.

socfpga_agilex.dtsi and socfpga_agilex_socdk.dts are from Linux (kernel/git/dinguyen/linux.git, commit 6f0bf971bacacc)

---
v8:
- Include socfpga_agilex-u-boot.dtsi in socfpga_agilex_socdk-u-boot.dtsi, instead of include it in socfpga_agilex_socdk.dts.

v7:
- Update socfpga_agilex.dtsi and socfpga_agilex_socdk.dts from Linux.
- Add new socfpga_agilex_socdk-u-boot.dts file for Uboot specific DT properties.

v6:
- Use new macro names from agilex-clock.h.

v5:
- Add CCU DT node.

v4:
- Add u-boot,dm-pre-reloc to sysmgr node.

v3:
- Fixed bank 1 memory alias base address to 0x280000000.
- Rename STRATIX10_*_CLK to SOCFPGA_SOC64_*_CLK.
- Include socfpga-soc64-clock.h
- Change to "intel,sdr-ctl-agilex" for SDRAM node.

v2:
- Add clock property to device node.
- Change memory size to 8GB
- Enable i2c1

---
 arch/arm/dts/Makefile                         |   1 +
 arch/arm/dts/socfpga_agilex-u-boot.dtsi       |  96 +++
 arch/arm/dts/socfpga_agilex.dtsi              | 622 ++++++++++++++++++
 arch/arm/dts/socfpga_agilex_socdk-u-boot.dtsi |  39 ++
 arch/arm/dts/socfpga_agilex_socdk.dts         | 141 ++++
 5 files changed, 899 insertions(+)
 create mode 100644 arch/arm/dts/socfpga_agilex-u-boot.dtsi
 create mode 100644 arch/arm/dts/socfpga_agilex.dtsi
 create mode 100644 arch/arm/dts/socfpga_agilex_socdk-u-boot.dtsi
 create mode 100644 arch/arm/dts/socfpga_agilex_socdk.dts
arch/arm/dts/Makefile +1 -0
index d8846df1bd..e76f7c1407 100644
@@ -328,6 +328,7 @@ dtb-$(CONFIG_TI816X) += dm8168-evm.dtb
 dtb-$(CONFIG_THUNDERX) += thunderx-88xx.dtb
 
 dtb-$(CONFIG_ARCH_SOCFPGA) +=                          \
+       socfpga_agilex_socdk.dtb                        \
        socfpga_arria5_socdk.dtb                        \
        socfpga_arria10_socdk_sdmmc.dtb                 \
        socfpga_cyclone5_mcvevk.dtb                     \
arch/arm/dts/socfpga_agilex-u-boot.dtsi new file +61 -0
new file mode 100644
index 0000000000..f0528a9ad9
@@ -0,0 +1,96 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * U-Boot additions
+ *
+ * Copyright (C) 2019 Intel Corporation <www.intel.com>
+ */
+
+/{
+       memory {
+               #address-cells = <2>;
+               #size-cells = <2>;
+               u-boot,dm-pre-reloc;
+       };
+
+       soc {
+               u-boot,dm-pre-reloc;
+
+               ccu: cache-controller at f7000000 {
+                       compatible = "arteris,ncore-ccu";
+                       reg = <0xf7000000 0x100900>;
+                       u-boot,dm-pre-reloc;
+               };
+       };
+};
+
+&clkmgr {
+       u-boot,dm-pre-reloc;
+};
+
+&gmac1 {
+       altr,sysmgr-syscon = <&sysmgr 0x48 0>;
+};
+
+&gmac2 {
+       altr,sysmgr-syscon = <&sysmgr 0x4c 0>;
+};
+
+&i2c0 {
+       reset-names = "i2c";
+};
+
+&i2c1 {
+       reset-names = "i2c";
+};
+
+&i2c2 {
+       reset-names = "i2c";
+};
+
+&i2c3 {
+       reset-names = "i2c";
+};
+
+&mmc {
+       resets = <&rst SDMMC_RESET>, <&rst SDMMC_OCP_RESET>;
+};
+
+&porta {
+       bank-name = "porta";
+};
+

arch/arm/dts/socfpga_agilex-u-boot.dtsi line 71

Quoted 10 lines
arch/arm/dts/socfpga_agilex-u-boot.dtsi new file +10 -0
+&portb {
+       bank-name = "portb";
+};
+
+&qspi {
+       u-boot,dm-pre-reloc;
+};
+
+&rst {
+       compatible = "altr,rst-mgr";

This and other compatible-changing lines in this file should be synced to the correct string in all DTs, so please fix this in the upstream Linux DTs.

Quoted 6 lines
Quoted 3 lines

Linux uses "altr,rst-mgr" for Gen5 and Arria10, "altr,stratix10-rst-mgr" for S10 and Agilex.
But, Uboot uses "altr,rst-mgr" for all Gen5/Arria10/S10/Agilex platforms.

What prevents you from fixing the Linux drivers to use "altr,stratix10-rst-mgr", too?

Linux driver already use "altr,stratix10-rst-mgr".
Are you mean fixing Uboot reset driver to support "altr,stratix10-rst-mgr"?

Quoted 33 lines

A devicetree should describe the hardware in a generic, OS-agnostic way as much as possible.

Quoted 11 lines
Quoted 10 lines

arch/arm/dts/socfpga_agilex-u-boot.dtsi line 77

Quoted 8 lines
arch/arm/dts/socfpga_agilex-u-boot.dtsi new file +6 -0
+       altr,modrst-offset = <0x20>;
+       u-boot,dm-pre-reloc;
+};
+
+&sdr {
+       compatible = "intel,sdr-ctl-agilex";

See above.

Linux doesn't have DDR device tree node. DDR driver is only needed in Uboot.

That's not the point. As written above, a devicetree describes hardware. The fact that Linux does not use this piece of hardware doesn't mean it must be removed from the dts in the Linux sources.

Quoted 13 lines
Quoted 13 lines

arch/arm/dts/socfpga_agilex-u-boot.dtsi line 86

Quoted 11 lines
arch/arm/dts/socfpga_agilex-u-boot.dtsi new file +9 -0
+       reg = <0xf8000400 0x80>,
+             <0xf8010000 0x190>,
+             <0xf8011000 0x500>;
+       resets = <&rst DDRSCH_RESET>;
+       u-boot,dm-pre-reloc;
+};
+
+&sysmgr {
+       compatible = "altr,sys-mgr", "syscon";

See above.

Quoted 4 lines
Quoted 1 line

Linux dts just removed "syscon" recently. But, Uboot needs it.

Hmm, can we fix the sysmgr driver to behave as syscon? Than we could remove this for U-Boot, too.

I will see how to do this.

Regards
Ley Foon

Quoted 841 lines
Quoted 841 lines
Quoted 841 lines

Ultimately, you should onle need 'u-boot,dm-pre-reloc' tags in this file and probably some boot source defititions.

However, until that is done, it's probably ok to have this here, so:

Quoted 833 lines
arch/arm/dts/socfpga_agilex-u-boot.dtsi new file +10 -0
+       u-boot,dm-pre-reloc;
+};
+
+&uart0 {
+       u-boot,dm-pre-reloc;
+};
+
+&watchdog0 {
+       u-boot,dm-pre-reloc;
+};
arch/arm/dts/socfpga_agilex.dtsi new file +622 -0
new file mode 100644
index 0000000000..179b4d5591
@@ -0,0 +1,622 @@
+// SPDX-License-Identifier:     GPL-2.0
+/*
+ * Copyright (C) 2019, Intel Corporation
+ */
+
+/dts-v1/;
+#include <dt-bindings/reset/altr,rst-mgr-s10.h>
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/clock/agilex-clock.h>
+
+/ {
+       compatible = "intel,socfpga-agilex";
+       #address-cells = <2>;
+       #size-cells = <2>;
+
+       reserved-memory {
+               #address-cells = <2>;
+               #size-cells = <2>;
+               ranges;
+
+               service_reserved: svcbuffer at 0 {
+                       compatible = "shared-dma-pool";
+                       reg = <0x0 0x0 0x0 0x1000000>;
+                       alignment = <0x1000>;
+                       no-map;
+               };
+       };
+
+       cpus {
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               cpu0: cpu at 0 {
+                       compatible = "arm,cortex-a53";
+                       device_type = "cpu";
+                       enable-method = "psci";
+                       reg = <0x0>;
+               };
+
+               cpu1: cpu at 1 {
+                       compatible = "arm,cortex-a53";
+                       device_type = "cpu";
+                       enable-method = "psci";
+                       reg = <0x1>;
+               };
+
+               cpu2: cpu at 2 {
+                       compatible = "arm,cortex-a53";
+                       device_type = "cpu";
+                       enable-method = "psci";
+                       reg = <0x2>;
+               };
+
+               cpu3: cpu at 3 {
+                       compatible = "arm,cortex-a53";
+                       device_type = "cpu";
+                       enable-method = "psci";
+                       reg = <0x3>;
+               };
+       };
+
+       pmu {
+               compatible = "arm,armv8-pmuv3";
+               interrupts = <0 170 4>,
+                            <0 171 4>,
+                            <0 172 4>,
+                            <0 173 4>;
+               interrupt-affinity = <&cpu0>,
+                                    <&cpu1>,
+                                    <&cpu2>,
+                                    <&cpu3>;
+               interrupt-parent = <&intc>;
+       };
+
+       psci {
+               compatible = "arm,psci-0.2";
+               method = "smc";
+       };
+
+       intc: intc at fffc1000 {
+               compatible = "arm,gic-400", "arm,cortex-a15-gic";
+               #interrupt-cells = <3>;
+               interrupt-controller;
+               reg = <0x0 0xfffc1000 0x0 0x1000>,
+                     <0x0 0xfffc2000 0x0 0x2000>,
+                     <0x0 0xfffc4000 0x0 0x2000>,
+                     <0x0 0xfffc6000 0x0 0x2000>;
+       };
+
+       soc {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               compatible = "simple-bus";
+               device_type = "soc";
+               interrupt-parent = <&intc>;
+               ranges = <0 0 0 0xffffffff>;
+
+               base_fpga_region {
+                       #address-cells = <0x1>;
+                       #size-cells = <0x1>;
+                       compatible = "fpga-region";
+                       fpga-mgr = <&fpga_mgr>;
+               };
+
+               clkmgr: clock-controller at ffd10000 {
+                       compatible = "intel,agilex-clkmgr";
+                       reg = <0xffd10000 0x1000>;
+                       #clock-cells = <1>;
+               };
+
+               clocks {
+                       cb_intosc_hs_div2_clk: cb-intosc-hs-div2-clk {
+                               #clock-cells = <0>;
+                               compatible = "fixed-clock";
+                       };
+
+                       cb_intosc_ls_clk: cb-intosc-ls-clk {
+                               #clock-cells = <0>;
+                               compatible = "fixed-clock";
+                       };
+
+                       f2s_free_clk: f2s-free-clk {
+                               #clock-cells = <0>;
+                               compatible = "fixed-clock";
+                       };
+
+                       osc1: osc1 {
+                               #clock-cells = <0>;
+                               compatible = "fixed-clock";
+                       };
+
+                       qspi_clk: qspi-clk {
+                               #clock-cells = <0>;
+                               compatible = "fixed-clock";
+                               clock-frequency = <200000000>;
+                       };
+               };
+               gmac0: ethernet at ff800000 {
+                       compatible = "altr,socfpga-stmmac", "snps,dwmac-3.74a", "snps,dwmac";
+                       reg = <0xff800000 0x2000>;
+                       interrupts = <0 90 4>;
+                       interrupt-names = "macirq";
+                       mac-address = [00 00 00 00 00 00];
+                       resets = <&rst EMAC0_RESET>, <&rst EMAC0_OCP_RESET>;
+                       reset-names = "stmmaceth", "stmmaceth-ocp";
+                       tx-fifo-depth = <16384>;
+                       rx-fifo-depth = <16384>;
+                       snps,multicast-filter-bins = <256>;
+                       iommus = <&smmu 1>;
+                       altr,sysmgr-syscon = <&sysmgr 0x44 0>;
+                       clocks = <&clkmgr AGILEX_EMAC0_CLK>;
+                       clock-names = "stmmaceth";
+                       status = "disabled";
+               };
+
+               gmac1: ethernet at ff802000 {
+                       compatible = "altr,socfpga-stmmac", "snps,dwmac-3.74a", "snps,dwmac";
+                       reg = <0xff802000 0x2000>;
+                       interrupts = <0 91 4>;
+                       interrupt-names = "macirq";
+                       mac-address = [00 00 00 00 00 00];
+                       resets = <&rst EMAC1_RESET>, <&rst EMAC1_OCP_RESET>;
+                       reset-names = "stmmaceth", "stmmaceth-ocp";
+                       tx-fifo-depth = <16384>;
+                       rx-fifo-depth = <16384>;
+                       snps,multicast-filter-bins = <256>;
+                       iommus = <&smmu 2>;
+                       altr,sysmgr-syscon = <&sysmgr 0x48 8>;
+                       clocks = <&clkmgr AGILEX_EMAC1_CLK>;
+                       clock-names = "stmmaceth";
+                       status = "disabled";
+               };
+
+               gmac2: ethernet at ff804000 {
+                       compatible = "altr,socfpga-stmmac", "snps,dwmac-3.74a", "snps,dwmac";
+                       reg = <0xff804000 0x2000>;
+                       interrupts = <0 92 4>;
+                       interrupt-names = "macirq";
+                       mac-address = [00 00 00 00 00 00];
+                       resets = <&rst EMAC2_RESET>, <&rst EMAC2_OCP_RESET>;
+                       reset-names = "stmmaceth", "stmmaceth-ocp";
+                       tx-fifo-depth = <16384>;
+                       rx-fifo-depth = <16384>;
+                       snps,multicast-filter-bins = <256>;
+                       iommus = <&smmu 3>;
+                       altr,sysmgr-syscon = <&sysmgr 0x4c 16>;
+                       clocks = <&clkmgr AGILEX_EMAC2_CLK>;
+                       clock-names = "stmmaceth";
+                       status = "disabled";
+               };
+
+               gpio0: gpio at ffc03200 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "snps,dw-apb-gpio";
+                       reg = <0xffc03200 0x100>;
+                       resets = <&rst GPIO0_RESET>;
+                       status = "disabled";
+
+                       porta: gpio-controller at 0 {
+                               compatible = "snps,dw-apb-gpio-port";
+                               gpio-controller;
+                               #gpio-cells = <2>;
+                               snps,nr-gpios = <24>;
+                               reg = <0>;
+                               interrupt-controller;
+                               #interrupt-cells = <2>;
+                               interrupts = <0 110 4>;
+                       };
+               };
+
+               gpio1: gpio at ffc03300 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "snps,dw-apb-gpio";
+                       reg = <0xffc03300 0x100>;
+                       resets = <&rst GPIO1_RESET>;
+                       status = "disabled";
+
+                       portb: gpio-controller at 0 {
+                               compatible = "snps,dw-apb-gpio-port";
+                               gpio-controller;
+                               #gpio-cells = <2>;
+                               snps,nr-gpios = <24>;
+                               reg = <0>;
+                               interrupt-controller;
+                               #interrupt-cells = <2>;
+                               interrupts = <0 111 4>;
+                       };
+               };
+
+               i2c0: i2c at ffc02800 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "snps,designware-i2c";
+                       reg = <0xffc02800 0x100>;
+                       interrupts = <0 103 4>;
+                       resets = <&rst I2C0_RESET>;
+                       clocks = <&clkmgr AGILEX_L4_SP_CLK>;
+                       status = "disabled";
+               };
+
+               i2c1: i2c at ffc02900 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "snps,designware-i2c";
+                       reg = <0xffc02900 0x100>;
+                       interrupts = <0 104 4>;
+                       resets = <&rst I2C1_RESET>;
+                       clocks = <&clkmgr AGILEX_L4_SP_CLK>;
+                       status = "disabled";
+               };
+
+               i2c2: i2c at ffc02a00 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "snps,designware-i2c";
+                       reg = <0xffc02a00 0x100>;
+                       interrupts = <0 105 4>;
+                       resets = <&rst I2C2_RESET>;
+                       clocks = <&clkmgr AGILEX_L4_SP_CLK>;
+                       status = "disabled";
+               };
+
+               i2c3: i2c at ffc02b00 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "snps,designware-i2c";
+                       reg = <0xffc02b00 0x100>;
+                       interrupts = <0 106 4>;
+                       resets = <&rst I2C3_RESET>;
+                       clocks = <&clkmgr AGILEX_L4_SP_CLK>;
+                       status = "disabled";
+               };
+
+               i2c4: i2c at ffc02c00 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "snps,designware-i2c";
+                       reg = <0xffc02c00 0x100>;
+                       interrupts = <0 107 4>;
+                       resets = <&rst I2C4_RESET>;
+                       clocks = <&clkmgr AGILEX_L4_SP_CLK>;
+                       status = "disabled";
+               };
+
+               mmc: dwmmc0 at ff808000 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "altr,socfpga-dw-mshc";
+                       reg = <0xff808000 0x1000>;
+                       interrupts = <0 96 4>;
+                       fifo-depth = <0x400>;
+                       resets = <&rst SDMMC_RESET>;
+                       reset-names = "reset";
+                       clocks = <&clkmgr AGILEX_L4_MP_CLK>,
+                                <&clkmgr AGILEX_SDMMC_CLK>;
+                       clock-names = "biu", "ciu";
+                       iommus = <&smmu 5>;
+                       status = "disabled";
+               };
+
+               nand: nand at ffb90000 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "altr,socfpga-denali-nand";
+                       reg = <0xffb90000 0x10000>,
+                             <0xffb80000 0x1000>;
+                       reg-names = "nand_data", "denali_reg";
+                       interrupts = <0 97 4>;
+                       resets = <&rst NAND_RESET>, <&rst NAND_OCP_RESET>;
+                       status = "disabled";
+               };
+
+               ocram: sram at ffe00000 {
+                       compatible = "mmio-sram";
+                       reg = <0xffe00000 0x40000>;
+               };
+
+               pdma: pdma at ffda0000 {
+                       compatible = "arm,pl330", "arm,primecell";
+                       reg = <0xffda0000 0x1000>;
+                       interrupts = <0 81 4>,
+                                    <0 82 4>,
+                                    <0 83 4>,
+                                    <0 84 4>,
+                                    <0 85 4>,
+                                    <0 86 4>,
+                                    <0 87 4>,
+                                    <0 88 4>,
+                                    <0 89 4>;
+                       #dma-cells = <1>;
+                       #dma-channels = <8>;
+                       #dma-requests = <32>;
+                       resets = <&rst DMA_RESET>, <&rst DMA_OCP_RESET>;
+                       reset-names = "dma", "dma-ocp";
+                       clocks = <&clkmgr AGILEX_L4_MAIN_CLK>;
+                       clock-names = "apb_pclk";
+               };
+
+               rst: rstmgr at ffd11000 {
+                       #reset-cells = <1>;
+                       compatible = "altr,stratix10-rst-mgr";
+                       reg = <0xffd11000 0x100>;
+               };
+
+               smmu: iommu at fa000000 {
+                       compatible = "arm,mmu-500", "arm,smmu-v2";
+                       reg = <0xfa000000 0x40000>;
+                       #global-interrupts = <2>;
+                       #iommu-cells = <1>;
+                       interrupt-parent = <&intc>;
+                       interrupts = <0 128 4>, /* Global Secure Fault */
+                               <0 129 4>, /* Global Non-secure Fault */
+                               /* Non-secure Context Interrupts (32) */
+                               <0 138 4>, <0 139 4>, <0 140 4>, <0 141 4>,
+                               <0 142 4>, <0 143 4>, <0 144 4>, <0 145 4>,
+                               <0 146 4>, <0 147 4>, <0 148 4>, <0 149 4>,
+                               <0 150 4>, <0 151 4>, <0 152 4>, <0 153 4>,
+                               <0 154 4>, <0 155 4>, <0 156 4>, <0 157 4>,
+                               <0 158 4>, <0 159 4>, <0 160 4>, <0 161 4>,
+                               <0 162 4>, <0 163 4>, <0 164 4>, <0 165 4>,
+                               <0 166 4>, <0 167 4>, <0 168 4>, <0 169 4>;
+                       stream-match-mask = <0x7ff0>;
+                       status = "disabled";
+               };
+
+               spi0: spi at ffda4000 {
+                       compatible = "snps,dw-apb-ssi";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <0xffda4000 0x1000>;
+                       interrupts = <0 99 4>;
+                       resets = <&rst SPIM0_RESET>;
+                       reg-io-width = <4>;
+                       num-cs = <4>;
+                       clocks = <&clkmgr AGILEX_L4_MAIN_CLK>;
+                       status = "disabled";
+               };
+
+               spi1: spi at ffda5000 {
+                       compatible = "snps,dw-apb-ssi";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <0xffda5000 0x1000>;
+                       interrupts = <0 100 4>;
+                       resets = <&rst SPIM1_RESET>;
+                       reg-io-width = <4>;
+                       num-cs = <4>;
+                       clocks = <&clkmgr AGILEX_L4_MAIN_CLK>;
+                       status = "disabled";
+               };
+
+               sysmgr: sysmgr at ffd12000 {
+                       compatible = "altr,sys-mgr-s10","altr,sys-mgr";
+                       reg = <0xffd12000 0x500>;
+               };
+
+               /* Local timer */
+               timer {
+                       compatible = "arm,armv8-timer";
+                       interrupts = <1 13 0xf08>,
+                                    <1 14 0xf08>,
+                                    <1 11 0xf08>,
+                                    <1 10 0xf08>;
+               };
+
+               timer0: timer0 at ffc03000 {
+                       compatible = "snps,dw-apb-timer";
+                       interrupts = <0 113 4>;
+                       reg = <0xffc03000 0x100>;
+                       clocks = <&clkmgr AGILEX_L4_SP_CLK>;
+                       clock-names = "timer";
+               };
+
+               timer1: timer1 at ffc03100 {
+                       compatible = "snps,dw-apb-timer";
+                       interrupts = <0 114 4>;
+                       reg = <0xffc03100 0x100>;
+                       clocks = <&clkmgr AGILEX_L4_SP_CLK>;
+                       clock-names = "timer";
+               };
+
+               timer2: timer2 at ffd00000 {
+                       compatible = "snps,dw-apb-timer";
+                       interrupts = <0 115 4>;
+                       reg = <0xffd00000 0x100>;
+                       clocks = <&clkmgr AGILEX_L4_SP_CLK>;
+                       clock-names = "timer";
+               };
+
+               timer3: timer3 at ffd00100 {
+                       compatible = "snps,dw-apb-timer";
+                       interrupts = <0 116 4>;
+                       reg = <0xffd00100 0x100>;
+                       clocks = <&clkmgr AGILEX_L4_SP_CLK>;
+                       clock-names = "timer";
+               };
+
+               uart0: serial0 at ffc02000 {
+                       compatible = "snps,dw-apb-uart";
+                       reg = <0xffc02000 0x100>;
+                       interrupts = <0 108 4>;
+                       reg-shift = <2>;
+                       reg-io-width = <4>;
+                       resets = <&rst UART0_RESET>;
+                       status = "disabled";
+                       clocks = <&clkmgr AGILEX_L4_SP_CLK>;
+                       clock-frequency = <100000000>;
+               };
+
+               uart1: serial1 at ffc02100 {
+                       compatible = "snps,dw-apb-uart";
+                       reg = <0xffc02100 0x100>;
+                       interrupts = <0 109 4>;
+                       reg-shift = <2>;
+                       reg-io-width = <4>;
+                       resets = <&rst UART1_RESET>;
+                       clocks = <&clkmgr AGILEX_L4_SP_CLK>;
+                       status = "disabled";
+               };
+
+               usbphy0: usbphy at 0 {
+                       #phy-cells = <0>;
+                       compatible = "usb-nop-xceiv";
+                       status = "okay";
+               };
+
+               usb0: usb at ffb00000 {
+                       compatible = "snps,dwc2";
+                       reg = <0xffb00000 0x40000>;
+                       interrupts = <0 93 4>;
+                       phys = <&usbphy0>;
+                       phy-names = "usb2-phy";
+                       resets = <&rst USB0_RESET>, <&rst USB0_OCP_RESET>;
+                       reset-names = "dwc2", "dwc2-ecc";
+                       clocks = <&clkmgr AGILEX_USB_CLK>;
+                       iommus = <&smmu 6>;
+                       status = "disabled";
+               };
+
+               usb1: usb at ffb40000 {
+                       compatible = "snps,dwc2";
+                       reg = <0xffb40000 0x40000>;
+                       interrupts = <0 94 4>;
+                       phys = <&usbphy0>;
+                       phy-names = "usb2-phy";
+                       resets = <&rst USB1_RESET>, <&rst USB1_OCP_RESET>;
+                       reset-names = "dwc2", "dwc2-ecc";
+                       iommus = <&smmu 7>;
+                       clocks = <&clkmgr AGILEX_USB_CLK>;
+                       status = "disabled";
+               };
+
+               watchdog0: watchdog at ffd00200 {
+                       compatible = "snps,dw-wdt";
+                       reg = <0xffd00200 0x100>;
+                       interrupts = <0 117 4>;
+                       resets = <&rst WATCHDOG0_RESET>;
+                       clocks = <&clkmgr AGILEX_L4_SYS_FREE_CLK>;
+                       status = "disabled";
+               };
+
+               watchdog1: watchdog at ffd00300 {
+                       compatible = "snps,dw-wdt";
+                       reg = <0xffd00300 0x100>;
+                       interrupts = <0 118 4>;
+                       resets = <&rst WATCHDOG1_RESET>;
+                       clocks = <&clkmgr AGILEX_L4_SYS_FREE_CLK>;
+                       status = "disabled";
+               };
+
+               watchdog2: watchdog at ffd00400 {
+                       compatible = "snps,dw-wdt";
+                       reg = <0xffd00400 0x100>;
+                       interrupts = <0 125 4>;
+                       resets = <&rst WATCHDOG2_RESET>;
+                       clocks = <&clkmgr AGILEX_L4_SYS_FREE_CLK>;
+                       status = "disabled";
+               };
+
+               watchdog3: watchdog at ffd00500 {
+                       compatible = "snps,dw-wdt";
+                       reg = <0xffd00500 0x100>;
+                       interrupts = <0 126 4>;
+                       resets = <&rst WATCHDOG3_RESET>;
+                       clocks = <&clkmgr AGILEX_L4_SYS_FREE_CLK>;
+                       status = "disabled";
+               };
+
+               sdr: sdr at f8011100 {
+                       compatible = "altr,sdr-ctl", "syscon";
+                       reg = <0xf8011100 0xc0>;
+               };
+
+               eccmgr {
+                       compatible = "altr,socfpga-s10-ecc-manager",
+                                    "altr,socfpga-a10-ecc-manager";
+                       altr,sysmgr-syscon = <&sysmgr>;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       interrupts = <0 15 4>;
+                       interrupt-controller;
+                       #interrupt-cells = <2>;
+                       ranges;
+
+                       sdramedac {
+                               compatible = "altr,sdram-edac-s10";
+                               altr,sdr-syscon = <&sdr>;
+                               interrupts = <16 4>;
+                       };
+
+                       ocram-ecc at ff8cc000 {
+                               compatible = "altr,socfpga-s10-ocram-ecc",
+                                            "altr,socfpga-a10-ocram-ecc";
+                               reg = <0xff8cc000 0x100>;
+                               altr,ecc-parent = <&ocram>;
+                               interrupts = <1 4>;
+                       };
+
+                       usb0-ecc at ff8c4000 {
+                               compatible = "altr,socfpga-s10-usb-ecc",
+                                            "altr,socfpga-usb-ecc";
+                               reg = <0xff8c4000 0x100>;
+                               altr,ecc-parent = <&usb0>;
+                               interrupts = <2 4>;
+                       };
+
+                       emac0-rx-ecc at ff8c0000 {
+                               compatible = "altr,socfpga-s10-eth-mac-ecc",
+                                            "altr,socfpga-eth-mac-ecc";
+                               reg = <0xff8c0000 0x100>;
+                               altr,ecc-parent = <&gmac0>;
+                               interrupts = <4 4>;
+                       };
+
+                       emac0-tx-ecc at ff8c0400 {
+                               compatible = "altr,socfpga-s10-eth-mac-ecc",
+                                            "altr,socfpga-eth-mac-ecc";
+                               reg = <0xff8c0400 0x100>;
+                               altr,ecc-parent = <&gmac0>;
+                               interrupts = <5 4>;
+                       };
+
+                       sdmmca-ecc at ff8c8c00 {
+                               compatible = "altr,socfpga-s10-sdmmc-ecc",
+                                            "altr,socfpga-sdmmc-ecc";
+                               reg = <0xff8c8c00 0x100>;
+                               altr,ecc-parent = <&mmc>;
+                               interrupts = <14 4>,
+                                            <15 4>;
+                       };
+               };
+
+               qspi: spi at ff8d2000 {
+                       compatible = "cdns,qspi-nor";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <0xff8d2000 0x100>,
+                             <0xff900000 0x100000>;
+                       interrupts = <0 3 4>;
+                       cdns,fifo-depth = <128>;
+                       cdns,fifo-width = <4>;
+                       cdns,trigger-address = <0x00000000>;
+                       clocks = <&qspi_clk>;
+
+                       status = "disabled";
+               };
+
+               firmware {
+                       svc {
+                               compatible = "intel,stratix10-svc";
+                               method = "smc";
+                               memory-region = <&service_reserved>;
+
+                               fpga_mgr: fpga-mgr {
+                                       compatible = "intel,stratix10-soc-fpga-mgr";
+                               };
+                       };
+               };
+       };
+};
arch/arm/dts/socfpga_agilex_socdk-u-boot.dtsi new file +39 -0
new file mode 100644
index 0000000000..1908be4b8b
@@ -0,0 +1,39 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * U-Boot additions
+ *
+ * Copyright (C) 2019 Intel Corporation <www.intel.com>
+ */
+
+#include "socfpga_agilex-u-boot.dtsi"
+
+/{
+       aliases {
+               spi0 = &qspi;
+               i2c0 = &i2c1;
+       };
+
+       memory {
+               /* 8GB */
+               reg = <0 0x00000000 0 0x80000000>,
+                     <2 0x80000000 1 0x80000000>;
+       };
+};
+
+&flash0 {
+       compatible = "jedec,spi-nor";
+       spi-tx-bus-width = <4>;
+       spi-rx-bus-width = <4>;
+       u-boot,dm-pre-reloc;
+};
+
+&i2c1 {
+       status = "okay";
+};
+
+&mmc {
+       drvsel = <3>;
+       smplsel = <0>;
+       u-boot,dm-pre-reloc;
+};
+
arch/arm/dts/socfpga_agilex_socdk.dts new file +141 -1
new file mode 100644
index 0000000000..bcdeecc0e0
@@ -0,0 +1,141 @@
+// SPDX-License-Identifier:     GPL-2.0
+/*
+ * Copyright (C) 2019, Intel Corporation
+ */
+#include "socfpga_agilex.dtsi"
+
+/ {
+       model = "SoCFPGA Agilex SoCDK";
+
+       aliases {
+               serial0 = &uart0;
+               ethernet0 = &gmac0;
+               ethernet1 = &gmac1;
+               ethernet2 = &gmac2;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+
+       leds {
+               compatible = "gpio-leds";
+               hps0 {
+                       label = "hps_led0";
+                       gpios = <&portb 20 GPIO_ACTIVE_HIGH>;
+               };
+
+               hps1 {
+                       label = "hps_led1";
+                       gpios = <&portb 19 GPIO_ACTIVE_HIGH>;
+               };
+
+               hps2 {
+                       label = "hps_led2";
+                       gpios = <&portb 21 GPIO_ACTIVE_HIGH>;
+               };
+       };
+
+       memory {
+               device_type = "memory";
+               /* We expect the bootloader to fill in the reg */
+               reg = <0 0 0 0>;
+       };
+
+       soc {
+               clocks {
+                       osc1 {
+                               clock-frequency = <25000000>;
+                       };
+               };
+       };
+};
+
+&gpio1 {
+       status = "okay";
+};
+
+&gmac0 {
+       status = "okay";
+       phy-mode = "rgmii";
+       phy-handle = <&phy0>;
+
+       max-frame-size = <9000>;
+
+       mdio0 {
+               #address-cells = <1>;
+               #size-cells = <0>;
+               compatible = "snps,dwmac-mdio";
+               phy0: ethernet-phy at 0 {
+                       reg = <4>;
+
+                       txd0-skew-ps = <0>; /* -420ps */
+                       txd1-skew-ps = <0>; /* -420ps */
+                       txd2-skew-ps = <0>; /* -420ps */
+                       txd3-skew-ps = <0>; /* -420ps */
+                       rxd0-skew-ps = <420>; /* 0ps */
+                       rxd1-skew-ps = <420>; /* 0ps */
+                       rxd2-skew-ps = <420>; /* 0ps */
+                       rxd3-skew-ps = <420>; /* 0ps */
+                       txen-skew-ps = <0>; /* -420ps */
+                       txc-skew-ps = <900>; /* 0ps */
+                       rxdv-skew-ps = <420>; /* 0ps */
+                       rxc-skew-ps = <1680>; /* 780ps */
+               };
+       };
+};
+
+&mmc {
+       status = "okay";
+       cap-sd-highspeed;
+       broken-cd;
+       bus-width = <4>;
+};
+
+&uart0 {
+       status = "okay";
+};
+
+&usb0 {
+       status = "okay";
+       disable-over-current;
+};
+
+&watchdog0 {
+       status = "okay";
+};
+
+&qspi {
+       flash0: flash at 0 {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               compatible = "mt25qu02g";
+               reg = <0>;
+               spi-max-frequency = <100000000>;
+
+               m25p,fast-read;
+               cdns,page-size = <256>;
+               cdns,block-size = <16>;
+               cdns,read-delay = <1>;
+               cdns,tshsl-ns = <50>;
+               cdns,tsd2d-ns = <50>;
+               cdns,tchsh-ns = <4>;
+               cdns,tslch-ns = <4>;
+
+               partitions {
+                       compatible = "fixed-partitions";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+
+                       qspi_boot: partition at 0 {
+                               label = "Boot and fpga data";
+                               reg = <0x0 0x034B0000>;
+                       };
+
+                       qspi_rootfs: partition at 34B0000 {
+                               label = "Root Filesystem - JFFS2";
+                               reg = <0x034B0000 0x0EB50000>;
+                       };
+               };
+       };
+};
--

2.19.0

#22 lore raw

PATCH v8 17/19 arm: dts: agilex: Add base dtsi and devkit dts

In reply to Ley Foon Tan
Quoted 162 lines · Ley Foon Tan
Quoted 138 lines · Simon Goldschmidt
Quoted 136 lines · Ley Foon Tan

Add device tree files for Agilex SoC platform.

socfpga_agilex-u-boot.dtsi and socfpga_agilex_socdk-u-boot.dts contains Uboot specific DT properties.

socfpga_agilex.dtsi and socfpga_agilex_socdk.dts are from Linux (kernel/git/dinguyen/linux.git, commit 6f0bf971bacacc)

---
v8:
- Include socfpga_agilex-u-boot.dtsi in socfpga_agilex_socdk-u-boot.dtsi, instead of include it in socfpga_agilex_socdk.dts.

v7:
- Update socfpga_agilex.dtsi and socfpga_agilex_socdk.dts from Linux.
- Add new socfpga_agilex_socdk-u-boot.dts file for Uboot specific DT properties.

v6:
- Use new macro names from agilex-clock.h.

v5:
- Add CCU DT node.

v4:
- Add u-boot,dm-pre-reloc to sysmgr node.

v3:
- Fixed bank 1 memory alias base address to 0x280000000.
- Rename STRATIX10_*_CLK to SOCFPGA_SOC64_*_CLK.
- Include socfpga-soc64-clock.h
- Change to "intel,sdr-ctl-agilex" for SDRAM node.

v2:
- Add clock property to device node.
- Change memory size to 8GB
- Enable i2c1

---
 arch/arm/dts/Makefile                         |   1 +
 arch/arm/dts/socfpga_agilex-u-boot.dtsi       |  96 +++
 arch/arm/dts/socfpga_agilex.dtsi              | 622 ++++++++++++++++++
 arch/arm/dts/socfpga_agilex_socdk-u-boot.dtsi |  39 ++
 arch/arm/dts/socfpga_agilex_socdk.dts         | 141 ++++
 5 files changed, 899 insertions(+)
 create mode 100644 arch/arm/dts/socfpga_agilex-u-boot.dtsi
 create mode 100644 arch/arm/dts/socfpga_agilex.dtsi
 create mode 100644 arch/arm/dts/socfpga_agilex_socdk-u-boot.dtsi
 create mode 100644 arch/arm/dts/socfpga_agilex_socdk.dts
arch/arm/dts/Makefile +1 -0
index d8846df1bd..e76f7c1407 100644
@@ -328,6 +328,7 @@ dtb-$(CONFIG_TI816X) += dm8168-evm.dtb
 dtb-$(CONFIG_THUNDERX) += thunderx-88xx.dtb
 
 dtb-$(CONFIG_ARCH_SOCFPGA) +=                          \
+       socfpga_agilex_socdk.dtb                        \
        socfpga_arria5_socdk.dtb                        \
        socfpga_arria10_socdk_sdmmc.dtb                 \
        socfpga_cyclone5_mcvevk.dtb                     \
arch/arm/dts/socfpga_agilex-u-boot.dtsi new file +66 -0
new file mode 100644
index 0000000000..f0528a9ad9
@@ -0,0 +1,96 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * U-Boot additions
+ *
+ * Copyright (C) 2019 Intel Corporation <www.intel.com>
+ */
+
+/{
+       memory {
+               #address-cells = <2>;
+               #size-cells = <2>;
+               u-boot,dm-pre-reloc;
+       };
+
+       soc {
+               u-boot,dm-pre-reloc;
+
+               ccu: cache-controller at f7000000 {
+                       compatible = "arteris,ncore-ccu";
+                       reg = <0xf7000000 0x100900>;
+                       u-boot,dm-pre-reloc;
+               };
+       };
+};
+
+&clkmgr {
+       u-boot,dm-pre-reloc;
+};
+
+&gmac1 {
+       altr,sysmgr-syscon = <&sysmgr 0x48 0>;
+};
+
+&gmac2 {
+       altr,sysmgr-syscon = <&sysmgr 0x4c 0>;
+};
+
+&i2c0 {
+       reset-names = "i2c";
+};
+
+&i2c1 {
+       reset-names = "i2c";
+};
+
+&i2c2 {
+       reset-names = "i2c";
+};
+
+&i2c3 {
+       reset-names = "i2c";
+};
+
+&mmc {
+       resets = <&rst SDMMC_RESET>, <&rst SDMMC_OCP_RESET>;
+};
+
+&porta {
+       bank-name = "porta";
+};
+
+&portb {
+       bank-name = "portb";
+};
+
+&qspi {
Quoted 8 lines

arch/arm/dts/socfpga_agilex-u-boot.dtsi line 71

Quoted 5 lines
arch/arm/dts/socfpga_agilex-u-boot.dtsi new file +5 -0
+       u-boot,dm-pre-reloc;
+};
+
+&rst {
+       compatible = "altr,rst-mgr";

This and other compatible-changing lines in this file should be synced to the correct string in all DTs, so please fix this in the upstream Linux DTs.

Linux uses "altr,rst-mgr" for Gen5 and Arria10, "altr,stratix10-rst-mgr" for S10 and Agilex.
But, Uboot uses "altr,rst-mgr" for all Gen5/Arria10/S10/Agilex platforms.

Quoted 9 lines

arch/arm/dts/socfpga_agilex-u-boot.dtsi line 77

Quoted 7 lines
arch/arm/dts/socfpga_agilex-u-boot.dtsi new file +6 -0
+       altr,modrst-offset = <0x20>;
+       u-boot,dm-pre-reloc;
+};
+
+&sdr {
+       compatible = "intel,sdr-ctl-agilex";

See above.

Quoted 1 line

Linux doesn't have DDR device tree node. DDR driver is only needed in Uboot.

Correction. Linux uses same compatible = "altr,sdr-ctl" for all device families. I can change S10 and Agilex to use same "altr,sdr-ctl" if you think this is better. But, it will in other series of patches.

Quoted 858 lines
Quoted 13 lines

arch/arm/dts/socfpga_agilex-u-boot.dtsi line 86

Quoted 11 lines
arch/arm/dts/socfpga_agilex-u-boot.dtsi new file +9 -0
+       reg = <0xf8000400 0x80>,
+             <0xf8010000 0x190>,
+             <0xf8011000 0x500>;
+       resets = <&rst DDRSCH_RESET>;
+       u-boot,dm-pre-reloc;
+};
+
+&sysmgr {
+       compatible = "altr,sys-mgr", "syscon";

See above.

Linux dts just removed "syscon" recently. But, Uboot needs it.

Regards
Ley Foon

Quoted 840 lines

Ultimately, you should onle need 'u-boot,dm-pre-reloc' tags in this file and probably some boot source defititions.

However, until that is done, it's probably ok to have this here, so:

Quoted 833 lines
arch/arm/dts/socfpga_agilex-u-boot.dtsi new file +10 -0
+       u-boot,dm-pre-reloc;
+};
+
+&uart0 {
+       u-boot,dm-pre-reloc;
+};
+
+&watchdog0 {
+       u-boot,dm-pre-reloc;
+};
arch/arm/dts/socfpga_agilex.dtsi new file +622 -0
new file mode 100644
index 0000000000..179b4d5591
@@ -0,0 +1,622 @@
+// SPDX-License-Identifier:     GPL-2.0
+/*
+ * Copyright (C) 2019, Intel Corporation
+ */
+
+/dts-v1/;
+#include <dt-bindings/reset/altr,rst-mgr-s10.h>
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/clock/agilex-clock.h>
+
+/ {
+       compatible = "intel,socfpga-agilex";
+       #address-cells = <2>;
+       #size-cells = <2>;
+
+       reserved-memory {
+               #address-cells = <2>;
+               #size-cells = <2>;
+               ranges;
+
+               service_reserved: svcbuffer at 0 {
+                       compatible = "shared-dma-pool";
+                       reg = <0x0 0x0 0x0 0x1000000>;
+                       alignment = <0x1000>;
+                       no-map;
+               };
+       };
+
+       cpus {
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               cpu0: cpu at 0 {
+                       compatible = "arm,cortex-a53";
+                       device_type = "cpu";
+                       enable-method = "psci";
+                       reg = <0x0>;
+               };
+
+               cpu1: cpu at 1 {
+                       compatible = "arm,cortex-a53";
+                       device_type = "cpu";
+                       enable-method = "psci";
+                       reg = <0x1>;
+               };
+
+               cpu2: cpu at 2 {
+                       compatible = "arm,cortex-a53";
+                       device_type = "cpu";
+                       enable-method = "psci";
+                       reg = <0x2>;
+               };
+
+               cpu3: cpu at 3 {
+                       compatible = "arm,cortex-a53";
+                       device_type = "cpu";
+                       enable-method = "psci";
+                       reg = <0x3>;
+               };
+       };
+
+       pmu {
+               compatible = "arm,armv8-pmuv3";
+               interrupts = <0 170 4>,
+                            <0 171 4>,
+                            <0 172 4>,
+                            <0 173 4>;
+               interrupt-affinity = <&cpu0>,
+                                    <&cpu1>,
+                                    <&cpu2>,
+                                    <&cpu3>;
+               interrupt-parent = <&intc>;
+       };
+
+       psci {
+               compatible = "arm,psci-0.2";
+               method = "smc";
+       };
+
+       intc: intc at fffc1000 {
+               compatible = "arm,gic-400", "arm,cortex-a15-gic";
+               #interrupt-cells = <3>;
+               interrupt-controller;
+               reg = <0x0 0xfffc1000 0x0 0x1000>,
+                     <0x0 0xfffc2000 0x0 0x2000>,
+                     <0x0 0xfffc4000 0x0 0x2000>,
+                     <0x0 0xfffc6000 0x0 0x2000>;
+       };
+
+       soc {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               compatible = "simple-bus";
+               device_type = "soc";
+               interrupt-parent = <&intc>;
+               ranges = <0 0 0 0xffffffff>;
+
+               base_fpga_region {
+                       #address-cells = <0x1>;
+                       #size-cells = <0x1>;
+                       compatible = "fpga-region";
+                       fpga-mgr = <&fpga_mgr>;
+               };
+
+               clkmgr: clock-controller at ffd10000 {
+                       compatible = "intel,agilex-clkmgr";
+                       reg = <0xffd10000 0x1000>;
+                       #clock-cells = <1>;
+               };
+
+               clocks {
+                       cb_intosc_hs_div2_clk: cb-intosc-hs-div2-clk {
+                               #clock-cells = <0>;
+                               compatible = "fixed-clock";
+                       };
+
+                       cb_intosc_ls_clk: cb-intosc-ls-clk {
+                               #clock-cells = <0>;
+                               compatible = "fixed-clock";
+                       };
+
+                       f2s_free_clk: f2s-free-clk {
+                               #clock-cells = <0>;
+                               compatible = "fixed-clock";
+                       };
+
+                       osc1: osc1 {
+                               #clock-cells = <0>;
+                               compatible = "fixed-clock";
+                       };
+
+                       qspi_clk: qspi-clk {
+                               #clock-cells = <0>;
+                               compatible = "fixed-clock";
+                               clock-frequency = <200000000>;
+                       };
+               };
+               gmac0: ethernet at ff800000 {
+                       compatible = "altr,socfpga-stmmac", "snps,dwmac-3.74a", "snps,dwmac";
+                       reg = <0xff800000 0x2000>;
+                       interrupts = <0 90 4>;
+                       interrupt-names = "macirq";
+                       mac-address = [00 00 00 00 00 00];
+                       resets = <&rst EMAC0_RESET>, <&rst EMAC0_OCP_RESET>;
+                       reset-names = "stmmaceth", "stmmaceth-ocp";
+                       tx-fifo-depth = <16384>;
+                       rx-fifo-depth = <16384>;
+                       snps,multicast-filter-bins = <256>;
+                       iommus = <&smmu 1>;
+                       altr,sysmgr-syscon = <&sysmgr 0x44 0>;
+                       clocks = <&clkmgr AGILEX_EMAC0_CLK>;
+                       clock-names = "stmmaceth";
+                       status = "disabled";
+               };
+
+               gmac1: ethernet at ff802000 {
+                       compatible = "altr,socfpga-stmmac", "snps,dwmac-3.74a", "snps,dwmac";
+                       reg = <0xff802000 0x2000>;
+                       interrupts = <0 91 4>;
+                       interrupt-names = "macirq";
+                       mac-address = [00 00 00 00 00 00];
+                       resets = <&rst EMAC1_RESET>, <&rst EMAC1_OCP_RESET>;
+                       reset-names = "stmmaceth", "stmmaceth-ocp";
+                       tx-fifo-depth = <16384>;
+                       rx-fifo-depth = <16384>;
+                       snps,multicast-filter-bins = <256>;
+                       iommus = <&smmu 2>;
+                       altr,sysmgr-syscon = <&sysmgr 0x48 8>;
+                       clocks = <&clkmgr AGILEX_EMAC1_CLK>;
+                       clock-names = "stmmaceth";
+                       status = "disabled";
+               };
+
+               gmac2: ethernet at ff804000 {
+                       compatible = "altr,socfpga-stmmac", "snps,dwmac-3.74a", "snps,dwmac";
+                       reg = <0xff804000 0x2000>;
+                       interrupts = <0 92 4>;
+                       interrupt-names = "macirq";
+                       mac-address = [00 00 00 00 00 00];
+                       resets = <&rst EMAC2_RESET>, <&rst EMAC2_OCP_RESET>;
+                       reset-names = "stmmaceth", "stmmaceth-ocp";
+                       tx-fifo-depth = <16384>;
+                       rx-fifo-depth = <16384>;
+                       snps,multicast-filter-bins = <256>;
+                       iommus = <&smmu 3>;
+                       altr,sysmgr-syscon = <&sysmgr 0x4c 16>;
+                       clocks = <&clkmgr AGILEX_EMAC2_CLK>;
+                       clock-names = "stmmaceth";
+                       status = "disabled";
+               };
+
+               gpio0: gpio at ffc03200 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "snps,dw-apb-gpio";
+                       reg = <0xffc03200 0x100>;
+                       resets = <&rst GPIO0_RESET>;
+                       status = "disabled";
+
+                       porta: gpio-controller at 0 {
+                               compatible = "snps,dw-apb-gpio-port";
+                               gpio-controller;
+                               #gpio-cells = <2>;
+                               snps,nr-gpios = <24>;
+                               reg = <0>;
+                               interrupt-controller;
+                               #interrupt-cells = <2>;
+                               interrupts = <0 110 4>;
+                       };
+               };
+
+               gpio1: gpio at ffc03300 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "snps,dw-apb-gpio";
+                       reg = <0xffc03300 0x100>;
+                       resets = <&rst GPIO1_RESET>;
+                       status = "disabled";
+
+                       portb: gpio-controller at 0 {
+                               compatible = "snps,dw-apb-gpio-port";
+                               gpio-controller;
+                               #gpio-cells = <2>;
+                               snps,nr-gpios = <24>;
+                               reg = <0>;
+                               interrupt-controller;
+                               #interrupt-cells = <2>;
+                               interrupts = <0 111 4>;
+                       };
+               };
+
+               i2c0: i2c at ffc02800 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "snps,designware-i2c";
+                       reg = <0xffc02800 0x100>;
+                       interrupts = <0 103 4>;
+                       resets = <&rst I2C0_RESET>;
+                       clocks = <&clkmgr AGILEX_L4_SP_CLK>;
+                       status = "disabled";
+               };
+
+               i2c1: i2c at ffc02900 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "snps,designware-i2c";
+                       reg = <0xffc02900 0x100>;
+                       interrupts = <0 104 4>;
+                       resets = <&rst I2C1_RESET>;
+                       clocks = <&clkmgr AGILEX_L4_SP_CLK>;
+                       status = "disabled";
+               };
+
+               i2c2: i2c at ffc02a00 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "snps,designware-i2c";
+                       reg = <0xffc02a00 0x100>;
+                       interrupts = <0 105 4>;
+                       resets = <&rst I2C2_RESET>;
+                       clocks = <&clkmgr AGILEX_L4_SP_CLK>;
+                       status = "disabled";
+               };
+
+               i2c3: i2c at ffc02b00 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "snps,designware-i2c";
+                       reg = <0xffc02b00 0x100>;
+                       interrupts = <0 106 4>;
+                       resets = <&rst I2C3_RESET>;
+                       clocks = <&clkmgr AGILEX_L4_SP_CLK>;
+                       status = "disabled";
+               };
+
+               i2c4: i2c at ffc02c00 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "snps,designware-i2c";
+                       reg = <0xffc02c00 0x100>;
+                       interrupts = <0 107 4>;
+                       resets = <&rst I2C4_RESET>;
+                       clocks = <&clkmgr AGILEX_L4_SP_CLK>;
+                       status = "disabled";
+               };
+
+               mmc: dwmmc0 at ff808000 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "altr,socfpga-dw-mshc";
+                       reg = <0xff808000 0x1000>;
+                       interrupts = <0 96 4>;
+                       fifo-depth = <0x400>;
+                       resets = <&rst SDMMC_RESET>;
+                       reset-names = "reset";
+                       clocks = <&clkmgr AGILEX_L4_MP_CLK>,
+                                <&clkmgr AGILEX_SDMMC_CLK>;
+                       clock-names = "biu", "ciu";
+                       iommus = <&smmu 5>;
+                       status = "disabled";
+               };
+
+               nand: nand at ffb90000 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "altr,socfpga-denali-nand";
+                       reg = <0xffb90000 0x10000>,
+                             <0xffb80000 0x1000>;
+                       reg-names = "nand_data", "denali_reg";
+                       interrupts = <0 97 4>;
+                       resets = <&rst NAND_RESET>, <&rst NAND_OCP_RESET>;
+                       status = "disabled";
+               };
+
+               ocram: sram at ffe00000 {
+                       compatible = "mmio-sram";
+                       reg = <0xffe00000 0x40000>;
+               };
+
+               pdma: pdma at ffda0000 {
+                       compatible = "arm,pl330", "arm,primecell";
+                       reg = <0xffda0000 0x1000>;
+                       interrupts = <0 81 4>,
+                                    <0 82 4>,
+                                    <0 83 4>,
+                                    <0 84 4>,
+                                    <0 85 4>,
+                                    <0 86 4>,
+                                    <0 87 4>,
+                                    <0 88 4>,
+                                    <0 89 4>;
+                       #dma-cells = <1>;
+                       #dma-channels = <8>;
+                       #dma-requests = <32>;
+                       resets = <&rst DMA_RESET>, <&rst DMA_OCP_RESET>;
+                       reset-names = "dma", "dma-ocp";
+                       clocks = <&clkmgr AGILEX_L4_MAIN_CLK>;
+                       clock-names = "apb_pclk";
+               };
+
+               rst: rstmgr at ffd11000 {
+                       #reset-cells = <1>;
+                       compatible = "altr,stratix10-rst-mgr";
+                       reg = <0xffd11000 0x100>;
+               };
+
+               smmu: iommu at fa000000 {
+                       compatible = "arm,mmu-500", "arm,smmu-v2";
+                       reg = <0xfa000000 0x40000>;
+                       #global-interrupts = <2>;
+                       #iommu-cells = <1>;
+                       interrupt-parent = <&intc>;
+                       interrupts = <0 128 4>, /* Global Secure Fault */
+                               <0 129 4>, /* Global Non-secure Fault */
+                               /* Non-secure Context Interrupts (32) */
+                               <0 138 4>, <0 139 4>, <0 140 4>, <0 141 4>,
+                               <0 142 4>, <0 143 4>, <0 144 4>, <0 145 4>,
+                               <0 146 4>, <0 147 4>, <0 148 4>, <0 149 4>,
+                               <0 150 4>, <0 151 4>, <0 152 4>, <0 153 4>,
+                               <0 154 4>, <0 155 4>, <0 156 4>, <0 157 4>,
+                               <0 158 4>, <0 159 4>, <0 160 4>, <0 161 4>,
+                               <0 162 4>, <0 163 4>, <0 164 4>, <0 165 4>,
+                               <0 166 4>, <0 167 4>, <0 168 4>, <0 169 4>;
+                       stream-match-mask = <0x7ff0>;
+                       status = "disabled";
+               };
+
+               spi0: spi at ffda4000 {
+                       compatible = "snps,dw-apb-ssi";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <0xffda4000 0x1000>;
+                       interrupts = <0 99 4>;
+                       resets = <&rst SPIM0_RESET>;
+                       reg-io-width = <4>;
+                       num-cs = <4>;
+                       clocks = <&clkmgr AGILEX_L4_MAIN_CLK>;
+                       status = "disabled";
+               };
+
+               spi1: spi at ffda5000 {
+                       compatible = "snps,dw-apb-ssi";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <0xffda5000 0x1000>;
+                       interrupts = <0 100 4>;
+                       resets = <&rst SPIM1_RESET>;
+                       reg-io-width = <4>;
+                       num-cs = <4>;
+                       clocks = <&clkmgr AGILEX_L4_MAIN_CLK>;
+                       status = "disabled";
+               };
+
+               sysmgr: sysmgr at ffd12000 {
+                       compatible = "altr,sys-mgr-s10","altr,sys-mgr";
+                       reg = <0xffd12000 0x500>;
+               };
+
+               /* Local timer */
+               timer {
+                       compatible = "arm,armv8-timer";
+                       interrupts = <1 13 0xf08>,
+                                    <1 14 0xf08>,
+                                    <1 11 0xf08>,
+                                    <1 10 0xf08>;
+               };
+
+               timer0: timer0 at ffc03000 {
+                       compatible = "snps,dw-apb-timer";
+                       interrupts = <0 113 4>;
+                       reg = <0xffc03000 0x100>;
+                       clocks = <&clkmgr AGILEX_L4_SP_CLK>;
+                       clock-names = "timer";
+               };
+
+               timer1: timer1 at ffc03100 {
+                       compatible = "snps,dw-apb-timer";
+                       interrupts = <0 114 4>;
+                       reg = <0xffc03100 0x100>;
+                       clocks = <&clkmgr AGILEX_L4_SP_CLK>;
+                       clock-names = "timer";
+               };
+
+               timer2: timer2 at ffd00000 {
+                       compatible = "snps,dw-apb-timer";
+                       interrupts = <0 115 4>;
+                       reg = <0xffd00000 0x100>;
+                       clocks = <&clkmgr AGILEX_L4_SP_CLK>;
+                       clock-names = "timer";
+               };
+
+               timer3: timer3 at ffd00100 {
+                       compatible = "snps,dw-apb-timer";
+                       interrupts = <0 116 4>;
+                       reg = <0xffd00100 0x100>;
+                       clocks = <&clkmgr AGILEX_L4_SP_CLK>;
+                       clock-names = "timer";
+               };
+
+               uart0: serial0 at ffc02000 {
+                       compatible = "snps,dw-apb-uart";
+                       reg = <0xffc02000 0x100>;
+                       interrupts = <0 108 4>;
+                       reg-shift = <2>;
+                       reg-io-width = <4>;
+                       resets = <&rst UART0_RESET>;
+                       status = "disabled";
+                       clocks = <&clkmgr AGILEX_L4_SP_CLK>;
+                       clock-frequency = <100000000>;
+               };
+
+               uart1: serial1 at ffc02100 {
+                       compatible = "snps,dw-apb-uart";
+                       reg = <0xffc02100 0x100>;
+                       interrupts = <0 109 4>;
+                       reg-shift = <2>;
+                       reg-io-width = <4>;
+                       resets = <&rst UART1_RESET>;
+                       clocks = <&clkmgr AGILEX_L4_SP_CLK>;
+                       status = "disabled";
+               };
+
+               usbphy0: usbphy at 0 {
+                       #phy-cells = <0>;
+                       compatible = "usb-nop-xceiv";
+                       status = "okay";
+               };
+
+               usb0: usb at ffb00000 {
+                       compatible = "snps,dwc2";
+                       reg = <0xffb00000 0x40000>;
+                       interrupts = <0 93 4>;
+                       phys = <&usbphy0>;
+                       phy-names = "usb2-phy";
+                       resets = <&rst USB0_RESET>, <&rst USB0_OCP_RESET>;
+                       reset-names = "dwc2", "dwc2-ecc";
+                       clocks = <&clkmgr AGILEX_USB_CLK>;
+                       iommus = <&smmu 6>;
+                       status = "disabled";
+               };
+
+               usb1: usb at ffb40000 {
+                       compatible = "snps,dwc2";
+                       reg = <0xffb40000 0x40000>;
+                       interrupts = <0 94 4>;
+                       phys = <&usbphy0>;
+                       phy-names = "usb2-phy";
+                       resets = <&rst USB1_RESET>, <&rst USB1_OCP_RESET>;
+                       reset-names = "dwc2", "dwc2-ecc";
+                       iommus = <&smmu 7>;
+                       clocks = <&clkmgr AGILEX_USB_CLK>;
+                       status = "disabled";
+               };
+
+               watchdog0: watchdog at ffd00200 {
+                       compatible = "snps,dw-wdt";
+                       reg = <0xffd00200 0x100>;
+                       interrupts = <0 117 4>;
+                       resets = <&rst WATCHDOG0_RESET>;
+                       clocks = <&clkmgr AGILEX_L4_SYS_FREE_CLK>;
+                       status = "disabled";
+               };
+
+               watchdog1: watchdog at ffd00300 {
+                       compatible = "snps,dw-wdt";
+                       reg = <0xffd00300 0x100>;
+                       interrupts = <0 118 4>;
+                       resets = <&rst WATCHDOG1_RESET>;
+                       clocks = <&clkmgr AGILEX_L4_SYS_FREE_CLK>;
+                       status = "disabled";
+               };
+
+               watchdog2: watchdog at ffd00400 {
+                       compatible = "snps,dw-wdt";
+                       reg = <0xffd00400 0x100>;
+                       interrupts = <0 125 4>;
+                       resets = <&rst WATCHDOG2_RESET>;
+                       clocks = <&clkmgr AGILEX_L4_SYS_FREE_CLK>;
+                       status = "disabled";
+               };
+
+               watchdog3: watchdog at ffd00500 {
+                       compatible = "snps,dw-wdt";
+                       reg = <0xffd00500 0x100>;
+                       interrupts = <0 126 4>;
+                       resets = <&rst WATCHDOG3_RESET>;
+                       clocks = <&clkmgr AGILEX_L4_SYS_FREE_CLK>;
+                       status = "disabled";
+               };
+
+               sdr: sdr at f8011100 {
+                       compatible = "altr,sdr-ctl", "syscon";
+                       reg = <0xf8011100 0xc0>;
+               };
+
+               eccmgr {
+                       compatible = "altr,socfpga-s10-ecc-manager",
+                                    "altr,socfpga-a10-ecc-manager";
+                       altr,sysmgr-syscon = <&sysmgr>;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       interrupts = <0 15 4>;
+                       interrupt-controller;
+                       #interrupt-cells = <2>;
+                       ranges;
+
+                       sdramedac {
+                               compatible = "altr,sdram-edac-s10";
+                               altr,sdr-syscon = <&sdr>;
+                               interrupts = <16 4>;
+                       };
+
+                       ocram-ecc at ff8cc000 {
+                               compatible = "altr,socfpga-s10-ocram-ecc",
+                                            "altr,socfpga-a10-ocram-ecc";
+                               reg = <0xff8cc000 0x100>;
+                               altr,ecc-parent = <&ocram>;
+                               interrupts = <1 4>;
+                       };
+
+                       usb0-ecc at ff8c4000 {
+                               compatible = "altr,socfpga-s10-usb-ecc",
+                                            "altr,socfpga-usb-ecc";
+                               reg = <0xff8c4000 0x100>;
+                               altr,ecc-parent = <&usb0>;
+                               interrupts = <2 4>;
+                       };
+
+                       emac0-rx-ecc at ff8c0000 {
+                               compatible = "altr,socfpga-s10-eth-mac-ecc",
+                                            "altr,socfpga-eth-mac-ecc";
+                               reg = <0xff8c0000 0x100>;
+                               altr,ecc-parent = <&gmac0>;
+                               interrupts = <4 4>;
+                       };
+
+                       emac0-tx-ecc at ff8c0400 {
+                               compatible = "altr,socfpga-s10-eth-mac-ecc",
+                                            "altr,socfpga-eth-mac-ecc";
+                               reg = <0xff8c0400 0x100>;
+                               altr,ecc-parent = <&gmac0>;
+                               interrupts = <5 4>;
+                       };
+
+                       sdmmca-ecc at ff8c8c00 {
+                               compatible = "altr,socfpga-s10-sdmmc-ecc",
+                                            "altr,socfpga-sdmmc-ecc";
+                               reg = <0xff8c8c00 0x100>;
+                               altr,ecc-parent = <&mmc>;
+                               interrupts = <14 4>,
+                                            <15 4>;
+                       };
+               };
+
+               qspi: spi at ff8d2000 {
+                       compatible = "cdns,qspi-nor";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <0xff8d2000 0x100>,
+                             <0xff900000 0x100000>;
+                       interrupts = <0 3 4>;
+                       cdns,fifo-depth = <128>;
+                       cdns,fifo-width = <4>;
+                       cdns,trigger-address = <0x00000000>;
+                       clocks = <&qspi_clk>;
+
+                       status = "disabled";
+               };
+
+               firmware {
+                       svc {
+                               compatible = "intel,stratix10-svc";
+                               method = "smc";
+                               memory-region = <&service_reserved>;
+
+                               fpga_mgr: fpga-mgr {
+                                       compatible = "intel,stratix10-soc-fpga-mgr";
+                               };
+                       };
+               };
+       };
+};
arch/arm/dts/socfpga_agilex_socdk-u-boot.dtsi new file +39 -0
new file mode 100644
index 0000000000..1908be4b8b
@@ -0,0 +1,39 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * U-Boot additions
+ *
+ * Copyright (C) 2019 Intel Corporation <www.intel.com>
+ */
+
+#include "socfpga_agilex-u-boot.dtsi"
+
+/{
+       aliases {
+               spi0 = &qspi;
+               i2c0 = &i2c1;
+       };
+
+       memory {
+               /* 8GB */
+               reg = <0 0x00000000 0 0x80000000>,
+                     <2 0x80000000 1 0x80000000>;
+       };
+};
+
+&flash0 {
+       compatible = "jedec,spi-nor";
+       spi-tx-bus-width = <4>;
+       spi-rx-bus-width = <4>;
+       u-boot,dm-pre-reloc;
+};
+
+&i2c1 {
+       status = "okay";
+};
+
+&mmc {
+       drvsel = <3>;
+       smplsel = <0>;
+       u-boot,dm-pre-reloc;
+};
+
arch/arm/dts/socfpga_agilex_socdk.dts new file +141 -1
new file mode 100644
index 0000000000..bcdeecc0e0
@@ -0,0 +1,141 @@
+// SPDX-License-Identifier:     GPL-2.0
+/*
+ * Copyright (C) 2019, Intel Corporation
+ */
+#include "socfpga_agilex.dtsi"
+
+/ {
+       model = "SoCFPGA Agilex SoCDK";
+
+       aliases {
+               serial0 = &uart0;
+               ethernet0 = &gmac0;
+               ethernet1 = &gmac1;
+               ethernet2 = &gmac2;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+
+       leds {
+               compatible = "gpio-leds";
+               hps0 {
+                       label = "hps_led0";
+                       gpios = <&portb 20 GPIO_ACTIVE_HIGH>;
+               };
+
+               hps1 {
+                       label = "hps_led1";
+                       gpios = <&portb 19 GPIO_ACTIVE_HIGH>;
+               };
+
+               hps2 {
+                       label = "hps_led2";
+                       gpios = <&portb 21 GPIO_ACTIVE_HIGH>;
+               };
+       };
+
+       memory {
+               device_type = "memory";
+               /* We expect the bootloader to fill in the reg */
+               reg = <0 0 0 0>;
+       };
+
+       soc {
+               clocks {
+                       osc1 {
+                               clock-frequency = <25000000>;
+                       };
+               };
+       };
+};
+
+&gpio1 {
+       status = "okay";
+};
+
+&gmac0 {
+       status = "okay";
+       phy-mode = "rgmii";
+       phy-handle = <&phy0>;
+
+       max-frame-size = <9000>;
+
+       mdio0 {
+               #address-cells = <1>;
+               #size-cells = <0>;
+               compatible = "snps,dwmac-mdio";
+               phy0: ethernet-phy at 0 {
+                       reg = <4>;
+
+                       txd0-skew-ps = <0>; /* -420ps */
+                       txd1-skew-ps = <0>; /* -420ps */
+                       txd2-skew-ps = <0>; /* -420ps */
+                       txd3-skew-ps = <0>; /* -420ps */
+                       rxd0-skew-ps = <420>; /* 0ps */
+                       rxd1-skew-ps = <420>; /* 0ps */
+                       rxd2-skew-ps = <420>; /* 0ps */
+                       rxd3-skew-ps = <420>; /* 0ps */
+                       txen-skew-ps = <0>; /* -420ps */
+                       txc-skew-ps = <900>; /* 0ps */
+                       rxdv-skew-ps = <420>; /* 0ps */
+                       rxc-skew-ps = <1680>; /* 780ps */
+               };
+       };
+};
+
+&mmc {
+       status = "okay";
+       cap-sd-highspeed;
+       broken-cd;
+       bus-width = <4>;
+};
+
+&uart0 {
+       status = "okay";
+};
+
+&usb0 {
+       status = "okay";
+       disable-over-current;
+};
+
+&watchdog0 {
+       status = "okay";
+};
+
+&qspi {
+       flash0: flash at 0 {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               compatible = "mt25qu02g";
+               reg = <0>;
+               spi-max-frequency = <100000000>;
+
+               m25p,fast-read;
+               cdns,page-size = <256>;
+               cdns,block-size = <16>;
+               cdns,read-delay = <1>;
+               cdns,tshsl-ns = <50>;
+               cdns,tsd2d-ns = <50>;
+               cdns,tchsh-ns = <4>;
+               cdns,tslch-ns = <4>;
+
+               partitions {
+                       compatible = "fixed-partitions";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+
+                       qspi_boot: partition at 0 {
+                               label = "Boot and fpga data";
+                               reg = <0x0 0x034B0000>;
+                       };
+
+                       qspi_rootfs: partition at 34B0000 {
+                               label = "Root Filesystem - JFFS2";
+                               reg = <0x034B0000 0x0EB50000>;
+                       };
+               };
+       };
+};
--

2.19.0

#23 lore raw

PATCH v8 17/19 arm: dts: agilex: Add base dtsi and devkit dts

Quoted 164 lines · Ley Foon Tan
Quoted 162 lines · Ley Foon Tan
Quoted 138 lines · Simon Goldschmidt
Quoted 136 lines · Ley Foon Tan

Add device tree files for Agilex SoC platform.

socfpga_agilex-u-boot.dtsi and socfpga_agilex_socdk-u-boot.dts contains Uboot specific DT properties.

socfpga_agilex.dtsi and socfpga_agilex_socdk.dts are from Linux (kernel/git/dinguyen/linux.git, commit 6f0bf971bacacc)

---
v8:
- Include socfpga_agilex-u-boot.dtsi in socfpga_agilex_socdk-u-boot.dtsi, instead of include it in socfpga_agilex_socdk.dts.

v7:
- Update socfpga_agilex.dtsi and socfpga_agilex_socdk.dts from Linux.
- Add new socfpga_agilex_socdk-u-boot.dts file for Uboot specific DT properties.

v6:
- Use new macro names from agilex-clock.h.

v5:
- Add CCU DT node.

v4:
- Add u-boot,dm-pre-reloc to sysmgr node.

v3:
- Fixed bank 1 memory alias base address to 0x280000000.
- Rename STRATIX10_*_CLK to SOCFPGA_SOC64_*_CLK.
- Include socfpga-soc64-clock.h
- Change to "intel,sdr-ctl-agilex" for SDRAM node.

v2:
- Add clock property to device node.
- Change memory size to 8GB
- Enable i2c1

---
 arch/arm/dts/Makefile                         |   1 +
 arch/arm/dts/socfpga_agilex-u-boot.dtsi       |  96 +++
 arch/arm/dts/socfpga_agilex.dtsi              | 622 ++++++++++++++++++
 arch/arm/dts/socfpga_agilex_socdk-u-boot.dtsi |  39 ++
 arch/arm/dts/socfpga_agilex_socdk.dts         | 141 ++++
 5 files changed, 899 insertions(+)
 create mode 100644 arch/arm/dts/socfpga_agilex-u-boot.dtsi
 create mode 100644 arch/arm/dts/socfpga_agilex.dtsi
 create mode 100644 arch/arm/dts/socfpga_agilex_socdk-u-boot.dtsi
 create mode 100644 arch/arm/dts/socfpga_agilex_socdk.dts
arch/arm/dts/Makefile +1 -0
index d8846df1bd..e76f7c1407 100644
@@ -328,6 +328,7 @@ dtb-$(CONFIG_TI816X) += dm8168-evm.dtb
 dtb-$(CONFIG_THUNDERX) += thunderx-88xx.dtb
 
 dtb-$(CONFIG_ARCH_SOCFPGA) +=                          \
+       socfpga_agilex_socdk.dtb                        \
        socfpga_arria5_socdk.dtb                        \
        socfpga_arria10_socdk_sdmmc.dtb                 \
        socfpga_cyclone5_mcvevk.dtb                     \
arch/arm/dts/socfpga_agilex-u-boot.dtsi new file +66 -0
new file mode 100644
index 0000000000..f0528a9ad9
@@ -0,0 +1,96 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * U-Boot additions
+ *
+ * Copyright (C) 2019 Intel Corporation <www.intel.com>
+ */
+
+/{
+       memory {
+               #address-cells = <2>;
+               #size-cells = <2>;
+               u-boot,dm-pre-reloc;
+       };
+
+       soc {
+               u-boot,dm-pre-reloc;
+
+               ccu: cache-controller at f7000000 {
+                       compatible = "arteris,ncore-ccu";
+                       reg = <0xf7000000 0x100900>;
+                       u-boot,dm-pre-reloc;
+               };
+       };
+};
+
+&clkmgr {
+       u-boot,dm-pre-reloc;
+};
+
+&gmac1 {
+       altr,sysmgr-syscon = <&sysmgr 0x48 0>;
+};
+
+&gmac2 {
+       altr,sysmgr-syscon = <&sysmgr 0x4c 0>;
+};
+
+&i2c0 {
+       reset-names = "i2c";
+};
+
+&i2c1 {
+       reset-names = "i2c";
+};
+
+&i2c2 {
+       reset-names = "i2c";
+};
+
+&i2c3 {
+       reset-names = "i2c";
+};
+
+&mmc {
+       resets = <&rst SDMMC_RESET>, <&rst SDMMC_OCP_RESET>;
+};
+
+&porta {
+       bank-name = "porta";
+};
+
+&portb {
+       bank-name = "portb";
+};
+
+&qspi {
Quoted 8 lines

arch/arm/dts/socfpga_agilex-u-boot.dtsi line 71

Quoted 5 lines
arch/arm/dts/socfpga_agilex-u-boot.dtsi new file +5 -0
+       u-boot,dm-pre-reloc;
+};
+
+&rst {
+       compatible = "altr,rst-mgr";

This and other compatible-changing lines in this file should be synced to the correct string in all DTs, so please fix this in the upstream Linux DTs.

Linux uses "altr,rst-mgr" for Gen5 and Arria10, "altr,stratix10-rst-mgr" for S10 and Agilex.
But, Uboot uses "altr,rst-mgr" for all Gen5/Arria10/S10/Agilex platforms.

Quoted 9 lines

arch/arm/dts/socfpga_agilex-u-boot.dtsi line 77

Quoted 7 lines
arch/arm/dts/socfpga_agilex-u-boot.dtsi new file +6 -0
+       altr,modrst-offset = <0x20>;
+       u-boot,dm-pre-reloc;
+};
+
+&sdr {
+       compatible = "intel,sdr-ctl-agilex";

See above.

Quoted 4 lines
Quoted 1 line

Linux doesn't have DDR device tree node. DDR driver is only needed in Uboot.

Correction. Linux uses same compatible = "altr,sdr-ctl" for all device families. I can change S10 and Agilex to use same "altr,sdr-ctl" if you think this is better. But, it will in other series of patches.

Without looking too deep into this, the ultimate goal should be that the dts/dtsi files in Linux and U-Boot can be the same, with the exception of added properties like "u-boot,dm-pre-reloc;" etc.

Regards,
Simon

Quoted 860 lines
Quoted 860 lines
Quoted 4 lines
Quoted 11 lines

arch/arm/dts/socfpga_agilex-u-boot.dtsi line 86

Quoted 9 lines
arch/arm/dts/socfpga_agilex-u-boot.dtsi new file +9 -0
+       reg = <0xf8000400 0x80>,
+             <0xf8010000 0x190>,
+             <0xf8011000 0x500>;
+       resets = <&rst DDRSCH_RESET>;
+       u-boot,dm-pre-reloc;
+};
+
+&sysmgr {
+       compatible = "altr,sys-mgr", "syscon";

See above.

Linux dts just removed "syscon" recently. But, Uboot needs it.

Regards
Ley Foon

Quoted 840 lines

Ultimately, you should onle need 'u-boot,dm-pre-reloc' tags in this file and probably some boot source defititions.

However, until that is done, it's probably ok to have this here, so:

Quoted 833 lines
arch/arm/dts/socfpga_agilex-u-boot.dtsi new file +10 -0
+       u-boot,dm-pre-reloc;
+};
+
+&uart0 {
+       u-boot,dm-pre-reloc;
+};
+
+&watchdog0 {
+       u-boot,dm-pre-reloc;
+};
arch/arm/dts/socfpga_agilex.dtsi new file +622 -0
new file mode 100644
index 0000000000..179b4d5591
@@ -0,0 +1,622 @@
+// SPDX-License-Identifier:     GPL-2.0
+/*
+ * Copyright (C) 2019, Intel Corporation
+ */
+
+/dts-v1/;
+#include <dt-bindings/reset/altr,rst-mgr-s10.h>
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/clock/agilex-clock.h>
+
+/ {
+       compatible = "intel,socfpga-agilex";
+       #address-cells = <2>;
+       #size-cells = <2>;
+
+       reserved-memory {
+               #address-cells = <2>;
+               #size-cells = <2>;
+               ranges;
+
+               service_reserved: svcbuffer at 0 {
+                       compatible = "shared-dma-pool";
+                       reg = <0x0 0x0 0x0 0x1000000>;
+                       alignment = <0x1000>;
+                       no-map;
+               };
+       };
+
+       cpus {
+               #address-cells = <1>;
+               #size-cells = <0>;
+
+               cpu0: cpu at 0 {
+                       compatible = "arm,cortex-a53";
+                       device_type = "cpu";
+                       enable-method = "psci";
+                       reg = <0x0>;
+               };
+
+               cpu1: cpu at 1 {
+                       compatible = "arm,cortex-a53";
+                       device_type = "cpu";
+                       enable-method = "psci";
+                       reg = <0x1>;
+               };
+
+               cpu2: cpu at 2 {
+                       compatible = "arm,cortex-a53";
+                       device_type = "cpu";
+                       enable-method = "psci";
+                       reg = <0x2>;
+               };
+
+               cpu3: cpu at 3 {
+                       compatible = "arm,cortex-a53";
+                       device_type = "cpu";
+                       enable-method = "psci";
+                       reg = <0x3>;
+               };
+       };
+
+       pmu {
+               compatible = "arm,armv8-pmuv3";
+               interrupts = <0 170 4>,
+                            <0 171 4>,
+                            <0 172 4>,
+                            <0 173 4>;
+               interrupt-affinity = <&cpu0>,
+                                    <&cpu1>,
+                                    <&cpu2>,
+                                    <&cpu3>;
+               interrupt-parent = <&intc>;
+       };
+
+       psci {
+               compatible = "arm,psci-0.2";
+               method = "smc";
+       };
+
+       intc: intc at fffc1000 {
+               compatible = "arm,gic-400", "arm,cortex-a15-gic";
+               #interrupt-cells = <3>;
+               interrupt-controller;
+               reg = <0x0 0xfffc1000 0x0 0x1000>,
+                     <0x0 0xfffc2000 0x0 0x2000>,
+                     <0x0 0xfffc4000 0x0 0x2000>,
+                     <0x0 0xfffc6000 0x0 0x2000>;
+       };
+
+       soc {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               compatible = "simple-bus";
+               device_type = "soc";
+               interrupt-parent = <&intc>;
+               ranges = <0 0 0 0xffffffff>;
+
+               base_fpga_region {
+                       #address-cells = <0x1>;
+                       #size-cells = <0x1>;
+                       compatible = "fpga-region";
+                       fpga-mgr = <&fpga_mgr>;
+               };
+
+               clkmgr: clock-controller at ffd10000 {
+                       compatible = "intel,agilex-clkmgr";
+                       reg = <0xffd10000 0x1000>;
+                       #clock-cells = <1>;
+               };
+
+               clocks {
+                       cb_intosc_hs_div2_clk: cb-intosc-hs-div2-clk {
+                               #clock-cells = <0>;
+                               compatible = "fixed-clock";
+                       };
+
+                       cb_intosc_ls_clk: cb-intosc-ls-clk {
+                               #clock-cells = <0>;
+                               compatible = "fixed-clock";
+                       };
+
+                       f2s_free_clk: f2s-free-clk {
+                               #clock-cells = <0>;
+                               compatible = "fixed-clock";
+                       };
+
+                       osc1: osc1 {
+                               #clock-cells = <0>;
+                               compatible = "fixed-clock";
+                       };
+
+                       qspi_clk: qspi-clk {
+                               #clock-cells = <0>;
+                               compatible = "fixed-clock";
+                               clock-frequency = <200000000>;
+                       };
+               };
+               gmac0: ethernet at ff800000 {
+                       compatible = "altr,socfpga-stmmac", "snps,dwmac-3.74a", "snps,dwmac";
+                       reg = <0xff800000 0x2000>;
+                       interrupts = <0 90 4>;
+                       interrupt-names = "macirq";
+                       mac-address = [00 00 00 00 00 00];
+                       resets = <&rst EMAC0_RESET>, <&rst EMAC0_OCP_RESET>;
+                       reset-names = "stmmaceth", "stmmaceth-ocp";
+                       tx-fifo-depth = <16384>;
+                       rx-fifo-depth = <16384>;
+                       snps,multicast-filter-bins = <256>;
+                       iommus = <&smmu 1>;
+                       altr,sysmgr-syscon = <&sysmgr 0x44 0>;
+                       clocks = <&clkmgr AGILEX_EMAC0_CLK>;
+                       clock-names = "stmmaceth";
+                       status = "disabled";
+               };
+
+               gmac1: ethernet at ff802000 {
+                       compatible = "altr,socfpga-stmmac", "snps,dwmac-3.74a", "snps,dwmac";
+                       reg = <0xff802000 0x2000>;
+                       interrupts = <0 91 4>;
+                       interrupt-names = "macirq";
+                       mac-address = [00 00 00 00 00 00];
+                       resets = <&rst EMAC1_RESET>, <&rst EMAC1_OCP_RESET>;
+                       reset-names = "stmmaceth", "stmmaceth-ocp";
+                       tx-fifo-depth = <16384>;
+                       rx-fifo-depth = <16384>;
+                       snps,multicast-filter-bins = <256>;
+                       iommus = <&smmu 2>;
+                       altr,sysmgr-syscon = <&sysmgr 0x48 8>;
+                       clocks = <&clkmgr AGILEX_EMAC1_CLK>;
+                       clock-names = "stmmaceth";
+                       status = "disabled";
+               };
+
+               gmac2: ethernet at ff804000 {
+                       compatible = "altr,socfpga-stmmac", "snps,dwmac-3.74a", "snps,dwmac";
+                       reg = <0xff804000 0x2000>;
+                       interrupts = <0 92 4>;
+                       interrupt-names = "macirq";
+                       mac-address = [00 00 00 00 00 00];
+                       resets = <&rst EMAC2_RESET>, <&rst EMAC2_OCP_RESET>;
+                       reset-names = "stmmaceth", "stmmaceth-ocp";
+                       tx-fifo-depth = <16384>;
+                       rx-fifo-depth = <16384>;
+                       snps,multicast-filter-bins = <256>;
+                       iommus = <&smmu 3>;
+                       altr,sysmgr-syscon = <&sysmgr 0x4c 16>;
+                       clocks = <&clkmgr AGILEX_EMAC2_CLK>;
+                       clock-names = "stmmaceth";
+                       status = "disabled";
+               };
+
+               gpio0: gpio at ffc03200 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "snps,dw-apb-gpio";
+                       reg = <0xffc03200 0x100>;
+                       resets = <&rst GPIO0_RESET>;
+                       status = "disabled";
+
+                       porta: gpio-controller at 0 {
+                               compatible = "snps,dw-apb-gpio-port";
+                               gpio-controller;
+                               #gpio-cells = <2>;
+                               snps,nr-gpios = <24>;
+                               reg = <0>;
+                               interrupt-controller;
+                               #interrupt-cells = <2>;
+                               interrupts = <0 110 4>;
+                       };
+               };
+
+               gpio1: gpio at ffc03300 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "snps,dw-apb-gpio";
+                       reg = <0xffc03300 0x100>;
+                       resets = <&rst GPIO1_RESET>;
+                       status = "disabled";
+
+                       portb: gpio-controller at 0 {
+                               compatible = "snps,dw-apb-gpio-port";
+                               gpio-controller;
+                               #gpio-cells = <2>;
+                               snps,nr-gpios = <24>;
+                               reg = <0>;
+                               interrupt-controller;
+                               #interrupt-cells = <2>;
+                               interrupts = <0 111 4>;
+                       };
+               };
+
+               i2c0: i2c at ffc02800 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "snps,designware-i2c";
+                       reg = <0xffc02800 0x100>;
+                       interrupts = <0 103 4>;
+                       resets = <&rst I2C0_RESET>;
+                       clocks = <&clkmgr AGILEX_L4_SP_CLK>;
+                       status = "disabled";
+               };
+
+               i2c1: i2c at ffc02900 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "snps,designware-i2c";
+                       reg = <0xffc02900 0x100>;
+                       interrupts = <0 104 4>;
+                       resets = <&rst I2C1_RESET>;
+                       clocks = <&clkmgr AGILEX_L4_SP_CLK>;
+                       status = "disabled";
+               };
+
+               i2c2: i2c at ffc02a00 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "snps,designware-i2c";
+                       reg = <0xffc02a00 0x100>;
+                       interrupts = <0 105 4>;
+                       resets = <&rst I2C2_RESET>;
+                       clocks = <&clkmgr AGILEX_L4_SP_CLK>;
+                       status = "disabled";
+               };
+
+               i2c3: i2c at ffc02b00 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "snps,designware-i2c";
+                       reg = <0xffc02b00 0x100>;
+                       interrupts = <0 106 4>;
+                       resets = <&rst I2C3_RESET>;
+                       clocks = <&clkmgr AGILEX_L4_SP_CLK>;
+                       status = "disabled";
+               };
+
+               i2c4: i2c at ffc02c00 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "snps,designware-i2c";
+                       reg = <0xffc02c00 0x100>;
+                       interrupts = <0 107 4>;
+                       resets = <&rst I2C4_RESET>;
+                       clocks = <&clkmgr AGILEX_L4_SP_CLK>;
+                       status = "disabled";
+               };
+
+               mmc: dwmmc0 at ff808000 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "altr,socfpga-dw-mshc";
+                       reg = <0xff808000 0x1000>;
+                       interrupts = <0 96 4>;
+                       fifo-depth = <0x400>;
+                       resets = <&rst SDMMC_RESET>;
+                       reset-names = "reset";
+                       clocks = <&clkmgr AGILEX_L4_MP_CLK>,
+                                <&clkmgr AGILEX_SDMMC_CLK>;
+                       clock-names = "biu", "ciu";
+                       iommus = <&smmu 5>;
+                       status = "disabled";
+               };
+
+               nand: nand at ffb90000 {
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       compatible = "altr,socfpga-denali-nand";
+                       reg = <0xffb90000 0x10000>,
+                             <0xffb80000 0x1000>;
+                       reg-names = "nand_data", "denali_reg";
+                       interrupts = <0 97 4>;
+                       resets = <&rst NAND_RESET>, <&rst NAND_OCP_RESET>;
+                       status = "disabled";
+               };
+
+               ocram: sram at ffe00000 {
+                       compatible = "mmio-sram";
+                       reg = <0xffe00000 0x40000>;
+               };
+
+               pdma: pdma at ffda0000 {
+                       compatible = "arm,pl330", "arm,primecell";
+                       reg = <0xffda0000 0x1000>;
+                       interrupts = <0 81 4>,
+                                    <0 82 4>,
+                                    <0 83 4>,
+                                    <0 84 4>,
+                                    <0 85 4>,
+                                    <0 86 4>,
+                                    <0 87 4>,
+                                    <0 88 4>,
+                                    <0 89 4>;
+                       #dma-cells = <1>;
+                       #dma-channels = <8>;
+                       #dma-requests = <32>;
+                       resets = <&rst DMA_RESET>, <&rst DMA_OCP_RESET>;
+                       reset-names = "dma", "dma-ocp";
+                       clocks = <&clkmgr AGILEX_L4_MAIN_CLK>;
+                       clock-names = "apb_pclk";
+               };
+
+               rst: rstmgr at ffd11000 {
+                       #reset-cells = <1>;
+                       compatible = "altr,stratix10-rst-mgr";
+                       reg = <0xffd11000 0x100>;
+               };
+
+               smmu: iommu at fa000000 {
+                       compatible = "arm,mmu-500", "arm,smmu-v2";
+                       reg = <0xfa000000 0x40000>;
+                       #global-interrupts = <2>;
+                       #iommu-cells = <1>;
+                       interrupt-parent = <&intc>;
+                       interrupts = <0 128 4>, /* Global Secure Fault */
+                               <0 129 4>, /* Global Non-secure Fault */
+                               /* Non-secure Context Interrupts (32) */
+                               <0 138 4>, <0 139 4>, <0 140 4>, <0 141 4>,
+                               <0 142 4>, <0 143 4>, <0 144 4>, <0 145 4>,
+                               <0 146 4>, <0 147 4>, <0 148 4>, <0 149 4>,
+                               <0 150 4>, <0 151 4>, <0 152 4>, <0 153 4>,
+                               <0 154 4>, <0 155 4>, <0 156 4>, <0 157 4>,
+                               <0 158 4>, <0 159 4>, <0 160 4>, <0 161 4>,
+                               <0 162 4>, <0 163 4>, <0 164 4>, <0 165 4>,
+                               <0 166 4>, <0 167 4>, <0 168 4>, <0 169 4>;
+                       stream-match-mask = <0x7ff0>;
+                       status = "disabled";
+               };
+
+               spi0: spi at ffda4000 {
+                       compatible = "snps,dw-apb-ssi";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <0xffda4000 0x1000>;
+                       interrupts = <0 99 4>;
+                       resets = <&rst SPIM0_RESET>;
+                       reg-io-width = <4>;
+                       num-cs = <4>;
+                       clocks = <&clkmgr AGILEX_L4_MAIN_CLK>;
+                       status = "disabled";
+               };
+
+               spi1: spi at ffda5000 {
+                       compatible = "snps,dw-apb-ssi";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <0xffda5000 0x1000>;
+                       interrupts = <0 100 4>;
+                       resets = <&rst SPIM1_RESET>;
+                       reg-io-width = <4>;
+                       num-cs = <4>;
+                       clocks = <&clkmgr AGILEX_L4_MAIN_CLK>;
+                       status = "disabled";
+               };
+
+               sysmgr: sysmgr at ffd12000 {
+                       compatible = "altr,sys-mgr-s10","altr,sys-mgr";
+                       reg = <0xffd12000 0x500>;
+               };
+
+               /* Local timer */
+               timer {
+                       compatible = "arm,armv8-timer";
+                       interrupts = <1 13 0xf08>,
+                                    <1 14 0xf08>,
+                                    <1 11 0xf08>,
+                                    <1 10 0xf08>;
+               };
+
+               timer0: timer0 at ffc03000 {
+                       compatible = "snps,dw-apb-timer";
+                       interrupts = <0 113 4>;
+                       reg = <0xffc03000 0x100>;
+                       clocks = <&clkmgr AGILEX_L4_SP_CLK>;
+                       clock-names = "timer";
+               };
+
+               timer1: timer1 at ffc03100 {
+                       compatible = "snps,dw-apb-timer";
+                       interrupts = <0 114 4>;
+                       reg = <0xffc03100 0x100>;
+                       clocks = <&clkmgr AGILEX_L4_SP_CLK>;
+                       clock-names = "timer";
+               };
+
+               timer2: timer2 at ffd00000 {
+                       compatible = "snps,dw-apb-timer";
+                       interrupts = <0 115 4>;
+                       reg = <0xffd00000 0x100>;
+                       clocks = <&clkmgr AGILEX_L4_SP_CLK>;
+                       clock-names = "timer";
+               };
+
+               timer3: timer3 at ffd00100 {
+                       compatible = "snps,dw-apb-timer";
+                       interrupts = <0 116 4>;
+                       reg = <0xffd00100 0x100>;
+                       clocks = <&clkmgr AGILEX_L4_SP_CLK>;
+                       clock-names = "timer";
+               };
+
+               uart0: serial0 at ffc02000 {
+                       compatible = "snps,dw-apb-uart";
+                       reg = <0xffc02000 0x100>;
+                       interrupts = <0 108 4>;
+                       reg-shift = <2>;
+                       reg-io-width = <4>;
+                       resets = <&rst UART0_RESET>;
+                       status = "disabled";
+                       clocks = <&clkmgr AGILEX_L4_SP_CLK>;
+                       clock-frequency = <100000000>;
+               };
+
+               uart1: serial1 at ffc02100 {
+                       compatible = "snps,dw-apb-uart";
+                       reg = <0xffc02100 0x100>;
+                       interrupts = <0 109 4>;
+                       reg-shift = <2>;
+                       reg-io-width = <4>;
+                       resets = <&rst UART1_RESET>;
+                       clocks = <&clkmgr AGILEX_L4_SP_CLK>;
+                       status = "disabled";
+               };
+
+               usbphy0: usbphy at 0 {
+                       #phy-cells = <0>;
+                       compatible = "usb-nop-xceiv";
+                       status = "okay";
+               };
+
+               usb0: usb at ffb00000 {
+                       compatible = "snps,dwc2";
+                       reg = <0xffb00000 0x40000>;
+                       interrupts = <0 93 4>;
+                       phys = <&usbphy0>;
+                       phy-names = "usb2-phy";
+                       resets = <&rst USB0_RESET>, <&rst USB0_OCP_RESET>;
+                       reset-names = "dwc2", "dwc2-ecc";
+                       clocks = <&clkmgr AGILEX_USB_CLK>;
+                       iommus = <&smmu 6>;
+                       status = "disabled";
+               };
+
+               usb1: usb at ffb40000 {
+                       compatible = "snps,dwc2";
+                       reg = <0xffb40000 0x40000>;
+                       interrupts = <0 94 4>;
+                       phys = <&usbphy0>;
+                       phy-names = "usb2-phy";
+                       resets = <&rst USB1_RESET>, <&rst USB1_OCP_RESET>;
+                       reset-names = "dwc2", "dwc2-ecc";
+                       iommus = <&smmu 7>;
+                       clocks = <&clkmgr AGILEX_USB_CLK>;
+                       status = "disabled";
+               };
+
+               watchdog0: watchdog at ffd00200 {
+                       compatible = "snps,dw-wdt";
+                       reg = <0xffd00200 0x100>;
+                       interrupts = <0 117 4>;
+                       resets = <&rst WATCHDOG0_RESET>;
+                       clocks = <&clkmgr AGILEX_L4_SYS_FREE_CLK>;
+                       status = "disabled";
+               };
+
+               watchdog1: watchdog at ffd00300 {
+                       compatible = "snps,dw-wdt";
+                       reg = <0xffd00300 0x100>;
+                       interrupts = <0 118 4>;
+                       resets = <&rst WATCHDOG1_RESET>;
+                       clocks = <&clkmgr AGILEX_L4_SYS_FREE_CLK>;
+                       status = "disabled";
+               };
+
+               watchdog2: watchdog at ffd00400 {
+                       compatible = "snps,dw-wdt";
+                       reg = <0xffd00400 0x100>;
+                       interrupts = <0 125 4>;
+                       resets = <&rst WATCHDOG2_RESET>;
+                       clocks = <&clkmgr AGILEX_L4_SYS_FREE_CLK>;
+                       status = "disabled";
+               };
+
+               watchdog3: watchdog at ffd00500 {
+                       compatible = "snps,dw-wdt";
+                       reg = <0xffd00500 0x100>;
+                       interrupts = <0 126 4>;
+                       resets = <&rst WATCHDOG3_RESET>;
+                       clocks = <&clkmgr AGILEX_L4_SYS_FREE_CLK>;
+                       status = "disabled";
+               };
+
+               sdr: sdr at f8011100 {
+                       compatible = "altr,sdr-ctl", "syscon";
+                       reg = <0xf8011100 0xc0>;
+               };
+
+               eccmgr {
+                       compatible = "altr,socfpga-s10-ecc-manager",
+                                    "altr,socfpga-a10-ecc-manager";
+                       altr,sysmgr-syscon = <&sysmgr>;
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+                       interrupts = <0 15 4>;
+                       interrupt-controller;
+                       #interrupt-cells = <2>;
+                       ranges;
+
+                       sdramedac {
+                               compatible = "altr,sdram-edac-s10";
+                               altr,sdr-syscon = <&sdr>;
+                               interrupts = <16 4>;
+                       };
+
+                       ocram-ecc at ff8cc000 {
+                               compatible = "altr,socfpga-s10-ocram-ecc",
+                                            "altr,socfpga-a10-ocram-ecc";
+                               reg = <0xff8cc000 0x100>;
+                               altr,ecc-parent = <&ocram>;
+                               interrupts = <1 4>;
+                       };
+
+                       usb0-ecc at ff8c4000 {
+                               compatible = "altr,socfpga-s10-usb-ecc",
+                                            "altr,socfpga-usb-ecc";
+                               reg = <0xff8c4000 0x100>;
+                               altr,ecc-parent = <&usb0>;
+                               interrupts = <2 4>;
+                       };
+
+                       emac0-rx-ecc at ff8c0000 {
+                               compatible = "altr,socfpga-s10-eth-mac-ecc",
+                                            "altr,socfpga-eth-mac-ecc";
+                               reg = <0xff8c0000 0x100>;
+                               altr,ecc-parent = <&gmac0>;
+                               interrupts = <4 4>;
+                       };
+
+                       emac0-tx-ecc at ff8c0400 {
+                               compatible = "altr,socfpga-s10-eth-mac-ecc",
+                                            "altr,socfpga-eth-mac-ecc";
+                               reg = <0xff8c0400 0x100>;
+                               altr,ecc-parent = <&gmac0>;
+                               interrupts = <5 4>;
+                       };
+
+                       sdmmca-ecc at ff8c8c00 {
+                               compatible = "altr,socfpga-s10-sdmmc-ecc",
+                                            "altr,socfpga-sdmmc-ecc";
+                               reg = <0xff8c8c00 0x100>;
+                               altr,ecc-parent = <&mmc>;
+                               interrupts = <14 4>,
+                                            <15 4>;
+                       };
+               };
+
+               qspi: spi at ff8d2000 {
+                       compatible = "cdns,qspi-nor";
+                       #address-cells = <1>;
+                       #size-cells = <0>;
+                       reg = <0xff8d2000 0x100>,
+                             <0xff900000 0x100000>;
+                       interrupts = <0 3 4>;
+                       cdns,fifo-depth = <128>;
+                       cdns,fifo-width = <4>;
+                       cdns,trigger-address = <0x00000000>;
+                       clocks = <&qspi_clk>;
+
+                       status = "disabled";
+               };
+
+               firmware {
+                       svc {
+                               compatible = "intel,stratix10-svc";
+                               method = "smc";
+                               memory-region = <&service_reserved>;
+
+                               fpga_mgr: fpga-mgr {
+                                       compatible = "intel,stratix10-soc-fpga-mgr";
+                               };
+                       };
+               };
+       };
+};
arch/arm/dts/socfpga_agilex_socdk-u-boot.dtsi new file +39 -0
new file mode 100644
index 0000000000..1908be4b8b
@@ -0,0 +1,39 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * U-Boot additions
+ *
+ * Copyright (C) 2019 Intel Corporation <www.intel.com>
+ */
+
+#include "socfpga_agilex-u-boot.dtsi"
+
+/{
+       aliases {
+               spi0 = &qspi;
+               i2c0 = &i2c1;
+       };
+
+       memory {
+               /* 8GB */
+               reg = <0 0x00000000 0 0x80000000>,
+                     <2 0x80000000 1 0x80000000>;
+       };
+};
+
+&flash0 {
+       compatible = "jedec,spi-nor";
+       spi-tx-bus-width = <4>;
+       spi-rx-bus-width = <4>;
+       u-boot,dm-pre-reloc;
+};
+
+&i2c1 {
+       status = "okay";
+};
+
+&mmc {
+       drvsel = <3>;
+       smplsel = <0>;
+       u-boot,dm-pre-reloc;
+};
+
arch/arm/dts/socfpga_agilex_socdk.dts new file +141 -1
new file mode 100644
index 0000000000..bcdeecc0e0
@@ -0,0 +1,141 @@
+// SPDX-License-Identifier:     GPL-2.0
+/*
+ * Copyright (C) 2019, Intel Corporation
+ */
+#include "socfpga_agilex.dtsi"
+
+/ {
+       model = "SoCFPGA Agilex SoCDK";
+
+       aliases {
+               serial0 = &uart0;
+               ethernet0 = &gmac0;
+               ethernet1 = &gmac1;
+               ethernet2 = &gmac2;
+       };
+
+       chosen {
+               stdout-path = "serial0:115200n8";
+       };
+
+       leds {
+               compatible = "gpio-leds";
+               hps0 {
+                       label = "hps_led0";
+                       gpios = <&portb 20 GPIO_ACTIVE_HIGH>;
+               };
+
+               hps1 {
+                       label = "hps_led1";
+                       gpios = <&portb 19 GPIO_ACTIVE_HIGH>;
+               };
+
+               hps2 {
+                       label = "hps_led2";
+                       gpios = <&portb 21 GPIO_ACTIVE_HIGH>;
+               };
+       };
+
+       memory {
+               device_type = "memory";
+               /* We expect the bootloader to fill in the reg */
+               reg = <0 0 0 0>;
+       };
+
+       soc {
+               clocks {
+                       osc1 {
+                               clock-frequency = <25000000>;
+                       };
+               };
+       };
+};
+
+&gpio1 {
+       status = "okay";
+};
+
+&gmac0 {
+       status = "okay";
+       phy-mode = "rgmii";
+       phy-handle = <&phy0>;
+
+       max-frame-size = <9000>;
+
+       mdio0 {
+               #address-cells = <1>;
+               #size-cells = <0>;
+               compatible = "snps,dwmac-mdio";
+               phy0: ethernet-phy at 0 {
+                       reg = <4>;
+
+                       txd0-skew-ps = <0>; /* -420ps */
+                       txd1-skew-ps = <0>; /* -420ps */
+                       txd2-skew-ps = <0>; /* -420ps */
+                       txd3-skew-ps = <0>; /* -420ps */
+                       rxd0-skew-ps = <420>; /* 0ps */
+                       rxd1-skew-ps = <420>; /* 0ps */
+                       rxd2-skew-ps = <420>; /* 0ps */
+                       rxd3-skew-ps = <420>; /* 0ps */
+                       txen-skew-ps = <0>; /* -420ps */
+                       txc-skew-ps = <900>; /* 0ps */
+                       rxdv-skew-ps = <420>; /* 0ps */
+                       rxc-skew-ps = <1680>; /* 780ps */
+               };
+       };
+};
+
+&mmc {
+       status = "okay";
+       cap-sd-highspeed;
+       broken-cd;
+       bus-width = <4>;
+};
+
+&uart0 {
+       status = "okay";
+};
+
+&usb0 {
+       status = "okay";
+       disable-over-current;
+};
+
+&watchdog0 {
+       status = "okay";
+};
+
+&qspi {
+       flash0: flash at 0 {
+               #address-cells = <1>;
+               #size-cells = <1>;
+               compatible = "mt25qu02g";
+               reg = <0>;
+               spi-max-frequency = <100000000>;
+
+               m25p,fast-read;
+               cdns,page-size = <256>;
+               cdns,block-size = <16>;
+               cdns,read-delay = <1>;
+               cdns,tshsl-ns = <50>;
+               cdns,tsd2d-ns = <50>;
+               cdns,tchsh-ns = <4>;
+               cdns,tslch-ns = <4>;
+
+               partitions {
+                       compatible = "fixed-partitions";
+                       #address-cells = <1>;
+                       #size-cells = <1>;
+
+                       qspi_boot: partition at 0 {
+                               label = "Boot and fpga data";
+                               reg = <0x0 0x034B0000>;
+                       };
+
+                       qspi_rootfs: partition at 34B0000 {
+                               label = "Root Filesystem - JFFS2";
+                               reg = <0x034B0000 0x0EB50000>;
+                       };
+               };
+       };
+};
--

2.19.0

#24 lore raw

PATCH v8 18/19 configs: socfpga: Move Stratix10 and Agilex common CONFIGs

In reply to Ley Foon Tan

Move Stratix10 and Agilex common CONFIGs to socfpga_soc64_common.h.

---
 ...ratix10_socdk.h => socfpga_soc64_common.h} |   8 +-
 include/configs/socfpga_stratix10_socdk.h     | 193 +-----------------
 2 files changed, 7 insertions(+), 194 deletions(-)
 copy include/configs/{socfpga_stratix10_socdk.h => socfpga_soc64_common.h} (96%)
include/configs/socfpga_soc64_common.h renamed from include/configs/socfpga_stratix10_socdk.h +4 -4
similarity index 96%
copy from include/configs/socfpga_stratix10_socdk.h
copy to include/configs/socfpga_soc64_common.h
index e8e66fa4ae..f69a55c191 100644
@@ -1,11 +1,11 @@
 /* SPDX-License-Identifier: GPL-2.0
  *
- * Copyright (C) 2017-2018 Intel Corporation <www.intel.com>
+ * Copyright (C) 2017-2019 Intel Corporation <www.intel.com>
  *
  */
 
-#ifndef __CONFIG_SOCFGPA_STRATIX10_H__
-#define __CONFIG_SOCFGPA_STRATIX10_H__
+#ifndef __CONFIG_SOCFPGA_SOC64_COMMON_H__
+#define __CONFIG_SOCFPGA_SOC64_COMMON_H__
 
 #include <asm/arch/base_addr_s10.h>
 #include <asm/arch/handoff_s10.h>
@@ -196,4 +196,4 @@ unsigned int cm_get_l4_sys_free_clk_hz(void);
 #define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION	1
 #define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME		"u-boot.img"
 
-#endif	/* __CONFIG_H */
+#endif	/* __CONFIG_SOCFPGA_SOC64_COMMON_H__ */
include/configs/socfpga_stratix10_socdk.h +3 -190

202 lines not on this page · raw message

Signature · 1 line
2.19.0
#25 lore raw

PATCH v8 18/19 configs: socfpga: Move Stratix10 and Agilex common CONFIGs

Quoted 4 lines · Ley Foon Tan

Move Stratix10 and Agilex common CONFIGs to socfpga_soc64_common.h.

Quoted 244 lines
---
 ...ratix10_socdk.h => socfpga_soc64_common.h} |   8 +-
 include/configs/socfpga_stratix10_socdk.h     | 193 +-----------------
 2 files changed, 7 insertions(+), 194 deletions(-)
 copy include/configs/{socfpga_stratix10_socdk.h => socfpga_soc64_common.h} (96%)
include/configs/socfpga_soc64_common.h renamed from include/configs/socfpga_stratix10_socdk.h +4 -4
similarity index 96%
copy from include/configs/socfpga_stratix10_socdk.h
copy to include/configs/socfpga_soc64_common.h
index e8e66fa4ae..f69a55c191 100644
@@ -1,11 +1,11 @@
 /* SPDX-License-Identifier: GPL-2.0
  *
- * Copyright (C) 2017-2018 Intel Corporation <www.intel.com>
+ * Copyright (C) 2017-2019 Intel Corporation <www.intel.com>
  *
  */
 
-#ifndef __CONFIG_SOCFGPA_STRATIX10_H__
-#define __CONFIG_SOCFGPA_STRATIX10_H__
+#ifndef __CONFIG_SOCFPGA_SOC64_COMMON_H__
+#define __CONFIG_SOCFPGA_SOC64_COMMON_H__
 
 #include <asm/arch/base_addr_s10.h>
 #include <asm/arch/handoff_s10.h>
@@ -196,4 +196,4 @@ unsigned int cm_get_l4_sys_free_clk_hz(void);
 #define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION     1
 #define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME                "u-boot.img"
 
-#endif /* __CONFIG_H */
+#endif /* __CONFIG_SOCFPGA_SOC64_COMMON_H__ */
include/configs/socfpga_stratix10_socdk.h +3 -191
index e8e66fa4ae..09b46ba013 100644
@@ -1,199 +1,12 @@
 /* SPDX-License-Identifier: GPL-2.0
  *
- * Copyright (C) 2017-2018 Intel Corporation <www.intel.com>
+ * Copyright (C) 2017-2019 Intel Corporation <www.intel.com>
  *
  */
 
 #ifndef __CONFIG_SOCFGPA_STRATIX10_H__
 #define __CONFIG_SOCFGPA_STRATIX10_H__
 
-#include <asm/arch/base_addr_s10.h>
-#include <asm/arch/handoff_s10.h>
+#include <configs/socfpga_soc64_common.h>
 
-/*
- * U-Boot general configurations
- */
-#define CONFIG_SYS_MONITOR_BASE                CONFIG_SYS_TEXT_BASE
-#define CONFIG_LOADADDR                        0x2000000
-#define CONFIG_SYS_LOAD_ADDR           CONFIG_LOADADDR
-#define CONFIG_REMAKE_ELF
-/* sysmgr.boot_scratch_cold4 & 5 (64bit) will be used for PSCI_CPU_ON call */
-#define CPU_RELEASE_ADDR               0xFFD12210
-#define CONFIG_SYS_CACHELINE_SIZE      64
-#define CONFIG_SYS_MEM_RESERVE_SECURE  0       /* using OCRAM, not DDR */
-
-/*
- * U-Boot console configurations
- */
-#define CONFIG_SYS_MAXARGS             64
-#define CONFIG_SYS_CBSIZE              2048
-#define CONFIG_SYS_PBSIZE              (CONFIG_SYS_CBSIZE + \
-                                       sizeof(CONFIG_SYS_PROMPT) + 16)
-#define CONFIG_SYS_BARGSIZE            CONFIG_SYS_CBSIZE
-
-/* Extend size of kernel image for uncompression */
-#define CONFIG_SYS_BOOTM_LEN           (32 * 1024 * 1024)
-
-/*
- * U-Boot run time memory configurations
- */
-#define CONFIG_SYS_INIT_RAM_ADDR       0xFFE00000
-#define CONFIG_SYS_INIT_RAM_SIZE       0x40000
-#define CONFIG_SYS_INIT_SP_ADDR                (CONFIG_SYS_INIT_RAM_ADDR  \
-                                       + CONFIG_SYS_INIT_RAM_SIZE \
-                                       - S10_HANDOFF_SIZE)
-#define CONFIG_SYS_INIT_SP_OFFSET      (CONFIG_SYS_INIT_SP_ADDR)
-#define CONFIG_SYS_MALLOC_LEN          (5 * 1024 * 1024)
-
-/*
- * U-Boot environment configurations
- */
-#define CONFIG_SYS_MMC_ENV_DEV         0       /* device 0 */
-
-/*
- * QSPI support
- */
- #ifdef CONFIG_CADENCE_QSPI
-/* Enable it if you want to use dual-stacked mode */
-/*#define CONFIG_QSPI_RBF_ADDR         0x720000*/
-
-/* Flash device info */
-
-/*#define CONFIG_ENV_IS_IN_SPI_FLASH*/
-
-#ifndef CONFIG_SPL_BUILD
-#define CONFIG_MTD_DEVICE
-#define CONFIG_MTD_PARTITIONS
-#define MTDIDS_DEFAULT                 "nor0=ff705000.spi.0"
-#endif /* CONFIG_SPL_BUILD */
-
-#ifndef __ASSEMBLY__
-unsigned int cm_get_qspi_controller_clk_hz(void);
-#define CONFIG_CQSPI_REF_CLK           cm_get_qspi_controller_clk_hz()
-#endif
-
-#endif /* CONFIG_CADENCE_QSPI */
-
-/*
- * Boot arguments passed to the boot command. The value of
- * CONFIG_BOOTARGS goes into the environment value "bootargs".
- * Do note the value will override also the chosen node in FDT blob.
- */
-#define CONFIG_BOOTARGS "earlycon"
-#define CONFIG_BOOTCOMMAND "run fatscript; run mmcload;run linux_qspi_enable;" \
-                          "run mmcboot"
-
-#define CONFIG_EXTRA_ENV_SETTINGS \
-       "loadaddr=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \
-       "bootfile=Image\0" \
-       "fdt_addr=8000000\0" \
-       "fdtimage=socfpga_stratix10_socdk.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" \
-       "linux_qspi_enable=if sf probe; then " \
-               "echo Enabling QSPI at Linux DTB...;" \
-               "fdt addr ${fdt_addr}; fdt resize;" \
-               "fdt set /soc/spi at ff8d2000 status okay;" \
-               "fdt set /soc/clkmgr/clocks/qspi_clk clock-frequency " \
-               " ${qspi_clock}; fi; \0" \
-       "scriptaddr=0x02100000\0" \
-       "scriptfile=u-boot.scr\0" \
-       "fatscript=if fatload mmc 0:1 ${scriptaddr} ${scriptfile};" \
-                  "then source ${scriptaddr}; fi\0" \
-       "socfpga_legacy_reset_compat=1\0"
-
-/*
- * Generic Interrupt Controller Definitions
- */
-#define CONFIG_GICV2
-
-/*
- * External memory configurations
- */
-#define PHYS_SDRAM_1                   0x0
-#define PHYS_SDRAM_1_SIZE              (1 * 1024 * 1024 * 1024)
-#define CONFIG_SYS_SDRAM_BASE          0
-#define CONFIG_SYS_MEMTEST_START       0
-#define CONFIG_SYS_MEMTEST_END         PHYS_SDRAM_1_SIZE - 0x200000
-
-/*
- * Serial / UART configurations
- */
-#define CONFIG_SYS_NS16550_CLK         100000000
-#define CONFIG_SYS_NS16550_MEM32
-
-/*
- * Timer & watchdog configurations
- */
-#define COUNTER_FREQUENCY              400000000
-
-/*
- * SDMMC configurations
- */
-#ifdef CONFIG_CMD_MMC
-#define CONFIG_SYS_MMC_MAX_BLK_COUNT   256
-#endif
-/*
- * Flash configurations
- */
-#define CONFIG_SYS_MAX_FLASH_BANKS     1
-
-/* Ethernet on SoC (EMAC) */
-#if defined(CONFIG_CMD_NET)
-#define CONFIG_DW_ALTDESCRIPTOR
-#endif /* CONFIG_CMD_NET */
-
-/*
- * L4 Watchdog
- */
-#ifdef CONFIG_SPL_BUILD
-#define CONFIG_HW_WATCHDOG
-#define CONFIG_DESIGNWARE_WATCHDOG
-#define CONFIG_DW_WDT_BASE             SOCFPGA_L4WD0_ADDRESS
-#ifndef __ASSEMBLY__
-unsigned int cm_get_l4_sys_free_clk_hz(void);
-#define CONFIG_DW_WDT_CLOCK_KHZ                (cm_get_l4_sys_free_clk_hz() / 1000)
-#endif
-#endif
-
-/*
- * SPL memory layout
- *
- * On chip RAM
- * 0xFFE0_0000 ...... Start of OCRAM
- * SPL code, rwdata
- * empty space
- * 0xFFEx_xxxx ...... Top of stack (grows down)
- * 0xFFEy_yyyy ...... Global Data
- * 0xFFEz_zzzz ...... Malloc prior relocation (size CONFIG_SYS_MALLOC_F_LEN)
- * 0xFFE3_F000 ...... Hardware handdoff blob (size 4KB)
- * 0xFFE3_FFFF ...... End of OCRAM
- *
- * SDRAM
- * 0x0000_0000 ...... Start of SDRAM_1
- * unused / empty space for image loading
- * Size 64MB   ...... MALLOC (size CONFIG_SYS_SPL_MALLOC_SIZE)
- * Size 1MB    ...... BSS (size CONFIG_SPL_BSS_MAX_SIZE)
- * 0x8000_0000 ...... End of SDRAM_1 (assume 2GB)
- *
- */
-#define CONFIG_SPL_TARGET              "spl/u-boot-spl.hex"
-#define CONFIG_SPL_MAX_SIZE            CONFIG_SYS_INIT_RAM_SIZE
-#define CONFIG_SPL_STACK               CONFIG_SYS_INIT_SP_ADDR
-#define CONFIG_SPL_BSS_MAX_SIZE                0x100000        /* 1 MB */
-#define CONFIG_SPL_BSS_START_ADDR      (PHYS_SDRAM_1 + PHYS_SDRAM_1_SIZE \
-                                       - CONFIG_SPL_BSS_MAX_SIZE)
-#define CONFIG_SYS_SPL_MALLOC_SIZE     (CONFIG_SYS_MALLOC_LEN)
-#define CONFIG_SYS_SPL_MALLOC_START    (CONFIG_SPL_BSS_START_ADDR \
-                                       - CONFIG_SYS_SPL_MALLOC_SIZE)
-
-/* SPL SDMMC boot support */
-#define CONFIG_SYS_MMCSD_FS_BOOT_PARTITION     1
-#define CONFIG_SPL_FS_LOAD_PAYLOAD_NAME                "u-boot.img"
-
-#endif /* __CONFIG_H */
+#endif /* __CONFIG_SOCFGPA_STRATIX10_H__ */
--

2.19.0

#26 lore raw

PATCH v8 19/19 arm: socfpga: agilex: Enable Agilex SoC build

In reply to Ley Foon Tan

Add build support for Agilex SoC.

---
v7:
- Move CONFIG_DW_WDT_CLOCK_KHZ to _soc64_common.h
- Use fdtimage filename from CONFIG_DEFAULT_DEVICE_TREE

v6:
- Include socfpga_soc64_common.h.

v5:
- Enable NCORE_CACHE

v3:
- Disable CONFIG_USE_TINY_PRINTF

v2:
- Remove IC_CLK define, use clock DM method to get i2c clock
- Change CONFIG_ENV_SIZE to 4KB since CONFIG_SPI_FLASH_USE_4K_SECTORS is enabled.

---
 arch/arm/Kconfig                       |  4 +-
 arch/arm/mach-socfpga/Kconfig          | 16 +++++++
 arch/arm/mach-socfpga/Makefile         |  9 ++++
 configs/socfpga_agilex_defconfig       | 60 ++++++++++++++++++++++++++
 include/configs/socfpga_agilex_socdk.h | 12 ++++++
 include/configs/socfpga_soc64_common.h |  6 ++-
 6 files changed, 104 insertions(+), 3 deletions(-)
 create mode 100644 configs/socfpga_agilex_defconfig
 create mode 100644 include/configs/socfpga_agilex_socdk.h
arch/arm/Kconfig +2 -2
index f96841c777..563d0b7eb8 100644
@@ -905,7 +905,7 @@ config ARCH_SOCFPGA
 	bool "Altera SOCFPGA family"
 	select ARCH_EARLY_INIT_R
 	select ARCH_MISC_INIT if !TARGET_SOCFPGA_ARRIA10
-	select ARM64 if TARGET_SOCFPGA_STRATIX10
+	select ARM64 if TARGET_SOCFPGA_STRATIX10 || TARGET_SOCFPGA_AGILEX
 	select CPU_V7A if TARGET_SOCFPGA_GEN5 || TARGET_SOCFPGA_ARRIA10
 	select DM
 	select DM_SERIAL
@@ -917,7 +917,7 @@ config ARCH_SOCFPGA
 	select SPL_LIBGENERIC_SUPPORT
 	select SPL_NAND_SUPPORT if SPL_NAND_DENALI
 	select SPL_OF_CONTROL
-	select SPL_SEPARATE_BSS if TARGET_SOCFPGA_STRATIX10
+	select SPL_SEPARATE_BSS if TARGET_SOCFPGA_STRATIX10 || TARGET_SOCFPGA_AGILEX
 	select SPL_SERIAL_SUPPORT
 	select SPL_SYSRESET
 	select SPL_WATCHDOG_SUPPORT
arch/arm/mach-socfpga/Kconfig +16 -0
index 3770e07258..969698c83f 100644
@@ -29,6 +29,15 @@ config SYS_TEXT_BASE
 	default 0x01000040 if TARGET_SOCFPGA_ARRIA10
 	default 0x01000040 if TARGET_SOCFPGA_GEN5
 
+config TARGET_SOCFPGA_AGILEX
+	bool
+	select ARMV8_MULTIENTRY
+	select ARMV8_SET_SMPEN
+	select ARMV8_SPIN_TABLE
+	select CLK
+	select NCORE_CACHE
+	select SPL_CLK if SPL
+
 config TARGET_SOCFPGA_ARRIA5
 	bool
 	select TARGET_SOCFPGA_GEN5
@@ -75,6 +84,10 @@ choice
 	prompt "Altera SOCFPGA board select"
 	optional
 
+config TARGET_SOCFPGA_AGILEX_SOCDK
+	bool "Intel SOCFPGA SoCDK (Agilex)"
+	select TARGET_SOCFPGA_AGILEX
+
 config TARGET_SOCFPGA_ARIES_MCVEVK
 	bool "Aries MCVEVK (Cyclone V)"
 	select TARGET_SOCFPGA_CYCLONE5
@@ -135,6 +148,7 @@ config TARGET_SOCFPGA_TERASIC_SOCKIT
 endchoice
 
 config SYS_BOARD
+	default "agilex-socdk" if TARGET_SOCFPGA_AGILEX_SOCDK
 	default "arria5-socdk" if TARGET_SOCFPGA_ARRIA5_SOCDK
 	default "arria10-socdk" if TARGET_SOCFPGA_ARRIA10_SOCDK
 	default "cyclone5-socdk" if TARGET_SOCFPGA_CYCLONE5_SOCDK
@@ -151,6 +165,7 @@ config SYS_BOARD
 	default "vining_fpga" if TARGET_SOCFPGA_SOFTING_VINING_FPGA
 
 config SYS_VENDOR
+	default "intel" if TARGET_SOCFPGA_AGILEX_SOCDK
 	default "altera" if TARGET_SOCFPGA_ARRIA5_SOCDK
 	default "altera" if TARGET_SOCFPGA_ARRIA10_SOCDK
 	default "altera" if TARGET_SOCFPGA_CYCLONE5_SOCDK
@@ -168,6 +183,7 @@ config SYS_SOC
 	default "socfpga"
 
 config SYS_CONFIG_NAME
+	default "socfpga_agilex_socdk" if TARGET_SOCFPGA_AGILEX_SOCDK
 	default "socfpga_arria5_socdk" if TARGET_SOCFPGA_ARRIA5_SOCDK
 	default "socfpga_arria10_socdk" if TARGET_SOCFPGA_ARRIA10_SOCDK
 	default "socfpga_cyclone5_socdk" if TARGET_SOCFPGA_CYCLONE5_SOCDK
arch/arm/mach-socfpga/Makefile +9 -0
index 81b6ffc675..418f543b20 100644
@@ -41,6 +41,14 @@ endif
 
 ifdef CONFIG_TARGET_SOCFPGA_AGILEX
 obj-y	+= clock_manager_agilex.o
+obj-y	+= mailbox_s10.o
+obj-y	+= misc_s10.o
+obj-y	+= mmu-arm64_s10.o
+obj-y	+= reset_manager_s10.o
+obj-y	+= system_manager_s10.o
+obj-y	+= timer_s10.o
+obj-y	+= wrap_pinmux_config_s10.o
+obj-y	+= wrap_pll_config_s10.o
 endif
 
 ifdef CONFIG_SPL_BUILD
@@ -59,6 +67,7 @@ obj-y	+= firewall.o
 obj-y	+= spl_s10.o
 endif
 ifdef CONFIG_TARGET_SOCFPGA_AGILEX
+obj-y	+= firewall.o
 obj-y	+= spl_agilex.o
 endif
 endif
configs/socfpga_agilex_defconfig new file +60 -0

60 lines not on this page · raw message

include/configs/socfpga_agilex_socdk.h new file +12 -0
new file mode 100644
index 0000000000..4eede7c84b
@@ -0,0 +1,12 @@
+/* SPDX-License-Identifier: GPL-2.0
+ *
+ * Copyright (C) 2019 Intel Corporation <www.intel.com>
+ *
+ */
+
+#ifndef __CONFIG_SOCFGPA_AGILEX_H__
+#define __CONFIG_SOCFGPA_AGILEX_H__
+
+#include <configs/socfpga_soc64_common.h>
+
+#endif	/* __CONFIG_SOCFGPA_AGILEX_H__ */
include/configs/socfpga_soc64_common.h +5 -1
index f69a55c191..4b27483788 100644
@@ -87,7 +87,7 @@ unsigned int cm_get_qspi_controller_clk_hz(void);
 	"loadaddr=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \
 	"bootfile=Image\0" \
 	"fdt_addr=8000000\0" \
-	"fdtimage=socfpga_stratix10_socdk.dtb\0" \
+	"fdtimage=" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0" \
 	"mmcroot=/dev/mmcblk0p2\0" \
 	"mmcboot=setenv bootargs " CONFIG_BOOTARGS \
 		" root=${mmcroot} rw rootwait;" \
@@ -155,10 +155,14 @@ unsigned int cm_get_qspi_controller_clk_hz(void);
 #define CONFIG_HW_WATCHDOG
 #define CONFIG_DESIGNWARE_WATCHDOG
 #define CONFIG_DW_WDT_BASE		SOCFPGA_L4WD0_ADDRESS
+#ifdef CONFIG_TARGET_SOCFPGA_STRATIX10
 #ifndef __ASSEMBLY__
 unsigned int cm_get_l4_sys_free_clk_hz(void);
 #define CONFIG_DW_WDT_CLOCK_KHZ		(cm_get_l4_sys_free_clk_hz() / 1000)
 #endif
+#else
+#define CONFIG_DW_WDT_CLOCK_KHZ		100000
+#endif
 #endif
 
 /*
Signature · 1 line
2.19.0