blob: faace43da710b80db2a3d344a55dc83f9cde996b [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Mingkai Hu0e58b512015-10-26 19:47:50 +08002/*
Meenakshi Aggarwalccb5d5d2020-10-29 19:16:16 +05303 * Copyright 2016-2018, 2020 NXP
Mingkai Hu0e58b512015-10-26 19:47:50 +08004 * Copyright 2015, Freescale Semiconductor
Mingkai Hu0e58b512015-10-26 19:47:50 +08005 */
6
7#ifndef _ASM_ARMV8_FSL_LAYERSCAPE_CONFIG_H_
8#define _ASM_ARMV8_FSL_LAYERSCAPE_CONFIG_H_
9
10#include <fsl_ddrc_version.h>
11
Simon Glass4dcacfc2020-05-10 11:40:13 -060012#ifndef __ASSEMBLY__
13#include <linux/bitops.h>
14#endif
15
York Sun0804d562015-12-04 11:57:08 -080016/*
17 * Reserve secure memory
18 * To be aligned with MMU block size
19 */
Tom Rini6a5dccc2022-11-16 13:10:41 -050020#define CFG_SYS_MEM_RESERVE_SECURE (66 * 1024 * 1024) /* 66MB */
York Sunf2aaf842017-05-15 08:52:00 -070021#define SPL_TLB_SETBACK 0x1000000 /* 16MB under effective memory top */
York Sun0804d562015-12-04 11:57:08 -080022
York Sun4ce6fbf2017-03-27 11:41:01 -070023#ifdef CONFIG_ARCH_LS2080A
Tom Rini376b88a2022-10-28 20:27:13 -040024#define CFG_SYS_FSL_CLUSTER_CLOCKS { 1, 1, 4, 4 }
Mingkai Hu0e58b512015-10-26 19:47:50 +080025#define SRDS_MAX_LANES 8
Tom Rini6a5dccc2022-11-16 13:10:41 -050026#define CFG_SYS_PAGE_SIZE 0x10000
Mingkai Hu0e58b512015-10-26 19:47:50 +080027#ifndef L1_CACHE_BYTES
28#define L1_CACHE_SHIFT 6
29#define L1_CACHE_BYTES BIT(L1_CACHE_SHIFT)
30#endif
31
Tom Rini376b88a2022-10-28 20:27:13 -040032#define CFG_SYS_FSL_OCRAM_BASE 0x18000000 /* initial RAM */
Hou Zhiqiang3a109ef2016-12-16 17:15:45 +080033#define SYS_FSL_OCRAM_SPACE_SIZE 0x00200000 /* 2M space */
Tom Rini376b88a2022-10-28 20:27:13 -040034#define CFG_SYS_FSL_OCRAM_SIZE 0x00020000 /* Real size 128K */
Mingkai Hu0e58b512015-10-26 19:47:50 +080035
36/* DDR */
Tom Rini6a5dccc2022-11-16 13:10:41 -050037#define CFG_SYS_DDR_BLOCK1_SIZE ((phys_size_t)2 << 30)
Tom Rinibc9d46b2022-12-04 10:04:50 -050038#define CFG_MAX_MEM_MAPPED CFG_SYS_DDR_BLOCK1_SIZE
Mingkai Hu0e58b512015-10-26 19:47:50 +080039
Mingkai Hu0e58b512015-10-26 19:47:50 +080040/* Generic Interrupt Controller Definitions */
41#define GICD_BASE 0x06000000
42#define GICR_BASE 0x06100000
43
44/* SMMU Defintions */
45#define SMMU_BASE 0x05000000 /* GR0 Base */
46
47/* Cache Coherent Interconnect */
48#define CCI_MN_BASE 0x04000000
49#define CCI_MN_RNF_NODEID_LIST 0x180
50#define CCI_MN_DVM_DOMAIN_CTL 0x200
51#define CCI_MN_DVM_DOMAIN_CTL_SET 0x210
52
York Sund957a672015-11-04 09:53:10 -080053#define CCI_HN_F_0_BASE (CCI_MN_BASE + 0x200000)
54#define CCI_HN_F_1_BASE (CCI_MN_BASE + 0x210000)
55#define CCN_HN_F_SAM_CTL 0x8 /* offset on base HN_F base */
56#define CCN_HN_F_SAM_NODEID_MASK 0x7f
57#define CCN_HN_F_SAM_NODEID_DDR0 0x4
58#define CCN_HN_F_SAM_NODEID_DDR1 0xe
59
Mingkai Hu0e58b512015-10-26 19:47:50 +080060#define CCI_RN_I_0_BASE (CCI_MN_BASE + 0x800000)
61#define CCI_RN_I_2_BASE (CCI_MN_BASE + 0x820000)
62#define CCI_RN_I_6_BASE (CCI_MN_BASE + 0x860000)
63#define CCI_RN_I_12_BASE (CCI_MN_BASE + 0x8C0000)
64#define CCI_RN_I_16_BASE (CCI_MN_BASE + 0x900000)
65#define CCI_RN_I_20_BASE (CCI_MN_BASE + 0x940000)
66
67#define CCI_S0_QOS_CONTROL_BASE(x) ((CCI_RN_I_0_BASE + (x * 0x10000)) + 0x10)
68#define CCI_S1_QOS_CONTROL_BASE(x) ((CCI_RN_I_0_BASE + (x * 0x10000)) + 0x110)
69#define CCI_S2_QOS_CONTROL_BASE(x) ((CCI_RN_I_0_BASE + (x * 0x10000)) + 0x210)
70
Prabhakar Kushwahaedbbd252016-01-25 12:08:45 +053071#define CCI_AUX_CONTROL_BASE(x) ((CCI_RN_I_0_BASE + (x * 0x10000)) + 0x0500)
72
Mingkai Hu0e58b512015-10-26 19:47:50 +080073/* TZ Protection Controller Definitions */
74#define TZPC_BASE 0x02200000
75#define TZPCR0SIZE_BASE (TZPC_BASE)
76#define TZPCDECPROT_0_STAT_BASE (TZPC_BASE + 0x800)
77#define TZPCDECPROT_0_SET_BASE (TZPC_BASE + 0x804)
78#define TZPCDECPROT_0_CLR_BASE (TZPC_BASE + 0x808)
79#define TZPCDECPROT_1_STAT_BASE (TZPC_BASE + 0x80C)
80#define TZPCDECPROT_1_SET_BASE (TZPC_BASE + 0x810)
81#define TZPCDECPROT_1_CLR_BASE (TZPC_BASE + 0x814)
82#define TZPCDECPROT_2_STAT_BASE (TZPC_BASE + 0x818)
83#define TZPCDECPROT_2_SET_BASE (TZPC_BASE + 0x81C)
84#define TZPCDECPROT_2_CLR_BASE (TZPC_BASE + 0x820)
85
Prabhakar Kushwaha22cfe962015-11-05 12:00:14 +053086#define DCSR_CGACRE5 0x700070914ULL
87#define EPU_EPCMPR5 0x700060914ULL
88#define EPU_EPCCR5 0x700060814ULL
89#define EPU_EPSMCR5 0x700060228ULL
90#define EPU_EPECR5 0x700060314ULL
91#define EPU_EPCTR5 0x700060a14ULL
92#define EPU_EPGCR 0x700060000ULL
93
Ashish Kumarb25faa22017-08-31 16:12:53 +053094#elif defined(CONFIG_ARCH_LS1088A)
Tom Rini376b88a2022-10-28 20:27:13 -040095#define CFG_SYS_FSL_CLUSTER_CLOCKS { 1, 1 }
Tom Rini6a5dccc2022-11-16 13:10:41 -050096#define CFG_SYS_PAGE_SIZE 0x10000
Ashish Kumarb25faa22017-08-31 16:12:53 +053097
98#define SRDS_MAX_LANES 4
Alex Marginean47568ce2020-01-11 01:05:40 +020099#define SRDS_BITS_PER_LANE 4
Ashish Kumarb25faa22017-08-31 16:12:53 +0530100
101/* TZ Protection Controller Definitions */
102#define TZPC_BASE 0x02200000
103#define TZPCR0SIZE_BASE (TZPC_BASE)
104#define TZPCDECPROT_0_STAT_BASE (TZPC_BASE + 0x800)
105#define TZPCDECPROT_0_SET_BASE (TZPC_BASE + 0x804)
106#define TZPCDECPROT_0_CLR_BASE (TZPC_BASE + 0x808)
107#define TZPCDECPROT_1_STAT_BASE (TZPC_BASE + 0x80C)
108#define TZPCDECPROT_1_SET_BASE (TZPC_BASE + 0x810)
109#define TZPCDECPROT_1_CLR_BASE (TZPC_BASE + 0x814)
110#define TZPCDECPROT_2_STAT_BASE (TZPC_BASE + 0x818)
111#define TZPCDECPROT_2_SET_BASE (TZPC_BASE + 0x81C)
112#define TZPCDECPROT_2_CLR_BASE (TZPC_BASE + 0x820)
113
114/* Generic Interrupt Controller Definitions */
115#define GICD_BASE 0x06000000
116#define GICR_BASE 0x06100000
117
118/* SMMU Defintions */
119#define SMMU_BASE 0x05000000 /* GR0 Base */
120
121/* DDR */
Tom Rini6a5dccc2022-11-16 13:10:41 -0500122#define CFG_SYS_DDR_BLOCK1_SIZE ((phys_size_t)2 << 30)
Tom Rinibc9d46b2022-12-04 10:04:50 -0500123#define CFG_MAX_MEM_MAPPED CFG_SYS_DDR_BLOCK1_SIZE
Ashish Kumarb25faa22017-08-31 16:12:53 +0530124
Ashish Kumarb25faa22017-08-31 16:12:53 +0530125/* DCFG - GUR */
Tom Rini376b88a2022-10-28 20:27:13 -0400126#define CFG_SYS_FSL_OCRAM_BASE 0x18000000 /* initial RAM */
Ashish Kumarb25faa22017-08-31 16:12:53 +0530127#define SYS_FSL_OCRAM_SPACE_SIZE 0x00200000 /* 2M space */
Tom Rini376b88a2022-10-28 20:27:13 -0400128#define CFG_SYS_FSL_OCRAM_SIZE 0x00020000 /* Real size 128K */
Ashish Kumarb25faa22017-08-31 16:12:53 +0530129
Meenakshi Aggarwalccb5d5d2020-10-29 19:16:16 +0530130/* LX2160A/LX2162A Soc Support */
131#elif defined(CONFIG_ARCH_LX2160A) || defined(CONFIG_ARCH_LX2162A)
Priyanka Jainef76b2e2018-10-29 09:17:09 +0000132#define TZPC_BASE 0x02200000
133#define TZPCDECPROT_0_SET_BASE (TZPC_BASE + 0x804)
Priyanka Jainef76b2e2018-10-29 09:17:09 +0000134#define SRDS_MAX_LANES 8
135#ifndef L1_CACHE_BYTES
136#define L1_CACHE_SHIFT 6
137#define L1_CACHE_BYTES BIT(L1_CACHE_SHIFT)
138#endif
Tom Rini376b88a2022-10-28 20:27:13 -0400139#define CFG_SYS_FSL_CLUSTER_CLOCKS { 1, 1, 1, 1, 4, 4, 4, 4 }
Priyanka Jainef76b2e2018-10-29 09:17:09 +0000140
Tom Rini6a5dccc2022-11-16 13:10:41 -0500141#define CFG_SYS_PAGE_SIZE 0x10000
Priyanka Jainef76b2e2018-10-29 09:17:09 +0000142
Tom Rini376b88a2022-10-28 20:27:13 -0400143#define CFG_SYS_FSL_OCRAM_BASE 0x18000000 /* initial RAM */
Priyanka Jainef76b2e2018-10-29 09:17:09 +0000144#define SYS_FSL_OCRAM_SPACE_SIZE 0x00200000 /* 2M space */
Tom Rini376b88a2022-10-28 20:27:13 -0400145#define CFG_SYS_FSL_OCRAM_SIZE 0x00040000 /* Real size 256K */
Priyanka Jainef76b2e2018-10-29 09:17:09 +0000146
147/* DDR */
Tom Rini6a5dccc2022-11-16 13:10:41 -0500148#define CFG_SYS_DDR_BLOCK1_SIZE ((phys_size_t)2 << 30)
Tom Rinibc9d46b2022-12-04 10:04:50 -0500149#define CFG_MAX_MEM_MAPPED CFG_SYS_DDR_BLOCK1_SIZE
Priyanka Jainef76b2e2018-10-29 09:17:09 +0000150
Priyanka Jainef76b2e2018-10-29 09:17:09 +0000151/* Generic Interrupt Controller Definitions */
152#define GICD_BASE 0x06000000
153#define GICR_BASE 0x06200000
154
155/* SMMU Definitions */
156#define SMMU_BASE 0x05000000 /* GR0 Base */
157
Priyanka Jainef76b2e2018-10-29 09:17:09 +0000158/* DCFG - GUR */
Priyanka Jainef76b2e2018-10-29 09:17:09 +0000159
Yuantian Tang4aefa162019-04-10 16:43:33 +0800160#elif defined(CONFIG_ARCH_LS1028A)
Tom Rini376b88a2022-10-28 20:27:13 -0400161#define CFG_SYS_FSL_CLUSTER_CLOCKS { 1, 1 }
Yuantian Tang4aefa162019-04-10 16:43:33 +0800162
163/* TZ Protection Controller Definitions */
164#define TZPC_BASE 0x02200000
165#define TZPCR0SIZE_BASE (TZPC_BASE)
166#define TZPCDECPROT_0_STAT_BASE (TZPC_BASE + 0x800)
167#define TZPCDECPROT_0_SET_BASE (TZPC_BASE + 0x804)
168#define TZPCDECPROT_0_CLR_BASE (TZPC_BASE + 0x808)
169#define TZPCDECPROT_1_STAT_BASE (TZPC_BASE + 0x80C)
170#define TZPCDECPROT_1_SET_BASE (TZPC_BASE + 0x810)
171#define TZPCDECPROT_1_CLR_BASE (TZPC_BASE + 0x814)
172#define TZPCDECPROT_2_STAT_BASE (TZPC_BASE + 0x818)
173#define TZPCDECPROT_2_SET_BASE (TZPC_BASE + 0x81C)
174#define TZPCDECPROT_2_CLR_BASE (TZPC_BASE + 0x820)
175
176#define SRDS_MAX_LANES 4
Alex Marginean47568ce2020-01-11 01:05:40 +0200177#define SRDS_BITS_PER_LANE 4
Yuantian Tang4aefa162019-04-10 16:43:33 +0800178
Tom Rini376b88a2022-10-28 20:27:13 -0400179#define CFG_SYS_FSL_OCRAM_BASE 0x18000000 /* initial RAM */
Yuantian Tang4aefa162019-04-10 16:43:33 +0800180#define SYS_FSL_OCRAM_SPACE_SIZE 0x00200000 /* 2M */
Tom Rini376b88a2022-10-28 20:27:13 -0400181#define CFG_SYS_FSL_OCRAM_SIZE 0x00040000 /* Real size 256K */
Yuantian Tang4aefa162019-04-10 16:43:33 +0800182
183/* Generic Interrupt Controller Definitions */
184#define GICD_BASE 0x06000000
185#define GICR_BASE 0x06040000
186
187/* SMMU Definitions */
188#define SMMU_BASE 0x05000000 /* GR0 Base */
189
190/* DDR */
Tom Rini6a5dccc2022-11-16 13:10:41 -0500191#define CFG_SYS_DDR_BLOCK1_SIZE ((phys_size_t)2 << 30)
Tom Rinibc9d46b2022-12-04 10:04:50 -0500192#define CFG_MAX_MEM_MAPPED CFG_SYS_DDR_BLOCK1_SIZE
Yuantian Tang4aefa162019-04-10 16:43:33 +0800193
Yuantian Tang4aefa162019-04-10 16:43:33 +0800194/* SEC */
Yuantian Tang4aefa162019-04-10 16:43:33 +0800195
Yuantian Tang4aefa162019-04-10 16:43:33 +0800196/* DCFG - GUR */
Yuantian Tang4aefa162019-04-10 16:43:33 +0800197
Qianyu Gong8aec7192016-07-05 16:01:53 +0800198#elif defined(CONFIG_FSL_LSCH2)
Tom Rini376b88a2022-10-28 20:27:13 -0400199#define CFG_SYS_FSL_OCRAM_BASE 0x10000000 /* initial RAM */
Hou Zhiqiang3a109ef2016-12-16 17:15:45 +0800200#define SYS_FSL_OCRAM_SPACE_SIZE 0x00200000 /* 2M space */
Tom Rini376b88a2022-10-28 20:27:13 -0400201#define CFG_SYS_FSL_OCRAM_SIZE 0x00020000 /* Real size 128K */
Mingkai Hue4e93ea2015-10-26 19:47:51 +0800202
Hou Zhiqiangc4797802016-12-16 17:15:46 +0800203#define DCSR_DCFG_SBEESR2 0x20140534
204#define DCSR_DCFG_MBEESR2 0x20140544
205
Qianyu Gong8aec7192016-07-05 16:01:53 +0800206/* SoC related */
York Sun342cf062017-03-27 11:41:02 -0700207#ifdef CONFIG_ARCH_LS1043A
Tom Rini0a2bac72022-11-16 13:10:29 -0500208#define CFG_SYS_NUM_FMAN 1
209#define CFG_SYS_NUM_FM1_DTSEC 7
210#define CFG_SYS_NUM_FM1_10GEC 1
Tom Rini6a5dccc2022-11-16 13:10:41 -0500211#define CFG_SYS_DDR_BLOCK1_SIZE ((phys_size_t)2 << 30)
Tom Rinibc9d46b2022-12-04 10:04:50 -0500212#define CFG_MAX_MEM_MAPPED CFG_SYS_DDR_BLOCK1_SIZE
Mingkai Hue4e93ea2015-10-26 19:47:51 +0800213
214#define QE_MURAM_SIZE 0x6000UL
215#define MAX_QE_RISC 1
216#define QE_NUM_OF_SNUM 28
217
Mingkai Hue4e93ea2015-10-26 19:47:51 +0800218/* SMMU Defintions */
219#define SMMU_BASE 0x09000000
220
221/* Generic Interrupt Controller Definitions */
222#define GICD_BASE 0x01401000
223#define GICC_BASE 0x01402000
Wenbin Songa8f57a92017-01-17 18:31:15 +0800224#define GICH_BASE 0x01404000
225#define GICV_BASE 0x01406000
226#define GICD_SIZE 0x1000
227#define GICC_SIZE 0x2000
228#define GICH_SIZE 0x2000
229#define GICV_SIZE 0x2000
230#ifdef CONFIG_HAS_FEATURE_GIC64K_ALIGN
231#define GICD_BASE_64K 0x01410000
232#define GICC_BASE_64K 0x01420000
233#define GICH_BASE_64K 0x01440000
234#define GICV_BASE_64K 0x01460000
235#define GICD_SIZE_64K 0x10000
236#define GICC_SIZE_64K 0x20000
237#define GICH_SIZE_64K 0x20000
238#define GICV_SIZE_64K 0x20000
239#endif
240
241#define DCFG_CCSR_SVR 0x1ee00a4
242#define REV1_0 0x10
243#define REV1_1 0x11
244#define GIC_ADDR_BIT 31
245#define SCFG_GIC400_ALIGN 0x1570188
Mingkai Hue4e93ea2015-10-26 19:47:51 +0800246
York Sund297d392016-12-28 08:43:40 -0800247#elif defined(CONFIG_ARCH_LS1012A)
Prabhakar Kushwahad169ebe2016-06-03 18:41:31 +0530248#define GICD_BASE 0x01401000
249#define GICC_BASE 0x01402000
Tom Rini6a5dccc2022-11-16 13:10:41 -0500250#define CFG_SYS_DDR_BLOCK1_SIZE ((phys_size_t)2 << 30)
Tom Rinibc9d46b2022-12-04 10:04:50 -0500251#define CFG_MAX_MEM_MAPPED CFG_SYS_DDR_BLOCK1_SIZE
Prabhakar Kushwaha1fb2f112017-01-30 17:05:22 +0530252
York Sunbad49842016-09-26 08:09:24 -0700253#elif defined(CONFIG_ARCH_LS1046A)
Tom Rini0a2bac72022-11-16 13:10:29 -0500254#define CFG_SYS_NUM_FMAN 1
255#define CFG_SYS_NUM_FM1_DTSEC 8
256#define CFG_SYS_NUM_FM1_10GEC 2
Tom Rini6a5dccc2022-11-16 13:10:41 -0500257#define CFG_SYS_DDR_BLOCK1_SIZE ((phys_size_t)2 << 30)
Tom Rinibc9d46b2022-12-04 10:04:50 -0500258#define CFG_MAX_MEM_MAPPED CFG_SYS_DDR_BLOCK1_SIZE
Mingkai Hucd54c0f2016-07-05 16:01:55 +0800259
Mingkai Hucd54c0f2016-07-05 16:01:55 +0800260/* SMMU Defintions */
261#define SMMU_BASE 0x09000000
262
263/* Generic Interrupt Controller Definitions */
264#define GICD_BASE 0x01410000
265#define GICC_BASE 0x01420000
Mingkai Hu0e58b512015-10-26 19:47:50 +0800266#else
267#error SoC not defined
268#endif
Qianyu Gong8aec7192016-07-05 16:01:53 +0800269#endif
Mingkai Hu0e58b512015-10-26 19:47:50 +0800270
271#endif /* _ASM_ARMV8_FSL_LAYERSCAPE_CONFIG_H_ */