Skip to contentSkip to conversation

Add Intel Agilex SoC support

PATCH Superseded Ley Foon Tan 3 participants 22 messages Aug 20, 2019 – Aug 21, 2019

Subsystems (5)

v3 of 8 Superseded Latest is v8 →

lore
Share & tools
lore
#0 lore raw

v3 cover Add Intel Agilex SoC support

This is 3rd version of patchset to add Intel Agilex SoC[1] support. Two major changes in this series are move Stratix 10 and Agilex common code to _soc64* file and convert drivers from struct to defines.

This patchset needs to apply after patch in [2] for manager drivers struct to defines conversion.

Patch status:
No change: Patch 1, 10, 14, 15
Have changes: Patch 2, 3, 4, 5, 6, 8, 9, 12, 13, 16, 17 New patch: Patch 7, 11

Detail change log is in patch commit message.

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

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

v2->v3:
-------
- Move S10 and Agilex code to _soc64* file.
- Convert to use defines instead of struct.
- Rename stratix10-clock.h to socfpga-soc64-clock.h
- Change compatible SDR string to use 'intel' (intel,sdr-ctl-agilex).

History:
---------
[v1]: https://patchwork.ozlabs.org/cover/1097830/
[v2]: https://patchwork.ozlabs.org/cover/1127440/

[1]: https://www.intel.com/content/www/us/en/products/programmable/fpga/agilex.html
[2]: https://patchwork.ozlabs.org/cover/1149731/

Ley Foon Tan (17):
arm: socfpga: agilex: Add base address for Intel Agilex SoC
arm: socfpga: Move firewall code to firewall file
arm: socfpga: Move Stratix10 and Agilex reset manager common code
arm: socfpga: agilex: Add reset manager support
arm: socfpga: Move Stratix10 and Agilex system manager common code
arm: socfpga: agilex: Add system manager support
arm: socfpga: Move Stratix10 and Agilex clock manager common code
clk: agilex: Add clock driver for Agilex
arm: socfpga: agilex: Add clock wrapper functions
arm: socfpga: agilex: Add CCU support for Agilex
arm: agilex: Add clock handoff offset for Agilex
ddr: altera: Restructure Stratix 10 SDRAM driver
ddr: altera: agilex: Add SDRAM driver for Agilex
board: intel: agilex: Add socdk board support for Intel Agilex SoC
arm: socfpga: agilex: Add SPL for Agilex SoC
arm: dts: agilex: Add base dtsi and devkit dts
arm: socfpga: agilex: Enable Agilex SoC build

 arch/arm/Kconfig                              |   4 +-
 arch/arm/dts/Makefile                         |   1 +
 arch/arm/dts/socfpga_agilex.dtsi              | 495 +++++++++++++++
 arch/arm/dts/socfpga_agilex_socdk-u-boot.dtsi |  71 +++
 arch/arm/dts/socfpga_agilex_socdk.dts         | 136 ++++
 arch/arm/mach-socfpga/Kconfig                 |  15 +
 arch/arm/mach-socfpga/Makefile                |  18 +
 arch/arm/mach-socfpga/ccu_agilex.c            |  99 +++
 arch/arm/mach-socfpga/clock_manager_agilex.c  |  84 +++
 .../mach-socfpga/{spl_s10.c => firewall.c}    | 112 +---
 .../mach-socfpga/include/mach/base_addr_s10.h |   4 +
 .../mach-socfpga/include/mach/ccu_agilex.h    |  67 ++
 .../mach-socfpga/include/mach/clock_manager.h |   2 +
 .../include/mach/clock_manager_agilex.h       |  14 +
 .../include/mach/clock_manager_s10.h          |  16 +-
 .../include/mach/clock_manager_soc64.h        |  23 +
 .../mach/{firewall_s10.h => firewall.h}       |  10 +-
 .../mach-socfpga/include/mach/handoff_s10.h   |   9 +-
 .../mach-socfpga/include/mach/reset_manager.h |   2 +
 .../include/mach/reset_manager_agilex.h       |  11 +
 .../include/mach/reset_manager_s10.h          |  87 +--
 .../include/mach/reset_manager_soc64.h        |  38 ++
 .../include/mach/system_manager.h             |   2 +
 .../include/mach/system_manager_agilex.h      |  11 +
 .../include/mach/system_manager_s10.h         | 114 +---
 ...m_manager_s10.h => system_manager_soc64.h} |  13 +-
 arch/arm/mach-socfpga/spl_agilex.c            |  97 +++
 arch/arm/mach-socfpga/spl_s10.c               |  87 +--
 arch/arm/mach-socfpga/wrap_pll_config_s10.c   |   5 +-
 board/intel/agilex-socdk/MAINTAINERS          |   7 +
 board/intel/agilex-socdk/Makefile             |   7 +
 board/intel/agilex-socdk/socfpga.c            |   7 +
 configs/socfpga_agilex_defconfig              |  58 ++
 drivers/clk/altera/Makefile                   |   1 +
 drivers/clk/altera/clk-agilex.c               | 579 ++++++++++++++++++
 drivers/clk/altera/clk-agilex.h               | 237 +++++++
 drivers/ddr/altera/Kconfig                    |   6 +-
 drivers/ddr/altera/Makefile                   |   3 +-
 drivers/ddr/altera/sdram_agilex.c             | 167 +++++
 drivers/ddr/altera/sdram_s10.c                | 298 +--------
 drivers/ddr/altera/sdram_s10.h                | 148 +----
 drivers/ddr/altera/sdram_soc64.c              | 304 +++++++++
 .../ddr/altera/{sdram_s10.h => sdram_soc64.h} |  71 ++-
 include/configs/socfpga_agilex_socdk.h        | 208 +++++++
 .../dt-bindings/clock/socfpga-soc64-clock.h   |  84 +++
 45 files changed, 2936 insertions(+), 896 deletions(-)
 create mode 100644 arch/arm/dts/socfpga_agilex.dtsi
 create mode 100644 arch/arm/dts/socfpga_agilex_socdk-u-boot.dtsi
 create mode 100644 arch/arm/dts/socfpga_agilex_socdk.dts
 create mode 100644 arch/arm/mach-socfpga/ccu_agilex.c
 create mode 100644 arch/arm/mach-socfpga/clock_manager_agilex.c
 copy arch/arm/mach-socfpga/{spl_s10.c => firewall.c} (51%)
 create mode 100644 arch/arm/mach-socfpga/include/mach/ccu_agilex.h
 create mode 100644 arch/arm/mach-socfpga/include/mach/clock_manager_agilex.h
 create mode 100644 arch/arm/mach-socfpga/include/mach/clock_manager_soc64.h
 rename arch/arm/mach-socfpga/include/mach/{firewall_s10.h => firewall.h} (94%)
 create mode 100644 arch/arm/mach-socfpga/include/mach/reset_manager_agilex.h
 create mode 100644 arch/arm/mach-socfpga/include/mach/reset_manager_soc64.h
 create mode 100644 arch/arm/mach-socfpga/include/mach/system_manager_agilex.h
 copy arch/arm/mach-socfpga/include/mach/{system_manager_s10.h => system_manager_soc64.h} (95%)
 create mode 100644 arch/arm/mach-socfpga/spl_agilex.c
 create mode 100644 board/intel/agilex-socdk/MAINTAINERS
 create mode 100644 board/intel/agilex-socdk/Makefile
 create mode 100644 board/intel/agilex-socdk/socfpga.c
 create mode 100644 configs/socfpga_agilex_defconfig
 create mode 100644 drivers/clk/altera/clk-agilex.c
 create mode 100644 drivers/clk/altera/clk-agilex.h
 create mode 100644 drivers/ddr/altera/sdram_agilex.c
 create mode 100644 drivers/ddr/altera/sdram_soc64.c
 copy drivers/ddr/altera/{sdram_s10.h => sdram_soc64.h} (79%)
 create mode 100644 include/configs/socfpga_agilex_socdk.h
 create mode 100644 include/dt-bindings/clock/socfpga-soc64-clock.h
Signature · 1 line
2.19.0
#1 lore raw

PATCH v3 1/17 arm: socfpga: agilex: Add base address for Intel Agilex SoC

Add base address for Intel Agilex SoC.

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

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

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

PATCH v3 2/17 arm: socfpga: Move firewall code to firewall file

In reply to Ley Foon Tan

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

No functional change.

---
v3:
- Move SOCFPGA_FIREWALL_TCU to firewall.c

---
 arch/arm/mach-socfpga/Makefile                |   1 +
 .../mach-socfpga/{spl_s10.c => firewall.c}    | 112 ++----------------
 .../mach/{firewall_s10.h => firewall.h}       |  10 +-
 arch/arm/mach-socfpga/spl_s10.c               |  87 +-------------
 drivers/ddr/altera/sdram_s10.c                |   2 +-
 5 files changed, 21 insertions(+), 191 deletions(-)
 copy arch/arm/mach-socfpga/{spl_s10.c => firewall.c} (51%)
 rename arch/arm/mach-socfpga/include/mach/{firewall_s10.h => firewall.h} (94%)
arch/arm/mach-socfpga/Makefile +1 -0
index fc1181cb27..dab34d0ef2 100644
@@ -51,6 +51,7 @@ ifdef CONFIG_TARGET_SOCFPGA_ARRIA10
 obj-y	+= spl_a10.o
 endif
 ifdef CONFIG_TARGET_SOCFPGA_STRATIX10
+obj-y	+= firewall.o
 obj-y	+= spl_s10.o
 endif
 endif
arch/arm/mach-socfpga/firewall.c renamed from arch/arm/mach-socfpga/spl_s10.c +11 -101

141 lines not on this page · raw message

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

105 lines not on this page · raw message

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

PATCH v3 3/17 arm: socfpga: Move Stratix10 and Agilex reset manager common code

In reply to Ley Foon Tan

Move Stratix10 and Agilex reset manager common code to reset_manager_soc64.h.

Remove unused RSTMGR_XXX defines.

---

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

---
 .../include/mach/reset_manager_s10.h          | 87 +------------------
 .../include/mach/reset_manager_soc64.h        | 38 ++++++++
 2 files changed, 40 insertions(+), 85 deletions(-)
 create mode 100644 arch/arm/mach-socfpga/include/mach/reset_manager_soc64.h
arch/arm/mach-socfpga/include/mach/reset_manager_s10.h +2 -85
index 64519c1d92..fdc9c8c9a4 100644
@@ -1,95 +1,12 @@
 /* SPDX-License-Identifier: GPL-2.0
  *
- * Copyright (C) 2016-2018 Intel Corporation <www.intel.com>
+ * Copyright (C) 2016-2019 Intel Corporation <www.intel.com>
  *
  */
 
 #ifndef	_RESET_MANAGER_S10_
 #define	_RESET_MANAGER_S10_
 
-void reset_cpu(ulong addr);
-int cpu_has_been_warmreset(void);
-
-void socfpga_bridges_reset(int enable);
-
-void socfpga_per_reset(u32 reset, int set);
-void socfpga_per_reset_all(void);
-
-#define RSTMGR_STATUS		0
-#define RSTMGR_MPUMODRST	0x20
-#define RSTMGR_PER0MODRST	0x24
-#define RSTMGR_PER1MODRST	0x28
-#define RSTMGR_BRGMODRST	0x2c
-
-#define RSTMGR_MPUMODRST_CORE0		0
-#define RSTMGR_PER0MODRST_OCP_MASK	0x0020bf00
-#define RSTMGR_BRGMODRST_DDRSCH_MASK	0X00000040
-#define RSTMGR_BRGMODRST_FPGA2SOC_MASK	0x00000004
-
-/* Watchdogs and MPU warm reset mask */
-#define RSTMGR_L4WD_MPU_WARMRESET_MASK	0x000F0F00
-
-/*
- * Define a reset identifier, from which a permodrst bank ID
- * and reset ID can be extracted using the subsequent macros
- * RSTMGR_RESET() and RSTMGR_BANK().
- */
-#define RSTMGR_BANK_OFFSET	8
-#define RSTMGR_BANK_MASK	0x7
-#define RSTMGR_RESET_OFFSET	0
-#define RSTMGR_RESET_MASK	0x1f
-#define RSTMGR_DEFINE(_bank, _offset)		\
-	((_bank) << RSTMGR_BANK_OFFSET) | ((_offset) << RSTMGR_RESET_OFFSET)
-
-/* Extract reset ID from the reset identifier. */
-#define RSTMGR_RESET(_reset)			\
-	(((_reset) >> RSTMGR_RESET_OFFSET) & RSTMGR_RESET_MASK)
-
-/* Extract bank ID from the reset identifier. */
-#define RSTMGR_BANK(_reset)			\
-	(((_reset) >> RSTMGR_BANK_OFFSET) & RSTMGR_BANK_MASK)
-
-/*
- * SocFPGA Stratix10 reset IDs, bank mapping is as follows:
- * 0 ... mpumodrst
- * 1 ... per0modrst
- * 2 ... per1modrst
- * 3 ... brgmodrst
- */
-#define RSTMGR_EMAC0		RSTMGR_DEFINE(1, 0)
-#define RSTMGR_EMAC1		RSTMGR_DEFINE(1, 1)
-#define RSTMGR_EMAC2		RSTMGR_DEFINE(1, 2)
-#define RSTMGR_USB0		RSTMGR_DEFINE(1, 3)
-#define RSTMGR_USB1		RSTMGR_DEFINE(1, 4)
-#define RSTMGR_NAND		RSTMGR_DEFINE(1, 5)
-#define RSTMGR_SDMMC		RSTMGR_DEFINE(1, 7)
-#define RSTMGR_EMAC0_OCP	RSTMGR_DEFINE(1, 8)
-#define RSTMGR_EMAC1_OCP	RSTMGR_DEFINE(1, 9)
-#define RSTMGR_EMAC2_OCP	RSTMGR_DEFINE(1, 10)
-#define RSTMGR_USB0_OCP		RSTMGR_DEFINE(1, 11)
-#define RSTMGR_USB1_OCP		RSTMGR_DEFINE(1, 12)
-#define RSTMGR_NAND_OCP		RSTMGR_DEFINE(1, 13)
-#define RSTMGR_SDMMC_OCP	RSTMGR_DEFINE(1, 15)
-#define RSTMGR_DMA		RSTMGR_DEFINE(1, 16)
-#define RSTMGR_SPIM0		RSTMGR_DEFINE(1, 17)
-#define RSTMGR_SPIM1		RSTMGR_DEFINE(1, 18)
-#define RSTMGR_L4WD0		RSTMGR_DEFINE(2, 0)
-#define RSTMGR_L4WD1		RSTMGR_DEFINE(2, 1)
-#define RSTMGR_L4WD2		RSTMGR_DEFINE(2, 2)
-#define RSTMGR_L4WD3		RSTMGR_DEFINE(2, 3)
-#define RSTMGR_OSC1TIMER0	RSTMGR_DEFINE(2, 4)
-#define RSTMGR_I2C0		RSTMGR_DEFINE(2, 8)
-#define RSTMGR_I2C1		RSTMGR_DEFINE(2, 9)
-#define RSTMGR_I2C2		RSTMGR_DEFINE(2, 10)
-#define RSTMGR_I2C3		RSTMGR_DEFINE(2, 11)
-#define RSTMGR_I2C4		RSTMGR_DEFINE(2, 12)
-#define RSTMGR_UART0		RSTMGR_DEFINE(2, 16)
-#define RSTMGR_UART1		RSTMGR_DEFINE(2, 17)
-#define RSTMGR_GPIO0		RSTMGR_DEFINE(2, 24)
-#define RSTMGR_GPIO1		RSTMGR_DEFINE(2, 25)
-#define RSTMGR_SDR		RSTMGR_DEFINE(3, 6)
-
-/* Create a human-readable reference to SoCFPGA reset. */
-#define SOCFPGA_RESET(_name)	RSTMGR_##_name
+#include <asm/arch/reset_manager_soc64.h>
 
 #endif /* _RESET_MANAGER_S10_ */
arch/arm/mach-socfpga/include/mach/reset_manager_soc64.h new file +38 -0
new file mode 100644
index 0000000000..87b5a171a1
@@ -0,0 +1,38 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ *  Copyright (C) 2016-2019 Intel Corporation <www.intel.com>
+ */
+
+#ifndef _RESET_MANAGER_SOC64_H_
+#define _RESET_MANAGER_SOC64_H_
+
+void reset_deassert_peripherals_handoff(void);
+int cpu_has_been_warmreset(void);
+void socfpga_bridges_reset(int enable);
+
+#define RSTMGR_STATUS		0
+#define RSTMGR_MPUMODRST	0x20
+#define RSTMGR_PER0MODRST	0x24
+#define RSTMGR_PER1MODRST	0x28
+#define RSTMGR_BRGMODRST	0x2c
+
+#define RSTMGR_MPUMODRST_CORE0		0
+#define RSTMGR_PER0MODRST_OCP_MASK	0x0020bf00
+#define RSTMGR_BRGMODRST_DDRSCH_MASK	0X00000040
+#define RSTMGR_BRGMODRST_FPGA2SOC_MASK	0x00000004
+
+/* Watchdogs and MPU warm reset mask */
+#define RSTMGR_L4WD_MPU_WARMRESET_MASK	0x000F0F00
+
+/*
+ * SocFPGA Stratix10 reset IDs, bank mapping is as follows:
+ * 0 ... mpumodrst
+ * 1 ... per0modrst
+ * 2 ... per1modrst
+ * 3 ... brgmodrst
+ */
+#define RSTMGR_L4WD0		RSTMGR_DEFINE(2, 0)
+#define RSTMGR_OSC1TIMER0	RSTMGR_DEFINE(2, 4)
+#define RSTMGR_UART0		RSTMGR_DEFINE(2, 16)
+
+#endif /* _RESET_MANAGER_SOC64_H_ */
Signature · 1 line
2.19.0
#4 lore raw

PATCH v3 4/17 arm: socfpga: agilex: Add reset manager support

In reply to Ley Foon Tan

Add reset manager support for Agilex.

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

---
 arch/arm/mach-socfpga/include/mach/reset_manager.h    |  2 ++
 .../mach-socfpga/include/mach/reset_manager_agilex.h  | 11 +++++++++++
 2 files changed, 13 insertions(+)
 create mode 100644 arch/arm/mach-socfpga/include/mach/reset_manager_agilex.h
arch/arm/mach-socfpga/include/mach/reset_manager.h +2 -0
index c460e89d22..d4cd39e960 100644
@@ -55,6 +55,8 @@ void socfpga_per_reset_all(void);
 #include <asm/arch/reset_manager_arria10.h>
 #elif defined(CONFIG_TARGET_SOCFPGA_STRATIX10)
 #include <asm/arch/reset_manager_s10.h>
+#elif defined(CONFIG_TARGET_SOCFPGA_AGILEX)
+#include <asm/arch/reset_manager_agilex.h>
 #endif
 
 #endif /* _RESET_MANAGER_H_ */
arch/arm/mach-socfpga/include/mach/reset_manager_agilex.h new file +11 -0
new file mode 100644
index 0000000000..617e06ec06
@@ -0,0 +1,11 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright (C) 2019 Intel Corporation <www.intel.com>
+ */
+
+#ifndef	_RESET_MANAGER_AGILEX_
+#define	_RESET_MANAGER_AGILEX_
+
+#include <asm/arch/reset_manager_soc64.h>
+
+#endif /* _RESET_MANAGER_AGILEX_ */
Signature · 1 line
2.19.0
#5 lore raw

PATCH v3 5/17 arm: socfpga: Move Stratix10 and Agilex system manager common code

In reply to Ley Foon Tan

Move Stratix10 and Agilex system manager common code to system_manager_soc64.h.

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

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

---
 .../include/mach/system_manager_s10.h         | 114 +-----------------
 ...m_manager_s10.h => system_manager_soc64.h} |  13 +-
 2 files changed, 8 insertions(+), 119 deletions(-)
 copy arch/arm/mach-socfpga/include/mach/{system_manager_s10.h => system_manager_soc64.h} (95%)
arch/arm/mach-socfpga/include/mach/system_manager_s10.h +2 -112
index cb5ccda620..c537fb300c 100644
@@ -1,122 +1,12 @@
 /* SPDX-License-Identifier: GPL-2.0
  *
- * Copyright (C) 2016-2018 Intel Corporation <www.intel.com>
+ * Copyright (C) 2016-2019 Intel Corporation <www.intel.com>
  *
  */
 
 #ifndef	_SYSTEM_MANAGER_S10_
 #define	_SYSTEM_MANAGER_S10_
 
-void sysmgr_pinmux_init(void);
-void populate_sysmgr_fpgaintf_module(void);
-void populate_sysmgr_pinmux(void);
-void sysmgr_pinmux_table_sel(const u32 **table, unsigned int *table_len);
-void sysmgr_pinmux_table_ctrl(const u32 **table, unsigned int *table_len);
-void sysmgr_pinmux_table_fpga(const u32 **table, unsigned int *table_len);
-void sysmgr_pinmux_table_delay(const u32 **table, unsigned int *table_len);
-
-#define SYSMGR_WDDBG			0x8
-#define SYSMGR_DMA			0x20
-#define SYSMGR_DMA_PERIPH		0x24
-#define SYSMGR_SDMMC			0x28
-#define SYSMGR_SDMMC_L3MASTER		0x2c
-#define SYSMGR_EMAC_GLOBAL		0x40
-#define SYSMGR_EMAC0			0x44
-#define SYSMGR_EMAC1			0x48
-#define SYSMGR_EMAC2			0x4c
-#define SYSMGR_EMAC0_ACE		0x50
-#define SYSMGR_EMAC1_ACE		0x54
-#define SYSMGR_EMAC2_ACE		0x58
-#define SYSMGR_NAND_AXUSER		0x5c
-#define SYSMGR_FPGAINTF_EN1		0x68
-#define SYSMGR_FPGAINTF_EN2		0x6c
-#define SYSMGR_FPGAINTF_EN3		0x70
-#define SYSMGR_DMA_L3MASTER		0x74
-#define SYSMGR_HMC_CLK			0xb4
-#define SYSMGR_IO_PA_CTRL		0xb8
-#define SYSMGR_NOC_TIMEOUT		0xc0
-#define SYSMGR_NOC_IDLEREQ_SET		0xc4
-#define SYSMGR_NOC_IDLEREQ_CLR		0xc8
-#define SYSMGR_NOC_IDLEREQ_VAL		0xcc
-#define SYSMGR_NOC_IDLEACK		0xd0
-#define SYSMGR_NOC_IDLESTATUS		0xd4
-#define SYSMGR_FPGA2SOC_CTRL		0xd8
-#define SYSMGR_FPGA_CONFIG		0xdc
-#define SYSMGR_IOCSRCLK_GATE		0xe0
-#define SYSMGR_GPO			0xe4
-#define SYSMGR_GPI			0xe8
-#define SYSMGR_MPU			0xf0
-#define SYSMGR_BOOT_SCRATCH_COLD0	0x200
-#define SYSMGR_BOOT_SCRATCH_COLD1	0x204
-#define SYSMGR_BOOT_SCRATCH_COLD2	0x208
-#define SYSMGR_BOOT_SCRATCH_COLD3	0x20c
-#define SYSMGR_BOOT_SCRATCH_COLD4	0x210
-#define SYSMGR_BOOT_SCRATCH_COLD5	0x214
-#define SYSMGR_BOOT_SCRATCH_COLD6	0x218
-#define SYSMGR_BOOT_SCRATCH_COLD7	0x21c
-#define SYSMGR_BOOT_SCRATCH_COLD8	0x220
-#define SYSMGR_BOOT_SCRATCH_COLD9	0x224
-#define SYSMGR_PINSEL0			0x1000
-#define SYSMGR_IOCTRL0			0x1130
-#define SYSMGR_EMAC0_USEFPGA		0x1300
-#define SYSMGR_EMAC1_USEFPGA		0x1304
-#define SYSMGR_EMAC2_USEFPGA		0x1308
-#define SYSMGR_I2C0_USEFPGA		0x130c
-#define SYSMGR_I2C1_USEFPGA		0x1310
-#define SYSMGR_I2C_EMAC0_USEFPGA	0x1314
-#define SYSMGR_I2C_EMAC1_USEFPGA	0x1318
-#define SYSMGR_I2C_EMAC2_USEFPGA	0x131c
-#define SYSMGR_NAND_USEFPGA		0x1320
-#define SYSMGR_SPIM0_USEFPGA		0x1328
-#define SYSMGR_SPIM1_USEFPGA		0x132c
-#define SYSMGR_SPIS0_USEFPGA		0x1330
-#define SYSMGR_SPIS1_USEFPGA		0x1334
-#define SYSMGR_UART0_USEFPGA		0x1338
-#define SYSMGR_UART1_USEFPGA		0x133c
-#define SYSMGR_MDIO0_USEFPGA		0x1340
-#define SYSMGR_MDIO1_USEFPGA		0x1344
-#define SYSMGR_MDIO2_USEFPGA		0x1348
-#define SYSMGR_JTAG_USEFPGA		0x1350
-#define SYSMGR_SDMMC_USEFPGA		0x1354
-#define SYSMGR_HPS_OSC_CLK		0x1358
-#define SYSMGR_IODELAY0			0x1400
-
-#define SYSMGR_ROMCODEGRP_CTRL_WARMRSTCFGPINMUX	BIT(0)
-#define SYSMGR_ROMCODEGRP_CTRL_WARMRSTCFGIO	BIT(1)
-#define SYSMGR_ECC_OCRAM_EN	BIT(0)
-#define SYSMGR_ECC_OCRAM_SERR	BIT(3)
-#define SYSMGR_ECC_OCRAM_DERR	BIT(4)
-#define SYSMGR_FPGAINTF_USEFPGA	0x1
-
-#define SYSMGR_FPGAINTF_NAND	BIT(4)
-#define SYSMGR_FPGAINTF_SDMMC	BIT(8)
-#define SYSMGR_FPGAINTF_SPIM0	BIT(16)
-#define SYSMGR_FPGAINTF_SPIM1	BIT(24)
-#define SYSMGR_FPGAINTF_EMAC0	BIT(0)
-#define SYSMGR_FPGAINTF_EMAC1	BIT(8)
-#define SYSMGR_FPGAINTF_EMAC2	BIT(16)
-
-#define SYSMGR_SDMMC_SMPLSEL_SHIFT	4
-#define SYSMGR_SDMMC_DRVSEL_SHIFT	0
-
-/* EMAC Group Bit definitions */
-#define SYSMGR_EMACGRP_CTRL_PHYSEL_ENUM_GMII_MII	0x0
-#define SYSMGR_EMACGRP_CTRL_PHYSEL_ENUM_RGMII		0x1
-#define SYSMGR_EMACGRP_CTRL_PHYSEL_ENUM_RMII		0x2
-
-#define SYSMGR_EMACGRP_CTRL_PHYSEL0_LSB			0
-#define SYSMGR_EMACGRP_CTRL_PHYSEL1_LSB			2
-#define SYSMGR_EMACGRP_CTRL_PHYSEL_MASK			0x3
-
-#define SYSMGR_NOC_H2F_MSK		0x00000001
-#define SYSMGR_NOC_LWH2F_MSK		0x00000010
-#define SYSMGR_HMC_CLK_STATUS_MSK	0x00000001
-
-#define SYSMGR_DMA_IRQ_NS		0xFF000000
-#define SYSMGR_DMA_MGR_NS		0x00010000
-
-#define SYSMGR_DMAPERIPH_ALL_NS		0xFFFFFFFF
-
-#define SYSMGR_WDDBG_PAUSE_ALL_CPU	0x0F0F0F0F
+#include <asm/arch/system_manager_soc64.h>
 
 #endif /* _SYSTEM_MANAGER_S10_ */
arch/arm/mach-socfpga/include/mach/system_manager_soc64.h renamed from arch/arm/mach-socfpga/include/mach/system_manager_s10.h +6 -7
similarity index 95%
copy from arch/arm/mach-socfpga/include/mach/system_manager_s10.h
copy to arch/arm/mach-socfpga/include/mach/system_manager_soc64.h
index cb5ccda620..a24b652823 100644
@@ -1,11 +1,10 @@
-/* SPDX-License-Identifier: GPL-2.0
- *
- * Copyright (C) 2016-2018 Intel Corporation <www.intel.com>
- *
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright (C) 2019 Intel Corporation <www.intel.com>
  */
 
-#ifndef	_SYSTEM_MANAGER_S10_
-#define	_SYSTEM_MANAGER_S10_
+#ifndef _SYSTEM_MANAGER_SOC64_H_
+#define _SYSTEM_MANAGER_SOC64_H_
 
 void sysmgr_pinmux_init(void);
 void populate_sysmgr_fpgaintf_module(void);
@@ -119,4 +118,4 @@ void sysmgr_pinmux_table_delay(const u32 **table, unsigned int *table_len);
 
 #define SYSMGR_WDDBG_PAUSE_ALL_CPU	0x0F0F0F0F
 
-#endif /* _SYSTEM_MANAGER_S10_ */
+#endif /* _SYSTEM_MANAGER_SOC64_H_ */
Signature · 1 line
2.19.0
#6 lore raw

PATCH v3 6/17 arm: socfpga: agilex: Add system manager support

In reply to Ley Foon Tan

Add system manager support for Agilex.

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

v2:
- Include system_manager_s10_agilex_common.h in system_manager_agilex.h

---
 arch/arm/mach-socfpga/include/mach/system_manager.h   |  2 ++
 .../mach-socfpga/include/mach/system_manager_agilex.h | 11 +++++++++++
 2 files changed, 13 insertions(+)
 create mode 100644 arch/arm/mach-socfpga/include/mach/system_manager_agilex.h
arch/arm/mach-socfpga/include/mach/system_manager.h +2 -0
index f2f6bc8aec..cfabf48a48 100644
@@ -23,6 +23,8 @@
 
 #if defined(CONFIG_TARGET_SOCFPGA_STRATIX10)
 #include <asm/arch/system_manager_s10.h>
+#elif defined(CONFIG_TARGET_SOCFPGA_AGILEX)
+#include <asm/arch/system_manager_agilex.h>
 #else
 #define SYSMGR_ROMCODEGRP_CTRL_WARMRSTCFGPINMUX	BIT(0)
 #define SYSMGR_ROMCODEGRP_CTRL_WARMRSTCFGIO	BIT(1)
arch/arm/mach-socfpga/include/mach/system_manager_agilex.h new file +11 -0
new file mode 100644
index 0000000000..cb284114be
@@ -0,0 +1,11 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright (C) 2019 Intel Corporation <www.intel.com>
+ */
+
+#ifndef	_SYSTEM_MANAGER_AGILEX_
+#define	_SYSTEM_MANAGER_AGILEX_
+
+#include <asm/arch/system_manager_soc64.h>
+
+#endif /* _SYSTEM_MANAGER_AGILEX_ */
Signature · 1 line
2.19.0
#7 lore raw

PATCH v3 7/17 arm: socfpga: Move Stratix10 and Agilex clock manager common code

In reply to Ley Foon Tan

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

Fixed CLKMGR_INTOSC_HZ to 400MHz instead of 460MHz.

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

PATCH v3 8/17 clk: agilex: Add clock driver for Agilex

In reply to Ley Foon Tan

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

Rename stratix10-clock.h to socfpga-soc64-clock.h.

stratix10-clock.h is from Linux commit ID 89727949ea1e.

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

v2:
- Convert Clock driver to DM

---
 drivers/clk/altera/Makefile                   |   1 +
 drivers/clk/altera/clk-agilex.c               | 579 ++++++++++++++++++
 drivers/clk/altera/clk-agilex.h               | 237 +++++++
 .../dt-bindings/clock/socfpga-soc64-clock.h   |  84 +++
 4 files changed, 901 insertions(+)
 create mode 100644 drivers/clk/altera/clk-agilex.c
 create mode 100644 drivers/clk/altera/clk-agilex.h
 create mode 100644 include/dt-bindings/clock/socfpga-soc64-clock.h
drivers/clk/altera/Makefile +1 -0
index a3ae8b24b0..96215ad5c4 100644
@@ -3,4 +3,5 @@
 # Copyright (C) 2018 Marek Vasut <[email protected]>
 #
 
+obj-$(CONFIG_TARGET_SOCFPGA_AGILEX) += clk-agilex.o
 obj-$(CONFIG_TARGET_SOCFPGA_ARRIA10) += clk-arria10.o
drivers/clk/altera/clk-agilex.c new file +579 -0

579 lines not on this page · raw message

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

237 lines not on this page · raw message

include/dt-bindings/clock/socfpga-soc64-clock.h new file +84 -0

84 lines not on this page · raw message

Signature · 1 line
2.19.0
#9 lore raw

PATCH v3 9/17 arm: socfpga: agilex: Add clock wrapper functions

In reply to Ley Foon Tan

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

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

v2:
- Get clocks from clock DM.

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

84 lines not on this page · raw message

arch/arm/mach-socfpga/include/mach/clock_manager.h +2 -0
index 73ec7dca65..36eec40d72 100644
@@ -33,6 +33,8 @@ void cm_print_clock_quick_summary(void);
 #include <asm/arch/clock_manager_arria10.h>
 #elif defined(CONFIG_TARGET_SOCFPGA_STRATIX10)
 #include <asm/arch/clock_manager_s10.h>
+#elif defined(CONFIG_TARGET_SOCFPGA_AGILEX)
+#include <asm/arch/clock_manager_agilex.h>
 #endif
 
 #endif /* _CLOCK_MANAGER_H_ */
arch/arm/mach-socfpga/include/mach/clock_manager_agilex.h new file +14 -0
new file mode 100644
index 0000000000..386e82a4e3
@@ -0,0 +1,14 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright (C) 2019 Intel Corporation <www.intel.com>
+ */
+
+#ifndef _CLOCK_MANAGER_AGILEX_
+#define _CLOCK_MANAGER_AGILEX_
+
+unsigned long cm_get_mpu_clk_hz(void);
+
+#include <asm/arch/clock_manager_soc64.h>
+#include "../../../../../drivers/clk/altera/clk-agilex.h"
+
+#endif /* _CLOCK_MANAGER_AGILEX_ */
Signature · 1 line
2.19.0
#10 lore raw

PATCH v3 10/17 arm: socfpga: agilex: Add CCU support for Agilex

In reply to Ley Foon Tan

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

Software need to initialize CCU's directories and coherency agent interfaces in CCU IP.

---
 arch/arm/mach-socfpga/Makefile                |  3 +
 arch/arm/mach-socfpga/ccu_agilex.c            | 99 +++++++++++++++++++
 .../mach-socfpga/include/mach/ccu_agilex.h    | 67 +++++++++++++
 3 files changed, 169 insertions(+)
 create mode 100644 arch/arm/mach-socfpga/ccu_agilex.c
 create mode 100644 arch/arm/mach-socfpga/include/mach/ccu_agilex.h
arch/arm/mach-socfpga/Makefile +3 -0
index a403b46b47..6f39dc06ed 100644
@@ -58,6 +58,9 @@ ifdef CONFIG_TARGET_SOCFPGA_STRATIX10
 obj-y	+= firewall.o
 obj-y	+= spl_s10.o
 endif
+ifdef CONFIG_TARGET_SOCFPGA_AGILEX
+obj-y	+= ccu_agilex.o
+endif
 endif
 
 ifdef CONFIG_TARGET_SOCFPGA_GEN5
arch/arm/mach-socfpga/ccu_agilex.c new file +99 -0

99 lines not on this page · raw message

arch/arm/mach-socfpga/include/mach/ccu_agilex.h new file +67 -0

67 lines not on this page · raw message

Signature · 1 line
2.19.0
#11 lore raw

PATCH v3 11/17 arm: agilex: Add clock handoff offset for Agilex

In reply to Ley Foon Tan

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

---
 arch/arm/mach-socfpga/include/mach/handoff_s10.h | 9 +++++++--
 arch/arm/mach-socfpga/wrap_pll_config_s10.c      | 5 +++--
 2 files changed, 10 insertions(+), 4 deletions(-)
arch/arm/mach-socfpga/include/mach/handoff_s10.h +7 -2
index ba0f1fd1b2..abf04d9b04 100644
@@ -26,8 +26,13 @@
 #define S10_HANDOFF_OFFSET_LENGTH	0x4
 #define S10_HANDOFF_OFFSET_DATA	0x10
 
-#define S10_HANDOFF_CLOCK_OSC	(S10_HANDOFF_BASE + 0x608)
-#define S10_HANDOFF_CLOCK_FPGA	(S10_HANDOFF_BASE + 0x60C)
+#ifdef TARGET_SOCFPGA_STRATIX10
+#define HANDOFF_CLOCK_OSC	(S10_HANDOFF_BASE + 0x608)
+#define HANDOFF_CLOCK_FPGA	(S10_HANDOFF_BASE + 0x60C)
+#else
+#define HANDOFF_CLOCK_OSC	(S10_HANDOFF_BASE + 0x5fc)
+#define HANDOFF_CLOCK_FPGA	(S10_HANDOFF_BASE + 0x600)
+#endif
 
 #define S10_HANDOFF_SIZE	4096
 
arch/arm/mach-socfpga/wrap_pll_config_s10.c +3 -2
index 65952396e9..2ff3ca1a49 100644
@@ -33,7 +33,8 @@ const struct cm_config * const cm_get_default_config(void)
 const unsigned int cm_get_osc_clk_hz(void)
 {
 #ifdef CONFIG_SPL_BUILD
-	u32 clock = readl(S10_HANDOFF_CLOCK_OSC);
+
+	u32 clock = readl(HANDOFF_CLOCK_OSC);
 
 	SYSMGR_WRITEL(clock, SYSMGR_BOOT_SCRATCH_COLD1);
 #endif
@@ -48,7 +49,7 @@ const unsigned int cm_get_intosc_clk_hz(void)
 const unsigned int cm_get_fpga_clk_hz(void)
 {
 #ifdef CONFIG_SPL_BUILD
-	u32 clock = readl(S10_HANDOFF_CLOCK_FPGA);
+	u32 clock = readl(HANDOFF_CLOCK_FPGA);
 
 	SYSMGR_WRITEL(clock, SYSMGR_BOOT_SCRATCH_COLD2);
 #endif
Signature · 1 line
2.19.0
#12 lore raw

PATCH v3 12/17 ddr: altera: Restructure Stratix 10 SDRAM driver

In reply to Ley Foon Tan

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

---
v3:
- Change sdram_common.* to sdram_soc64.*

---
 drivers/ddr/altera/Makefile                   |   2 +-
 drivers/ddr/altera/sdram_s10.c                | 296 +----------------
 drivers/ddr/altera/sdram_s10.h                | 148 +--------
 drivers/ddr/altera/sdram_soc64.c              | 303 ++++++++++++++++++
 .../ddr/altera/{sdram_s10.h => sdram_soc64.h} |  70 ++--
 5 files changed, 340 insertions(+), 479 deletions(-)
 create mode 100644 drivers/ddr/altera/sdram_soc64.c
 copy drivers/ddr/altera/{sdram_s10.h => sdram_soc64.h} (79%)
drivers/ddr/altera/Makefile +1 -1
index 341ac0d73b..eb8da13b7d 100644
@@ -9,5 +9,5 @@
 ifdef CONFIG_$(SPL_)ALTERA_SDRAM
 obj-$(CONFIG_TARGET_SOCFPGA_GEN5) += sdram_gen5.o sequencer.o
 obj-$(CONFIG_TARGET_SOCFPGA_ARRIA10) += sdram_arria10.o
-obj-$(CONFIG_TARGET_SOCFPGA_STRATIX10) += sdram_s10.o
+obj-$(CONFIG_TARGET_SOCFPGA_STRATIX10) += sdram_soc64.o sdram_s10.o
 endif
drivers/ddr/altera/sdram_s10.c +1 -295

330 lines not on this page · raw message

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

159 lines not on this page · raw message

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

303 lines not on this page · raw message

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

85 lines not on this page · raw message

Signature · 1 line
2.19.0
#13 lore raw

PATCH v3 13/17 ddr: altera: agilex: Add SDRAM driver for Agilex

In reply to Ley Foon Tan

Add SDRAM driver for Agilex SoC.

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

---
 drivers/ddr/altera/Kconfig        |   6 +-
 drivers/ddr/altera/Makefile       |   1 +
 drivers/ddr/altera/sdram_agilex.c | 167 ++++++++++++++++++++++++++++++
 drivers/ddr/altera/sdram_soc64.c  |   1 +
 drivers/ddr/altera/sdram_soc64.h  |   1 +
 5 files changed, 173 insertions(+), 3 deletions(-)
 create mode 100644 drivers/ddr/altera/sdram_agilex.c
drivers/ddr/altera/Kconfig +3 -3
index 2b1c1be3b5..8f590dc5f6 100644
@@ -1,8 +1,8 @@
 config SPL_ALTERA_SDRAM
 	bool "SoCFPGA DDR SDRAM driver in SPL"
 	depends on SPL
-	depends on TARGET_SOCFPGA_GEN5 || TARGET_SOCFPGA_ARRIA10 || TARGET_SOCFPGA_STRATIX10
-	select RAM if TARGET_SOCFPGA_GEN5 || TARGET_SOCFPGA_STRATIX10
-	select SPL_RAM if TARGET_SOCFPGA_GEN5 || TARGET_SOCFPGA_STRATIX10
+	depends on TARGET_SOCFPGA_GEN5 || TARGET_SOCFPGA_ARRIA10 || TARGET_SOCFPGA_STRATIX10 || TARGET_SOCFPGA_AGILEX
+	select RAM if TARGET_SOCFPGA_GEN5 || TARGET_SOCFPGA_STRATIX10 || TARGET_SOCFPGA_AGILEX
+	select SPL_RAM if TARGET_SOCFPGA_GEN5 || TARGET_SOCFPGA_STRATIX10 || TARGET_SOCFPGA_AGILEX
 	help
 	  Enable DDR SDRAM controller for the SoCFPGA devices.
drivers/ddr/altera/Makefile +1 -0
index eb8da13b7d..39dfee5d5a 100644
@@ -10,4 +10,5 @@ ifdef CONFIG_$(SPL_)ALTERA_SDRAM
 obj-$(CONFIG_TARGET_SOCFPGA_GEN5) += sdram_gen5.o sequencer.o
 obj-$(CONFIG_TARGET_SOCFPGA_ARRIA10) += sdram_arria10.o
 obj-$(CONFIG_TARGET_SOCFPGA_STRATIX10) += sdram_soc64.o sdram_s10.o
+obj-$(CONFIG_TARGET_SOCFPGA_AGILEX) += sdram_soc64.o sdram_agilex.o
 endif
drivers/ddr/altera/sdram_agilex.c new file +167 -0

167 lines not on this page · raw message

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

PATCH v3 14/17 board: intel: agilex: Add socdk board support for Intel Agilex SoC

In reply to Ley Foon Tan

Add socdk board support for Intel Agilex SoC

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

PATCH v3 15/17 arm: socfpga: agilex: Add SPL for Agilex SoC

In reply to Ley Foon Tan

Add SPL support for Agilex SoC.

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

---
 arch/arm/mach-socfpga/Makefile     |  1 +
 arch/arm/mach-socfpga/spl_agilex.c | 97 ++++++++++++++++++++++++++++++
 2 files changed, 98 insertions(+)
 create mode 100644 arch/arm/mach-socfpga/spl_agilex.c
arch/arm/mach-socfpga/Makefile +1 -0
index 6f39dc06ed..9d334e9e1b 100644
@@ -60,6 +60,7 @@ obj-y	+= spl_s10.o
 endif
 ifdef CONFIG_TARGET_SOCFPGA_AGILEX
 obj-y	+= ccu_agilex.o
+obj-y	+= spl_agilex.o
 endif
 endif
 
arch/arm/mach-socfpga/spl_agilex.c new file +97 -0

97 lines not on this page · raw message

Signature · 1 line
2.19.0
#16 lore raw

PATCH v3 16/17 arm: dts: agilex: Add base dtsi and devkit dts

In reply to Ley Foon Tan

Add device tree files for Agilex SoC platform.

Based on Linux Commit ID 4b36daf9ada30.

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

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

---
 arch/arm/dts/Makefile                         |   1 +
 arch/arm/dts/socfpga_agilex.dtsi              | 495 ++++++++++++++++++
 arch/arm/dts/socfpga_agilex_socdk-u-boot.dtsi |  71 +++
 arch/arm/dts/socfpga_agilex_socdk.dts         | 136 +++++
 4 files changed, 703 insertions(+)
 create mode 100644 arch/arm/dts/socfpga_agilex.dtsi
 create mode 100644 arch/arm/dts/socfpga_agilex_socdk-u-boot.dtsi
 create mode 100644 arch/arm/dts/socfpga_agilex_socdk.dts
arch/arm/dts/Makefile +1 -0
index ebe5495d44..7f375a8c7e 100644
@@ -309,6 +309,7 @@ dtb-$(CONFIG_TI816X) += dm8168-evm.dtb
 dtb-$(CONFIG_THUNDERX) += thunderx-88xx.dtb
 
 dtb-$(CONFIG_ARCH_SOCFPGA) +=				\
+	socfpga_agilex_socdk.dtb			\
 	socfpga_arria5_socdk.dtb			\
 	socfpga_arria10_socdk_sdmmc.dtb			\
 	socfpga_cyclone5_mcvevk.dtb			\
arch/arm/dts/socfpga_agilex.dtsi new file +495 -0

495 lines not on this page · raw message

arch/arm/dts/socfpga_agilex_socdk-u-boot.dtsi new file +71 -0

71 lines not on this page · raw message

arch/arm/dts/socfpga_agilex_socdk.dts new file +136 -0

136 lines not on this page · raw message

Signature · 1 line
2.19.0
#17 lore raw

PATCH v3 17/17 arm: socfpga: agilex: Enable Agilex SoC build

In reply to Ley Foon Tan

Add build support for Agilex SoC.

---
v3:
- Disable CONFIG_USE_TINY_PRINTF

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

---
 arch/arm/Kconfig                       |   4 +-
 arch/arm/mach-socfpga/Kconfig          |  15 ++
 arch/arm/mach-socfpga/Makefile         |   9 ++
 configs/socfpga_agilex_defconfig       |  58 +++++++
 include/configs/socfpga_agilex_socdk.h | 208 +++++++++++++++++++++++++
 5 files changed, 292 insertions(+), 2 deletions(-)
 create mode 100644 configs/socfpga_agilex_defconfig
 create mode 100644 include/configs/socfpga_agilex_socdk.h
arch/arm/Kconfig +2 -2
index 1cb89c6f15..133fbcbc4e 100644
@@ -881,7 +881,7 @@ config ARCH_SOCFPGA
 	bool "Altera SOCFPGA family"
 	select ARCH_EARLY_INIT_R
 	select ARCH_MISC_INIT if !TARGET_SOCFPGA_ARRIA10
-	select ARM64 if TARGET_SOCFPGA_STRATIX10
+	select ARM64 if TARGET_SOCFPGA_STRATIX10 || TARGET_SOCFPGA_AGILEX
 	select CPU_V7A if TARGET_SOCFPGA_GEN5 || TARGET_SOCFPGA_ARRIA10
 	select DM
 	select DM_SERIAL
@@ -893,7 +893,7 @@ config ARCH_SOCFPGA
 	select SPL_LIBGENERIC_SUPPORT
 	select SPL_NAND_SUPPORT if SPL_NAND_DENALI
 	select SPL_OF_CONTROL
-	select SPL_SEPARATE_BSS if TARGET_SOCFPGA_STRATIX10
+	select SPL_SEPARATE_BSS if TARGET_SOCFPGA_STRATIX10 || TARGET_SOCFPGA_AGILEX
 	select SPL_SERIAL_SUPPORT
 	select SPL_SYSRESET
 	select SPL_WATCHDOG_SUPPORT
arch/arm/mach-socfpga/Kconfig +15 -0
index 1d914648e3..b64477a081 100644
@@ -26,6 +26,14 @@ config SYS_TEXT_BASE
 	default 0x01000040 if TARGET_SOCFPGA_ARRIA10
 	default 0x01000040 if TARGET_SOCFPGA_GEN5
 
+config TARGET_SOCFPGA_AGILEX
+	bool
+	select ARMV8_MULTIENTRY
+	select ARMV8_SET_SMPEN
+	select ARMV8_SPIN_TABLE
+	select CLK
+	select SPL_CLK if SPL
+
 config TARGET_SOCFPGA_ARRIA5
 	bool
 	select TARGET_SOCFPGA_GEN5
@@ -72,6 +80,10 @@ choice
 	prompt "Altera SOCFPGA board select"
 	optional
 
+config TARGET_SOCFPGA_AGILEX_SOCDK
+	bool "Intel SOCFPGA SoCDK (Agilex)"
+	select TARGET_SOCFPGA_AGILEX
+
 config TARGET_SOCFPGA_ARIES_MCVEVK
 	bool "Aries MCVEVK (Cyclone V)"
 	select TARGET_SOCFPGA_CYCLONE5
@@ -132,6 +144,7 @@ config TARGET_SOCFPGA_TERASIC_SOCKIT
 endchoice
 
 config SYS_BOARD
+	default "agilex-socdk" if TARGET_SOCFPGA_AGILEX_SOCDK
 	default "arria5-socdk" if TARGET_SOCFPGA_ARRIA5_SOCDK
 	default "arria10-socdk" if TARGET_SOCFPGA_ARRIA10_SOCDK
 	default "cyclone5-socdk" if TARGET_SOCFPGA_CYCLONE5_SOCDK
@@ -148,6 +161,7 @@ config SYS_BOARD
 	default "vining_fpga" if TARGET_SOCFPGA_SAMTEC_VINING_FPGA
 
 config SYS_VENDOR
+	default "intel" if TARGET_SOCFPGA_AGILEX_SOCDK
 	default "altera" if TARGET_SOCFPGA_ARRIA5_SOCDK
 	default "altera" if TARGET_SOCFPGA_ARRIA10_SOCDK
 	default "altera" if TARGET_SOCFPGA_CYCLONE5_SOCDK
@@ -165,6 +179,7 @@ config SYS_SOC
 	default "socfpga"
 
 config SYS_CONFIG_NAME
+	default "socfpga_agilex_socdk" if TARGET_SOCFPGA_AGILEX_SOCDK
 	default "socfpga_arria5_socdk" if TARGET_SOCFPGA_ARRIA5_SOCDK
 	default "socfpga_arria10_socdk" if TARGET_SOCFPGA_ARRIA10_SOCDK
 	default "socfpga_cyclone5_socdk" if TARGET_SOCFPGA_CYCLONE5_SOCDK
arch/arm/mach-socfpga/Makefile +9 -0
index 9d334e9e1b..30c87b1efd 100644
@@ -41,6 +41,14 @@ endif
 
 ifdef CONFIG_TARGET_SOCFPGA_AGILEX
 obj-y	+= clock_manager_agilex.o
+obj-y	+= mailbox_s10.o
+obj-y	+= misc_s10.o
+obj-y	+= mmu-arm64_s10.o
+obj-y	+= reset_manager_s10.o
+obj-y	+= system_manager_s10.o
+obj-y	+= timer_s10.o
+obj-y	+= wrap_pinmux_config_s10.o
+obj-y	+= wrap_pll_config_s10.o
 endif
 
 ifdef CONFIG_SPL_BUILD
@@ -60,6 +68,7 @@ obj-y	+= spl_s10.o
 endif
 ifdef CONFIG_TARGET_SOCFPGA_AGILEX
 obj-y	+= ccu_agilex.o
+obj-y	+= firewall.o
 obj-y	+= spl_agilex.o
 endif
 endif
configs/socfpga_agilex_defconfig new file +58 -0

58 lines not on this page · raw message

include/configs/socfpga_agilex_socdk.h new file +208 -0

208 lines not on this page · raw message

Signature · 1 line
2.19.0
#18 lore raw

v3 cover Add Intel Agilex SoC support

In reply to Ley Foon Tan
Quoted 12 lines · Ley Foon Tan

This is 3rd version of patchset to add Intel Agilex SoC[1] support. Two major changes in this series are move Stratix 10 and Agilex common code to _soc64* file and convert drivers from struct to defines.

This patchset needs to apply after patch in [2] for manager drivers struct to defines conversion.

Patch status:
No change: Patch 1, 10, 14, 15
Have changes: Patch 2, 3, 4, 5, 6, 8, 9, 12, 13, 16, 17 New patch: Patch 7, 11

Quoted 5 lines

Detail change log is in patch commit message.

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

I wanted to pick these, but they don't apply to u-boot-socfpga/master (updated to u-boot/master). Can you update and repost ?

#19 lore raw

v3 cover Add Intel Agilex SoC support

Quoted 14 lines · Marek Vasut
Quoted 12 lines · Ley Foon Tan

This is 3rd version of patchset to add Intel Agilex SoC[1] support. Two major changes in this series are move Stratix 10 and Agilex common code to _soc64* file and convert drivers from struct to defines.

This patchset needs to apply after patch in [2] for manager drivers struct to defines conversion.

Patch status:
No change: Patch 1, 10, 14, 15
Have changes: Patch 2, 3, 4, 5, 6, 8, 9, 12, 13, 16, 17 New patch: Patch 7, 11

Quoted 8 lines
Quoted 5 lines

Detail change log is in patch commit message.

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

I wanted to pick these, but they don't apply to u-boot-socfpga/master (updated to u-boot/master). Can you update and repost ?

They are already rebase on top of u-boot/master. This patchset need to apply after
https://patchwork.ozlabs.org/cover/1149731/ series.

Regards

Ley Foon

#20 lore raw

v3 cover Add Intel Agilex SoC support

Quoted 21 lines · Ley Foon Tan
Quoted 20 lines · Marek Vasut
Quoted 17 lines · Ley Foon Tan

This is 3rd version of patchset to add Intel Agilex SoC[1] support. Two major changes in this series are move Stratix 10 and Agilex common code to _soc64* file and convert drivers from struct to defines.

This patchset needs to apply after patch in [2] for manager drivers struct to defines conversion.

Patch status:
No change: Patch 1, 10, 14, 15
Have changes: Patch 2, 3, 4, 5, 6, 8, 9, 12, 13, 16, 17 New patch: Patch 7, 11

Detail change log is in patch commit message.

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

Quoted 5 lines
Quoted 2 lines

I wanted to pick these, but they don't apply to u-boot-socfpga/master (updated to u-boot/master). Can you update and repost ?

They are already rebase on top of u-boot/master. This patchset need to apply after
https://patchwork.ozlabs.org/cover/1149731/ series.

OK, and that one has discussion ongoing, so I will drop this series for now.

#21 lore raw

v3 cover Add Intel Agilex SoC support

Quoted 23 lines · Marek Vasut
Quoted 21 lines · Ley Foon Tan
Quoted 20 lines · Marek Vasut
Quoted 17 lines · Ley Foon Tan

This is 3rd version of patchset to add Intel Agilex SoC[1] support. Two major changes in this series are move Stratix 10 and Agilex common code to _soc64* file and convert drivers from struct to defines.

This patchset needs to apply after patch in [2] for manager drivers struct to defines conversion.

Patch status:
No change: Patch 1, 10, 14, 15
Have changes: Patch 2, 3, 4, 5, 6, 8, 9, 12, 13, 16, 17 New patch: Patch 7, 11

Detail change log is in patch commit message.

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

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

I wanted to pick these, but they don't apply to u-boot-socfpga/master (updated to u-boot/master). Can you update and repost ?

They are already rebase on top of u-boot/master. This patchset need to apply after
https://patchwork.ozlabs.org/cover/1149731/ series.

OK, and that one has discussion ongoing, so I will drop this series for now.

Sure, I need rework this patchset if anything change in
https://patchwork.ozlabs.org/cover/1149731/ series.

Regards
Ley Foon