xref: /rk3399_ARM-atf/plat/intel/soc/stratix10/include/socfpga_plat_def.h (revision 306551362c15c3be7d118b549c7c99290716d5d6)
1 /*
2  * Copyright (c) 2019-2023, ARM Limited and Contributors. All rights reserved.
3  * Copyright (c) 2024, Altera Corporation. All rights reserved.
4  *
5  * SPDX-License-Identifier: BSD-3-Clause
6  */
7 
8 #ifndef PLAT_SOCFPGA_DEF_H
9 #define PLAT_SOCFPGA_DEF_H
10 
11 #include <platform_def.h>
12 #include <lib/utils_def.h>
13 #include "s10_system_manager.h"
14 
15 /* Platform Setting */
16 #define PLATFORM_MODEL				PLAT_SOCFPGA_STRATIX10
17 #define BOOT_SOURCE				BOOT_SOURCE_SDMMC
18 #define PLAT_PRIMARY_CPU			0
19 #define PLAT_CLUSTER_ID_MPIDR_AFF_SHIFT		MPIDR_AFF1_SHIFT
20 #define PLAT_CPU_ID_MPIDR_AFF_SHIFT		MPIDR_AFF0_SHIFT
21 #define PLAT_HANDOFF_OFFSET			0xFFE3F000
22 #define PLAT_TIMER_BASE_ADDR			0xFFD01000
23 
24 /* FPGA config helpers */
25 #define INTEL_SIP_SMC_FPGA_CONFIG_ADDR		0x400000
26 #define INTEL_SIP_SMC_FPGA_CONFIG_SIZE		0x1000000
27 
28 /* QSPI Setting */
29 #define CAD_QSPIDATA_OFST			0xff900000
30 #define CAD_QSPI_OFFSET				0xff8d2000
31 
32 /* SDMMC Setting */
33 # if ARM_LINUX_KERNEL_AS_BL33
34 #define SOCFPGA_MMC_BLOCK_SIZE			U(32768)
35 # else
36 #define SOCFPGA_MMC_BLOCK_SIZE			U(8192)
37 # endif
38 
39 /* Register Mapping */
40 #define SOCFPGA_CCU_NOC_REG_BASE		0xf7000000
41 #define SOCFPGA_F2SDRAMMGR_REG_BASE		U(0xf8024000)
42 
43 #define SOCFPGA_MMC_REG_BASE                    0xff808000
44 
45 #define SOCFPGA_RSTMGR_REG_BASE			0xffd11000
46 #define SOCFPGA_SYSMGR_REG_BASE			0xffd12000
47 #define SOCFPGA_ECC_QSPI_REG_BASE				0xffa22000
48 
49 #define SOCFPGA_L4_PER_SCR_REG_BASE		0xffd21000
50 #define SOCFPGA_L4_SYS_SCR_REG_BASE		0xffd21100
51 #define SOCFPGA_SOC2FPGA_SCR_REG_BASE		0xffd21200
52 #define SOCFPGA_LWSOC2FPGA_SCR_REG_BASE		0xffd21300
53 
54 /*******************************************************************************
55  * Platform memory map related constants
56  ******************************************************************************/
57 #define DRAM_BASE				(0x0)
58 #define DRAM_SIZE				(0x80000000)
59 
60 #define OCRAM_BASE				(0xFFE00000)
61 #define OCRAM_SIZE				(0x00040000)
62 
63 #define MEM64_BASE				(0x0100000000)
64 #define MEM64_SIZE				(0x1F00000000)
65 
66 #define DEVICE1_BASE				(0x80000000)
67 #define DEVICE1_SIZE				(0x60000000)
68 
69 #define DEVICE2_BASE				(0xF7000000)
70 #define DEVICE2_SIZE				(0x08E00000)
71 
72 #define DEVICE3_BASE				(0xFFFC0000)
73 #define DEVICE3_SIZE				(0x00008000)
74 
75 #define DEVICE4_BASE				(0x2000000000)
76 #define DEVICE4_SIZE				(0x0100000000)
77 
78 #define BL2_BASE				(0xffe00000)
79 #define BL2_LIMIT				(0xffe2b000)
80 
81 #define BL31_BASE				(0x1000)
82 #define BL31_LIMIT				(0x81000)
83 
84 /*******************************************************************************
85  * UART related constants
86  ******************************************************************************/
87 #define PLAT_UART0_BASE				(0xFFC02000)
88 #define PLAT_UART1_BASE				(0xFFC02100)
89 
90 /*******************************************************************************
91  * WDT related constants
92  ******************************************************************************/
93 #define WDT_BASE			(0xFFD00200)
94 
95 /*******************************************************************************
96  * GIC related constants
97  ******************************************************************************/
98 #define PLAT_GIC_BASE				(0xFFFC0000)
99 #define PLAT_GICC_BASE				(PLAT_GIC_BASE + 0x2000)
100 #define PLAT_GICD_BASE				(PLAT_GIC_BASE + 0x1000)
101 #define PLAT_GICR_BASE				0
102 
103 #define PLAT_SYS_COUNTER_FREQ_IN_TICKS		(400000000)
104 #define PLAT_HZ_CONVERT_TO_MHZ		(1000000)
105 
106 /*******************************************************************************
107  * SDMMC related pointer function
108  ******************************************************************************/
109 #define SDMMC_READ_BLOCKS			mmc_read_blocks
110 #define SDMMC_WRITE_BLOCKS			mmc_write_blocks
111 
112 /*******************************************************************************
113  * sysmgr.boot_scratch_cold6 & 7 (64bit) are used to indicate L2 reset
114  * is done and HPS should trigger warm reset via RMR_EL3.
115  ******************************************************************************/
116 #define L2_RESET_DONE_REG			0xFFD12218
117 
118 /* Platform specific system counter */
119 #define PLAT_SYS_COUNTER_FREQ_IN_MHZ		U(400)
120 
121 #endif /* PLATSOCFPGA_DEF_H */
122 
123