blob: a757b4df0041659ece079320cfdb3cf8a7803cdf [file] [log] [blame]
Andrew Thoelke960347d2014-06-26 14:27:26 +01001#/*
Dan Handleyed6ff952014-05-14 17:44:19 +01002 * 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 __FVP_DEF_H__
32#define __FVP_DEF_H__
33
34#include <platform_def.h> /* for TZROM_SIZE */
35
36
37/* Firmware Image Package */
38#define FIP_IMAGE_NAME "fip.bin"
Juan Castillob3dbeb02014-07-16 15:53:43 +010039#define FVP_PRIMARY_CPU 0x0
Dan Handleyed6ff952014-05-14 17:44:19 +010040
Dan Handleyed6ff952014-05-14 17:44:19 +010041/*******************************************************************************
42 * FVP memory map related constants
43 ******************************************************************************/
44
45#define FLASH0_BASE 0x08000000
46#define FLASH0_SIZE TZROM_SIZE
47
48#define FLASH1_BASE 0x0c000000
49#define FLASH1_SIZE 0x04000000
50
51#define PSRAM_BASE 0x14000000
52#define PSRAM_SIZE 0x04000000
53
54#define VRAM_BASE 0x18000000
55#define VRAM_SIZE 0x02000000
56
57/* Aggregate of all devices in the first GB */
58#define DEVICE0_BASE 0x1a000000
59#define DEVICE0_SIZE 0x12200000
60
61#define DEVICE1_BASE 0x2f000000
62#define DEVICE1_SIZE 0x200000
63
64#define NSRAM_BASE 0x2e000000
65#define NSRAM_SIZE 0x10000
66
67#define MBOX_OFF 0x1000
68
69/* Base address where parameters to BL31 are stored */
70#define PARAMS_BASE TZDRAM_BASE
71
72#define DRAM1_BASE 0x80000000ull
73#define DRAM1_SIZE 0x80000000ull
74#define DRAM1_END (DRAM1_BASE + DRAM1_SIZE - 1)
75#define DRAM1_SEC_SIZE 0x01000000ull
76
77#define DRAM_BASE DRAM1_BASE
78#define DRAM_SIZE DRAM1_SIZE
79
80#define DRAM2_BASE 0x880000000ull
81#define DRAM2_SIZE 0x780000000ull
82#define DRAM2_END (DRAM2_BASE + DRAM2_SIZE - 1)
83
84#define PCIE_EXP_BASE 0x40000000
85#define TZRNG_BASE 0x7fe60000
86#define TZNVCTR_BASE 0x7fe70000
87#define TZROOTKEY_BASE 0x7fe80000
88
89/* Memory mapped Generic timer interfaces */
90#define SYS_CNTCTL_BASE 0x2a430000
91#define SYS_CNTREAD_BASE 0x2a800000
92#define SYS_TIMCTL_BASE 0x2a810000
93
94/* V2M motherboard system registers & offsets */
95#define VE_SYSREGS_BASE 0x1c010000
96#define V2M_SYS_ID 0x0
97#define V2M_SYS_LED 0x8
98#define V2M_SYS_CFGDATA 0xa0
99#define V2M_SYS_CFGCTRL 0xa4
100
101/* Load address of BL33 in the FVP port */
102#define NS_IMAGE_OFFSET (DRAM1_BASE + 0x8000000) /* DRAM + 128MB */
103
Andrew Thoelkea55566d2014-05-28 22:22:55 +0100104/* Special value used to verify platform parameters from BL2 to BL3-1 */
105#define FVP_BL31_PLAT_PARAM_VAL 0x0f1e2d3c4b5a6978ULL
106
Dan Handleyed6ff952014-05-14 17:44:19 +0100107/*
108 * V2M sysled bit definitions. The values written to this
109 * register are defined in arch.h & runtime_svc.h. Only
110 * used by the primary cpu to diagnose any cold boot issues.
111 *
112 * SYS_LED[0] - Security state (S=0/NS=1)
113 * SYS_LED[2:1] - Exception Level (EL3-EL0)
114 * SYS_LED[7:3] - Exception Class (Sync/Async & origin)
115 *
116 */
117#define SYS_LED_SS_SHIFT 0x0
118#define SYS_LED_EL_SHIFT 0x1
119#define SYS_LED_EC_SHIFT 0x3
120
121#define SYS_LED_SS_MASK 0x1
122#define SYS_LED_EL_MASK 0x3
123#define SYS_LED_EC_MASK 0x1f
124
125/* V2M sysid register bits */
Juan Castillod73898a2014-06-13 17:10:00 +0100126#define SYS_ID_REV_SHIFT 28
Dan Handleyed6ff952014-05-14 17:44:19 +0100127#define SYS_ID_HBI_SHIFT 16
128#define SYS_ID_BLD_SHIFT 12
129#define SYS_ID_ARCH_SHIFT 8
130#define SYS_ID_FPGA_SHIFT 0
131
132#define SYS_ID_REV_MASK 0xf
133#define SYS_ID_HBI_MASK 0xfff
134#define SYS_ID_BLD_MASK 0xf
135#define SYS_ID_ARCH_MASK 0xf
136#define SYS_ID_FPGA_MASK 0xff
137
138#define SYS_ID_BLD_LENGTH 4
139
Dan Handleyed6ff952014-05-14 17:44:19 +0100140#define HBI_FVP_BASE 0x020
Andrew Thoelke960347d2014-06-26 14:27:26 +0100141#define REV_FVP_BASE_V0 0x0
142
Dan Handleyed6ff952014-05-14 17:44:19 +0100143#define HBI_FOUNDATION 0x010
Andrew Thoelke960347d2014-06-26 14:27:26 +0100144#define REV_FOUNDATION_V2_0 0x0
145#define REV_FOUNDATION_V2_1 0x1
Dan Handleyed6ff952014-05-14 17:44:19 +0100146
147#define BLD_GIC_VE_MMAP 0x0
148#define BLD_GIC_A53A57_MMAP 0x1
149
150#define ARCH_MODEL 0x1
151
152/* FVP Power controller base address*/
153#define PWRC_BASE 0x1c100000
154
155
156/*******************************************************************************
157 * CCI-400 related constants
158 ******************************************************************************/
159#define CCI400_BASE 0x2c090000
160#define CCI400_SL_IFACE_CLUSTER0 3
161#define CCI400_SL_IFACE_CLUSTER1 4
162#define CCI400_SL_IFACE_INDEX(mpidr) (mpidr & MPIDR_CLUSTER_MASK ? \
163 CCI400_SL_IFACE_CLUSTER1 : \
164 CCI400_SL_IFACE_CLUSTER0)
165
166/*******************************************************************************
167 * GIC-400 & interrupt handling related constants
168 ******************************************************************************/
169/* VE compatible GIC memory map */
170#define VE_GICD_BASE 0x2c001000
171#define VE_GICC_BASE 0x2c002000
172#define VE_GICH_BASE 0x2c004000
173#define VE_GICV_BASE 0x2c006000
174
175/* Base FVP compatible GIC memory map */
176#define BASE_GICD_BASE 0x2f000000
177#define BASE_GICR_BASE 0x2f100000
178#define BASE_GICC_BASE 0x2c000000
179#define BASE_GICH_BASE 0x2c010000
180#define BASE_GICV_BASE 0x2c02f000
181
182#define IRQ_TZ_WDOG 56
183#define IRQ_SEC_PHY_TIMER 29
184#define IRQ_SEC_SGI_0 8
185#define IRQ_SEC_SGI_1 9
186#define IRQ_SEC_SGI_2 10
187#define IRQ_SEC_SGI_3 11
188#define IRQ_SEC_SGI_4 12
189#define IRQ_SEC_SGI_5 13
190#define IRQ_SEC_SGI_6 14
191#define IRQ_SEC_SGI_7 15
192#define IRQ_SEC_SGI_8 16
193
194/*******************************************************************************
195 * PL011 related constants
196 ******************************************************************************/
197#define PL011_UART0_BASE 0x1c090000
198#define PL011_UART1_BASE 0x1c0a0000
199#define PL011_UART2_BASE 0x1c0b0000
200#define PL011_UART3_BASE 0x1c0c0000
201
Soby Mathew69817f72014-07-14 15:43:21 +0100202#define PL011_BAUDRATE 115200
203
204#define PL011_UART0_CLK_IN_HZ 24000000
205#define PL011_UART1_CLK_IN_HZ 24000000
206#define PL011_UART2_CLK_IN_HZ 24000000
207#define PL011_UART3_CLK_IN_HZ 24000000
208
Dan Handleyed6ff952014-05-14 17:44:19 +0100209/*******************************************************************************
210 * TrustZone address space controller related constants
211 ******************************************************************************/
212#define TZC400_BASE 0x2a4a0000
213
214/*
215 * The NSAIDs for this platform as used to program the TZC400.
216 */
217
218/* The FVP has 4 bits of NSAIDs. Used with TZC FAIL_ID (ACE Lite ID width) */
219#define FVP_AID_WIDTH 4
220
221/* NSAIDs used by devices in TZC filter 0 on FVP */
222#define FVP_NSAID_DEFAULT 0
223#define FVP_NSAID_PCI 1
224#define FVP_NSAID_VIRTIO 8 /* from FVP v5.6 onwards */
225#define FVP_NSAID_AP 9 /* Application Processors */
226#define FVP_NSAID_VIRTIO_OLD 15 /* until FVP v5.5 */
227
228/* NSAIDs used by devices in TZC filter 2 on FVP */
229#define FVP_NSAID_HDLCD0 2
230#define FVP_NSAID_CLCD 7
231
232
233#endif /* __FVP_DEF_H__ */