Skip to contentSkip to conversation

Agilex5 Platform Enablement

PATCH In review Jit Loon Lim 2 participants 23 messages Jun 21, 2023 – Jun 30, 2023

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

cover Agilex5 Platform Enablement

Intel Agilex5 is a midrange FPGAs optimized for applications requiring high performance, lower power, and smaller form factors and lower logic densities. U-Boot is one of the bootloader to boot along with ARM trusted Firmware to boot the board up.

*** BLURB HERE ***

Jit Loon Lim (16):
arch: arm: update kconfig for new platform agilex5
arch: arm: dts: add dts and dtsi for new platform agilex5
arch: arm: mach-socfpga: add new platform agilex5 mach-socfpga
enablement
arch: arm: mach-socfpga: include: mach: add new platform agilex5
mach-socfpga enablement
board: intel: add new platform agilex5 socdk
configs: add new platform agilex5 defconfig
doc: device-tree-bindings: misc: add secreg text file for agilex5
drivers: ddr: altera: add ddr support for agilex5
drivers: clk: altera: add clock support for agilex5
drivers: misc: update driver misc for agilex5
drivers: mmc: add mmc/cadence driver for agilex5
drivers: phy: add combo phy driver for agilex5
drivers: reset: add reset driver for agilex5
drivers: sysreset: add system driver for agilex5
drivers: watchdog: update watchdog driver for agilex5
includes: add and update configuration for agilex5

Sieu Mun Tang (1):
tools: binman: update binman tool for agilex5

 arch/arm/Kconfig                              |   5 +-
 arch/arm/dts/Makefile                         |   1 +
 arch/arm/dts/socfpga_agilex5-u-boot.dtsi      | 459 ++++++++++
 arch/arm/dts/socfpga_agilex5.dtsi             | 634 +++++++++++++
 .../arm/dts/socfpga_agilex5_socdk-u-boot.dtsi | 131 +++
 arch/arm/dts/socfpga_agilex5_socdk.dts        | 165 ++++
 arch/arm/dts/socfpga_soc64_fit-u-boot.dtsi    |  38 +-
 arch/arm/dts/socfpga_soc64_u-boot.dtsi        | 120 +++
 arch/arm/dts/socfpga_stratix10.dtsi           |   0
 .../dts/socfpga_stratix10_socdk-u-boot.dtsi   |   0
 arch/arm/dts/socfpga_stratix10_socdk.dts      |   0
 arch/arm/mach-socfpga/Kconfig                 |  92 ++
 arch/arm/mach-socfpga/Makefile                |  69 +-
 arch/arm/mach-socfpga/board.c                 |  65 +-
 arch/arm/mach-socfpga/clock_manager_agilex5.c |  82 ++
 arch/arm/mach-socfpga/firewall.c              | 107 ---
 .../include/mach/base_addr_soc64.h            |  43 +-
 .../mach-socfpga/include/mach/clock_manager.h |   5 +-
 .../include/mach/clock_manager_agilex5.h      |  12 +
 arch/arm/mach-socfpga/include/mach/firewall.h |  42 +-
 .../mach-socfpga/include/mach/handoff_soc64.h |  25 +-
 .../mach-socfpga/include/mach/mailbox_s10.h   |  32 +-
 .../include/mach/reset_manager_soc64.h        |  33 +-
 .../mach-socfpga/include/mach/smmu_agilex5.h  |  30 +
 arch/arm/mach-socfpga/include/mach/smmu_s10.h |  73 ++
 .../include/mach/system_manager_soc64.h       | 126 ++-
 arch/arm/mach-socfpga/include/mach/timer.h    |  30 +
 arch/arm/mach-socfpga/lowlevel_init_agilex5.S |  61 ++
 arch/arm/mach-socfpga/lowlevel_init_soc64.S   | 167 +++-
 arch/arm/mach-socfpga/mailbox_s10.c           |  21 +
 arch/arm/mach-socfpga/misc.c                  |  19 +-
 arch/arm/mach-socfpga/misc_soc64.c            |  33 +-
 arch/arm/mach-socfpga/mmu-arm64_s10.c         |  43 +-
 arch/arm/mach-socfpga/reset_manager_s10.c     | 271 +++++-
 arch/arm/mach-socfpga/secure_reg_helper.c     |   4 +-
 arch/arm/mach-socfpga/smmu_agilex5.c          |  34 +
 arch/arm/mach-socfpga/smmu_s10.c              | 126 +++
 arch/arm/mach-socfpga/spl_agilex5.c           | 180 ++++
 arch/arm/mach-socfpga/spl_soc64.c             | 188 +++-
 arch/arm/mach-socfpga/u-boot-spl-soc64.lds    |  93 ++
 arch/arm/mach-socfpga/wrap_handoff_soc64.c    |   7 +-
 board/intel/agilex5-socdk/MAINTAINERS         |   8 +
 board/intel/agilex5-socdk/Makefile            |   7 +
 board/intel/agilex5-socdk/socfpga.c           |   7 +
 configs/socfpga_agilex5_defconfig             | 125 +++
 configs/socfpga_agilex5_legacy_defconfig      |  87 ++
 .../misc/socfpga_secreg.txt                   | 397 ++++++++
 drivers/clk/altera/Makefile                   |   1 +
 drivers/clk/altera/clk-agilex5.c              | 736 +++++++++++++++
 drivers/clk/altera/clk-agilex5.h              | 263 ++++++
 drivers/ddr/altera/Makefile                   |   5 +-
 drivers/ddr/altera/iossm_mailbox.c            | 786 ++++++++++++++++
 drivers/ddr/altera/iossm_mailbox.h            | 141 +++
 drivers/ddr/altera/sdram_agilex5.c            | 329 +++++++
 drivers/ddr/altera/sdram_soc64.c              |  78 +-
 drivers/ddr/altera/sdram_soc64.h              |  17 +-
 drivers/misc/Kconfig                          |   9 +
 drivers/misc/Makefile                         |   1 +
 drivers/misc/socfpga_secreg.c                 | 116 +++
 drivers/mmc/mmc.c                             |  27 +-
 drivers/mmc/sdhci-cadence.c                   | 164 +++-
 drivers/phy/cadence/Kconfig                   |   9 +
 drivers/phy/cadence/Makefile                  |   1 +
 drivers/phy/cadence/phy-cadence-combophy.c    | 855 ++++++++++++++++++
 drivers/reset/reset-socfpga.c                 |  28 +-
 drivers/sysreset/Kconfig                      |   7 +
 drivers/sysreset/Makefile                     |   1 +
 drivers/sysreset/sysreset_socfpga_agilex5.c   |  44 +
 drivers/watchdog/Kconfig                      |   2 +-
 include/configs/socfpga_agilex5_socdk.h       |  12 +
 include/configs/socfpga_soc64_common.h        | 214 ++++-
 include/dt-bindings/clock/agilex5-clock.h     |  71 ++
 include/dt-bindings/reset/altr,rst-mgr-agx5.h |  82 ++
 tools/binman/control.py                       |   8 +-
 74 files changed, 8019 insertions(+), 285 deletions(-)
 create mode 100644 arch/arm/dts/socfpga_agilex5-u-boot.dtsi
 create mode 100644 arch/arm/dts/socfpga_agilex5.dtsi
 create mode 100644 arch/arm/dts/socfpga_agilex5_socdk-u-boot.dtsi
 create mode 100644 arch/arm/dts/socfpga_agilex5_socdk.dts
 create mode 100644 arch/arm/dts/socfpga_soc64_u-boot.dtsi
 mode change 100755 => 100644 arch/arm/dts/socfpga_stratix10.dtsi
 mode change 100755 => 100644 arch/arm/dts/socfpga_stratix10_socdk-u-boot.dtsi
 mode change 100755 => 100644 arch/arm/dts/socfpga_stratix10_socdk.dts
 create mode 100644 arch/arm/mach-socfpga/clock_manager_agilex5.c
 delete mode 100644 arch/arm/mach-socfpga/firewall.c
 create mode 100644 arch/arm/mach-socfpga/include/mach/clock_manager_agilex5.h
 create mode 100644 arch/arm/mach-socfpga/include/mach/smmu_agilex5.h
 create mode 100644 arch/arm/mach-socfpga/include/mach/smmu_s10.h
 create mode 100644 arch/arm/mach-socfpga/lowlevel_init_agilex5.S
 create mode 100644 arch/arm/mach-socfpga/smmu_agilex5.c
 create mode 100644 arch/arm/mach-socfpga/smmu_s10.c
 create mode 100644 arch/arm/mach-socfpga/spl_agilex5.c
 create mode 100644 arch/arm/mach-socfpga/u-boot-spl-soc64.lds
 create mode 100644 board/intel/agilex5-socdk/MAINTAINERS
 create mode 100644 board/intel/agilex5-socdk/Makefile
 create mode 100644 board/intel/agilex5-socdk/socfpga.c
 create mode 100644 configs/socfpga_agilex5_defconfig
 create mode 100644 configs/socfpga_agilex5_legacy_defconfig
 create mode 100644 doc/device-tree-bindings/misc/socfpga_secreg.txt
 create mode 100644 drivers/clk/altera/clk-agilex5.c
 create mode 100644 drivers/clk/altera/clk-agilex5.h
 create mode 100644 drivers/ddr/altera/iossm_mailbox.c
 create mode 100644 drivers/ddr/altera/iossm_mailbox.h
 create mode 100644 drivers/ddr/altera/sdram_agilex5.c
 create mode 100644 drivers/misc/socfpga_secreg.c
 create mode 100644 drivers/phy/cadence/phy-cadence-combophy.c
 create mode 100644 drivers/sysreset/sysreset_socfpga_agilex5.c
 create mode 100644 include/configs/socfpga_agilex5_socdk.h
 create mode 100644 include/dt-bindings/clock/agilex5-clock.h
 create mode 100644 include/dt-bindings/reset/altr,rst-mgr-agx5.h
Signature · 1 line
2.26.2
#1 lore raw

PATCH 1/17 arch: arm: update kconfig for new platform agilex5

This is for new platform enablement for agilex5

---
 arch/arm/Kconfig | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
arch/arm/Kconfig +4 -1
index 99264a6478..8e36456fa8 100644
@@ -1093,6 +1093,8 @@ config ARCH_SOCFPGA
 	select SPL_LIBGENERIC_SUPPORT
 	select SPL_OF_CONTROL
 	select SPL_SEPARATE_BSS if TARGET_SOCFPGA_SOC64
+	select SPL_DRIVERS_MISC if TARGET_SOCFPGA_SOC64
+	select SPL_SOCFPGA_SEC_REG if TARGET_SOCFPGA_SOC64
 	select SPL_SERIAL
 	select SPL_SYSRESET
 	select SPL_WATCHDOG
@@ -1101,7 +1103,8 @@ config ARCH_SOCFPGA
 	select SYS_THUMB_BUILD if TARGET_SOCFPGA_GEN5 || TARGET_SOCFPGA_ARRIA10
 	select SYSRESET
 	select SYSRESET_SOCFPGA if TARGET_SOCFPGA_GEN5 || TARGET_SOCFPGA_ARRIA10
-	select SYSRESET_SOCFPGA_SOC64 if TARGET_SOCFPGA_SOC64
+	select SYSRESET_SOCFPGA_SOC64 if !TARGET_SOCFPGA_AGILEX5 && TARGET_SOCFPGA_SOC64
+	imply SYSRESET_SOCFPGA_AGILEX5 if TARGET_SOCFPGA_AGILEX5
 	imply CMD_DM
 	imply CMD_MTDPARTS
 	imply CRC32_VERIFY
Signature · 1 line
2.26.2
#2 lore raw

RE: [PATCH v1 01/17] arch: arm: update kconfig for new platform agilex5

Hi Jit Loon,

Quoted 28 lines

-----Original Message-----
From: Lim, Jit Loon <[email protected]>
Sent: Wednesday, 21 June, 2023 11:16 AM
To: [email protected]
Cc: Jagan Teki <[email protected]>; Vignesh R <[email protected]>; Vasut, Marek <[email protected]>; Simon <[email protected]>; Chee, Tien Fong <[email protected]>; Hea, Kok Kiang <[email protected]>; Lokanathan, Raaj <[email protected]>; Maniyam, Dinesh <[email protected]>; Ng, Boon Khai <[email protected]>; Yuslaimi, Alif Zakuan <[email protected]>; Chong, Teik Heng <[email protected]>; Zamri, Muhammad Hazim Izzat <[email protected]>; Lim, Jit Loon <[email protected]>; Tang, Sieu Mun <[email protected]>
Subject: [PATCH v1 01/17] arch: arm: update kconfig for new platform agilex5

This is for new platform enablement for agilex5

---
 arch/arm/Kconfig | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
arch/arm/Kconfig index renamed from arch/arm/Kconfig +0 -0

99264a6478..8e36456fa8 100644

arch/arm/Kconfig config ARCH_SOCFPGA · line 1097

Quoted 5 lines
arch/arm/Kconfig +2 -0
@@ -1093,6 +1093,8 @@ config ARCH_SOCFPGA
 	select SPL_LIBGENERIC_SUPPORT
 	select SPL_OF_CONTROL
 	select SPL_SEPARATE_BSS if TARGET_SOCFPGA_SOC64
+	select SPL_DRIVERS_MISC if TARGET_SOCFPGA_SOC64
+	select SPL_SOCFPGA_SEC_REG if TARGET_SOCFPGA_SOC64

Please exclude these changes for now because this driver is not in mainline yet. You can submit another patch for these changes once the driver is accepted into mainline.

arch/arm/Kconfig config ARCH_SOCFPGA · line 1107

Quoted 13 lines
arch/arm/Kconfig +0 -0
 	select SPL_SERIAL
 	select SPL_SYSRESET
 	select SPL_WATCHDOG
@@ -1101,7 +1103,8 @@ config ARCH_SOCFPGA
 	select SYS_THUMB_BUILD if TARGET_SOCFPGA_GEN5 ||

TARGET_SOCFPGA_ARRIA10

arch/arm/Kconfig +0 -0
 	select SYSRESET
 	select SYSRESET_SOCFPGA if TARGET_SOCFPGA_GEN5 ||

TARGET_SOCFPGA_ARRIA10

arch/arm/Kconfig +1 -1
-	select SYSRESET_SOCFPGA_SOC64 if TARGET_SOCFPGA_SOC64
+	select SYSRESET_SOCFPGA_SOC64 if !TARGET_SOCFPGA_AGILEX5

&& TARGET_SOCFPGA_SOC64

arch/arm/Kconfig +1 -0
+	imply SYSRESET_SOCFPGA_AGILEX5 if TARGET_SOCFPGA_AGILEX5

Please update your commit message, your message should be clear and accurate to reflect your changes here.

Quoted 5 lines
arch/arm/Kconfig +0 -1
 	imply CMD_DM
 	imply CMD_MTDPARTS
 	imply CRC32_VERIFY
--

2.26.2

Thanks and regards,
Tien Fong

#3 lore raw

RE: [PATCH v1 01/17] arch: arm: update kconfig for new platform agilex5

Quoted 77 lines

-----Original Message-----
From: Chee, Tien Fong <[email protected]>
Sent: Wednesday, 28 June, 2023 4:17 PM
To: Lim, Jit Loon <[email protected]>; [email protected]
Cc: Jagan Teki <[email protected]>; Vignesh R <[email protected]>; Vasut, Marek <[email protected]>; Simon <[email protected]>; Hea, Kok Kiang <[email protected]>; Lokanathan, Raaj <[email protected]>; Maniyam, Dinesh <[email protected]>; Ng, Boon Khai <[email protected]>; Yuslaimi, Alif Zakuan <[email protected]>; Chong, Teik Heng <[email protected]>; Zamri, Muhammad Hazim Izzat <[email protected]>; Tang, Sieu Mun <[email protected]>
Subject: RE: [PATCH v1 01/17] arch: arm: update kconfig for new platform agilex5

Hi Jit Loon,

Quoted 29 lines

-----Original Message-----
From: Lim, Jit Loon <[email protected]>
Sent: Wednesday, 21 June, 2023 11:16 AM
To: [email protected]
Cc: Jagan Teki <[email protected]>; Vignesh R <[email protected]>; Vasut, Marek <[email protected]>; Simon <[email protected]>; Chee, Tien Fong <[email protected]>; Hea, Kok Kiang <[email protected]>; Lokanathan, Raaj <[email protected]>; Maniyam, Dinesh <[email protected]>; Ng, Boon Khai <[email protected]>; Yuslaimi, Alif Zakuan <[email protected]>; Chong, Teik Heng <[email protected]>; Zamri, Muhammad Hazim Izzat <[email protected]>; Lim, Jit Loon <[email protected]>; Tang, Sieu Mun <[email protected]>
Subject: [PATCH v1 01/17] arch: arm: update kconfig for new platform agilex5

This is for new platform enablement for agilex5

---
 arch/arm/Kconfig | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
arch/arm/Kconfig index renamed from arch/arm/Kconfig +0 -0

99264a6478..8e36456fa8 100644

arch/arm/Kconfig config ARCH_SOCFPGA · line 1097

Quoted 5 lines
arch/arm/Kconfig +2 -0
@@ -1093,6 +1093,8 @@ config ARCH_SOCFPGA
 	select SPL_LIBGENERIC_SUPPORT
 	select SPL_OF_CONTROL
 	select SPL_SEPARATE_BSS if TARGET_SOCFPGA_SOC64
+	select SPL_DRIVERS_MISC if TARGET_SOCFPGA_SOC64
+	select SPL_SOCFPGA_SEC_REG if TARGET_SOCFPGA_SOC64

Please exclude these changes for now because this driver is not in mainline yet. You can submit another patch for these changes once the driver is accepted into mainline.

arch/arm/Kconfig config ARCH_SOCFPGA · line 1107

Quoted 13 lines
arch/arm/Kconfig +0 -0
 	select SPL_SERIAL
 	select SPL_SYSRESET
 	select SPL_WATCHDOG
@@ -1101,7 +1103,8 @@ config ARCH_SOCFPGA
 	select SYS_THUMB_BUILD if TARGET_SOCFPGA_GEN5 ||

TARGET_SOCFPGA_ARRIA10

arch/arm/Kconfig +0 -0
 	select SYSRESET
 	select SYSRESET_SOCFPGA if TARGET_SOCFPGA_GEN5 ||

TARGET_SOCFPGA_ARRIA10

arch/arm/Kconfig +1 -1
-	select SYSRESET_SOCFPGA_SOC64 if TARGET_SOCFPGA_SOC64
+	select SYSRESET_SOCFPGA_SOC64 if !TARGET_SOCFPGA_AGILEX5

&& TARGET_SOCFPGA_SOC64

arch/arm/Kconfig +1 -0
+	imply SYSRESET_SOCFPGA_AGILEX5 if TARGET_SOCFPGA_AGILEX5

Please update your commit message, your message should be clear and accurate to reflect your changes here.

Quoted 8 lines
Quoted 5 lines
arch/arm/Kconfig +0 -1
 	imply CMD_DM
 	imply CMD_MTDPARTS
 	imply CRC32_VERIFY
--

2.26.2

Thanks and regards,
Tien Fong

Ok. Will update commit message and send out in v2 for review.

#4 lore raw

PATCH 2/17 arch: arm: dts: add dts and dtsi for new platform agilex5

In reply to Jit Loon Lim

This is for new platform enablement for agilex5.
Add agilex5 dtsi and dts.
Update checkpatch error for stratix10.

---
 arch/arm/dts/Makefile                         |   1 +
 arch/arm/dts/socfpga_agilex5-u-boot.dtsi      | 459 +++++++++++++
 arch/arm/dts/socfpga_agilex5.dtsi             | 634 ++++++++++++++++++
 .../arm/dts/socfpga_agilex5_socdk-u-boot.dtsi | 131 ++++
 arch/arm/dts/socfpga_agilex5_socdk.dts        | 165 +++++
 arch/arm/dts/socfpga_soc64_fit-u-boot.dtsi    |  38 +-
 arch/arm/dts/socfpga_soc64_u-boot.dtsi        | 120 ++++
 arch/arm/dts/socfpga_stratix10.dtsi           |   0
 .../dts/socfpga_stratix10_socdk-u-boot.dtsi   |   0
 arch/arm/dts/socfpga_stratix10_socdk.dts      |   0
 10 files changed, 1534 insertions(+), 14 deletions(-)
 create mode 100644 arch/arm/dts/socfpga_agilex5-u-boot.dtsi
 create mode 100644 arch/arm/dts/socfpga_agilex5.dtsi
 create mode 100644 arch/arm/dts/socfpga_agilex5_socdk-u-boot.dtsi
 create mode 100644 arch/arm/dts/socfpga_agilex5_socdk.dts
 create mode 100644 arch/arm/dts/socfpga_soc64_u-boot.dtsi
 mode change 100755 => 100644 arch/arm/dts/socfpga_stratix10.dtsi
 mode change 100755 => 100644 arch/arm/dts/socfpga_stratix10_socdk-u-boot.dtsi
 mode change 100755 => 100644 arch/arm/dts/socfpga_stratix10_socdk.dts
arch/arm/dts/Makefile +1 -0
index 480269fa60..2e4bc556e1 100644
@@ -456,6 +456,7 @@ dtb-$(CONFIG_TARGET_THUNDERX_88XX) += thunderx-88xx.dtb
 
 dtb-$(CONFIG_ARCH_SOCFPGA) +=				\
 	socfpga_agilex_socdk.dtb			\
+	socfpga_agilex5_socdk.dtb			\
 	socfpga_arria5_secu1.dtb			\
 	socfpga_arria5_socdk.dtb			\
 	socfpga_arria10_chameleonv3_270_2.dtb		\
arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +459 -0

459 lines not on this page · raw message

arch/arm/dts/socfpga_agilex5.dtsi new file +634 -0

634 lines not on this page · raw message

arch/arm/dts/socfpga_agilex5_socdk-u-boot.dtsi new file +131 -0

131 lines not on this page · raw message

arch/arm/dts/socfpga_agilex5_socdk.dts new file +165 -0

165 lines not on this page · raw message

arch/arm/dts/socfpga_soc64_fit-u-boot.dtsi +24 -14
index 84b91e8df0..1ca721f070 100644
@@ -2,7 +2,7 @@
 /*
  * U-Boot additions
  *
- * Copyright (C) 2020 Intel Corporation <www.intel.com>
+ * Copyright (C) 2020-2022 Intel Corporation <www.intel.com>
  */
 
 #if defined(CONFIG_FIT)
@@ -21,14 +21,18 @@
 			description = "FIT with firmware and bootloader";
 			#address-cells = <1>;
 
-			images {
+			images: images {
 				uboot {
 					description = "U-Boot SoC64";
 					type = "standalone";
 					os = "U-Boot";
 					arch = "arm64";
 					compression = "none";
+				#if IS_ENABLED(CONFIG_TARGET_SOCFPGA_AGILEX5)
+					load = <0x80200000>;
+				#else
 					load = <0x00200000>;
+				#endif
 					uboot_blob: blob-ext {
 						filename = "u-boot-nodtb.bin";
 					};
@@ -43,8 +47,13 @@
 					os = "arm-trusted-firmware";
 					arch = "arm64";
 					compression = "none";
+				#if IS_ENABLED(CONFIG_TARGET_SOCFPGA_AGILEX5)
+					load = <0x80000000>;
+					entry = <0x80000000>;
+				#else
 					load = <0x00001000>;
 					entry = <0x00001000>;
+				#endif
 					atf_blob: blob-ext {
 						filename = "bl31.bin";
 					};
@@ -53,11 +62,11 @@
 					};
 				};
 
-				fdt {
-					description = "U-Boot SoC64 flat device-tree";
+				fdt-0 {
+					description = "socfpga_socdk";
 					type = "flat_dt";
 					compression = "none";
-					uboot_fdt_blob: blob-ext {
+					fdt_0_blob: blob-ext {
 						filename = "u-boot.dtb";
 					};
 					hash {
@@ -66,17 +75,18 @@
 				};
 			};
 
-			configurations {
-				default = "conf";
-				conf {
-					description = "Intel SoC64 FPGA";
+			board_config: configurations {
+				default = "board-0";
+
+				board-0 {
+					description = "board_0";
 					firmware = "atf";
 					loadables = "uboot";
-					fdt = "fdt";
+					fdt = "fdt-0";
 					signature {
 						algo = "crc32";
 						key-name-hint = "dev";
-						sign-images = "atf", "fdt", "uboot";
+						sign-images = "atf", "uboot", "fdt-0";
 					};
 				};
 			};
@@ -96,8 +106,8 @@
 					arch = "arm64";
 					os = "linux";
 					compression = "none";
-					load = <0x4080000>;
-					entry = <0x4080000>;
+					load = <0x6000000>;
+					entry = <0x6000000>;
 					kernel_blob: blob-ext {
 						filename = "Image";
 					};
@@ -146,7 +156,7 @@
 	filename = "signed-bl31.bin";
 };
 
-&uboot_fdt_blob {
+&fdt_0_blob {
 	filename = "signed-u-boot.dtb";
 };
 
arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +120 -0

120 lines not on this page · raw message

arch/arm/dts/socfpga_stratix10.dtsi +0 -0
old mode 100755
new mode 100644
arch/arm/dts/socfpga_stratix10_socdk-u-boot.dtsi +0 -0
old mode 100755
new mode 100644
arch/arm/dts/socfpga_stratix10_socdk.dts +0 -0
old mode 100755
new mode 100644
Signature · 1 line
2.26.2
#5 lore raw

RE: [PATCH v1 02/17] arch: arm: dts: add dts and dtsi for new platform agilex5

Hi Jit Loon,

Quoted 17 lines

-----Original Message-----
From: Lim, Jit Loon <[email protected]>
Sent: Wednesday, 21 June, 2023 11:16 AM
To: [email protected]
Cc: Jagan Teki <[email protected]>; Vignesh R <[email protected]>; Vasut, Marek <[email protected]>; Simon <[email protected]>; Chee, Tien Fong <[email protected]>; Hea, Kok Kiang <[email protected]>; Lokanathan, Raaj <[email protected]>; Maniyam, Dinesh <[email protected]>; Ng, Boon Khai <[email protected]>; Yuslaimi, Alif Zakuan <[email protected]>; Chong, Teik Heng <[email protected]>; Zamri, Muhammad Hazim Izzat <[email protected]>; Lim, Jit Loon <[email protected]>; Tang, Sieu Mun <[email protected]>
Subject: [PATCH v1 02/17] arch: arm: dts: add dts and dtsi for new platform agilex5

Quoted 3 lines

This is for new platform enablement for agilex5. Add agilex5 dtsi and dts.
Update checkpatch error for stratix10.

Why having checkpatch error for Stratix10?
This should be in a separate patch.

Quoted 272 lines
---
 arch/arm/dts/Makefile                         |   1 +
 arch/arm/dts/socfpga_agilex5-u-boot.dtsi      | 459 +++++++++++++
 arch/arm/dts/socfpga_agilex5.dtsi             | 634 ++++++++++++++++++
 .../arm/dts/socfpga_agilex5_socdk-u-boot.dtsi | 131 ++++
 arch/arm/dts/socfpga_agilex5_socdk.dts        | 165 +++++
 arch/arm/dts/socfpga_soc64_fit-u-boot.dtsi    |  38 +-
 arch/arm/dts/socfpga_soc64_u-boot.dtsi        | 120 ++++
 arch/arm/dts/socfpga_stratix10.dtsi           |   0
 .../dts/socfpga_stratix10_socdk-u-boot.dtsi   |   0
 arch/arm/dts/socfpga_stratix10_socdk.dts      |   0
 10 files changed, 1534 insertions(+), 14 deletions(-)  create mode 100644
arch/arm/dts/socfpga_agilex5-u-boot.dtsi
 create mode 100644 arch/arm/dts/socfpga_agilex5.dtsi  create mode 100644
arch/arm/dts/socfpga_agilex5_socdk-u-boot.dtsi
 create mode 100644 arch/arm/dts/socfpga_agilex5_socdk.dts
 create mode 100644 arch/arm/dts/socfpga_soc64_u-boot.dtsi
 mode change 100755 => 100644 arch/arm/dts/socfpga_stratix10.dtsi
 mode change 100755 => 100644 arch/arm/dts/socfpga_stratix10_socdk-u-
boot.dtsi
 mode change 100755 => 100644 arch/arm/dts/socfpga_stratix10_socdk.dts
arch/arm/dts/Makefile index renamed from arch/arm/dts/Makefile +0 -0

480269fa60..2e4bc556e1 100644

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

thunderx-88xx.dtb

dtb-$(CONFIG_ARCH_SOCFPGA) += \

arch/arm/dts/Makefile +1 -0
 	socfpga_agilex_socdk.dtb			\
+	socfpga_agilex5_socdk.dtb			\
 	socfpga_arria5_secu1.dtb			\
 	socfpga_arria5_socdk.dtb			\
 	socfpga_arria10_chameleonv3_270_2.dtb		\
arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +33 -0
new file mode 100644
index 0000000000..6a1299901a
@@ -0,0 +1,459 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * U-Boot additions
+ *
+ * Copyright (C) 2019-2022 Intel Corporation <www.intel.com>  */
+
+#include "socfpga_soc64_u-boot.dtsi"
+#include "socfpga_soc64_fit-u-boot.dtsi"
+
+/{
+	memory {
+		#address-cells = <2>;
+		#size-cells = <2>;
+		bootph-all;
+	};
+
+	soc {
+		bootph-all;
+
+		socfpga_secreg: socfpga-secreg {
+			compatible = "intel,socfpga-secreg";
+			#address-cells = <1>;
+			#size-cells = <1>;
+			bootph-all;
+
+			/* DSU */
+			i_ccu_caiu0@1c000000 {
+				reg = <0x1c000000 0x00001000>;
+				intel,offset-settings =
+					/* CAIUAMIGR */
+					<0x000003c0 0x00000003 0x0000001f>,
+					/* CAIUMIFSR */
+					<0x000003c4 0x00000000

0x07070777>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +47 -0
+					/* DII1_MPFEREGS */
+					<0x00000414 0x00018000 0xffffffff>,
+					<0x00000418 0x00000000 0x000000ff>,
+					<0x00000410 0xc0e00200 0xc1f03e1f>,
+					/* DII2_GICREGS */
+					<0x00000424 0x0001d000 0xffffffff>,
+					<0x00000428 0x00000000 0x000000ff>,
+					<0x00000420 0xc0800400 0xc1f03e1f>,
+					/* NCAIU0_LWSOC2FPGA */
+					<0x00000444 0x00020000 0xffffffff>,
+					<0x00000448 0x00000000 0x000000ff>,
+					<0x00000440 0xc1100006 0xc1f03e1f>,
+					/* NCAIU0_SOC2FPGA_1G */
+					<0x00000454 0x00040000 0xffffffff>,
+					<0x00000458 0x00000000 0x000000ff>,
+					<0x00000450 0xc1200006 0xc1f03e1f>,
+					/* DMI_SDRAM_2G */
+					<0x00000464 0x00080000 0xffffffff>,
+					<0x00000468 0x00000000 0x000000ff>,
+					<0x00000460 0x81300006 0xc1f03e1f>,
+					/* NCAIU0_SOC2FPGA_16G */
+					<0x00000474 0x00400000 0xffffffff>,
+					<0x00000478 0x00000000 0x000000ff>,
+					<0x00000470 0xc1600006 0xc1f03e1f>,
+					/* DMI_SDRAM_30G */
+					<0x00000484 0x00800000 0xffffffff>,
+					<0x00000488 0x00000000 0x000000ff>,
+					<0x00000480 0x81700006 0xc1f03e1f>,
+					/* NCAIU0_SOC2FPGA_256G */
+					<0x00000494 0x04000000 0xffffffff>,
+					<0x00000498 0x00000000 0x000000ff>,
+					<0x00000490 0xc1a00006 0xc1f03e1f>,
+					/* DMI_SDRAM_480G */
+					<0x000004a4 0x08000000 0xffffffff>,
+					<0x000004a8 0x00000000 0x000000ff>,
+					<0x000004a0 0x81b00006 0xc1f03e1f>;
+				bootph-all;
+			};
+
+			/* FPGA2SOC */
+			i_ccu_ncaiu0@1c001000 {
+				reg = <0x1c001000 0x00001000>;
+				intel,offset-settings =
+					/* NCAIU0AMIGR */
+					<0x000003c0 0x00000003 0x0000001f>,
+					/* NCAIU0MIFSR */
+					<0x000003c4 0x00000000

0x07070777>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +47 -0
+					/* PSS */
+					<0x00000404 0x00010000 0xffffffff>,
+					<0x00000408 0x00000000 0x000000ff>,
+					<0x00000400 0xC0F00000 0xc1f03e1f>,
+					/* DII1_MPFEREGS */
+					<0x00000414 0x00018000 0xffffffff>,
+					<0x00000418 0x00000000 0x000000ff>,
+					<0x00000410 0xc0e00200 0xc1f03e1f>,
+					/* NCAIU0_LWSOC2FPGA */
+					<0x00000444 0x00020000 0xffffffff>,
+					<0x00000448 0x00000000 0x000000ff>,
+					<0x00000440 0xc1100006 0xc1f03e1f>,
+					/* NCAIU0_SOC2FPGA_1G */
+					<0x00000454 0x00040000 0xffffffff>,
+					<0x00000458 0x00000000 0x000000ff>,
+					<0x00000450 0xc1200006 0xc1f03e1f>,
+					/* DMI_SDRAM_2G */
+					<0x00000464 0x00080000 0xffffffff>,
+					<0x00000468 0x00000000 0x000000ff>,
+					<0x00000460 0x81300006 0xc1f03e1f>,
+					/* NCAIU0_SOC2FPGA_16G */
+					<0x00000474 0x00400000 0xffffffff>,
+					<0x00000478 0x00000000 0x000000ff>,
+					<0x00000470 0xc1600006 0xc1f03e1f>,
+					/* DMI_SDRAM_30G */
+					<0x00000484 0x00800000 0xffffffff>,
+					<0x00000488 0x00000000 0x000000ff>,
+					<0x00000480 0x81700006 0xc1f03e1f>,
+					/* NCAIU0_SOC2FPGA_256G */
+					<0x00000494 0x04000000 0xffffffff>,
+					<0x00000498 0x00000000 0x000000ff>,
+					<0x00000490 0xc1a00006 0xc1f03e1f>,
+					/* DMI_SDRAM_480G */
+					<0x000004a4 0x08000000 0xffffffff>,
+					<0x000004a8 0x00000000 0x000000ff>,
+					<0x000004a0 0x81b00006 0xc1f03e1f>;
+				bootph-all;
+			};
+
+			/* GIC_M */
+			i_ccu_ncaiu1@1c002000 {
+				reg = <0x1c002000 0x00001000>;
+				intel,offset-settings =
+					/* NCAIU1AMIGR */
+					<0x000003c0 0x00000003 0x0000001f>,
+					/* NCAIU1MIFSR */
+					<0x000003c4 0x00000000

0x07070777>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +23 -0
+					/* DMI_SDRAM_2G */
+					<0x00000464 0x00080000 0xffffffff>,
+					<0x00000468 0x00000000 0x000000ff>,
+					<0x00000460 0x81300006 0xc1f03e1f>,
+					/* DMI_SDRAM_30G */
+					<0x00000484 0x00800000 0xffffffff>,
+					<0x00000488 0x00000000 0x000000ff>,
+					<0x00000480 0x81700006 0xc1f03e1f>,
+					/* DMI_SDRAM_480G */
+					<0x000004a4 0x08000000 0xffffffff>,
+					<0x000004a8 0x00000000 0x000000ff>,
+					<0x000004a0 0x81b00006 0xc1f03e1f>;
+				bootph-all;
+			};
+
+			/* PSS NOC */
+			i_ccu_ncaiu3@1c004000 {
+				reg = <0x1c004000 0x00001000>;
+				intel,offset-settings =
+					/* NCAIU3AMIGR */
+					<0x000003c0 0x00000003 0x0000001f>,
+					/* NCAIU3MIFSR */
+					<0x000003c4 0x00000000

0x07070777>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +27 -0
+					/* DII1_MPFEREGS */
+					<0x00000414 0x00018000 0xffffffff>,
+					<0x00000418 0x00000000 0x000000ff>,
+					<0x00000410 0xc0e00200 0xc1f03e1f>,
+					/* DMI_SDRAM_2G */
+					<0x00000464 0x00080000 0xffffffff>,
+					<0x00000468 0x00000000 0x000000ff>,
+					<0x00000460 0x81300006 0xc1f03e1f>,
+					/* DMI_SDRAM_30G */
+					<0x00000484 0x00800000 0xffffffff>,
+					<0x00000488 0x00000000 0x000000ff>,
+					<0x00000480 0x81700006 0xc1f03e1f>,
+					/* DMI_SDRAM_480G */
+					<0x000004a4 0x08000000 0xffffffff>,
+					<0x000004a8 0x00000000 0x000000ff>,
+					<0x000004a0 0x81b00006 0xc1f03e1f>;
+				bootph-all;
+			};
+
+			/* DCE0 */
+			i_ccu_dce0@1c005000 {
+				reg = <0x1c005000 0x00001000>;
+				intel,offset-settings =
+					/* DCEUAMIGR0 */
+					<0x000003c0 0x00000003 0x0000001f>,
+					/* DCEUMIFSR0 */
+					<0x000003c4 0x00000000

0x07070777>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +23 -0
+					/* DMI_SDRAM_2G */
+					<0x00000464 0x00080000 0xffffffff>,
+					<0x00000468 0x00000000 0x000000ff>,
+					<0x00000460 0x81300006 0xc1f03e1f>,
+					/* DMI_SDRAM_30G */
+					<0x00000484 0x00800000 0xffffffff>,
+					<0x00000488 0x00000000 0x000000ff>,
+					<0x00000480 0x81700006 0xc1f03e1f>,
+					/* DMI_SDRAM_480G */
+					<0x000004a4 0x08000000 0xffffffff>,
+					<0x000004a8 0x00000000 0x000000ff>,
+					<0x000004a0 0x81b00006 0xc1f03e1f>;
+				bootph-all;
+			};
+
+			/* DCE1 */
+			i_ccu_dce1@1c006000 {
+				reg = <0x1c006000 0x00001000>;
+				intel,offset-settings =
+					/* DCEUAMIGR1 */
+					<0x000003c0 0x00000003 0x0000001f>,
+					/* DCEUMIFSR1 */
+					<0x000003c4 0x00000000

0x07070777>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +21 -0
+					/* DMI_SDRAM_2G */
+					<0x00000464 0x00080000 0xffffffff>,
+					<0x00000468 0x00000000 0x000000ff>,
+					<0x00000460 0x81300006 0xc1f03e1f>,
+					/* DMI_SDRAM_30G */
+					<0x00000484 0x00800000 0xffffffff>,
+					<0x00000488 0x00000000 0x000000ff>,
+					<0x00000480 0x81700006 0xc1f03e1f>,
+					/* DMI_SDRAM_480G */
+					<0x000004a4 0x08000000 0xffffffff>,
+					<0x000004a8 0x00000000 0x000000ff>,
+					<0x000004a0 0x81b00006 0xc1f03e1f>;
+				bootph-all;
+			};
+
+			/* DMI0 */
+			i_ccu_dmi0@1c007000 {
+				reg = <0x1c007000 0x00001000>;
+				intel,offset-settings =
+					/* DMIUSMCTCR */
+					<0x00000300 0x00000003

0x00000003>;

arch/arm/dts/socfpga_agilex5-u-boot.dtsi

Quoted 2 lines
arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+				bootph-all;
+			};

Please exclude above secreg changes for now because this driver is not in mainline yet. You can submit another patch for these changes once the driver is accepted into mainline.

Quoted 1,566 lines
arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +7 -0
+
+			/* DMI1 */
+			i_ccu_dmi0@1c008000 {
+				reg = <0x1c008000 0x00001000>;
+				intel,offset-settings =
+					/* DMIUSMCTCR */
+					<0x00000300 0x00000003

0x00000003>;

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +9 -0
+				bootph-all;
+			};
+
+			/* L4 peripherals firewall */
+			noc_fw_l4_per@10d21000 {
+				reg = <0x10d21000 0x0000008c>;
+				intel,offset-settings =
+					/* NAND */
+					<0x00000000 0x01010001

0x01010001>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* USB0 */
+					<0x0000000c 0x01010001

0x01010001>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* USB1 */
+					<0x00000010 0x01010001

0x01010001>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* SPI_MAIN0 */
+					<0x0000001c 0x01010301

0x01010301>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* SPI_MAIN1 */
+					<0x00000020 0x01010301

0x01010301>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* SPI_SECONDARY0 */
+					<0x00000024 0x01010301

0x01010301>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* SPI_SECONDARY1 */
+					<0x00000028 0x01010301

0x01010301>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* EMAC0 */
+					<0x0000002c 0x01010001

0x01010001>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* EMAC1 */
+					<0x00000030 0x01010001

0x01010001>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* EMAC2 */
+					<0x00000034 0x01010001

0x01010001>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* SDMMC */
+					<0x00000040 0x01010001

0x01010001>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* GPIO0 */
+					<0x00000044 0x01010301

0x01010301>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* GPIO1 */
+					<0x00000048 0x01010301

0x01010301>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* I2C0 */
+					<0x00000050 0x01010301

0x01010301>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* I2C1 */
+					<0x00000054 0x01010301

0x01010301>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* I2C2 */
+					<0x00000058 0x01010301

0x01010301>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* I2C3 */
+					<0x0000005c 0x01010301

0x01010301>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* I2C4 */
+					<0x00000060 0x01010301

0x01010301>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* SP_TIMER0 */
+					<0x00000064 0x01010301

0x01010301>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* SP_TIMER1 */
+					<0x00000068 0x01010301

0x01010301>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* UART0 */
+					<0x0000006c 0x01010301

0x01010301>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* UART1 */
+					<0x00000070 0x01010301

0x01010301>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* I3C0 */
+					<0x00000074 0x01010301

0x01010301>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* I3C1 */
+					<0x00000078 0x01010301

0x01010301>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* DMA0 */
+					<0x0000007c 0x01010001

0x01010001>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* DMA1 */
+					<0x00000080 0x01010001

0x01010001>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* COMBO_PHY */
+					<0x00000084 0x01010001

0x01010001>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* NAND_SDMA */
+					<0x00000088 0x01010301

0x01010301>;

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +9 -0
+				bootph-all;
+			};
+
+			/* L4 system firewall */
+			noc_fw_l4_sys@10d21100 {
+				reg = <0x10d21100 0x00000098>;
+				intel,offset-settings =
+					/* DMA_ECC */
+					<0x00000008 0x01010001

0x01010001>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* EMAC0RX_ECC */
+					<0x0000000c 0x01010001

0x01010001>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* EMAC0TX_ECC */
+					<0x00000010 0x01010001

0x01010001>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* EMAC1RX_ECC */
+					<0x00000014 0x01010001

0x01010001>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* EMAC1TX_ECC */
+					<0x00000018 0x01010001

0x01010001>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* EMAC2RX_ECC */
+					<0x0000001c 0x01010001

0x01010001>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* EMAC2TX_ECC */
+					<0x00000020 0x01010001

0x01010001>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* NAND_ECC */
+					<0x0000002c 0x01010001

0x01010001>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* NAND_READ_ECC */
+					<0x00000030 0x01010001

0x01010001>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* NAND_WRITE_ECC */
+					<0x00000034 0x01010001

0x01010001>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* OCRAM_ECC */
+					<0x00000038 0x01010001

0x01010001>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* SDMMC_ECC */
+					<0x00000040 0x01010001

0x01010001>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* USB0_ECC */
+					<0x00000044 0x01010001

0x01010001>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* USB1_CACHEECC */
+					<0x00000048 0x01010001

0x01010001>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* CLOCK_MANAGER */
+					<0x0000004c 0x01010001

0x01010001>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* IO_MANAGER */
+					<0x00000054 0x01010001

0x01010001>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* RESET_MANAGER */
+					<0x00000058 0x01010001

0x01010001>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* SYSTEM_MANAGER */
+					<0x0000005c 0x01010001

0x01010001>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* OSC0_TIMER */
+					<0x00000060 0x01010301

0x01010301>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* OSC1_TIMER0*/
+					<0x00000064 0x01010301

0x01010301>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* WATCHDOG0 */
+					<0x00000068 0x01010301

0x01010301>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* WATCHDOG1 */
+					<0x0000006c 0x01010301

0x01010301>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* WATCHDOG2 */
+					<0x00000070 0x01010301

0x01010301>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* WATCHDOG3 */
+					<0x00000074 0x01010301

0x01010301>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* DAP */
+					<0x00000078 0x03010001

0x03010001>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* WATCHDOG4 */
+					<0x0000007c 0x01010301

0x01010301>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* POWER_MANAGER */
+					<0x00000080 0x01010001

0x01010001>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* USB1_RXECC */
+					<0x00000084 0x01010001

0x01010001>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* USB1_TXECC */
+					<0x00000088 0x01010001

0x01010001>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* L4_NOC_PROBES */
+					<0x00000090 0x01010001

0x01010001>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* L4_NOC_QOS */
+					<0x00000094 0x01010001

0x01010001>;

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +27 -0
+				bootph-all;
+			};
+
+			/* Light weight SoC2FPGA */
+			noc_fw_lwsoc2fpga@10d21300 {
+				reg = <0x10d21300 0x0000004>;
+				intel,offset-settings =
+					/* LWSOC2FPGA_CSR */
+					<0x00000000 0x0ffe0301>;
+				bootph-all;
+			};
+
+			/* SoC2FPGA */
+			noc_fw_soc2fpga@10d21200 {
+				reg = <0x10d21200 0x0000004>;
+				intel,offset-settings =
+					/* SOC2FPGA_CSR */
+					<0x00000000 0x0ffe0301 0x0ffe0301>;
+				bootph-all;
+			};
+
+			/* TCU */
+			noc_fw_tcu@10d21400 {
+				reg = <0x10d21400 0x0000004>;
+				intel,offset-settings =
+					/* TCU_CSR */
+					<0x00000000 0x01010001

0x01010001>;

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +68 -0
+				bootph-all;
+			};
+		};
+	};
+};
+
+&clkmgr {
+	bootph-all;
+};
+
+&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 {
+	bootph-all;
+};
+
+&rst {
+	compatible = "altr,rst-mgr";
+	altr,modrst-offset = <0x24>;
+	bootph-all;
+};
+
+&sdr {
+	compatible = "intel,sdr-ctl-agilex5";
+	reg = <0x18000000 0x400000>,
+	      <0x18400000 0x400000>,
+	      <0x18800000 0x400000>;
+	resets = <&rst DDRSCH_RESET>;
+	bootph-all;
+};
+
+&sysmgr {
+	compatible = "altr,sys-mgr", "syscon";
+	bootph-all;
+};
+
+&uart0 {
+	bootph-all;
+};
+
+&watchdog0 {
+	bootph-all;
+};
arch/arm/dts/socfpga_agilex5.dtsi new file +135 -0
new file mode 100644
index 0000000000..f445bc04ad
@@ -0,0 +1,634 @@
+// SPDX-License-Identifier:     GPL-2.0
+/*
+ * Copyright (C) 2022, Intel Corporation  */
+
+/dts-v1/;
+#include <dt-bindings/reset/altr,rst-mgr-agx5.h>
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/clock/agilex5-clock.h>
+
+/ {
+	compatible = "intel,socfpga-agilex";
+	#address-cells = <2>;
+	#size-cells = <2>;
+
+	reserved-memory {
+		#address-cells = <2>;
+		#size-cells = <2>;
+		ranges;
+
+		service_reserved: svcbuffer@0 {
+			compatible = "shared-dma-pool";
+			reg = <0x0 0x0 0x0 0x1000000>;
+			alignment = <0x1000>;
+			no-map;
+		};
+	};
+
+	cpus {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		cpu0: cpu@0 {
+			compatible = "arm,cortex-a55";
+			device_type = "cpu";
+			enable-method = "psci";
+			reg = <0x0>;
+		};
+
+		cpu1: cpu@1 {
+			compatible = "arm,cortex-a55";
+			device_type = "cpu";
+			enable-method = "psci";
+			reg = <0x1>;
+		};
+
+		cpu2: cpu@2 {
+			compatible = "arm,cortex-a76";
+			device_type = "cpu";
+			enable-method = "psci";
+			reg = <0x2>;
+		};
+
+		cpu3: cpu@3 {
+			compatible = "arm,cortex-a76";
+			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@fffc1000 {
+		compatible = "arm,gic-400", "arm,cortex-a15-gic";
+		#interrupt-cells = <3>;
+		interrupt-controller;
+		reg = <0x0 0x1d000000 0x0 0x10000>;
+	};
+
+	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@10d10000 {
+			compatible = "intel,agilex5-clkmgr";
+			reg = <0x10d10000 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@10810000 {
+			compatible = "altr,socfpga-stmmac", "snps,dwmac-

3.74a", "snps,dwmac";

arch/arm/dts/socfpga_agilex5.dtsi new file +5 -0
+			reg = <0x10810000 0x3500>;
+			interrupts = <0 90 4>;
+			interrupt-names = "macirq";
+			mac-address = [00 00 00 00 00 00];
+			resets = <&rst EMAC0_RESET>, <&rst

EMAC0_OCP_RESET>;

arch/arm/dts/socfpga_agilex5.dtsi new file +13 -0
+			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 AGILEX5_EMAC0_CLK>;
+			clock-names = "stmmaceth";
+			status = "disabled";
+		};
+
+		gmac1: ethernet@10820000 {
+			compatible = "altr,socfpga-stmmac", "snps,dwmac-

3.74a", "snps,dwmac";

arch/arm/dts/socfpga_agilex5.dtsi new file +5 -0
+			reg = <0x10820000 0x3500>;
+			interrupts = <0 91 4>;
+			interrupt-names = "macirq";
+			mac-address = [00 00 00 00 00 00];
+			resets = <&rst EMAC1_RESET>, <&rst

EMAC1_OCP_RESET>;

arch/arm/dts/socfpga_agilex5.dtsi new file +13 -0
+			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 AGILEX5_EMAC1_CLK>;
+			clock-names = "stmmaceth";
+			status = "disabled";
+		};
+
+		gmac2: ethernet@10830000 {
+			compatible = "altr,socfpga-stmmac", "snps,dwmac-

3.74a", "snps,dwmac";

arch/arm/dts/socfpga_agilex5.dtsi new file +5 -0
+			reg = <0x10830000 0x3500>;
+			interrupts = <0 92 4>;
+			interrupt-names = "macirq";
+			mac-address = [00 00 00 00 00 00];
+			resets = <&rst EMAC2_RESET>, <&rst

EMAC2_OCP_RESET>;

arch/arm/dts/socfpga_agilex5.dtsi new file +146 -0
+			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 AGILEX5_EMAC2_CLK>;
+			clock-names = "stmmaceth";
+			status = "disabled";
+		};
+
+		gpio0: gpio@10c03200 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "snps,dw-apb-gpio";
+			reg = <0x10c03200 0x80>;
+			resets = <&rst GPIO0_RESET>;
+			status = "disabled";
+
+			porta: gpio-controller@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@10c03300 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "snps,dw-apb-gpio";
+			reg = <0x10c03300 0x80>;
+			resets = <&rst GPIO1_RESET>;
+			status = "disabled";
+
+			portb: gpio-controller@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@10c02800 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "snps,designware-i2c";
+			reg = <0x10c02800 0x100>;
+			interrupts = <0 103 4>;
+			resets = <&rst I2C0_RESET>;
+			clocks = <&clkmgr AGILEX5_L4_SP_CLK>;
+			status = "disabled";
+		};
+
+		i2c1: i2c@10c02900 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "snps,designware-i2c";
+			reg = <0x10c02900 0x100>;
+			interrupts = <0 104 4>;
+			resets = <&rst I2C1_RESET>;
+			clocks = <&clkmgr AGILEX5_L4_SP_CLK>;
+			status = "disabled";
+		};
+
+		i2c2: i2c@10c02a00 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "snps,designware-i2c";
+			reg = <0x10c02a00 0x100>;
+			interrupts = <0 105 4>;
+			resets = <&rst I2C2_RESET>;
+			clocks = <&clkmgr AGILEX5_L4_SP_CLK>;
+			status = "disabled";
+		};
+
+		i2c3: i2c@10c02b00 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "snps,designware-i2c";
+			reg = <0x10c02b00 0x100>;
+			interrupts = <0 106 4>;
+			resets = <&rst I2C3_RESET>;
+			clocks = <&clkmgr AGILEX5_L4_SP_CLK>;
+			status = "disabled";
+		};
+
+		i2c4: i2c@10c02c00 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "snps,designware-i2c";
+			reg = <0x10c02c00 0x100>;
+			interrupts = <0 107 4>;
+			resets = <&rst I2C4_RESET>;
+			clocks = <&clkmgr AGILEX5_L4_SP_CLK>;
+			status = "disabled";
+		};
+
+		combophy0: combophy@0 {
+			#phy-cells = <0>;
+			phy-type = <1>;
+			compatible = "cdns,combophy";
+			reg = <0x10808000 0x1000>;
+			resets = <&rst COMBOPHY_RESET>;
+			reset-names = "reset";
+			status = "disabled";
+		};
+
+		mmc: mmc0@10808000 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "cdns,sd4hc";
+			reg = <0x10808000 0x1000>;
+			interrupts = <0 96 4>;
+			phys = <&combophy0>;
+			phy-names = "combo-phy";
+			clocks = <&clkmgr AGILEX5_L4_MP_CLK>,
+				 <&clkmgr AGILEX5_SDMMC_CLK>;
+			clock-names = "biu", "ciu";
+			fifo-depth = <0x800>;
+			resets = <&rst SDMMC_RESET>;
+			reset-names = "reset";
+			iommus = <&smmu 5>;
+			status = "disabled";
+		};
+
+		nand: nand@10b80000 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "altr,socfpga-denali-nand";
+			reg = <0x10b80000 0x1038>,
+			      <0xffb80000 0x1000>;
+			reg-names = "nand_data", "denali_reg";
+			interrupts = <0 97 4>;
+			clocks = <&clkmgr AGILEX5_NAND_CLK>,
+				 <&clkmgr AGILEX5_NAND_X_CLK>;
+			clock-names = "nand", "nand_x";
+			resets = <&rst NAND_RESET>, <&rst

NAND_OCP_RESET>;

arch/arm/dts/socfpga_agilex5.dtsi new file +38 -0
+			status = "disabled";
+		};
+
+		ocram: sram@00000000 {
+			compatible = "mmio-sram";
+			reg = <0x00000000 0x200000>;
+		};
+
+		rst: rstmgr@10d11000 {
+			#reset-cells = <1>;
+			compatible = "altr,stratix10-rst-mgr";
+			reg = <0x10d11000 0x1000>;
+		};
+
+		smmu: iommu@16000000 {
+			compatible = "arm,mmu-500", "arm,smmu-v2";
+			reg = <0x16000000 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@10da4000 {
+			compatible = "intel,agilex-spi",
+				     "snps,dw-apb-ssi-4.00a", "snps,dw-apb-

ssi";

arch/arm/dts/socfpga_agilex5.dtsi new file +14 -0
+			#address-cells = <1>;
+			#size-cells = <0>;
+			reg = <0x10da4000 0x1000>;
+			interrupts = <0 99 4>;
+			resets = <&rst SPIM0_RESET>;
+			reg-io-width = <4>;
+			num-cs = <4>;
+			clocks = <&clkmgr AGILEX5_L4_MAIN_CLK>;
+			status = "disabled";
+		};
+
+		spi1: spi@10da5000 {
+			compatible = "intel,agilex-spi",
+				     "snps,dw-apb-ssi-4.00a", "snps,dw-apb-

ssi";

arch/arm/dts/socfpga_agilex5.dtsi new file +102 -0
+			#address-cells = <1>;
+			#size-cells = <0>;
+			reg = <0x10da5000 0x1000>;
+			interrupts = <0 100 4>;
+			resets = <&rst SPIM1_RESET>;
+			reg-io-width = <4>;
+			num-cs = <4>;
+			clocks = <&clkmgr AGILEX5_L4_MAIN_CLK>;
+			status = "disabled";
+		};
+
+		sysmgr: sysmgr@10d12000 {
+			compatible = "altr,sys-mgr-s10","altr,sys-mgr";
+			reg = <0x10d12000 0x500>;
+		};
+
+		/* Local timer */
+		timer {
+			compatible = "arm,armv8-timer";
+			interrupts = <1 13 0xf08>,
+				     <1 14 0xf08>,
+				     <1 11 0xf08>,
+				     <1 10 0xf08>;
+		};
+
+		timer0: timer0@10c03000 {
+			compatible = "snps,dw-apb-timer";
+			interrupts = <0 113 4>;
+			reg = <0x10c03000 0x100>;
+			resets = <&rst SPTIMER0_RESET>;
+			clocks = <&clkmgr AGILEX5_L4_SP_CLK>;
+			clock-names = "timer";
+			status = "disabled";
+		};
+
+		timer1: timer1@10c03100 {
+			compatible = "snps,dw-apb-timer";
+			interrupts = <0 114 4>;
+			reg = <0x10c03100 0x100>;
+			resets = <&rst SPTIMER1_RESET>;
+			clocks = <&clkmgr AGILEX5_L4_SP_CLK>;
+			clock-names = "timer";
+			status = "disabled";
+		};
+
+		timer2: timer2@10d00000 {
+			compatible = "snps,dw-apb-timer";
+			interrupts = <0 115 4>;
+			reg = <0x10d00000 0x100>;
+			resets = <&rst L4SYSTIMER0_RESET>;
+			clocks = <&clkmgr AGILEX5_L4_SYS_FREE_CLK>;
+			clock-names = "timer";
+			status = "disabled";
+		};
+
+		timer3: timer3@10d00100 {
+			compatible = "snps,dw-apb-timer";
+			interrupts = <0 116 4>;
+			reg = <0x10d00100 0x100>;
+			resets = <&rst L4SYSTIMER1_RESET>;
+			clocks = <&clkmgr AGILEX5_L4_SYS_FREE_CLK>;
+			clock-names = "timer";
+			status = "disabled";
+		};
+
+		uart0: serial0@10c02000 {
+			compatible = "snps,dw-apb-uart";
+			reg = <0x10c02000 0x100>;
+			interrupts = <0 108 4>;
+			reg-shift = <2>;
+			reg-io-width = <4>;
+			resets = <&rst UART0_RESET>;
+			status = "disabled";
+			clocks = <&clkmgr AGILEX5_L4_SP_CLK>;
+			clock-frequency = <100000000>;
+		};
+
+		uart1: serial1@10c02100 {
+			compatible = "snps,dw-apb-uart";
+			reg = <0x10c02100 0x100>;
+			interrupts = <0 109 4>;
+			reg-shift = <2>;
+			reg-io-width = <4>;
+			resets = <&rst UART1_RESET>;
+			clocks = <&clkmgr AGILEX5_L4_SP_CLK>;
+			status = "disabled";
+		};
+
+		usbphy0: usbphy@0 {
+			#phy-cells = <0>;
+			compatible = "usb-nop-xceiv";
+			clocks = <&clkmgr AGILEX5_USB_CLK>;
+			status = "disabled";
+		};
+
+		usb0: usb@10b00000 {
+			compatible = "snps,dwc2";
+			reg = <0x10b00000 0x40000>;
+			interrupts = <0 93 4>;
+			phys = <&usbphy0>;
+			phy-names = "usb2-phy";
+			resets = <&rst USB0_RESET>, <&rst

USB0_OCP_RESET>;

arch/arm/dts/socfpga_agilex5.dtsi new file +152 -0
+			reset-names = "dwc2", "dwc2-ecc";
+			clocks = <&clkmgr AGILEX5_USB_CLK>;
+			iommus = <&smmu 6>;
+			status = "disabled";
+		};
+
+		usb31: usb31@11000000 {
+			compatible = "snps,dwc3";
+			reg = <0x11000000 0x100000>;
+			resets = <&rst USB1_RESET>;
+			phys = <&usbphy0>, <&usbphy0>;
+			phy-names = "usb2-phy", "usb3-phy";
+			dr_mode = "host";
+			maximum-speed = "super-speed";
+			snps,dis_u2_susphy_quirk;
+			status = "disabled";
+		};
+
+		watchdog0: watchdog@10d00200 {
+			compatible = "snps,dw-wdt";
+			reg = <0x10d00200 0x100>;
+			interrupts = <0 117 4>;
+			resets = <&rst WATCHDOG0_RESET>;
+			clocks = <&clkmgr AGILEX5_L4_SYS_FREE_CLK>;
+			status = "disabled";
+		};
+
+		watchdog1: watchdog@10d00300 {
+			compatible = "snps,dw-wdt";
+			reg = <0x10d00300 0x100>;
+			interrupts = <0 118 4>;
+			resets = <&rst WATCHDOG1_RESET>;
+			clocks = <&clkmgr AGILEX5_L4_SYS_FREE_CLK>;
+			status = "disabled";
+		};
+
+		watchdog2: watchdog@10d00400 {
+			compatible = "snps,dw-wdt";
+			reg = <0x10d00400 0x100>;
+			interrupts = <0 125 4>;
+			resets = <&rst WATCHDOG2_RESET>;
+			clocks = <&clkmgr AGILEX5_L4_SYS_FREE_CLK>;
+			status = "disabled";
+		};
+
+		watchdog3: watchdog@10d00500 {
+			compatible = "snps,dw-wdt";
+			reg = <0x10d00500 0x100>;
+			interrupts = <0 126 4>;
+			resets = <&rst WATCHDOG3_RESET>;
+			clocks = <&clkmgr AGILEX5_L4_SYS_FREE_CLK>;
+			status = "disabled";
+		};
+
+		watchdog4: watchdog@10d00600 {
+			compatible = "snps,dw-wdt";
+			reg = <0x10d00600 0x100>;
+			interrupts = <0 175 4>;
+			resets = <&rst WATCHDOG4_RESET>;
+			clocks = <&clkmgr AGILEX5_L4_SYS_FREE_CLK>;
+			status = "disabled";
+		};
+
+		sdr: sdr@10d21000 {
+			compatible = "altr,sdr-ctl", "syscon";
+			reg = <0x10d21000 0xc0>;
+		};
+
+		/* TODO: Update the ECC registers */
+		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@ff8cc000 {
+				compatible = "altr,socfpga-s10-ocram-ecc",
+					     "altr,socfpga-a10-ocram-ecc";
+				reg = <0xff8cc000 0x100>;
+				altr,ecc-parent = <&ocram>;
+				interrupts = <1 4>;
+			};
+
+			usb0-ecc@ff8c4000 {
+				compatible = "altr,socfpga-s10-usb-ecc",
+					     "altr,socfpga-usb-ecc";
+				reg = <0xff8c4000 0x100>;
+				altr,ecc-parent = <&usb0>;
+				interrupts = <2 4>;
+			};
+
+			emac0-rx-ecc@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@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@ff8c8c00 {
+				compatible = "altr,socfpga-s10-sdmmc-ecc",
+					     "altr,socfpga-sdmmc-ecc";
+				reg = <0xff8c8c00 0x100>;
+				altr,ecc-parent = <&mmc>;
+				interrupts = <14 4>,
+					     <15 4>;
+			};
+		};
+
+		/* QSPI address not available yet */
+		qspi: spi@108d2000 {
+			compatible = "cdns,qspi-nor";
+			#address-cells = <1>;
+			#size-cells = <0>;
+			reg = <0x108d2000 0x100>,
+			      <0x10900000 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_agilex5.dtsi new file +5 -0
+				};
+			};
+		};
+	};
+};
arch/arm/dts/socfpga_agilex5_socdk-u-boot.dtsi new file +130 -0
new file mode 100644
index 0000000000..ad170353f8
@@ -0,0 +1,131 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * U-Boot additions
+ *
+ * Copyright (C) 2022 Intel Corporation <www.intel.com>  */
+
+#include "socfpga_agilex5-u-boot.dtsi"
+
+/{
+	aliases {
+		spi0 = &qspi;
+		freeze_br0 = &freeze_controller;
+	};
+
+	soc {
+		freeze_controller: freeze_controller@f9000450 {
+			compatible = "altr,freeze-bridge-controller";
+			reg = <0xf9000450 0x00000010>;
+			status = "disabled";
+		};
+	};
+
+	memory {
+		/* 2GB on Simics*/
+		reg = <0 0x80000000 0 0x80000000>;
+	};
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+		u-boot,spl-boot-order = &mmc,&flash0,"/memory";
+	};
+};
+
+&flash0 {
+	compatible = "jedec,spi-nor";
+	spi-tx-bus-width = <4>;
+	spi-rx-bus-width = <4>;
+	bootph-all;
+};
+
+&nand {
+	status = "okay";
+	nand-bus-width = <16>;
+	bootph-all;
+};
+
+&mmc {
+	status = "okay";
+	bus-width = <4>;
+	sd-uhs-sdr50;
+	cap-mmc-highspeed;
+	bootph-all;
+};
+
+&combophy0 {
+	status = "okay";
+	bootph-all;
+	cdns,phy-use-ext-lpbk-dqs = <1>;
+	cdns,phy-use-lpbk-dqs = <1>;
+	cdns,phy-use-phony-dqs = <1>;
+	cdns,phy-use-phony-dqs-cmd = <1>;
+	cdns,phy-io-mask-always-on = <0>;
+	cdns,phy-io-mask-end = <5>;
+	cdns,phy-io-mask-start = <0>;
+	cdns,phy-data-select-oe-end = <1>;
+	cdns,phy-sync-method = <1>;
+	cdns,phy-sw-half-cycle-shift = <0>;
+	cdns,phy-rd-del-sel = <52>;
+	cdns,phy-underrun-suppress = <1>;
+	cdns,phy-gate-cfg-always-on = <1>;
+	cdns,phy-param-dll-bypass-mode = <1>;
+	cdns,phy-param-phase-detect-sel = <2>;
+	cdns,phy-param-dll-start-point = <254>;
+	cdns,phy-read-dqs-cmd-delay = <0>;
+	cdns,phy-clk-wrdqs-delay = <0>;
+	cdns,phy-clk-wr-delay = <0>;
+	cdns,phy-read-dqs-delay = <0>;
+	cdns,phy-phony-dqs-timing = <0>;
+	cdns,hrs09-rddata-en = <1>;
+	cdns,hrs09-rdcmd-en = <1>;
+	cdns,hrs09-extended-wr-mode = <1>;
+	cdns,hrs09-extended-rd-mode = <1>;
+	cdns,hrs10-hcsdclkadj = <3>;
+	cdns,hrs16-wrdata1-sdclk-dly = <0>;
+	cdns,hrs16-wrdata0-sdclk-dly = <0>;
+	cdns,hrs16-wrcmd1-sdclk-dly = <0>;
+	cdns,hrs16-wrcmd0-sdclk-dly = <0>;
+	cdns,hrs16-wrdata1-dly = <0>;
+	cdns,hrs16-wrdata0-dly = <0>;
+	cdns,hrs16-wrcmd1-dly = <0>;
+	cdns,hrs16-wrcmd0-dly = <0>;
+	cdns,hrs07-rw-compensate = <10>;
+	cdns,hrs07-idelay-val = <0>;
+};
+
+&qspi {
+	status = "okay";
+};
+
+&timer0 {
+	bootph-all;
+};
+
+&timer1 {
+	bootph-all;
+};
+
+&timer2 {
+	bootph-all;
+};
+
+&timer3 {
+	bootph-all;
+};
+
+&watchdog0 {
+	bootph-all;
+};
+
+#if !defined(CONFIG_SOCFPGA_SECURE_VAB_AUTH)
+&fdt_0_blob {
+	filename = "arch/arm/dts/socfpga_agilex5_socdk.dtb";
+};
+
+/* To add NAND dtb when ready in future */
+
+&binman {
+	/delete-node/ kernel;
+};
+#endif
arch/arm/dts/socfpga_agilex5_socdk.dts new file +164 -0
new file mode 100644
index 0000000000..1a39426561
@@ -0,0 +1,165 @@
+// SPDX-License-Identifier:     GPL-2.0
+/*
+ * Copyright (C) 2019-2022, Intel Corporation  */ #include
+"socfpga_agilex5.dtsi"
+
+/ {
+	model = "SoCFPGA Agilex5 SoCDK";
+
+	aliases {
+		serial0 = &uart0;
+	};
+
+	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>;
+			};
+		};
+	};
+};
+
+&gpio0 {
+	status = "okay";
+};
+
+&gpio1 {
+	status = "okay";
+};
+
+&i2c0 {
+	status = "okay";
+};
+
+&i2c1 {
+	status = "okay";
+};
+
+&mmc {
+	status = "okay";
+};
+
+&combophy0 {
+	status = "okay";
+};
+
+&uart0 {
+	status = "okay";
+};
+
+&usbphy0 {
+	status = "okay";
+};
+
+&usb0 {
+	status = "okay";
+	disable-over-current;
+};
+
+&usb31 {
+	status = "okay";
+};
+
+&watchdog0 {
+	status = "okay";
+};
+
+&watchdog1 {
+	status = "okay";
+};
+
+&watchdog2 {
+	status = "okay";
+};
+
+&watchdog3 {
+	status = "okay";
+};
+
+&watchdog4 {
+	status = "okay";
+};
+
+&timer0 {
+	status = "okay";
+};
+
+&timer1 {
+	status = "okay";
+};
+
+&timer2 {
+	status = "okay";
+};
+
+&timer3 {
+	status = "okay";
+};
+
+&spi0 {
+	status = "okay";
+};
+
+&spi1 {
+	status = "okay";
+};
+
+&qspi {
+	flash0: flash@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@0 {
+				label = "Boot and fpga data";
+				reg = <0x0 0x034B0000>;
+			};
+
+			qspi_rootfs: partition@34B0000 {
+				label = "Root Filesystem - JFFS2";
+				reg = <0x034B0000 0x0EB50000>;
+			};
+		};
+	};
+};
arch/arm/dts/socfpga_soc64_fit-u-boot.dtsi +6 -2
index 84b91e8df0..1ca721f070 100644
@@ -2,7 +2,7 @@
 /*
  * U-Boot additions
  *
- * Copyright (C) 2020 Intel Corporation <www.intel.com>
+ * Copyright (C) 2020-2022 Intel Corporation <www.intel.com>
  */
 
 #if defined(CONFIG_FIT)
@@ -21,14 +21,18 @@
 			description = "FIT with firmware and bootloader";
 			#address-cells = <1>;
 
-			images {
+			images: images {
 				uboot {
 					description = "U-Boot SoC64";
 					type = "standalone";
 					os = "U-Boot";
 					arch = "arm64";
 					compression = "none";
+				#if
 IS_ENABLED(CONFIG_TARGET_SOCFPGA_AGILEX5)
+					load = <0x80200000>;
+				#else
 					load = <0x00200000>;
+				#endif
 					uboot_blob: blob-ext {
 						filename = "u-boot-

nodtb.bin";

arch/arm/dts/socfpga_soc64_fit-u-boot.dtsi +5 -0
 					};
@@ -43,8 +47,13 @@
 					os = "arm-trusted-firmware";
 					arch = "arm64";
 					compression = "none";
+				#if
 IS_ENABLED(CONFIG_TARGET_SOCFPGA_AGILEX5)
+					load = <0x80000000>;
+					entry = <0x80000000>;
+				#else
 					load = <0x00001000>;
 					entry = <0x00001000>;
+				#endif
 					atf_blob: blob-ext {
 						filename = "bl31.bin";
arch/arm/dts/socfpga_soc64_fit-u-boot.dtsi +3 -3
 					};
@@ -53,11 +62,11 @@
 					};
 				};
 
-				fdt {
-					description = "U-Boot SoC64 flat
 device-tree";
+				fdt-0 {
+					description = "socfpga_socdk";
 					type = "flat_dt";
 					compression = "none";
-					uboot_fdt_blob: blob-ext {
+					fdt_0_blob: blob-ext {
 						filename = "u-boot.dtb";
 					};
arch/arm/dts/socfpga_soc64_fit-u-boot.dtsi +7 -6
 					hash {
@@ -66,17 +75,18 @@
 				};
 			};
 
-			configurations {
-				default = "conf";
-				conf {
-					description = "Intel SoC64 FPGA";
+			board_config: configurations {
+				default = "board-0";
+
+				board-0 {
+					description = "board_0";
 					firmware = "atf";
 					loadables = "uboot";
-					fdt = "fdt";
+					fdt = "fdt-0";
 					signature {
 						algo = "crc32";
 						key-name-hint = "dev";
-						sign-images = "atf", "fdt",
 "uboot";
+						sign-images = "atf", "uboot",
 "fdt-0";
 					};
arch/arm/dts/socfpga_soc64_fit-u-boot.dtsi +3 -3
 				};
 			};
@@ -96,8 +106,8 @@
 					arch = "arm64";
 					os = "linux";
 					compression = "none";
-					load = <0x4080000>;
-					entry = <0x4080000>;
+					load = <0x6000000>;
+					entry = <0x6000000>;
 					kernel_blob: blob-ext {
 						filename = "Image";
 					};
@@ -146,7 +156,7 @@
 	filename = "signed-bl31.bin";
 };
 
-&uboot_fdt_blob {
+&fdt_0_blob {
 	filename = "signed-u-boot.dtb";
 };
 
arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +18 -0
new file mode 100644
index 0000000000..add9890de3
@@ -0,0 +1,120 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * U-Boot additions
+ *
+ * Copyright (C) 2021-2022 Intel Corporation <www.intel.com>  */
+
+/ {
+	soc {
+			socfpga_secreg: socfpga-secreg {
+			compatible = "intel,socfpga-secreg";
+			#address-cells = <1>;
+			#size-cells = <1>;
+			bootph-all;
+
+			i_sys_mgr_core@ffd12000 {
+				reg = <0xffd12000 0x00000230>;
+				intel,offset-settings =
+					/* Enable non-secure interface to

DMA */

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +2 -0
+					<0x00000020 0xff010000 0xff010011>,
+					/* Enable non-secure interface to

DMA periph */

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +9 -0
+					<0x00000024 0xffffffff 0xffffffff>;
+				bootph-all;
+			};
+
+			noc_fw_l4_per_l4_per_scr@ffd21000 {
+				reg = <0xffd21000 0x00000074>;
+				intel,offset-settings =
+					/* Disable L4 periphs firewall */
+					<0x00000000 0x01010001

0x01010001>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x00000004 0x01010001

0x01010001>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x0000000c 0x01010001

0x01010001>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x00000010 0x01010001

0x01010001>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x0000001c 0x01010001

0x01010101>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x00000020 0x01010001

0x01010101>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x00000024 0x01010001

0x01010101>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x00000028 0x01010001

0x01010101>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x0000002c 0x01010001

0x01010001>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x00000030 0x01010001

0x01010001>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x00000034 0x01010001

0x01010001>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x00000040 0x01010001

0x01010001>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x00000044 0x01010001

0x01010101>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x00000048 0x01010001

0x01010101>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x00000050 0x01010001

0x01010101>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x00000054 0x01010001

0x01010101>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x00000058 0x01010001

0x01010101>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x0000005c 0x01010001

0x01010101>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x00000060 0x01010001

0x01010101>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x00000064 0x01010001

0x01010101>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x00000068 0x01010001

0x01010101>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x0000006c 0x01010001

0x01010101>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x00000070 0x01010001

0x01010101>;

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +8 -0
+				bootph-all;
+			};
+
+			noc_fw_l4_sys_l4_sys_scr@ffd21100 {
+				reg = <0xffd21100 0x00000098>;
+				intel,offset-settings =
+					/* Disable L4 system firewall */
+					<0x00000008 0x01010001

0x01010001>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x0000000c 0x01010001

0x01010001>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x00000010 0x01010001

0x01010001>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x00000014 0x01010001

0x01010001>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x00000018 0x01010001

0x01010001>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x0000001c 0x01010001

0x01010001>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x00000020 0x01010001

0x01010001>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x0000002c 0x01010001

0x01010001>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x00000030 0x01010001

0x01010001>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x00000034 0x01010001

0x01010001>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x00000038 0x01010001

0x01010001>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x00000040 0x01010001

0x01010001>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x00000044 0x01010001

0x01010001>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x00000048 0x01010001

0x01010001>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x0000004c 0x01010001

0x01010001>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x00000054 0x01010001

0x01010001>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x00000058 0x01010001

0x01010001>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x0000005c 0x01010001

0x01010001>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x00000060 0x01010001

0x01010101>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x00000064 0x01010001

0x01010101>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x00000068 0x01010001

0x01010101>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x0000006c 0x01010001

0x01010101>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x00000070 0x01010001

0x01010101>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x00000074 0x01010001

0x01010101>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x00000078 0x01010001

0x03010001>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x00000090 0x01010001

0x01010001>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x00000094 0x01010001

0x01010001>;

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +7 -0
+				bootph-all;
+			};
+
+			noc_fw_soc2fpga_soc2fpga_scr@ffd21200 {
+				reg = <0xffd21200 0x00000004>;
+				/* Disable soc2fpga security access */
+				intel,offset-settings = <0x00000000

0x0ffe0101 0x0ffe0101>;

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +6 -0
+				bootph-all;
+			};
+
+			noc_fw_lwsoc2fpga_lwsoc2fpga_scr@ffd21300 {
+				reg = <0xffd21300 0x00000004>;
+				/* Disable lightweight soc2fpga security

access */

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+				intel,offset-settings = <0x00000000

0x0ffe0101 0x0ffe0101>;

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +6 -0
+				bootph-all;
+			};
+
+			noc_fw_tcu_tcu_scr@ffd21400 {
+				reg = <0xffd21400 0x00000004>;
+				/* Disable DMA ECC security access, for

SMMU use */

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+				intel,offset-settings = <0x00000000

0x01010001 0x01010001>;

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +7 -0
+				bootph-all;
+			};
+
+			noc_fw_priv_MemoryMap_priv@ffd24800 {
+				reg = <0xffd24800 0x0000000c>;
+				intel,offset-settings =
+					/* Enable non-prviledged access to

various periphs */

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +6 -0
+					<0x00000000 0xfff73ffb 0xfff73ffb>;
+				bootph-all;
+			};
+		};
+	};
+};
arch/arm/dts/socfpga_stratix10.dtsi +0 -0
old mode 100755
new mode 100644
arch/arm/dts/socfpga_stratix10_socdk-u-boot.dtsi +0 -0
old mode 100755
new mode 100644
arch/arm/dts/socfpga_stratix10_socdk.dts +0 -1
old mode 100755
new mode 100644
--

2.26.2

#6 lore raw

RE: [PATCH v1 02/17] arch: arm: dts: add dts and dtsi for new platform agilex5

Quoted 1,951 lines

-----Original Message-----
From: Chee, Tien Fong <[email protected]>
Sent: Wednesday, 28 June, 2023 5:14 PM
To: Lim, Jit Loon <[email protected]>; [email protected]
Cc: Jagan Teki <[email protected]>; Vignesh R <[email protected]>; Vasut, Marek <[email protected]>; Simon <[email protected]>; Hea, Kok Kiang <[email protected]>; Lokanathan, Raaj <[email protected]>; Maniyam, Dinesh <[email protected]>; Ng, Boon Khai <[email protected]>; Yuslaimi, Alif Zakuan <[email protected]>; Chong, Teik Heng <[email protected]>; Zamri, Muhammad Hazim Izzat <[email protected]>; Tang, Sieu Mun <[email protected]>
Subject: RE: [PATCH v1 02/17] arch: arm: dts: add dts and dtsi for new platform agilex5

Hi Jit Loon,

Quoted 18 lines

-----Original Message-----
From: Lim, Jit Loon <[email protected]>
Sent: Wednesday, 21 June, 2023 11:16 AM
To: [email protected]
Cc: Jagan Teki <[email protected]>; Vignesh R <[email protected]>; Vasut, Marek <[email protected]>; Simon <[email protected]>; Chee, Tien Fong <[email protected]>; Hea, Kok Kiang <[email protected]>; Lokanathan, Raaj <[email protected]>; Maniyam, Dinesh <[email protected]>; Ng, Boon Khai <[email protected]>; Yuslaimi, Alif Zakuan <[email protected]>; Chong, Teik Heng <[email protected]>; Zamri, Muhammad Hazim Izzat <[email protected]>; Lim, Jit Loon <[email protected]>; Tang, Sieu Mun <[email protected]>
Subject: [PATCH v1 02/17] arch: arm: dts: add dts and dtsi for new platform
agilex5

Quoted 3 lines

This is for new platform enablement for agilex5.
Add agilex5 dtsi and dts.
Update checkpatch error for stratix10.

Why having checkpatch error for Stratix10?
This should be in a separate patch.

Quoted 65 lines
---
 arch/arm/dts/Makefile                         |   1 +
 arch/arm/dts/socfpga_agilex5-u-boot.dtsi      | 459 +++++++++++++
 arch/arm/dts/socfpga_agilex5.dtsi             | 634 ++++++++++++++++++
 .../arm/dts/socfpga_agilex5_socdk-u-boot.dtsi | 131 ++++
 arch/arm/dts/socfpga_agilex5_socdk.dts        | 165 +++++
 arch/arm/dts/socfpga_soc64_fit-u-boot.dtsi    |  38 +-
 arch/arm/dts/socfpga_soc64_u-boot.dtsi        | 120 ++++
 arch/arm/dts/socfpga_stratix10.dtsi           |   0
 .../dts/socfpga_stratix10_socdk-u-boot.dtsi   |   0
 arch/arm/dts/socfpga_stratix10_socdk.dts      |   0
 10 files changed, 1534 insertions(+), 14 deletions(-)  create mode
100644 arch/arm/dts/socfpga_agilex5-u-boot.dtsi
 create mode 100644 arch/arm/dts/socfpga_agilex5.dtsi  create mode
100644 arch/arm/dts/socfpga_agilex5_socdk-u-boot.dtsi
 create mode 100644 arch/arm/dts/socfpga_agilex5_socdk.dts
 create mode 100644 arch/arm/dts/socfpga_soc64_u-boot.dtsi
 mode change 100755 => 100644 arch/arm/dts/socfpga_stratix10.dtsi
 mode change 100755 => 100644 arch/arm/dts/socfpga_stratix10_socdk-u-
boot.dtsi
 mode change 100755 => 100644 arch/arm/dts/socfpga_stratix10_socdk.dts
arch/arm/dts/Makefile index renamed from arch/arm/dts/Makefile +0 -0

480269fa60..2e4bc556e1 100644

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

thunderx-88xx.dtb

dtb-$(CONFIG_ARCH_SOCFPGA) += \

arch/arm/dts/Makefile +1 -0
 	socfpga_agilex_socdk.dtb			\
+	socfpga_agilex5_socdk.dtb			\
 	socfpga_arria5_secu1.dtb			\
 	socfpga_arria5_socdk.dtb			\
 	socfpga_arria10_chameleonv3_270_2.dtb		\
arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +21 -0
new file mode 100644
index 0000000000..6a1299901a
@@ -0,0 +1,459 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * U-Boot additions
+ *
+ * Copyright (C) 2019-2022 Intel Corporation <www.intel.com>  */
+
+#include "socfpga_soc64_u-boot.dtsi"
+#include "socfpga_soc64_fit-u-boot.dtsi"
+
+/{
+	memory {
+		#address-cells = <2>;
+		#size-cells = <2>;
+		bootph-all;
+	};
+
+	soc {
+		bootph-all;
+
+		socfpga_secreg: socfpga-secreg {
+			compatible = "intel,socfpga-secreg";

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

Quoted 10 lines
arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +10 -0
+			#address-cells = <1>;
+			#size-cells = <1>;
+			bootph-all;
+
+			/* DSU */
+			i_ccu_caiu0@1c000000 {
+				reg = <0x1c000000 0x00001000>;
+				intel,offset-settings =
+					/* CAIUAMIGR */
+					<0x000003c0 0x00000003

0x0000001f>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi

Quoted 6 lines
arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* CAIUMIFSR */
+					<0x000003c4 0x00000000

0x07070777>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +3 -0
+					/* DII1_MPFEREGS */
+					<0x00000414 0x00018000 0xffffffff>,
+					<0x00000418 0x00000000

0x000000ff>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi

Quoted 1 line
arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +1 -0
+					<0x00000410 0xc0e00200

0xc1f03e1f>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi

Quoted 3 lines
arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +3 -0
+					/* DII2_GICREGS */
+					<0x00000424 0x0001d000 0xffffffff>,
+					<0x00000428 0x00000000

0x000000ff>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi

Quoted 1 line
arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +1 -0
+					<0x00000420 0xc0800400

0xc1f03e1f>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi

Quoted 3 lines
arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +3 -0
+					/* NCAIU0_LWSOC2FPGA */
+					<0x00000444 0x00020000 0xffffffff>,
+					<0x00000448 0x00000000

0x000000ff>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi

Quoted 1 line
arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +1 -0
+					<0x00000440 0xc1100006

0xc1f03e1f>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi

Quoted 3 lines
arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +3 -0
+					/* NCAIU0_SOC2FPGA_1G */
+					<0x00000454 0x00040000 0xffffffff>,
+					<0x00000458 0x00000000

0x000000ff>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi

Quoted 1 line
arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +1 -0
+					<0x00000450 0xc1200006

0xc1f03e1f>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi

Quoted 3 lines
arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +3 -0
+					/* DMI_SDRAM_2G */
+					<0x00000464 0x00080000 0xffffffff>,
+					<0x00000468 0x00000000

0x000000ff>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi

Quoted 1 line
arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +1 -0
+					<0x00000460 0x81300006

0xc1f03e1f>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi

Quoted 3 lines
arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +3 -0
+					/* NCAIU0_SOC2FPGA_16G */
+					<0x00000474 0x00400000 0xffffffff>,
+					<0x00000478 0x00000000

0x000000ff>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi

Quoted 1 line
arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +1 -0
+					<0x00000470 0xc1600006

0xc1f03e1f>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi

Quoted 3 lines
arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +3 -0
+					/* DMI_SDRAM_30G */
+					<0x00000484 0x00800000 0xffffffff>,
+					<0x00000488 0x00000000

0x000000ff>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi

Quoted 1 line
arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +1 -0
+					<0x00000480 0x81700006

0xc1f03e1f>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi

Quoted 3 lines
arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +3 -0
+					/* NCAIU0_SOC2FPGA_256G */
+					<0x00000494 0x04000000 0xffffffff>,
+					<0x00000498 0x00000000

0x000000ff>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi

Quoted 1 line
arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +1 -0
+					<0x00000490 0xc1a00006

0xc1f03e1f>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi

Quoted 3 lines
arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +3 -0
+					/* DMI_SDRAM_480G */
+					<0x000004a4 0x08000000 0xffffffff>,
+					<0x000004a8 0x00000000

0x000000ff>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi

Quoted 1 line
arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +1 -0
+					<0x000004a0 0x81b00006

0xc1f03e1f>;

arch/arm/dts/socfpga_agilex5-u-boot.dtsi

Quoted 9 lines
arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +9 -0
+				bootph-all;
+			};
+
+			/* FPGA2SOC */
+			i_ccu_ncaiu0@1c001000 {
+				reg = <0x1c001000 0x00001000>;
+				intel,offset-settings =
+					/* NCAIU0AMIGR */
+					<0x000003c0 0x00000003

0x0000001f>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi

Quoted 6 lines
arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* NCAIU0MIFSR */
+					<0x000003c4 0x00000000

0x07070777>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +3 -0
+					/* PSS */
+					<0x00000404 0x00010000 0xffffffff>,
+					<0x00000408 0x00000000

0x000000ff>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi

Quoted 1 line
arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +1 -0
+					<0x00000400 0xC0F00000

0xc1f03e1f>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi

Quoted 3 lines
arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +3 -0
+					/* DII1_MPFEREGS */
+					<0x00000414 0x00018000 0xffffffff>,
+					<0x00000418 0x00000000

0x000000ff>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi

Quoted 1 line
arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +1 -0
+					<0x00000410 0xc0e00200

0xc1f03e1f>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi

Quoted 3 lines
arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +3 -0
+					/* NCAIU0_LWSOC2FPGA */
+					<0x00000444 0x00020000 0xffffffff>,
+					<0x00000448 0x00000000

0x000000ff>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi

Quoted 1 line
arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +1 -0
+					<0x00000440 0xc1100006

0xc1f03e1f>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi

Quoted 3 lines
arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +3 -0
+					/* NCAIU0_SOC2FPGA_1G */
+					<0x00000454 0x00040000 0xffffffff>,
+					<0x00000458 0x00000000

0x000000ff>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi

Quoted 1 line
arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +1 -0
+					<0x00000450 0xc1200006

0xc1f03e1f>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi

Quoted 3 lines
arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +3 -0
+					/* DMI_SDRAM_2G */
+					<0x00000464 0x00080000 0xffffffff>,
+					<0x00000468 0x00000000

0x000000ff>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi

Quoted 1 line
arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +1 -0
+					<0x00000460 0x81300006

0xc1f03e1f>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi

Quoted 3 lines
arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +3 -0
+					/* NCAIU0_SOC2FPGA_16G */
+					<0x00000474 0x00400000 0xffffffff>,
+					<0x00000478 0x00000000

0x000000ff>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi

Quoted 1 line
arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +1 -0
+					<0x00000470 0xc1600006

0xc1f03e1f>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi

Quoted 3 lines
arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +3 -0
+					/* DMI_SDRAM_30G */
+					<0x00000484 0x00800000 0xffffffff>,
+					<0x00000488 0x00000000

0x000000ff>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi

Quoted 1 line
arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +1 -0
+					<0x00000480 0x81700006

0xc1f03e1f>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi

Quoted 3 lines
arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +3 -0
+					/* NCAIU0_SOC2FPGA_256G */
+					<0x00000494 0x04000000 0xffffffff>,
+					<0x00000498 0x00000000

0x000000ff>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi

Quoted 1 line
arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +1 -0
+					<0x00000490 0xc1a00006

0xc1f03e1f>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi

Quoted 3 lines
arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +3 -0
+					/* DMI_SDRAM_480G */
+					<0x000004a4 0x08000000 0xffffffff>,
+					<0x000004a8 0x00000000

0x000000ff>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi

Quoted 1 line
arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +1 -0
+					<0x000004a0 0x81b00006

0xc1f03e1f>;

arch/arm/dts/socfpga_agilex5-u-boot.dtsi

Quoted 9 lines
arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +9 -0
+				bootph-all;
+			};
+
+			/* GIC_M */
+			i_ccu_ncaiu1@1c002000 {
+				reg = <0x1c002000 0x00001000>;
+				intel,offset-settings =
+					/* NCAIU1AMIGR */
+					<0x000003c0 0x00000003

0x0000001f>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi

Quoted 6 lines
arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* NCAIU1MIFSR */
+					<0x000003c4 0x00000000

0x07070777>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +3 -0
+					/* DMI_SDRAM_2G */
+					<0x00000464 0x00080000 0xffffffff>,
+					<0x00000468 0x00000000

0x000000ff>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi

Quoted 1 line
arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +1 -0
+					<0x00000460 0x81300006

0xc1f03e1f>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi

Quoted 3 lines
arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +3 -0
+					/* DMI_SDRAM_30G */
+					<0x00000484 0x00800000 0xffffffff>,
+					<0x00000488 0x00000000

0x000000ff>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi

Quoted 1 line
arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +1 -0
+					<0x00000480 0x81700006

0xc1f03e1f>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi

Quoted 3 lines
arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +3 -0
+					/* DMI_SDRAM_480G */
+					<0x000004a4 0x08000000 0xffffffff>,
+					<0x000004a8 0x00000000

0x000000ff>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi

Quoted 1 line
arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +1 -0
+					<0x000004a0 0x81b00006

0xc1f03e1f>;

arch/arm/dts/socfpga_agilex5-u-boot.dtsi

Quoted 9 lines
arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +9 -0
+				bootph-all;
+			};
+
+			/* PSS NOC */
+			i_ccu_ncaiu3@1c004000 {
+				reg = <0x1c004000 0x00001000>;
+				intel,offset-settings =
+					/* NCAIU3AMIGR */
+					<0x000003c0 0x00000003

0x0000001f>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi

Quoted 6 lines
arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* NCAIU3MIFSR */
+					<0x000003c4 0x00000000

0x07070777>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +3 -0
+					/* DII1_MPFEREGS */
+					<0x00000414 0x00018000 0xffffffff>,
+					<0x00000418 0x00000000

0x000000ff>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi

Quoted 1 line
arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +1 -0
+					<0x00000410 0xc0e00200

0xc1f03e1f>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi

Quoted 3 lines
arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +3 -0
+					/* DMI_SDRAM_2G */
+					<0x00000464 0x00080000 0xffffffff>,
+					<0x00000468 0x00000000

0x000000ff>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi

Quoted 1 line
arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +1 -0
+					<0x00000460 0x81300006

0xc1f03e1f>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi

Quoted 3 lines
arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +3 -0
+					/* DMI_SDRAM_30G */
+					<0x00000484 0x00800000 0xffffffff>,
+					<0x00000488 0x00000000

0x000000ff>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi

Quoted 1 line
arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +1 -0
+					<0x00000480 0x81700006

0xc1f03e1f>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi

Quoted 3 lines
arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +3 -0
+					/* DMI_SDRAM_480G */
+					<0x000004a4 0x08000000 0xffffffff>,
+					<0x000004a8 0x00000000

0x000000ff>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi

Quoted 1 line
arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +1 -0
+					<0x000004a0 0x81b00006

0xc1f03e1f>;

arch/arm/dts/socfpga_agilex5-u-boot.dtsi

Quoted 9 lines
arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +9 -0
+				bootph-all;
+			};
+
+			/* DCE0 */
+			i_ccu_dce0@1c005000 {
+				reg = <0x1c005000 0x00001000>;
+				intel,offset-settings =
+					/* DCEUAMIGR0 */
+					<0x000003c0 0x00000003

0x0000001f>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi

Quoted 6 lines
arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* DCEUMIFSR0 */
+					<0x000003c4 0x00000000

0x07070777>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +3 -0
+					/* DMI_SDRAM_2G */
+					<0x00000464 0x00080000 0xffffffff>,
+					<0x00000468 0x00000000

0x000000ff>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi

Quoted 1 line
arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +1 -0
+					<0x00000460 0x81300006

0xc1f03e1f>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi

Quoted 3 lines
arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +3 -0
+					/* DMI_SDRAM_30G */
+					<0x00000484 0x00800000 0xffffffff>,
+					<0x00000488 0x00000000

0x000000ff>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi

Quoted 1 line
arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +1 -0
+					<0x00000480 0x81700006

0xc1f03e1f>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi

Quoted 3 lines
arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +3 -0
+					/* DMI_SDRAM_480G */
+					<0x000004a4 0x08000000 0xffffffff>,
+					<0x000004a8 0x00000000

0x000000ff>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi

Quoted 1 line
arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +1 -0
+					<0x000004a0 0x81b00006

0xc1f03e1f>;

arch/arm/dts/socfpga_agilex5-u-boot.dtsi

Quoted 9 lines
arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +9 -0
+				bootph-all;
+			};
+
+			/* DCE1 */
+			i_ccu_dce1@1c006000 {
+				reg = <0x1c006000 0x00001000>;
+				intel,offset-settings =
+					/* DCEUAMIGR1 */
+					<0x000003c0 0x00000003

0x0000001f>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi

Quoted 6 lines
arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* DCEUMIFSR1 */
+					<0x000003c4 0x00000000

0x07070777>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +3 -0
+					/* DMI_SDRAM_2G */
+					<0x00000464 0x00080000 0xffffffff>,
+					<0x00000468 0x00000000

0x000000ff>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi

Quoted 1 line
arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +1 -0
+					<0x00000460 0x81300006

0xc1f03e1f>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi

Quoted 3 lines
arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +3 -0
+					/* DMI_SDRAM_30G */
+					<0x00000484 0x00800000 0xffffffff>,
+					<0x00000488 0x00000000

0x000000ff>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi

Quoted 1 line
arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +1 -0
+					<0x00000480 0x81700006

0xc1f03e1f>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi

Quoted 3 lines
arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +3 -0
+					/* DMI_SDRAM_480G */
+					<0x000004a4 0x08000000 0xffffffff>,
+					<0x000004a8 0x00000000

0x000000ff>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi

Quoted 1 line
arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +1 -0
+					<0x000004a0 0x81b00006

0xc1f03e1f>;

arch/arm/dts/socfpga_agilex5-u-boot.dtsi

Quoted 12 lines
arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +9 -0
+				bootph-all;
+			};
+
+			/* DMI0 */
+			i_ccu_dmi0@1c007000 {
+				reg = <0x1c007000 0x00001000>;
+				intel,offset-settings =
+					/* DMIUSMCTCR */
+					<0x00000300 0x00000003

0x00000003>;

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+				bootph-all;
+			};

Please exclude above secreg changes for now because this driver is not in mainline yet. You can submit another patch for these changes once the driver is accepted into mainline.

Quoted 1,558 lines
arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +7 -0
+
+			/* DMI1 */
+			i_ccu_dmi0@1c008000 {
+				reg = <0x1c008000 0x00001000>;
+				intel,offset-settings =
+					/* DMIUSMCTCR */
+					<0x00000300 0x00000003

0x00000003>;

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +9 -0
+				bootph-all;
+			};
+
+			/* L4 peripherals firewall */
+			noc_fw_l4_per@10d21000 {
+				reg = <0x10d21000 0x0000008c>;
+				intel,offset-settings =
+					/* NAND */
+					<0x00000000 0x01010001

0x01010001>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* USB0 */
+					<0x0000000c 0x01010001

0x01010001>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* USB1 */
+					<0x00000010 0x01010001

0x01010001>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* SPI_MAIN0 */
+					<0x0000001c 0x01010301

0x01010301>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* SPI_MAIN1 */
+					<0x00000020 0x01010301

0x01010301>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* SPI_SECONDARY0 */
+					<0x00000024 0x01010301

0x01010301>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* SPI_SECONDARY1 */
+					<0x00000028 0x01010301

0x01010301>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* EMAC0 */
+					<0x0000002c 0x01010001

0x01010001>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* EMAC1 */
+					<0x00000030 0x01010001

0x01010001>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* EMAC2 */
+					<0x00000034 0x01010001

0x01010001>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* SDMMC */
+					<0x00000040 0x01010001

0x01010001>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* GPIO0 */
+					<0x00000044 0x01010301

0x01010301>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* GPIO1 */
+					<0x00000048 0x01010301

0x01010301>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* I2C0 */
+					<0x00000050 0x01010301

0x01010301>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* I2C1 */
+					<0x00000054 0x01010301

0x01010301>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* I2C2 */
+					<0x00000058 0x01010301

0x01010301>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* I2C3 */
+					<0x0000005c 0x01010301

0x01010301>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* I2C4 */
+					<0x00000060 0x01010301

0x01010301>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* SP_TIMER0 */
+					<0x00000064 0x01010301

0x01010301>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* SP_TIMER1 */
+					<0x00000068 0x01010301

0x01010301>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* UART0 */
+					<0x0000006c 0x01010301

0x01010301>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* UART1 */
+					<0x00000070 0x01010301

0x01010301>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* I3C0 */
+					<0x00000074 0x01010301

0x01010301>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* I3C1 */
+					<0x00000078 0x01010301

0x01010301>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* DMA0 */
+					<0x0000007c 0x01010001

0x01010001>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* DMA1 */
+					<0x00000080 0x01010001

0x01010001>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* COMBO_PHY */
+					<0x00000084 0x01010001

0x01010001>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* NAND_SDMA */
+					<0x00000088 0x01010301

0x01010301>;

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +9 -0
+				bootph-all;
+			};
+
+			/* L4 system firewall */
+			noc_fw_l4_sys@10d21100 {
+				reg = <0x10d21100 0x00000098>;
+				intel,offset-settings =
+					/* DMA_ECC */
+					<0x00000008 0x01010001

0x01010001>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* EMAC0RX_ECC */
+					<0x0000000c 0x01010001

0x01010001>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* EMAC0TX_ECC */
+					<0x00000010 0x01010001

0x01010001>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* EMAC1RX_ECC */
+					<0x00000014 0x01010001

0x01010001>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* EMAC1TX_ECC */
+					<0x00000018 0x01010001

0x01010001>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* EMAC2RX_ECC */
+					<0x0000001c 0x01010001

0x01010001>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* EMAC2TX_ECC */
+					<0x00000020 0x01010001

0x01010001>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* NAND_ECC */
+					<0x0000002c 0x01010001

0x01010001>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* NAND_READ_ECC */
+					<0x00000030 0x01010001

0x01010001>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* NAND_WRITE_ECC */
+					<0x00000034 0x01010001

0x01010001>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* OCRAM_ECC */
+					<0x00000038 0x01010001

0x01010001>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* SDMMC_ECC */
+					<0x00000040 0x01010001

0x01010001>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* USB0_ECC */
+					<0x00000044 0x01010001

0x01010001>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* USB1_CACHEECC */
+					<0x00000048 0x01010001

0x01010001>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* CLOCK_MANAGER */
+					<0x0000004c 0x01010001

0x01010001>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* IO_MANAGER */
+					<0x00000054 0x01010001

0x01010001>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* RESET_MANAGER */
+					<0x00000058 0x01010001

0x01010001>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* SYSTEM_MANAGER */
+					<0x0000005c 0x01010001

0x01010001>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* OSC0_TIMER */
+					<0x00000060 0x01010301

0x01010301>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* OSC1_TIMER0*/
+					<0x00000064 0x01010301

0x01010301>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* WATCHDOG0 */
+					<0x00000068 0x01010301

0x01010301>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* WATCHDOG1 */
+					<0x0000006c 0x01010301

0x01010301>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* WATCHDOG2 */
+					<0x00000070 0x01010301

0x01010301>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* WATCHDOG3 */
+					<0x00000074 0x01010301

0x01010301>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* DAP */
+					<0x00000078 0x03010001

0x03010001>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* WATCHDOG4 */
+					<0x0000007c 0x01010301

0x01010301>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* POWER_MANAGER */
+					<0x00000080 0x01010001

0x01010001>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* USB1_RXECC */
+					<0x00000084 0x01010001

0x01010001>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* USB1_TXECC */
+					<0x00000088 0x01010001

0x01010001>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* L4_NOC_PROBES */
+					<0x00000090 0x01010001

0x01010001>,

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +2 -0
+					/* L4_NOC_QOS */
+					<0x00000094 0x01010001

0x01010001>;

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +27 -0
+				bootph-all;
+			};
+
+			/* Light weight SoC2FPGA */
+			noc_fw_lwsoc2fpga@10d21300 {
+				reg = <0x10d21300 0x0000004>;
+				intel,offset-settings =
+					/* LWSOC2FPGA_CSR */
+					<0x00000000 0x0ffe0301>;
+				bootph-all;
+			};
+
+			/* SoC2FPGA */
+			noc_fw_soc2fpga@10d21200 {
+				reg = <0x10d21200 0x0000004>;
+				intel,offset-settings =
+					/* SOC2FPGA_CSR */
+					<0x00000000 0x0ffe0301 0x0ffe0301>;
+				bootph-all;
+			};
+
+			/* TCU */
+			noc_fw_tcu@10d21400 {
+				reg = <0x10d21400 0x0000004>;
+				intel,offset-settings =
+					/* TCU_CSR */
+					<0x00000000 0x01010001

0x01010001>;

arch/arm/dts/socfpga_agilex5-u-boot.dtsi new file +68 -0
+				bootph-all;
+			};
+		};
+	};
+};
+
+&clkmgr {
+	bootph-all;
+};
+
+&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 {
+	bootph-all;
+};
+
+&rst {
+	compatible = "altr,rst-mgr";
+	altr,modrst-offset = <0x24>;
+	bootph-all;
+};
+
+&sdr {
+	compatible = "intel,sdr-ctl-agilex5";
+	reg = <0x18000000 0x400000>,
+	      <0x18400000 0x400000>,
+	      <0x18800000 0x400000>;
+	resets = <&rst DDRSCH_RESET>;
+	bootph-all;
+};
+
+&sysmgr {
+	compatible = "altr,sys-mgr", "syscon";
+	bootph-all;
+};
+
+&uart0 {
+	bootph-all;
+};
+
+&watchdog0 {
+	bootph-all;
+};
arch/arm/dts/socfpga_agilex5.dtsi new file +135 -0
new file mode 100644
index 0000000000..f445bc04ad
@@ -0,0 +1,634 @@
+// SPDX-License-Identifier:     GPL-2.0
+/*
+ * Copyright (C) 2022, Intel Corporation  */
+
+/dts-v1/;
+#include <dt-bindings/reset/altr,rst-mgr-agx5.h>
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/clock/agilex5-clock.h>
+
+/ {
+	compatible = "intel,socfpga-agilex";
+	#address-cells = <2>;
+	#size-cells = <2>;
+
+	reserved-memory {
+		#address-cells = <2>;
+		#size-cells = <2>;
+		ranges;
+
+		service_reserved: svcbuffer@0 {
+			compatible = "shared-dma-pool";
+			reg = <0x0 0x0 0x0 0x1000000>;
+			alignment = <0x1000>;
+			no-map;
+		};
+	};
+
+	cpus {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		cpu0: cpu@0 {
+			compatible = "arm,cortex-a55";
+			device_type = "cpu";
+			enable-method = "psci";
+			reg = <0x0>;
+		};
+
+		cpu1: cpu@1 {
+			compatible = "arm,cortex-a55";
+			device_type = "cpu";
+			enable-method = "psci";
+			reg = <0x1>;
+		};
+
+		cpu2: cpu@2 {
+			compatible = "arm,cortex-a76";
+			device_type = "cpu";
+			enable-method = "psci";
+			reg = <0x2>;
+		};
+
+		cpu3: cpu@3 {
+			compatible = "arm,cortex-a76";
+			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@fffc1000 {
+		compatible = "arm,gic-400", "arm,cortex-a15-gic";
+		#interrupt-cells = <3>;
+		interrupt-controller;
+		reg = <0x0 0x1d000000 0x0 0x10000>;
+	};
+
+	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@10d10000 {
+			compatible = "intel,agilex5-clkmgr";
+			reg = <0x10d10000 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@10810000 {
+			compatible = "altr,socfpga-stmmac", "snps,dwmac-

3.74a", "snps,dwmac";

arch/arm/dts/socfpga_agilex5.dtsi new file +5 -0
+			reg = <0x10810000 0x3500>;
+			interrupts = <0 90 4>;
+			interrupt-names = "macirq";
+			mac-address = [00 00 00 00 00 00];
+			resets = <&rst EMAC0_RESET>, <&rst

EMAC0_OCP_RESET>;

arch/arm/dts/socfpga_agilex5.dtsi new file +13 -0
+			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 AGILEX5_EMAC0_CLK>;
+			clock-names = "stmmaceth";
+			status = "disabled";
+		};
+
+		gmac1: ethernet@10820000 {
+			compatible = "altr,socfpga-stmmac", "snps,dwmac-

3.74a", "snps,dwmac";

arch/arm/dts/socfpga_agilex5.dtsi new file +5 -0
+			reg = <0x10820000 0x3500>;
+			interrupts = <0 91 4>;
+			interrupt-names = "macirq";
+			mac-address = [00 00 00 00 00 00];
+			resets = <&rst EMAC1_RESET>, <&rst

EMAC1_OCP_RESET>;

arch/arm/dts/socfpga_agilex5.dtsi new file +13 -0
+			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 AGILEX5_EMAC1_CLK>;
+			clock-names = "stmmaceth";
+			status = "disabled";
+		};
+
+		gmac2: ethernet@10830000 {
+			compatible = "altr,socfpga-stmmac", "snps,dwmac-

3.74a", "snps,dwmac";

arch/arm/dts/socfpga_agilex5.dtsi new file +5 -0
+			reg = <0x10830000 0x3500>;
+			interrupts = <0 92 4>;
+			interrupt-names = "macirq";
+			mac-address = [00 00 00 00 00 00];
+			resets = <&rst EMAC2_RESET>, <&rst

EMAC2_OCP_RESET>;

arch/arm/dts/socfpga_agilex5.dtsi new file +146 -0
+			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 AGILEX5_EMAC2_CLK>;
+			clock-names = "stmmaceth";
+			status = "disabled";
+		};
+
+		gpio0: gpio@10c03200 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "snps,dw-apb-gpio";
+			reg = <0x10c03200 0x80>;
+			resets = <&rst GPIO0_RESET>;
+			status = "disabled";
+
+			porta: gpio-controller@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@10c03300 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "snps,dw-apb-gpio";
+			reg = <0x10c03300 0x80>;
+			resets = <&rst GPIO1_RESET>;
+			status = "disabled";
+
+			portb: gpio-controller@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@10c02800 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "snps,designware-i2c";
+			reg = <0x10c02800 0x100>;
+			interrupts = <0 103 4>;
+			resets = <&rst I2C0_RESET>;
+			clocks = <&clkmgr AGILEX5_L4_SP_CLK>;
+			status = "disabled";
+		};
+
+		i2c1: i2c@10c02900 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "snps,designware-i2c";
+			reg = <0x10c02900 0x100>;
+			interrupts = <0 104 4>;
+			resets = <&rst I2C1_RESET>;
+			clocks = <&clkmgr AGILEX5_L4_SP_CLK>;
+			status = "disabled";
+		};
+
+		i2c2: i2c@10c02a00 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "snps,designware-i2c";
+			reg = <0x10c02a00 0x100>;
+			interrupts = <0 105 4>;
+			resets = <&rst I2C2_RESET>;
+			clocks = <&clkmgr AGILEX5_L4_SP_CLK>;
+			status = "disabled";
+		};
+
+		i2c3: i2c@10c02b00 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "snps,designware-i2c";
+			reg = <0x10c02b00 0x100>;
+			interrupts = <0 106 4>;
+			resets = <&rst I2C3_RESET>;
+			clocks = <&clkmgr AGILEX5_L4_SP_CLK>;
+			status = "disabled";
+		};
+
+		i2c4: i2c@10c02c00 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "snps,designware-i2c";
+			reg = <0x10c02c00 0x100>;
+			interrupts = <0 107 4>;
+			resets = <&rst I2C4_RESET>;
+			clocks = <&clkmgr AGILEX5_L4_SP_CLK>;
+			status = "disabled";
+		};
+
+		combophy0: combophy@0 {
+			#phy-cells = <0>;
+			phy-type = <1>;
+			compatible = "cdns,combophy";
+			reg = <0x10808000 0x1000>;
+			resets = <&rst COMBOPHY_RESET>;
+			reset-names = "reset";
+			status = "disabled";
+		};
+
+		mmc: mmc0@10808000 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "cdns,sd4hc";
+			reg = <0x10808000 0x1000>;
+			interrupts = <0 96 4>;
+			phys = <&combophy0>;
+			phy-names = "combo-phy";
+			clocks = <&clkmgr AGILEX5_L4_MP_CLK>,
+				 <&clkmgr AGILEX5_SDMMC_CLK>;
+			clock-names = "biu", "ciu";
+			fifo-depth = <0x800>;
+			resets = <&rst SDMMC_RESET>;
+			reset-names = "reset";
+			iommus = <&smmu 5>;
+			status = "disabled";
+		};
+
+		nand: nand@10b80000 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "altr,socfpga-denali-nand";
+			reg = <0x10b80000 0x1038>,
+			      <0xffb80000 0x1000>;
+			reg-names = "nand_data", "denali_reg";
+			interrupts = <0 97 4>;
+			clocks = <&clkmgr AGILEX5_NAND_CLK>,
+				 <&clkmgr AGILEX5_NAND_X_CLK>;
+			clock-names = "nand", "nand_x";
+			resets = <&rst NAND_RESET>, <&rst

NAND_OCP_RESET>;

arch/arm/dts/socfpga_agilex5.dtsi new file +38 -0
+			status = "disabled";
+		};
+
+		ocram: sram@00000000 {
+			compatible = "mmio-sram";
+			reg = <0x00000000 0x200000>;
+		};
+
+		rst: rstmgr@10d11000 {
+			#reset-cells = <1>;
+			compatible = "altr,stratix10-rst-mgr";
+			reg = <0x10d11000 0x1000>;
+		};
+
+		smmu: iommu@16000000 {
+			compatible = "arm,mmu-500", "arm,smmu-v2";
+			reg = <0x16000000 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@10da4000 {
+			compatible = "intel,agilex-spi",
+				     "snps,dw-apb-ssi-4.00a", "snps,dw-apb-

ssi";

arch/arm/dts/socfpga_agilex5.dtsi new file +14 -0
+			#address-cells = <1>;
+			#size-cells = <0>;
+			reg = <0x10da4000 0x1000>;
+			interrupts = <0 99 4>;
+			resets = <&rst SPIM0_RESET>;
+			reg-io-width = <4>;
+			num-cs = <4>;
+			clocks = <&clkmgr AGILEX5_L4_MAIN_CLK>;
+			status = "disabled";
+		};
+
+		spi1: spi@10da5000 {
+			compatible = "intel,agilex-spi",
+				     "snps,dw-apb-ssi-4.00a", "snps,dw-apb-

ssi";

arch/arm/dts/socfpga_agilex5.dtsi new file +102 -0
+			#address-cells = <1>;
+			#size-cells = <0>;
+			reg = <0x10da5000 0x1000>;
+			interrupts = <0 100 4>;
+			resets = <&rst SPIM1_RESET>;
+			reg-io-width = <4>;
+			num-cs = <4>;
+			clocks = <&clkmgr AGILEX5_L4_MAIN_CLK>;
+			status = "disabled";
+		};
+
+		sysmgr: sysmgr@10d12000 {
+			compatible = "altr,sys-mgr-s10","altr,sys-mgr";
+			reg = <0x10d12000 0x500>;
+		};
+
+		/* Local timer */
+		timer {
+			compatible = "arm,armv8-timer";
+			interrupts = <1 13 0xf08>,
+				     <1 14 0xf08>,
+				     <1 11 0xf08>,
+				     <1 10 0xf08>;
+		};
+
+		timer0: timer0@10c03000 {
+			compatible = "snps,dw-apb-timer";
+			interrupts = <0 113 4>;
+			reg = <0x10c03000 0x100>;
+			resets = <&rst SPTIMER0_RESET>;
+			clocks = <&clkmgr AGILEX5_L4_SP_CLK>;
+			clock-names = "timer";
+			status = "disabled";
+		};
+
+		timer1: timer1@10c03100 {
+			compatible = "snps,dw-apb-timer";
+			interrupts = <0 114 4>;
+			reg = <0x10c03100 0x100>;
+			resets = <&rst SPTIMER1_RESET>;
+			clocks = <&clkmgr AGILEX5_L4_SP_CLK>;
+			clock-names = "timer";
+			status = "disabled";
+		};
+
+		timer2: timer2@10d00000 {
+			compatible = "snps,dw-apb-timer";
+			interrupts = <0 115 4>;
+			reg = <0x10d00000 0x100>;
+			resets = <&rst L4SYSTIMER0_RESET>;
+			clocks = <&clkmgr AGILEX5_L4_SYS_FREE_CLK>;
+			clock-names = "timer";
+			status = "disabled";
+		};
+
+		timer3: timer3@10d00100 {
+			compatible = "snps,dw-apb-timer";
+			interrupts = <0 116 4>;
+			reg = <0x10d00100 0x100>;
+			resets = <&rst L4SYSTIMER1_RESET>;
+			clocks = <&clkmgr AGILEX5_L4_SYS_FREE_CLK>;
+			clock-names = "timer";
+			status = "disabled";
+		};
+
+		uart0: serial0@10c02000 {
+			compatible = "snps,dw-apb-uart";
+			reg = <0x10c02000 0x100>;
+			interrupts = <0 108 4>;
+			reg-shift = <2>;
+			reg-io-width = <4>;
+			resets = <&rst UART0_RESET>;
+			status = "disabled";
+			clocks = <&clkmgr AGILEX5_L4_SP_CLK>;
+			clock-frequency = <100000000>;
+		};
+
+		uart1: serial1@10c02100 {
+			compatible = "snps,dw-apb-uart";
+			reg = <0x10c02100 0x100>;
+			interrupts = <0 109 4>;
+			reg-shift = <2>;
+			reg-io-width = <4>;
+			resets = <&rst UART1_RESET>;
+			clocks = <&clkmgr AGILEX5_L4_SP_CLK>;
+			status = "disabled";
+		};
+
+		usbphy0: usbphy@0 {
+			#phy-cells = <0>;
+			compatible = "usb-nop-xceiv";
+			clocks = <&clkmgr AGILEX5_USB_CLK>;
+			status = "disabled";
+		};
+
+		usb0: usb@10b00000 {
+			compatible = "snps,dwc2";
+			reg = <0x10b00000 0x40000>;
+			interrupts = <0 93 4>;
+			phys = <&usbphy0>;
+			phy-names = "usb2-phy";
+			resets = <&rst USB0_RESET>, <&rst

USB0_OCP_RESET>;

arch/arm/dts/socfpga_agilex5.dtsi new file +152 -0
+			reset-names = "dwc2", "dwc2-ecc";
+			clocks = <&clkmgr AGILEX5_USB_CLK>;
+			iommus = <&smmu 6>;
+			status = "disabled";
+		};
+
+		usb31: usb31@11000000 {
+			compatible = "snps,dwc3";
+			reg = <0x11000000 0x100000>;
+			resets = <&rst USB1_RESET>;
+			phys = <&usbphy0>, <&usbphy0>;
+			phy-names = "usb2-phy", "usb3-phy";
+			dr_mode = "host";
+			maximum-speed = "super-speed";
+			snps,dis_u2_susphy_quirk;
+			status = "disabled";
+		};
+
+		watchdog0: watchdog@10d00200 {
+			compatible = "snps,dw-wdt";
+			reg = <0x10d00200 0x100>;
+			interrupts = <0 117 4>;
+			resets = <&rst WATCHDOG0_RESET>;
+			clocks = <&clkmgr AGILEX5_L4_SYS_FREE_CLK>;
+			status = "disabled";
+		};
+
+		watchdog1: watchdog@10d00300 {
+			compatible = "snps,dw-wdt";
+			reg = <0x10d00300 0x100>;
+			interrupts = <0 118 4>;
+			resets = <&rst WATCHDOG1_RESET>;
+			clocks = <&clkmgr AGILEX5_L4_SYS_FREE_CLK>;
+			status = "disabled";
+		};
+
+		watchdog2: watchdog@10d00400 {
+			compatible = "snps,dw-wdt";
+			reg = <0x10d00400 0x100>;
+			interrupts = <0 125 4>;
+			resets = <&rst WATCHDOG2_RESET>;
+			clocks = <&clkmgr AGILEX5_L4_SYS_FREE_CLK>;
+			status = "disabled";
+		};
+
+		watchdog3: watchdog@10d00500 {
+			compatible = "snps,dw-wdt";
+			reg = <0x10d00500 0x100>;
+			interrupts = <0 126 4>;
+			resets = <&rst WATCHDOG3_RESET>;
+			clocks = <&clkmgr AGILEX5_L4_SYS_FREE_CLK>;
+			status = "disabled";
+		};
+
+		watchdog4: watchdog@10d00600 {
+			compatible = "snps,dw-wdt";
+			reg = <0x10d00600 0x100>;
+			interrupts = <0 175 4>;
+			resets = <&rst WATCHDOG4_RESET>;
+			clocks = <&clkmgr AGILEX5_L4_SYS_FREE_CLK>;
+			status = "disabled";
+		};
+
+		sdr: sdr@10d21000 {
+			compatible = "altr,sdr-ctl", "syscon";
+			reg = <0x10d21000 0xc0>;
+		};
+
+		/* TODO: Update the ECC registers */
+		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@ff8cc000 {
+				compatible = "altr,socfpga-s10-ocram-ecc",
+					     "altr,socfpga-a10-ocram-ecc";
+				reg = <0xff8cc000 0x100>;
+				altr,ecc-parent = <&ocram>;
+				interrupts = <1 4>;
+			};
+
+			usb0-ecc@ff8c4000 {
+				compatible = "altr,socfpga-s10-usb-ecc",
+					     "altr,socfpga-usb-ecc";
+				reg = <0xff8c4000 0x100>;
+				altr,ecc-parent = <&usb0>;
+				interrupts = <2 4>;
+			};
+
+			emac0-rx-ecc@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@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@ff8c8c00 {
+				compatible = "altr,socfpga-s10-sdmmc-ecc",
+					     "altr,socfpga-sdmmc-ecc";
+				reg = <0xff8c8c00 0x100>;
+				altr,ecc-parent = <&mmc>;
+				interrupts = <14 4>,
+					     <15 4>;
+			};
+		};
+
+		/* QSPI address not available yet */
+		qspi: spi@108d2000 {
+			compatible = "cdns,qspi-nor";
+			#address-cells = <1>;
+			#size-cells = <0>;
+			reg = <0x108d2000 0x100>,
+			      <0x10900000 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_agilex5.dtsi new file +5 -0
+				};
+			};
+		};
+	};
+};
arch/arm/dts/socfpga_agilex5_socdk-u-boot.dtsi new file +130 -0
new file mode 100644
index 0000000000..ad170353f8
@@ -0,0 +1,131 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * U-Boot additions
+ *
+ * Copyright (C) 2022 Intel Corporation <www.intel.com>  */
+
+#include "socfpga_agilex5-u-boot.dtsi"
+
+/{
+	aliases {
+		spi0 = &qspi;
+		freeze_br0 = &freeze_controller;
+	};
+
+	soc {
+		freeze_controller: freeze_controller@f9000450 {
+			compatible = "altr,freeze-bridge-controller";
+			reg = <0xf9000450 0x00000010>;
+			status = "disabled";
+		};
+	};
+
+	memory {
+		/* 2GB on Simics*/
+		reg = <0 0x80000000 0 0x80000000>;
+	};
+
+	chosen {
+		stdout-path = "serial0:115200n8";
+		u-boot,spl-boot-order = &mmc,&flash0,"/memory";
+	};
+};
+
+&flash0 {
+	compatible = "jedec,spi-nor";
+	spi-tx-bus-width = <4>;
+	spi-rx-bus-width = <4>;
+	bootph-all;
+};
+
+&nand {
+	status = "okay";
+	nand-bus-width = <16>;
+	bootph-all;
+};
+
+&mmc {
+	status = "okay";
+	bus-width = <4>;
+	sd-uhs-sdr50;
+	cap-mmc-highspeed;
+	bootph-all;
+};
+
+&combophy0 {
+	status = "okay";
+	bootph-all;
+	cdns,phy-use-ext-lpbk-dqs = <1>;
+	cdns,phy-use-lpbk-dqs = <1>;
+	cdns,phy-use-phony-dqs = <1>;
+	cdns,phy-use-phony-dqs-cmd = <1>;
+	cdns,phy-io-mask-always-on = <0>;
+	cdns,phy-io-mask-end = <5>;
+	cdns,phy-io-mask-start = <0>;
+	cdns,phy-data-select-oe-end = <1>;
+	cdns,phy-sync-method = <1>;
+	cdns,phy-sw-half-cycle-shift = <0>;
+	cdns,phy-rd-del-sel = <52>;
+	cdns,phy-underrun-suppress = <1>;
+	cdns,phy-gate-cfg-always-on = <1>;
+	cdns,phy-param-dll-bypass-mode = <1>;
+	cdns,phy-param-phase-detect-sel = <2>;
+	cdns,phy-param-dll-start-point = <254>;
+	cdns,phy-read-dqs-cmd-delay = <0>;
+	cdns,phy-clk-wrdqs-delay = <0>;
+	cdns,phy-clk-wr-delay = <0>;
+	cdns,phy-read-dqs-delay = <0>;
+	cdns,phy-phony-dqs-timing = <0>;
+	cdns,hrs09-rddata-en = <1>;
+	cdns,hrs09-rdcmd-en = <1>;
+	cdns,hrs09-extended-wr-mode = <1>;
+	cdns,hrs09-extended-rd-mode = <1>;
+	cdns,hrs10-hcsdclkadj = <3>;
+	cdns,hrs16-wrdata1-sdclk-dly = <0>;
+	cdns,hrs16-wrdata0-sdclk-dly = <0>;
+	cdns,hrs16-wrcmd1-sdclk-dly = <0>;
+	cdns,hrs16-wrcmd0-sdclk-dly = <0>;
+	cdns,hrs16-wrdata1-dly = <0>;
+	cdns,hrs16-wrdata0-dly = <0>;
+	cdns,hrs16-wrcmd1-dly = <0>;
+	cdns,hrs16-wrcmd0-dly = <0>;
+	cdns,hrs07-rw-compensate = <10>;
+	cdns,hrs07-idelay-val = <0>;
+};
+
+&qspi {
+	status = "okay";
+};
+
+&timer0 {
+	bootph-all;
+};
+
+&timer1 {
+	bootph-all;
+};
+
+&timer2 {
+	bootph-all;
+};
+
+&timer3 {
+	bootph-all;
+};
+
+&watchdog0 {
+	bootph-all;
+};
+
+#if !defined(CONFIG_SOCFPGA_SECURE_VAB_AUTH)
+&fdt_0_blob {
+	filename = "arch/arm/dts/socfpga_agilex5_socdk.dtb";
+};
+
+/* To add NAND dtb when ready in future */
+
+&binman {
+	/delete-node/ kernel;
+};
+#endif
arch/arm/dts/socfpga_agilex5_socdk.dts new file +164 -0
new file mode 100644
index 0000000000..1a39426561
@@ -0,0 +1,165 @@
+// SPDX-License-Identifier:     GPL-2.0
+/*
+ * Copyright (C) 2019-2022, Intel Corporation  */ #include
+"socfpga_agilex5.dtsi"
+
+/ {
+	model = "SoCFPGA Agilex5 SoCDK";
+
+	aliases {
+		serial0 = &uart0;
+	};
+
+	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>;
+			};
+		};
+	};
+};
+
+&gpio0 {
+	status = "okay";
+};
+
+&gpio1 {
+	status = "okay";
+};
+
+&i2c0 {
+	status = "okay";
+};
+
+&i2c1 {
+	status = "okay";
+};
+
+&mmc {
+	status = "okay";
+};
+
+&combophy0 {
+	status = "okay";
+};
+
+&uart0 {
+	status = "okay";
+};
+
+&usbphy0 {
+	status = "okay";
+};
+
+&usb0 {
+	status = "okay";
+	disable-over-current;
+};
+
+&usb31 {
+	status = "okay";
+};
+
+&watchdog0 {
+	status = "okay";
+};
+
+&watchdog1 {
+	status = "okay";
+};
+
+&watchdog2 {
+	status = "okay";
+};
+
+&watchdog3 {
+	status = "okay";
+};
+
+&watchdog4 {
+	status = "okay";
+};
+
+&timer0 {
+	status = "okay";
+};
+
+&timer1 {
+	status = "okay";
+};
+
+&timer2 {
+	status = "okay";
+};
+
+&timer3 {
+	status = "okay";
+};
+
+&spi0 {
+	status = "okay";
+};
+
+&spi1 {
+	status = "okay";
+};
+
+&qspi {
+	flash0: flash@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@0 {
+				label = "Boot and fpga data";
+				reg = <0x0 0x034B0000>;
+			};
+
+			qspi_rootfs: partition@34B0000 {
+				label = "Root Filesystem - JFFS2";
+				reg = <0x034B0000 0x0EB50000>;
+			};
+		};
+	};
+};
arch/arm/dts/socfpga_soc64_fit-u-boot.dtsi +6 -2
index 84b91e8df0..1ca721f070 100644
@@ -2,7 +2,7 @@
 /*
  * U-Boot additions
  *
- * Copyright (C) 2020 Intel Corporation <www.intel.com>
+ * Copyright (C) 2020-2022 Intel Corporation <www.intel.com>
  */
 
 #if defined(CONFIG_FIT)
@@ -21,14 +21,18 @@
 			description = "FIT with firmware and bootloader";
 			#address-cells = <1>;
 
-			images {
+			images: images {
 				uboot {
 					description = "U-Boot SoC64";
 					type = "standalone";
 					os = "U-Boot";
 					arch = "arm64";
 					compression = "none";
+				#if
 IS_ENABLED(CONFIG_TARGET_SOCFPGA_AGILEX5)
+					load = <0x80200000>;
+				#else
 					load = <0x00200000>;
+				#endif
 					uboot_blob: blob-ext {
 						filename = "u-boot-

nodtb.bin";

arch/arm/dts/socfpga_soc64_fit-u-boot.dtsi +5 -0
 					};
@@ -43,8 +47,13 @@
 					os = "arm-trusted-firmware";
 					arch = "arm64";
 					compression = "none";
+				#if
 IS_ENABLED(CONFIG_TARGET_SOCFPGA_AGILEX5)
+					load = <0x80000000>;
+					entry = <0x80000000>;
+				#else
 					load = <0x00001000>;
 					entry = <0x00001000>;
+				#endif
 					atf_blob: blob-ext {
 						filename = "bl31.bin";
arch/arm/dts/socfpga_soc64_fit-u-boot.dtsi +3 -3
 					};
@@ -53,11 +62,11 @@
 					};
 				};
 
-				fdt {
-					description = "U-Boot SoC64 flat
 device-tree";
+				fdt-0 {
+					description = "socfpga_socdk";
 					type = "flat_dt";
 					compression = "none";
-					uboot_fdt_blob: blob-ext {
+					fdt_0_blob: blob-ext {
 						filename = "u-boot.dtb";
 					};
arch/arm/dts/socfpga_soc64_fit-u-boot.dtsi +7 -6
 					hash {
@@ -66,17 +75,18 @@
 				};
 			};
 
-			configurations {
-				default = "conf";
-				conf {
-					description = "Intel SoC64 FPGA";
+			board_config: configurations {
+				default = "board-0";
+
+				board-0 {
+					description = "board_0";
 					firmware = "atf";
 					loadables = "uboot";
-					fdt = "fdt";
+					fdt = "fdt-0";
 					signature {
 						algo = "crc32";
 						key-name-hint = "dev";
-						sign-images = "atf", "fdt",
 "uboot";
+						sign-images = "atf", "uboot",
 "fdt-0";
 					};
arch/arm/dts/socfpga_soc64_fit-u-boot.dtsi +3 -3
 				};
 			};
@@ -96,8 +106,8 @@
 					arch = "arm64";
 					os = "linux";
 					compression = "none";
-					load = <0x4080000>;
-					entry = <0x4080000>;
+					load = <0x6000000>;
+					entry = <0x6000000>;
 					kernel_blob: blob-ext {
 						filename = "Image";
 					};
@@ -146,7 +156,7 @@
 	filename = "signed-bl31.bin";
 };
 
-&uboot_fdt_blob {
+&fdt_0_blob {
 	filename = "signed-u-boot.dtb";
 };
 
arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +18 -0
new file mode 100644
index 0000000000..add9890de3
@@ -0,0 +1,120 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * U-Boot additions
+ *
+ * Copyright (C) 2021-2022 Intel Corporation <www.intel.com>  */
+
+/ {
+	soc {
+			socfpga_secreg: socfpga-secreg {
+			compatible = "intel,socfpga-secreg";
+			#address-cells = <1>;
+			#size-cells = <1>;
+			bootph-all;
+
+			i_sys_mgr_core@ffd12000 {
+				reg = <0xffd12000 0x00000230>;
+				intel,offset-settings =
+					/* Enable non-secure interface to

DMA */

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +2 -0
+					<0x00000020 0xff010000 0xff010011>,
+					/* Enable non-secure interface to

DMA periph */

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +9 -0
+					<0x00000024 0xffffffff 0xffffffff>;
+				bootph-all;
+			};
+
+			noc_fw_l4_per_l4_per_scr@ffd21000 {
+				reg = <0xffd21000 0x00000074>;
+				intel,offset-settings =
+					/* Disable L4 periphs firewall */
+					<0x00000000 0x01010001

0x01010001>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x00000004 0x01010001

0x01010001>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x0000000c 0x01010001

0x01010001>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x00000010 0x01010001

0x01010001>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x0000001c 0x01010001

0x01010101>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x00000020 0x01010001

0x01010101>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x00000024 0x01010001

0x01010101>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x00000028 0x01010001

0x01010101>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x0000002c 0x01010001

0x01010001>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x00000030 0x01010001

0x01010001>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x00000034 0x01010001

0x01010001>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x00000040 0x01010001

0x01010001>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x00000044 0x01010001

0x01010101>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x00000048 0x01010001

0x01010101>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x00000050 0x01010001

0x01010101>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x00000054 0x01010001

0x01010101>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x00000058 0x01010001

0x01010101>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x0000005c 0x01010001

0x01010101>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x00000060 0x01010001

0x01010101>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x00000064 0x01010001

0x01010101>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x00000068 0x01010001

0x01010101>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x0000006c 0x01010001

0x01010101>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x00000070 0x01010001

0x01010101>;

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +8 -0
+				bootph-all;
+			};
+
+			noc_fw_l4_sys_l4_sys_scr@ffd21100 {
+				reg = <0xffd21100 0x00000098>;
+				intel,offset-settings =
+					/* Disable L4 system firewall */
+					<0x00000008 0x01010001

0x01010001>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x0000000c 0x01010001

0x01010001>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x00000010 0x01010001

0x01010001>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x00000014 0x01010001

0x01010001>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x00000018 0x01010001

0x01010001>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x0000001c 0x01010001

0x01010001>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x00000020 0x01010001

0x01010001>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x0000002c 0x01010001

0x01010001>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x00000030 0x01010001

0x01010001>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x00000034 0x01010001

0x01010001>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x00000038 0x01010001

0x01010001>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x00000040 0x01010001

0x01010001>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x00000044 0x01010001

0x01010001>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x00000048 0x01010001

0x01010001>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x0000004c 0x01010001

0x01010001>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x00000054 0x01010001

0x01010001>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x00000058 0x01010001

0x01010001>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x0000005c 0x01010001

0x01010001>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x00000060 0x01010001

0x01010101>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x00000064 0x01010001

0x01010101>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x00000068 0x01010001

0x01010101>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x0000006c 0x01010001

0x01010101>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x00000070 0x01010001

0x01010101>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x00000074 0x01010001

0x01010101>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x00000078 0x01010001

0x03010001>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x00000090 0x01010001

0x01010001>,

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+					<0x00000094 0x01010001

0x01010001>;

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +7 -0
+				bootph-all;
+			};
+
+			noc_fw_soc2fpga_soc2fpga_scr@ffd21200 {
+				reg = <0xffd21200 0x00000004>;
+				/* Disable soc2fpga security access */
+				intel,offset-settings = <0x00000000

0x0ffe0101 0x0ffe0101>;

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +6 -0
+				bootph-all;
+			};
+
+			noc_fw_lwsoc2fpga_lwsoc2fpga_scr@ffd21300 {
+				reg = <0xffd21300 0x00000004>;
+				/* Disable lightweight soc2fpga security

access */

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+				intel,offset-settings = <0x00000000

0x0ffe0101 0x0ffe0101>;

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +6 -0
+				bootph-all;
+			};
+
+			noc_fw_tcu_tcu_scr@ffd21400 {
+				reg = <0xffd21400 0x00000004>;
+				/* Disable DMA ECC security access, for

SMMU use */

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +1 -0
+				intel,offset-settings = <0x00000000

0x01010001 0x01010001>;

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +7 -0
+				bootph-all;
+			};
+
+			noc_fw_priv_MemoryMap_priv@ffd24800 {
+				reg = <0xffd24800 0x0000000c>;
+				intel,offset-settings =
+					/* Enable non-prviledged access to

various periphs */

arch/arm/dts/socfpga_soc64_u-boot.dtsi new file +6 -0
+					<0x00000000 0xfff73ffb 0xfff73ffb>;
+				bootph-all;
+			};
+		};
+	};
+};
arch/arm/dts/socfpga_stratix10.dtsi +0 -0
old mode 100755
new mode 100644
arch/arm/dts/socfpga_stratix10_socdk-u-boot.dtsi +0 -0
Quoted 8 lines
Quoted 8 lines

old mode 100755
new mode 100644

arch/arm/dts/socfpga_stratix10_socdk.dts +0 -1
old mode 100755
new mode 100644
--

2.26.2

The fix is to solve checkpatch issue. Will submit S10 separately.

#7 lore raw

PATCH 3/17 arch: arm: mach-socfpga: add new platform agilex5 mach-socfpga enablement

In reply to Jit Loon Lim

This is for new platform enablement for agilex5.
Add platform related files to enable new product.

---
 arch/arm/mach-socfpga/Kconfig                 |  37 +++
 arch/arm/mach-socfpga/Makefile                |  69 ++++-
 arch/arm/mach-socfpga/board.c                 |  65 ++++-
 arch/arm/mach-socfpga/clock_manager_agilex5.c |  82 ++++++
 arch/arm/mach-socfpga/firewall.c              | 107 -------
 arch/arm/mach-socfpga/lowlevel_init_agilex5.S |  61 ++++
 arch/arm/mach-socfpga/lowlevel_init_soc64.S   | 167 ++++++++++-
 arch/arm/mach-socfpga/mailbox_s10.c           |  21 ++
 arch/arm/mach-socfpga/misc.c                  |  19 +-
 arch/arm/mach-socfpga/misc_soc64.c            |  33 ++-
 arch/arm/mach-socfpga/mmu-arm64_s10.c         |  43 ++-
 arch/arm/mach-socfpga/reset_manager_s10.c     | 271 +++++++++++++++---
 arch/arm/mach-socfpga/secure_reg_helper.c     |   4 +-
 arch/arm/mach-socfpga/smmu_agilex5.c          |  34 +++
 arch/arm/mach-socfpga/smmu_s10.c              | 126 ++++++++
 arch/arm/mach-socfpga/spl_agilex5.c           | 180 ++++++++++++
 arch/arm/mach-socfpga/spl_soc64.c             | 188 +++++++++++-
 arch/arm/mach-socfpga/u-boot-spl-soc64.lds    |  93 ++++++
 arch/arm/mach-socfpga/wrap_handoff_soc64.c    |   7 +-
 19 files changed, 1429 insertions(+), 178 deletions(-)
 create mode 100644 arch/arm/mach-socfpga/clock_manager_agilex5.c
 delete mode 100644 arch/arm/mach-socfpga/firewall.c
 create mode 100644 arch/arm/mach-socfpga/lowlevel_init_agilex5.S
 create mode 100644 arch/arm/mach-socfpga/smmu_agilex5.c
 create mode 100644 arch/arm/mach-socfpga/smmu_s10.c
 create mode 100644 arch/arm/mach-socfpga/spl_agilex5.c
 create mode 100644 arch/arm/mach-socfpga/u-boot-spl-soc64.lds
arch/arm/mach-socfpga/Kconfig +37 -0
index 503c82d388..562c3796ec 100644
@@ -44,6 +44,15 @@ config TEXT_BASE
 	default 0x01000040 if TARGET_SOCFPGA_ARRIA10
 	default 0x01000040 if TARGET_SOCFPGA_GEN5
 
+config ARMV8_PSCI_NR_CPUS
+	default 4 if TARGET_SOCFPGA_SOC64
+
+config ARMV8_SECURE_BASE
+	default 0x00001000 if TARGET_SOCFPGA_SOC64 && ARMV8_PSCI
+
+config SYS_HAS_ARMV8_SECURE_BASE
+	default y if TARGET_SOCFPGA_SOC64 && ARMV8_PSCI
+
 config TARGET_SOCFPGA_AGILEX
 	bool
 	select ARMV8_MULTIENTRY
@@ -51,10 +60,31 @@ config TARGET_SOCFPGA_AGILEX
 	select BINMAN if SPL_ATF
 	select CLK
 	select FPGA_INTEL_SDM_MAILBOX
+	select GICV2
+	select NCORE_CACHE
+	select SPL_CLK if SPL
+	select TARGET_SOCFPGA_SOC64
+
+config TARGET_SOCFPGA_AGILEX5
+	bool
+	select BINMAN if SPL_ATF
+	select CLK
+	select FPGA_INTEL_SDM_MAILBOX
+	select GICV3
 	select NCORE_CACHE
 	select SPL_CLK if SPL
 	select TARGET_SOCFPGA_SOC64
 
+config TARGET_SOCFPGA_AGILEX5_EMU
+	bool "Enable build that bootable only on Agilex5 Emulator"
+	help
+	 This is to use for Agilex5 Emulator.
+
+config TARGET_SOCFPGA_AGILEX5_SIMICS
+	bool "Enable build that bootable only on Agilex5 Simics platform"
+	help
+	 This is to use for Agilex5 Simics.
+
 config TARGET_SOCFPGA_ARRIA5
 	bool
 	select TARGET_SOCFPGA_GEN5
@@ -126,6 +156,10 @@ config TARGET_SOCFPGA_AGILEX_SOCDK
 	bool "Intel SOCFPGA SoCDK (Agilex)"
 	select TARGET_SOCFPGA_AGILEX
 
+config TARGET_SOCFPGA_AGILEX5_SOCDK
+	bool "Intel SOCFPGA SoCDK (Agilex5)"
+	select TARGET_SOCFPGA_AGILEX5
+
 config TARGET_SOCFPGA_ARIES_MCVEVK
 	bool "Aries MCVEVK (Cyclone V)"
 	select TARGET_SOCFPGA_CYCLONE5
@@ -199,6 +233,7 @@ config TARGET_SOCFPGA_TERASIC_SOCKIT
 endchoice
 
 config SYS_BOARD
+	default "agilex5-socdk" if TARGET_SOCFPGA_AGILEX5_SOCDK
 	default "agilex-socdk" if TARGET_SOCFPGA_AGILEX_SOCDK
 	default "arria5-socdk" if TARGET_SOCFPGA_ARRIA5_SOCDK
 	default "arria10-socdk" if TARGET_SOCFPGA_ARRIA10_SOCDK
@@ -220,6 +255,7 @@ config SYS_BOARD
 	default "vining_fpga" if TARGET_SOCFPGA_SOFTING_VINING_FPGA
 
 config SYS_VENDOR
+	default "intel" if TARGET_SOCFPGA_AGILEX5_SOCDK
 	default "intel" if TARGET_SOCFPGA_AGILEX_SOCDK
 	default "intel" if TARGET_SOCFPGA_N5X_SOCDK
 	default "altera" if TARGET_SOCFPGA_ARRIA5_SOCDK
@@ -242,6 +278,7 @@ config SYS_SOC
 	default "socfpga"
 
 config SYS_CONFIG_NAME
+	default "socfpga_agilex5_socdk" if TARGET_SOCFPGA_AGILEX5_SOCDK
 	default "socfpga_agilex_socdk" if TARGET_SOCFPGA_AGILEX_SOCDK
 	default "socfpga_arria5_secu1" if TARGET_SOCFPGA_ARRIA5_SECU1
 	default "socfpga_arria5_socdk" if TARGET_SOCFPGA_ARRIA5_SOCDK
arch/arm/mach-socfpga/Makefile +65 -4

118 lines not on this page · raw message

arch/arm/mach-socfpga/board.c +58 -7

113 lines not on this page · raw message

arch/arm/mach-socfpga/clock_manager_agilex5.c new file +82 -0

82 lines not on this page · raw message

arch/arm/mach-socfpga/firewall.c deleted +0 -107

107 lines not on this page · raw message

arch/arm/mach-socfpga/lowlevel_init_agilex5.S new file +61 -0

61 lines not on this page · raw message

arch/arm/mach-socfpga/lowlevel_init_soc64.S +164 -3

200 lines not on this page · raw message

arch/arm/mach-socfpga/mailbox_s10.c +21 -0
index 101af23855..7846596c17 100644
@@ -7,7 +7,9 @@
 #include <common.h>
 #include <asm/arch/clock_manager.h>
 #include <asm/arch/mailbox_s10.h>
+#include <asm/arch/smc_api.h>
 #include <asm/arch/system_manager.h>
+#include <asm/arch/timer.h>
 #include <asm/global_data.h>
 #include <asm/io.h>
 #include <asm/secure.h>
@@ -454,6 +456,14 @@ static __always_inline int mbox_get_fpga_config_status_common(u32 cmd)
 	return MBOX_CFGSTAT_STATE_CONFIG;
 }
 
+#ifdef CONFIG_ARMV8_PSCI
+int  __secure mbox_hps_stage_notify_psci(u32 execution_stage)
+{
+	return mbox_send_cmd_psci(MBOX_ID_UBOOT, MBOX_HPS_STAGE_NOTIFY,
+			     MBOX_CMD_DIRECT, 1, &execution_stage, 0, 0, NULL);
+}
+#endif
+
 int mbox_get_fpga_config_status(u32 cmd)
 {
 	return mbox_get_fpga_config_status_common(cmd);
@@ -479,6 +489,17 @@ int __secure mbox_send_cmd_psci(u8 id, u32 cmd, u8 is_indirect, u32 len,
 					  urgent, resp_buf_len, resp_buf);
 }
 
+int mbox_hps_stage_notify(u32 execution_stage)
+{
+#if !defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_ATF)
+	return smc_send_mailbox(MBOX_HPS_STAGE_NOTIFY, 1, &execution_stage,
+				0, 0, NULL);
+#else
+	return mbox_send_cmd(MBOX_ID_UBOOT, MBOX_HPS_STAGE_NOTIFY,
+			     MBOX_CMD_DIRECT, 1, &execution_stage, 0, 0, NULL);
+#endif
+}
+
 int mbox_send_cmd_only(u8 id, u32 cmd, u8 is_indirect, u32 len, u32 *arg)
 {
 	return mbox_send_cmd_only_common(id, cmd, is_indirect, len, arg);
arch/arm/mach-socfpga/misc.c +13 -6
index 5b5a81a255..024b714ecb 100644
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
- *  Copyright (C) 2012-2017 Altera Corporation <www.altera.com>
+ *  Copyright (C) 2012-2023 Altera Corporation <www.altera.com>
  */
 
 #include <common.h>
@@ -34,7 +34,7 @@ phys_addr_t socfpga_sysmgr_base __section(".data");
 
 #ifdef CONFIG_SYS_L2_PL310
 static const struct pl310_regs *const pl310 =
-	(struct pl310_regs *)CFG_SYS_PL310_BASE;
+	(struct pl310_regs *)CONFIG_SYS_PL310_BASE;
 #endif
 
 struct bsel bsel_str[] = {
@@ -164,7 +164,10 @@ int arch_cpu_init(void)
 	 * timeout value is still active which might too short for Linux
 	 * booting.
 	 */
+#if !(IS_ENABLED(CONFIG_TARGET_SOCFPGA_AGILEX5_SIMICS) || \
+IS_ENABLED(CONFIG_TARGET_SOCFPGA_AGILEX5_EMU))
 	hw_watchdog_init();
+#endif
 #else
 	/*
 	 * If the HW watchdog is NOT enabled, make sure it is not running,
@@ -208,10 +211,11 @@ static int do_bridge(struct cmd_tbl *cmdtp, int flag, int argc,
 }
 
 U_BOOT_CMD(bridge, 3, 1, do_bridge,
-	   "SoCFPGA HPS FPGA bridge control",
-	   "enable [mask] - Enable HPS-to-FPGA, FPGA-to-HPS, LWHPS-to-FPGA bridges\n"
-	   "bridge disable [mask] - Enable HPS-to-FPGA, FPGA-to-HPS, LWHPS-to-FPGA bridges\n"
-	   ""
+	"SoCFPGA HPS FPGA bridge control",
+	"enable [mask] - Enable HPS-to-FPGA (Bit 0), LWHPS-to-FPGA (Bit 1), FPGA-to-HPS (Bit 2), F2SDRAM0 (Bit 3), F2SDRAM1 (Bit 4), F2SDRAM2 (Bit 5) bridges \n"
+	"bridge disable [mask] - Disable HPS-to-FPGA (Bit 0), LWHPS-to-FPGA (Bit 1), FPGA-to-HPS (Bit 2), F2SDRAM0 (Bit 3), F2SDRAM1 (Bit 4), F2SDRAM2 (Bit 5) bridges\n"
+	"Bit 3, Bit 4 and Bit 5 bridges only available in Stratix 10\n"
+	""
 );
 
 #endif
@@ -257,6 +261,9 @@ void socfpga_get_managers_addr(void)
 #elif IS_ENABLED(CONFIG_TARGET_SOCFPGA_N5X)
 	ret = socfpga_get_base_addr("intel,n5x-clkmgr",
 				    &socfpga_clkmgr_base);
+#elif IS_ENABLED(CONFIG_TARGET_SOCFPGA_AGILEX5)
+	ret = socfpga_get_base_addr("intel,agilex5-clkmgr",
+				    &socfpga_clkmgr_base);
 #else
 	ret = socfpga_get_base_addr("altr,clk-mgr", &socfpga_clkmgr_base);
 #endif
arch/arm/mach-socfpga/misc_soc64.c +30 -3
index 2acdfad07b..7dd6f834e1 100644
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0
 /*
- * Copyright (C) 2016-2018 Intel Corporation <www.intel.com>
+ * Copyright (C) 2016-2023 Intel Corporation <www.intel.com>
  *
  */
 
@@ -18,8 +18,12 @@
 #include <log.h>
 #include <mach/clock_manager.h>
 
+#define RSU_DEFAULT_LOG_LEVEL  7
+
 DECLARE_GLOBAL_DATA_PTR;
 
+u8 socfpga_get_board_id(void);
+
 /*
  * FPGA programming support for SoC FPGA Stratix 10
  */
@@ -47,8 +51,11 @@ static Altera_desc altera_fpga[] = {
 #if defined(CONFIG_DISPLAY_CPUINFO)
 int print_cpuinfo(void)
 {
+#if IS_ENABLED(CONFIG_TARGET_SOCFPGA_AGILEX5)
+	puts("CPU:   Intel FPGA SoCFPGA Platform (ARMv8 64bit Cortex-A55/A76)\n");
+#else
 	puts("CPU:   Intel FPGA SoCFPGA Platform (ARMv8 64bit Cortex-A53)\n");
-
+#endif
 	return 0;
 }
 #endif
@@ -56,11 +63,26 @@ int print_cpuinfo(void)
 #ifdef CONFIG_ARCH_MISC_INIT
 int arch_misc_init(void)
 {
+#if !(IS_ENABLED(CONFIG_TARGET_SOCFPGA_AGILEX5_SIMICS) || \
+IS_ENABLED(CONFIG_TARGET_SOCFPGA_AGILEX5_EMU))
 	char qspi_string[13];
+	char level[4];
+	char id[3];
+
+	snprintf(level, sizeof(level), "%u", RSU_DEFAULT_LOG_LEVEL);
 
 	sprintf(qspi_string, "<0x%08x>", cm_get_qspi_controller_clk_hz());
 	env_set("qspi_clock", qspi_string);
 
+	/* for RSU, set log level to default if log level is not set */
+	if (!env_get("rsu_log_level"))
+		env_set("rsu_log_level", level);
+
+	/* Export board_id as environment variable */
+	sprintf(id, "%u", socfpga_get_board_id());
+	env_set("board_id", id);
+#endif
+
 	return 0;
 }
 #endif
@@ -87,5 +109,10 @@ void do_bridge_reset(int enable, unsigned int mask)
 		return;
 	}
 
-	socfpga_bridges_reset(enable);
+	socfpga_bridges_reset(enable, mask);
+}
+
+void arch_preboot_os(void)
+{
+	mbox_hps_stage_notify(HPS_EXECUTION_STATE_OS);
 }
arch/arm/mach-socfpga/mmu-arm64_s10.c +42 -1

57 lines not on this page · raw message

arch/arm/mach-socfpga/reset_manager_s10.c +231 -40

326 lines not on this page · raw message

arch/arm/mach-socfpga/secure_reg_helper.c +3 -1
index 0d4f45f33d..23595d242a 100644
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0
 /*
- * Copyright (C) 2020 Intel Corporation <www.intel.com>
+ * Copyright (C) 2020-2022 Intel Corporation <www.intel.com>
  *
  */
 
@@ -18,9 +18,11 @@
 int socfpga_secure_convert_reg_id_to_addr(u32 id, phys_addr_t *reg_addr)
 {
 	switch (id) {
+#if !IS_ENABLED(CONFIG_TARGET_SOCFPGA_AGILEX5)
 	case SOCFPGA_SECURE_REG_SYSMGR_SOC64_SDMMC:
 		*reg_addr = socfpga_get_sysmgr_addr() + SYSMGR_SOC64_SDMMC;
 		break;
+#endif
 	case SOCFPGA_SECURE_REG_SYSMGR_SOC64_EMAC0:
 		*reg_addr = socfpga_get_sysmgr_addr() + SYSMGR_SOC64_EMAC0;
 		break;
arch/arm/mach-socfpga/smmu_agilex5.c new file +34 -0
new file mode 100644
index 0000000000..05e74926aa
@@ -0,0 +1,34 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (C) 2023 Intel Corporation. All rights reserved
+ *
+ */
+
+#include <common.h>
+#include <asm/global_data.h>
+#include <asm/io.h>
+#include <asm/arch/firewall.h>
+#include <asm/arch/smmu_agilex5.h>
+#include <asm/arch/system_manager.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+static inline void setup_smmu_firewall(void)
+{
+	u32 i;
+
+	/* Off the DDR secure transaction for all TBU supported peripherals */
+	for (i = SYSMGR_DMA0_SID_ADDR; i < SYSMGR_TSN2_SID_ADDR; i +=
+	     SOCFPGA_NEXT_TBU_PERIPHERAL) {
+		/* skip this, future use register */
+		if (i == SYSMGR_USB3_SID_ADDR)
+			continue;
+
+		writel(SECURE_TRANS_RESET, (uintptr_t)i);
+	}
+}
+
+void socfpga_init_smmu(void)
+{
+	setup_smmu_firewall();
+}
arch/arm/mach-socfpga/smmu_s10.c new file +126 -0

126 lines not on this page · raw message

arch/arm/mach-socfpga/spl_agilex5.c new file +180 -0

180 lines not on this page · raw message

arch/arm/mach-socfpga/spl_soc64.c +183 -5

208 lines not on this page · raw message

arch/arm/mach-socfpga/u-boot-spl-soc64.lds new file +93 -0

93 lines not on this page · raw message

arch/arm/mach-socfpga/wrap_handoff_soc64.c +6 -1
index e7cb5ea89c..23434dbf6c 100644
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0
 /*
- * Copyright (C) 2020-2021 Intel Corporation <www.intel.com>
+ * Copyright (C) 2020-2022 Intel Corporation <www.intel.com>
  *
  */
 
@@ -19,7 +19,12 @@ static enum endianness check_endianness(u32 handoff)
 	case SOC64_HANDOFF_MAGIC_FPGA:
 	case SOC64_HANDOFF_MAGIC_DELAY:
 	case SOC64_HANDOFF_MAGIC_CLOCK:
+#if IS_ENABLED(CONFIG_TARGET_SOCFPGA_AGILEX5)
+	case SOC64_HANDOFF_MAGIC_PERI:
+	case SOC64_HANDOFF_MAGIC_SDRAM:
+#else
 	case SOC64_HANDOFF_MAGIC_MISC:
+#endif
 		return BIG_ENDIAN;
 #if IS_ENABLED(CONFIG_TARGET_SOCFPGA_N5X)
 	case SOC64_HANDOFF_DDR_UMCTL2_MAGIC:
Signature · 1 line
2.26.2
#8 lore raw

RE: [PATCH v1 03/17] arch: arm: mach-socfpga: add new platform agilex5 mach-socfpga enablement

Hi Jit Loon,

Quoted 17 lines

-----Original Message-----
From: Lim, Jit Loon <[email protected]>
Sent: Wednesday, 21 June, 2023 11:16 AM
To: [email protected]
Cc: Jagan Teki <[email protected]>; Vignesh R <[email protected]>; Vasut, Marek <[email protected]>; Simon <[email protected]>; Chee, Tien Fong <[email protected]>; Hea, Kok Kiang <[email protected]>; Lokanathan, Raaj <[email protected]>; Maniyam, Dinesh <[email protected]>; Ng, Boon Khai <[email protected]>; Yuslaimi, Alif Zakuan <[email protected]>; Chong, Teik Heng <[email protected]>; Zamri, Muhammad Hazim Izzat <[email protected]>; Lim, Jit Loon <[email protected]>; Tang, Sieu Mun <[email protected]>
Subject: [PATCH v1 03/17] arch: arm: mach-socfpga: add new platform agilex5 mach-socfpga enablement

Quoted 2 lines

This is for new platform enablement for agilex5.
Add platform related files to enable new product.

You should not squash all IP drivers such as clock manager, reset manager into one patch, this is not the right way to generate the patch, very hard for me to review the codes.

Quoted 137 lines
---
 arch/arm/mach-socfpga/Kconfig                 |  37 +++
 arch/arm/mach-socfpga/Makefile                |  69 ++++-
 arch/arm/mach-socfpga/board.c                 |  65 ++++-
 arch/arm/mach-socfpga/clock_manager_agilex5.c |  82 ++++++
 arch/arm/mach-socfpga/firewall.c              | 107 -------
 arch/arm/mach-socfpga/lowlevel_init_agilex5.S |  61 ++++
 arch/arm/mach-socfpga/lowlevel_init_soc64.S   | 167 ++++++++++-
 arch/arm/mach-socfpga/mailbox_s10.c           |  21 ++
 arch/arm/mach-socfpga/misc.c                  |  19 +-
 arch/arm/mach-socfpga/misc_soc64.c            |  33 ++-
 arch/arm/mach-socfpga/mmu-arm64_s10.c         |  43 ++-
 arch/arm/mach-socfpga/reset_manager_s10.c     | 271 +++++++++++++++--
(quoted diff) +0 -1
-
 arch/arm/mach-socfpga/secure_reg_helper.c     |   4 +-
 arch/arm/mach-socfpga/smmu_agilex5.c          |  34 +++
 arch/arm/mach-socfpga/smmu_s10.c              | 126 ++++++++
 arch/arm/mach-socfpga/spl_agilex5.c           | 180 ++++++++++++
 arch/arm/mach-socfpga/spl_soc64.c             | 188 +++++++++++-
 arch/arm/mach-socfpga/u-boot-spl-soc64.lds    |  93 ++++++
 arch/arm/mach-socfpga/wrap_handoff_soc64.c    |   7 +-
 19 files changed, 1429 insertions(+), 178 deletions(-)
 create mode 100644 arch/arm/mach-socfpga/clock_manager_agilex5.c
 delete mode 100644 arch/arm/mach-socfpga/firewall.c
 create mode 100644 arch/arm/mach-socfpga/lowlevel_init_agilex5.S
 create mode 100644 arch/arm/mach-socfpga/smmu_agilex5.c
 create mode 100644 arch/arm/mach-socfpga/smmu_s10.c
 create mode 100644 arch/arm/mach-socfpga/spl_agilex5.c
 create mode 100644 arch/arm/mach-socfpga/u-boot-spl-soc64.lds
arch/arm/mach- renamed from arch/arm/mach-socfpga/Kconfig +0 -0

socfpga/Kconfig
index 503c82d388..562c3796ec 100644

arch/arm/mach-socfpga/Kconfig +37 -0
@@ -44,6 +44,15 @@ config TEXT_BASE
 	default 0x01000040 if TARGET_SOCFPGA_ARRIA10
 	default 0x01000040 if TARGET_SOCFPGA_GEN5
 
+config ARMV8_PSCI_NR_CPUS
+	default 4 if TARGET_SOCFPGA_SOC64
+
+config ARMV8_SECURE_BASE
+	default 0x00001000 if TARGET_SOCFPGA_SOC64 && ARMV8_PSCI
+
+config SYS_HAS_ARMV8_SECURE_BASE
+	default y if TARGET_SOCFPGA_SOC64 && ARMV8_PSCI
+
 config TARGET_SOCFPGA_AGILEX
 	bool
 	select ARMV8_MULTIENTRY
@@ -51,10 +60,31 @@ config TARGET_SOCFPGA_AGILEX
 	select BINMAN if SPL_ATF
 	select CLK
 	select FPGA_INTEL_SDM_MAILBOX
+	select GICV2
+	select NCORE_CACHE
+	select SPL_CLK if SPL
+	select TARGET_SOCFPGA_SOC64
+
+config TARGET_SOCFPGA_AGILEX5
+	bool
+	select BINMAN if SPL_ATF
+	select CLK
+	select FPGA_INTEL_SDM_MAILBOX
+	select GICV3
 	select NCORE_CACHE
 	select SPL_CLK if SPL
 	select TARGET_SOCFPGA_SOC64
 
+config TARGET_SOCFPGA_AGILEX5_EMU
+	bool "Enable build that bootable only on Agilex5 Emulator"
+	help
+	 This is to use for Agilex5 Emulator.
+
+config TARGET_SOCFPGA_AGILEX5_SIMICS
+	bool "Enable build that bootable only on Agilex5 Simics platform"
+	help
+	 This is to use for Agilex5 Simics.
+
 config TARGET_SOCFPGA_ARRIA5
 	bool
 	select TARGET_SOCFPGA_GEN5
@@ -126,6 +156,10 @@ config TARGET_SOCFPGA_AGILEX_SOCDK
 	bool "Intel SOCFPGA SoCDK (Agilex)"
 	select TARGET_SOCFPGA_AGILEX
 
+config TARGET_SOCFPGA_AGILEX5_SOCDK
+	bool "Intel SOCFPGA SoCDK (Agilex5)"
+	select TARGET_SOCFPGA_AGILEX5
+
 config TARGET_SOCFPGA_ARIES_MCVEVK
 	bool "Aries MCVEVK (Cyclone V)"
 	select TARGET_SOCFPGA_CYCLONE5
@@ -199,6 +233,7 @@ config TARGET_SOCFPGA_TERASIC_SOCKIT
 endchoice
 
 config SYS_BOARD
+	default "agilex5-socdk" if TARGET_SOCFPGA_AGILEX5_SOCDK
 	default "agilex-socdk" if TARGET_SOCFPGA_AGILEX_SOCDK
 	default "arria5-socdk" if TARGET_SOCFPGA_ARRIA5_SOCDK
 	default "arria10-socdk" if TARGET_SOCFPGA_ARRIA10_SOCDK
@@ -220,6 +255,7 @@ config SYS_BOARD
 	default "vining_fpga" if TARGET_SOCFPGA_SOFTING_VINING_FPGA
 
 config SYS_VENDOR
+	default "intel" if TARGET_SOCFPGA_AGILEX5_SOCDK
 	default "intel" if TARGET_SOCFPGA_AGILEX_SOCDK
 	default "intel" if TARGET_SOCFPGA_N5X_SOCDK
 	default "altera" if TARGET_SOCFPGA_ARRIA5_SOCDK
@@ -242,6 +278,7 @@ config SYS_SOC
 	default "socfpga"
 
 config SYS_CONFIG_NAME
+	default "socfpga_agilex5_socdk" if

TARGET_SOCFPGA_AGILEX5_SOCDK
default "socfpga_agilex_socdk" if
TARGET_SOCFPGA_AGILEX_SOCDK

arch/arm/mach-socfpga/Kconfig +0 -0
 	default "socfpga_arria5_secu1" if TARGET_SOCFPGA_ARRIA5_SECU1
 	default "socfpga_arria5_socdk" if

TARGET_SOCFPGA_ARRIA5_SOCDK

arch/arm/mach- renamed from arch/arm/mach-socfpga/Makefile +0 -0

socfpga/Makefile
index ec38b64dd4..771e7ce77d 100644

arch/arm/mach-socfpga/Makefile +1 -0
@@ -35,10 +35,22 @@ obj-y	+= mailbox_s10.o
 obj-y	+= misc_soc64.o
 obj-y	+= mmu-arm64_s10.o
 obj-y	+= reset_manager_s10.o
+obj-y	+= smmu_s10.o
 obj-y	+= system_manager_soc64.o
 obj-y	+= timer_s10.o
 obj-y	+= wrap_handoff_soc64.o
 obj-y	+= wrap_pll_config_soc64.o

arch/arm/mach-socfpga/Makefile obj-y += mailbox_s10.o · line 52

Quoted 10 lines
arch/arm/mach-socfpga/Makefile +10 -0
+ifndef CONFIG_SPL_BUILD
+obj-y   += rsu.o
+obj-y   += rsu_ll_qspi.o
+obj-y   += rsu_misc.o
+obj-y	+= rsu_s10.o
+obj-$(CONFIG_ARMV8_PSCI) += psci.o
+obj-$(CONFIG_ARMV8_PSCI) += smc_ecc_dbe_s10.o
+obj-$(CONFIG_ARMV8_PSCI) += smc_fpga_reconfig_s10.o
+obj-$(CONFIG_ARMV8_PSCI) += smc_registers_s10.o
+obj-$(CONFIG_ARMV8_PSCI) += smc_rsu_s10.o

There are no rsu, smc and including secreg drivers in mainline yet, you have to upstream these drivers first or excluding these drivers related in this series. You can submit separate patches for these changes once these drivers are available in mainline.

Quoted 1,669 lines
arch/arm/mach-socfpga/Makefile +54 -4
+endif
 endif
 
 ifdef CONFIG_TARGET_SOCFPGA_AGILEX
@@ -49,11 +61,46 @@ obj-y	+= misc_soc64.o
 obj-y	+= mmu-arm64_s10.o
 obj-y	+= reset_manager_s10.o
 obj-$(CONFIG_SOCFPGA_SECURE_VAB_AUTH)	+= secure_vab.o
+obj-y	+= smmu_s10.o
 obj-y	+= system_manager_soc64.o
 obj-y	+= timer_s10.o
 obj-$(CONFIG_SOCFPGA_SECURE_VAB_AUTH)	+= vab.o
 obj-y	+= wrap_handoff_soc64.o
 obj-y	+= wrap_pll_config_soc64.o
+ifndef CONFIG_SPL_BUILD
+obj-y   += rsu.o
+obj-y   += rsu_ll_qspi.o
+obj-y   += rsu_misc.o
+obj-y	+= rsu_s10.o
+obj-$(CONFIG_ARMV8_PSCI) += psci.o
+obj-$(CONFIG_ARMV8_PSCI) += smc_ecc_dbe_s10.o
+obj-$(CONFIG_ARMV8_PSCI) += smc_fpga_reconfig_s10.o
+obj-$(CONFIG_ARMV8_PSCI) += smc_registers_s10.o
+obj-$(CONFIG_ARMV8_PSCI) += smc_rsu_s10.o
+endif
+endif
+
+ifdef CONFIG_TARGET_SOCFPGA_AGILEX5
+obj-y	+= clock_manager_agilex5.o
+obj-y	+= lowlevel_init_agilex5.o
+obj-y	+= mailbox_s10.o
+obj-y	+= misc_soc64.o
+obj-y	+= mmu-arm64_s10.o
+obj-y	+= reset_manager_s10.o
+obj-$(CONFIG_SOCFPGA_SECURE_VAB_AUTH)	+= secure_vab.o
+obj-y	+= smmu_agilex5.o
+obj-y	+= system_manager_soc64.o
+obj-y	+= timer_s10.o
+obj-$(CONFIG_SOCFPGA_SECURE_VAB_AUTH)	+= vab.o
+obj-y	+= wrap_handoff_soc64.o
+obj-y	+= wrap_pll_config_soc64.o
+ifndef CONFIG_SPL_BUILD
+obj-$(CONFIG_ARMV8_PSCI) += psci.o
+obj-$(CONFIG_ARMV8_PSCI) += smc_ecc_dbe_s10.o
+obj-$(CONFIG_ARMV8_PSCI) += smc_fpga_reconfig_s10.o
+obj-$(CONFIG_ARMV8_PSCI) += smc_registers_s10.o
+obj-$(CONFIG_ARMV8_PSCI) += smc_rsu_s10.o
+endif
 endif
 
 ifdef CONFIG_TARGET_SOCFPGA_N5X
@@ -64,11 +111,22 @@ obj-y	+= misc_soc64.o
 obj-y	+= mmu-arm64_s10.o
 obj-y	+= reset_manager_s10.o
 obj-$(CONFIG_SOCFPGA_SECURE_VAB_AUTH)	+= secure_vab.o
+obj-y	+= smmu_s10.o
 obj-y	+= system_manager_soc64.o
 obj-y	+= timer_s10.o
 obj-$(CONFIG_SOCFPGA_SECURE_VAB_AUTH)	+= vab.o
 obj-y	+= wrap_handoff_soc64.o
 obj-y	+= wrap_pll_config_soc64.o
+ifndef CONFIG_SPL_BUILD
+obj-y   += rsu.o
+obj-y   += rsu_ll_qspi.o
+obj-y   += rsu_misc.o
+obj-y	+= rsu_s10.o
+obj-$(CONFIG_ARMV8_PSCI) += psci.o
+obj-$(CONFIG_ARMV8_PSCI) += smc_ecc_dbe_s10.o
+obj-$(CONFIG_ARMV8_PSCI) += smc_registers_s10.o
+obj-$(CONFIG_ARMV8_PSCI) += smc_rsu_s10.o
+endif
 endif
 
 ifdef CONFIG_SPL_BUILD
@@ -79,21 +137,24 @@ obj-y	+= wrap_iocsr_config.o
 obj-y	+= wrap_pinmux_config.o
 obj-y	+= wrap_sdram_config.o
 endif
-ifdef CONFIG_TARGET_SOCFPGA_SOC64
-obj-y	+= firewall.o
-obj-y	+= spl_soc64.o
-endif
 ifdef CONFIG_TARGET_SOCFPGA_ARRIA10
 obj-y	+= spl_a10.o
 endif
 ifdef CONFIG_TARGET_SOCFPGA_STRATIX10
 obj-y	+= spl_s10.o
+obj-y	+= spl_soc64.o
 endif
 ifdef CONFIG_TARGET_SOCFPGA_AGILEX
 obj-y	+= spl_agilex.o
+obj-y	+= spl_soc64.o
 endif
 ifdef CONFIG_TARGET_SOCFPGA_N5X
 obj-y	+= spl_n5x.o
+obj-y	+= spl_soc64.o
+endif
+ifdef CONFIG_TARGET_SOCFPGA_AGILEX5
+obj-y	+= spl_agilex5.o
+obj-y	+= spl_soc64.o
 endif
 else
 obj-$(CONFIG_SPL_ATF) += secure_reg_helper.o
arch/arm/mach- renamed from arch/arm/mach-socfpga/board.c +0 -0

socfpga/board.c
index 09e09192fb..140a520ab7 100644

arch/arm/mach-socfpga/board.c +45 -6
@@ -7,9 +7,11 @@
 
 #include <common.h>
 #include <asm/arch/clock_manager.h>
+#include <asm/arch/mailbox_s10.h>
 #include <asm/arch/misc.h>
 #include <asm/arch/reset_manager.h>
 #include <asm/arch/secure_vab.h>
+#include <asm/arch/smc_api.h>
 #include <asm/global_data.h>
 #include <asm/io.h>
 #include <errno.h>
@@ -23,6 +25,8 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
+#define DEFAULT_JTAG_USERCODE 0xFFFFFFFF
+
 void s_init(void) {
 #ifndef CONFIG_ARM64
 	/*
@@ -46,7 +50,7 @@ void s_init(void) {
 int board_init(void)
 {
 	/* Address of boot parameters for ATAG (if ATAG is used) */
-	gd->bd->bi_boot_params = CFG_SYS_SDRAM_BASE + 0x100;
+	gd->bd->bi_boot_params = CONFIG_SYS_SDRAM_BASE + 0x100;
 
 	return 0;
 }
@@ -92,13 +96,55 @@ int g_dnl_board_usb_cable_connected(void)
 }
 #endif
 
-#ifdef CONFIG_SPL_BUILD
-__weak int board_fit_config_name_match(const char *name)
+u8 socfpga_get_board_id(void)
 {
-	/* Just empty function now - can't decide what to choose */
-	debug("%s: %s\n", __func__, name);
+	u8 board_id = 0;
+	u32 jtag_usercode;
+	int err;
 
-	return 0;
+#if !IS_ENABLED(CONFIG_SPL_BUILD) && IS_ENABLED(CONFIG_SPL_ATF)
+	err = smc_get_usercode(&jtag_usercode);
+#else
+	u32 resp_len = 1;
+
+	err = mbox_send_cmd(MBOX_ID_UBOOT, MBOX_GET_USERCODE,
 MBOX_CMD_DIRECT, 0,
+			    NULL, 0, &resp_len, &jtag_usercode);
+#endif
+
+	if (err) {
+		puts("Fail to read JTAG Usercode. Default Board ID to 0\n");
+		return board_id;
+	}
+
+	debug("Valid JTAG Usercode: %u\n", jtag_usercode);
+
+	if (jtag_usercode == DEFAULT_JTAG_USERCODE) {
+		debug("JTAG Usercode is not set. Default Board ID to 0\n");
+	} else if (jtag_usercode >= 0 && jtag_usercode <= 255) {
+		board_id = jtag_usercode;
+		debug("Valid JTAG Usercode. Set Board ID to %u\n",
 board_id);
+	} else {
+		puts("Board ID is not in range 0 to 255\n");
+	}
+
+	return board_id;
+}
+
+#if IS_ENABLED(CONFIG_SPL_BUILD) &&
 IS_ENABLED(CONFIG_TARGET_SOCFPGA_SOC64)
+int board_fit_config_name_match(const char *name)
+{
+	char board_name[10];
+
+#if IS_ENABLED(CONFIG_TARGET_SOCFPGA_AGILEX5_SIMICS) || \
+IS_ENABLED(CONFIG_TARGET_SOCFPGA_AGILEX5_EMU)
+	sprintf(board_name, "board_%u", 0); /* Hardcoded board ID since

Simics no support */

arch/arm/mach-socfpga/board.c +9 -0
+#else
+	sprintf(board_name, "board_%u", socfpga_get_board_id());
+#endif
+
+	debug("Board name: %s\n", board_name);
+
+	return strcmp(name, board_name);
 }
 #endif
@@ -116,6 +162,8 @@ void board_fit_image_post_process(const void *fit,
 int node, void **p_image,
 #if !IS_ENABLED(CONFIG_SPL_BUILD) && IS_ENABLED(CONFIG_FIT)
 void board_prep_linux(struct bootm_headers *images)
 {
+	bool use_fit = false;
+
 	if (!images->fit_uname_cfg) {
 		if (IS_ENABLED(CONFIG_SOCFPGA_SECURE_VAB_AUTH) &&

!IS_ENABLED(CONFIG_SOCFPGA_SECURE_VAB_AUTH_ALLOW_N
ON_FIT_IMAGE)) {

arch/arm/mach-socfpga/board.c +4 -1
@@ -127,14 +175,17 @@ void board_prep_linux(struct bootm_headers
 *images)
 			hang();
 		}
 	} else {
+		use_fit = true;
 		/* Update fdt_addr in enviroment variable */
 		env_set_hex("fdt_addr", (ulong)images->ft_addr);
 		debug("images->ft_addr = 0x%08lx\n", (ulong)images-
 >ft_addr);
 	}
 
-	if (IS_ENABLED(CONFIG_CADENCE_QSPI)) {
+	if (use_fit && IS_ENABLED(CONFIG_CADENCE_QSPI)) {
 		if (env_get("linux_qspi_enable"))
 			run_command(env_get("linux_qspi_enable"), 0);
+		if (env_get("rsu_status"))
+			run_command(env_get("rsu_status"), 0);
 	}

}
#endif

arch/arm/mach-socfpga/clock_manager_agilex5.c new file +28 -0
new file mode 100644
index 0000000000..46b6bc5d40
@@ -0,0 +1,82 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (C) 2019-2022 Intel Corporation <www.intel.com>
+ *
+ */
+
+#include <clk.h>
+#include <common.h>
+#include <dm.h>
+#include <log.h>
+#include <malloc.h>
+#include <asm/arch/clock_manager.h>
+#include <asm/arch/system_manager.h>
+#include <asm/global_data.h>
+#include <asm/io.h>
+#include <dt-bindings/clock/agilex5-clock.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+static ulong cm_get_rate_dm(u32 id)
+{
+	struct udevice *dev;
+	struct clk clk;
+	ulong rate;
+	int ret;
+
+	ret = uclass_get_device_by_driver(UCLASS_CLK,
+

DM_DRIVER_GET(socfpga_agilex5_clk),

arch/arm/mach-socfpga/clock_manager_agilex5.c new file +54 -0
+					  &dev);
+	if (ret)
+		return 0;
+
+	clk.id = id;
+	ret = clk_request(dev, &clk);
+	if (ret < 0)
+		return 0;
+
+	rate = clk_get_rate(&clk);
+
+	clk_free(&clk);
+
+	if ((rate == (unsigned long)-ENOSYS) ||
+	    (rate == (unsigned long)-ENXIO) ||
+	    (rate == (unsigned long)-EIO)) {
+		debug("%s id %u: clk_get_rate err: %ld\n",
+		      __func__, id, rate);
+		return 0;
+	}
+
+	return rate;
+}
+
+static u32 cm_get_rate_dm_khz(u32 id)
+{
+	return cm_get_rate_dm(id) / 1000;
+}
+
+unsigned long cm_get_mpu_clk_hz(void)
+{
+	return cm_get_rate_dm(AGILEX5_MPU_CLK);
+}
+
+unsigned int cm_get_l4_sys_free_clk_hz(void)
+{
+	return cm_get_rate_dm(AGILEX5_L4_SYS_FREE_CLK);
+}
+
+void cm_print_clock_quick_summary(void)
+{
+	printf("MPU       %10d kHz\n",
+	       cm_get_rate_dm_khz(AGILEX5_MPU_CLK));
+	printf("L4 Main	    %8d kHz\n",
+	       cm_get_rate_dm_khz(AGILEX5_L4_MAIN_CLK));
+	printf("L4 sys free %8d kHz\n",
+	       cm_get_rate_dm_khz(AGILEX5_L4_SYS_FREE_CLK));
+	printf("L4 MP       %8d kHz\n",
+	       cm_get_rate_dm_khz(AGILEX5_L4_MP_CLK));
+	printf("L4 SP       %8d kHz\n",
+	       cm_get_rate_dm_khz(AGILEX5_L4_SP_CLK));
+	printf("SDMMC       %8d kHz\n",
+	       cm_get_rate_dm_khz(AGILEX5_SDMMC_CLK));
+}
arch/arm/mach- renamed from arch/arm/mach-socfpga/firewall.c +0 -0

socfpga/firewall.c
deleted file mode 100644
index 69229dc651..0000000000

arch/arm/mach-socfpga/firewall.c deleted +0 -15
@@ -1,107 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- * Copyright (C) 2016-2019 Intel Corporation <www.intel.com>
- *
- */
-
-#include <asm/io.h>
-#include <common.h>
-#include <asm/arch/firewall.h>
-#include <asm/arch/system_manager.h>
-
-static void firewall_l4_per_disable(void)
-{
-	const struct socfpga_firwall_l4_per *firwall_l4_per_base =
-		(struct socfpga_firwall_l4_per

*)SOCFPGA_FIREWALL_L4_PER;

arch/arm/mach-socfpga/firewall.c deleted +0 -74
-	u32 i;
-	const u32 *addr[] = {
-			&firwall_l4_per_base->nand,
-			&firwall_l4_per_base->nand_data,
-			&firwall_l4_per_base->usb0,
-			&firwall_l4_per_base->usb1,
-			&firwall_l4_per_base->spim0,
-			&firwall_l4_per_base->spim1,
-			&firwall_l4_per_base->emac0,
-			&firwall_l4_per_base->emac1,
-			&firwall_l4_per_base->emac2,
-			&firwall_l4_per_base->sdmmc,
-			&firwall_l4_per_base->gpio0,
-			&firwall_l4_per_base->gpio1,
-			&firwall_l4_per_base->i2c0,
-			&firwall_l4_per_base->i2c1,
-			&firwall_l4_per_base->i2c2,
-			&firwall_l4_per_base->i2c3,
-			&firwall_l4_per_base->i2c4,
-			&firwall_l4_per_base->timer0,
-			&firwall_l4_per_base->timer1,
-			&firwall_l4_per_base->uart0,
-			&firwall_l4_per_base->uart1
-			};
-
-	/*
-	 * The following lines of code will enable non-secure access
-	 * to nand, usb, spi, emac, sdmmc, gpio, i2c, timers and uart. This
-	 * is needed as most OS run in non-secure mode. Thus we need to
-	 * enable non-secure access to these peripherals in order for the
-	 * OS to use these peripherals.
-	 */
-	for (i = 0; i < ARRAY_SIZE(addr); i++)
-		writel(FIREWALL_L4_DISABLE_ALL, addr[i]);
-}
-
-static void firewall_l4_sys_disable(void)
-{
-	const struct socfpga_firwall_l4_sys *firwall_l4_sys_base =
-		(struct socfpga_firwall_l4_sys *)SOCFPGA_FIREWALL_L4_SYS;
-	u32 i;
-	const u32 *addr[] = {
-			&firwall_l4_sys_base->dma_ecc,
-			&firwall_l4_sys_base->emac0rx_ecc,
-			&firwall_l4_sys_base->emac0tx_ecc,
-			&firwall_l4_sys_base->emac1rx_ecc,
-			&firwall_l4_sys_base->emac1tx_ecc,
-			&firwall_l4_sys_base->emac2rx_ecc,
-			&firwall_l4_sys_base->emac2tx_ecc,
-			&firwall_l4_sys_base->nand_ecc,
-			&firwall_l4_sys_base->nand_read_ecc,
-			&firwall_l4_sys_base->nand_write_ecc,
-			&firwall_l4_sys_base->ocram_ecc,
-			&firwall_l4_sys_base->sdmmc_ecc,
-			&firwall_l4_sys_base->usb0_ecc,
-			&firwall_l4_sys_base->usb1_ecc,
-			&firwall_l4_sys_base->clock_manager,
-			&firwall_l4_sys_base->io_manager,
-			&firwall_l4_sys_base->reset_manager,
-			&firwall_l4_sys_base->system_manager,
-			&firwall_l4_sys_base->watchdog0,
-			&firwall_l4_sys_base->watchdog1,
-			&firwall_l4_sys_base->watchdog2,
-			&firwall_l4_sys_base->watchdog3
-		};
-
-	for (i = 0; i < ARRAY_SIZE(addr); i++)
-		writel(FIREWALL_L4_DISABLE_ALL, addr[i]);
-}
-
-static void firewall_bridge_disable(void)
-{
-	/* disable lwsocf2fpga and soc2fpga bridge security */
-	writel(FIREWALL_BRIDGE_DISABLE_ALL,

SOCFPGA_FIREWALL_SOC2FPGA);

arch/arm/mach-socfpga/firewall.c deleted +0 -1
-	writel(FIREWALL_BRIDGE_DISABLE_ALL,

SOCFPGA_FIREWALL_LWSOC2FPGA);

arch/arm/mach-socfpga/firewall.c deleted +0 -17
-}
-
-void firewall_setup(void)
-{
-	firewall_l4_per_disable();
-	firewall_l4_sys_disable();
-	firewall_bridge_disable();
-
-	/* disable SMMU security */
-	writel(FIREWALL_L4_DISABLE_ALL, SOCFPGA_FIREWALL_TCU);
-
-	/* enable non-secure interface to DMA330 DMA and peripherals */
-	writel(SYSMGR_DMA_IRQ_NS | SYSMGR_DMA_MGR_NS,
-	       socfpga_get_sysmgr_addr() + SYSMGR_SOC64_DMA);
-	writel(SYSMGR_DMAPERIPH_ALL_NS,
-	       socfpga_get_sysmgr_addr() + SYSMGR_SOC64_DMA_PERIPH);
-}
arch/arm/mach-socfpga/lowlevel_init_agilex5.S new file +28 -0
new file mode 100644
index 0000000000..15e5066767
@@ -0,0 +1,61 @@
+/* SPDX-License-Identifier: GPL-2.0
+ *
+ * Copyright (C) 2022-2023 Intel Corporation <www.intel.com>
+ *
+ */
+
+#include <asm-offsets.h>
+#include <config.h>
+#include <linux/linkage.h>
+#include <asm/macro.h>
+#include <asm/arch/reset_manager_soc64.h>
+
+#if !defined(CONFIG_SPL_BUILD) && defined(CONFIG_ARMV8_PSCI)
+.align 3
+_el3_exception_vectors:
+	.quad el3_exception_vectors;
+#endif
+
+ENTRY(lowlevel_init)
+	mov	x29, lr			/* Save LR */
+
+#ifdef CONFIG_SPL_BUILD
+	branch_if_slave x0, 3f
+
+	/* Check rstmgr.stat for warm reset status */
+	ldr	w1, =SOCFPGA_RSTMGR_ADDRESS
+	ldr	w0, [x1]
+	/* Check whether any L4 watchdogs or SDM had triggered warm

reset */

arch/arm/mach-socfpga/lowlevel_init_agilex5.S new file +33 -0
+	ldr	x2, =RSTMGR_L4WD_MPU_WARMRESET_MASK
+	ands	x0, x0, x2
+	/*
+	 * If current Reset Manager's status is warm reset just reload the
+	 * .data section by copying the data from data preserve section.
+	 * Otherwise, copy the .data section to the data preserve section to
+	 * keep an original copy of .data section. This ensure SPL is
+	 * reentrant after warm reset.
+	 */
+	b.ne	reload_data_section
+	/* Copy from .data to preserved .data to backup the SPL state */
+	ldr	x0, =__data_start
+	ldr	x1, =__preserve_data_start
+	ldr	x2, =__preserve_data_end
+	b	copy_loop
+reload_data_section:
+	/* Copy from preserved .data to .data to restore the SPL state */
+	ldr	x0, =__preserve_data_start
+	ldr	x1, =__data_start
+	ldr	x2, =__data_end
+copy_loop:
+	ldr	w3, [x0]
+	add	x0, x0, #4
+	str	w3, [x1]
+	add	x1, x1, #4
+	cmp	x1, x2
+	b.ne	copy_loop
+3:
+#endif
+
+	mov	lr, x29			/* Restore LR */
+	ret
+ENDPROC(lowlevel_init)
arch/arm/mach- renamed from arch/arm/mach-socfpga/lowlevel_init_soc64.S +0 -0

socfpga/lowlevel_init_soc64.S
index 875927cc4d..5680553f68 100644

arch/arm/mach-socfpga/lowlevel_init_soc64.S +135 -3
@@ -1,7 +1,7 @@
-/*
- * Copyright (C) 2020 Intel Corporation. All rights reserved
+/* SPDX-License-Identifier: GPL-2.0
+ *
+ * Copyright (C) 2022-2023 Intel Corporation <www.intel.com>
  *
- * SPDX-License-Identifier:    GPL-2.0
  */
 
 #include <asm-offsets.h>
@@ -9,11 +9,101 @@
 #include <linux/linkage.h>
 #include <asm/macro.h>
 
+#if !defined(CONFIG_SPL_BUILD) && defined(CONFIG_ARMV8_PSCI)
+.align 3
+_el3_exception_vectors:
+	.quad el3_exception_vectors;
+#endif
+
 ENTRY(lowlevel_init)
 	mov	x29, lr			/* Save LR */
 
+#ifdef CONFIG_SPL_BUILD
+	/* Check for L2 reset magic word */
+	ldr	x4, =L2_RESET_DONE_REG
+	ldr	x5, [x4]
+	ldr	x1, =L2_RESET_DONE_STATUS
+	cmp	x1, x5
+	/* No L2 reset, skip warm reset */
+	b.ne	skipwarmreset
+	/* Put all slaves CPUs into WFI mode */
+	branch_if_slave x0, put_cpu_in_wfi
+	/* L2 reset completed */
+	str	xzr, [x4]
+	/* Clear previous CPU release address */
+	ldr	x4, =CPU_RELEASE_ADDR
+	str	wzr, [x4]
+	/* Master CPU (CPU0) request for warm reset */
+	mrs	x1, rmr_el3
+	orr	x1, x1, #0x02
+	msr	rmr_el3, x1
+	isb
+	dsb	sy
+put_cpu_in_wfi:
+	wfi
+	b	put_cpu_in_wfi
+skipwarmreset:
+#endif
+
 #if defined(CONFIG_GICV2) || defined(CONFIG_GICV3)
 #if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_ATF)
+
+	/*
+	 * In ATF flow, need to clear the old CPU address when cold reset
+	 * being triggered, but shouldn't clear CPU address if it is reset
+	 * by CPU-ON, so that the core can correctly jump to ATF code after
+	 * reset by CPU-ON. CPU-ON trigger the reset via mpumodrst.
+	 *
+	 * Hardware will set 1 to core*_irq in mpurststat register in
+	 * reset manager if the core is reset by mpumodrst.
+	 *
+	 * The following code will check the mpurststat to identify if the
+	 * core is reset by mpumodrst, and it will skip CPU address clearing
+	 * if the core is reset by mpumodrst. At last, the code need to clear
+	 * the core*_irq by set it to 1. So that it can reflect the correct
+	 * and latest status in next reset.
+	 */
+
+	/* Check if it is a master core off/on from kernel using boot scratch
+	 * cold register 8 bit 19. This bit is set by ATF.
+	 */
+	ldr	x4, =BOOT_SCRATCH_COLD8
+	ldr	x5, [x4]
+	and	x6, x5, #0x80000
+	cbnz	x6, wait_for_atf_master
+
+	/* Retrieve mpurststat register in reset manager */
+	ldr	x4, =SOCFPGA_RSTMGR_ADDRESS
+	ldr	w5, [x4, #0x04]
+
+	/* Set mask based on current core id */
+	mrs	x0, mpidr_el1
+	and	x1, x0, #0xF
+	ldr	x2, =0x00000100
+	lsl	x2, x2, x1
+
+	/* Skip if core*_irq register is set */
+	and	x6, x5, x2
+	cbnz	x6, skip_clear_cpu_address
+
+	/*
+	 * Reach here means core*_irq is 0, means the core is
+	 * reset by cold, warm or watchdog reset.
+	 * Clear previous CPU release address
+	 */
+	ldr	x4, =CPU_RELEASE_ADDR
+	str	wzr, [x4]
+	b	skip_clear_core_irq
+
+skip_clear_cpu_address:
+	/* Clear core*_irq register by writing 1 */
+	ldr	x4, =SOCFPGA_RSTMGR_ADDRESS
+	str	w2, [x4, #0x04]
+
+skip_clear_core_irq:
+	/* Master CPU (CPU0) does not need to wait for atf */
+	branch_if_master x0, master_cpu
+
 wait_for_atf:
 	ldr	x4, =CPU_RELEASE_ADDR
 	ldr	x5, [x4]
@@ -21,6 +111,16 @@ wait_for_atf:
 	br	x5
 slave_wait_atf:
 	branch_if_slave x0, wait_for_atf
+
+wait_for_atf_master:
+	ldr	x4, =CPU_RELEASE_ADDR
+	ldr	x5, [x4]
+	cbz	x5, master_wait_atf
+	br	x5
+master_wait_atf:
+	branch_if_master x0, wait_for_atf_master
+
+master_cpu:
 #else
 	branch_if_slave x0, 1f
 #endif
@@ -52,6 +152,18 @@ slave_wait_atf:
 	bl	gic_wait_for_interrupt
 #endif
 
+#if defined(CONFIG_SPL_BUILD) && !defined(CONFIG_SPL_ATF)
+	/*
+	 * Read the u-boot's PSCI exception handler's vector base
+	 * address from the sysmgr.boot_scratch_cold6 & 7 and update
+	 * their VBAR_EL3 respectively.
+	 */
+wait_vbar_el3:
+	ldr	x4, =VBAR_EL3_BASE_ADDR
+	ldr	x5, [x4]
+	cbz	x5, wait_vbar_el3
+	msr	vbar_el3, x5
+#endif
 	/*
 	 * All slaves will enter EL2 and optionally EL1.
 	 */
@@ -71,6 +183,55 @@ lowlevel_in_el1:
 #endif /* CONFIG_ARMV8_MULTIENTRY */
 
 2:
+#if !defined(CONFIG_SPL_BUILD) && defined(CONFIG_ARMV8_PSCI)
+	/*
+	 * Write the u-boot PSCI exception handler's vector base address
+	 * into a sysmgr.boot_scratch_cold6 & 7 so that other slave cpus
+	 * are able to get the vector base address and update their VBAR_EL3
+	 * respectively.
+	 */
+	adr	x0, _el3_exception_vectors
+	ldr	x5, [x0]
+	ldr	x4, =VBAR_EL3_BASE_ADDR
+	str	x5, [x4]
+#endif
+
+#ifdef CONFIG_SPL_BUILD
+	branch_if_slave x0, 3f
+
+	/* Check rstmgr.stat for warm reset status */
+	ldr	x1, =SOCFPGA_RSTMGR_ADDRESS
+	ldr	x0, [x1]
+	/* Check whether any L4 watchdogs or MPUs had triggered warm

reset */

arch/arm/mach-socfpga/lowlevel_init_soc64.S +29 -0
+	ldr	x2, =0x000F0F00
+	ands	x0, x0, x2
+	/*
+	 * If current Reset Manager's status is warm reset just reload the
+	 * .data section by copying the data from data preserve section.
+	 * Otherwise, copy the .data section to the data preserve section to
+	 * keep an original copy of .data section. This ensure SPL is
+	 * reentrant after warm reset.
+	 */
+	b.ne	reload_data_section
+	/* Copy from .data to preserved .data to backup the SPL state */
+	ldr	x0, =__data_start
+	ldr	x1, =__preserve_data_start
+	ldr	x2, =__preserve_data_end
+	b	copy_loop
+reload_data_section:
+	/* Copy from preserved .data to .data to restore the SPL state */
+	ldr	x0, =__preserve_data_start
+	ldr	x1, =__data_start
+	ldr	x2, =__data_end
+copy_loop:
+	ldr	w3, [x0]
+	add	x0, x0, #4
+	str	w3, [x1]
+	add	x1, x1, #4
+	cmp	x1, x2
+	b.ne	copy_loop
+3:
+#endif
 	mov	lr, x29			/* Restore LR */
 	ret
 ENDPROC(lowlevel_init)
arch/arm/mach- renamed from arch/arm/mach-socfpga/mailbox_s10.c +0 -0

socfpga/mailbox_s10.c
index 101af23855..7846596c17 100644

arch/arm/mach-socfpga/mailbox_s10.c +10 -0
@@ -7,7 +7,9 @@
 #include <common.h>
 #include <asm/arch/clock_manager.h>
 #include <asm/arch/mailbox_s10.h>
+#include <asm/arch/smc_api.h>
 #include <asm/arch/system_manager.h>
+#include <asm/arch/timer.h>
 #include <asm/global_data.h>
 #include <asm/io.h>
 #include <asm/secure.h>
@@ -454,6 +456,14 @@ static __always_inline int
 mbox_get_fpga_config_status_common(u32 cmd)
 	return MBOX_CFGSTAT_STATE_CONFIG;
 }
 
+#ifdef CONFIG_ARMV8_PSCI
+int  __secure mbox_hps_stage_notify_psci(u32 execution_stage)
+{
+	return mbox_send_cmd_psci(MBOX_ID_UBOOT,
 MBOX_HPS_STAGE_NOTIFY,
+			     MBOX_CMD_DIRECT, 1, &execution_stage, 0, 0,
 NULL);
+}
+#endif
+

int mbox_get_fpga_config_status(u32 cmd)
{

arch/arm/mach-socfpga/mailbox_s10.c +8 -0
 	return mbox_get_fpga_config_status_common(cmd);
@@ -479,6 +489,17 @@ int __secure mbox_send_cmd_psci(u8 id, u32 cmd,
 u8 is_indirect, u32 len,
 					  urgent, resp_buf_len, resp_buf);
 }
 
+int mbox_hps_stage_notify(u32 execution_stage)
+{
+#if !defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_ATF)
+	return smc_send_mailbox(MBOX_HPS_STAGE_NOTIFY, 1,
 &execution_stage,
+				0, 0, NULL);
+#else
+	return mbox_send_cmd(MBOX_ID_UBOOT,
 MBOX_HPS_STAGE_NOTIFY,
+			     MBOX_CMD_DIRECT, 1, &execution_stage, 0, 0,

NULL);

arch/arm/mach-socfpga/mailbox_s10.c +3 -0
+#endif
+}
+
 int mbox_send_cmd_only(u8 id, u32 cmd, u8 is_indirect, u32 len, u32 *arg)
 {
 	return mbox_send_cmd_only_common(id, cmd, is_indirect, len, arg);
arch/arm/mach-socfpga/misc.c +5 -4
index 5b5a81a255..024b714ecb 100644
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0+
 /*
- *  Copyright (C) 2012-2017 Altera Corporation <www.altera.com>
+ *  Copyright (C) 2012-2023 Altera Corporation <www.altera.com>
  */
 
 #include <common.h>
@@ -34,7 +34,7 @@ phys_addr_t socfpga_sysmgr_base __section(".data");
 
 #ifdef CONFIG_SYS_L2_PL310
 static const struct pl310_regs *const pl310 =
-	(struct pl310_regs *)CFG_SYS_PL310_BASE;
+	(struct pl310_regs *)CONFIG_SYS_PL310_BASE;
 #endif
 
 struct bsel bsel_str[] = {
@@ -164,7 +164,10 @@ int arch_cpu_init(void)
 	 * timeout value is still active which might too short for Linux
 	 * booting.
 	 */
+#if !(IS_ENABLED(CONFIG_TARGET_SOCFPGA_AGILEX5_SIMICS) || \
+IS_ENABLED(CONFIG_TARGET_SOCFPGA_AGILEX5_EMU))
 	hw_watchdog_init();
+#endif
 #else
 	/*
 	 * If the HW watchdog is NOT enabled, make sure it is not running,
@@ -208,10 +211,11 @@ static int do_bridge(struct cmd_tbl *cmdtp, int flag,
 int argc,
 }
 
 U_BOOT_CMD(bridge, 3, 1, do_bridge,
-	   "SoCFPGA HPS FPGA bridge control",
-	   "enable [mask] - Enable HPS-to-FPGA, FPGA-to-HPS, LWHPS-to-

FPGA bridges\n"

arch/arm/mach-socfpga/misc.c +0 -1
-	   "bridge disable [mask] - Enable HPS-to-FPGA, FPGA-to-HPS,

LWHPS-to-FPGA bridges\n"

arch/arm/mach-socfpga/misc.c +2 -1
-	   ""
+	"SoCFPGA HPS FPGA bridge control",
+	"enable [mask] - Enable HPS-to-FPGA (Bit 0), LWHPS-to-FPGA (Bit 1),

FPGA-to-HPS (Bit 2), F2SDRAM0 (Bit 3), F2SDRAM1 (Bit 4), F2SDRAM2 (Bit 5) bridges \n"

arch/arm/mach-socfpga/misc.c +1 -0
+	"bridge disable [mask] - Disable HPS-to-FPGA (Bit 0), LWHPS-to-FPGA

(Bit 1), FPGA-to-HPS (Bit 2), F2SDRAM0 (Bit 3), F2SDRAM1 (Bit 4), F2SDRAM2 (Bit 5) bridges\n"

arch/arm/mach-socfpga/misc.c +5 -0
+	"Bit 3, Bit 4 and Bit 5 bridges only available in Stratix 10\n"
+	""
 );
 
 #endif
@@ -257,6 +261,9 @@ void socfpga_get_managers_addr(void)
 #elif IS_ENABLED(CONFIG_TARGET_SOCFPGA_N5X)
 	ret = socfpga_get_base_addr("intel,n5x-clkmgr",
 				    &socfpga_clkmgr_base);
+#elif IS_ENABLED(CONFIG_TARGET_SOCFPGA_AGILEX5)
+	ret = socfpga_get_base_addr("intel,agilex5-clkmgr",
+				    &socfpga_clkmgr_base);
 #else
 	ret = socfpga_get_base_addr("altr,clk-mgr", &socfpga_clkmgr_base);
 #endif
arch/arm/mach- renamed from arch/arm/mach-socfpga/misc_soc64.c +0 -0

socfpga/misc_soc64.c
index 2acdfad07b..7dd6f834e1 100644

arch/arm/mach-socfpga/misc_soc64.c +9 -2
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0
 /*
- * Copyright (C) 2016-2018 Intel Corporation <www.intel.com>
+ * Copyright (C) 2016-2023 Intel Corporation <www.intel.com>
  *
  */
 
@@ -18,8 +18,12 @@
 #include <log.h>
 #include <mach/clock_manager.h>
 
+#define RSU_DEFAULT_LOG_LEVEL  7
+
 DECLARE_GLOBAL_DATA_PTR;
 
+u8 socfpga_get_board_id(void);
+
 /*
  * FPGA programming support for SoC FPGA Stratix 10
  */
@@ -47,8 +51,11 @@ static Altera_desc altera_fpga[] = {
 #if defined(CONFIG_DISPLAY_CPUINFO)
 int print_cpuinfo(void)
 {
+#if IS_ENABLED(CONFIG_TARGET_SOCFPGA_AGILEX5)
+	puts("CPU:   Intel FPGA SoCFPGA Platform (ARMv8 64bit Cortex-
 A55/A76)\n");
+#else
 	puts("CPU:   Intel FPGA SoCFPGA Platform (ARMv8 64bit Cortex-
 A53)\n");
-
+#endif
 	return 0;

}
#endif

arch/arm/mach-socfpga/misc_soc64.c +21 -1
@@ -56,11 +63,26 @@ int print_cpuinfo(void)
 #ifdef CONFIG_ARCH_MISC_INIT
 int arch_misc_init(void)
 {
+#if !(IS_ENABLED(CONFIG_TARGET_SOCFPGA_AGILEX5_SIMICS) || \
+IS_ENABLED(CONFIG_TARGET_SOCFPGA_AGILEX5_EMU))
 	char qspi_string[13];
+	char level[4];
+	char id[3];
+
+	snprintf(level, sizeof(level), "%u", RSU_DEFAULT_LOG_LEVEL);
 
 	sprintf(qspi_string, "<0x%08x>", cm_get_qspi_controller_clk_hz());
 	env_set("qspi_clock", qspi_string);
 
+	/* for RSU, set log level to default if log level is not set */
+	if (!env_get("rsu_log_level"))
+		env_set("rsu_log_level", level);
+
+	/* Export board_id as environment variable */
+	sprintf(id, "%u", socfpga_get_board_id());
+	env_set("board_id", id);
+#endif
+
 	return 0;
 }
 #endif
@@ -87,5 +109,10 @@ void do_bridge_reset(int enable, unsigned int mask)
 		return;
 	}
 
-	socfpga_bridges_reset(enable);
+	socfpga_bridges_reset(enable, mask);
+}
+
+void arch_preboot_os(void)
+{
+	mbox_hps_stage_notify(HPS_EXECUTION_STATE_OS);
 }
arch/arm/mach- renamed from arch/arm/mach-socfpga/mmu-arm64_s10.c +0 -0

socfpga/mmu-arm64_s10.c
index a55b7b7cf3..0951233cad 100644

arch/arm/mach-socfpga/mmu-arm64_s10.c +42 -1
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0
 /*
- * Copyright (C) 2016-2018 Intel Corporation <www.intel.com>
+ * Copyright (C) 2016-2022 Intel Corporation <www.intel.com>
  *
  */
 
@@ -10,6 +10,46 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
+#if IS_ENABLED(CONFIG_TARGET_SOCFPGA_AGILEX5)
+static struct mm_region socfpga_agilex5_mem_map[] = {
+	{
+		/* OCRAM 1MB but available 256KB */
+		.virt	= 0x00000000UL,
+		.phys	= 0x00000000UL,
+		.size	= 0x00040000UL,
+		.attrs	= PTE_BLOCK_MEMTYPE(MT_NORMAL) |
+				PTE_BLOCK_INNER_SHARE,
+	}, {
+		/* DEVICE */
+		.virt	= 0x10808000UL,
+		.phys	= 0x10808000UL,
+		.size	= 0x0F7F8000UL,
+		.attrs	= PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
+				PTE_BLOCK_NON_SHARE |
+				PTE_BLOCK_PXN | PTE_BLOCK_UXN,
+	}, {
+		/* FPGA 1.5GB */
+		.virt	= 0x20000000UL,
+		.phys	= 0x20000000UL,
+		.size	= 0x60000000UL,
+		.attrs	= PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
+				PTE_BLOCK_NON_SHARE |
+				PTE_BLOCK_PXN | PTE_BLOCK_UXN,
+	}, {
+		/* MEM 2GB */
+		.virt	= 0x80000000UL,
+		.phys	= 0x80000000UL,
+		.size	= 0x80000000UL,
+		.attrs	= PTE_BLOCK_MEMTYPE(MT_NORMAL) |
+				PTE_BLOCK_INNER_SHARE,
+	}, {
+		/* List terminator */
+	},
+};
+
+struct mm_region *mem_map = socfpga_agilex5_mem_map;
+
+#else
 static struct mm_region socfpga_stratix10_mem_map[] = {
 	{
 		/* MEM 2GB*/
@@ -70,3 +110,4 @@ static struct mm_region socfpga_stratix10_mem_map[]
 = {
 };
 
 struct mm_region *mem_map = socfpga_stratix10_mem_map;
+#endif
arch/arm/mach- renamed from arch/arm/mach-socfpga/reset_manager_s10.c +0 -0

socfpga/reset_manager_s10.c
index f47fec10a0..1bf6a74648 100644

arch/arm/mach-socfpga/reset_manager_s10.c +50 -4
@@ -1,22 +1,58 @@
 // SPDX-License-Identifier: GPL-2.0
 /*
- * Copyright (C) 2016-2018 Intel Corporation <www.intel.com>
+ * Copyright (C) 2016-2023 Intel Corporation <www.intel.com>
  *
  */
 
 #include <common.h>
+#include <errno.h>
 #include <hang.h>
 #include <asm/global_data.h>
 #include <asm/io.h>
+#include <asm/secure.h>
 #include <asm/arch/reset_manager.h>
 #include <asm/arch/smc_api.h>
 #include <asm/arch/system_manager.h>
+#include <asm/arch/timer.h>
 #include <dt-bindings/reset/altr,rst-mgr-s10.h>
+#include <exports.h>
 #include <linux/iopoll.h>
 #include <linux/intel-smc.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
+#define TIMEOUT_300MS     300
+
+/* F2S manager registers */
+#define F2SDRAM_SIDEBAND_FLAGINSTATUS0	0x14
+#define F2SDRAM_SIDEBAND_FLAGOUTSET0	0x50
+#define F2SDRAM_SIDEBAND_FLAGOUTCLR0	0x54
+
+static __always_inline int wait_for_bit(u32 *reg, const u32 mask, bool set,
+					unsigned int timeout_ms)
+{
+	u32 val;
+	int timeout = timeout_ms;
+
+	while (1) {
+		val = readl(reg);
+
+		if (!set)
+			val = ~val;
+
+		if ((val & mask) == mask)
+			return 0;
+
+		if (!timeout)
+			break;
+
+		timeout--;
+		__socfpga_udelay(1000);
+	}
+
+	return -ETIMEDOUT;
+}
+
 /* Assert or de-assert SoCFPGA reset manager reset. */
 void socfpga_per_reset(u32 reset, int set)
 {
@@ -57,66 +93,221 @@ void socfpga_per_reset_all(void)
 	writel(0xffffffff, socfpga_get_rstmgr_addr() +
 RSTMGR_SOC64_PER1MODRST);
 }
 
-void socfpga_bridges_reset(int enable)
+static __always_inline void socfpga_f2s_bridges_reset(int enable,
+						      unsigned int mask)
 {
-#if !defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_ATF)
-	u64 arg = enable;
+	int ret;
+	u32 brg_mask;
+	u32 flagout_idlereq = 0;
+	u32 flagoutset_fdrain = 0;
+	u32 flagoutset_en = 0;
+	u32 flaginstatus_idleack = 0;
+	u32 flaginstatus_respempty = 0;
+
+	if (CONFIG_IS_ENABLED(TARGET_SOCFPGA_STRATIX10)) {
+		/* Support fpga2soc and f2sdram */
+		brg_mask = mask &

(RSTMGR_BRGMODRST_FPGA2SOC_MASK |

arch/arm/mach-socfpga/reset_manager_s10.c +1 -0
+				   RSTMGR_BRGMODRST_F2SDRAM0_MASK

|

arch/arm/mach-socfpga/reset_manager_s10.c +1 -0
+				   RSTMGR_BRGMODRST_F2SDRAM1_MASK

|

arch/arm/mach-socfpga/reset_manager_s10.c +17 -1
+				   RSTMGR_BRGMODRST_F2SDRAM2_MASK);
+
+		if (brg_mask & RSTMGR_BRGMODRST_F2SDRAM0_MASK) {
+			flagout_idlereq |= BIT(0);
+			flaginstatus_idleack |= BIT(1);
+			flagoutset_fdrain |= BIT(2);
+			flagoutset_en |= BIT(1);
+			flaginstatus_respempty |= BIT(3);
+		}
+
+		if (brg_mask & RSTMGR_BRGMODRST_F2SDRAM1_MASK) {
+			flagout_idlereq |= BIT(3);
+			flaginstatus_idleack |= BIT(5);
+			flagoutset_fdrain |= BIT(5);
+			flagoutset_en |= BIT(4);
+			flaginstatus_respempty |= BIT(7);
+		}
 
-	int ret = invoke_smc(INTEL_SIP_SMC_HPS_SET_BRIDGES, &arg, 1,

NULL, 0);

arch/arm/mach-socfpga/reset_manager_s10.c +10 -2
-	if (ret) {
-		printf("SMC call failed with error %d in %s.\n", ret, __func__);
+		if (brg_mask & RSTMGR_BRGMODRST_F2SDRAM2_MASK) {
+			flagout_idlereq |= BIT(6);
+			flaginstatus_idleack |= BIT(9);
+			flagoutset_fdrain |= BIT(8);
+			flagoutset_en |= BIT(7);
+			flaginstatus_respempty |= BIT(11);
+		}
+	} else {
+		/* Support fpga2soc only */
+		brg_mask = mask &

RSTMGR_BRGMODRST_FPGA2SOC_MASK;

arch/arm/mach-socfpga/reset_manager_s10.c +14 -0
+		if (brg_mask & RSTMGR_BRGMODRST_FPGA2SOC_MASK) {
+			flagout_idlereq |= BIT(0);
+			flaginstatus_idleack |= BIT(1);
+			flagoutset_fdrain |= BIT(2);
+			flagoutset_en |= BIT(1);
+			flaginstatus_respempty |= BIT(3);
+		}
+	}
+
+	/* mask is not set, return here */
+	if (!brg_mask)
 		return;
+
+	if (enable) {
+		clrbits_le32(socfpga_get_rstmgr_addr() +

RSTMGR_SOC64_BRGMODRST,

arch/arm/mach-socfpga/reset_manager_s10.c +15 -0
+			     brg_mask);
+		setbits_le32(SOCFPGA_F2SDRAM_MGR_ADDRESS +
+			     F2SDRAM_SIDEBAND_FLAGOUTCLR0,
+			     flagout_idlereq);
+
+		/* Wait for mpfe noc idleack to 0 */
+		wait_for_bit((u32 *)(SOCFPGA_F2SDRAM_MGR_ADDRESS +
+			     F2SDRAM_SIDEBAND_FLAGINSTATUS0),
+			     flaginstatus_idleack, false, TIMEOUT_300MS);
+
+		setbits_le32(SOCFPGA_F2SDRAM_MGR_ADDRESS +
+			     F2SDRAM_SIDEBAND_FLAGOUTCLR0,
+			     flagoutset_fdrain);
+		setbits_le32(SOCFPGA_F2SDRAM_MGR_ADDRESS +
+			     F2SDRAM_SIDEBAND_FLAGOUTSET0,

flagoutset_en);

arch/arm/mach-socfpga/reset_manager_s10.c +10 -0
+
+		__socfpga_udelay(1); /* wait 1us */
+	} else {
+		if (readl((socfpga_get_rstmgr_addr() +
+		    RSTMGR_SOC64_BRGMODRST) & brg_mask)) {
+			/* Bridge cannot be reset twice */
+			return;
+		}
+
+		setbits_le32(socfpga_get_rstmgr_addr() +

RSTMGR_SOC64_HDSKEN,

arch/arm/mach-socfpga/reset_manager_s10.c +2 -0
+			     RSTMGR_HDSKEN_FPGAHSEN);
+		setbits_le32(socfpga_get_rstmgr_addr() +

RSTMGR_SOC64_HDSKREQ,

arch/arm/mach-socfpga/reset_manager_s10.c +5 -0
+			     RSTMGR_HDSKREQ_FPGAHSREQ);
+
+		/* Wait for FPGA ack the handshake request to 1 */
+		wait_for_bit((u32 *)(socfpga_get_rstmgr_addr() +
+			     RSTMGR_SOC64_HDSKACK),

RSTMGR_HDSKREQ_FPGAHSREQ,

arch/arm/mach-socfpga/reset_manager_s10.c +4 -0
+			     true, TIMEOUT_300MS);
+
+		setbits_le32(SOCFPGA_F2SDRAM_MGR_ADDRESS +
+			     F2SDRAM_SIDEBAND_FLAGOUTCLR0,

flagoutset_en);

arch/arm/mach-socfpga/reset_manager_s10.c +6 -0
+
+		__socfpga_udelay(1);
+
+		/* Requests MPFE NoC to idle */
+		setbits_le32(SOCFPGA_F2SDRAM_MGR_ADDRESS +
+			     F2SDRAM_SIDEBAND_FLAGOUTSET0,

flagout_idlereq);

arch/arm/mach-socfpga/reset_manager_s10.c +4 -0
+
+		/* Force F2S bridge to drain */
+		setbits_le32(SOCFPGA_F2SDRAM_MGR_ADDRESS +
+			     F2SDRAM_SIDEBAND_FLAGOUTSET0,

flagoutset_fdrain);

arch/arm/mach-socfpga/reset_manager_s10.c +3 -0
+
+		/* Wait for respond queue empty status to 1 (resp idle) */
+		ret = wait_for_bit((u32

*)(SOCFPGA_F2SDRAM_MGR_ADDRESS +
+
F2SDRAM_SIDEBAND_FLAGINSTATUS0),

arch/arm/mach-socfpga/reset_manager_s10.c +7 -0
+					   flaginstatus_respempty, true,
+					   TIMEOUT_300MS);
+
+		/* Confirm again */
+		if (!ret)
+			ret = wait_for_bit((u32 *)
+

(SOCFPGA_F2SDRAM_MGR_ADDRESS +
+
F2SDRAM_SIDEBAND_FLAGINSTATUS0),

arch/arm/mach-socfpga/reset_manager_s10.c +4 -0
+					   flaginstatus_respempty, true,
+					   TIMEOUT_300MS);
+
+		setbits_le32(socfpga_get_rstmgr_addr() +

RSTMGR_SOC64_BRGMODRST,

arch/arm/mach-socfpga/reset_manager_s10.c +1 -0
+			     brg_mask &

~RSTMGR_BRGMODRST_FPGA2SOC_MASK);

arch/arm/mach-socfpga/reset_manager_s10.c +1 -0
+		clrbits_le32(socfpga_get_rstmgr_addr() +

RSTMGR_SOC64_HDSKREQ,

arch/arm/mach-socfpga/reset_manager_s10.c +27 -4
+			     RSTMGR_HDSKREQ_FPGAHSREQ);
+		setbits_le32(SOCFPGA_F2SDRAM_MGR_ADDRESS +
+			     F2SDRAM_SIDEBAND_FLAGOUTCLR0,
+			     flagout_idlereq);
+	}
+}
+
+static __always_inline void socfpga_s2f_bridges_reset(int enable,
+						      unsigned int mask)
+{
+	unsigned int noc_mask = 0;
+	unsigned int brg_mask = 0;
+
+	if (mask & RSTMGR_BRGMODRST_SOC2FPGA_MASK) {
+		noc_mask = SYSMGR_NOC_H2F_MSK;
+		brg_mask = RSTMGR_BRGMODRST_SOC2FPGA_MASK;
 	}
-#else
-	u32 reg;
+
+	if (mask & RSTMGR_BRGMODRST_LWSOC2FPGA_MASK) {
+		noc_mask |= SYSMGR_NOC_LWH2F_MSK;
+		brg_mask |= RSTMGR_BRGMODRST_LWSOC2FPGA_MASK;
+	}
+
+	/* s2f mask is not set, return here */
+	if (!brg_mask)
+		return;
 
 	if (enable) {
 		/* clear idle request to all bridges */
 		setbits_le32(socfpga_get_sysmgr_addr() +
-			     SYSMGR_SOC64_NOC_IDLEREQ_CLR, ~0);
+			     SYSMGR_SOC64_NOC_IDLEREQ_CLR, noc_mask);
 
-		/* Release all bridges from reset state */
+		/* Release SOC2FPGA bridges from reset state */
 		clrbits_le32(socfpga_get_rstmgr_addr() +

RSTMGR_SOC64_BRGMODRST,

arch/arm/mach-socfpga/reset_manager_s10.c +7 -8
-			     ~0);
+			     brg_mask);
 
-		/* Poll until all idleack to 0 */
-		read_poll_timeout(readl, reg, !reg, 1000, 300000,
-				  socfpga_get_sysmgr_addr() +
-				  SYSMGR_SOC64_NOC_IDLEACK);
+		/* Wait for all NOC master ack to 0 */
+		wait_for_bit((u32 *)(socfpga_get_sysmgr_addr() +
+			     SYSMGR_SOC64_NOC_IDLEACK), noc_mask, false,
+			     TIMEOUT_300MS);
 	} else {
 		/* set idle request to all bridges */
-		writel(~0,
-		       socfpga_get_sysmgr_addr() +
-		       SYSMGR_SOC64_NOC_IDLEREQ_SET);
+		setbits_le32(socfpga_get_sysmgr_addr() +
+			     SYSMGR_SOC64_NOC_IDLEREQ_SET, noc_mask);
 
 		/* Enable the NOC timeout */
 		writel(1, socfpga_get_sysmgr_addr() +

SYSMGR_SOC64_NOC_TIMEOUT);

arch/arm/mach-socfpga/reset_manager_s10.c +8 -17
-		/* Poll until all idleack to 1 */
-		read_poll_timeout(readl, reg,
-				  reg == (SYSMGR_NOC_H2F_MSK |
-					  SYSMGR_NOC_LWH2F_MSK),
-				  1000, 300000,
-				  socfpga_get_sysmgr_addr() +
-				  SYSMGR_SOC64_NOC_IDLEACK);
-
-		/* Poll until all idlestatus to 1 */
-		read_poll_timeout(readl, reg,
-				  reg == (SYSMGR_NOC_H2F_MSK |
-					  SYSMGR_NOC_LWH2F_MSK),
-				  1000, 300000,
-				  socfpga_get_sysmgr_addr() +
-				  SYSMGR_SOC64_NOC_IDLESTATUS);
-
-		/* Reset all bridges (except NOR DDR scheduler & F2S) */
+		/* Wait for all NOC master ack to 1 */
+		wait_for_bit((u32 *)(socfpga_get_sysmgr_addr() +
+			     SYSMGR_SOC64_NOC_IDLEACK), noc_mask, true,
+			     TIMEOUT_300MS);
+
+		/* Wait for all NOC master idlestatus to 1 */
+		wait_for_bit((u32 *)(socfpga_get_sysmgr_addr() +
+			     SYSMGR_SOC64_NOC_IDLESTATUS), noc_mask,

true,

arch/arm/mach-socfpga/reset_manager_s10.c +3 -0
+			     TIMEOUT_300MS);
+
+		/* Reset all SOC2FPGA bridges */
 		setbits_le32(socfpga_get_rstmgr_addr() +

RSTMGR_SOC64_BRGMODRST,

arch/arm/mach-socfpga/reset_manager_s10.c +1 -2
-			     ~(RSTMGR_BRGMODRST_DDRSCH_MASK |
-			       RSTMGR_BRGMODRST_FPGA2SOC_MASK));
+			     brg_mask);
 
 		/* Disable NOC timeout */
 		writel(0, socfpga_get_sysmgr_addr() +

SYSMGR_SOC64_NOC_TIMEOUT);

arch/arm/mach-socfpga/reset_manager_s10.c +5 -1
 	}
-#endif
+}
+
+void socfpga_bridges_reset(int enable, unsigned int mask)
+{
+	if (!IS_ENABLED(CONFIG_SPL_BUILD) &&

IS_ENABLED(CONFIG_SPL_ATF)) {

arch/arm/mach-socfpga/reset_manager_s10.c +22 -0
+		u64 arg[2];
+		int ret;
+
+		/* Set bit-1 to indicate has mask value in arg[1]. */
+		arg[0] = (enable & BIT(0)) | BIT(1);
+		arg[1] = mask;
+
+		ret = invoke_smc(INTEL_SIP_SMC_HPS_SET_BRIDGES, arg,
+				 ARRAY_SIZE(arg), NULL, 0);
+		if (ret)
+			printf("Failed to %s the HPS bridges, error %d\n",
+			       enable ? "enable" : "disable", ret);
+	} else {
+		socfpga_s2f_bridges_reset(enable, mask);
+		socfpga_f2s_bridges_reset(enable, mask);
+	}
+}
+
+void __secure socfpga_bridges_reset_psci(int enable, unsigned int mask)
+{
+	socfpga_s2f_bridges_reset(enable, mask);
+	socfpga_f2s_bridges_reset(enable, mask);
 }
 
 /*
@@ -125,7 +316,7 @@ void socfpga_bridges_reset(int enable)
 int cpu_has_been_warmreset(void)
 {
 	return readl(socfpga_get_rstmgr_addr() + RSTMGR_SOC64_STATUS)

&

arch/arm/mach-socfpga/reset_manager_s10.c +1 -1
-			RSTMGR_L4WD_MPU_WARMRESET_MASK;
+			(RSTMGR_L4WD_MPU_WARMRESET_MASK);
 }
 
 void print_reset_info(void)
arch/arm/mach- renamed from arch/arm/mach-socfpga/secure_reg_helper.c +0 -0

socfpga/secure_reg_helper.c
index 0d4f45f33d..23595d242a 100644

arch/arm/mach-socfpga/secure_reg_helper.c +3 -1
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0
 /*
- * Copyright (C) 2020 Intel Corporation <www.intel.com>
+ * Copyright (C) 2020-2022 Intel Corporation <www.intel.com>
  *
  */
 
@@ -18,9 +18,11 @@
 int socfpga_secure_convert_reg_id_to_addr(u32 id, phys_addr_t *reg_addr)
 {
 	switch (id) {
+#if !IS_ENABLED(CONFIG_TARGET_SOCFPGA_AGILEX5)
 	case SOCFPGA_SECURE_REG_SYSMGR_SOC64_SDMMC:
 		*reg_addr = socfpga_get_sysmgr_addr() +
 SYSMGR_SOC64_SDMMC;
 		break;
+#endif
 	case SOCFPGA_SECURE_REG_SYSMGR_SOC64_EMAC0:
 		*reg_addr = socfpga_get_sysmgr_addr() +

SYSMGR_SOC64_EMAC0;

arch/arm/mach-socfpga/secure_reg_helper.c +0 -0
 		break;
arch/arm/mach- renamed from arch/arm/mach-socfpga/smmu_agilex5.c +0 -0

socfpga/smmu_agilex5.c
new file mode 100644
index 0000000000..05e74926aa

arch/arm/mach-socfpga/smmu_agilex5.c new file +20 -0
@@ -0,0 +1,34 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (C) 2023 Intel Corporation. All rights reserved
+ *
+ */
+
+#include <common.h>
+#include <asm/global_data.h>
+#include <asm/io.h>
+#include <asm/arch/firewall.h>
+#include <asm/arch/smmu_agilex5.h>
+#include <asm/arch/system_manager.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+static inline void setup_smmu_firewall(void)
+{
+	u32 i;
+
+	/* Off the DDR secure transaction for all TBU supported peripherals

*/

arch/arm/mach-socfpga/smmu_agilex5.c new file +15 -0
+	for (i = SYSMGR_DMA0_SID_ADDR; i < SYSMGR_TSN2_SID_ADDR; i
+=
+	     SOCFPGA_NEXT_TBU_PERIPHERAL) {
+		/* skip this, future use register */
+		if (i == SYSMGR_USB3_SID_ADDR)
+			continue;
+
+		writel(SECURE_TRANS_RESET, (uintptr_t)i);
+	}
+}
+
+void socfpga_init_smmu(void)
+{
+	setup_smmu_firewall();
+}
arch/arm/mach- renamed from arch/arm/mach-socfpga/smmu_s10.c +0 -0

socfpga/smmu_s10.c
new file mode 100644
index 0000000000..106834cc9a

arch/arm/mach-socfpga/smmu_s10.c new file +17 -0
@@ -0,0 +1,126 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (C) 2018-2023 Intel Corporation <www.intel.com>
+ *
+ */
+
+#include <common.h>
+#include <asm/global_data.h>
+#include <asm/io.h>
+#include <asm/arch/firewall.h>
+#include <asm/arch/smmu_s10.h>
+#include <asm/arch/system_manager.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+static const struct smmu_stream_id dev_stream_id[] = {
+	{SYSMGR_EMAC0_SID_ADDR, 0x01, EMAC_W_OFST,

EMAC_R_OFST},

arch/arm/mach-socfpga/smmu_s10.c new file +1 -0
+	{SYSMGR_EMAC1_SID_ADDR, 0x02, EMAC_W_OFST,

EMAC_R_OFST},

arch/arm/mach-socfpga/smmu_s10.c new file +1 -0
+	{SYSMGR_EMAC2_SID_ADDR, 0x03, EMAC_W_OFST,

EMAC_R_OFST},

arch/arm/mach-socfpga/smmu_s10.c new file +38 -0
+	{SYSMGR_NAND_SID_ADDR,  0x04, NAND_W_OFST, NAND_R_OFST},
+	{SYSMGR_SDMMC_SID_ADDR, 0x05, SDMMC_OFST, SDMMC_OFST},
+	{SYSMGR_USB0_SID_ADDR,  0x06, USB_OFST, USB_OFST},
+	{SYSMGR_USB1_SID_ADDR,  0x07, USB_OFST, USB_OFST},
+	{SYSMGR_DMA_SID_ADDR,   0x08, DMA_W_OFST, DMA_R_OFST},
+	{SYSMGR_ETR_SID_ADDR,   0x09, ETR_W_OFST, ETR_R_OFST},
+};
+
+static void set_smmu_streamid(void)
+{
+	int i;
+
+	for (i = 0; i < ARRAY_SIZE(dev_stream_id); i++) {
+		u32 mask = SMMU_SET_STREAMID(0x3FF,
+					 dev_stream_id[i].r_bit_ofst,
+					 dev_stream_id[i].w_bit_ofst);
+		u32 value = SMMU_SET_STREAMID(dev_stream_id[i].sid,
+					 dev_stream_id[i].r_bit_ofst,
+					 dev_stream_id[i].w_bit_ofst);
+
+		clrbits_le32(dev_stream_id[i].addr, mask);
+		setbits_le32(dev_stream_id[i].addr, value);
+	}
+}
+
+/*
+ * Need to set the Secure bit (to make it non-secure) on each peripheral
+ * so that SMMU can access the peripheral
+ */
+static void set_smmu_accessible_reg(void)
+{
+	setbits_le32(socfpga_get_sysmgr_addr() + SYSMGR_SOC64_EMAC0,
+		     BIT(27) | BIT(25));
+	setbits_le32(socfpga_get_sysmgr_addr() + SYSMGR_SOC64_EMAC1,
+		     BIT(27) | BIT(25));
+	setbits_le32(socfpga_get_sysmgr_addr() + SYSMGR_SOC64_EMAC2,
+		     BIT(27) | BIT(25));
+	setbits_le32(socfpga_get_sysmgr_addr() +

SYSMGR_SOC64_NANDGRP_L3MASTER,

arch/arm/mach-socfpga/smmu_s10.c new file +2 -0
+		     BIT(21) | BIT(17));
+	setbits_le32(socfpga_get_sysmgr_addr() +

SYSMGR_SOC64_SDMMC_L3MASTER,

arch/arm/mach-socfpga/smmu_s10.c new file +2 -0
+		     BIT(5));
+	setbits_le32(socfpga_get_sysmgr_addr() +

SYSMGR_SOC64_USB0_L3MASTER,

arch/arm/mach-socfpga/smmu_s10.c new file +2 -0
+		     BIT(9));
+	setbits_le32(socfpga_get_sysmgr_addr() +

SYSMGR_SOC64_USB1_L3MASTER,

arch/arm/mach-socfpga/smmu_s10.c new file +19 -0
+		     BIT(9));
+}
+
+static inline void setup_smmu_firewall(void)
+{
+	/* Enable nonsecure SMMU accesses */
+	writel(FIREWALL_L4_DISABLE_ALL, SOCFPGA_FIREWALL_TCU);
+}
+
+void socfpga_init_smmu(void)
+{
+	setup_smmu_firewall();
+	set_smmu_streamid();
+	set_smmu_accessible_reg();
+}
+
+int is_smmu_bypass(void)
+{
+	return readl(SOCFPGA_SMMU_ADDRESS + SMMU_SCR0) &

SMMU_SCR0_CLIENTPD;

arch/arm/mach-socfpga/smmu_s10.c new file +22 -0
+}
+
+int is_smmu_stream_id_enabled(u32 stream_id)
+{
+	int i;
+	u32 smrg_num;
+	u32 smr, s2cr, sid_mask;
+	u32 cb, cb_index, cb_num;
+
+	if (is_smmu_bypass())
+		return 0;
+
+	/* Get number of Stream Mapping Register Groups */
+	smrg_num = readl(SOCFPGA_SMMU_ADDRESS + SMMU_SIDR0) &
+		   SMMU_SIDR0_NUMSMRG_MASK;
+
+	/* Get number of Context Bank */
+	cb_num = readl(SOCFPGA_SMMU_ADDRESS + SMMU_SIDR1) &
+		 SMMU_SIDR1_NUMCB_MASK;
+
+	for (i = 0; i < smrg_num; i++) {
+		smr = readl(SOCFPGA_SMMU_ADDRESS +

SMMU_GR0_SMR((u64)i));

arch/arm/mach-socfpga/smmu_s10.c new file +4 -0
+		sid_mask = (smr & SMMU_SMR_MASK) >> 16;
+
+		/* Skip if Stream ID is invalid or not matched */
+		if (!(smr & SMMU_SMR_VALID) || (smr & sid_mask) !=

stream_id)

arch/arm/mach-socfpga/smmu_s10.c new file +4 -0
+			continue;
+
+		/* Get Context Bank index from valid matching Stream ID */
+		s2cr = readl(SOCFPGA_SMMU_ADDRESS +

SMMU_GR0_S2CR((u64)i));

arch/arm/mach-socfpga/smmu_s10.c new file +7 -0
+		cb_index = s2cr & SMMU_S2CR_CBNDX;
+
+		/* Skip if Context Bank is invalid or not Translation mode */
+		if (cb_index >= cb_num || (s2cr & SMMU_S2CR_TYPE))
+			continue;
+
+		cb = readl(SOCFPGA_SMMU_ADDRESS +

SMMU_GR0_CB((u64)cb_index,
+
SMMU_CB_SCTLR));

arch/arm/mach-socfpga/smmu_s10.c new file +6 -0
+		/* Return MMU enable status for this Context Bank */
+		return (cb & SMMU_CB_SCTLR_M);
+	}
+
+	return 0;
+}
arch/arm/mach- renamed from arch/arm/mach-socfpga/spl_agilex5.c +0 -0

socfpga/spl_agilex5.c
new file mode 100644
index 0000000000..da91bf5917

arch/arm/mach-socfpga/spl_agilex5.c new file +95 -0
@@ -0,0 +1,180 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (C) 2019-2023 Intel Corporation <www.intel.com>
+ *
+ */
+
+#include <init.h>
+#include <log.h>
+#include <asm/global_data.h>
+#include <asm/io.h>
+#include <asm/u-boot.h>
+#include <asm/utils.h>
+#include <common.h>
+#include <hang.h>
+#include <image.h>
+#include <spl.h>
+#include <asm/arch/clock_manager.h>
+#include <asm/arch/firewall.h>
+#include <asm/arch/mailbox_s10.h>
+#include <asm/arch/misc.h>
+#include <asm/arch/reset_manager.h>
+#include <asm/arch/smmu_s10.h>
+#include <asm/arch/system_manager.h>
+#include <wdt.h>
+#include <dm/uclass.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+#define USE_HARDCODED_HANDOFF
+
+#ifdef USE_HARDCODED_HANDOFF
+static const u32 hardcoded_handoff_data[402] = {
+0x544f4f42, 0x01000500, 0x00000000, 0x00000000, 0x58554d50, 0x90010000,
+0x00000000, 0x00000000, 0x00000000, 0x03000000, 0x04000000, 0x03000000,
+0x08000000, 0x03000000, 0x0c000000, 0x03000000, 0x10000000, 0x03000000,
+0x14000000, 0x03000000, 0x18000000, 0x03000000, 0x1c000000, 0x03000000,
+0x20000000, 0x03000000, 0x24000000, 0x03000000, 0x28000000, 0x03000000,
+0x2c000000, 0x03000000, 0x30000000, 0x03000000, 0x34000000, 0x03000000,
+0x38000000, 0x03000000, 0x3c000000, 0x03000000, 0x40000000, 0x00000000,
+0x44000000, 0x00000000, 0x48000000, 0x00000000, 0x4c000000, 0x00000000,
+0x50000000, 0x00000000, 0x54000000, 0x00000000, 0x58000000, 0x04000000,
+0x5c000000, 0x04000000, 0x60000000, 0x08000000, 0x64000000, 0x08000000,
+0x68000000, 0x05000000, 0x6c000000, 0x05000000, 0x70000000, 0x08000000,
+0x74000000, 0x08000000, 0x78000000, 0x04000000, 0x7c000000, 0x04000000,
+0x80000000, 0x07000000, 0x84000000, 0x07000000, 0x88000000, 0x07000000,
+0x8c000000, 0x07000000, 0x90000000, 0x01000000, 0x94000000, 0x01000000,
+0x98000000, 0x01000000, 0x9c000000, 0x01000000, 0x00010000, 0x01000000,
+0x04010000, 0x01000000, 0x08010000, 0x09000000, 0x0c010000, 0x08000000,
+0x10010000, 0x08000000, 0x14010000, 0x08000000, 0x18010000, 0x05000000,
+0x1c010000, 0x05000000, 0x54434f49, 0x90010000, 0x00000000, 0x00000000,
+0x00000000, 0x34000000, 0x04000000, 0x14000000, 0x08000000, 0x34000000,
+0x0c000000, 0x34000000, 0x10000000, 0x34000000, 0x14000000, 0x34000000,
+0x18000000, 0x34000000, 0x1c000000, 0x34000000, 0x20000000, 0x34000000,
+0x24000000, 0x34000000, 0x28000000, 0x34000000, 0x2c000000, 0x34000000,
+0x30000000, 0x16000000, 0x34000000, 0x14000000, 0x38000000, 0x34000000,
+0x3c000000, 0x34000000, 0x40000000, 0x14000000, 0x44000000, 0x14000000,
+0x48000000, 0x34000000, 0x4c000000, 0x34000000, 0x50000000, 0x14000000,
+0x54000000, 0x14000000, 0x58000000, 0x34000000, 0x5c000000, 0x34000000,
+0x60000000, 0x35000000, 0x64000000, 0x35000000, 0x68000000, 0x16000000,
+0x6c000000, 0x34000000, 0xd0000000, 0x35000000, 0xd4000000, 0x35000000,
+0xd8000000, 0x3e000000, 0xdc000000, 0x3e000000, 0xe0000000, 0x34000000,
+0xe4000000, 0x34000000, 0xe8000000, 0x16000000, 0xec000000, 0x34000000,
+0xf0000000, 0x34000000, 0xf4000000, 0x34000000, 0xf8000000, 0x14000000,
+0xfc000000, 0x34000000, 0x00010000, 0x34000000, 0x04010000, 0x34000000,
+0x08010000, 0x34000000, 0x0c010000, 0x35000000, 0x10010000, 0x35000000,
+0x14010000, 0x35000000, 0x18010000, 0x3e000000, 0x1c010000, 0x16000000,
+0x41475046, 0xc0000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+0x04000000, 0x00000000, 0x08000000, 0x00000000, 0x0c000000, 0x00000000,
+0x10000000, 0x00000000, 0x14000000, 0x00000000, 0x18000000, 0x00000000,
+0x1c000000, 0x00000000, 0x20000000, 0x00000000, 0x28000000, 0x00000000,
+0x2c000000, 0x00000000, 0x30000000, 0x00000000, 0x34000000, 0x00000000,
+#if IS_ENABLED(CONFIG_TARGET_SOCFPGA_AGILEX5_EMU)
+0x38000000, 0x01000000, 0x3c000000, 0x00000000, 0x40000000, 0x00000000,
+#else
+0x38000000, 0x00000000, 0x3c000000, 0x00000000, 0x40000000, 0x00000000,
+#endif
+0x44000000, 0x00000000, 0x48000000, 0x00000000, 0x50000000, 0x00000000,
+0x54000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+0x59414c44, 0x90010000, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+0x04000000, 0x00000000, 0x08000000, 0x00000000, 0x0c000000, 0x00000000,
+0x10000000, 0x00000000, 0x14000000, 0x00000000, 0x18000000, 0x00000000,
+0x1c000000, 0x00000000, 0x20000000, 0x00000000, 0x24000000, 0x00000000,
+0x28000000, 0x00000000, 0x2c000000, 0x00000000, 0x30000000, 0x00110000,
+0x34000000, 0x00000000, 0x38000000, 0x00000000, 0x3c000000, 0x00000000,
+0x40000000, 0x00000000, 0x44000000, 0x00000000, 0x48000000, 0x00000000,
+0x4c000000, 0x00000000, 0x50000000, 0x00000000, 0x54000000, 0x00000000,
+0x58000000, 0x00000000, 0x5c000000, 0x00000000, 0x60000000, 0x00000000,
+0x64000000, 0x00000000, 0x68000000, 0x00000000, 0x6c000000, 0x00000000,
+0x70000000, 0x00000000, 0x74000000, 0x00000000, 0x78000000, 0x00000000,
+0x7c000000, 0x00000000, 0x80000000, 0x00000000, 0x84000000, 0x00000000,
+0x88000000, 0x00000000, 0x8c000000, 0x00000000, 0x90000000, 0x00000000,
+0x94000000, 0x00000000, 0x98000000, 0x00000000, 0x9c000000, 0x00000000,
+0xa0000000, 0x00000000, 0xa4000000, 0x00000000, 0xa8000000, 0x00000000,
+0xac000000, 0x00000000, 0xb0000000, 0x00000000, 0xb4000000, 0x00000000,
+0xb8000000, 0x00000000, 0xbC000000, 0x00000000, 0x534b4c43, 0xA0000000,

arch/arm/mach-socfpga/spl_agilex5.c line 105

Quoted 10 lines
arch/arm/mach-socfpga/spl_agilex5.c new file +10 -0
+0x00000000, 0x00000000, 0x00000000, 0x98002618, 0x03010016, 0x00000000,
+0x02000008, 0x04000008, 0x03000008, 0x09000008, 0x90000000, 0x00000000,
+0x01000000, 0x03010015, 0x00000000, 0x02000008, 0x03000008, 0x7d000008,
+0x06000008, 0x78000000, 0x01000100, 0x09000000, 0x00000100, 0x01000000,
+0x00000100, 0x00000100, 0x00000100, 0x13000000, 0x01000000, 0x00000100,
+0x00000000, 0x00000000, 0x00000000, 0x40787d01, 0x40787d01, 0x00000000,
+0x00000000, 0x00000000, 0x49524550, 0x14000000, 0x00000000, 0x00000000,
+0x40000000, 0x4d524453, 0x14000000, 0x00000000, 0x00000000, 0x00000000
+};
+#endif

You should not hardcoded handoff here, it should be generated based on user inputs and designs in the platform designer.

Quoted 434 lines
arch/arm/mach-socfpga/spl_agilex5.c new file +2 -0
+
+#define HARDCODED_HANDOFF_DATA_SIZE

(sizeof(hardcoded_handoff_data) / sizeof(u32))

arch/arm/mach-socfpga/spl_agilex5.c new file +26 -0
+
+void board_init_f(ulong dummy)
+{
+	int ret;
+	struct udevice *dev;
+
+	ret = spl_early_init();
+	if (ret)
+		hang();
+
+	socfpga_get_managers_addr();
+
+#ifdef USE_HARDCODED_HANDOFF
+	/* Write hardcoded handoff value into OCRAM handoff area */
+	u32 i;
+
+	for (i = 0; i < HARDCODED_HANDOFF_DATA_SIZE; i++)
+		writel(hardcoded_handoff_data[i],
+		       (u32 *)SOC64_HANDOFF_BASE + i);
+#endif
+
+	sysmgr_pinmux_init();
+
+	if (!(IS_ENABLED(CONFIG_TARGET_SOCFPGA_AGILEX5_SIMICS) ||
+	      IS_ENABLED(CONFIG_TARGET_SOCFPGA_AGILEX5_EMU))) {
+		/* Ensure watchdog is paused when debugging is happening

*/

arch/arm/mach-socfpga/spl_agilex5.c new file +16 -0
+		writel(SYSMGR_WDDBG_PAUSE_ALL_CPU,
+		       socfpga_get_sysmgr_addr() + SYSMGR_SOC64_WDDBG);
+	}
+
+	timer_init();
+
+	ret = uclass_get_device(UCLASS_CLK, 0, &dev);
+	if (ret) {
+		debug("Clock init failed: %d\n", ret);
+		hang();
+	}
+
+	if (!(IS_ENABLED(CONFIG_TARGET_SOCFPGA_AGILEX5_SIMICS) ||
+	      IS_ENABLED(CONFIG_TARGET_SOCFPGA_AGILEX5_EMU))) {
+		/*
+		 * Enable watchdog as early as possible before initializing

other

arch/arm/mach-socfpga/spl_agilex5.c new file +1 -0
+		 * component. Watchdog need to be enabled after clock

driver because

arch/arm/mach-socfpga/spl_agilex5.c new file +11 -0
+		 * it will retrieve the clock frequency from clock driver.
+		 */
+		if (CONFIG_IS_ENABLED(WDT))
+			initr_watchdog();
+	}
+
+	preloader_console_init();
+	print_reset_info();
+	cm_print_clock_quick_summary();
+
+	ret = uclass_get_device_by_name(UCLASS_NOP, "socfpga-secreg",

&dev);

arch/arm/mach-socfpga/spl_agilex5.c new file +19 -0
+	if (ret) {
+		printf("Firewall & secure settings init failed: %d\n", ret);
+		hang();
+	}
+
+#if CONFIG_IS_ENABLED(ALTERA_SDRAM)
+	ret = uclass_get_device(UCLASS_RAM, 0, &dev);
+	if (ret) {
+		debug("DRAM init failed: %d\n", ret);
+		hang();
+	}
+#endif
+
+	mbox_init();
+
+#ifdef CONFIG_CADENCE_QSPI
+	mbox_qspi_open();
+#endif
+}
arch/arm/mach- renamed from arch/arm/mach-socfpga/spl_soc64.c +0 -0

socfpga/spl_soc64.c
index ba6efc1d86..a4ac906ffd 100644

arch/arm/mach-socfpga/spl_soc64.c +91 -5
@@ -1,25 +1,203 @@
 // SPDX-License-Identifier: GPL-2.0
 /*
- *  Copyright (C) 2020 Intel Corporation. All rights reserved
+ *  Copyright (C) 2020-2022 Intel Corporation. All rights reserved
  *
  */
 
+#include <asm/io.h>
+#include <asm/u-boot.h>
+#include <asm/utils.h>
 #include <common.h>
+#include <debug_uart.h>
+#include <dm.h>
+#include <dm/ofnode.h>
+#include <image.h>
+#include <log.h>
 #include <spl.h>
+#include <asm/arch/clock_manager.h>
+#include <asm/arch/firewall.h>
+#include <asm/arch/mailbox_s10.h>
+#include <asm/arch/reset_manager.h>
+#include <asm/arch/system_manager.h>
+#include <asm/arch/smmu_s10.h>
+#include <watchdog.h>
+#include <dm/uclass.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
 u32 spl_boot_device(void)
 {
+	int ret, size;
+	ofnode node;
+	const fdt32_t *phandle_p;
+	u32 phandle;
+	struct udevice *dev;
+
+	node = ofnode_path("/chosen");
+	if (!ofnode_valid(node)) {
+		debug("%s: /chosen node was not found.\n", __func__);
+		goto fallback;
+	}
+
+	phandle_p = ofnode_get_property(node, "u-boot,boot0", &size);
+	if (!phandle_p) {
+		debug("%s: u-boot,boot0 property was not found.\n",
+		      __func__);
+		goto fallback;
+	}
+
+	phandle = fdt32_to_cpu(*phandle_p);
+
+	node = ofnode_get_by_phandle(phandle);
+
+	ret = device_get_global_by_ofnode(node, &dev);
+	if (ret) {
+		debug("%s: Boot device at not found, error: %d\n",
 __func__,
+		      ret);
+		goto fallback;
+	}
+
+	debug("%s: Found boot device %s\n", __func__, dev->name);
+
+	switch (device_get_uclass_id(dev)) {
+	case UCLASS_SPI_FLASH:
+		return BOOT_DEVICE_SPI;
+	case UCLASS_MTD:
+		return BOOT_DEVICE_NAND;
+	case UCLASS_MMC:
+		return BOOT_DEVICE_MMC1;
+	default:
+		debug("%s: Booting from device uclass '%s' is not
 supported\n",
+		      __func__, dev_get_uclass_name(dev));
+	}
+
+fallback:
+	/* Return default boot device */
 	return BOOT_DEVICE_MMC1;
 }
 
 #if IS_ENABLED(CONFIG_SPL_MMC)
 u32 spl_boot_mode(const u32 boot_device)
 {
-	if (IS_ENABLED(CONFIG_SPL_FS_FAT) ||
 IS_ENABLED(CONFIG_SPL_FS_EXT4))
-		return MMCSD_MODE_FS;
-	else
-		return MMCSD_MODE_RAW;
+#if defined(CONFIG_SPL_FS_FAT) || defined(CONFIG_SPL_FS_EXT4)
+	return MMCSD_MODE_FS;
+#else
+	return MMCSD_MODE_RAW;
+#endif
 }
 #endif
+
+/* board specific function prior loading SSBL / U-Boot */
+void spl_perform_fixups(struct spl_image_info *spl_image)
+{
+	/* Setup and Initialize SMMU */
+	socfpga_init_smmu();
+
+#if !(IS_ENABLED(CONFIG_TARGET_SOCFPGA_AGILEX5_SIMICS) || \
+IS_ENABLED(CONFIG_TARGET_SOCFPGA_AGILEX5_EMU))
+	mbox_hps_stage_notify(HPS_EXECUTION_STATE_SSBL);
+#endif
+}
+
+/* This function is to map specified node onto SPL boot devices */
+static int spl_node_to_boot_device(int node)
+{
+	const void *blob = gd->fdt_blob;
+	struct udevice *parent;
+	const char *prop;
+
+	if (!uclass_get_device_by_of_offset(UCLASS_MMC, node, &parent))
+		return BOOT_DEVICE_MMC1;
+	else if (!uclass_get_device_by_of_offset(UCLASS_SPI_FLASH, node,

&parent))

arch/arm/mach-socfpga/spl_soc64.c +2 -0
+		return BOOT_DEVICE_SPI;
+	else if (!uclass_get_device_by_of_offset(UCLASS_MTD, node,

&parent))

arch/arm/mach-socfpga/spl_soc64.c +56 -0
+		return BOOT_DEVICE_NAND;
+
+	prop = fdt_getprop(blob, node, "device_type", NULL);
+	if (prop) {
+		if (!strcmp(prop, "memory"))
+			return BOOT_DEVICE_RAM;
+
+		printf("%s: unknown device_type %s\n", __func__, prop);
+	}
+
+	return -1;
+}
+
+static void default_spl_boot_list(u32 *spl_boot_list, int length)
+{
+	spl_boot_list[0] = BOOT_DEVICE_MMC1;
+
+	if (length > 1)
+		spl_boot_list[1] = BOOT_DEVICE_SPI;
+
+	if (length > 2)
+		spl_boot_list[2] = BOOT_DEVICE_NAND;
+}
+
+void board_boot_order(u32 *spl_boot_list)
+{
+	int idx = 0;
+	const void *blob = gd->fdt_blob;
+	int chosen_node = fdt_path_offset(blob, "/chosen");
+	const char *conf;
+	int elem;
+	int boot_device;
+	int node;
+	int length;
+
+	/* expect valid initialized spl_boot_list */
+	if (!spl_boot_list)
+		return;
+
+	length = 1;
+	while (spl_boot_list[length] == spl_boot_list[length - 1])
+		length++;
+
+	debug("%s: chosen_node is %d\n", __func__, chosen_node);
+	if (chosen_node < 0) {
+		printf("%s: /chosen not found, using default\n", __func__);
+		default_spl_boot_list(spl_boot_list, length);
+		return;
+	}
+
+	for (elem = 0;
+	    (conf = fdt_stringlist_get(blob, chosen_node,
+			"u-boot,spl-boot-order", elem, NULL));
+	    elem++) {
+		if (idx >= length) {
+			printf("%s: limit %d to spl_boot_list exceeded\n",

__func__,

arch/arm/mach-socfpga/spl_soc64.c +8 -0
+			       length);
+			break;
+		}
+
+		/* Resolve conf item as a path in device tree */
+		node = fdt_path_offset(blob, conf);
+		if (node < 0) {
+			debug("%s: could not find %s in FDT\n", __func__,

conf);

arch/arm/mach-socfpga/spl_soc64.c +7 -0
+			continue;
+		}
+
+		/* Try to map spl node back onto SPL boot devices */
+		boot_device = spl_node_to_boot_device(node);
+		if (boot_device < 0) {
+			debug("%s: could not map node @%x to a boot-

device\n",

arch/arm/mach-socfpga/spl_soc64.c +13 -0
+			      __func__, node);
+			continue;
+		}
+
+		spl_boot_list[idx] = boot_device;
+		debug("%s: spl_boot_list[%d] = %u\n", __func__, idx,
+		      spl_boot_list[idx]);
+		idx++;
+	}
+
+	if (idx == 0) {
+		if (!conf && !elem) {
+			printf("%s: spl-boot-order invalid, using default\n",

__func__);

arch/arm/mach-socfpga/spl_soc64.c +3 -0
+			default_spl_boot_list(spl_boot_list, length);
+		} else {
+			printf("%s: no valid element spl-boot-order list\n",

__func__);

arch/arm/mach-socfpga/spl_soc64.c +3 -0
+		}
+	}
+}
arch/arm/mach- renamed from arch/arm/mach-socfpga/u-boot-spl-soc64.lds +0 -0

socfpga/u-boot-spl-soc64.lds
new file mode 100644
index 0000000000..8beef91d17

arch/arm/mach-socfpga/u-boot-spl-soc64.lds new file +23 -0
@@ -0,0 +1,93 @@
+/*
+ * (C) Copyright 2018
+ * Intel Corporation <www.intel.com>
+ *
+ * (C) Copyright 2013
+ * David Feng <[email protected]>
+ *
+ * (C) Copyright 2002
+ * Gary Jennejohn, DENX Software Engineering, <[email protected]>
+ *
+ * (C) Copyright 2010
+ * Texas Instruments, <www.ti.com>
+ *	Aneesh V <[email protected]>
+ *
+ * SPDX-License-Identifier: GPL-2.0
+ */
+
+MEMORY { .sram : ORIGIN = CONFIG_SPL_TEXT_BASE,
+		LENGTH = CONFIG_SPL_MAX_SIZE }
+MEMORY { .sdram : ORIGIN = CONFIG_SPL_BSS_START_ADDR,
+		LENGTH = CONFIG_SPL_BSS_MAX_SIZE }
+
+OUTPUT_FORMAT("elf64-littleaarch64", "elf64-littleaarch64", "elf64-

littleaarch64")

arch/arm/mach-socfpga/u-boot-spl-soc64.lds new file +70 -0
+OUTPUT_ARCH(aarch64)
+ENTRY(_start)
+SECTIONS
+{
+	.text : {
+		. = ALIGN(8);
+		__image_copy_start = .;
+		CPUDIR/start.o (.text*)
+		*(.text*)
+	} >.sram
+
+	.rodata : {
+		. = ALIGN(8);
+		*(SORT_BY_ALIGNMENT(SORT_BY_NAME(.rodata*)))
+	} >.sram
+
+	.data : {
+		. = ALIGN(8);
+		/* Run time .data section starting at this location */
+		__data_start = .;
+		*(.data*)
+		/* Run time .data section ending at this location */
+		__data_end = .;
+	} >.sram
+
+	. = ALIGN(8);
+	/* Preserve original .data section starting at this location */
+	__preserve_data_start = .;
+	. = __preserve_data_start + (__data_end - __data_start);
+	/* Preserve original .data section ending at this location */
+	__preserve_data_end = .;
+
+	. = ALIGN(8);
+	__u_boot_list . : {
+		KEEP(*(SORT(__u_boot_list*)));
+	} >.sram
+
+	.image_copy_end : {
+		. = ALIGN(8);
+		*(.__image_copy_end)
+	} >.sram
+
+	.end : {
+		. = ALIGN(8);
+		*(.__end)
+	} >.sram
+
+	_image_binary_end = .;
+
+	.bss_start (NOLOAD) : {
+		. = ALIGN(8);
+		KEEP(*(.__bss_start));
+	} >.sdram
+
+	.bss (NOLOAD) : {
+		*(.bss*)
+		 . = ALIGN(8);
+	} >.sdram
+
+	.bss_end (NOLOAD) : {
+		KEEP(*(.__bss_end));
+	} >.sdram
+
+	/DISCARD/ : { *(.dynsym) }
+	/DISCARD/ : { *(.dynstr*) }
+	/DISCARD/ : { *(.dynamic*) }
+	/DISCARD/ : { *(.plt*) }
+	/DISCARD/ : { *(.interp*) }
+	/DISCARD/ : { *(.gnu*) }
+}
arch/arm/mach-socfpga/wrap_handoff_soc64.c +6 -1
index e7cb5ea89c..23434dbf6c 100644
@@ -1,6 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0
 /*
- * Copyright (C) 2020-2021 Intel Corporation <www.intel.com>
+ * Copyright (C) 2020-2022 Intel Corporation <www.intel.com>
  *
  */
 
@@ -19,7 +19,12 @@ static enum endianness check_endianness(u32
 handoff)
 	case SOC64_HANDOFF_MAGIC_FPGA:
 	case SOC64_HANDOFF_MAGIC_DELAY:
 	case SOC64_HANDOFF_MAGIC_CLOCK:
+#if IS_ENABLED(CONFIG_TARGET_SOCFPGA_AGILEX5)
+	case SOC64_HANDOFF_MAGIC_PERI:
+	case SOC64_HANDOFF_MAGIC_SDRAM:
+#else
 	case SOC64_HANDOFF_MAGIC_MISC:
+#endif
 		return BIG_ENDIAN;
 #if IS_ENABLED(CONFIG_TARGET_SOCFPGA_N5X)

case SOC64_HANDOFF_DDR_UMCTL2_MAGIC:
--
2.26.2

#9 lore raw

PATCH 4/17 arch: arm: mach-socfpga: include: mach: add new platform agilex5 mach-socfpga enablement

In reply to Jit Loon Lim

This is for new platform enablement for agilex5. Add platform related header files to enable new product.

---
 .../include/mach/base_addr_soc64.h            |  43 +++++-
 .../mach-socfpga/include/mach/clock_manager.h |   5 +-
 .../include/mach/clock_manager_agilex5.h      |  12 ++
 arch/arm/mach-socfpga/include/mach/firewall.h |  42 +++++-
 .../mach-socfpga/include/mach/handoff_soc64.h |  25 +++-
 .../mach-socfpga/include/mach/mailbox_s10.h   |  32 +++--
 .../include/mach/reset_manager_soc64.h        |  33 ++++-
 .../mach-socfpga/include/mach/smmu_agilex5.h  |  30 +++++
 arch/arm/mach-socfpga/include/mach/smmu_s10.h |  73 ++++++++++
 .../include/mach/system_manager_soc64.h       | 126 ++++++++++++++++--
 arch/arm/mach-socfpga/include/mach/timer.h    |  30 +++++
 11 files changed, 419 insertions(+), 32 deletions(-)
 create mode 100644 arch/arm/mach-socfpga/include/mach/clock_manager_agilex5.h
 create mode 100644 arch/arm/mach-socfpga/include/mach/smmu_agilex5.h
 create mode 100644 arch/arm/mach-socfpga/include/mach/smmu_s10.h
arch/arm/mach-socfpga/include/mach/base_addr_soc64.h +42 -1
index 3f899fcfa3..4a88770638 100644
@@ -1,21 +1,60 @@
 /* SPDX-License-Identifier: GPL-2.0 */
 /*
- * Copyright (C) 2016-2021 Intel Corporation <www.intel.com>
+ * Copyright (C) 2016-2023 Intel Corporation <www.intel.com>
  */
 
 #ifndef _SOCFPGA_SOC64_BASE_HARDWARE_H_
 #define _SOCFPGA_SOC64_BASE_HARDWARE_H_
 
+#if IS_ENABLED(CONFIG_TARGET_SOCFPGA_AGILEX5)
+#define SOCFPGA_CCU_ADDRESS			0x1c000000
+#define SOCFPGA_F2SDRAM_MGR_ADDRESS		0x18001000
+#define SOCFPGA_SMMU_ADDRESS			0x16000000
+#define SOCFPGA_OCRAM_FIREWALL_ADDRESS		0x108cc400
+#define SOCFPGA_MAILBOX_ADDRESS			0x10a30000
+#define SOCFPGA_UART0_ADDRESS			0x10c02000
+#define SOCFPGA_UART1_ADDRESS			0x10c02100
+#define SOCFPGA_SPTIMER0_ADDRESS		0x10c03000
+#define SOCFPGA_SPTIMER1_ADDRESS		0x10c03100
+#define SOCFPGA_SYSTIMER0_ADDRESS		0x10d00000
+#define SOCFPGA_SYSTIMER1_ADDRESS		0x10d00100
+#define SOCFPGA_L4WD0_ADDRESS			0x10d00200
+#define SOCFPGA_L4WD1_ADDRESS			0x10d00300
+#define SOCFPGA_L4WD2_ADDRESS			0x10d00400
+#define SOCFPGA_L4WD3_ADDRESS			0x10d00500
+#define SOCFPGA_L4WD4_ADDRESS			0x10d00600
+#define SOCFPGA_GTIMER_SEC_ADDRESS		0x10d01000
+#define SOCFPGA_GTIMER_NSEC_ADDRESS		0x10d02000
+#define SOCFPGA_CLKMGR_ADDRESS			0x10d10000
+#define SOCFPGA_RSTMGR_ADDRESS			0x10d11000
+#define SOCFPGA_SYSMGR_ADDRESS			0x10d12000
+#define SOCFPGA_OCRAM_ADDRESS			0x00000000
+#define SOCFPGA_FW_DDR_CCU_DMI0_ADDRESS		0x18000800
+#define SOCFPGA_FW_DDR_CCU_DMI1_ADDRESS		0x18000A00
+#define SOCFPGA_FW_TBU2NOC_ADDRESS		0x18000C00
+#define SOCFPGA_FIREWALL_L4_PER			0xffd21000 /* TODO */
+#define SOCFPGA_FIREWALL_L4_SYS			0xffd21100 /* TODO */
+#define SOCFPGA_FIREWALL_SOC2FPGA		0xffd21200 /* TODO */
+#define SOCFPGA_FIREWALL_LWSOC2FPGA		0xffd21300 /* TODO */
+#define SOCFPGA_FIREWALL_TCU			0xffd21400 /* TODO */
+#define SOCFPGA_FIREWALL_PRIV_MEMORYMAP_PRIV	0xffd24800 /* TODO */
+#define SOCFPGA_DMANONSECURE_ADDRESS		0xffda0000 /* TODO */
+#define SOCFPGA_DMASECURE_ADDRESS		0xffda1000 /* TODO */
+#define GICD_BASE				0x1d000000
+#define GICR_BASE				0x1d060000
+#else
 #define SOCFPGA_CCU_ADDRESS			0xf7000000
 #define SOCFPGA_SDR_SCHEDULER_ADDRESS		0xf8000400
 #define SOCFPGA_HMC_MMR_IO48_ADDRESS		0xf8010000
 #define SOCFPGA_SDR_ADDRESS			0xf8011000
+#define SOCFPGA_FW_MPFE_SCR_ADDRESS		0xf8020000
 #if IS_ENABLED(CONFIG_TARGET_SOCFPGA_AGILEX) || \
 	IS_ENABLED(CONFIG_TARGET_SOCFPGA_N5X)
 #define SOCFPGA_FW_MPU_DDR_SCR_ADDRESS		0xf8020200
 #else
 #define SOCFPGA_FW_MPU_DDR_SCR_ADDRESS		0xf8020100
 #endif
+#define SOCFPGA_F2SDRAM_MGR_ADDRESS		0xf8024000
 #define SOCFPGA_SMMU_ADDRESS			0xfa000000
 #define SOCFPGA_MAILBOX_ADDRESS			0xffa30000
 #define SOCFPGA_UART0_ADDRESS			0xffc02000
@@ -39,10 +78,12 @@
 #define SOCFPGA_FIREWALL_SOC2FPGA		0xffd21200
 #define SOCFPGA_FIREWALL_LWSOC2FPGA		0xffd21300
 #define SOCFPGA_FIREWALL_TCU			0xffd21400
+#define SOCFPGA_FIREWALL_PRIV_MEMORYMAP_PRIV	0xffd24800
 #define SOCFPGA_DMANONSECURE_ADDRESS		0xffda0000
 #define SOCFPGA_DMASECURE_ADDRESS		0xffda1000
 #define SOCFPGA_OCRAM_ADDRESS			0xffe00000
 #define GICD_BASE				0xfffc1000
 #define GICC_BASE				0xfffc2000
+#endif /* IS_ENABLED(CONFIG_TARGET_SOCFPGA_AGILEX5) */
 
 #endif /* _SOCFPGA_SOC64_BASE_HARDWARE_H_ */
arch/arm/mach-socfpga/include/mach/clock_manager.h +4 -1
index a8cb07a1c4..ef92536662 100644
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0+ */
 /*
- *  Copyright (C) 2013-2017 Altera Corporation <www.altera.com>
+ *  Copyright (C) 2013-2023 Altera Corporation <www.altera.com>
  */
 
 #ifndef _CLOCK_MANAGER_H_
@@ -14,6 +14,7 @@ int cm_wait_for_fsm(void);
 void cm_print_clock_quick_summary(void);
 unsigned long cm_get_mpu_clk_hz(void);
 unsigned int cm_get_qspi_controller_clk_hz(void);
+unsigned int cm_get_mmc_controller_clk_hz(void);
 
 #if defined(CONFIG_TARGET_SOCFPGA_SOC64)
 int cm_set_qspi_controller_clk_hz(u32 clk_hz);
@@ -28,6 +29,8 @@ int cm_set_qspi_controller_clk_hz(u32 clk_hz);
 #include <asm/arch/clock_manager_s10.h>
 #elif defined(CONFIG_TARGET_SOCFPGA_AGILEX)
 #include <asm/arch/clock_manager_agilex.h>
+#elif defined(CONFIG_TARGET_SOCFPGA_AGILEX5)
+#include <asm/arch/clock_manager_agilex5.h>
 #elif IS_ENABLED(CONFIG_TARGET_SOCFPGA_N5X)
 #include <asm/arch/clock_manager_n5x.h>
 #endif
arch/arm/mach-socfpga/include/mach/clock_manager_agilex5.h new file +12 -0
new file mode 100644
index 0000000000..cbad0fdec7
@@ -0,0 +1,12 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright (C) 2019-2022 Intel Corporation <www.intel.com>
+ */
+
+#ifndef _CLOCK_MANAGER_AGILEX5_
+#define _CLOCK_MANAGER_AGILEX5_
+
+#include <asm/arch/clock_manager_soc64.h>
+#include "../../../../../drivers/clk/altera/clk-agilex5.h"
+
+#endif /* _CLOCK_MANAGER_AGILEX5_ */
arch/arm/mach-socfpga/include/mach/firewall.h +41 -1

70 lines not on this page · raw message

arch/arm/mach-socfpga/include/mach/handoff_soc64.h +20 -5
index 902fc6bfb5..27f545734f 100644
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0
  *
- * Copyright (C) 2016-2021 Intel Corporation <www.intel.com>
+ * Copyright (C) 2016-2023 Intel Corporation <www.intel.com>
  *
  */
 
@@ -17,7 +17,12 @@
 #define SOC64_HANDOFF_MAGIC_FPGA	0x46504741
 #define SOC64_HANDOFF_MAGIC_DELAY	0x444C4159
 #define SOC64_HANDOFF_MAGIC_CLOCK	0x434C4B53
+#if IS_ENABLED(CONFIG_TARGET_SOCFPGA_AGILEX5)
+#define SOC64_HANDOFF_MAGIC_PERI	0x50455249
+#define SOC64_HANDOFF_MAGIC_SDRAM	0x5344524d
+#else
 #define SOC64_HANDOFF_MAGIC_MISC	0x4D495343
+#endif
 
 #define SOC64_HANDOFF_OFFSET_LENGTH	0x4
 #define SOC64_HANDOFF_OFFSET_DATA	0x10
@@ -27,6 +32,8 @@
 	IS_ENABLED(CONFIG_TARGET_SOCFPGA_AGILEX)
 #define SOC64_HANDOFF_BASE		0xFFE3F000
 #define SOC64_HANDOFF_MISC		(SOC64_HANDOFF_BASE + 0x610)
+#elif IS_ENABLED(CONFIG_TARGET_SOCFPGA_AGILEX5)
+#define SOC64_HANDOFF_BASE		0x0007F000
 #elif IS_ENABLED(CONFIG_TARGET_SOCFPGA_N5X)
 #define SOC64_HANDOFF_BASE		0xFFE5F000
 #define SOC64_HANDOFF_MISC		(SOC64_HANDOFF_BASE + 0x630)
@@ -58,13 +65,21 @@
 #define SOC64_HANDOFF_FPGA		(SOC64_HANDOFF_BASE + 0x330)
 #define SOC64_HANDOFF_DELAY		(SOC64_HANDOFF_BASE + 0x3F0)
 #define SOC64_HANDOFF_CLOCK		(SOC64_HANDOFF_BASE + 0x580)
+#if IS_ENABLED(CONFIG_TARGET_SOCFPGA_AGILEX5)
+#define SOC64_HANDOFF_PERI		(SOC64_HANDOFF_BASE + 0x620)
+#define SOC64_HANDOFF_SDRAM		(SOC64_HANDOFF_BASE + 0x634)
+#define SOC64_HANDOFF_SDRAM_LEN		1
+#endif
 
 #if IS_ENABLED(CONFIG_TARGET_SOCFPGA_STRATIX10)
-#define SOC64_HANDOFF_CLOCK_OSC	(SOC64_HANDOFF_BASE + 0x608)
-#define SOC64_HANDOFF_CLOCK_FPGA	(SOC64_HANDOFF_BASE + 0x60C)
+#define SOC64_HANDOFF_CLOCK_OSC			(SOC64_HANDOFF_BASE + 0x608)
+#define SOC64_HANDOFF_CLOCK_FPGA		(SOC64_HANDOFF_BASE + 0x60C)
+#elif IS_ENABLED(CONFIG_TARGET_SOCFPGA_AGILEX5)
+#define SOC64_HANDOFF_CLOCK_OSC			(SOC64_HANDOFF_BASE + 0x610)
+#define SOC64_HANDOFF_CLOCK_FPGA		(SOC64_HANDOFF_BASE + 0x614)
 #else
-#define SOC64_HANDOFF_CLOCK_OSC	(SOC64_HANDOFF_BASE + 0x5fc)
-#define SOC64_HANDOFF_CLOCK_FPGA	(SOC64_HANDOFF_BASE + 0x600)
+#define SOC64_HANDOFF_CLOCK_OSC			(SOC64_HANDOFF_BASE + 0x5fc)
+#define SOC64_HANDOFF_CLOCK_FPGA		(SOC64_HANDOFF_BASE + 0x600)
 #endif
 
 #define SOC64_HANDOFF_MUX_LEN			96
arch/arm/mach-socfpga/include/mach/mailbox_s10.h +22 -10
index fbaf11597e..502b29bd49 100644
@@ -112,17 +112,22 @@ enum ALT_SDM_MBOX_RESP_CODE {
 };
 
 /* Mailbox command list */
-#define MBOX_RESTART		2
-#define MBOX_CONFIG_STATUS	4
-#define MBOX_RECONFIG		6
-#define MBOX_RECONFIG_MSEL	7
-#define MBOX_RECONFIG_DATA	8
-#define MBOX_RECONFIG_STATUS	9
+#define MBOX_RESTART			2
+#define MBOX_CONFIG_STATUS		4
+#define MBOX_RECONFIG			6
+#define MBOX_RECONFIG_MSEL		7
+#define MBOX_RECONFIG_DATA		8
+#define MBOX_RECONFIG_STATUS		9
 #define MBOX_VAB_SRC_CERT		11
-#define MBOX_QSPI_OPEN		50
-#define MBOX_QSPI_CLOSE		51
-#define MBOX_QSPI_DIRECT	59
-#define MBOX_REBOOT_HPS		71
+#define MBOX_GET_USERCODE		19
+#define MBOX_QSPI_OPEN			50
+#define MBOX_QSPI_CLOSE			51
+#define MBOX_QSPI_DIRECT		59
+#define MBOX_REBOOT_HPS			71
+#define MBOX_GET_SUBPARTITION_TABLE	90
+#define MBOX_RSU_STATUS			91
+#define MBOX_RSU_UPDATE			92
+#define MBOX_HPS_STAGE_NOTIFY		93
 
 /* Mailbox registers */
 #define MBOX_CIN			0	/* command valid offset */
@@ -166,6 +171,11 @@ enum ALT_SDM_MBOX_RESP_CODE {
 #define RCF_SOFTFUNC_STATUS_SEU_ERROR			BIT(3)
 #define RCF_PIN_STATUS_NSTATUS				BIT(31)
 
+/* Defines for HPS_STAGE_NOTIFY */
+#define HPS_EXECUTION_STATE_FSBL	0
+#define HPS_EXECUTION_STATE_SSBL	1
+#define HPS_EXECUTION_STATE_OS		2
+
 int mbox_send_cmd(u8 id, u32 cmd, u8 is_indirect, u32 len, u32 *arg, u8 urgent,
 		  u32 *resp_buf_len, u32 *resp_buf);
 int mbox_send_cmd_psci(u8 id, u32 cmd, u8 is_indirect, u32 len, u32 *arg,
@@ -182,6 +192,8 @@ int mbox_qspi_open(void);
 #endif
 
 int mbox_reset_cold(void);
+int mbox_hps_stage_notify(u32 execution_stage);
+int mbox_hps_stage_notify_psci(u32 execution_stage);
 int mbox_get_fpga_config_status(u32 cmd);
 int mbox_get_fpga_config_status_psci(u32 cmd);
 #endif /* _MAILBOX_S10_H_ */
arch/arm/mach-socfpga/include/mach/reset_manager_soc64.h +28 -5
index c8bb727aa2..0f6f1a43da 100644
@@ -1,17 +1,25 @@
 /* SPDX-License-Identifier: GPL-2.0 */
 /*
- *  Copyright (C) 2016-2019 Intel Corporation <www.intel.com>
+ *  Copyright (C) 2016-2023 Intel Corporation <www.intel.com>
  */
 
 #ifndef _RESET_MANAGER_SOC64_H_
 #define _RESET_MANAGER_SOC64_H_
 
+#ifndef __ASSEMBLY__
 void reset_deassert_peripherals_handoff(void);
 int cpu_has_been_warmreset(void);
 void print_reset_info(void);
-void socfpga_bridges_reset(int enable);
+void socfpga_bridges_reset(int enable, unsigned int mask);
+void socfpga_bridges_reset_psci(int enable, unsigned int mask);
+void l2_reset_cpu(void);
+void l2_reset_cpu_psci(void);
+#endif
 
 #define RSTMGR_SOC64_STATUS	0x00
+#define RSTMGR_SOC64_HDSKEN	0x10
+#define RSTMGR_SOC64_HDSKREQ	0x14
+#define RSTMGR_SOC64_HDSKACK	0x18
 #define RSTMGR_SOC64_MPUMODRST	0x20
 #define RSTMGR_SOC64_PER0MODRST	0x24
 #define RSTMGR_SOC64_PER1MODRST	0x28
@@ -19,18 +27,33 @@ void socfpga_bridges_reset(int enable);
 
 #define RSTMGR_MPUMODRST_CORE0		0
 #define RSTMGR_PER0MODRST_OCP_MASK	0x0020bf00
-#define RSTMGR_BRGMODRST_DDRSCH_MASK	0X00000040
-#define RSTMGR_BRGMODRST_FPGA2SOC_MASK	0x00000004
+
+#define RSTMGR_BRGMODRST_SOC2FPGA_MASK		BIT(0)
+#define RSTMGR_BRGMODRST_LWSOC2FPGA_MASK	BIT(1)
+#define RSTMGR_BRGMODRST_FPGA2SOC_MASK		BIT(2)
+#define RSTMGR_BRGMODRST_F2SDRAM0_MASK		BIT(3)
+#define RSTMGR_BRGMODRST_F2SDRAM1_MASK		BIT(4)
+#define RSTMGR_BRGMODRST_F2SDRAM2_MASK		BIT(5)
+#define RSTMGR_BRGMODRST_DDRSCH_MASK		BIT(6)
+
+#define RSTMGR_HDSKEN_FPGAHSEN		BIT(2)
+#define RSTMGR_HDSKREQ_FPGAHSREQ	BIT(2)
 
 /* SDM, Watchdogs and MPU warm reset mask */
-#define RSTMGR_STAT_SDMWARMRST		BIT(1)
+#define RSTMGR_STAT_SDMWARMRST		0x2
 #define RSTMGR_STAT_MPU0RST_BITPOS	8
 #define RSTMGR_STAT_L4WD0RST_BITPOS	16
+#if IS_ENABLED(CONFIG_TARGET_SOCFPGA_AGILEX5)
+#define RSTMGR_STAT_L4WD0RST_BIT	0x1F0000
+#define RSTMGR_L4WD_MPU_WARMRESET_MASK	RSTMGR_STAT_SDMWARMRST | \
+		RSTMGR_STAT_L4WD0RST_BIT
+#else
 #define RSTMGR_L4WD_MPU_WARMRESET_MASK	(RSTMGR_STAT_SDMWARMRST | \
 		GENMASK(RSTMGR_STAT_MPU0RST_BITPOS + 3, \
 			RSTMGR_STAT_MPU0RST_BITPOS) | \
 		GENMASK(RSTMGR_STAT_L4WD0RST_BITPOS + 3, \
 			RSTMGR_STAT_L4WD0RST_BITPOS))
+#endif
 
 /*
  * SocFPGA Stratix10 reset IDs, bank mapping is as follows:
arch/arm/mach-socfpga/include/mach/smmu_agilex5.h new file +30 -0
new file mode 100644
index 0000000000..0bb79896a3
@@ -0,0 +1,30 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright (C) 2023 Intel Corporation. All rights reserved
+ *
+ */
+
+void socfpga_init_smmu(void);
+#define SOCFPGA_NEXT_TBU_PERIPHERAL	4
+/* DMA0 STREAMID */
+#define SYSMGR_DMA0_SID_ADDR	SOCFPGA_SYSMGR_ADDRESS + 0x17C
+/* DMA1 STREAMID */
+#define SYSMGR_DMA1_SID_ADDR	SOCFPGA_SYSMGR_ADDRESS + 0x180
+/* SDM  STREAMID */
+#define SYSMGR_SDM_SID_ADDR	SOCFPGA_SYSMGR_ADDRESS + 0x184
+/* USB2 STREAMID */
+#define SYSMGR_USB2_SID_ADDR	SOCFPGA_SYSMGR_ADDRESS + 0x188
+/* USB3 STREAMID, FUTURE USE */
+#define SYSMGR_USB3_SID_ADDR	SOCFPGA_SYSMGR_ADDRESS + 0x18C
+/* SDMMC STREAMID */
+#define SYSMGR_SDMMC_SID_ADDR	SOCFPGA_SYSMGR_ADDRESS + 0x190
+/* NAND STREAMID */
+#define SYSMGR_NAND_SID_ADDR	SOCFPGA_SYSMGR_ADDRESS + 0x194
+/* ETR STREAMID */
+#define SYSMGR_ETR_SID_ADDR	SOCFPGA_SYSMGR_ADDRESS + 0x198
+/* TSN0 STREAMID */
+#define SYSMGR_TSN0_SID_ADDR	SOCFPGA_SYSMGR_ADDRESS + 0x19C
+/* TSN1 STREAMID */
+#define SYSMGR_TSN1_SID_ADDR	SOCFPGA_SYSMGR_ADDRESS + 0x1A0
+/* TSN2 STREAMID */
+#define SYSMGR_TSN2_SID_ADDR	SOCFPGA_SYSMGR_ADDRESS + 0x1A4
arch/arm/mach-socfpga/include/mach/smmu_s10.h new file +73 -0

73 lines not on this page · raw message

arch/arm/mach-socfpga/include/mach/system_manager_soc64.h +117 -9

159 lines not on this page · raw message

arch/arm/mach-socfpga/include/mach/timer.h +30 -0
index 82596e412e..ac44b2ea45 100644
@@ -6,6 +6,9 @@
 #ifndef _SOCFPGA_TIMER_H_
 #define _SOCFPGA_TIMER_H_
 
+#include <asm/barriers.h>
+#include <div64.h>
+
 struct socfpga_timer {
 	u32	load_val;
 	u32	curr_val;
@@ -14,4 +17,31 @@ struct socfpga_timer {
 	u32	int_stat;
 };
 
+static __always_inline u64 __socfpga_get_time_stamp(void)
+{
+	u64 cntpct;
+
+	isb();
+	asm volatile("mrs %0, cntpct_el0" : "=r" (cntpct));
+	return cntpct;
+}
+
+static __always_inline u64 __socfpga_usec_to_tick(u64 usec)
+{
+	u64 tick = usec;
+	u64 cntfrq;
+
+	asm volatile("mrs %0, cntfrq_el0" : "=r" (cntfrq));
+	tick *= cntfrq;
+	do_div(tick, 1000000);
+	return tick;
+}
+
+static __always_inline void __socfpga_udelay(u64 usec)
+{
+	u64 tmp = __socfpga_get_time_stamp() + __socfpga_usec_to_tick(usec);
+
+	while (__socfpga_get_time_stamp() < tmp + 1)
+		;
+}
 #endif
Signature · 1 line
2.26.2
#10 lore raw

PATCH 5/17 board: intel: add new platform agilex5 socdk

In reply to Jit Loon Lim

This is for new platform enablement for agilex5. Add new platform socdk and update maintainer list.

---
 board/intel/agilex5-socdk/MAINTAINERS | 8 ++++++++
 board/intel/agilex5-socdk/Makefile    | 7 +++++++
 board/intel/agilex5-socdk/socfpga.c   | 7 +++++++
 3 files changed, 22 insertions(+)
 create mode 100644 board/intel/agilex5-socdk/MAINTAINERS
 create mode 100644 board/intel/agilex5-socdk/Makefile
 create mode 100644 board/intel/agilex5-socdk/socfpga.c
board/intel/agilex5-socdk/MAINTAINERS new file +8 -0
new file mode 100644
index 0000000000..f0bb2b796b
@@ -0,0 +1,8 @@
+SOCFPGA BOARD
+M:	Tien Fong Chee <[email protected]>
+M:	Jit Loon Lim <[email protected]>
+M:	Sieu Mun Tang <[email protected]>
+S:	Maintained
+F:	board/intel/agilex5-socdk/
+F:	include/configs/socfpga_agilex5_socdk.h
+F:	configs/socfpga_agilex5_defconfig
board/intel/agilex5-socdk/Makefile new file +7 -0
new file mode 100644
index 0000000000..52f7de8880
@@ -0,0 +1,7 @@
+#
+# Copyright (C) 2022 Intel Corporation <www.intel.com>
+#
+# SPDX-License-Identifier:	GPL-2.0
+#
+
+obj-y	:= socfpga.o
board/intel/agilex5-socdk/socfpga.c new file +7 -0
new file mode 100644
index 0000000000..ae5c04557c
@@ -0,0 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (C) 2022 Intel Corporation <www.intel.com>
+ *
+ */
+
+#include <common.h>
Signature · 1 line
2.26.2
#11 lore raw

PATCH 6/17 configs: add new platform agilex5 defconfig

In reply to Jit Loon Lim

This is for new platform enablement for agilex5.
Add new platform defconfig for new platform.

---
 configs/socfpga_agilex5_defconfig        | 123 +++++++++++++++++++++++
 configs/socfpga_agilex5_legacy_defconfig |  85 ++++++++++++++++
 2 files changed, 208 insertions(+)
 create mode 100644 configs/socfpga_agilex5_defconfig
 create mode 100644 configs/socfpga_agilex5_legacy_defconfig
configs/socfpga_agilex5_defconfig new file +123 -0
new file mode 100644
index 0000000000..6a90fa0b27
@@ -0,0 +1,123 @@
+CONFIG_ARM=y
+CONFIG_SPL_LDSCRIPT="arch/arm/mach-socfpga/u-boot-spl-soc64.lds"
+CONFIG_SYS_SPI_U_BOOT_OFFS=0x02000000
+CONFIG_ARCH_SOCFPGA=y
+CONFIG_TEXT_BASE=0x80200000
+CONFIG_SYS_MALLOC_F_LEN=0x2000
+CONFIG_NR_DRAM_BANKS=2
+CONFIG_ENV_SIZE=0x2000
+CONFIG_DM_GPIO=y
+CONFIG_DEFAULT_DEVICE_TREE="socfpga_agilex5_socdk"
+# CONFIG_SPL_MMC is not set
+CONFIG_TARGET_SOCFPGA_AGILEX5_SIMICS=y
+CONFIG_TARGET_SOCFPGA_AGILEX5_SOCDK=y
+CONFIG_IDENT_STRING="socfpga_agilex5"
+CONFIG_SPL_FS_FAT=y
+CONFIG_DISTRO_DEFAULTS=y
+CONFIG_FIT=y
+CONFIG_SPL_FIT_SIGNATURE=y
+CONFIG_SPL_LOAD_FIT=y
+CONFIG_SPL_LOAD_FIT_ADDRESS=0x82000000
+# CONFIG_USE_SPL_FIT_GENERATOR is not set
+CONFIG_QSPI_BOOT=y
+CONFIG_BOOTDELAY=5
+CONFIG_USE_BOOTARGS=y
+CONFIG_BOOTARGS="console=ttyS0,115200 initrd=0x90000000 root=/dev/ram0 rw init=/sbin/init ramdisk_size=10000000 earlycon panic=-1 nosmp kvm-arm.mode=nvhe"
+CONFIG_LEGACY_IMAGE_FORMAT=y
+# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set
+CONFIG_SPL_CRC32=y
+CONFIG_SPL_CACHE=y
+CONFIG_SPL_ATF=y
+CONFIG_SPL_ATF_NO_PLATFORM_PARAM=y
+CONFIG_SYS_PROMPT="SOCFPGA_AGILEX5 # "
+CONFIG_CMD_NVEDIT_SELECT=y
+CONFIG_CMD_MEMTEST=y
+CONFIG_CMD_GPIO=y
+CONFIG_CMD_I2C=y
+CONFIG_CMD_MMC=y
+CONFIG_CMD_SF=y
+CONFIG_PHY=y
+CONFIG_SPL_PHY=y
+CONFIG_PHY_CADENCE_COMBOPHY=y
+CONFIG_DM_MMC=y
+CONFIG_SPL_MMC=y
+CONFIG_SPL_DM_MMC=y
+CONFIG_MMC_SDHCI=y
+CONFIG_MMC_SDHCI_ADMA=y
+CONFIG_SPL_MMC_SDHCI_ADMA=y
+CONFIG_MMC_SDHCI_CADENCE=y
+CONFIG_CMD_FAT=y
+CONFIG_DOS_PARTITION=y
+CONFIG_SPL_DOS_PARTITION=y
+CONFIG_SPL_SYS_DISABLE_DCACHE_OPS=y
+CONFIG_CMD_MTD=y
+CONFIG_CMD_NAND_TRIMFFS=y
+CONFIG_CMD_NAND_LOCK_UNLOCK=y
+CONFIG_CMD_SPI=y
+CONFIG_CMD_USB=y
+CONFIG_CMD_CACHE=y
+CONFIG_MTDIDS_DEFAULT="nand0=ffb90000.nand.0"
+CONFIG_MTDPARTS_DEFAULT="mtdparts=ffb90000.nand.0:2m(u-boot),-(root)"
+CONFIG_CMD_UBI=y
+# CONFIG_ISO_PARTITION is not set
+# CONFIG_EFI_PARTITION is not set
+CONFIG_OF_LIST=""
+CONFIG_SYS_RELOC_GD_ENV_ADDR=y
+CONFIG_NET_RANDOM_ETHADDR=y
+CONFIG_SPL_DM_SEQ_ALIAS=y
+CONFIG_SPL_ALTERA_SDRAM=y
+CONFIG_FPGA_INTEL_PR=y
+CONFIG_DWAPB_GPIO=y
+CONFIG_DM_I2C=y
+CONFIG_SYS_I2C_DW=y
+CONFIG_MISC=y
+CONFIG_MMC_DW=y
+CONFIG_MTD=y
+CONFIG_DM_MTD=y
+CONFIG_SYS_NAND_U_BOOT_LOCATIONS=y
+CONFIG_SYS_NAND_U_BOOT_OFFS=0x0
+CONFIG_SYS_NAND_U_BOOT_OFFS_REDUND=0x100000
+CONFIG_SF_DEFAULT_MODE=0x2003
+CONFIG_SPI_FLASH_SPANSION=y
+CONFIG_SPI_FLASH_STMICRO=y
+CONFIG_UBI_SILENCE_MSG=y
+CONFIG_PHY_MICREL=y
+CONFIG_PHY_MICREL_KSZ90X1=y
+CONFIG_DM_ETH=y
+CONFIG_ETH_DESIGNWARE=y
+CONFIG_MII=y
+CONFIG_DM_RESET=y
+CONFIG_SPI=y
+CONFIG_CADENCE_QSPI=y
+CONFIG_DESIGNWARE_SPI=y
+CONFIG_NOP_PHY=y
+CONFIG_USB=y
+CONFIG_USB_DWC2=y
+CONFIG_USB_DWC3=y
+CONFIG_USB_XHCI_HCD=y
+CONFIG_USB_XHCI_DWC3=y
+CONFIG_UBIFS_SILENCE_MSG=y
+# CONFIG_SPL_USE_TINY_PRINTF is not set
+CONFIG_PANIC_HANG=y
+CONFIG_SPL_SPI_LOAD=y
+CONFIG_SYS_LOAD_ADDR=0x82000000
+CONFIG_WDT=y
+CONFIG_CMD_WDT=y
+CONFIG_DESIGNWARE_WATCHDOG=y
+CONFIG_SPL_WDT=y
+CONFIG_WATCHDOG_AUTOSTART=n
+CONFIG_TIMER=y
+CONFIG_DESIGNWARE_APB_TIMER=y
+CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
+CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x80300000
+CONFIG_SPL_MAX_SIZE=0x40000
+CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
+CONFIG_SPL_BSS_START_ADDR=0x8ff00000
+# CONFIG_SPL_SHARES_INIT_SP_ADDR is not set
+CONFIG_SPL_STACK=0xffe3f000
+CONFIG_SYS_SPL_MALLOC=y
+CONFIG_HAS_CUSTOM_SPL_MALLOC_START=y
+CONFIG_CUSTOM_SYS_SPL_MALLOC_ADDR=0x8fa00000
+CONFIG_SYS_SPL_MALLOC_SIZE=0x500000
+CONFIG_SPL_BSS_MAX_SIZE=0x100000
+# CONFIG_EFI_LOADER is not set
configs/socfpga_agilex5_legacy_defconfig new file +85 -0

85 lines not on this page · raw message

Signature · 1 line
2.26.2
#12 lore raw

PATCH 7/17 doc: device-tree-bindings: misc: add secreg text file for agilex5

In reply to Jit Loon Lim

This is for new platform enablement for agilex5. Add new secure register text file for new platform.

---
 .../misc/socfpga_secreg.txt                   | 397 ++++++++++++++++++
 1 file changed, 397 insertions(+)
 create mode 100644 doc/device-tree-bindings/misc/socfpga_secreg.txt
doc/device-tree-bindings/misc/socfpga_secreg.txt new file +397 -0
new file mode 100644
index 0000000000..97640b74d9
@@ -0,0 +1,397 @@
+* Firewall and privilege register settings in device tree
+
+Required properties:
+--------------------
+
+- compatible: should contain "intel,socfpga-secreg"
+- reg: Physical base address and size of block register.
+- intel,offset-settings: 32-bit offset address of block register,
+			 followed by 32-bit value settings and
+			 the masking bits, only masking bit
+			 set to 1 allows modification.
+
+The device tree node which describes secure and privilege register access
+configuration in compile time.
+
+Most of these registers are expected to work except for the case which some
+registers configuration are required for granting access to some other
+registers, for example CCU registers have to be properly configured before
+allowing register configuration access to fpga2sdram firewall as shown in
+below example.
+
+Some registers depend on runtime data for proper configuration are expected
+to be part of driver that generating these data for example configuration for
+soc_noc_fw_ddr_mpu_inst_0_ddr_scr block register depend on DDR size parsed from
+memory device tree node.
+
+Please refer details of tested examples below for both fpga2sdram and QoS
+configuration with default reset value and the comments.
+
+Example:
+--------
+
+Common configuration for all SoC64 devices:
+Path: arch/arm/dts/socfpga_soc64_u-boot.dtsi
+
+	socfpga_secreg: socfpga-secreg {
+		compatible = "intel,socfpga-secreg";
+		#address-cells = <1>;
+		#size-cells = <1>;
+		u-boot,dm-pre-reloc;
+
+		i_sys_mgr_core@ffd12000 {
+			reg = <0xffd12000 0x00000230>;
+			intel,offset-settings =
+				/* Enable non-secure interface to DMA */
+				<0x00000020 0xff010000 0xff010011>,
+				/* Enable non-secure interface to DMA periph */
+				<0x00000024 0xffffffff 0xffffffff>;
+			u-boot,dm-pre-reloc;
+		};
+
+		noc_fw_l4_per_l4_per_scr@ffd21000 {
+			reg = <0xffd21000 0x00000074>;
+			intel,offset-settings =
+				/* Disable L4 periphs firewall */
+				<0x00000000 0x01010001 0x01010001>,
+				<0x00000004 0x01010001 0x01010001>,
+				<0x0000000c 0x01010001 0x01010001>,
+				<0x00000010 0x01010001 0x01010001>,
+				<0x0000001c 0x01010001 0x01010101>,
+				<0x00000020 0x01010001 0x01010101>,
+				<0x00000024 0x01010001 0x01010101>,
+				<0x00000028 0x01010001 0x01010101>,
+				<0x0000002c 0x01010001 0x01010001>,
+				<0x00000030 0x01010001 0x01010001>,
+				<0x00000034 0x01010001 0x01010001>,
+				<0x00000040 0x01010001 0x01010001>,
+				<0x00000044 0x01010001 0x01010101>,
+				<0x00000048 0x01010001 0x01010101>,
+				<0x00000050 0x01010001 0x01010101>,
+				<0x00000054 0x01010001 0x01010101>,
+				<0x00000058 0x01010001 0x01010101>,
+				<0x0000005c 0x01010001 0x01010101>,
+				<0x00000060 0x01010001 0x01010101>,
+				<0x00000064 0x01010001 0x01010101>,
+				<0x00000068 0x01010001 0x01010101>,
+				<0x0000006c 0x01010001 0x01010101>,
+				<0x00000070 0x01010001 0x01010101>;
+			u-boot,dm-pre-reloc;
+		};
+
+		noc_fw_l4_sys_l4_sys_scr@ffd21100 {
+			reg = <0xffd21100 0x00000098>;
+			intel,offset-settings =
+				/* Disable L4 system firewall */
+				<0x00000008 0x01010001 0x01010001>,
+				<0x0000000c 0x01010001 0x01010001>,
+				<0x00000010 0x01010001 0x01010001>,
+				<0x00000014 0x01010001 0x01010001>,
+				<0x00000018 0x01010001 0x01010001>,
+				<0x0000001c 0x01010001 0x01010001>,
+				<0x00000020 0x01010001 0x01010001>,
+				<0x0000002c 0x01010001 0x01010001>,
+				<0x00000030 0x01010001 0x01010001>,
+				<0x00000034 0x01010001 0x01010001>,
+				<0x00000038 0x01010001 0x01010001>,
+				<0x00000040 0x01010001 0x01010001>,
+				<0x00000044 0x01010001 0x01010001>,
+				<0x00000048 0x01010001 0x01010001>,
+				<0x0000004c 0x01010001 0x01010001>,
+				<0x00000054 0x01010001 0x01010001>,
+				<0x00000058 0x01010001 0x01010001>,
+				<0x0000005c 0x01010001 0x01010001>,
+				<0x00000060 0x01010001 0x01010101>,
+				<0x00000064 0x01010001 0x01010101>,
+				<0x00000068 0x01010001 0x01010101>,
+				<0x0000006c 0x01010001 0x01010101>,
+				<0x00000070 0x01010001 0x01010101>,
+				<0x00000074 0x01010001 0x01010101>,
+				<0x00000078 0x01010001 0x03010001>,
+				<0x00000090 0x01010001 0x01010001>,
+				<0x00000094 0x01010001 0x01010001>;
+			u-boot,dm-pre-reloc;
+		};
+
+		noc_fw_soc2fpga_soc2fpga_scr@ffd21200 {
+			reg = <0xffd21200 0x00000004>;
+			/* Disable soc2fpga security access */
+			intel,offset-settings = <0x00000000 0x0ffe0101 0x0ffe0101>;
+			u-boot,dm-pre-reloc;
+		};
+
+		noc_fw_lwsoc2fpga_lwsoc2fpga_scr@ffd21300 {
+			reg = <0xffd21300 0x00000004>;
+			/* Disable lightweight soc2fpga security access */
+			intel,offset-settings = <0x00000000 0x0ffe0101 0x0ffe0101>;
+			u-boot,dm-pre-reloc;
+		};
+
+		noc_fw_tcu_tcu_scr@ffd21400 {
+			reg = <0xffd21400 0x00000004>;
+			/* Disable DMA ECC security access, for SMMU use */
+			intel,offset-settings = <0x00000000 0x01010001 0x01010001>;
+			u-boot,dm-pre-reloc;
+		};
+
+		noc_fw_priv_MemoryMap_priv@ffd24800 {
+			reg = <0xffd24800 0x0000000c>;
+			intel,offset-settings =
+				/* Enable non-prviledged access to various periphs */
+				<0x00000000 0xfff73ffb 0xfff73ffb>;
+			u-boot,dm-pre-reloc;
+		};
+	};
+
+configuration for N5X device:
+Path: arch/arm/dts/socfpga_n5x-u-boot.dtsi
+
+	&socfpga_secreg {
+		coh_cpu0_bypass_OC_Firewall_main_Firewall@f7100200 {
+			reg = <0xf7100200 0x00000014>;
+			intel,offset-settings =
+				/* Disable ocram security at CCU for non secure access */
+				<0x0000004 0x8000ffff 0xe007ffff>,
+				<0x0000008 0x8000ffff 0xe007ffff>,
+				<0x000000c 0x8000ffff 0xe007ffff>,
+				<0x0000010 0x8000ffff 0xe007ffff>;
+			u-boot,dm-pre-reloc;
+		};
+
+		soc_noc_fw_mpfe_csr_inst_0_mpfe_scr@f8020000 {
+			reg = <0xf8020000 0x0000001c>;
+			intel,offset-settings =
+				/* Disable MPFE firewall for SMMU */
+				<0x00000000 0x00010101 0x00010101>,
+				/* Disable MPFE firewall for HMC adapter */
+				<0x00000004 0x00000001 0x00010101>;
+			u-boot,dm-pre-reloc;
+		};
+	};
+
+configuration for Agilex device:
+Path: arch/arm/dts/socfpga_agilex-u-boot.dtsi
+
+	&socfpga_secreg {
+		CCU_coh_cpu0_bypass_OC_Firewall_main_Firewall@f7100200 {
+			reg = <0xf7100200 0x00000014>;
+			intel,offset-settings =
+				/* Disable ocram security at CCU for non secure access */
+				<0x0000004 0x8000ffff 0xe003ffff>,
+				<0x0000008 0x8000ffff 0xe003ffff>,
+				<0x000000c 0x8000ffff 0xe003ffff>,
+				<0x0000010 0x8000ffff 0xe003ffff>;
+			u-boot,dm-pre-reloc;
+		};
+
+		soc_noc_fw_mpfe_csr_inst_0_mpfe_scr@f8020000 {
+			reg = <0xf8020000 0x0000001c>;
+			intel,offset-settings =
+				/* Disable MPFE firewall for SMMU */
+				<0x00000000 0x00010101 0x00010101>,
+				/* Disable MPFE firewall for HMC adapter */
+				<0x00000004 0x00000001 0x00010101>;
+			u-boot,dm-pre-reloc;
+		};
+
+		/*
+		 * Below are all fpga2sdram firewall settings with default
+		 * reset value for the sake of easy reference by users.
+		 * Users may choose to remove any of these register
+		 * configurations that they do not require in their specific
+		 * implementation.
+		 */
+		soc_noc_fw_ddr_fpga2sdram_inst_0_ddr_scr@f8020100 {
+			reg = <0xf8020100 0x00000050>;
+			intel,offset-settings =
+				<0x0000000 0x00000000 0x0000000f>,
+				<0x0000004 0x00000000 0x0000000f>,
+				<0x0000008 0x00000000 0x0000000f>,
+				<0x0000010 0x00000000 0xffff0000>,
+				<0x0000014 0x00000000 0x000000ff>,
+				<0x0000018 0x00000000 0xffff0000>,
+				<0x000001c 0x00000000 0x000000ff>,
+				<0x0000020 0x00000000 0xffff0000>,
+				<0x0000024 0x00000000 0x000000ff>,
+				<0x0000028 0x00000000 0xffff0000>,
+				<0x000002c 0x00000000 0x000000ff>,
+				<0x0000030 0x00000000 0xffff0000>,
+				<0x0000034 0x00000000 0x000000ff>,
+				<0x0000038 0x00000000 0xffff0000>,
+				<0x000003c 0x00000000 0x000000ff>,
+				<0x0000040 0x00000000 0xffff0000>,
+				<0x0000044 0x00000000 0x000000ff>,
+				<0x0000048 0x00000000 0xffff0000>,
+				<0x000004c 0x00000000 0x000000ff>;
+			u-boot,dm-pre-reloc;
+		};
+
+		/*
+		 * Example of ccu_mem0_I_main QOS settings with
+		 * default reset value for the sake of easy reference
+		 * by users. Users may choose to remove any of these register
+		 * configurations that they do not require in their specific
+		 * implementation.
+		 */
+		soc_mpfe_noc_inst_0_ccu_mem0_I_main_QosGenerator@f8022080 {
+			reg = <0xf8022080 0x0000001c>;
+			intel,offset-settings =
+				<0x0000008 0x00000200 0x00000303>,
+				<0x000000c 0x00000003 0x00000003>,
+				<0x0000010 0x00000BFE 0x00007fff>,
+				<0x0000014 0x00000008 0x000003ff>,
+				<0x0000018 0x00000000 0x0000000f>;
+			u-boot,dm-pre-reloc;
+		};
+	};
+
+configuration for Stratix 10 device:
+Path: arch/arm/dts/socfpga_stratix10-u-boot.dtsi
+
+	&socfpga_secreg {
+		i_ccu_noc_registers@f7000000 {
+			reg = <0xf7000000 0x00049e60>;
+			intel,offset-settings =
+				/* Enable access to DDR reg from CPU */
+				<0x0004400 0xF8000000 0xffffffff>,
+
+				/* Enable access to DDR region from CPU */
+				<0x00045c0 0x00000000 0xffffffdf>,
+				<0x00045e0 0x00000000 0xffffffdf>,
+				<0x0004600 0x00000000 0xffffffdf>,
+				<0x0004620 0x00000000 0xffffffdf>,
+				<0x0004640 0x00000000 0xffffffdf>,
+				<0x0004660 0x00000000 0xffffffdf>,
+
+				/* Disable ocram security at CCU for non secure access */
+				<0x0004688 0xfffc0000 0xffffffcf>,
+				<0x0018628 0xfffc0000 0xffffffcf>,
+
+				/* Enable access to DDR region from IO master */
+				<0x00018560 0x00000000 0xffffffdf>,
+				<0x00018580 0x00000000 0xffffffdf>,
+				<0x000185a0 0x00000000 0xffffffdf>,
+				<0x000185c0 0x00000000 0xffffffdf>,
+				<0x000185e0 0x00000000 0xffffffdf>,
+				<0x00018600 0x00000000 0xffffffdf>,
+
+				/* Enable access to DDR region from TCU */
+				<0x0002c520 0x00000000 0xffffffdf>,
+				<0x0002c540 0x00000000 0xffffffdf>,
+				<0x0002c560 0x00000000 0xffffffdf>,
+				<0x0002c580 0x00000000 0xffffffdf>,
+				<0x0002c5a0 0x00000000 0xffffffdf>,
+				<0x0002c5c0 0x00000000 0xffffffdf>,
+
+				/* Enable access to DDR region from FPGA */
+				<0x000105a0 0x00000000 0xffffffdf>,
+				<0x000105c0 0x00000000 0xffffffdf>,
+				<0x000105e0 0x00000000 0xffffffdf>,
+				<0x00010600 0x00000000 0xffffffdf>,
+				<0x00010620 0x00000000 0xffffffdf>,
+				<0x00010640 0x00000000 0xffffffdf>;
+			u-boot,dm-pre-reloc;
+		};
+
+		/*
+		 * Both firewall and QOS regs accessed by CPU in MPFE has
+		 * dependency on CCU configuration above.
+		 *
+		 * Below are all fpga2sdram firewall settings with default
+		 * reset value for the sake of easy reference by users.
+		 * Users may choose to remove any of these register configurations
+		 * that they do not require in their specific implementation.
+		 */
+		soc_noc_fw_ddr_fpga2sdram_inst_0_ddr_scr@f8020200 {
+			reg = <0xf8020200 0x00000050>;
+			intel,offset-settings =
+				<0x0000000 0x00000000 0x0000000f>,
+				<0x0000004 0x00000000 0x0000000f>,
+				<0x0000008 0x00000000 0x0000000f>,
+				<0x0000010 0x00000000 0xffff0000>,
+				<0x0000014 0x00000000 0x0000001f>,
+				<0x0000018 0x00000000 0xffff0000>,
+				<0x000001c 0x00000000 0x0000001f>,
+				<0x0000020 0x00000000 0xffff0000>,
+				<0x0000024 0x00000000 0x0000001f>,
+				<0x0000028 0x00000000 0xffff0000>,
+				<0x000002c 0x00000000 0x0000001f>,
+				<0x0000030 0x00000000 0xffff0000>,
+				<0x0000034 0x00000000 0x0000001f>,
+				<0x0000038 0x00000000 0xffff0000>,
+				<0x000003c 0x00000000 0x0000001f>,
+				<0x0000040 0x00000000 0xffff0000>,
+				<0x0000044 0x00000000 0x0000001f>,
+				<0x0000048 0x00000000 0xffff0000>,
+				<0x000004c 0x00000000 0x0000001f>;
+			u-boot,dm-pre-reloc;
+		};
+
+		soc_noc_fw_ddr_fpga2sdram_inst_1_ddr_scr@f8020300 {
+			reg = <0xf8020300 0x00000050>;
+			intel,offset-settings =
+				<0x0000000 0x00000000 0x0000000f>,
+				<0x0000004 0x00000000 0x0000000f>,
+				<0x0000008 0x00000000 0x0000000f>,
+				<0x0000010 0x00000000 0xffff0000>,
+				<0x0000014 0x00000000 0x0000001f>,
+				<0x0000018 0x00000000 0xffff0000>,
+				<0x000001c 0x00000000 0x0000001f>,
+				<0x0000020 0x00000000 0xffff0000>,
+				<0x0000024 0x00000000 0x0000001f>,
+				<0x0000028 0x00000000 0xffff0000>,
+				<0x000002c 0x00000000 0x0000001f>,
+				<0x0000030 0x00000000 0xffff0000>,
+				<0x0000034 0x00000000 0x0000001f>,
+				<0x0000038 0x00000000 0xffff0000>,
+				<0x000003c 0x00000000 0x0000001f>,
+				<0x0000040 0x00000000 0xffff0000>,
+				<0x0000044 0x00000000 0x0000001f>,
+				<0x0000048 0x00000000 0xffff0000>,
+				<0x000004c 0x00000000 0x0000001f>;
+			u-boot,dm-pre-reloc;
+		};
+
+		soc_noc_fw_ddr_fpga2sdram_inst_2_ddr_scr@f8020400 {
+			reg = <0xf8020400 0x00000050>;
+			intel,offset-settings =
+				<0x0000000 0x00000000 0x0000000f>,
+				<0x0000004 0x00000000 0x0000000f>,
+				<0x0000008 0x00000000 0x0000000f>,
+				<0x0000010 0x00000000 0xffff0000>,
+				<0x0000014 0x00000000 0x0000001f>,
+				<0x0000018 0x00000000 0xffff0000>,
+				<0x000001c 0x00000000 0x0000001f>,
+				<0x0000020 0x00000000 0xffff0000>,
+				<0x0000024 0x00000000 0x0000001f>,
+				<0x0000028 0x00000000 0xffff0000>,
+				<0x000002c 0x00000000 0x0000001f>,
+				<0x0000030 0x00000000 0xffff0000>,
+				<0x0000034 0x00000000 0x0000001f>,
+				<0x0000038 0x00000000 0xffff0000>,
+				<0x000003c 0x00000000 0x0000001f>,
+				<0x0000040 0x00000000 0xffff0000>,
+				<0x0000044 0x00000000 0x0000001f>,
+				<0x0000048 0x00000000 0xffff0000>,
+				<0x000004c 0x00000000 0x0000001f>;
+			u-boot,dm-pre-reloc;
+		};
+
+		/*
+		 * Example of ccu_mem0_I_main QOS settings with
+		 * default reset value for the sake of easy reference
+		 * by users. Users may choose to remove any of these register
+		 * configurations that they do not require in their specific
+		 * implementation.
+		 */
+		soc_ddr_scheduler_inst_0_ccu_mem0_I_main_QosGenerator@f8022080 {
+			reg = <0xf8022080 0x0000001c>;
+			intel,offset-settings =
+				<0x0000008 0x00000000 0x00000303>,
+				<0x000000c 0x00000001 0x00000003>,
+				<0x0000010 0x00000BFE 0x00001fff>,
+				<0x0000014 0x00000008 0x000003ff>,
+				<0x0000018 0x00000000 0x00000007>;
+			u-boot,dm-pre-reloc;
+		};
+	};
Signature · 1 line
2.26.2
#13 lore raw

PATCH 8/17 drivers: ddr: altera: add ddr support for agilex5

In reply to Jit Loon Lim

This is for new platform enablement for agilex5. Add new ddr and iossm mailbox files for new platform.Add

---
 drivers/ddr/altera/Makefile        |   5 +-
 drivers/ddr/altera/iossm_mailbox.c | 786 +++++++++++++++++++++++++++++
 drivers/ddr/altera/iossm_mailbox.h | 141 ++++++
 drivers/ddr/altera/sdram_agilex5.c | 329 ++++++++++++
 drivers/ddr/altera/sdram_soc64.c   |  78 ++-
 drivers/ddr/altera/sdram_soc64.h   |  17 +-
 6 files changed, 1345 insertions(+), 11 deletions(-)
 create mode 100644 drivers/ddr/altera/iossm_mailbox.c
 create mode 100644 drivers/ddr/altera/iossm_mailbox.h
 create mode 100644 drivers/ddr/altera/sdram_agilex5.c
drivers/ddr/altera/Makefile +3 -2
index 9fa5d85a27..fa6c880b39 100644
@@ -7,9 +7,10 @@
 # Copyright (C) 2014-2021 Altera Corporation <www.altera.com>
 
 ifdef CONFIG_$(SPL_)ALTERA_SDRAM
-obj-$(CONFIG_TARGET_SOCFPGA_GEN5) += sdram_gen5.o sequencer.o
-obj-$(CONFIG_TARGET_SOCFPGA_ARRIA10) += sdram_arria10.o
+obj-$(CONFIG_TARGET_SOCFPGA_GEN5) += sdram_soc32.o sdram_gen5.o sequencer.o
+obj-$(CONFIG_TARGET_SOCFPGA_ARRIA10) += sdram_soc32.o sdram_arria10.o
 obj-$(CONFIG_TARGET_SOCFPGA_STRATIX10) += sdram_soc64.o sdram_s10.o
 obj-$(CONFIG_TARGET_SOCFPGA_AGILEX) += sdram_soc64.o sdram_agilex.o
 obj-$(CONFIG_TARGET_SOCFPGA_N5X) += sdram_soc64.o sdram_n5x.o
+obj-$(CONFIG_TARGET_SOCFPGA_AGILEX5) += sdram_soc64.o sdram_agilex5.o iossm_mailbox.o
 endif
drivers/ddr/altera/iossm_mailbox.c new file +786 -0

786 lines not on this page · raw message

drivers/ddr/altera/iossm_mailbox.h new file +141 -0

141 lines not on this page · raw message

drivers/ddr/altera/sdram_agilex5.c new file +329 -0

329 lines not on this page · raw message

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

145 lines not on this page · raw message

drivers/ddr/altera/sdram_soc64.h +16 -1
index 07a0f9f2ae..c96025f8b1 100644
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0 */
 /*
- * Copyright (C) 2017-2019 Intel Corporation <www.intel.com>
+ * Copyright (C) 2017-2022 Intel Corporation <www.intel.com>
  */
 
 #ifndef	_SDRAM_SOC64_H_
@@ -14,11 +14,20 @@ struct altera_sdram_priv {
 	struct reset_ctl_bulk resets;
 };
 
+#if IS_ENABLED(CONFIG_TARGET_SOCFPGA_AGILEX5)
+struct altera_sdram_plat {
+	fdt_addr_t mpfe_base_addr;
+	bool dualport;
+	bool dualemif;
+};
+#else
+
 struct altera_sdram_plat {
 	void __iomem *hmc;
 	void __iomem *ddr_sch;
 	void __iomem *iomhc;
 };
+#endif
 
 /* ECC HMC registers */
 #define DDRIOCTRL			0x8
@@ -39,6 +48,8 @@ struct altera_sdram_plat {
 #define RSTHANDSHAKESTAT		0x218
 
 #define DDR_HMC_DDRIOCTRL_IOSIZE_MSK		0x00000003
+#define DDR_HMC_DDRIOCTRL_MPFE_HMCA_DATA_RATE_MSK BIT(2)
+#define DDR_HMC_DDRIOCTRL_MPFE_HMCA_DATA_RATE_SHIFT 2
 #define DDR_HMC_DDRCALSTAT_CAL_MSK		BIT(0)
 #define DDR_HMC_ECCCTL_AWB_CNT_RST_SET_MSK	BIT(16)
 #define DDR_HMC_ECCCTL_CNT_RST_SET_MSK		BIT(8)
@@ -66,6 +77,7 @@ struct altera_sdram_plat {
 #define CTRLCFG0			0x28
 #define CTRLCFG1			0x2c
 #define CTRLCFG3                        0x34
+#define CTRLCFG5                        0x3c
 #define DRAMTIMING0			0x50
 #define CALTIMING0			0x7c
 #define CALTIMING1			0x80
@@ -79,6 +91,9 @@ struct altera_sdram_plat {
 #define NIOSRESERVED1			0x114
 #define NIOSRESERVED2			0x118
 
+#define CTRLCFG3_CFG_CTRL_CMD_RATE_QUARTER	BIT(2)
+#define CTRLCFG5_CFG_CTRL_RC_EN_MASK		BIT(8)
+
 #define DRAMADDRW_CFG_COL_ADDR_WIDTH(x)			\
 	(((x) >> 0) & 0x1F)
 #define DRAMADDRW_CFG_ROW_ADDR_WIDTH(x)			\
Signature · 1 line
2.26.2
#14 lore raw

PATCH 9/17 drivers: clk: altera: add clock support for agilex5

In reply to Jit Loon Lim

This is for new platform enablement for agilex5.
Add new clock files for new platform.Add

---
 drivers/clk/altera/Makefile      |   1 +
 drivers/clk/altera/clk-agilex5.c | 736 +++++++++++++++++++++++++++++++
 drivers/clk/altera/clk-agilex5.h | 263 +++++++++++
 3 files changed, 1000 insertions(+)
 create mode 100644 drivers/clk/altera/clk-agilex5.c
 create mode 100644 drivers/clk/altera/clk-agilex5.h
drivers/clk/altera/Makefile +1 -0
index 33db092918..61ffa4179a 100644
@@ -7,3 +7,4 @@ obj-$(CONFIG_TARGET_SOCFPGA_AGILEX) += clk-agilex.o
 obj-$(CONFIG_TARGET_SOCFPGA_ARRIA10) += clk-arria10.o
 obj-$(CONFIG_TARGET_SOCFPGA_N5X) += clk-n5x.o
 obj-$(CONFIG_TARGET_SOCFPGA_N5X) += clk-mem-n5x.o
+obj-$(CONFIG_TARGET_SOCFPGA_AGILEX5) += clk-agilex5.o
drivers/clk/altera/clk-agilex5.c new file +736 -0

736 lines not on this page · raw message

drivers/clk/altera/clk-agilex5.h new file +263 -0

263 lines not on this page · raw message

Signature · 1 line
2.26.2
#15 lore raw

PATCH 10/17 drivers: misc: update driver misc for agilex5

In reply to Jit Loon Lim

This is for new platform enablement for agilex5. Update secure registers, Kconfig and makefile for new platform.

---
 drivers/misc/Kconfig          |   9 +++
 drivers/misc/Makefile         |   1 +
 drivers/misc/socfpga_secreg.c | 116 ++++++++++++++++++++++++++++++++++
 3 files changed, 126 insertions(+)
 create mode 100644 drivers/misc/socfpga_secreg.c
drivers/misc/Kconfig +9 -0
index 04460f1acb..3b6f5314ff 100644
@@ -666,4 +666,13 @@ config SL28CPLD
 	  the base driver which provides common access methods for the
 	  sub-drivers.
 
+config SPL_SOCFPGA_SEC_REG
+	bool "Enable register setting from device tree in SPL"
+	depends on SPL
+	help
+	  Enable register setting from device tree in SPL, which require
+	  high privilege access like firewall registers. This also
+	  provides user a clean interface and all register settings are
+	  centralized in one place, device tree.
+
 endmenu
drivers/misc/Makefile +1 -0
index 52aed09602..441c03509f 100644
@@ -88,3 +88,4 @@ obj-$(CONFIG_K3_AVS0) += k3_avs.o
 obj-$(CONFIG_ESM_K3) += k3_esm.o
 obj-$(CONFIG_ESM_PMIC) += esm_pmic.o
 obj-$(CONFIG_SL28CPLD) += sl28cpld.o
+obj-$(CONFIG_SPL_SOCFPGA_SEC_REG) += socfpga_secreg.o
drivers/misc/socfpga_secreg.c new file +116 -0

116 lines not on this page · raw message

Signature · 1 line
2.26.2
#16 lore raw

PATCH 11/17 drivers: mmc: add mmc/cadence driver for agilex5

In reply to Jit Loon Lim

This is for new platform enablement for agilex5.
Add mmc and cadence host driver for new platform.

---
 drivers/mmc/mmc.c           |  27 +++---
 drivers/mmc/sdhci-cadence.c | 164 ++++++++++++++++++++++++++++++++----
 2 files changed, 160 insertions(+), 31 deletions(-)
drivers/mmc/mmc.c +13 -14
index 1af6af82e6..88c674d44f 100644
@@ -26,6 +26,7 @@
 #include <div64.h>
 #include "mmc_private.h"
 
+#define TIMEOUT_TEN_MS  10
 #define DEFAULT_CMD6_TIMEOUT_MS  500
 
 static int mmc_set_signal_voltage(struct mmc *mmc, uint signal_voltage);
@@ -247,7 +248,7 @@ static int mmc_send_cmd_retry(struct mmc *mmc, struct mmc_cmd *cmd,
 static int mmc_send_cmd_quirks(struct mmc *mmc, struct mmc_cmd *cmd,
 			       struct mmc_data *data, u32 quirk, uint retries)
 {
-	if (IS_ENABLED(CONFIG_MMC_QUIRKS) && mmc->quirks & quirk)
+	if (CONFIG_IS_ENABLED(MMC_QUIRKS) && mmc->quirks & quirk)
 		return mmc_send_cmd_retry(mmc, cmd, data, retries);
 	else
 		return mmc_send_cmd(mmc, cmd, data);
@@ -597,6 +598,11 @@ static int sd_send_op_cond(struct mmc *mmc, bool uhs_en)
 	int err;
 	struct mmc_cmd cmd;
 
+	/* lower timeout, to speed up mmc init since both uses same flow */
+	if (IS_ENABLED(CONFIG_TARGET_SOCFPGA_AGILEX5_EMU) ||
+	    IS_ENABLED(CONFIG_TARGET_SOCFPGA_AGILEX5_SIMICS))
+		timeout = TIMEOUT_TEN_MS;
+
 	while (1) {
 		cmd.cmdidx = MMC_CMD_APP_CMD;
 		cmd.resp_type = MMC_RSP_R1;
@@ -635,7 +641,7 @@ static int sd_send_op_cond(struct mmc *mmc, bool uhs_en)
 			break;
 
 		if (timeout-- <= 0)
-			return -EOPNOTSUPP;
+			return -ETIMEDOUT;
 
 		udelay(1000);
 	}
@@ -2432,9 +2438,6 @@ static int mmc_startup_v4(struct mmc *mmc)
 
 	mmc->wr_rel_set = ext_csd[EXT_CSD_WR_REL_SET];
 
-	mmc->can_trim =
-		!!(ext_csd[EXT_CSD_SEC_FEATURE] & EXT_CSD_SEC_FEATURE_TRIM_EN);
-
 	return 0;
 error:
 	if (mmc->ext_csd) {
@@ -3130,10 +3133,9 @@ int mmc_init_device(int num)
 #endif
 
 #ifdef CONFIG_CMD_BKOPS_ENABLE
-int mmc_set_bkops_enable(struct mmc *mmc, bool autobkops, bool enable)
+int mmc_set_bkops_enable(struct mmc *mmc)
 {
 	int err;
-	u32 bit = autobkops ? BIT(1) : BIT(0);
 	ALLOC_CACHE_ALIGN_BUFFER(u8, ext_csd, MMC_MAX_BLOCK_LEN);
 
 	err = mmc_send_ext_csd(mmc, ext_csd);
@@ -3147,21 +3149,18 @@ int mmc_set_bkops_enable(struct mmc *mmc, bool autobkops, bool enable)
 		return -EMEDIUMTYPE;
 	}
 
-	if (enable && (ext_csd[EXT_CSD_BKOPS_EN] & bit)) {
+	if (ext_csd[EXT_CSD_BKOPS_EN] & 0x1) {
 		puts("Background operations already enabled\n");
 		return 0;
 	}
 
-	err = mmc_switch(mmc, EXT_CSD_CMD_SET_NORMAL, EXT_CSD_BKOPS_EN,
-			 enable ? bit : 0);
+	err = mmc_switch(mmc, EXT_CSD_CMD_SET_NORMAL, EXT_CSD_BKOPS_EN, 1);
 	if (err) {
-		printf("Failed to %sable manual background operations\n",
-		       enable ? "en" : "dis");
+		puts("Failed to enable manual background operations\n");
 		return err;
 	}
 
-	printf("%sabled %s background operations\n",
-	       enable ? "En" : "Dis", autobkops ? "auto" : "manual");
+	puts("Enabled manual background operations\n");
 
 	return 0;
 }
drivers/mmc/sdhci-cadence.c +147 -17

260 lines not on this page · raw message

Signature · 1 line
2.26.2
#17 lore raw

PATCH 12/17 drivers: phy: add combo phy driver for agilex5

In reply to Jit Loon Lim

This is for new platform enablement for agilex5.
Add combo phy driver for new platform.

---
 drivers/phy/cadence/Kconfig                |   9 +
 drivers/phy/cadence/Makefile               |   1 +
 drivers/phy/cadence/phy-cadence-combophy.c | 855 +++++++++++++++++++++
 3 files changed, 865 insertions(+)
 create mode 100644 drivers/phy/cadence/phy-cadence-combophy.c
drivers/phy/cadence/Kconfig +9 -0
index 549ddbf504..61d1b36be2 100644
@@ -1,3 +1,12 @@
+config PHY_CADENCE_COMBOPHY
+	tristate "Cadence ComboPhy PHY Driver"
+	depends on MMC_SDHCI_CADENCE
+	help
+	  Enable this to support the Cadence ComboPhy PHY driver
+	  A single module that encapsulates all functionality required to interface
+	  to external NAND Flash, eMMC devices, and SD cards for command and data
+	  transfer.
+
 config PHY_CADENCE_SIERRA
 	tristate "Cadence Sierra PHY Driver"
 	depends on DM_RESET
drivers/phy/cadence/Makefile +1 -0
index af63b32d9f..3092b9f3b8 100644
@@ -1,2 +1,3 @@
 obj-$(CONFIG_$(SPL_)PHY_CADENCE_SIERRA)	+= phy-cadence-sierra.o
 obj-$(CONFIG_$(SPL_)PHY_CADENCE_TORRENT) += phy-cadence-torrent.o
+obj-$(CONFIG_PHY_CADENCE_COMBOPHY) += phy-cadence-combophy.o
drivers/phy/cadence/phy-cadence-combophy.c new file +855 -0

855 lines not on this page · raw message

Signature · 1 line
2.26.2
#18 lore raw

PATCH 13/17 drivers: reset: add reset driver for agilex5

In reply to Jit Loon Lim

This is for new platform enablement for agilex5.
Add reset driver for new platform.

---
 drivers/reset/reset-socfpga.c | 28 +++++++++++++++++++++++++---
 1 file changed, 25 insertions(+), 3 deletions(-)
drivers/reset/reset-socfpga.c +25 -3
index 6e3f03e248..8b35f0685d 100644
@@ -24,9 +24,18 @@
 #include <linux/bitops.h>
 #include <linux/io.h>
 #include <linux/sizes.h>
-
-#define BANK_INCREMENT		4
-#define NR_BANKS		8
+#include <asm/arch/reset_manager.h>
+
+#define BANK_INCREMENT					4
+#define NR_BANKS					8
+#define RSTMGR_PER0MODRST_USB31				BIT(4)
+#define RSTMGR_PER0MODRST_NAND				BIT(5)
+#define RSTMGR_PER0MODRST_DMA				BIT(16)
+#define RSTMGR_PER0MODRST_DMAIF				GENMASK(31, 24)
+#define RSTMGR_PER0MODRST_USB31_NAND_DMA_DEASSERT	RSTMGR_PER0MODRST_USB31 \
+							| RSTMGR_PER0MODRST_NAND \
+							| RSTMGR_PER0MODRST_DMA \
+							| RSTMGR_PER0MODRST_DMAIF
 
 struct socfpga_reset_data {
 	void __iomem *modrst_base;
@@ -112,9 +121,22 @@ static int socfpga_reset_remove(struct udevice *dev)
 {
 	struct socfpga_reset_data *data = dev_get_priv(dev);
 
+/*
+ * TODO: This is temporary solution for NAND/DMA/USB3.1 deaasert.
+ * When NAND/DMA/USB3.1 driver is ready, the deassert shall be done
+ * from NAND/DMA/USB3.1 driver.
+ */
+#if defined(CONFIG_TARGET_SOCFPGA_AGILEX5)
+	clrbits_le32(socfpga_get_rstmgr_addr() + RSTMGR_SOC64_PER0MODRST,
+		     RSTMGR_PER0MODRST_USB31_NAND_DMA_DEASSERT);
+#endif
+
 	if (socfpga_reset_keep_enabled()) {
 		puts("Deasserting all peripheral resets\n");
 		writel(0, data->modrst_base + 4);
+#if defined(CONFIG_TARGET_SOCFPGA_ARRIA10)
+		writel(0, data->modrst_base + 8);
+#endif
 	}
 
 	return 0;
Signature · 1 line
2.26.2
#19 lore raw

PATCH 14/17 drivers: sysreset: add system driver for agilex5

In reply to Jit Loon Lim

This is for new platform enablement for agilex5.
Add cold, warm reset logic for new platform.

---
 drivers/sysreset/Kconfig                    |  7 ++++
 drivers/sysreset/Makefile                   |  1 +
 drivers/sysreset/sysreset_socfpga_agilex5.c | 44 +++++++++++++++++++++
 3 files changed, 52 insertions(+)
 create mode 100644 drivers/sysreset/sysreset_socfpga_agilex5.c
drivers/sysreset/Kconfig +7 -0
index 03f7fdd597..850191eeed 100644
@@ -137,6 +137,13 @@ config SYSRESET_SOCFPGA_SOC64
 	  This enables the system reset driver support for Intel SOCFPGA
 	  SoC64 SoCs.
 
+config SYSRESET_SOCFPGA_AGILEX5
+	bool "Enable support for Intel SOCFPGA AGILEX5 device"
+	depends on ARCH_SOCFPGA && TARGET_SOCFPGA_AGILEX5
+	help
+	  This enables the system reset driver support for Intel SOCFPGA
+	  AGILEX5 device.
+
 config SYSRESET_TI_SCI
 	bool "TI System Control Interface (TI SCI) system reset driver"
 	depends on TI_SCI_PROTOCOL
drivers/sysreset/Makefile +1 -0
index 40c876764a..6631a71db6 100644
@@ -16,6 +16,7 @@ obj-$(CONFIG_SYSRESET_PSCI) += sysreset_psci.o
 obj-$(CONFIG_SYSRESET_SBI) += sysreset_sbi.o
 obj-$(CONFIG_SYSRESET_SOCFPGA) += sysreset_socfpga.o
 obj-$(CONFIG_SYSRESET_SOCFPGA_SOC64) += sysreset_socfpga_soc64.o
+obj-$(CONFIG_SYSRESET_SOCFPGA_AGILEX5) += sysreset_socfpga_agilex5.o
 obj-$(CONFIG_SYSRESET_TI_SCI) += sysreset-ti-sci.o
 obj-$(CONFIG_SYSRESET_SYSCON) += sysreset_syscon.o
 obj-$(CONFIG_SYSRESET_WATCHDOG) += sysreset_watchdog.o
drivers/sysreset/sysreset_socfpga_agilex5.c new file +44 -0

44 lines not on this page · raw message

Signature · 1 line
2.26.2
#20 lore raw

PATCH 15/17 drivers: watchdog: update watchdog driver for agilex5

In reply to Jit Loon Lim

This is for new platform enablement for agilex5.
Update watchdog timeout timer for new platform.

---
 drivers/watchdog/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/watchdog/Kconfig +1 -1
index 646663528a..18d2e33e09 100644
@@ -28,7 +28,7 @@ config WATCHDOG_TIMEOUT_MSECS
 	int "Watchdog timeout in msec"
 	default 128000 if ARCH_MX31 || ARCH_MX5 || ARCH_MX6
 	default 128000 if ARCH_MX7 || ARCH_VF610
-	default 30000 if ARCH_SOCFPGA
+	default 10000 if ARCH_SOCFPGA
 	default 16000 if ARCH_SUNXI
 	default 5376 if ULP_WATCHDOG
 	default 15000 if ARCH_BCM283X
Signature · 1 line
2.26.2
#21 lore raw

PATCH 16/17 includes: add and update configuration for agilex5

In reply to Jit Loon Lim

This is for new platform enablement for agilex5. Add in new configuration that needed to boot new platform.

---
 arch/arm/mach-socfpga/Kconfig                 |  55 +++++
 configs/socfpga_agilex5_defconfig             |   2 +
 configs/socfpga_agilex5_legacy_defconfig      |   2 +
 include/configs/socfpga_agilex5_socdk.h       |  12 +
 include/configs/socfpga_soc64_common.h        | 214 +++++++++++++++++-
 include/dt-bindings/clock/agilex5-clock.h     |  71 ++++++
 include/dt-bindings/reset/altr,rst-mgr-agx5.h |  82 +++++++
 7 files changed, 428 insertions(+), 10 deletions(-)
 create mode 100644 include/configs/socfpga_agilex5_socdk.h
 create mode 100644 include/dt-bindings/clock/agilex5-clock.h
 create mode 100644 include/dt-bindings/reset/altr,rst-mgr-agx5.h
arch/arm/mach-socfpga/Kconfig +55 -0
index 562c3796ec..a35928ef47 100644
@@ -3,6 +3,10 @@ if ARCH_SOCFPGA
 config ERR_PTR_OFFSET
 	default 0xfffec000 if TARGET_SOCFPGA_GEN5 # Boot ROM range
 
+config MEM_RESERVE_SECURE
+	int
+	default 0
+
 config NR_DRAM_BANKS
 	default 1
 
@@ -33,6 +37,37 @@ config SPL_STACK_R_ADDR
 config SPL_SYS_MALLOC_F_LEN
 	default 0x800 if TARGET_SOCFPGA_GEN5
 
+config SYS_CACHELINE_SIZE
+	default 64
+
+config SYS_INIT_RAM_ADDR
+	bool
+	default 0xFFE00000 if TARGET_SOCFPGA_AGILEX
+	default 0x0 if TARGET_SOCFPGA_AGILEX5
+	default 0xFFE00000 if TARGET_SOCFPGA_N5X
+	default 0xFFE00000 if TARGET_SOCFPGA_STRATIX10
+
+config SYS_INIT_RAM_SIZE
+	bool
+	default 0x40000 if TARGET_SOCFPGA_AGILEX
+	default 0x80000 if TARGET_SOCFPGA_AGILEX5
+	default 0x40000 if TARGET_SOCFPGA_N5X
+	default 0x40000 if TARGET_SOCFPGA_STRATIX10
+
+config SYS_MAX_NAND_DEVICE
+	default 1
+
+config SYS_NAND_ONFI_DETECTION
+	default 1
+
+config SYS_NAND_U_BOOT_SIZE
+	int
+	default 1048576
+
+config SYS_NAND_U_BOOT_DST
+	bool
+	default CONFIG_TEXT_BASE if TARGET_SOCFPGA_SOC64
+
 config SYS_MMCSD_RAW_MODE_U_BOOT_PARTITION_TYPE
 	default 0xa2
 
@@ -40,6 +75,16 @@ config SYS_MALLOC_F_LEN
 	default 0x2000 if TARGET_SOCFPGA_ARRIA10
 	default 0x2000 if TARGET_SOCFPGA_GEN5
 
+config SYS_NS16550_MEM32
+	default y if TARGET_SOCFPGA_SOC64
+
+config SYS_SDRAM_BASE
+	bool
+	default 0x0 if TARGET_SOCFPGA_AGILEX
+	default 0x80000000 if TARGET_SOCFPGA_AGILEX5
+	default 0x0 if TARGET_SOCFPGA_N5X
+	default 0x0 if TARGET_SOCFPGA_STRATIX10
+
 config TEXT_BASE
 	default 0x01000040 if TARGET_SOCFPGA_ARRIA10
 	default 0x01000040 if TARGET_SOCFPGA_GEN5
@@ -59,29 +104,35 @@ config TARGET_SOCFPGA_AGILEX
 	select ARMV8_SET_SMPEN
 	select BINMAN if SPL_ATF
 	select CLK
+	select CONFIG_BOOTFILE if SPL_ATF
 	select FPGA_INTEL_SDM_MAILBOX
 	select GICV2
 	select NCORE_CACHE
 	select SPL_CLK if SPL
+	select SYS_SDRAM_BASE
 	select TARGET_SOCFPGA_SOC64
 
 config TARGET_SOCFPGA_AGILEX5
 	bool
 	select BINMAN if SPL_ATF
 	select CLK
+	select CONFIG_BOOTFILE if SPL_ATF
 	select FPGA_INTEL_SDM_MAILBOX
 	select GICV3
 	select NCORE_CACHE
 	select SPL_CLK if SPL
+	select SYS_SDRAM_BASE
 	select TARGET_SOCFPGA_SOC64
 
 config TARGET_SOCFPGA_AGILEX5_EMU
 	bool "Enable build that bootable only on Agilex5 Emulator"
+	select TARGET_SOCFPGA_AGILEX5
 	help
 	 This is to use for Agilex5 Emulator.
 
 config TARGET_SOCFPGA_AGILEX5_SIMICS
 	bool "Enable build that bootable only on Agilex5 Simics platform"
+	select TARGET_SOCFPGA_AGILEX5
 	help
 	 This is to use for Agilex5 Simics.
 
@@ -127,10 +178,12 @@ config TARGET_SOCFPGA_N5X
 	select ARMV8_SET_SMPEN
 	select BINMAN if SPL_ATF
 	select CLK
+	select CONFIG_BOOTFILE if SPL_ATF
 	select FPGA_INTEL_SDM_MAILBOX
 	select NCORE_CACHE
 	select SPL_ALTERA_SDRAM
 	select SPL_CLK if SPL
+	select SYS_SDRAM_BASE
 	select TARGET_SOCFPGA_SOC64
 
 config TARGET_SOCFPGA_N5X_SOCDK
@@ -145,7 +198,9 @@ config TARGET_SOCFPGA_STRATIX10
 	select ARMV8_MULTIENTRY
 	select ARMV8_SET_SMPEN
 	select BINMAN if SPL_ATF
+	select CONFIG_BOOTFILE if SPL_ATF
 	select FPGA_INTEL_SDM_MAILBOX
+	select SYS_SDRAM_BASE
 	select TARGET_SOCFPGA_SOC64
 
 choice
configs/socfpga_agilex5_defconfig +2 -0
index 6a90fa0b27..8e5c7e6f70 100644
@@ -50,6 +50,8 @@ CONFIG_CMD_FAT=y
 CONFIG_DOS_PARTITION=y
 CONFIG_SPL_DOS_PARTITION=y
 CONFIG_SPL_SYS_DISABLE_DCACHE_OPS=y
+CONFIG_USE_BOOTFILE=y
+CONFIG_BOOTFILE="kernel.itb"
 CONFIG_CMD_MTD=y
 CONFIG_CMD_NAND_TRIMFFS=y
 CONFIG_CMD_NAND_LOCK_UNLOCK=y
configs/socfpga_agilex5_legacy_defconfig +2 -0
index cede11c880..054f785b6e 100644
@@ -45,6 +45,8 @@ CONFIG_MMC_SDHCI_CADENCE=y
 CONFIG_CMD_FAT=y
 CONFIG_DOS_PARTITION=y
 CONFIG_SPL_DOS_PARTITION=y
+CONFIG_USE_BOOTFILE=y
+CONFIG_BOOTFILE="kernel.itb"
 CONFIG_CMD_MTD=y
 CONFIG_CMD_NAND_TRIMFFS=y
 CONFIG_CMD_NAND_LOCK_UNLOCK=y
include/configs/socfpga_agilex5_socdk.h new file +12 -0
new file mode 100644
index 0000000000..ad2b5632d1
@@ -0,0 +1,12 @@
+/* SPDX-License-Identifier: GPL-2.0
+ *
+ * Copyright (C) 2019-2022 Intel Corporation <www.intel.com>
+ *
+ */
+
+#ifndef __CONFIG_SOCFGPA_AGILEX5_H__
+#define __CONFIG_SOCFGPA_AGILEX5_H__
+
+#include <configs/socfpga_soc64_common.h>
+
+#endif	/* __CONFIG_SOCFGPA_AGILEX5_H__ */
include/configs/socfpga_soc64_common.h +204 -10

265 lines not on this page · raw message

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

71 lines not on this page · raw message

include/dt-bindings/reset/altr,rst-mgr-agx5.h new file +82 -0

82 lines not on this page · raw message

Signature · 1 line
2.26.2
#22 lore raw

PATCH 17/17 tools: binman: update binman tool for agilex5

In reply to Jit Loon Lim

From: Sieu Mun Tang <[email protected]>

This is for new platform enablement for agilex5.
Update binman tool for new platform.

---
 tools/binman/control.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
tools/binman/control.py +4 -4
index 68597c4e77..51e94c9e65 100644
@@ -7,11 +7,11 @@
 
 from collections import OrderedDict
 import glob
-try:
-    import importlib.resources
-except ImportError:
+#try:
+#    import importlib.resources
+#except ImportError:
     # for Python 3.6
-    import importlib_resources
+#    import importlib_resources
 import os
 import pkg_resources
 import re
Signature · 1 line
2.26.2