blob: 2134ee41518ea3448cbd0264d3219df2d0d60598 [file] [log] [blame]
Sandrine Bailleux798140d2014-07-17 16:06:39 +01001/*
2 * Copyright (c) 2014, ARM Limited and Contributors. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are met:
6 *
7 * Redistributions of source code must retain the above copyright notice, this
8 * list of conditions and the following disclaimer.
9 *
10 * Redistributions in binary form must reproduce the above copyright notice,
11 * this list of conditions and the following disclaimer in the documentation
12 * and/or other materials provided with the distribution.
13 *
14 * Neither the name of ARM nor the names of its contributors may be used
15 * to endorse or promote products derived from this software without specific
16 * prior written permission.
17 *
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
22 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 * POSSIBILITY OF SUCH DAMAGE.
29 */
30
31#ifndef __JUNO_DEF_H__
32#define __JUNO_DEF_H__
33
34/* Special value used to verify platform parameters from BL2 to BL3-1 */
35#define JUNO_BL31_PLAT_PARAM_VAL 0x0f1e2d3c4b5a6978ULL
36
Sandrine Bailleux798140d2014-07-17 16:06:39 +010037/*******************************************************************************
38 * Juno memory map related constants
39 ******************************************************************************/
Juan Castillo6ba59eb2014-11-07 09:44:58 +000040#define FLASH_BASE 0x08000000
41#define FLASH_SIZE 0x04000000
42
43/* Bypass offset from start of NOR flash */
44#define BL1_ROM_BYPASS_OFFSET 0x03EC0000
45
46#ifndef TZROM_BASE
47/* Use the bypass address */
48#define TZROM_BASE FLASH_BASE + BL1_ROM_BYPASS_OFFSET
49#endif
Juan Castillo9c25a402015-01-13 12:21:04 +000050/* Actual ROM size on Juno is 64 KB, but TBB requires at least 80 KB in debug
51 * mode. We can test TBB on Juno bypassing the ROM and using 128 KB of flash */
52#if TRUSTED_BOARD_BOOT
53#define TZROM_SIZE 0x00020000
54#else
Juan Castillo6ba59eb2014-11-07 09:44:58 +000055#define TZROM_SIZE 0x00010000
Juan Castillo9c25a402015-01-13 12:21:04 +000056#endif
Juan Castillo6ba59eb2014-11-07 09:44:58 +000057
58#define TZRAM_BASE 0x04001000
59#define TZRAM_SIZE 0x0003F000
60
Juan Castillo921b8772014-09-05 17:29:38 +010061#define PLAT_TRUSTED_SRAM_ID 0
62#define PLAT_DRAM_ID 1
63
Sandrine Bailleux798140d2014-07-17 16:06:39 +010064#define MHU_SECURE_BASE 0x04000000
65#define MHU_SECURE_SIZE 0x00001000
66
67#define MHU_PAYLOAD_CACHED 0
68
69#define TRUSTED_MAILBOXES_BASE MHU_SECURE_BASE
70#define TRUSTED_MAILBOX_SHIFT 4
71
72#define EMMC_BASE 0x0c000000
73#define EMMC_SIZE 0x04000000
74
75#define PSRAM_BASE 0x14000000
76#define PSRAM_SIZE 0x02000000
77
78#define IOFPGA_BASE 0x1c000000
79#define IOFPGA_SIZE 0x03000000
80
81#define NSROM_BASE 0x1f000000
82#define NSROM_SIZE 0x00001000
83
84/* Following covers Columbus Peripherals excluding NSROM and NSRAM */
85#define DEVICE0_BASE 0x20000000
86#define DEVICE0_SIZE 0x0e000000
87#define MHU_BASE 0x2b1f0000
88
89#define NSRAM_BASE 0x2e000000
90#define NSRAM_SIZE 0x00008000
91
92/* Following covers Juno Peripherals and PCIe expansion area */
93#define DEVICE1_BASE 0x40000000
94#define DEVICE1_SIZE 0x40000000
95#define PCIE_CONTROL_BASE 0x7ff20000
96
97#define DRAM_BASE 0x80000000
98#define DRAM_SIZE 0x80000000
99
Juan Castillo921b8772014-09-05 17:29:38 +0100100/*
101 * DRAM at 0x8000_0000 is divided in two regions:
102 * - Secure DRAM (default is the top 16MB except for the last 2MB, which are
103 * used by the SCP for DDR retraining)
104 * - Non-Secure DRAM (remaining DRAM starting at DRAM_BASE)
105 */
106
107#define DRAM_SCP_SIZE 0x00200000
108#define DRAM_SCP_BASE (DRAM_BASE + DRAM_SIZE - DRAM_SCP_SIZE)
109
110#define DRAM_SEC_SIZE 0x00E00000
111#define DRAM_SEC_BASE (DRAM_SCP_BASE - DRAM_SEC_SIZE)
112
113#define DRAM_NS_BASE DRAM_BASE
114#define DRAM_NS_SIZE (DRAM_SIZE - DRAM_SCP_SIZE - DRAM_SEC_SIZE)
115
116/* Second region of DRAM */
117#define DRAM2_BASE 0x880000000
118#define DRAM2_SIZE 0x180000000
119
Sandrine Bailleux798140d2014-07-17 16:06:39 +0100120/* Memory mapped Generic timer interfaces */
121#define SYS_CNTCTL_BASE 0x2a430000
122#define SYS_CNTREAD_BASE 0x2a800000
123#define SYS_TIMCTL_BASE 0x2a810000
124
Sandrine Bailleuxfd8f8982015-02-04 14:06:10 +0000125/*
126 * Base memory address of the V2M-Juno motherboard APB system registers in the
127 * IOFPGA
128 */
Sandrine Bailleux798140d2014-07-17 16:06:39 +0100129#define VE_SYSREGS_BASE 0x1c010000
Sandrine Bailleuxfd8f8982015-02-04 14:06:10 +0000130/* APB system registers in address offset order from the base memory address */
131#define V2M_SYS_ID 0x0
Sandrine Bailleux798140d2014-07-17 16:06:39 +0100132#define V2M_SYS_LED 0x8
133
Sandrine Bailleuxfd8f8982015-02-04 14:06:10 +0000134/* V2M SYS_ID register bits */
135#define SYS_ID_REV_SHIFT 28
136#define SYS_ID_REV_MASK 0xf
137
138/* Board revisions */
139#define REV_JUNO_R0 0x1 /* Rev B */
140#define REV_JUNO_R1 0x2 /* Rev C */
141
Sandrine Bailleux798140d2014-07-17 16:06:39 +0100142/*
143 * V2M sysled bit definitions. The values written to this
144 * register are defined in arch.h & runtime_svc.h. Only
145 * used by the primary cpu to diagnose any cold boot issues.
146 *
147 * SYS_LED[0] - Security state (S=0/NS=1)
148 * SYS_LED[2:1] - Exception Level (EL3-EL0)
149 * SYS_LED[7:3] - Exception Class (Sync/Async & origin)
150 *
151 */
152#define SYS_LED_SS_SHIFT 0x0
153#define SYS_LED_EL_SHIFT 0x1
154#define SYS_LED_EC_SHIFT 0x3
155
Soby Mathew13ee9682015-01-22 11:22:22 +0000156/*
157 * The number of regions like RO(code), coherent and data required by
158 * different BL stages which need to be mapped in the MMU.
159 */
160#if USE_COHERENT_MEM
161#define JUNO_BL_REGIONS 3
162#else
163#define JUNO_BL_REGIONS 2
164#endif
165
166/*
167 * The JUNO_MAX_MMAP_REGIONS depend on the number of entries in juno_mmap[]
168 * defined for each BL stage in juno_common.c.
169 */
170#if IMAGE_BL1
171#define JUNO_MMAP_ENTRIES 6
172#endif
173#if IMAGE_BL2
174#define JUNO_MMAP_ENTRIES 8
175#endif
176#if IMAGE_BL31
177#define JUNO_MMAP_ENTRIES 5
178#endif
179#if IMAGE_BL32
180#define JUNO_MMAP_ENTRIES 4
181#endif
182
Sandrine Bailleux798140d2014-07-17 16:06:39 +0100183/*******************************************************************************
184 * GIC-400 & interrupt handling related constants
185 ******************************************************************************/
186#define GICD_BASE 0x2c010000
187#define GICC_BASE 0x2c02f000
188#define GICH_BASE 0x2c04f000
189#define GICV_BASE 0x2c06f000
190
191#define IRQ_MHU 69
192#define IRQ_GPU_SMMU_0 71
193#define IRQ_GPU_SMMU_1 73
194#define IRQ_ETR_SMMU 75
195#define IRQ_TZC400 80
196#define IRQ_TZ_WDOG 86
197
Sandrine Bailleux1fe43362014-07-17 09:56:29 +0100198#define IRQ_SEC_PHY_TIMER 29
Sandrine Bailleux798140d2014-07-17 16:06:39 +0100199#define IRQ_SEC_SGI_0 8
200#define IRQ_SEC_SGI_1 9
201#define IRQ_SEC_SGI_2 10
202#define IRQ_SEC_SGI_3 11
203#define IRQ_SEC_SGI_4 12
204#define IRQ_SEC_SGI_5 13
205#define IRQ_SEC_SGI_6 14
206#define IRQ_SEC_SGI_7 15
Sandrine Bailleux798140d2014-07-17 16:06:39 +0100207
208/*******************************************************************************
209 * PL011 related constants
210 ******************************************************************************/
211/* FPGA UART0 */
212#define PL011_UART0_BASE 0x1c090000
213/* FPGA UART1 */
214#define PL011_UART1_BASE 0x1c0a0000
215/* SoC UART0 */
216#define PL011_UART2_BASE 0x7ff80000
217/* SoC UART1 */
218#define PL011_UART3_BASE 0x7ff70000
219
220#define PL011_BAUDRATE 115200
221
222#define PL011_UART0_CLK_IN_HZ 24000000
223#define PL011_UART1_CLK_IN_HZ 24000000
Soby Mathewf797cea2014-08-21 15:20:27 +0100224#define PL011_UART2_CLK_IN_HZ 7273800
225#define PL011_UART3_CLK_IN_HZ 7273800
Sandrine Bailleux798140d2014-07-17 16:06:39 +0100226
227/*******************************************************************************
228 * NIC-400 related constants
229 ******************************************************************************/
230
231/* CSS NIC-400 Global Programmers View (GPV) */
232#define CSS_NIC400_BASE 0x2a000000
233
234/* The slave_bootsecure controls access to GPU, DMC and CS. */
235#define CSS_NIC400_SLAVE_BOOTSECURE 8
236
237/* SoC NIC-400 Global Programmers View (GPV) */
238#define SOC_NIC400_BASE 0x7fd00000
239
240#define SOC_NIC400_USB_EHCI 0
241#define SOC_NIC400_TLX_MASTER 1
242#define SOC_NIC400_USB_OHCI 2
243#define SOC_NIC400_PL354_SMC 3
244/*
245 * The apb4_bridge controls access to:
246 * - the PCIe configuration registers
247 * - the MMU units for USB, HDLCD and DMA
248 */
249#define SOC_NIC400_APB4_BRIDGE 4
250/*
251 * The bootsec_bridge controls access to a bunch of peripherals, e.g. the UARTs.
252 */
253#define SOC_NIC400_BOOTSEC_BRIDGE 5
254#define SOC_NIC400_BOOTSEC_BRIDGE_UART1 (1 << 12)
255
256/*******************************************************************************
257 * TZC-400 related constants
258 ******************************************************************************/
259#define TZC400_BASE 0x2a4a0000
260
261#define TZC400_NSAID_CCI400 0 /* Note: Same as default NSAID!! */
262#define TZC400_NSAID_PCIE 1
263#define TZC400_NSAID_HDLCD0 2
264#define TZC400_NSAID_HDLCD1 3
265#define TZC400_NSAID_USB 4
266#define TZC400_NSAID_DMA330 5
267#define TZC400_NSAID_THINLINKS 6
268#define TZC400_NSAID_AP 9
269#define TZC400_NSAID_GPU 10
270#define TZC400_NSAID_SCP 11
271#define TZC400_NSAID_CORESIGHT 12
272
273/*******************************************************************************
274 * CCI-400 related constants
275 ******************************************************************************/
276#define CCI400_BASE 0x2c090000
Vikram Kanigiri4e97e542015-02-26 15:25:58 +0000277#define CCI400_CLUSTER0_SL_IFACE_IX 4
278#define CCI400_CLUSTER1_SL_IFACE_IX 3
Sandrine Bailleux798140d2014-07-17 16:06:39 +0100279
Juan Castillo21b04192014-08-12 17:24:30 +0100280/*******************************************************************************
281 * SCP <=> AP boot configuration
282 ******************************************************************************/
283#define SCP_BOOT_CFG_ADDR 0x04000080
284#define PRIMARY_CPU_SHIFT 8
285#define PRIMARY_CPU_MASK 0xf
286
Robin Murphy0f1d6662015-01-09 14:30:58 +0000287/*******************************************************************************
288 * MMU-401 related constants
289 ******************************************************************************/
290#define MMU401_SSD_OFFSET 0x4000
291#define MMU401_DMA330_BASE 0x7fb00000
292
Sandrine Bailleux798140d2014-07-17 16:06:39 +0100293#endif /* __JUNO_DEF_H__ */