Skip to contentSkip to conversation

Add Intel Agilex SoC support

PATCH New Ley Foon Tan 5 participants 41 messages May 10, 2019 – May 14, 2019

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

cover Add Intel Agilex SoC support

This patchset add Intel Agilex SoC[1] support.

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

[1]: https://www.intel.com/content/www/us/en/products/programmable/fpga/agilex.html

Ley Foon Tan (14):
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: agilex: Add clock manager support
arm: socfpga: agilex: Add CCU support 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              | 459 ++++++++++++++
 arch/arm/dts/socfpga_agilex_socdk-u-boot.dtsi |  59 ++
 arch/arm/dts/socfpga_agilex_socdk.dts         | 131 ++++
 arch/arm/mach-socfpga/Kconfig                 |  13 +
 arch/arm/mach-socfpga/Makefile                |  18 +
 arch/arm/mach-socfpga/ccu_agilex.c            |  99 +++
 arch/arm/mach-socfpga/clock_manager_agilex.c  | 582 ++++++++++++++++++
 arch/arm/mach-socfpga/firewall.c              |  97 +++
 .../include/mach/base_addr_agilex.h           |  38 ++
 .../mach-socfpga/include/mach/ccu_agilex.h    |  67 ++
 .../mach-socfpga/include/mach/clock_manager.h |   2 +
 .../include/mach/clock_manager_agilex.h       | 328 ++++++++++
 .../mach/{firewall_s10.h => firewall.h}       |  10 +-
 .../mach-socfpga/include/mach/reset_manager.h |  29 +
 .../include/mach/reset_manager_agilex.h       |  38 ++
 .../include/mach/reset_manager_s10.h          |  80 ---
 .../include/mach/system_manager.h             |  53 ++
 ..._manager_s10.h => system_manager_agilex.h} |  89 +--
 .../include/mach/system_manager_s10.h         |  46 --
 arch/arm/mach-socfpga/reset_manager.c         |   9 +-
 arch/arm/mach-socfpga/spl_agilex.c            | 105 ++++
 arch/arm/mach-socfpga/spl_s10.c               |  84 +--
 board/intel/agilex-socdk/MAINTAINERS          |   7 +
 board/intel/agilex-socdk/Makefile             |   7 +
 board/intel/agilex-socdk/socfpga.c            |   7 +
 configs/socfpga_agilex_defconfig              |  57 ++
 drivers/ddr/altera/Kconfig                    |   6 +-
 drivers/ddr/altera/Makefile                   |   3 +-
 drivers/ddr/altera/sdram_agilex.c             | 158 +++++
 drivers/ddr/altera/sdram_common.c             | 308 +++++++++
 .../altera/{sdram_s10.h => sdram_common.h}    |  75 +--
 drivers/ddr/altera/sdram_s10.c                | 302 +--------
 drivers/ddr/altera/sdram_s10.h                | 148 -----
 include/configs/socfpga_agilex_socdk.h        | 220 +++++++
 36 files changed, 2966 insertions(+), 773 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
 create mode 100644 arch/arm/mach-socfpga/firewall.c
 create mode 100644 arch/arm/mach-socfpga/include/mach/base_addr_agilex.h
 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
 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
 copy arch/arm/mach-socfpga/include/mach/{system_manager_s10.h => system_manager_agilex.h} (51%)
 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/ddr/altera/sdram_agilex.c
 create mode 100644 drivers/ddr/altera/sdram_common.c
 copy drivers/ddr/altera/{sdram_s10.h => sdram_common.h} (78%)
 create mode 100644 include/configs/socfpga_agilex_socdk.h
Signature · 1 line
2.19.0
#1 lore raw

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

Add base address for Intel Agilex SoC.

---
 .../include/mach/base_addr_agilex.h           | 38 +++++++++++++++++++
 1 file changed, 38 insertions(+)
 create mode 100644 arch/arm/mach-socfpga/include/mach/base_addr_agilex.h
arch/arm/mach-socfpga/include/mach/base_addr_agilex.h new file +38 -0
new file mode 100644
index 0000000000..e90b61f29d
@@ -0,0 +1,38 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright (C) 2016-2017 Intel Corporation <www.intel.com>
+ */
+
+#ifndef _SOCFPGA_AGILEX_BASE_HARDWARE_H_
+#define _SOCFPGA_AGILEX_BASE_HARDWARE_H_
+
+#define SOCFPGA_CCU_ADDRESS			0xf7000000
+#define SOCFPGA_FW_MPU_DDR_SCR_ADDRESS		0xf8020200
+#define SOCFPGA_SMMU_ADDRESS			0xfa000000
+#define SOCFPGA_MAILBOX_ADDRESS			0xffa30000
+#define SOCFPGA_SPTIMER0_ADDRESS		0xffc03000
+#define SOCFPGA_SPTIMER1_ADDRESS		0xffc03100
+#define SOCFPGA_SYSTIMER0_ADDRESS		0xffd00000
+#define SOCFPGA_SYSTIMER1_ADDRESS		0xffd00100
+#define SOCFPGA_L4WD0_ADDRESS			0xffd00200
+#define SOCFPGA_L4WD1_ADDRESS			0xffd00300
+#define SOCFPGA_L4WD2_ADDRESS			0xffd00400
+#define SOCFPGA_L4WD3_ADDRESS			0xffd00500
+#define SOCFPGA_GTIMER_SEC_ADDRESS		0xffd01000
+#define SOCFPGA_GTIMER_NSEC_ADDRESS		0xffd02000
+#define SOCFPGA_CLKMGR_ADDRESS			0xffd10000
+#define SOCFPGA_RSTMGR_ADDRESS			0xffd11000
+#define SOCFPGA_SYSMGR_ADDRESS			0xffd12000
+#define SOCFPGA_PINMUX_DEDICATED_IO_ADDRESS	0xffd13000
+#define SOCFPGA_FIREWALL_L4_PER			0xffd21000
+#define SOCFPGA_FIREWALL_L4_SYS			0xffd21100
+#define SOCFPGA_FIREWALL_SOC2FPGA		0xffd21200
+#define SOCFPGA_FIREWALL_LWSOC2FPGA		0xffd21300
+#define SOCFPGA_FIREWALL_TCU			0xffd21400
+#define SOCFPGA_DMANONSECURE_ADDRESS		0xffda0000
+#define SOCFPGA_DMASECURE_ADDRESS		0xffda1000
+#define SOCFPGA_OCRAM_ADDRESS			0xffe00000
+#define GICD_BASE				0xfffc1000
+#define GICC_BASE				0xfffc2000
+
+#endif /* _SOCFPGA_AGILEX_BASE_HARDWARE_H_ */
Signature · 1 line
2.19.0
maintainer
#2 lore raw

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

Quoted 43 lines · Ley Foon Tan

Add base address for Intel Agilex SoC.

---
 .../include/mach/base_addr_agilex.h           | 38 +++++++++++++++++++
 1 file changed, 38 insertions(+)
 create mode 100644 arch/arm/mach-socfpga/include/mach/base_addr_agilex.h
arch/arm/mach-socfpga/include/mach/base_addr_agilex.h new file +28 -0
new file mode 100644
index 0000000000..e90b61f29d
@@ -0,0 +1,38 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright (C) 2016-2017 Intel Corporation <www.intel.com>
+ */
+
+#ifndef _SOCFPGA_AGILEX_BASE_HARDWARE_H_
+#define _SOCFPGA_AGILEX_BASE_HARDWARE_H_
+
+#define SOCFPGA_CCU_ADDRESS			0xf7000000
+#define SOCFPGA_FW_MPU_DDR_SCR_ADDRESS		0xf8020200
+#define SOCFPGA_SMMU_ADDRESS			0xfa000000
+#define SOCFPGA_MAILBOX_ADDRESS			0xffa30000
+#define SOCFPGA_SPTIMER0_ADDRESS		0xffc03000
+#define SOCFPGA_SPTIMER1_ADDRESS		0xffc03100
+#define SOCFPGA_SYSTIMER0_ADDRESS		0xffd00000
+#define SOCFPGA_SYSTIMER1_ADDRESS		0xffd00100
+#define SOCFPGA_L4WD0_ADDRESS			0xffd00200
+#define SOCFPGA_L4WD1_ADDRESS			0xffd00300
+#define SOCFPGA_L4WD2_ADDRESS			0xffd00400
+#define SOCFPGA_L4WD3_ADDRESS			0xffd00500
+#define SOCFPGA_GTIMER_SEC_ADDRESS		0xffd01000
+#define SOCFPGA_GTIMER_NSEC_ADDRESS		0xffd02000
+#define SOCFPGA_CLKMGR_ADDRESS			0xffd10000
+#define SOCFPGA_RSTMGR_ADDRESS			0xffd11000
+#define SOCFPGA_SYSMGR_ADDRESS			0xffd12000
+#define SOCFPGA_PINMUX_DEDICATED_IO_ADDRESS	0xffd13000
+#define SOCFPGA_FIREWALL_L4_PER			0xffd21000
+#define SOCFPGA_FIREWALL_L4_SYS			0xffd21100

arch/arm/mach-socfpga/include/mach/base_addr_agilex.h line 38

Quoted 10 lines
arch/arm/mach-socfpga/include/mach/base_addr_agilex.h new file +10 -0
+#define SOCFPGA_FIREWALL_SOC2FPGA		0xffd21200
+#define SOCFPGA_FIREWALL_LWSOC2FPGA		0xffd21300
+#define SOCFPGA_FIREWALL_TCU			0xffd21400
+#define SOCFPGA_DMANONSECURE_ADDRESS		0xffda0000
+#define SOCFPGA_DMASECURE_ADDRESS		0xffda1000
+#define SOCFPGA_OCRAM_ADDRESS			0xffe00000
+#define GICD_BASE				0xfffc1000
+#define GICC_BASE				0xfffc2000
+
+#endif /* _SOCFPGA_AGILEX_BASE_HARDWARE_H_ */

All of these addresses are identical to the Stratix10, couldn't you just use the Stratix10 and any diffs, you can just use fdt?

Dinh

#3 lore raw

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

Am 10.05.2019 um 16:59 schrieb Dinh Nguyen:

Quoted 51 lines · Ley Foon Tan
Quoted 48 lines

Add base address for Intel Agilex SoC.

---
  .../include/mach/base_addr_agilex.h           | 38 +++++++++++++++++++
  1 file changed, 38 insertions(+)

create mode 100644 arch/arm/mach-socfpga/include/mach/base_addr_agilex.h

arch/arm/mach-socfpga/include/mach/base_addr_agilex.h new file +34 -0
new file mode 100644
index 0000000000..e90b61f29d
@@ -0,0 +1,38 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright (C) 2016-2017 Intel Corporation <www.intel.com>
+ */
+
+#ifndef _SOCFPGA_AGILEX_BASE_HARDWARE_H_
+#define _SOCFPGA_AGILEX_BASE_HARDWARE_H_
+
+#define SOCFPGA_CCU_ADDRESS			0xf7000000
+#define SOCFPGA_FW_MPU_DDR_SCR_ADDRESS		0xf8020200
+#define SOCFPGA_SMMU_ADDRESS			0xfa000000
+#define SOCFPGA_MAILBOX_ADDRESS			0xffa30000
+#define SOCFPGA_SPTIMER0_ADDRESS		0xffc03000
+#define SOCFPGA_SPTIMER1_ADDRESS		0xffc03100
+#define SOCFPGA_SYSTIMER0_ADDRESS		0xffd00000
+#define SOCFPGA_SYSTIMER1_ADDRESS		0xffd00100
+#define SOCFPGA_L4WD0_ADDRESS			0xffd00200
+#define SOCFPGA_L4WD1_ADDRESS			0xffd00300
+#define SOCFPGA_L4WD2_ADDRESS			0xffd00400
+#define SOCFPGA_L4WD3_ADDRESS			0xffd00500
+#define SOCFPGA_GTIMER_SEC_ADDRESS		0xffd01000
+#define SOCFPGA_GTIMER_NSEC_ADDRESS		0xffd02000
+#define SOCFPGA_CLKMGR_ADDRESS			0xffd10000
+#define SOCFPGA_RSTMGR_ADDRESS			0xffd11000
+#define SOCFPGA_SYSMGR_ADDRESS			0xffd12000
+#define SOCFPGA_PINMUX_DEDICATED_IO_ADDRESS	0xffd13000
+#define SOCFPGA_FIREWALL_L4_PER			0xffd21000
+#define SOCFPGA_FIREWALL_L4_SYS			0xffd21100
+#define SOCFPGA_FIREWALL_SOC2FPGA		0xffd21200
+#define SOCFPGA_FIREWALL_LWSOC2FPGA		0xffd21300
+#define SOCFPGA_FIREWALL_TCU			0xffd21400
+#define SOCFPGA_DMANONSECURE_ADDRESS		0xffda0000
+#define SOCFPGA_DMASECURE_ADDRESS		0xffda1000
+#define SOCFPGA_OCRAM_ADDRESS			0xffe00000
Quoted 8 lines

arch/arm/mach-socfpga/include/mach/base_addr_agilex.h line 38

Quoted 5 lines
arch/arm/mach-socfpga/include/mach/base_addr_agilex.h new file +4 -0
+#define GICD_BASE				0xfffc1000
+#define GICC_BASE				0xfffc2000
+
+#endif /* _SOCFPGA_AGILEX_BASE_HARDWARE_H_ */

All of these addresses are identical to the Stratix10, couldn't you just use the Stratix10 and any diffs, you can just use fdt?

Would it make sense to only add the addresses that are actually needed as constants? I'd expect that most (if not all) of them could come from devicetree?

Regards,
Simon

#4 lore raw

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

Quoted 62 lines · Simon Goldschmidt

Am 10.05.2019 um 16:59 schrieb Dinh Nguyen:

Quoted 51 lines · Ley Foon Tan
Quoted 48 lines

Add base address for Intel Agilex SoC.

---
  .../include/mach/base_addr_agilex.h           | 38 +++++++++++++++++++
  1 file changed, 38 insertions(+)

create mode 100644 arch/arm/mach-socfpga/include/mach/base_addr_agilex.h

arch/arm/mach-socfpga/include/mach/base_addr_agilex.h new file +34 -0
new file mode 100644
index 0000000000..e90b61f29d
@@ -0,0 +1,38 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright (C) 2016-2017 Intel Corporation <www.intel.com>
+ */
+
+#ifndef _SOCFPGA_AGILEX_BASE_HARDWARE_H_
+#define _SOCFPGA_AGILEX_BASE_HARDWARE_H_
+
+#define SOCFPGA_CCU_ADDRESS                 0xf7000000
+#define SOCFPGA_FW_MPU_DDR_SCR_ADDRESS              0xf8020200
+#define SOCFPGA_SMMU_ADDRESS                        0xfa000000
+#define SOCFPGA_MAILBOX_ADDRESS                     0xffa30000
+#define SOCFPGA_SPTIMER0_ADDRESS            0xffc03000
+#define SOCFPGA_SPTIMER1_ADDRESS            0xffc03100
+#define SOCFPGA_SYSTIMER0_ADDRESS           0xffd00000
+#define SOCFPGA_SYSTIMER1_ADDRESS           0xffd00100
+#define SOCFPGA_L4WD0_ADDRESS                       0xffd00200
+#define SOCFPGA_L4WD1_ADDRESS                       0xffd00300
+#define SOCFPGA_L4WD2_ADDRESS                       0xffd00400
+#define SOCFPGA_L4WD3_ADDRESS                       0xffd00500
+#define SOCFPGA_GTIMER_SEC_ADDRESS          0xffd01000
+#define SOCFPGA_GTIMER_NSEC_ADDRESS         0xffd02000
+#define SOCFPGA_CLKMGR_ADDRESS                      0xffd10000
+#define SOCFPGA_RSTMGR_ADDRESS                      0xffd11000
+#define SOCFPGA_SYSMGR_ADDRESS                      0xffd12000
+#define SOCFPGA_PINMUX_DEDICATED_IO_ADDRESS 0xffd13000
+#define SOCFPGA_FIREWALL_L4_PER                     0xffd21000
+#define SOCFPGA_FIREWALL_L4_SYS                     0xffd21100
+#define SOCFPGA_FIREWALL_SOC2FPGA           0xffd21200
+#define SOCFPGA_FIREWALL_LWSOC2FPGA         0xffd21300
+#define SOCFPGA_FIREWALL_TCU                        0xffd21400
+#define SOCFPGA_DMANONSECURE_ADDRESS                0xffda0000
+#define SOCFPGA_DMASECURE_ADDRESS           0xffda1000
+#define SOCFPGA_OCRAM_ADDRESS                       0xffe00000
Quoted 8 lines

arch/arm/mach-socfpga/include/mach/base_addr_agilex.h line 38

Quoted 5 lines
arch/arm/mach-socfpga/include/mach/base_addr_agilex.h new file +4 -0
+#define GICD_BASE                           0xfffc1000
+#define GICC_BASE                           0xfffc2000
+
+#endif /* _SOCFPGA_AGILEX_BASE_HARDWARE_H_ */

All of these addresses are identical to the Stratix10, couldn't you just use the Stratix10 and any diffs, you can just use fdt?

Quoted 6 lines

Would it make sense to only add the addresses that are actually needed as constants? I'd expect that most (if not all) of them could come from devicetree?

Regards,
Simon

Yes, these are only the requires #define. Those components that can get from DT already remove, eg: SDRAM base etc.

Regards
Ley Foon

#5 lore raw

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

Quoted 65 lines · Ley Foon Tan
Quoted 62 lines · Simon Goldschmidt

Am 10.05.2019 um 16:59 schrieb Dinh Nguyen:

Quoted 59 lines · Ley Foon Tan
Quoted 43 lines

Add base address for Intel Agilex SoC.

---
  .../include/mach/base_addr_agilex.h           | 38 +++++++++++++++++++
  1 file changed, 38 insertions(+)

create mode 100644 arch/arm/mach-socfpga/include/mach/base_addr_agilex.h

arch/arm/mach-socfpga/include/mach/base_addr_agilex.h new file +28 -0
new file mode 100644
index 0000000000..e90b61f29d
@@ -0,0 +1,38 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright (C) 2016-2017 Intel Corporation <www.intel.com>
+ */
+
+#ifndef _SOCFPGA_AGILEX_BASE_HARDWARE_H_
+#define _SOCFPGA_AGILEX_BASE_HARDWARE_H_
+
+#define SOCFPGA_CCU_ADDRESS                 0xf7000000
+#define SOCFPGA_FW_MPU_DDR_SCR_ADDRESS              0xf8020200
+#define SOCFPGA_SMMU_ADDRESS                        0xfa000000
+#define SOCFPGA_MAILBOX_ADDRESS                     0xffa30000
+#define SOCFPGA_SPTIMER0_ADDRESS            0xffc03000
+#define SOCFPGA_SPTIMER1_ADDRESS            0xffc03100
+#define SOCFPGA_SYSTIMER0_ADDRESS           0xffd00000
+#define SOCFPGA_SYSTIMER1_ADDRESS           0xffd00100
+#define SOCFPGA_L4WD0_ADDRESS                       0xffd00200
+#define SOCFPGA_L4WD1_ADDRESS                       0xffd00300
+#define SOCFPGA_L4WD2_ADDRESS                       0xffd00400
+#define SOCFPGA_L4WD3_ADDRESS                       0xffd00500
+#define SOCFPGA_GTIMER_SEC_ADDRESS          0xffd01000
+#define SOCFPGA_GTIMER_NSEC_ADDRESS         0xffd02000
+#define SOCFPGA_CLKMGR_ADDRESS                      0xffd10000
+#define SOCFPGA_RSTMGR_ADDRESS                      0xffd11000
+#define SOCFPGA_SYSMGR_ADDRESS                      0xffd12000
+#define SOCFPGA_PINMUX_DEDICATED_IO_ADDRESS 0xffd13000
+#define SOCFPGA_FIREWALL_L4_PER                     0xffd21000
+#define SOCFPGA_FIREWALL_L4_SYS                     0xffd21100

arch/arm/mach-socfpga/include/mach/base_addr_agilex.h line 38

Quoted 10 lines
arch/arm/mach-socfpga/include/mach/base_addr_agilex.h new file +10 -0
+#define SOCFPGA_FIREWALL_SOC2FPGA           0xffd21200
+#define SOCFPGA_FIREWALL_LWSOC2FPGA         0xffd21300
+#define SOCFPGA_FIREWALL_TCU                        0xffd21400
+#define SOCFPGA_DMANONSECURE_ADDRESS                0xffda0000
+#define SOCFPGA_DMASECURE_ADDRESS           0xffda1000
+#define SOCFPGA_OCRAM_ADDRESS                       0xffe00000
+#define GICD_BASE                           0xfffc1000
+#define GICC_BASE                           0xfffc2000
+
+#endif /* _SOCFPGA_AGILEX_BASE_HARDWARE_H_ */

All of these addresses are identical to the Stratix10, couldn't you just use the Stratix10 and any diffs, you can just use fdt?

Quoted 8 lines
Quoted 6 lines

Would it make sense to only add the addresses that are actually needed as constants? I'd expect that most (if not all) of them could come from devicetree?

Regards,
Simon

Yes, these are only the requires #define. Those components that can get from DT already remove, eg: SDRAM base etc.

Are these defines really all used in the code? I haven't seen that. But if it's so,
then it's probably ok... Although I would rather like to see more dm drivers...

Regards,
Simon

#6 lore raw

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

In reply to Dinh Nguyen
Quoted 61 lines · Dinh Nguyen
Quoted 43 lines · Ley Foon Tan

Add base address for Intel Agilex SoC.

---
 .../include/mach/base_addr_agilex.h           | 38 +++++++++++++++++++
 1 file changed, 38 insertions(+)
 create mode 100644 arch/arm/mach-socfpga/include/mach/base_addr_agilex.h
arch/arm/mach-socfpga/include/mach/base_addr_agilex.h new file +28 -0
new file mode 100644
index 0000000000..e90b61f29d
@@ -0,0 +1,38 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright (C) 2016-2017 Intel Corporation <www.intel.com>
+ */
+
+#ifndef _SOCFPGA_AGILEX_BASE_HARDWARE_H_
+#define _SOCFPGA_AGILEX_BASE_HARDWARE_H_
+
+#define SOCFPGA_CCU_ADDRESS                  0xf7000000
+#define SOCFPGA_FW_MPU_DDR_SCR_ADDRESS               0xf8020200
+#define SOCFPGA_SMMU_ADDRESS                 0xfa000000
+#define SOCFPGA_MAILBOX_ADDRESS                      0xffa30000
+#define SOCFPGA_SPTIMER0_ADDRESS             0xffc03000
+#define SOCFPGA_SPTIMER1_ADDRESS             0xffc03100
+#define SOCFPGA_SYSTIMER0_ADDRESS            0xffd00000
+#define SOCFPGA_SYSTIMER1_ADDRESS            0xffd00100
+#define SOCFPGA_L4WD0_ADDRESS                        0xffd00200
+#define SOCFPGA_L4WD1_ADDRESS                        0xffd00300
+#define SOCFPGA_L4WD2_ADDRESS                        0xffd00400
+#define SOCFPGA_L4WD3_ADDRESS                        0xffd00500
+#define SOCFPGA_GTIMER_SEC_ADDRESS           0xffd01000
+#define SOCFPGA_GTIMER_NSEC_ADDRESS          0xffd02000
+#define SOCFPGA_CLKMGR_ADDRESS                       0xffd10000
+#define SOCFPGA_RSTMGR_ADDRESS                       0xffd11000
+#define SOCFPGA_SYSMGR_ADDRESS                       0xffd12000
+#define SOCFPGA_PINMUX_DEDICATED_IO_ADDRESS  0xffd13000
+#define SOCFPGA_FIREWALL_L4_PER                      0xffd21000
+#define SOCFPGA_FIREWALL_L4_SYS                      0xffd21100

arch/arm/mach-socfpga/include/mach/base_addr_agilex.h line 38

Quoted 10 lines
arch/arm/mach-socfpga/include/mach/base_addr_agilex.h new file +10 -0
+#define SOCFPGA_FIREWALL_SOC2FPGA            0xffd21200
+#define SOCFPGA_FIREWALL_LWSOC2FPGA          0xffd21300
+#define SOCFPGA_FIREWALL_TCU                 0xffd21400
+#define SOCFPGA_DMANONSECURE_ADDRESS         0xffda0000
+#define SOCFPGA_DMASECURE_ADDRESS            0xffda1000
+#define SOCFPGA_OCRAM_ADDRESS                        0xffe00000
+#define GICD_BASE                            0xfffc1000
+#define GICC_BASE                            0xfffc2000
+
+#endif /* _SOCFPGA_AGILEX_BASE_HARDWARE_H_ */

All of these addresses are identical to the Stratix10, couldn't you just use the Stratix10 and any diffs, you can just use fdt?

Quoted 1 line

Dinh

There is one different compare to S10.
Can reuse base_address_s10.h file, but filename remain _s10.h.

Regards
Ley Foon

#7 lore raw

PATCH 2/14 arm: socfpga: Move firewall code to firewall file

In reply to Ley Foon Tan

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

No functional change.

---
 arch/arm/mach-socfpga/Makefile                |  1 +
 arch/arm/mach-socfpga/firewall.c              | 97 +++++++++++++++++++
 .../mach/{firewall_s10.h => firewall.h}       | 10 +-
 arch/arm/mach-socfpga/spl_s10.c               | 84 +---------------
 drivers/ddr/altera/sdram_s10.c                |  2 +-
 5 files changed, 107 insertions(+), 87 deletions(-)
 create mode 100644 arch/arm/mach-socfpga/firewall.c
 rename arch/arm/mach-socfpga/include/mach/{firewall_s10.h => firewall.h} (94%)
arch/arm/mach-socfpga/Makefile +1 -0
index e66720447f..11370cf4c4 100644
@@ -52,6 +52,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 new file +97 -0

97 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 -82

102 lines not on this page · raw message

drivers/ddr/altera/sdram_s10.c +1 -1
index 56cbbac9fe..a211635c2b 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
#8 lore raw

PATCH 3/14 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.h.

Remove unused RSTMGR_XXX defines.

---
 .../mach-socfpga/include/mach/reset_manager.h | 26 ++++++
 .../include/mach/reset_manager_s10.h          | 80 -------------------
 2 files changed, 26 insertions(+), 80 deletions(-)
arch/arm/mach-socfpga/include/mach/reset_manager.h +26 -0
index 42beaecdd6..e2dce4b4fb 100644
@@ -36,6 +36,32 @@ void socfpga_per_reset_all(void);
 /* Create a human-readable reference to SoCFPGA reset. */
 #define SOCFPGA_RESET(_name)	RSTMGR_##_name
 
+#if defined(CONFIG_TARGET_SOCFPGA_STRATIX10)
+
+void reset_deassert_peripherals_handoff(void);
+int cpu_has_been_warmreset(void);
+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
+
+/* 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
+
 #if defined(CONFIG_TARGET_SOCFPGA_GEN5)
 #include <asm/arch/reset_manager_gen5.h>
 #elif defined(CONFIG_TARGET_SOCFPGA_ARRIA10)
arch/arm/mach-socfpga/include/mach/reset_manager_s10.h +0 -80

90 lines not on this page · raw message

Signature · 1 line
2.19.0
#9 lore raw

PATCH 4/14 arm: socfpga: agilex: Add reset manager support

In reply to Ley Foon Tan

Add reset manager support for Agilex.

---
 .../mach-socfpga/include/mach/reset_manager.h |  5 ++-
 .../include/mach/reset_manager_agilex.h       | 38 +++++++++++++++++++
 arch/arm/mach-socfpga/reset_manager.c         |  9 +++--
 3 files changed, 48 insertions(+), 4 deletions(-)
 create mode 100644 arch/arm/mach-socfpga/include/mach/reset_manager_agilex.h
arch/arm/mach-socfpga/include/mach/reset_manager.h +4 -1
index e2dce4b4fb..f752f7abb8 100644
@@ -36,7 +36,8 @@ void socfpga_per_reset_all(void);
 /* Create a human-readable reference to SoCFPGA reset. */
 #define SOCFPGA_RESET(_name)	RSTMGR_##_name
 
-#if defined(CONFIG_TARGET_SOCFPGA_STRATIX10)
+#if defined(CONFIG_TARGET_SOCFPGA_STRATIX10) || \
+	defined(CONFIG_TARGET_SOCFPGA_AGILEX)
 
 void reset_deassert_peripherals_handoff(void);
 int cpu_has_been_warmreset(void);
@@ -68,6 +69,8 @@ void socfpga_bridges_reset(int enable);
 #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 +38 -0
new file mode 100644
index 0000000000..c209fb439b
@@ -0,0 +1,38 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright (C) 2019 Intel Corporation <www.intel.com>
+ */
+
+#ifndef	_RESET_MANAGER_AGILEX_
+#define	_RESET_MANAGER_AGILEX_
+
+struct socfpga_reset_manager {
+	u32	status;
+	u32	mpu_rst_stat;
+	u32	misc_stat;
+	u32	padding1;
+	u32	hdsk_en;
+	u32	hdsk_req;
+	u32	hdsk_ack;
+	u32	hdsk_stall;
+	u32	mpumodrst;
+	u32	per0modrst;
+	u32	per1modrst;
+	u32	brgmodrst;
+	u32	padding2;
+	u32	cold_mod_reset;
+	u32	padding3;
+	u32	dbg_mod_reset;
+	u32	padding4;
+	u32	padding5;
+	u32	padding6;
+	u32	brg_warm_mask;
+	u32	padding7[3];
+	u32	tst_stat;
+	u32	padding8;
+	u32	hdsk_timeout;
+	u32	mpul2flushtimeout;
+	u32	dbghdsktimeout;
+};
+
+#endif /* _RESET_MANAGER_AGILEX_ */
arch/arm/mach-socfpga/reset_manager.c +6 -3
index e0a01ed07a..5dfe303940 100644
@@ -8,13 +8,15 @@
 #include <asm/io.h>
 #include <asm/arch/reset_manager.h>
 
-#if defined(CONFIG_TARGET_SOCFPGA_STRATIX10)
+#if defined(CONFIG_TARGET_SOCFPGA_STRATIX10) || \
+	defined(CONFIG_TARGET_SOCFPGA_AGILEX)
 #include <asm/arch/mailbox_s10.h>
 #endif
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#if !defined(CONFIG_TARGET_SOCFPGA_STRATIX10)
+#if !defined(CONFIG_TARGET_SOCFPGA_STRATIX10) && \
+	!defined(CONFIG_TARGET_SOCFPGA_AGILEX)
 static const struct socfpga_reset_manager *reset_manager_base =
 		(void *)SOCFPGA_RSTMGR_ADDRESS;
 #endif
@@ -25,7 +27,8 @@ static const struct socfpga_reset_manager *reset_manager_base =
 void reset_cpu(ulong addr)
 {
 	/* request a warm reset */
-#if defined(CONFIG_TARGET_SOCFPGA_STRATIX10)
+#if defined(CONFIG_TARGET_SOCFPGA_STRATIX10) || \
+	defined(CONFIG_TARGET_SOCFPGA_AGILEX)
 	puts("Mailbox: Issuing mailbox cmd REBOOT_HPS\n");
 	mbox_reset_cold();
 #else
Signature · 1 line
2.19.0
maintainer
#10 lore raw

PATCH 4/14 arm: socfpga: agilex: Add reset manager support

Quoted 6 lines · Ley Foon Tan

Add reset manager support for Agilex.

---
 .../mach-socfpga/include/mach/reset_manager.h |  5 ++-
 .../include/mach/reset_manager_agilex.h       | 38 +++++++++++++++++++

AFAIK, there's really nothing different in Agilex reset manager from the Stratix10, can you just re-use the Stratix10?

Dinh

#11 lore raw

PATCH 4/14 arm: socfpga: agilex: Add reset manager support

Quoted 11 lines · Dinh Nguyen
Quoted 6 lines · Ley Foon Tan

Add reset manager support for Agilex.

---
 .../mach-socfpga/include/mach/reset_manager.h |  5 ++-
 .../include/mach/reset_manager_agilex.h       | 38 +++++++++++++++++++
Quoted 4 lines

AFAIK, there's really nothing different in Agilex reset manager from the Stratix10, can you just re-use the Stratix10?

Dinh

There are some changes on the register mapping.

Regards
Ley Foon

#12 lore raw

PATCH 4/14 arm: socfpga: agilex: Add reset manager support

In reply to Ley Foon Tan

Am 10.05.2019 um 07:54 schrieb Ley Foon Tan:

Quoted 7 lines

Add reset manager support for Agilex.

---
  .../mach-socfpga/include/mach/reset_manager.h |  5 ++-
  .../include/mach/reset_manager_agilex.h       | 38 +++++++++++++++++++
  arch/arm/mach-socfpga/reset_manager.c         |  9 +++--

Have you seen my series that removes reset_manager.c and moves the code to drivers/sysreset instead? It's not accepted, yet, but I think agilex should use drivers/sysreset, too.

Regards,
Simon

Quoted 103 lines
  3 files changed, 48 insertions(+), 4 deletions(-)

create mode 100644 arch/arm/mach-socfpga/include/mach/reset_manager_agilex.h

arch/arm/mach-socfpga/include/mach/reset_manager.h +4 -1
index e2dce4b4fb..f752f7abb8 100644
@@ -36,7 +36,8 @@ void socfpga_per_reset_all(void);
  /* Create a human-readable reference to SoCFPGA reset. */
  #define SOCFPGA_RESET(_name)	RSTMGR_##_name
 
-#if defined(CONFIG_TARGET_SOCFPGA_STRATIX10)
+#if defined(CONFIG_TARGET_SOCFPGA_STRATIX10) || \
+	defined(CONFIG_TARGET_SOCFPGA_AGILEX)
 
  void reset_deassert_peripherals_handoff(void);
  int cpu_has_been_warmreset(void);
@@ -68,6 +69,8 @@ void socfpga_bridges_reset(int enable);
  #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 +38 -0
new file mode 100644
index 0000000000..c209fb439b
@@ -0,0 +1,38 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright (C) 2019 Intel Corporation <www.intel.com>
+ */
+
+#ifndef	_RESET_MANAGER_AGILEX_
+#define	_RESET_MANAGER_AGILEX_
+
+struct socfpga_reset_manager {
+	u32	status;
+	u32	mpu_rst_stat;
+	u32	misc_stat;
+	u32	padding1;
+	u32	hdsk_en;
+	u32	hdsk_req;
+	u32	hdsk_ack;
+	u32	hdsk_stall;
+	u32	mpumodrst;
+	u32	per0modrst;
+	u32	per1modrst;
+	u32	brgmodrst;
+	u32	padding2;
+	u32	cold_mod_reset;
+	u32	padding3;
+	u32	dbg_mod_reset;
+	u32	padding4;
+	u32	padding5;
+	u32	padding6;
+	u32	brg_warm_mask;
+	u32	padding7[3];
+	u32	tst_stat;
+	u32	padding8;
+	u32	hdsk_timeout;
+	u32	mpul2flushtimeout;
+	u32	dbghdsktimeout;
+};
+
+#endif /* _RESET_MANAGER_AGILEX_ */
arch/arm/mach-socfpga/reset_manager.c +6 -3
index e0a01ed07a..5dfe303940 100644
@@ -8,13 +8,15 @@
  #include <asm/io.h>
  #include <asm/arch/reset_manager.h>
 
-#if defined(CONFIG_TARGET_SOCFPGA_STRATIX10)
+#if defined(CONFIG_TARGET_SOCFPGA_STRATIX10) || \
+	defined(CONFIG_TARGET_SOCFPGA_AGILEX)
  #include <asm/arch/mailbox_s10.h>
  #endif
 
  DECLARE_GLOBAL_DATA_PTR;
 
-#if !defined(CONFIG_TARGET_SOCFPGA_STRATIX10)
+#if !defined(CONFIG_TARGET_SOCFPGA_STRATIX10) && \
+	!defined(CONFIG_TARGET_SOCFPGA_AGILEX)
  static const struct socfpga_reset_manager *reset_manager_base =
  		(void *)SOCFPGA_RSTMGR_ADDRESS;
  #endif
@@ -25,7 +27,8 @@ static const struct socfpga_reset_manager *reset_manager_base =
  void reset_cpu(ulong addr)
  {
  	/* request a warm reset */
-#if defined(CONFIG_TARGET_SOCFPGA_STRATIX10)
+#if defined(CONFIG_TARGET_SOCFPGA_STRATIX10) || \
+	defined(CONFIG_TARGET_SOCFPGA_AGILEX)
  	puts("Mailbox: Issuing mailbox cmd REBOOT_HPS\n");
  	mbox_reset_cold();
  #else
#13 lore raw

PATCH 4/14 arm: socfpga: agilex: Add reset manager support

Quoted 10 lines · Simon Goldschmidt

Am 10.05.2019 um 07:54 schrieb Ley Foon Tan:

Quoted 7 lines

Add reset manager support for Agilex.

---
  .../mach-socfpga/include/mach/reset_manager.h |  5 ++-
  .../include/mach/reset_manager_agilex.h       | 38 +++++++++++++++++++
  arch/arm/mach-socfpga/reset_manager.c         |  9 +++--
Quoted 6 lines

Have you seen my series that removes reset_manager.c and moves the code to drivers/sysreset instead? It's not accepted, yet, but I think agilex should use drivers/sysreset, too.

Regards,
Simon

drivers/sysreset is only for system reset, right?
Most of our drivers use reset framework to reset, but we still using functions from reset_manager to reset watchdog and UART (when CONFIG_DEBUG_UART enabeld).

Regards
Ley Foon

#14 lore raw

PATCH 4/14 arm: socfpga: agilex: Add reset manager support

Quoted 17 lines · Ley Foon Tan
Quoted 14 lines · Simon Goldschmidt

Am 10.05.2019 um 07:54 schrieb Ley Foon Tan:

Quoted 7 lines

Add reset manager support for Agilex.

---
  .../mach-socfpga/include/mach/reset_manager.h |  5 ++-
  .../include/mach/reset_manager_agilex.h       | 38 +++++++++++++++++++
  arch/arm/mach-socfpga/reset_manager.c         |  9 +++--

Have you seen my series that removes reset_manager.c and moves the code to drivers/sysreset instead? It's not accepted, yet, but I think agilex should use drivers/sysreset, too.

Quoted 6 lines
Quoted 2 lines

Regards,
Simon

drivers/sysreset is only for system reset, right?
Most of our drivers use reset framework to reset, but we still using functions from reset_manager to reset watchdog and UART (when CONFIG_DEBUG_UART enabeld).

Right, but arch/arm/mach-socfpga/reset_manager.c only contains reset_cpu(), so drivers/sysreset is a direct replacement for this.

You're probably talking about reset_manager_s10.c. I know you still need that (although I'm trying to find a way to move that code to dm driver, too - at least for gen5 as a start).

Regards,
Simon

#15 lore raw

PATCH 4/14 arm: socfpga: agilex: Add reset manager support

Quoted 26 lines · Simon Goldschmidt
Quoted 17 lines · Ley Foon Tan
Quoted 14 lines · Simon Goldschmidt

Am 10.05.2019 um 07:54 schrieb Ley Foon Tan:

Quoted 7 lines

Add reset manager support for Agilex.

---
  .../mach-socfpga/include/mach/reset_manager.h |  5 ++-
  .../include/mach/reset_manager_agilex.h       | 38 +++++++++++++++++++
  arch/arm/mach-socfpga/reset_manager.c         |  9 +++--

Have you seen my series that removes reset_manager.c and moves the code to drivers/sysreset instead? It's not accepted, yet, but I think agilex should use drivers/sysreset, too.

Quoted 6 lines
Quoted 2 lines

Regards,
Simon

drivers/sysreset is only for system reset, right?
Most of our drivers use reset framework to reset, but we still using functions from reset_manager to reset watchdog and UART (when CONFIG_DEBUG_UART enabeld).

Quoted 7 lines

Right, but arch/arm/mach-socfpga/reset_manager.c only contains reset_cpu(), so drivers/sysreset is a direct replacement for this.

You're probably talking about reset_manager_s10.c. I know you still need that (although I'm trying to find a way to move that code to dm driver, too - at least for gen5 as a start).

Yes, I am talking about reset_manager_s10.c.

Regards
Ley Foon

#16 lore raw

PATCH 5/14 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.h.

---
 .../include/mach/system_manager.h             | 47 +++++++++++++++++++
 .../include/mach/system_manager_s10.h         | 46 ------------------
 2 files changed, 47 insertions(+), 46 deletions(-)
arch/arm/mach-socfpga/include/mach/system_manager.h +47 -0
index 7e76df74b7..171b79e238 100644
@@ -8,6 +8,53 @@
 
 #if defined(CONFIG_TARGET_SOCFPGA_STRATIX10)
 #include <asm/arch/system_manager_s10.h>
+
+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_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
+
 #else
 #define SYSMGR_ROMCODEGRP_CTRL_WARMRSTCFGPINMUX	BIT(0)
 #define SYSMGR_ROMCODEGRP_CTRL_WARMRSTCFGIO	BIT(1)
arch/arm/mach-socfpga/include/mach/system_manager_s10.h +0 -46

56 lines not on this page · raw message

Signature · 1 line
2.19.0
#17 lore raw

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

Quoted 3 lines · Ley Foon Tan

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

This becomes quite a bit of ifdeffery . Why don't you have the system_manager.h include system_manager_$soc.h like e.g. here?

http://git.denx.de/?p=u-boot.git;a=blob;f=arch/arm/mach-rmobile/include/mach/rmobile.h

Signature · 2 lines
Best regards,
Marek Vasut
#18 lore raw

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

Quoted 6 lines · Marek Vasut
Quoted 3 lines · Ley Foon Tan

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

Quoted 8 lines

This becomes quite a bit of ifdeffery . Why don't you have the system_manager.h include system_manager_$soc.h like e.g. here?

http://git.denx.de/?p=u-boot.git;a=blob;f=arch/arm/mach-rmobile/include/mach/rmobile.h

--
Best regards,
Marek Vasut

We already have similar thing for Gen5. A10 and S10 includes. But, S10 and Agilex share some common defines/functions.
I can move S10 and Agilex common code to a separate file and include in their header file.

Regards
Ley Foon

#19 lore raw

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

Quoted 12 lines · Ley Foon Tan
Quoted 11 lines · Marek Vasut
Quoted 3 lines · Ley Foon Tan

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

This becomes quite a bit of ifdeffery . Why don't you have the system_manager.h include system_manager_$soc.h like e.g. here?

http://git.denx.de/?p=u-boot.git;a=blob;f=arch/arm/mach-rmobile/include/mach/rmobile.h

Quoted 7 lines
Quoted 3 lines

--
Best regards,
Marek Vasut

We already have similar thing for Gen5. A10 and S10 includes. But, S10 and Agilex share some common defines/functions.
I can move S10 and Agilex common code to a separate file and include in their header file.

I think that'd improve the code .

Signature · 2 lines
Best regards,
Marek Vasut
#20 lore raw

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

Quoted 17 lines · Marek Vasut
Quoted 15 lines · Ley Foon Tan
Quoted 14 lines · Marek Vasut
Quoted 3 lines · Ley Foon Tan

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

This becomes quite a bit of ifdeffery . Why don't you have the system_manager.h include system_manager_$soc.h like e.g. here?

http://git.denx.de/?p=u-boot.git;a=blob;f=arch/arm/mach-rmobile/include/mach/rmobile.h

--
Best regards,
Marek Vasut

Quoted 7 lines
Quoted 4 lines

We already have similar thing for Gen5. A10 and S10 includes. But, S10 and Agilex share some common defines/functions.
I can move S10 and Agilex common code to a separate file and include in their header file.

I think that'd improve the code .

I am plan to use filename system_manager_s10_agilex_common.h, or you have better filename suggestion? :)

Regards
Ley Foon

#21 lore raw

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

Quoted 23 lines · Ley Foon Tan
Quoted 22 lines · Marek Vasut
Quoted 19 lines · Ley Foon Tan
Quoted 6 lines · Marek Vasut
Quoted 3 lines · Ley Foon Tan

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

Quoted 8 lines

This becomes quite a bit of ifdeffery . Why don't you have the system_manager.h include system_manager_$soc.h like e.g. here?

http://git.denx.de/?p=u-boot.git;a=blob;f=arch/arm/mach-rmobile/include/mach/rmobile.h

--
Best regards,
Marek Vasut

We already have similar thing for Gen5. A10 and S10 includes. But, S10 and Agilex share some common defines/functions.
I can move S10 and Agilex common code to a separate file and include in their header file.

Quoted 4 lines
Quoted 2 lines

I think that'd improve the code .

I am plan to use filename system_manager_s10_agilex_common.h, or you have better filename suggestion? :)

Whatever looks consistent is fine.

Signature · 2 lines
Best regards,
Marek Vasut
#22 lore raw

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

Quoted 25 lines · Marek Vasut
Quoted 23 lines · Ley Foon Tan
Quoted 22 lines · Marek Vasut
Quoted 19 lines · Ley Foon Tan
Quoted 6 lines · Marek Vasut
Quoted 3 lines · Ley Foon Tan

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

Quoted 8 lines

This becomes quite a bit of ifdeffery . Why don't you have the system_manager.h include system_manager_$soc.h like e.g. here?

http://git.denx.de/?p=u-boot.git;a=blob;f=arch/arm/mach-rmobile/include/mach/rmobile.h

--
Best regards,
Marek Vasut

We already have similar thing for Gen5. A10 and S10 includes. But, S10 and Agilex share some common defines/functions.
I can move S10 and Agilex common code to a separate file and include in their header file.

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

I think that'd improve the code .

I am plan to use filename system_manager_s10_agilex_common.h, or you have better filename suggestion? :)

Whatever looks consistent is fine.

--

Noted.

Thanks.

Regards
Ley Foon

#23 lore raw

PATCH 6/14 arm: socfpga: agilex: Add system manager support

In reply to Ley Foon Tan

Add system manager support for Agilex.

---
 .../include/mach/system_manager.h             |   6 +
 .../include/mach/system_manager_agilex.h      | 127 ++++++++++++++++++
 2 files changed, 133 insertions(+)
 create mode 100644 arch/arm/mach-socfpga/include/mach/system_manager_agilex.h
arch/arm/mach-socfpga/include/mach/system_manager.h +6 -0
index 171b79e238..ee693fc7a6 100644
@@ -6,8 +6,14 @@
 #ifndef _SYSTEM_MANAGER_H_
 #define _SYSTEM_MANAGER_H_
 
+#if defined(CONFIG_TARGET_SOCFPGA_STRATIX10) || \
+	defined(CONFIG_TARGET_SOCFPGA_AGILEX)
+
 #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>
+#endif
 
 void sysmgr_pinmux_init(void);
 void populate_sysmgr_fpgaintf_module(void);
arch/arm/mach-socfpga/include/mach/system_manager_agilex.h new file +127 -0

127 lines not on this page · raw message

Signature · 1 line
2.19.0
#24 lore raw

PATCH 7/14 arm: socfpga: agilex: Add clock manager support

In reply to Ley Foon Tan

Add clock manager support for Agilex.

---
 arch/arm/mach-socfpga/Makefile                |   4 +
 arch/arm/mach-socfpga/clock_manager_agilex.c  | 582 ++++++++++++++++++
 .../mach-socfpga/include/mach/clock_manager.h |   2 +
 .../include/mach/clock_manager_agilex.h       | 328 ++++++++++
 4 files changed, 916 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 11370cf4c4..5bb36d07df 100644
@@ -40,6 +40,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 +582 -0

582 lines not on this page · raw message

arch/arm/mach-socfpga/include/mach/clock_manager.h +2 -0
index dd80e3a767..a3d5de59d2 100644
@@ -18,6 +18,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 +328 -0

328 lines not on this page · raw message

Signature · 1 line
2.19.0
#25 lore raw

PATCH 7/14 arm: socfpga: agilex: Add clock manager support

Quoted 4 lines · Ley Foon Tan

Add clock manager support for Agilex.

Quoted 8 lines
---
 arch/arm/mach-socfpga/Makefile                |   4 +
 arch/arm/mach-socfpga/clock_manager_agilex.c  | 582 ++++++++++++++++++
 .../mach-socfpga/include/mach/clock_manager.h |   2 +
 .../include/mach/clock_manager_agilex.h       | 328 ++++++++++
 4 files changed, 916 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

Can this be in drivers/clk instead ?

Signature · 2 lines
Best regards,
Marek Vasut
#26 lore raw

PATCH 7/14 arm: socfpga: agilex: Add clock manager support

Quoted 15 lines · Marek Vasut
Quoted 4 lines · Ley Foon Tan

Add clock manager support for Agilex.

Quoted 8 lines
---
 arch/arm/mach-socfpga/Makefile                |   4 +
 arch/arm/mach-socfpga/clock_manager_agilex.c  | 582 ++++++++++++++++++
 .../mach-socfpga/include/mach/clock_manager.h |   2 +
 .../include/mach/clock_manager_agilex.h       | 328 ++++++++++
 4 files changed, 916 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
Quoted 3 lines

Can this be in drivers/clk instead ?

--

Yes, it can.
There is plan to move S10 clock driver to DM as well.

Regards
Ley Foon

#27 lore raw

PATCH 7/14 arm: socfpga: agilex: Add clock manager support

Quoted 17 lines · Ley Foon Tan
Quoted 15 lines · Marek Vasut
Quoted 12 lines · Ley Foon Tan

Add clock manager support for Agilex.

---
 arch/arm/mach-socfpga/Makefile                |   4 +
 arch/arm/mach-socfpga/clock_manager_agilex.c  | 582 ++++++++++++++++++
 .../mach-socfpga/include/mach/clock_manager.h |   2 +
 .../include/mach/clock_manager_agilex.h       | 328 ++++++++++
 4 files changed, 916 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
Quoted 5 lines
Quoted 3 lines

Can this be in drivers/clk instead ?

--

Yes, it can.
There is plan to move S10 clock driver to DM as well.

That would indeed be a good plan! I'm working on a clock driver for gen5, currently...

Regards,
Simon

#28 lore raw

PATCH 8/14 arm: socfpga: agilex: Add CCU support for Agilex

In reply to Ley Foon Tan

Add CCU support for Agilex.

---
 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 5bb36d07df..51355ad070 100644
@@ -59,6 +59,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
#29 lore raw

PATCH 8/14 arm: socfpga: agilex: Add CCU support for Agilex

Am 10.05.2019 um 07:54 schrieb Ley Foon Tan:

Quoted 1 line

Add CCU support for Agilex.

This description could be a bit longer: what's CCU, and why do you add it or when/by what will it be used.

Regards,
Simon

Quoted 203 lines
---
  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 5bb36d07df..51355ad070 100644
@@ -59,6 +59,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
new file mode 100644
index 0000000000..f27a48b523
@@ -0,0 +1,99 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (C) 2019 Intel Corporation <www.intel.com>
+ *
+ */
+#include <asm/io.h>
+#include <wait_bit.h>
+#include <asm/arch/ccu_agilex.h>
+
+static void ccu_init_dirs(void)
+{
+	ulong i, f;
+	int ret;
+	u32 num_of_dirs;
+	u32 num_of_snoop_filters;
+	u32 reg;
+
+	num_of_dirs = CSUIDR_NUMDIRUS_GET(readl(CCU_REG_ADDR(CSUIDR)));
+	num_of_snoop_filters =
+		CSIDR_NUMSFS_GET(readl(CCU_REG_ADDR(CSIDR))) + 1;
+
+	/* Initialize each snoop filter in each directory */
+	for (f = 0; f < num_of_snoop_filters; f++) {
+		reg = f << DIRUSFMCR_SFID_SHIFT;
+		for (i = 0; i < num_of_dirs; i++) {
+			/* Initialize all entries */
+			writel(reg, CCU_DIR_REG_ADDR(i, DIRUSFMCR));
+
+			/* Poll snoop filter maintenance operation active
+			 * bit become 0.
+			 */
+			ret = wait_for_bit_le32((const void *)
+						CCU_DIR_REG_ADDR(i, DIRUSFMAR),
+						BIT(0), false, 1000, false);
+			if (ret) {
+				puts("CCU: Directory initialization failed!\n");
+				hang();
+			}
+
+			/* Enable snoop filter, a bit per snoop filter */
+			setbits_le32((ulong)CCU_DIR_REG_ADDR(i, DIRUSFER),
+				     BIT(f));
+		}
+	}
+}
+
+void ccu_init_coh_agent_intf(void)
+{
+	u32 num_of_coh_agent_intf;
+	u32 num_of_dirs;
+	u32 reg;
+	u32 type;
+	u32 i, dir;
+
+	num_of_coh_agent_intf =
+		CSUIDR_NUMCAIUS_GET(readl(CCU_REG_ADDR(CSUIDR)));
+	num_of_dirs = CSUIDR_NUMDIRUS_GET(readl(CCU_REG_ADDR(CSUIDR)));
+
+	for (i = 0; i < num_of_coh_agent_intf; i++) {
+		reg = readl((ulong)CCU_CAIU_REG_ADDR(i, CAIUIDR));
+		if (CAIUIDR_CA_GET(reg)) {
+			/* Caching agent bit is enabled, enable caching agent
+			 * snoop in each directory
+			 */
+			for (dir = 0; dir < num_of_dirs; dir++) {
+				setbits_le32((ulong)
+					     CCU_DIR_REG_ADDR(dir, DIRUCASER0),
+					     BIT(i));
+			}
+		}
+
+		type = CAIUIDR_TYPE_GET(reg);
+		if (type == CAIUIDR_TYPE_ACE_CAI_DVM_SUPPORT ||
+		    type == CAIUIDR_TYPE_ACELITE_CAI_DVM_SUPPORT) {
+			/* DVM support is enabled, enable ACE DVM snoop*/
+			setbits_le32((ulong)(CCU_REG_ADDR(CSADSER0)),
+				     BIT(i));
+		}
+	}
+}
+
+static void ocram_bypass_firewall(void)
+{
+	clrbits_le32((ulong)(COH_CPU0_BYPASS_REG_ADDR(OCRAM_BLK_CGF_01_REG)),
+		     OCRAM_PRIVILEGED_MASK | OCRAM_SECURE_MASK);
+	clrbits_le32((ulong)(COH_CPU0_BYPASS_REG_ADDR(OCRAM_BLK_CGF_02_REG)),
+		     OCRAM_PRIVILEGED_MASK | OCRAM_SECURE_MASK);
+	clrbits_le32((ulong)(COH_CPU0_BYPASS_REG_ADDR(OCRAM_BLK_CGF_03_REG)),
+		     OCRAM_PRIVILEGED_MASK | OCRAM_SECURE_MASK);
+	clrbits_le32((ulong)(COH_CPU0_BYPASS_REG_ADDR(OCRAM_BLK_CGF_04_REG)),
+		     OCRAM_PRIVILEGED_MASK | OCRAM_SECURE_MASK);
+}
+
+void ccu_init(void)
+{
+	ccu_init_dirs();
+	ccu_init_coh_agent_intf();
+	ocram_bypass_firewall();
+}
arch/arm/mach-socfpga/include/mach/ccu_agilex.h new file +67 -0
new file mode 100644
index 0000000000..4e5373e0ad
@@ -0,0 +1,67 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright (C) 2019 Intel Corporation <www.intel.com>
+ */
+
+#ifndef	_CCU_AGILEX_H_
+#define	_CCU_AGILEX_H_
+
+/* Directory */
+#define DIRUSFER		0x80010
+#define DIRUCASER0		0x80040
+#define DIRUMRHER		0x80070
+#define DIRUSFMCR		0x80080
+#define DIRUSFMAR		0x80084
+
+#define DIRUSFMCR_SFID_SHIFT	16
+
+/* Coherent cache agent interface */
+#define CAIUIDR			0x00ffc
+
+#define CAIUIDR_CA_GET(v)	(((v) & 0x00008000) >> 15)
+#define CAIUIDR_TYPE_GET(v)	(((v) & 0x000f0000) >> 16)
+#define CAIUIDR_TYPE_ACE_CAI_DVM_SUPPORT	0
+#define CAIUIDR_TYPE_ACELITE_CAI_DVM_SUPPORT	1
+
+/* Coherent subsystem */
+#define CSADSER0		0xff040
+#define CSUIDR			0xffff8
+#define CSIDR			0xffffc
+
+#define CSUIDR_NUMCAIUS_GET(v)	(((v) & 0x0000007f) >> 0)
+#define CSUIDR_NUMDIRUS_GET(v)	(((v) & 0x003f0000) >> 16)
+#define CSUIDR_NUMCMIUS_GET(v)	(((v) & 0x3f000000) >> 24)
+
+#define CSIDR_NUMSFS_GET(v)	(((v) & 0x007c0000) >> 18)
+
+#define DIR_REG_OFF		0x1000
+#define CAIU_REG_OFF		0x1000
+#define COHMEM_REG_OFF		0x1000
+
+#define CCU_REG_ADDR(reg)		\
+		(SOCFPGA_CCU_ADDRESS + (reg))
+
+#define CCU_DIR_REG_ADDR(dir, reg)	\
+		(CCU_REG_ADDR(reg) + ((dir) * DIR_REG_OFF))
+
+#define CCU_CAIU_REG_ADDR(caiu, reg)	\
+		(CCU_REG_ADDR(reg) + ((caiu) * CAIU_REG_OFF))
+
+/* Coherent CPU BYPASS OCRAM */
+#define COH_CPU0_BYPASS_OC_BASE		(SOCFPGA_CCU_ADDRESS + 0x100200)
+
+#define OCRAM_BLK_CGF_01_REG		0x4
+#define OCRAM_BLK_CGF_02_REG		0x8
+#define OCRAM_BLK_CGF_03_REG		0xc
+#define OCRAM_BLK_CGF_04_REG		0x10
+#define OCRAM_SECURE_REGIONS		4
+
+#define OCRAM_PRIVILEGED_MASK		BIT(29)
+#define OCRAM_SECURE_MASK		BIT(30)
+
+#define COH_CPU0_BYPASS_REG_ADDR(reg)		\
+		(COH_CPU0_BYPASS_OC_BASE + (reg))
+
+void ccu_init(void);
+
+#endif /* _CCU_AGILEX_H_ */
#30 lore raw

PATCH 8/14 arm: socfpga: agilex: Add CCU support for Agilex

Quoted 6 lines · Simon Goldschmidt

Am 10.05.2019 um 07:54 schrieb Ley Foon Tan:

Quoted 1 line

Add CCU support for Agilex.

This description could be a bit longer: what's CCU, and why do you add it or when/by what will it be used.

Will update description.
Thanks.

Regards
Ley Foon

Quoted 208 lines

Regards,
Simon

Quoted 203 lines
---
  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 5bb36d07df..51355ad070 100644
@@ -59,6 +59,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
new file mode 100644
index 0000000000..f27a48b523
@@ -0,0 +1,99 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (C) 2019 Intel Corporation <www.intel.com>
+ *
+ */
+#include <asm/io.h>
+#include <wait_bit.h>
+#include <asm/arch/ccu_agilex.h>
+
+static void ccu_init_dirs(void)
+{
+     ulong i, f;
+     int ret;
+     u32 num_of_dirs;
+     u32 num_of_snoop_filters;
+     u32 reg;
+
+     num_of_dirs = CSUIDR_NUMDIRUS_GET(readl(CCU_REG_ADDR(CSUIDR)));
+     num_of_snoop_filters =
+             CSIDR_NUMSFS_GET(readl(CCU_REG_ADDR(CSIDR))) + 1;
+
+     /* Initialize each snoop filter in each directory */
+     for (f = 0; f < num_of_snoop_filters; f++) {
+             reg = f << DIRUSFMCR_SFID_SHIFT;
+             for (i = 0; i < num_of_dirs; i++) {
+                     /* Initialize all entries */
+                     writel(reg, CCU_DIR_REG_ADDR(i, DIRUSFMCR));
+
+                     /* Poll snoop filter maintenance operation active
+                      * bit become 0.
+                      */
+                     ret = wait_for_bit_le32((const void *)
+                                             CCU_DIR_REG_ADDR(i, DIRUSFMAR),
+                                             BIT(0), false, 1000, false);
+                     if (ret) {
+                             puts("CCU: Directory initialization failed!\n");
+                             hang();
+                     }
+
+                     /* Enable snoop filter, a bit per snoop filter */
+                     setbits_le32((ulong)CCU_DIR_REG_ADDR(i, DIRUSFER),
+                                  BIT(f));
+             }
+     }
+}
+
+void ccu_init_coh_agent_intf(void)
+{
+     u32 num_of_coh_agent_intf;
+     u32 num_of_dirs;
+     u32 reg;
+     u32 type;
+     u32 i, dir;
+
+     num_of_coh_agent_intf =
+             CSUIDR_NUMCAIUS_GET(readl(CCU_REG_ADDR(CSUIDR)));
+     num_of_dirs = CSUIDR_NUMDIRUS_GET(readl(CCU_REG_ADDR(CSUIDR)));
+
+     for (i = 0; i < num_of_coh_agent_intf; i++) {
+             reg = readl((ulong)CCU_CAIU_REG_ADDR(i, CAIUIDR));
+             if (CAIUIDR_CA_GET(reg)) {
+                     /* Caching agent bit is enabled, enable caching agent
+                      * snoop in each directory
+                      */
+                     for (dir = 0; dir < num_of_dirs; dir++) {
+                             setbits_le32((ulong)
+                                          CCU_DIR_REG_ADDR(dir, DIRUCASER0),
+                                          BIT(i));
+                     }
+             }
+
+             type = CAIUIDR_TYPE_GET(reg);
+             if (type == CAIUIDR_TYPE_ACE_CAI_DVM_SUPPORT ||
+                 type == CAIUIDR_TYPE_ACELITE_CAI_DVM_SUPPORT) {
+                     /* DVM support is enabled, enable ACE DVM snoop*/
+                     setbits_le32((ulong)(CCU_REG_ADDR(CSADSER0)),
+                                  BIT(i));
+             }
+     }
+}
+
+static void ocram_bypass_firewall(void)
+{
+     clrbits_le32((ulong)(COH_CPU0_BYPASS_REG_ADDR(OCRAM_BLK_CGF_01_REG)),
+                  OCRAM_PRIVILEGED_MASK | OCRAM_SECURE_MASK);
+     clrbits_le32((ulong)(COH_CPU0_BYPASS_REG_ADDR(OCRAM_BLK_CGF_02_REG)),
+                  OCRAM_PRIVILEGED_MASK | OCRAM_SECURE_MASK);
+     clrbits_le32((ulong)(COH_CPU0_BYPASS_REG_ADDR(OCRAM_BLK_CGF_03_REG)),
+                  OCRAM_PRIVILEGED_MASK | OCRAM_SECURE_MASK);
+     clrbits_le32((ulong)(COH_CPU0_BYPASS_REG_ADDR(OCRAM_BLK_CGF_04_REG)),
+                  OCRAM_PRIVILEGED_MASK | OCRAM_SECURE_MASK);
+}
+
+void ccu_init(void)
+{
+     ccu_init_dirs();
+     ccu_init_coh_agent_intf();
+     ocram_bypass_firewall();
+}
arch/arm/mach-socfpga/include/mach/ccu_agilex.h new file +67 -0
new file mode 100644
index 0000000000..4e5373e0ad
@@ -0,0 +1,67 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Copyright (C) 2019 Intel Corporation <www.intel.com>
+ */
+
+#ifndef      _CCU_AGILEX_H_
+#define      _CCU_AGILEX_H_
+
+/* Directory */
+#define DIRUSFER             0x80010
+#define DIRUCASER0           0x80040
+#define DIRUMRHER            0x80070
+#define DIRUSFMCR            0x80080
+#define DIRUSFMAR            0x80084
+
+#define DIRUSFMCR_SFID_SHIFT 16
+
+/* Coherent cache agent interface */
+#define CAIUIDR                      0x00ffc
+
+#define CAIUIDR_CA_GET(v)    (((v) & 0x00008000) >> 15)
+#define CAIUIDR_TYPE_GET(v)  (((v) & 0x000f0000) >> 16)
+#define CAIUIDR_TYPE_ACE_CAI_DVM_SUPPORT     0
+#define CAIUIDR_TYPE_ACELITE_CAI_DVM_SUPPORT 1
+
+/* Coherent subsystem */
+#define CSADSER0             0xff040
+#define CSUIDR                       0xffff8
+#define CSIDR                        0xffffc
+
+#define CSUIDR_NUMCAIUS_GET(v)       (((v) & 0x0000007f) >> 0)
+#define CSUIDR_NUMDIRUS_GET(v)       (((v) & 0x003f0000) >> 16)
+#define CSUIDR_NUMCMIUS_GET(v)       (((v) & 0x3f000000) >> 24)
+
+#define CSIDR_NUMSFS_GET(v)  (((v) & 0x007c0000) >> 18)
+
+#define DIR_REG_OFF          0x1000
+#define CAIU_REG_OFF         0x1000
+#define COHMEM_REG_OFF               0x1000
+
+#define CCU_REG_ADDR(reg)            \
+             (SOCFPGA_CCU_ADDRESS + (reg))
+
+#define CCU_DIR_REG_ADDR(dir, reg)   \
+             (CCU_REG_ADDR(reg) + ((dir) * DIR_REG_OFF))
+
+#define CCU_CAIU_REG_ADDR(caiu, reg) \
+             (CCU_REG_ADDR(reg) + ((caiu) * CAIU_REG_OFF))
+
+/* Coherent CPU BYPASS OCRAM */
+#define COH_CPU0_BYPASS_OC_BASE              (SOCFPGA_CCU_ADDRESS + 0x100200)
+
+#define OCRAM_BLK_CGF_01_REG         0x4
+#define OCRAM_BLK_CGF_02_REG         0x8
+#define OCRAM_BLK_CGF_03_REG         0xc
+#define OCRAM_BLK_CGF_04_REG         0x10
+#define OCRAM_SECURE_REGIONS         4
+
+#define OCRAM_PRIVILEGED_MASK                BIT(29)
+#define OCRAM_SECURE_MASK            BIT(30)
+
+#define COH_CPU0_BYPASS_REG_ADDR(reg)                \
+             (COH_CPU0_BYPASS_OC_BASE + (reg))
+
+void ccu_init(void);
+
+#endif /* _CCU_AGILEX_H_ */
#31 lore raw

PATCH 9/14 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.

---
 drivers/ddr/altera/Makefile                   |   2 +-
 drivers/ddr/altera/sdram_common.c             | 307 ++++++++++++++++++
 .../altera/{sdram_s10.h => sdram_common.h}    |  74 +++--
 drivers/ddr/altera/sdram_s10.c                | 300 +----------------
 drivers/ddr/altera/sdram_s10.h                | 148 ---------
 5 files changed, 348 insertions(+), 483 deletions(-)
 create mode 100644 drivers/ddr/altera/sdram_common.c
 copy drivers/ddr/altera/{sdram_s10.h => sdram_common.h} (79%)
drivers/ddr/altera/Makefile +1 -1
index 341ac0d73b..09454461a9 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_common.o sdram_s10.o
 endif
drivers/ddr/altera/sdram_common.c new file +307 -0

307 lines not on this page · raw message

drivers/ddr/altera/sdram_common.h renamed from drivers/ddr/altera/sdram_s10.h +38 -36

89 lines not on this page · raw message

drivers/ddr/altera/sdram_s10.c +2 -298

336 lines not on this page · raw message

drivers/ddr/altera/sdram_s10.h +0 -148

158 lines not on this page · raw message

Signature · 1 line
2.19.0
#32 lore raw

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

In reply to Ley Foon Tan

Add SDRAM driver for Agilex SoC.

---
 drivers/ddr/altera/Kconfig        |   6 +-
 drivers/ddr/altera/Makefile       |   1 +
 drivers/ddr/altera/sdram_agilex.c | 158 ++++++++++++++++++++++++++++++
 drivers/ddr/altera/sdram_common.c |   1 +
 drivers/ddr/altera/sdram_common.h |   1 +
 5 files changed, 164 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 09454461a9..b3b48948bf 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_common.o sdram_s10.o
+obj-$(CONFIG_TARGET_SOCFPGA_AGILEX) += sdram_common.o sdram_agilex.o
 endif
drivers/ddr/altera/sdram_agilex.c new file +158 -0

158 lines not on this page · raw message

drivers/ddr/altera/sdram_common.c +1 -0
index 24ab5f932b..d3a45c0ae7 100644
@@ -292,6 +292,7 @@ static struct ram_ops altera_sdram_ops = {
 
 static const struct udevice_id altera_sdram_ids[] = {
 	{ .compatible = "altr,sdr-ctl-s10" },
+	{ .compatible = "altr,sdr-ctl-agilex" },
 	{ /* sentinel */ }
 };
 
drivers/ddr/altera/sdram_common.h +1 -0
index 814ab52be3..89cea3d003 100644
@@ -69,6 +69,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
#33 lore raw

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

Quoted 12 lines · Ley Foon Tan

Add SDRAM driver for Agilex SoC.

---
 drivers/ddr/altera/Kconfig        |   6 +-
 drivers/ddr/altera/Makefile       |   1 +
 drivers/ddr/altera/sdram_agilex.c | 158 ++++++++++++++++++++++++++++++
 drivers/ddr/altera/sdram_common.c |   1 +
 drivers/ddr/altera/sdram_common.h |   1 +
 5 files changed, 164 insertions(+), 3 deletions(-)
 create mode 100644 drivers/ddr/altera/sdram_agilex.c

[...]

drivers/ddr/altera/sdram_agilex.c line 109

Quoted 5 lines
drivers/ddr/altera/sdram_agilex.c new file +5 -0
+	/* This enables nonsecure access to DDR */
+	/* mpuregion0addr_limit */
+	FW_MPU_DDR_SCR_WRITEL(gd->ram_size - 1,
+			      FW_MPU_DDR_SCR_MPUREGION0ADDR_LIMIT);
+	FW_MPU_DDR_SCR_WRITEL(0x1F, FW_MPU_DDR_SCR_MPUREGION0ADDR_LIMITEXT);

Why is the function name in caps?

drivers/ddr/altera/sdram_agilex.c line 119

Quoted 10 lines
drivers/ddr/altera/sdram_agilex.c new file +10 -0
+
+	/* nonmpuregion0addr_limit */
+	FW_MPU_DDR_SCR_WRITEL(gd->ram_size - 1,
+			      FW_MPU_DDR_SCR_NONMPUREGION0ADDR_LIMIT);
+
+	/* Enable mpuregion0enable and nonmpuregion0enable */
+	FW_MPU_DDR_SCR_WRITEL(MPUREGION0_ENABLE | NONMPUREGION0_ENABLE,
+			      FW_MPU_DDR_SCR_EN_SET);
+
+	u32 ctrlcfg1 = hmc_readl(plat, CTRLCFG1);

Doesn't the C compiler warn about variable defined in the middle of code ?

[...]

Signature · 2 lines
Best regards,
Marek Vasut
#34 lore raw

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

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

Add SDRAM driver for Agilex SoC.

---
 drivers/ddr/altera/Kconfig        |   6 +-
 drivers/ddr/altera/Makefile       |   1 +
 drivers/ddr/altera/sdram_agilex.c | 158 ++++++++++++++++++++++++++++++
 drivers/ddr/altera/sdram_common.c |   1 +
 drivers/ddr/altera/sdram_common.h |   1 +
 5 files changed, 164 insertions(+), 3 deletions(-)
 create mode 100644 drivers/ddr/altera/sdram_agilex.c

[...]

Quoted 7 lines

drivers/ddr/altera/sdram_agilex.c line 109

Quoted 5 lines
drivers/ddr/altera/sdram_agilex.c new file +5 -0
+     /* This enables nonsecure access to DDR */
+     /* mpuregion0addr_limit */
+     FW_MPU_DDR_SCR_WRITEL(gd->ram_size - 1,
+                           FW_MPU_DDR_SCR_MPUREGION0ADDR_LIMIT);
+     FW_MPU_DDR_SCR_WRITEL(0x1F, FW_MPU_DDR_SCR_MPUREGION0ADDR_LIMITEXT);

Why is the function name in caps?

They are macros, not function.

Quoted 13 lines

drivers/ddr/altera/sdram_agilex.c line 119

Quoted 11 lines
drivers/ddr/altera/sdram_agilex.c new file +10 -0
+
+     /* nonmpuregion0addr_limit */
+     FW_MPU_DDR_SCR_WRITEL(gd->ram_size - 1,
+                           FW_MPU_DDR_SCR_NONMPUREGION0ADDR_LIMIT);
+
+     /* Enable mpuregion0enable and nonmpuregion0enable */
+     FW_MPU_DDR_SCR_WRITEL(MPUREGION0_ENABLE | NONMPUREGION0_ENABLE,
+                           FW_MPU_DDR_SCR_EN_SET);
+
+     u32 ctrlcfg1 = hmc_readl(plat, CTRLCFG1);

Doesn't the C compiler warn about variable defined in the middle of code ?

No compiler warning.

Regards
Ley Foon

#35 lore raw

PATCH 11/14 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
#36 lore raw

PATCH 12/14 arm: socfpga: agilex: Add SPL for Agilex SoC

In reply to Ley Foon Tan

Add SPL support for Agilex SoC.

---
 arch/arm/mach-socfpga/Makefile     |   1 +
 arch/arm/mach-socfpga/spl_agilex.c | 105 +++++++++++++++++++++++++++++
 2 files changed, 106 insertions(+)
 create mode 100644 arch/arm/mach-socfpga/spl_agilex.c
arch/arm/mach-socfpga/Makefile +1 -0
index 51355ad070..476dcaefff 100644
@@ -61,6 +61,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 +105 -0

105 lines not on this page · raw message

Signature · 1 line
2.19.0
#37 lore raw

PATCH 13/14 arm: dts: agilex: Add base dtsi and devkit dts

In reply to Ley Foon Tan

Add device tree files for Agilex SoC platform.

---
 arch/arm/dts/Makefile                         |   1 +
 arch/arm/dts/socfpga_agilex.dtsi              | 459 ++++++++++++++++++
 arch/arm/dts/socfpga_agilex_socdk-u-boot.dtsi |  59 +++
 arch/arm/dts/socfpga_agilex_socdk.dts         | 131 +++++
 4 files changed, 650 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 a199f3f988..6c57e5fc38 100644
@@ -274,6 +274,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_is1.dtb			\
arch/arm/dts/socfpga_agilex.dtsi new file +459 -0

459 lines not on this page · raw message

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

59 lines not on this page · raw message

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

131 lines not on this page · raw message

Signature · 1 line
2.19.0
#38 lore raw

PATCH 13/14 arm: dts: agilex: Add base dtsi and devkit dts

Quoted 3 lines · Ley Foon Tan

Add device tree files for Agilex SoC platform.

Are these from Linux ? If so, which version and commit ?

Signature · 2 lines
Best regards,
Marek Vasut
#39 lore raw

PATCH 13/14 arm: dts: agilex: Add base dtsi and devkit dts

Quoted 9 lines · Marek Vasut
Quoted 3 lines · Ley Foon Tan

Add device tree files for Agilex SoC platform.

Are these from Linux ? If so, which version and commit ?

--

Yes, but with minor changes.
It is from linux-next branch. Will add commit id.

Regards
Ley Foon

Regards
Ley Foon

#40 lore raw

PATCH 14/14 arm: socfpga: agilex: Enable Agilex SoC build

In reply to Ley Foon Tan

Add build support for Agilex SoC.

---
 arch/arm/Kconfig                       |   4 +-
 arch/arm/mach-socfpga/Kconfig          |  13 ++
 arch/arm/mach-socfpga/Makefile         |   9 +
 configs/socfpga_agilex_defconfig       |  57 +++++++
 include/configs/socfpga_agilex_socdk.h | 220 +++++++++++++++++++++++++
 5 files changed, 301 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 f91c590f6d..45086ccdfe 100644
@@ -815,7 +815,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
@@ -827,7 +827,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_WATCHDOG_SUPPORT
 	select SUPPORT_SPL
arch/arm/mach-socfpga/Kconfig +13 -0
index ea316d09d7..5c37583de5 100644
@@ -20,6 +20,12 @@ 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
+
 config TARGET_SOCFPGA_ARRIA5
 	bool
 	select TARGET_SOCFPGA_GEN5
@@ -64,6 +70,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_ARRIA10_SOCDK
 	bool "Altera SOCFPGA SoCDK (Arria 10)"
 	select TARGET_SOCFPGA_ARRIA10
@@ -120,6 +130,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
@@ -135,6 +146,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
@@ -151,6 +163,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 476dcaefff..774d3571ef 100644
@@ -42,6 +42,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
@@ -61,6 +69,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 +57 -0

57 lines not on this page · raw message

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

220 lines not on this page · raw message

Signature · 1 line
2.19.0