blob: 36a3b33aa2a728dbf7df87011e27a39637ab698f [file] [log] [blame]
Achin Gupta4f6ad662013-10-25 09:08:21 +01001/*
Dan Handleye83b0ca2014-01-14 18:17:09 +00002 * Copyright (c) 2013-2014, ARM Limited and Contributors. All rights reserved.
Achin Gupta4f6ad662013-10-25 09:08:21 +01003 *
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 __PLATFORM_H__
32#define __PLATFORM_H__
33
34#include <arch.h>
Vikram Kanigiri96377452014-04-24 11:02:16 +010035#include <bl_common.h>
Achin Gupta4f6ad662013-10-25 09:08:21 +010036
37
38/*******************************************************************************
39 * Platform binary types for linking
40 ******************************************************************************/
41#define PLATFORM_LINKER_FORMAT "elf64-littleaarch64"
42#define PLATFORM_LINKER_ARCH aarch64
43
44/*******************************************************************************
45 * Generic platform constants
46 ******************************************************************************/
Andrew Thoelke65668f92014-03-20 10:48:23 +000047
48/* Size of cacheable stacks */
49#define PLATFORM_STACK_SIZE 0x800
50
51/* Size of coherent stacks for debug and release builds */
52#if DEBUG
53#define PCPU_DV_MEM_STACK_SIZE 0x400
54#else
55#define PCPU_DV_MEM_STACK_SIZE 0x300
56#endif
Achin Gupta4f6ad662013-10-25 09:08:21 +010057
58#define FIRMWARE_WELCOME_STR "Booting trusted firmware boot loader stage 1\n\r"
Harry Liebel561cd332014-02-14 14:42:48 +000059
60/* Trusted Boot Firmware BL2 */
Achin Gupta4f6ad662013-10-25 09:08:21 +010061#define BL2_IMAGE_NAME "bl2.bin"
Achin Guptae4d084e2014-02-19 17:18:23 +000062
Harry Liebel561cd332014-02-14 14:42:48 +000063/* EL3 Runtime Firmware BL31 */
Achin Guptae4d084e2014-02-19 17:18:23 +000064#define BL31_IMAGE_NAME "bl31.bin"
65
Harry Liebel561cd332014-02-14 14:42:48 +000066/* Secure Payload BL32 (Trusted OS) */
Achin Guptae4d084e2014-02-19 17:18:23 +000067#define BL32_IMAGE_NAME "bl32.bin"
68
Harry Liebel561cd332014-02-14 14:42:48 +000069/* Non-Trusted Firmware BL33 and its load address */
Achin Guptae4d084e2014-02-19 17:18:23 +000070#define BL33_IMAGE_NAME "bl33.bin" /* e.g. UEFI */
Juan Castillo7055ca42014-05-16 15:33:15 +010071#define NS_IMAGE_OFFSET (DRAM1_BASE + 0x8000000) /* DRAM + 128MB */
Achin Guptae4d084e2014-02-19 17:18:23 +000072
Harry Liebel561cd332014-02-14 14:42:48 +000073/* Firmware Image Package */
74#define FIP_IMAGE_NAME "fip.bin"
75
Achin Gupta4f6ad662013-10-25 09:08:21 +010076#define PLATFORM_CACHE_LINE_SIZE 64
77#define PLATFORM_CLUSTER_COUNT 2ull
78#define PLATFORM_CLUSTER0_CORE_COUNT 4
79#define PLATFORM_CLUSTER1_CORE_COUNT 4
Ian Spray84687392014-01-02 16:57:12 +000080#define PLATFORM_CORE_COUNT (PLATFORM_CLUSTER1_CORE_COUNT + \
81 PLATFORM_CLUSTER0_CORE_COUNT)
Achin Gupta4f6ad662013-10-25 09:08:21 +010082#define PLATFORM_MAX_CPUS_PER_CLUSTER 4
83#define PRIMARY_CPU 0x0
Harry Liebel561cd332014-02-14 14:42:48 +000084#define MAX_IO_DEVICES 3
James Morrisseyf2f9bb52014-02-10 16:18:59 +000085#define MAX_IO_HANDLES 4
Achin Gupta4f6ad662013-10-25 09:08:21 +010086
87/* Constants for accessing platform configuration */
88#define CONFIG_GICD_ADDR 0
89#define CONFIG_GICC_ADDR 1
90#define CONFIG_GICH_ADDR 2
91#define CONFIG_GICV_ADDR 3
92#define CONFIG_MAX_AFF0 4
93#define CONFIG_MAX_AFF1 5
94/* Indicate whether the CPUECTLR SMP bit should be enabled. */
95#define CONFIG_CPU_SETUP 6
96#define CONFIG_BASE_MMAP 7
Harry Liebel30affd52013-10-30 17:41:48 +000097/* Indicates whether CCI should be enabled on the platform. */
98#define CONFIG_HAS_CCI 8
Harry Liebelcef93392014-04-01 19:27:38 +010099#define CONFIG_HAS_TZC 9
100#define CONFIG_LIMIT 10
Achin Gupta4f6ad662013-10-25 09:08:21 +0100101
102/*******************************************************************************
103 * Platform memory map related constants
104 ******************************************************************************/
105#define TZROM_BASE 0x00000000
106#define TZROM_SIZE 0x04000000
107
108#define TZRAM_BASE 0x04000000
109#define TZRAM_SIZE 0x40000
110
111#define FLASH0_BASE 0x08000000
112#define FLASH0_SIZE TZROM_SIZE
113
114#define FLASH1_BASE 0x0c000000
115#define FLASH1_SIZE 0x04000000
116
117#define PSRAM_BASE 0x14000000
118#define PSRAM_SIZE 0x04000000
119
120#define VRAM_BASE 0x18000000
121#define VRAM_SIZE 0x02000000
122
123/* Aggregate of all devices in the first GB */
124#define DEVICE0_BASE 0x1a000000
125#define DEVICE0_SIZE 0x12200000
126
127#define DEVICE1_BASE 0x2f000000
128#define DEVICE1_SIZE 0x200000
129
130#define NSRAM_BASE 0x2e000000
131#define NSRAM_SIZE 0x10000
132
133/* Location of trusted dram on the base fvp */
134#define TZDRAM_BASE 0x06000000
135#define TZDRAM_SIZE 0x02000000
136#define MBOX_OFF 0x1000
Achin Gupta4f6ad662013-10-25 09:08:21 +0100137
Vikram Kanigirida567432014-04-15 18:08:08 +0100138/* Base address where parameters to BL31 are stored */
139#define PARAMS_BASE TZDRAM_BASE
140
141
Juan Castillo7055ca42014-05-16 15:33:15 +0100142#define DRAM1_BASE 0x80000000ull
143#define DRAM1_SIZE 0x80000000ull
144#define DRAM1_END (DRAM1_BASE + DRAM1_SIZE - 1)
145#define DRAM1_SEC_SIZE 0x01000000ull
146
147#define DRAM_BASE DRAM1_BASE
148#define DRAM_SIZE DRAM1_SIZE
149
150#define DRAM2_BASE 0x880000000ull
151#define DRAM2_SIZE 0x780000000ull
152#define DRAM2_END (DRAM2_BASE + DRAM2_SIZE - 1)
Achin Gupta4f6ad662013-10-25 09:08:21 +0100153
154#define PCIE_EXP_BASE 0x40000000
155#define TZRNG_BASE 0x7fe60000
156#define TZNVCTR_BASE 0x7fe70000
157#define TZROOTKEY_BASE 0x7fe80000
158
159/* Memory mapped Generic timer interfaces */
160#define SYS_CNTCTL_BASE 0x2a430000
161#define SYS_CNTREAD_BASE 0x2a800000
162#define SYS_TIMCTL_BASE 0x2a810000
163
164/* Counter timer module offsets */
165#define CNTNSAR 0x4
166#define CNTNSAR_NS_SHIFT(x) x
167
168#define CNTACR_BASE(x) (0x40 + (x << 2))
169#define CNTACR_RPCT_SHIFT 0x0
170#define CNTACR_RVCT_SHIFT 0x1
171#define CNTACR_RFRQ_SHIFT 0x2
172#define CNTACR_RVOFF_SHIFT 0x3
173#define CNTACR_RWVT_SHIFT 0x4
174#define CNTACR_RWPT_SHIFT 0x5
175
176/* V2M motherboard system registers & offsets */
177#define VE_SYSREGS_BASE 0x1c010000
178#define V2M_SYS_ID 0x0
179#define V2M_SYS_LED 0x8
180#define V2M_SYS_CFGDATA 0xa0
181#define V2M_SYS_CFGCTRL 0xa4
182
183/*
184 * V2M sysled bit definitions. The values written to this
185 * register are defined in arch.h & runtime_svc.h. Only
186 * used by the primary cpu to diagnose any cold boot issues.
187 *
188 * SYS_LED[0] - Security state (S=0/NS=1)
189 * SYS_LED[2:1] - Exception Level (EL3-EL0)
190 * SYS_LED[7:3] - Exception Class (Sync/Async & origin)
191 *
192 */
193#define SYS_LED_SS_SHIFT 0x0
194#define SYS_LED_EL_SHIFT 0x1
195#define SYS_LED_EC_SHIFT 0x3
196
197#define SYS_LED_SS_MASK 0x1
198#define SYS_LED_EL_MASK 0x3
199#define SYS_LED_EC_MASK 0x1f
200
201/* V2M sysid register bits */
202#define SYS_ID_REV_SHIFT 27
203#define SYS_ID_HBI_SHIFT 16
204#define SYS_ID_BLD_SHIFT 12
205#define SYS_ID_ARCH_SHIFT 8
206#define SYS_ID_FPGA_SHIFT 0
207
208#define SYS_ID_REV_MASK 0xf
209#define SYS_ID_HBI_MASK 0xfff
210#define SYS_ID_BLD_MASK 0xf
211#define SYS_ID_ARCH_MASK 0xf
212#define SYS_ID_FPGA_MASK 0xff
213
214#define SYS_ID_BLD_LENGTH 4
215
216#define REV_FVP 0x0
217#define HBI_FVP_BASE 0x020
218#define HBI_FOUNDATION 0x010
219
220#define BLD_GIC_VE_MMAP 0x0
221#define BLD_GIC_A53A57_MMAP 0x1
222
223#define ARCH_MODEL 0x1
224
225/* FVP Power controller base address*/
226#define PWRC_BASE 0x1c100000
227
228/*******************************************************************************
229 * Platform specific per affinity states. Distinction between off and suspend
230 * is made to allow reporting of a suspended cpu as still being on e.g. in the
231 * affinity_info psci call.
232 ******************************************************************************/
233#define PLATFORM_MAX_AFF0 4
234#define PLATFORM_MAX_AFF1 2
235#define PLAT_AFF_UNK 0xff
236
237#define PLAT_AFF0_OFF 0x0
238#define PLAT_AFF0_ONPENDING 0x1
239#define PLAT_AFF0_SUSPEND 0x2
240#define PLAT_AFF0_ON 0x3
241
242#define PLAT_AFF1_OFF 0x0
243#define PLAT_AFF1_ONPENDING 0x1
244#define PLAT_AFF1_SUSPEND 0x2
245#define PLAT_AFF1_ON 0x3
246
247/*******************************************************************************
Sandrine Bailleuxf7488062014-05-22 15:21:35 +0100248 * BL1 specific defines.
Sandrine Bailleux6c8b3592014-05-22 15:28:26 +0100249 * BL1 RW data is relocated from ROM to RAM at runtime so we need 2 sets of
Sandrine Bailleuxf7488062014-05-22 15:21:35 +0100250 * addresses.
251 ******************************************************************************/
252#define BL1_RO_BASE TZROM_BASE
Sandrine Bailleux6c8b3592014-05-22 15:28:26 +0100253#define BL1_RO_LIMIT (TZROM_BASE + TZROM_SIZE)
Sandrine Bailleuxf7488062014-05-22 15:21:35 +0100254#define BL1_RW_BASE TZRAM_BASE
Sandrine Bailleux6c8b3592014-05-22 15:28:26 +0100255#define BL1_RW_LIMIT BL31_BASE
Sandrine Bailleuxf7488062014-05-22 15:21:35 +0100256
257/*******************************************************************************
Achin Gupta4f6ad662013-10-25 09:08:21 +0100258 * BL2 specific defines.
259 ******************************************************************************/
Sandrine Bailleuxe701e302014-05-20 17:28:25 +0100260#define BL2_BASE (TZRAM_BASE + TZRAM_SIZE - 0xc000)
Sandrine Bailleux6c8b3592014-05-22 15:28:26 +0100261#define BL2_LIMIT (TZRAM_BASE + TZRAM_SIZE)
Achin Gupta4f6ad662013-10-25 09:08:21 +0100262
263/*******************************************************************************
264 * BL31 specific defines.
265 ******************************************************************************/
Sandrine Bailleuxe701e302014-05-20 17:28:25 +0100266#define BL31_BASE (TZRAM_BASE + 0x6000)
Sandrine Bailleux6c8b3592014-05-22 15:28:26 +0100267#if TSP_RAM_LOCATION_ID == TSP_IN_TZRAM
268#define BL31_LIMIT BL32_BASE
269#elif TSP_RAM_LOCATION_ID == TSP_IN_TZDRAM
270#define BL31_LIMIT BL2_BASE
271#endif
Achin Gupta4f6ad662013-10-25 09:08:21 +0100272
273/*******************************************************************************
Achin Guptaa3050ed2014-02-19 17:52:35 +0000274 * BL32 specific defines.
275 ******************************************************************************/
Sandrine Bailleuxe701e302014-05-20 17:28:25 +0100276/*
277 * On FVP, the TSP can execute either from Trusted SRAM or Trusted DRAM.
278 */
279#define TSP_IN_TZRAM 0
280#define TSP_IN_TZDRAM 1
281
282#if TSP_RAM_LOCATION_ID == TSP_IN_TZRAM
283# define TSP_SEC_MEM_BASE TZRAM_BASE
284# define TSP_SEC_MEM_SIZE TZRAM_SIZE
285# define BL32_BASE (TZRAM_BASE + TZRAM_SIZE - 0x1c000)
286# define BL32_LIMIT BL2_BASE
287#elif TSP_RAM_LOCATION_ID == TSP_IN_TZDRAM
288# define TSP_SEC_MEM_BASE TZDRAM_BASE
289# define TSP_SEC_MEM_SIZE TZDRAM_SIZE
290# define BL32_BASE (TZDRAM_BASE + 0x2000)
291# define BL32_LIMIT (TZDRAM_BASE + (1 << 21))
292#else
293# error "Unsupported TSP_RAM_LOCATION_ID value"
294#endif
Achin Guptaa3050ed2014-02-19 17:52:35 +0000295
296/*******************************************************************************
Achin Gupta4f6ad662013-10-25 09:08:21 +0100297 * Platform specific page table and MMU setup constants
298 ******************************************************************************/
Achin Gupta4f6ad662013-10-25 09:08:21 +0100299#define ADDR_SPACE_SIZE (1ull << 32)
Jon Medhurstb1eb0932014-02-26 16:27:53 +0000300#define MAX_XLAT_TABLES 3
301#define MAX_MMAP_REGIONS 16
Achin Gupta4f6ad662013-10-25 09:08:21 +0100302
Achin Gupta4f6ad662013-10-25 09:08:21 +0100303
304/*******************************************************************************
305 * CCI-400 related constants
306 ******************************************************************************/
307#define CCI400_BASE 0x2c090000
308#define CCI400_SL_IFACE_CLUSTER0 3
309#define CCI400_SL_IFACE_CLUSTER1 4
310#define CCI400_SL_IFACE_INDEX(mpidr) (mpidr & MPIDR_CLUSTER_MASK ? \
311 CCI400_SL_IFACE_CLUSTER1 : \
312 CCI400_SL_IFACE_CLUSTER0)
313
314/*******************************************************************************
315 * GIC-400 & interrupt handling related constants
316 ******************************************************************************/
317/* VE compatible GIC memory map */
318#define VE_GICD_BASE 0x2c001000
319#define VE_GICC_BASE 0x2c002000
320#define VE_GICH_BASE 0x2c004000
321#define VE_GICV_BASE 0x2c006000
322
323/* Base FVP compatible GIC memory map */
324#define BASE_GICD_BASE 0x2f000000
325#define BASE_GICR_BASE 0x2f100000
326#define BASE_GICC_BASE 0x2c000000
327#define BASE_GICH_BASE 0x2c010000
328#define BASE_GICV_BASE 0x2c02f000
329
330#define IRQ_TZ_WDOG 56
331#define IRQ_SEC_PHY_TIMER 29
332#define IRQ_SEC_SGI_0 8
333#define IRQ_SEC_SGI_1 9
334#define IRQ_SEC_SGI_2 10
335#define IRQ_SEC_SGI_3 11
336#define IRQ_SEC_SGI_4 12
337#define IRQ_SEC_SGI_5 13
338#define IRQ_SEC_SGI_6 14
339#define IRQ_SEC_SGI_7 15
340#define IRQ_SEC_SGI_8 16
341
342/*******************************************************************************
343 * PL011 related constants
344 ******************************************************************************/
Achin Gupta8aa0cd42014-02-09 13:47:08 +0000345#define PL011_UART0_BASE 0x1c090000
346#define PL011_UART1_BASE 0x1c0a0000
347#define PL011_UART2_BASE 0x1c0b0000
348#define PL011_UART3_BASE 0x1c0c0000
Achin Gupta4f6ad662013-10-25 09:08:21 +0100349
Harry Liebelcef93392014-04-01 19:27:38 +0100350
351/*******************************************************************************
352 * TrustZone address space controller related constants
353 ******************************************************************************/
354#define TZC400_BASE 0x2a4a0000
355
356/*
357 * The NSAIDs for this platform as used to program the TZC400.
Harry Liebelcef93392014-04-01 19:27:38 +0100358 */
359
360/* The FVP has 4 bits of NSAIDs. Used with TZC FAIL_ID (ACE Lite ID width) */
361#define FVP_AID_WIDTH 4
Andrew Thoelkefe3374b2014-05-09 15:36:13 +0100362
363/* NSAIDs used by devices in TZC filter 0 on FVP */
Harry Liebelcef93392014-04-01 19:27:38 +0100364#define FVP_NSAID_DEFAULT 0
Andrew Thoelkefe3374b2014-05-09 15:36:13 +0100365#define FVP_NSAID_PCI 1
366#define FVP_NSAID_VIRTIO 8 /* from FVP v5.6 onwards */
Harry Liebelcef93392014-04-01 19:27:38 +0100367#define FVP_NSAID_AP 9 /* Application Processors */
Andrew Thoelkefe3374b2014-05-09 15:36:13 +0100368#define FVP_NSAID_VIRTIO_OLD 15 /* until FVP v5.5 */
Harry Liebelcef93392014-04-01 19:27:38 +0100369
Andrew Thoelkefe3374b2014-05-09 15:36:13 +0100370/* NSAIDs used by devices in TZC filter 2 on FVP */
371#define FVP_NSAID_HDLCD0 2
372#define FVP_NSAID_CLCD 7
Harry Liebelcef93392014-04-01 19:27:38 +0100373
374
Achin Gupta4f6ad662013-10-25 09:08:21 +0100375/*******************************************************************************
376 * Declarations and constants to access the mailboxes safely. Each mailbox is
377 * aligned on the biggest cache line size in the platform. This is known only
378 * to the platform as it might have a combination of integrated and external
379 * caches. Such alignment ensures that two maiboxes do not sit on the same cache
380 * line at any cache level. They could belong to different cpus/clusters &
381 * get written while being protected by different locks causing corruption of
382 * a valid mailbox address.
383 ******************************************************************************/
384#define CACHE_WRITEBACK_SHIFT 6
385#define CACHE_WRITEBACK_GRANULE (1 << CACHE_WRITEBACK_SHIFT)
386
387#ifndef __ASSEMBLY__
388
Dan Handley2bd4ef22014-04-09 13:14:54 +0100389#include <stdint.h>
Vikram Kanigirida567432014-04-15 18:08:08 +0100390#include <bl_common.h>
Dan Handley2bd4ef22014-04-09 13:14:54 +0100391
Dan Handleye2712bc2014-04-10 15:37:22 +0100392typedef volatile struct mailbox {
Achin Gupta4f6ad662013-10-25 09:08:21 +0100393 unsigned long value
394 __attribute__((__aligned__(CACHE_WRITEBACK_GRANULE)));
Dan Handleye2712bc2014-04-10 15:37:22 +0100395} mailbox_t;
Achin Gupta4f6ad662013-10-25 09:08:21 +0100396
397/*******************************************************************************
Dan Handley2bd4ef22014-04-09 13:14:54 +0100398 * Forward declarations
399 ******************************************************************************/
400struct plat_pm_ops;
401struct meminfo;
Vikram Kanigirida567432014-04-15 18:08:08 +0100402struct bl31_params;
Vikram Kanigirida567432014-04-15 18:08:08 +0100403struct image_info;
404struct entry_point_info;
405
406
407/*******************************************************************************
408 * This structure represents the superset of information that is passed to
409 * BL31 e.g. while passing control to it from BL2 which is bl31_params
Vikram Kanigirid8c9d262014-05-16 18:48:12 +0100410 * and another platform specific params
Vikram Kanigirida567432014-04-15 18:08:08 +0100411 ******************************************************************************/
412typedef struct bl2_to_bl31_params_mem {
413 struct bl31_params bl31_params;
Vikram Kanigirida567432014-04-15 18:08:08 +0100414 struct image_info bl31_image_info;
415 struct image_info bl32_image_info;
416 struct image_info bl33_image_info;
417 struct entry_point_info bl33_ep_info;
418 struct entry_point_info bl32_ep_info;
419 struct entry_point_info bl31_ep_info;
420} bl2_to_bl31_params_mem_t;
421
Dan Handley2bd4ef22014-04-09 13:14:54 +0100422
423/*******************************************************************************
Achin Gupta4f6ad662013-10-25 09:08:21 +0100424 * Function and variable prototypes
425 ******************************************************************************/
Dan Handleya17fefa2014-05-14 12:38:32 +0100426unsigned long *bl1_normal_ram_base;
427unsigned long *bl1_normal_ram_len;
428unsigned long *bl1_normal_ram_limit;
429unsigned long *bl1_normal_ram_zi_base;
430unsigned long *bl1_normal_ram_zi_len;
Achin Gupta4f6ad662013-10-25 09:08:21 +0100431
Dan Handleya17fefa2014-05-14 12:38:32 +0100432unsigned long *bl1_coherent_ram_base;
433unsigned long *bl1_coherent_ram_len;
434unsigned long *bl1_coherent_ram_limit;
435unsigned long *bl1_coherent_ram_zi_base;
436unsigned long *bl1_coherent_ram_zi_len;
437unsigned long warm_boot_entrypoint;
Achin Gupta4f6ad662013-10-25 09:08:21 +0100438
Dan Handleya17fefa2014-05-14 12:38:32 +0100439void bl1_plat_arch_setup(void);
440void bl2_plat_arch_setup(void);
441void bl31_plat_arch_setup(void);
442int platform_setup_pm(const struct plat_pm_ops **);
443unsigned int platform_get_core_pos(unsigned long mpidr);
444void enable_mmu_el1(void);
445void enable_mmu_el3(void);
446void configure_mmu_el1(unsigned long total_base,
447 unsigned long total_size,
448 unsigned long ro_start,
449 unsigned long ro_limit,
450 unsigned long coh_start,
451 unsigned long coh_limit);
452void configure_mmu_el3(unsigned long total_base,
453 unsigned long total_size,
454 unsigned long ro_start,
455 unsigned long ro_limit,
456 unsigned long coh_start,
457 unsigned long coh_limit);
458unsigned long platform_get_cfgvar(unsigned int);
459int platform_config_setup(void);
460void plat_report_exception(unsigned long);
461unsigned long plat_get_ns_image_entrypoint(void);
462unsigned long platform_get_stack(unsigned long mpidr);
463uint64_t plat_get_syscnt_freq(void);
Vikram Kanigiri96377452014-04-24 11:02:16 +0100464#if RESET_TO_BL31
Dan Handleya17fefa2014-05-14 12:38:32 +0100465void plat_get_entry_point_info(unsigned long target_security,
466 el_change_info_t *target_entry_info);
Vikram Kanigiri96377452014-04-24 11:02:16 +0100467#endif
Dan Handleya17fefa2014-05-14 12:38:32 +0100468void fvp_cci_setup(void);
Achin Gupta4f6ad662013-10-25 09:08:21 +0100469
Achin Gupta02d36282014-05-04 19:02:52 +0100470/* Declarations for plat_gic.c */
Dan Handleya17fefa2014-05-14 12:38:32 +0100471uint32_t ic_get_pending_interrupt_id(void);
472uint32_t ic_get_pending_interrupt_type(void);
473uint32_t ic_acknowledge_interrupt(void);
474uint32_t ic_get_interrupt_type(uint32_t id);
475void ic_end_of_interrupt(uint32_t id);
476void gic_cpuif_deactivate(unsigned int);
477void gic_cpuif_setup(unsigned int);
478void gic_pcpu_distif_setup(unsigned int);
479void gic_setup(void);
480uint32_t plat_interrupt_type_to_line(uint32_t type,
Achin Gupta191e86e2014-05-09 10:03:15 +0100481 uint32_t security_state);
Ian Spray84687392014-01-02 16:57:12 +0000482
Achin Gupta02d36282014-05-04 19:02:52 +0100483/* Declarations for plat_topology.c */
Dan Handleya17fefa2014-05-14 12:38:32 +0100484int plat_setup_topology(void);
485int plat_get_max_afflvl(void);
486unsigned int plat_get_aff_count(unsigned int, unsigned long);
487unsigned int plat_get_aff_state(unsigned int, unsigned long);
Achin Gupta4f6ad662013-10-25 09:08:21 +0100488
James Morrissey9d72b4e2014-02-10 17:04:32 +0000489/* Declarations for plat_io_storage.c */
Dan Handleya17fefa2014-05-14 12:38:32 +0100490void io_setup(void);
491int plat_get_image_source(const char *image_name,
492 uintptr_t *dev_handle,
493 uintptr_t *image_spec);
James Morrissey9d72b4e2014-02-10 17:04:32 +0000494
Harry Liebelcef93392014-04-01 19:27:38 +0100495/* Declarations for plat_security.c */
Dan Handleya17fefa2014-05-14 12:38:32 +0100496void plat_security_setup(void);
Harry Liebelcef93392014-04-01 19:27:38 +0100497
Vikram Kanigirida567432014-04-15 18:08:08 +0100498/*
499 * Before calling this function BL2 is loaded in memory and its entrypoint
500 * is set by load_image. This is a placeholder for the platform to change
501 * the entrypoint of BL2 and set SPSR and security state.
502 * On FVP we are only setting the security state, entrypoint
503 */
Dan Handleya17fefa2014-05-14 12:38:32 +0100504void bl1_plat_set_bl2_ep_info(struct image_info *image,
505 struct entry_point_info *ep);
Vikram Kanigirida567432014-04-15 18:08:08 +0100506
507/*
508 * Before calling this function BL31 is loaded in memory and its entrypoint
509 * is set by load_image. This is a placeholder for the platform to change
510 * the entrypoint of BL31 and set SPSR and security state.
511 * On FVP we are only setting the security state, entrypoint
512 */
Dan Handleya17fefa2014-05-14 12:38:32 +0100513void bl2_plat_set_bl31_ep_info(struct image_info *image,
514 struct entry_point_info *ep);
Vikram Kanigirida567432014-04-15 18:08:08 +0100515
516/*
517 * Before calling this function BL32 is loaded in memory and its entrypoint
518 * is set by load_image. This is a placeholder for the platform to change
519 * the entrypoint of BL32 and set SPSR and security state.
520 * On FVP we are only setting the security state, entrypoint
521 */
Dan Handleya17fefa2014-05-14 12:38:32 +0100522void bl2_plat_set_bl32_ep_info(struct image_info *image,
523 struct entry_point_info *ep);
Vikram Kanigirida567432014-04-15 18:08:08 +0100524
525/*
526 * Before calling this function BL33 is loaded in memory and its entrypoint
527 * is set by load_image. This is a placeholder for the platform to change
528 * the entrypoint of BL33 and set SPSR and security state.
529 * On FVP we are only setting the security state, entrypoint
530 */
Dan Handleya17fefa2014-05-14 12:38:32 +0100531void bl2_plat_set_bl33_ep_info(struct image_info *image,
532 struct entry_point_info *ep);
Vikram Kanigirida567432014-04-15 18:08:08 +0100533
Vikram Kanigirid8c9d262014-05-16 18:48:12 +0100534/* Gets the memory layout for BL32 */
Dan Handleya17fefa2014-05-14 12:38:32 +0100535void bl2_plat_get_bl32_meminfo(struct meminfo *mem_info);
Vikram Kanigirid8c9d262014-05-16 18:48:12 +0100536
537/* Gets the memory layout for BL33 */
Dan Handleya17fefa2014-05-14 12:38:32 +0100538void bl2_plat_get_bl33_meminfo(struct meminfo *mem_info);
Vikram Kanigirid8c9d262014-05-16 18:48:12 +0100539
Vikram Kanigiri96377452014-04-24 11:02:16 +0100540/* Sets the entrypoint for BL32 */
Dan Handleya17fefa2014-05-14 12:38:32 +0100541void fvp_set_bl32_ep_info(struct entry_point_info *bl32_ep_info);
Vikram Kanigiri96377452014-04-24 11:02:16 +0100542
543/* Sets the entrypoint for BL33 */
Dan Handleya17fefa2014-05-14 12:38:32 +0100544void fvp_set_bl33_ep_info(struct entry_point_info *bl33_ep_info);
Vikram Kanigiri96377452014-04-24 11:02:16 +0100545
Harry Liebelcef93392014-04-01 19:27:38 +0100546
Achin Gupta4f6ad662013-10-25 09:08:21 +0100547#endif /*__ASSEMBLY__*/
548
549#endif /* __PLATFORM_H__ */