plat_default_def.h 3.64 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
/*
 * Copyright 2021 NXP
 *
 * SPDX-License-Identifier: BSD-3-Clause
 *
 */

#ifndef PLAT_DEFAULT_DEF_H
#define PLAT_DEFAULT_DEF_H

/*
 * Platform binary types for linking
 */
#ifdef __aarch64__
#define PLATFORM_LINKER_FORMAT          "elf64-littleaarch64"
#define PLATFORM_LINKER_ARCH            aarch64
#else
#define PLATFORM_LINKER_FORMAT          "elf32-littlearm"
#define PLATFORM_LINKER_ARCH            arm
#endif /* __aarch64__ */

#define LS_BL31_PLAT_PARAM_VAL		0x0f1e2d3c4b5a6978ULL

/* NXP Platforms have DRAM divided into banks.
 * DRAM0 Bank:	Maximum size of this bank is fixed to 2GB
 * DRAM1 Bank:	Greater than 2GB belongs to bank1 and size of bank1 varies from
 *		one platform to other platform.
 * DRAMn Bank:
 *
 * Except a few, all the platforms have 2GB size as DRAM0 BANK.
 * Hence common for all the platforms.
 * For platforms where DRAM0 Size is < 2GB, it is defined in platform_def.h
 */
#ifndef PLAT_DEF_DRAM0_SIZE
#define PLAT_DEF_DRAM0_SIZE	0x80000000	/*  2G */
#endif

/* This is common for all platforms where: */
#ifndef NXP_NS_DRAM_ADDR
#define NXP_NS_DRAM_ADDR	NXP_DRAM0_ADDR
#endif

/* 64M is reserved for Secure memory
 */
#ifndef NXP_SECURE_DRAM_SIZE
#define NXP_SECURE_DRAM_SIZE	(64 * 1024 * 1024)
#endif

/* 2M Secure EL1 Payload Shared Memory */
#ifndef NXP_SP_SHRD_DRAM_SIZE
#define NXP_SP_SHRD_DRAM_SIZE	(2 * 1024 * 1024)
#endif

#ifndef NXP_NS_DRAM_SIZE
/* Non secure memory */
#define NXP_NS_DRAM_SIZE	(PLAT_DEF_DRAM0_SIZE - \
				(NXP_SECURE_DRAM_SIZE + NXP_SP_SHRD_DRAM_SIZE))
#endif

#ifndef NXP_SECURE_DRAM_ADDR
#ifdef TEST_BL31
#define NXP_SECURE_DRAM_ADDR 0
#else
#define NXP_SECURE_DRAM_ADDR	(NXP_NS_DRAM_ADDR + PLAT_DEF_DRAM0_SIZE - \
				(NXP_SECURE_DRAM_SIZE  + NXP_SP_SHRD_DRAM_SIZE))
#endif
#endif

#ifndef NXP_SP_SHRD_DRAM_ADDR
#define NXP_SP_SHRD_DRAM_ADDR	(NXP_NS_DRAM_ADDR + PLAT_DEF_DRAM0_SIZE \
				- NXP_SP_SHRD_DRAM_SIZE)
#endif

#ifndef BL31_BASE
/* 2 MB reserved in secure memory for DDR */
#define BL31_BASE		NXP_SECURE_DRAM_ADDR
#endif

#ifndef BL31_SIZE
#define BL31_SIZE		(0x200000)
#endif

#ifndef BL31_LIMIT
#define BL31_LIMIT		(BL31_BASE + BL31_SIZE)
#endif

/* Put BL32 in secure memory */
#ifndef BL32_BASE
#define BL32_BASE		(NXP_SECURE_DRAM_ADDR + BL31_SIZE)
#endif

#ifndef BL32_LIMIT
#define BL32_LIMIT		(NXP_SECURE_DRAM_ADDR + \
				NXP_SECURE_DRAM_SIZE + NXP_SP_SHRD_DRAM_SIZE)
#endif

/* BL33 memory region */
/* Hardcoded based on current address in u-boot */
#ifndef BL33_BASE
#define BL33_BASE		0x82000000
#endif

#ifndef BL33_LIMIT
#define BL33_LIMIT		(NXP_NS_DRAM_ADDR + NXP_NS_DRAM_SIZE)
#endif

/*
 * FIP image defines - Offset at which FIP Image would be present
 * Image would include Bl31 , Bl33 and Bl32 (optional)
 */
#ifdef POLICY_FUSE_PROVISION
#ifndef FUSE_BUF
#define FUSE_BUF		ULL(0x81000000)
#endif

#ifndef FUSE_SZ
#define FUSE_SZ			0x80000
#endif
#endif

#ifndef MAX_FIP_DEVICES
#define MAX_FIP_DEVICES		2
#endif

#ifndef PLAT_FIP_OFFSET
#define PLAT_FIP_OFFSET		0x100000
#endif

#ifndef PLAT_FIP_MAX_SIZE
#define PLAT_FIP_MAX_SIZE	0x400000
#endif

/* Check if this size can be determined from array size */
#if defined(IMAGE_BL2)
#ifndef MAX_MMAP_REGIONS
#define MAX_MMAP_REGIONS	8
#endif
#ifndef MAX_XLAT_TABLES
#define MAX_XLAT_TABLES		6
#endif
#elif defined(IMAGE_BL31)
#ifndef MAX_MMAP_REGIONS
#define MAX_MMAP_REGIONS	9
#endif
#ifndef MAX_XLAT_TABLES
#define MAX_XLAT_TABLES		9
#endif
#elif defined(IMAGE_BL32)
#ifndef MAX_MMAP_REGIONS
#define MAX_MMAP_REGIONS	8
#endif
#ifndef MAX_XLAT_TABLES
#define MAX_XLAT_TABLES		9
#endif
#endif

/*
 * ID of the secure physical generic timer interrupt used by the BL32.
 */
#ifndef BL32_IRQ_SEC_PHY_TIMER
#define BL32_IRQ_SEC_PHY_TIMER	29
#endif

#endif	/*	PLAT_DEFAULT_DEF_H	*/