xref: /rk3399_ARM-atf/plat/intel/soc/agilex5/include/socfpga_plat_def.h (revision 533fda3fad914d7be31a93a37d2ab99160e11302)
1 /*
2  * Copyright (c) 2019, ARM Limited and Contributors. All rights reserved.
3  * Copyright (c) 2019-2023, Intel Corporation. All rights reserved.
4  * Copyright (c) 2024, Altera Corporation. All rights reserved.
5  *
6  * SPDX-License-Identifier: BSD-3-Clause
7  */
8 
9 #ifndef PLAT_SOCFPGA_DEF_H
10 #define PLAT_SOCFPGA_DEF_H
11 
12 #include "agilex5_memory_controller.h"
13 #include "agilex5_system_manager.h"
14 
15 #include <platform_def.h>
16 
17 /* Platform Setting */
18 #define PLATFORM_MODEL						PLAT_SOCFPGA_AGILEX5
19 #define BOOT_SOURCE						BOOT_SOURCE_SDMMC
20 #define MMC_DEVICE_TYPE						1  /* MMC = 0, SD = 1 */
21 #define XLAT_TABLES_V2						U(1)
22 #define PLAT_PRIMARY_CPU_A55					0x000
23 #define PLAT_PRIMARY_CPU_A76					0x200
24 #define PLAT_CLUSTER_ID_MPIDR_AFF_SHIFT				MPIDR_AFF2_SHIFT
25 #define PLAT_CPU_ID_MPIDR_AFF_SHIFT				MPIDR_AFF1_SHIFT
26 #define PLAT_L2_RESET_REQ					0xB007C0DE
27 #define PLAT_TIMER_BASE_ADDR					0x10D01000
28 
29 /* System Counter */
30 /* TODO: Update back to 400MHz.
31  * This shall be updated to read from L4 clock instead of hardcoded.
32  */
33 #define PLAT_SYS_COUNTER_FREQ_IN_TICKS				U(400000000)
34 #define PLAT_SYS_COUNTER_FREQ_IN_MHZ				U(400)
35 
36 /* FPGA config helpers */
37 #define INTEL_SIP_SMC_FPGA_CONFIG_ADDR				0x80400000
38 #define INTEL_SIP_SMC_FPGA_CONFIG_SIZE				0x82000000
39 
40 /* QSPI Setting */
41 #define CAD_QSPIDATA_OFST					0x10900000
42 #define CAD_QSPI_OFFSET						0x108d2000
43 
44 /* Register Mapping */
45 #define SOCFPGA_CCU_NOC_REG_BASE				0x1c000000
46 #define SOCFPGA_F2SDRAMMGR_REG_BASE				0x18001000
47 
48 #define SOCFPGA_MMC_REG_BASE					0x10808000
49 #define SOCFPGA_MEMCTRL_REG_BASE				0x108CC000
50 #define SOCFPGA_RSTMGR_REG_BASE					0x10d11000
51 #define SOCFPGA_SYSMGR_REG_BASE					0x10d12000
52 #define SOCFPGA_PINMUX_REG_BASE					0x10d13000
53 #define SOCFPGA_NAND_REG_BASE					0x10B80000
54 #define SOCFPGA_ECC_QSPI_REG_BASE				0x10A22000
55 
56 #define SOCFPGA_L4_PER_SCR_REG_BASE				0x10d21000
57 #define SOCFPGA_L4_SYS_SCR_REG_BASE				0x10d21100
58 #define SOCFPGA_SOC2FPGA_SCR_REG_BASE				0x10d21200
59 #define SOCFPGA_LWSOC2FPGA_SCR_REG_BASE				0x10d21300
60 
61 /* Define maximum page size for NAND flash devices */
62 #define PLATFORM_MTD_MAX_PAGE_SIZE				U(0x2000)
63 
64 /*******************************************************************************
65  * Platform memory map related constants
66  ******************************************************************************/
67 #define DRAM_BASE						(0x80000000)
68 #define DRAM_SIZE						(0x80000000)
69 
70 #define OCRAM_BASE						(0x00000000)
71 #define OCRAM_SIZE						(0x00080000)
72 
73 #define MEM64_BASE						(0x0080000000)
74 #define MEM64_SIZE						(0x0080000000)
75 
76 //128MB PSS
77 #define PSS_BASE						(0x10000000)
78 #define PSS_SIZE						(0x08000000)
79 
80 //64MB MPFE
81 #define MPFE_BASE						(0x18000000)
82 #define MPFE_SIZE						(0x04000000)
83 
84 //16MB CCU
85 #define CCU_BASE						(0x1C000000)
86 #define CCU_SIZE						(0x01000000)
87 
88 //1MB GIC
89 #define GIC_BASE						(0x1D000000)
90 #define GIC_SIZE						(0x00100000)
91 
92 #define BL2_BASE						(0x00000000)
93 #define BL2_LIMIT						(0x0007E000)
94 
95 #define BL31_BASE						(0x80000000)
96 #define BL31_LIMIT						(0x82000000)
97 /*******************************************************************************
98  * UART related constants
99  ******************************************************************************/
100 #define PLAT_UART0_BASE						(0x10C02000)
101 #define PLAT_UART1_BASE						(0x10C02100)
102 
103 /*******************************************************************************
104  * WDT related constants
105  ******************************************************************************/
106 #define WDT_BASE						(0x10D00200)
107 
108 /*******************************************************************************
109  * GIC related constants
110  ******************************************************************************/
111 #define PLAT_GIC_BASE						(0x1D000000)
112 #define PLAT_GICC_BASE						(PLAT_GIC_BASE + 0x20000)
113 #define PLAT_GICD_BASE						(PLAT_GIC_BASE + 0x00000)
114 #define PLAT_GICR_BASE						(PLAT_GIC_BASE + 0x60000)
115 
116 #define PLAT_INTEL_SOCFPGA_GICR_BASE				PLAT_GICR_BASE
117 
118 /*******************************************************************************
119  * SDMMC related pointer function
120  ******************************************************************************/
121 #define SDMMC_READ_BLOCKS					sdmmc_read_blocks
122 #define SDMMC_WRITE_BLOCKS					sdmmc_write_blocks
123 
124 /*******************************************************************************
125  * sysmgr.boot_scratch_cold6 & 7 (64bit) are used to indicate L2 reset
126  * is done and HPS should trigger warm reset via RMR_EL3.
127  ******************************************************************************/
128 #define L2_RESET_DONE_REG					0x10D12218
129 
130 #endif /* PLAT_SOCFPGA_DEF_H */
131