blob: 5824778ca286502b57510aedee94df3f5882ab94 [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
York Sunbad49842016-09-26 08:09:24 -070010#include <linux/kconfig.h>
Mingkai Hu0e58b512015-10-26 19:47:50 +080011#include <fsl_ddrc_version.h>
12
Simon Glass4dcacfc2020-05-10 11:40:13 -060013#ifndef __ASSEMBLY__
14#include <linux/bitops.h>
15#endif
16
Shaohui Xie6759cc22016-09-07 17:56:09 +080017#define CONFIG_STANDALONE_LOAD_ADDR 0x80300000
18
York Sun0804d562015-12-04 11:57:08 -080019/*
20 * Reserve secure memory
21 * To be aligned with MMU block size
22 */
Sumit Garg251c44b2017-09-01 13:55:00 +053023#define CONFIG_SYS_MEM_RESERVE_SECURE (66 * 1024 * 1024) /* 66MB */
York Sunf2aaf842017-05-15 08:52:00 -070024#define SPL_TLB_SETBACK 0x1000000 /* 16MB under effective memory top */
York Sun0804d562015-12-04 11:57:08 -080025
York Sun4ce6fbf2017-03-27 11:41:01 -070026#ifdef CONFIG_ARCH_LS2080A
Mingkai Hu0e58b512015-10-26 19:47:50 +080027#define CONFIG_SYS_FSL_CLUSTER_CLOCKS { 1, 1, 4, 4 }
28#define SRDS_MAX_LANES 8
Mingkai Hu0e58b512015-10-26 19:47:50 +080029#define CONFIG_SYS_PAGE_SIZE 0x10000
Mingkai Hu0e58b512015-10-26 19:47:50 +080030#ifndef L1_CACHE_BYTES
31#define L1_CACHE_SHIFT 6
32#define L1_CACHE_BYTES BIT(L1_CACHE_SHIFT)
33#endif
34
Hou Zhiqiang3a109ef2016-12-16 17:15:45 +080035#define CONFIG_SYS_FSL_OCRAM_BASE 0x18000000 /* initial RAM */
36#define SYS_FSL_OCRAM_SPACE_SIZE 0x00200000 /* 2M space */
37#define CONFIG_SYS_FSL_OCRAM_SIZE 0x00020000 /* Real size 128K */
Mingkai Hu0e58b512015-10-26 19:47:50 +080038
39/* DDR */
York Sun4de24ef2017-03-06 09:02:28 -080040#define CONFIG_SYS_DDR_BLOCK1_SIZE ((phys_size_t)2 << 30)
41#define CONFIG_MAX_MEM_MAPPED CONFIG_SYS_DDR_BLOCK1_SIZE
Mingkai Hu0e58b512015-10-26 19:47:50 +080042
Mingkai Hu0e58b512015-10-26 19:47:50 +080043/* Generic Interrupt Controller Definitions */
44#define GICD_BASE 0x06000000
45#define GICR_BASE 0x06100000
46
47/* SMMU Defintions */
48#define SMMU_BASE 0x05000000 /* GR0 Base */
49
50/* Cache Coherent Interconnect */
51#define CCI_MN_BASE 0x04000000
52#define CCI_MN_RNF_NODEID_LIST 0x180
53#define CCI_MN_DVM_DOMAIN_CTL 0x200
54#define CCI_MN_DVM_DOMAIN_CTL_SET 0x210
55
York Sund957a672015-11-04 09:53:10 -080056#define CCI_HN_F_0_BASE (CCI_MN_BASE + 0x200000)
57#define CCI_HN_F_1_BASE (CCI_MN_BASE + 0x210000)
58#define CCN_HN_F_SAM_CTL 0x8 /* offset on base HN_F base */
59#define CCN_HN_F_SAM_NODEID_MASK 0x7f
60#define CCN_HN_F_SAM_NODEID_DDR0 0x4
61#define CCN_HN_F_SAM_NODEID_DDR1 0xe
62
Mingkai Hu0e58b512015-10-26 19:47:50 +080063#define CCI_RN_I_0_BASE (CCI_MN_BASE + 0x800000)
64#define CCI_RN_I_2_BASE (CCI_MN_BASE + 0x820000)
65#define CCI_RN_I_6_BASE (CCI_MN_BASE + 0x860000)
66#define CCI_RN_I_12_BASE (CCI_MN_BASE + 0x8C0000)
67#define CCI_RN_I_16_BASE (CCI_MN_BASE + 0x900000)
68#define CCI_RN_I_20_BASE (CCI_MN_BASE + 0x940000)
69
70#define CCI_S0_QOS_CONTROL_BASE(x) ((CCI_RN_I_0_BASE + (x * 0x10000)) + 0x10)
71#define CCI_S1_QOS_CONTROL_BASE(x) ((CCI_RN_I_0_BASE + (x * 0x10000)) + 0x110)
72#define CCI_S2_QOS_CONTROL_BASE(x) ((CCI_RN_I_0_BASE + (x * 0x10000)) + 0x210)
73
Prabhakar Kushwahaedbbd252016-01-25 12:08:45 +053074#define CCI_AUX_CONTROL_BASE(x) ((CCI_RN_I_0_BASE + (x * 0x10000)) + 0x0500)
75
Mingkai Hu0e58b512015-10-26 19:47:50 +080076/* TZ Protection Controller Definitions */
77#define TZPC_BASE 0x02200000
78#define TZPCR0SIZE_BASE (TZPC_BASE)
79#define TZPCDECPROT_0_STAT_BASE (TZPC_BASE + 0x800)
80#define TZPCDECPROT_0_SET_BASE (TZPC_BASE + 0x804)
81#define TZPCDECPROT_0_CLR_BASE (TZPC_BASE + 0x808)
82#define TZPCDECPROT_1_STAT_BASE (TZPC_BASE + 0x80C)
83#define TZPCDECPROT_1_SET_BASE (TZPC_BASE + 0x810)
84#define TZPCDECPROT_1_CLR_BASE (TZPC_BASE + 0x814)
85#define TZPCDECPROT_2_STAT_BASE (TZPC_BASE + 0x818)
86#define TZPCDECPROT_2_SET_BASE (TZPC_BASE + 0x81C)
87#define TZPCDECPROT_2_CLR_BASE (TZPC_BASE + 0x820)
88
Prabhakar Kushwaha22cfe962015-11-05 12:00:14 +053089#define DCSR_CGACRE5 0x700070914ULL
90#define EPU_EPCMPR5 0x700060914ULL
91#define EPU_EPCCR5 0x700060814ULL
92#define EPU_EPSMCR5 0x700060228ULL
93#define EPU_EPECR5 0x700060314ULL
94#define EPU_EPCTR5 0x700060a14ULL
95#define EPU_EPGCR 0x700060000ULL
96
Ashish Kumarb25faa22017-08-31 16:12:53 +053097#elif defined(CONFIG_ARCH_LS1088A)
Ashish Kumarb25faa22017-08-31 16:12:53 +053098#define CONFIG_SYS_FSL_CLUSTER_CLOCKS { 1, 1 }
Ashish Kumarb25faa22017-08-31 16:12:53 +053099#define CONFIG_SYS_PAGE_SIZE 0x10000
100
101#define SRDS_MAX_LANES 4
Alex Marginean47568ce2020-01-11 01:05:40 +0200102#define SRDS_BITS_PER_LANE 4
Ashish Kumarb25faa22017-08-31 16:12:53 +0530103
104/* TZ Protection Controller Definitions */
105#define TZPC_BASE 0x02200000
106#define TZPCR0SIZE_BASE (TZPC_BASE)
107#define TZPCDECPROT_0_STAT_BASE (TZPC_BASE + 0x800)
108#define TZPCDECPROT_0_SET_BASE (TZPC_BASE + 0x804)
109#define TZPCDECPROT_0_CLR_BASE (TZPC_BASE + 0x808)
110#define TZPCDECPROT_1_STAT_BASE (TZPC_BASE + 0x80C)
111#define TZPCDECPROT_1_SET_BASE (TZPC_BASE + 0x810)
112#define TZPCDECPROT_1_CLR_BASE (TZPC_BASE + 0x814)
113#define TZPCDECPROT_2_STAT_BASE (TZPC_BASE + 0x818)
114#define TZPCDECPROT_2_SET_BASE (TZPC_BASE + 0x81C)
115#define TZPCDECPROT_2_CLR_BASE (TZPC_BASE + 0x820)
116
117/* Generic Interrupt Controller Definitions */
118#define GICD_BASE 0x06000000
119#define GICR_BASE 0x06100000
120
121/* SMMU Defintions */
122#define SMMU_BASE 0x05000000 /* GR0 Base */
123
124/* DDR */
125#define CONFIG_SYS_DDR_BLOCK1_SIZE ((phys_size_t)2 << 30)
126#define CONFIG_MAX_MEM_MAPPED CONFIG_SYS_DDR_BLOCK1_SIZE
127
Ashish Kumarb25faa22017-08-31 16:12:53 +0530128/* DCFG - GUR */
Ashish Kumarb25faa22017-08-31 16:12:53 +0530129#define CONFIG_SYS_FSL_OCRAM_BASE 0x18000000 /* initial RAM */
130#define SYS_FSL_OCRAM_SPACE_SIZE 0x00200000 /* 2M space */
131#define CONFIG_SYS_FSL_OCRAM_SIZE 0x00020000 /* Real size 128K */
132
Meenakshi Aggarwalccb5d5d2020-10-29 19:16:16 +0530133/* LX2160A/LX2162A Soc Support */
134#elif defined(CONFIG_ARCH_LX2160A) || defined(CONFIG_ARCH_LX2162A)
Priyanka Jainef76b2e2018-10-29 09:17:09 +0000135#define TZPC_BASE 0x02200000
136#define TZPCDECPROT_0_SET_BASE (TZPC_BASE + 0x804)
Priyanka Jainef76b2e2018-10-29 09:17:09 +0000137#define SRDS_MAX_LANES 8
138#ifndef L1_CACHE_BYTES
139#define L1_CACHE_SHIFT 6
140#define L1_CACHE_BYTES BIT(L1_CACHE_SHIFT)
141#endif
Priyanka Jainef76b2e2018-10-29 09:17:09 +0000142#define CONFIG_SYS_FSL_CLUSTER_CLOCKS { 1, 1, 1, 1, 4, 4, 4, 4 }
Priyanka Jainef76b2e2018-10-29 09:17:09 +0000143
144#define CONFIG_SYS_PAGE_SIZE 0x10000
145
146#define CONFIG_SYS_FSL_OCRAM_BASE 0x18000000 /* initial RAM */
147#define SYS_FSL_OCRAM_SPACE_SIZE 0x00200000 /* 2M space */
148#define CONFIG_SYS_FSL_OCRAM_SIZE 0x00040000 /* Real size 256K */
149
150/* DDR */
151#define CONFIG_SYS_DDR_BLOCK1_SIZE ((phys_size_t)2 << 30)
152#define CONFIG_MAX_MEM_MAPPED CONFIG_SYS_DDR_BLOCK1_SIZE
153
Priyanka Jainef76b2e2018-10-29 09:17:09 +0000154/* Generic Interrupt Controller Definitions */
155#define GICD_BASE 0x06000000
156#define GICR_BASE 0x06200000
157
158/* SMMU Definitions */
159#define SMMU_BASE 0x05000000 /* GR0 Base */
160
Priyanka Jainef76b2e2018-10-29 09:17:09 +0000161/* DCFG - GUR */
Priyanka Jainef76b2e2018-10-29 09:17:09 +0000162
Yuantian Tang4aefa162019-04-10 16:43:33 +0800163#elif defined(CONFIG_ARCH_LS1028A)
Yuantian Tang4aefa162019-04-10 16:43:33 +0800164#define CONFIG_SYS_FSL_CLUSTER_CLOCKS { 1, 1 }
Yuantian Tang4aefa162019-04-10 16:43:33 +0800165#define CONFIG_FSL_TZASC_400
166
167/* TZ Protection Controller Definitions */
168#define TZPC_BASE 0x02200000
169#define TZPCR0SIZE_BASE (TZPC_BASE)
170#define TZPCDECPROT_0_STAT_BASE (TZPC_BASE + 0x800)
171#define TZPCDECPROT_0_SET_BASE (TZPC_BASE + 0x804)
172#define TZPCDECPROT_0_CLR_BASE (TZPC_BASE + 0x808)
173#define TZPCDECPROT_1_STAT_BASE (TZPC_BASE + 0x80C)
174#define TZPCDECPROT_1_SET_BASE (TZPC_BASE + 0x810)
175#define TZPCDECPROT_1_CLR_BASE (TZPC_BASE + 0x814)
176#define TZPCDECPROT_2_STAT_BASE (TZPC_BASE + 0x818)
177#define TZPCDECPROT_2_SET_BASE (TZPC_BASE + 0x81C)
178#define TZPCDECPROT_2_CLR_BASE (TZPC_BASE + 0x820)
179
180#define SRDS_MAX_LANES 4
Alex Marginean47568ce2020-01-11 01:05:40 +0200181#define SRDS_BITS_PER_LANE 4
Yuantian Tang4aefa162019-04-10 16:43:33 +0800182
183#define CONFIG_SYS_FSL_OCRAM_BASE 0x18000000 /* initial RAM */
184#define SYS_FSL_OCRAM_SPACE_SIZE 0x00200000 /* 2M */
185#define CONFIG_SYS_FSL_OCRAM_SIZE 0x00040000 /* Real size 256K */
186
187/* Generic Interrupt Controller Definitions */
188#define GICD_BASE 0x06000000
189#define GICR_BASE 0x06040000
190
191/* SMMU Definitions */
192#define SMMU_BASE 0x05000000 /* GR0 Base */
193
194/* DDR */
195#define CONFIG_SYS_DDR_BLOCK1_SIZE ((phys_size_t)2 << 30)
196#define CONFIG_MAX_MEM_MAPPED CONFIG_SYS_DDR_BLOCK1_SIZE
197
Yuantian Tang4aefa162019-04-10 16:43:33 +0800198/* SEC */
Yuantian Tang4aefa162019-04-10 16:43:33 +0800199
Yuantian Tang4aefa162019-04-10 16:43:33 +0800200/* DCFG - GUR */
Yuantian Tang4aefa162019-04-10 16:43:33 +0800201
Qianyu Gong8aec7192016-07-05 16:01:53 +0800202#elif defined(CONFIG_FSL_LSCH2)
Mingkai Hue4e93ea2015-10-26 19:47:51 +0800203#define CONFIG_SYS_FSL_OCRAM_BASE 0x10000000 /* initial RAM */
Hou Zhiqiang3a109ef2016-12-16 17:15:45 +0800204#define SYS_FSL_OCRAM_SPACE_SIZE 0x00200000 /* 2M space */
205#define CONFIG_SYS_FSL_OCRAM_SIZE 0x00020000 /* Real size 128K */
Mingkai Hue4e93ea2015-10-26 19:47:51 +0800206
Hou Zhiqiangc4797802016-12-16 17:15:46 +0800207#define DCSR_DCFG_SBEESR2 0x20140534
208#define DCSR_DCFG_MBEESR2 0x20140544
209
Qianyu Gong8aec7192016-07-05 16:01:53 +0800210/* SoC related */
York Sun342cf062017-03-27 11:41:02 -0700211#ifdef CONFIG_ARCH_LS1043A
Qianyu Gong8aec7192016-07-05 16:01:53 +0800212#define CONFIG_SYS_NUM_FMAN 1
213#define CONFIG_SYS_NUM_FM1_DTSEC 7
214#define CONFIG_SYS_NUM_FM1_10GEC 1
Qianyu Gong8aec7192016-07-05 16:01:53 +0800215#define CONFIG_SYS_DDR_BLOCK1_SIZE ((phys_size_t)2 << 30)
216#define CONFIG_MAX_MEM_MAPPED CONFIG_SYS_DDR_BLOCK1_SIZE
Mingkai Hue4e93ea2015-10-26 19:47:51 +0800217
218#define QE_MURAM_SIZE 0x6000UL
219#define MAX_QE_RISC 1
220#define QE_NUM_OF_SNUM 28
221
Mingkai Hue4e93ea2015-10-26 19:47:51 +0800222/* SMMU Defintions */
223#define SMMU_BASE 0x09000000
224
225/* Generic Interrupt Controller Definitions */
226#define GICD_BASE 0x01401000
227#define GICC_BASE 0x01402000
Wenbin Songa8f57a92017-01-17 18:31:15 +0800228#define GICH_BASE 0x01404000
229#define GICV_BASE 0x01406000
230#define GICD_SIZE 0x1000
231#define GICC_SIZE 0x2000
232#define GICH_SIZE 0x2000
233#define GICV_SIZE 0x2000
234#ifdef CONFIG_HAS_FEATURE_GIC64K_ALIGN
235#define GICD_BASE_64K 0x01410000
236#define GICC_BASE_64K 0x01420000
237#define GICH_BASE_64K 0x01440000
238#define GICV_BASE_64K 0x01460000
239#define GICD_SIZE_64K 0x10000
240#define GICC_SIZE_64K 0x20000
241#define GICH_SIZE_64K 0x20000
242#define GICV_SIZE_64K 0x20000
243#endif
244
245#define DCFG_CCSR_SVR 0x1ee00a4
246#define REV1_0 0x10
247#define REV1_1 0x11
248#define GIC_ADDR_BIT 31
249#define SCFG_GIC400_ALIGN 0x1570188
Mingkai Hue4e93ea2015-10-26 19:47:51 +0800250
York Sund297d392016-12-28 08:43:40 -0800251#elif defined(CONFIG_ARCH_LS1012A)
Prabhakar Kushwahad169ebe2016-06-03 18:41:31 +0530252#define GICD_BASE 0x01401000
253#define GICC_BASE 0x01402000
Prabhakar Kushwaha1fb2f112017-01-30 17:05:22 +0530254#define CONFIG_SYS_DDR_BLOCK1_SIZE ((phys_size_t)2 << 30)
255#define CONFIG_MAX_MEM_MAPPED CONFIG_SYS_DDR_BLOCK1_SIZE
256
York Sunbad49842016-09-26 08:09:24 -0700257#elif defined(CONFIG_ARCH_LS1046A)
Mingkai Hucd54c0f2016-07-05 16:01:55 +0800258#define CONFIG_SYS_NUM_FMAN 1
259#define CONFIG_SYS_NUM_FM1_DTSEC 8
260#define CONFIG_SYS_NUM_FM1_10GEC 2
Mingkai Hucd54c0f2016-07-05 16:01:55 +0800261#define CONFIG_SYS_DDR_BLOCK1_SIZE ((phys_size_t)2 << 30)
262#define CONFIG_MAX_MEM_MAPPED CONFIG_SYS_DDR_BLOCK1_SIZE
263
Mingkai Hucd54c0f2016-07-05 16:01:55 +0800264/* SMMU Defintions */
265#define SMMU_BASE 0x09000000
266
267/* Generic Interrupt Controller Definitions */
268#define GICD_BASE 0x01410000
269#define GICC_BASE 0x01420000
Mingkai Hu0e58b512015-10-26 19:47:50 +0800270#else
271#error SoC not defined
272#endif
Qianyu Gong8aec7192016-07-05 16:01:53 +0800273#endif
Mingkai Hu0e58b512015-10-26 19:47:50 +0800274
275#endif /* _ASM_ARMV8_FSL_LAYERSCAPE_CONFIG_H_ */