blob: 70f6b5b5a70b8ed77e046c274795b157c536887e [file] [log] [blame]
Dan Handley9df48042015-03-19 18:58:55 +00001/*
Yatharth Kocharf11b29a2016-02-01 11:04:46 +00002 * Copyright (c) 2015-2016, ARM Limited and Contributors. All rights reserved.
Dan Handley9df48042015-03-19 18:58:55 +00003 *
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#ifndef __BOARD_ARM_DEF_H__
31#define __BOARD_ARM_DEF_H__
32
33#include <v2m_def.h>
34
35
36/*
37 * Required platform porting definitions common to all ARM
38 * development platforms
39 */
40
41/* Size of cacheable stacks */
Soby Mathewc9bac9c2016-01-19 17:52:28 +000042#if IMAGE_BL1
Dan Handley9df48042015-03-19 18:58:55 +000043#if TRUSTED_BOARD_BOOT
44# define PLATFORM_STACK_SIZE 0x1000
45#else
46# define PLATFORM_STACK_SIZE 0x440
47#endif
48#elif IMAGE_BL2
49# if TRUSTED_BOARD_BOOT
50# define PLATFORM_STACK_SIZE 0x1000
51# else
52# define PLATFORM_STACK_SIZE 0x400
53# endif
Yatharth Kochar3a11eda2015-10-14 15:28:11 +010054#elif IMAGE_BL2U
55# define PLATFORM_STACK_SIZE 0x200
Dan Handley9df48042015-03-19 18:58:55 +000056#elif IMAGE_BL31
57# define PLATFORM_STACK_SIZE 0x400
58#elif IMAGE_BL32
59# define PLATFORM_STACK_SIZE 0x440
60#endif
61
62/*
63 * PLAT_ARM_MMAP_ENTRIES depends on the number of entries in the
64 * plat_arm_mmap array defined for each BL stage.
65 */
66#if IMAGE_BL1
Juan Castillo31a68f02015-04-14 12:49:03 +010067# if PLAT_fvp
Yatharth Kochar736a3bf2015-10-11 14:14:55 +010068# if TRUSTED_BOARD_BOOT
69# define PLAT_ARM_MMAP_ENTRIES 8
70# else
71# define PLAT_ARM_MMAP_ENTRIES 7
72# endif /* TRUSTED_BOARD_BOOT */
Juan Castillo31a68f02015-04-14 12:49:03 +010073# else
Yatharth Kochar736a3bf2015-10-11 14:14:55 +010074# if TRUSTED_BOARD_BOOT
75# define PLAT_ARM_MMAP_ENTRIES 7
76# else
77# define PLAT_ARM_MMAP_ENTRIES 6
78# endif /* TRUSTED_BOARD_BOOT */
79# endif /* PLAT_ */
Dan Handley9df48042015-03-19 18:58:55 +000080#endif
81#if IMAGE_BL2
Juan Castillo31a68f02015-04-14 12:49:03 +010082# if PLAT_fvp
83# define PLAT_ARM_MMAP_ENTRIES 9
84# else
85# define PLAT_ARM_MMAP_ENTRIES 8
86# endif
Dan Handley9df48042015-03-19 18:58:55 +000087#endif
Yatharth Kochar3a11eda2015-10-14 15:28:11 +010088#if IMAGE_BL2U
89# if PLAT_fvp
90# define PLAT_ARM_MMAP_ENTRIES 3
91# else
92# define PLAT_ARM_MMAP_ENTRIES 4
93#endif
94#endif
Dan Handley9df48042015-03-19 18:58:55 +000095#if IMAGE_BL31
Juan Castillo31a68f02015-04-14 12:49:03 +010096#define PLAT_ARM_MMAP_ENTRIES 5
Dan Handley9df48042015-03-19 18:58:55 +000097#endif
98#if IMAGE_BL32
Juan Castillo31a68f02015-04-14 12:49:03 +010099#define PLAT_ARM_MMAP_ENTRIES 4
Dan Handley9df48042015-03-19 18:58:55 +0000100#endif
101
102/*
103 * Platform specific page table and MMU setup constants
104 */
105#if IMAGE_BL1
Yatharth Kochar736a3bf2015-10-11 14:14:55 +0100106# if TRUSTED_BOARD_BOOT
107# define MAX_XLAT_TABLES 4
Dan Handley9df48042015-03-19 18:58:55 +0000108# else
Yatharth Kochar736a3bf2015-10-11 14:14:55 +0100109# if PLAT_juno
110# define MAX_XLAT_TABLES 2
111# else
112# define MAX_XLAT_TABLES 3
113# endif /* PLAT_ */
114# endif /* TRUSTED_BOARD_BOOT */
Dan Handley9df48042015-03-19 18:58:55 +0000115#elif IMAGE_BL2
Juan Castillo31a68f02015-04-14 12:49:03 +0100116# if PLAT_juno
117# define MAX_XLAT_TABLES 3
118# else
119# define MAX_XLAT_TABLES 4
120# endif /* PLAT_ */
Yatharth Kochar3a11eda2015-10-14 15:28:11 +0100121#elif IMAGE_BL2U
122# if PLAT_juno
123# define MAX_XLAT_TABLES 3
124# else
125# define MAX_XLAT_TABLES 4
126# endif /* PLAT_ */
Dan Handley9df48042015-03-19 18:58:55 +0000127#elif IMAGE_BL31
128# define MAX_XLAT_TABLES 2
129#elif IMAGE_BL32
130# if ARM_TSP_RAM_LOCATION_ID == ARM_DRAM_ID
131# define MAX_XLAT_TABLES 3
132# else
133# define MAX_XLAT_TABLES 2
134# endif
135#endif
136
137
138#define MAX_IO_DEVICES 3
139#define MAX_IO_HANDLES 4
140
141#define PLAT_ARM_TRUSTED_SRAM_SIZE 0x00040000 /* 256 KB */
142
143#define PLAT_ARM_FIP_BASE V2M_FLASH0_BASE
144#define PLAT_ARM_FIP_MAX_SIZE V2M_FLASH0_SIZE
145
Yatharth Kocharf11b29a2016-02-01 11:04:46 +0000146#define PLAT_ARM_NVM_BASE V2M_FLASH0_BASE
147#define PLAT_ARM_NVM_SIZE V2M_FLASH0_SIZE
148
Dan Handley9df48042015-03-19 18:58:55 +0000149
150#endif /* __BOARD_ARM_DEF_H__ */