xref: /arm-trusted-firmware/tools/renesas/rzg_layout_create/sa6.c (revision 91f16700b400a8c0651d24a598fc48ee2997a0d7)
1*91f16700Schasinglulu /*
2*91f16700Schasinglulu  * Copyright (c) 2020, Renesas Electronics Corporation. All rights reserved.
3*91f16700Schasinglulu  *
4*91f16700Schasinglulu  * SPDX-License-Identifier: BSD-3-Clause
5*91f16700Schasinglulu  */
6*91f16700Schasinglulu 
7*91f16700Schasinglulu #include <stdint.h>
8*91f16700Schasinglulu 
9*91f16700Schasinglulu #define RCAR_SA6_TYPE_QSPIFLASH		(0)
10*91f16700Schasinglulu #define RCAR_SA6_TYPE_EMMC		(1)
11*91f16700Schasinglulu 
12*91f16700Schasinglulu #if (RCAR_SA6_TYPE == RCAR_SA6_TYPE_QSPIFLASH)
13*91f16700Schasinglulu 
14*91f16700Schasinglulu /* Number of content cert for Non-secure Target Program(BL33x) */
15*91f16700Schasinglulu #define RCAR_IMAGE_NUM			(0x00000001U)
16*91f16700Schasinglulu /* Source address on flash for BL31 */
17*91f16700Schasinglulu #define RCAR_BL31SRC_ADDRESS		(0x001C0000U)
18*91f16700Schasinglulu /* Reserved */
19*91f16700Schasinglulu #define RCAR_BL31_PARTITION		(0x00000000U)
20*91f16700Schasinglulu /* Source address on flash for BL32 */
21*91f16700Schasinglulu #define RCAR_BL32SRC_ADDRESS		(0x00200000U)
22*91f16700Schasinglulu /* Reserved */
23*91f16700Schasinglulu #define RCAR_BL32_PARTITION		(0x00000000U)
24*91f16700Schasinglulu /* Source address on flash for BL33 */
25*91f16700Schasinglulu #define RCAR_BL33SRC_ADDRESS		(0x00300000U)
26*91f16700Schasinglulu /* Reserved */
27*91f16700Schasinglulu #define RCAR_BL33_PARTITION		(0x00000000U)
28*91f16700Schasinglulu #define RCAR_BL332SRC_ADDRESS		(0x00000000U)
29*91f16700Schasinglulu /* Reserved */
30*91f16700Schasinglulu #define RCAR_BL332_PARTITION		(0x00000000U)
31*91f16700Schasinglulu #define RCAR_BL333SRC_ADDRESS		(0x00000000U)
32*91f16700Schasinglulu /* Reserved */
33*91f16700Schasinglulu #define RCAR_BL333_PARTITION		(0x00000000U)
34*91f16700Schasinglulu #define RCAR_BL334SRC_ADDRESS		(0x00000000U)
35*91f16700Schasinglulu /* Reserved */
36*91f16700Schasinglulu #define RCAR_BL334_PARTITION		(0x00000000U)
37*91f16700Schasinglulu #define RCAR_BL335SRC_ADDRESS		(0x00000000U)
38*91f16700Schasinglulu /* Reserved */
39*91f16700Schasinglulu #define RCAR_BL335_PARTITION		(0x00000000U)
40*91f16700Schasinglulu #define RCAR_BL336SRC_ADDRESS		(0x00000000U)
41*91f16700Schasinglulu /* Reserved */
42*91f16700Schasinglulu #define RCAR_BL336_PARTITION		(0x00000000U)
43*91f16700Schasinglulu #define RCAR_BL337SRC_ADDRESS		(0x00000000U)
44*91f16700Schasinglulu /* Reserved */
45*91f16700Schasinglulu #define RCAR_BL337_PARTITION		(0x00000000U)
46*91f16700Schasinglulu #define RCAR_BL338SRC_ADDRESS		(0x00000000U)
47*91f16700Schasinglulu /* Reserved */
48*91f16700Schasinglulu #define RCAR_BL338_PARTITION		(0x00000000U)
49*91f16700Schasinglulu 
50*91f16700Schasinglulu #else /* RCAR_SA6_TYPE == RCAR_SA6_TYPE_EMMC */
51*91f16700Schasinglulu 
52*91f16700Schasinglulu /* Number of content cert for Non-secure Target Program(BL33x) */
53*91f16700Schasinglulu #define RCAR_IMAGE_NUM			(0x00000001U)
54*91f16700Schasinglulu /* Source address on eMMC for BL31 */
55*91f16700Schasinglulu #define RCAR_BL31SRC_ADDRESS		(0x00040000U)
56*91f16700Schasinglulu /* Source partition on eMMC for BL31 */
57*91f16700Schasinglulu #define RCAR_BL31_PARTITION		(0x00000001U)
58*91f16700Schasinglulu /* Source address on eMMC for BL32 */
59*91f16700Schasinglulu #define RCAR_BL32SRC_ADDRESS		(0x00200000U)
60*91f16700Schasinglulu /* Source partition on eMMC for BL32 */
61*91f16700Schasinglulu #define RCAR_BL32_PARTITION		(0x00000001U)
62*91f16700Schasinglulu /* Source address on eMMC for BL33 */
63*91f16700Schasinglulu #define RCAR_BL33SRC_ADDRESS		(0x00000000U)
64*91f16700Schasinglulu /* Source partition on eMMC for BL33 */
65*91f16700Schasinglulu #define RCAR_BL33_PARTITION		(0x00000002U)
66*91f16700Schasinglulu /* Reserved */
67*91f16700Schasinglulu #define RCAR_BL332SRC_ADDRESS		(0x00000000U)
68*91f16700Schasinglulu #define RCAR_BL332_PARTITION		(0x00000000U)
69*91f16700Schasinglulu /* Reserved */
70*91f16700Schasinglulu #define RCAR_BL333SRC_ADDRESS		(0x00000000U)
71*91f16700Schasinglulu #define RCAR_BL333_PARTITION		(0x00000000U)
72*91f16700Schasinglulu /* Reserved */
73*91f16700Schasinglulu #define RCAR_BL334SRC_ADDRESS		(0x00000000U)
74*91f16700Schasinglulu #define RCAR_BL334_PARTITION		(0x00000000U)
75*91f16700Schasinglulu /* Reserved */
76*91f16700Schasinglulu #define RCAR_BL335SRC_ADDRESS		(0x00000000U)
77*91f16700Schasinglulu #define RCAR_BL335_PARTITION		(0x00000000U)
78*91f16700Schasinglulu /* Reserved */
79*91f16700Schasinglulu #define RCAR_BL336SRC_ADDRESS		(0x00000000U)
80*91f16700Schasinglulu #define RCAR_BL336_PARTITION		(0x00000000U)
81*91f16700Schasinglulu /* Reserved */
82*91f16700Schasinglulu #define RCAR_BL337SRC_ADDRESS		(0x00000000U)
83*91f16700Schasinglulu #define RCAR_BL337_PARTITION		(0x00000000U)
84*91f16700Schasinglulu /* Reserved */
85*91f16700Schasinglulu #define RCAR_BL338SRC_ADDRESS		(0x00000000U)
86*91f16700Schasinglulu #define RCAR_BL338_PARTITION		(0x00000000U)
87*91f16700Schasinglulu 
88*91f16700Schasinglulu #endif /* RCAR_SA6_TYPE == RCAR_SA6_TYPE_QSPIFLASH */
89*91f16700Schasinglulu 
90*91f16700Schasinglulu /* Destination address for BL31 */
91*91f16700Schasinglulu #define RCAR_BL31DST_ADDRESS		(0x44000000U)
92*91f16700Schasinglulu #define RCAR_BL31DST_ADDRESSH		(0x00000000U)
93*91f16700Schasinglulu /* Destination size for BL31 */
94*91f16700Schasinglulu #define RCAR_BL31DST_SIZE		(0x00004000U)
95*91f16700Schasinglulu /* Destination address for BL32 */
96*91f16700Schasinglulu #define RCAR_BL32DST_ADDRESS		(0x44100000U)
97*91f16700Schasinglulu #define RCAR_BL32DST_ADDRESSH		(0x00000000U)
98*91f16700Schasinglulu /* Destination size for BL32 */
99*91f16700Schasinglulu #define RCAR_BL32DST_SIZE		(0x00040000U)
100*91f16700Schasinglulu /* Destination address for BL33 */
101*91f16700Schasinglulu #define RCAR_BL33DST_ADDRESS		(0x50000000U)
102*91f16700Schasinglulu #define RCAR_BL33DST_ADDRESSH		(0x00000000U)
103*91f16700Schasinglulu /* Destination size for BL33 */
104*91f16700Schasinglulu #define RCAR_BL33DST_SIZE		(0x00040000U)
105*91f16700Schasinglulu /* Reserved */
106*91f16700Schasinglulu #define RCAR_BL332DST_ADDRESS		(0x00000000U)
107*91f16700Schasinglulu #define RCAR_BL332DST_ADDRESSH		(0x00000000U)
108*91f16700Schasinglulu #define RCAR_BL332DST_SIZE		(0x00000000U)
109*91f16700Schasinglulu /* Reserved */
110*91f16700Schasinglulu #define RCAR_BL333DST_ADDRESS		(0x00000000U)
111*91f16700Schasinglulu #define RCAR_BL333DST_ADDRESSH		(0x00000000U)
112*91f16700Schasinglulu #define RCAR_BL333DST_SIZE		(0x00000000U)
113*91f16700Schasinglulu /* Reserved */
114*91f16700Schasinglulu #define RCAR_BL334DST_ADDRESS		(0x00000000U)
115*91f16700Schasinglulu #define RCAR_BL334DST_ADDRESSH		(0x00000000U)
116*91f16700Schasinglulu #define RCAR_BL334DST_SIZE		(0x00000000U)
117*91f16700Schasinglulu /* Reserved */
118*91f16700Schasinglulu #define RCAR_BL335DST_ADDRESS		(0x00000000U)
119*91f16700Schasinglulu #define RCAR_BL335DST_ADDRESSH		(0x00000000U)
120*91f16700Schasinglulu #define RCAR_BL335DST_SIZE		(0x00000000U)
121*91f16700Schasinglulu /* Reserved */
122*91f16700Schasinglulu #define RCAR_BL336DST_ADDRESS		(0x00000000U)
123*91f16700Schasinglulu #define RCAR_BL336DST_ADDRESSH		(0x00000000U)
124*91f16700Schasinglulu #define RCAR_BL336DST_SIZE		(0x00000000U)
125*91f16700Schasinglulu /* Reserved */
126*91f16700Schasinglulu #define RCAR_BL337DST_ADDRESS		(0x00000000U)
127*91f16700Schasinglulu #define RCAR_BL337DST_ADDRESSH		(0x00000000U)
128*91f16700Schasinglulu #define RCAR_BL337DST_SIZE		(0x00000000U)
129*91f16700Schasinglulu /* Reserved */
130*91f16700Schasinglulu #define RCAR_BL338DST_ADDRESS		(0x00000000U)
131*91f16700Schasinglulu #define RCAR_BL338DST_ADDRESSH		(0x00000000U)
132*91f16700Schasinglulu #define RCAR_BL338DST_SIZE		(0x00000000U)
133*91f16700Schasinglulu 
134*91f16700Schasinglulu /* SA6 */
135*91f16700Schasinglulu const uint64_t __attribute__ ((section(".sa6_image_num")))
136*91f16700Schasinglulu 				image_num	= RCAR_IMAGE_NUM;
137*91f16700Schasinglulu const uint64_t __attribute__ ((section(".sa6_bl31src_addr")))
138*91f16700Schasinglulu 				bl31src_addr	= RCAR_BL31SRC_ADDRESS;
139*91f16700Schasinglulu const uint64_t __attribute__ ((section(".sa6_bl31partition")))
140*91f16700Schasinglulu 				bl31partition	= RCAR_BL31_PARTITION;
141*91f16700Schasinglulu const uint64_t __attribute__ ((section(".sa6_bl32src_addr")))
142*91f16700Schasinglulu 				bl32src_addr	= RCAR_BL32SRC_ADDRESS;
143*91f16700Schasinglulu const uint64_t __attribute__ ((section(".sa6_bl32partition")))
144*91f16700Schasinglulu 				bl32partition	= RCAR_BL32_PARTITION;
145*91f16700Schasinglulu const uint64_t __attribute__ ((section(".sa6_bl33src_addr")))
146*91f16700Schasinglulu 				bl33src_addr	= RCAR_BL33SRC_ADDRESS;
147*91f16700Schasinglulu const uint64_t __attribute__ ((section(".sa6_bl33partition")))
148*91f16700Schasinglulu 				bl33partition	= RCAR_BL33_PARTITION;
149*91f16700Schasinglulu const uint64_t __attribute__ ((section(".sa6_bl332src_addr")))
150*91f16700Schasinglulu 				bl332src_addr	= RCAR_BL332SRC_ADDRESS;
151*91f16700Schasinglulu const uint64_t __attribute__ ((section(".sa6_bl332partition")))
152*91f16700Schasinglulu 				bl332partition	= RCAR_BL332_PARTITION;
153*91f16700Schasinglulu const uint64_t __attribute__ ((section(".sa6_bl333src_addr")))
154*91f16700Schasinglulu 				bl333src_addr	= RCAR_BL333SRC_ADDRESS;
155*91f16700Schasinglulu const uint64_t __attribute__ ((section(".sa6_bl333partition")))
156*91f16700Schasinglulu 				bl333partition	= RCAR_BL333_PARTITION;
157*91f16700Schasinglulu const uint64_t __attribute__ ((section(".sa6_bl334src_addr")))
158*91f16700Schasinglulu 				bl334src_addr	= RCAR_BL334SRC_ADDRESS;
159*91f16700Schasinglulu const uint64_t __attribute__ ((section(".sa6_bl334partition")))
160*91f16700Schasinglulu 				bl334partition	= RCAR_BL334_PARTITION;
161*91f16700Schasinglulu const uint64_t __attribute__ ((section(".sa6_bl335src_addr")))
162*91f16700Schasinglulu 				bl335src_addr	= RCAR_BL335SRC_ADDRESS;
163*91f16700Schasinglulu const uint64_t __attribute__ ((section(".sa6_bl335partition")))
164*91f16700Schasinglulu 				bl335partition	= RCAR_BL335_PARTITION;
165*91f16700Schasinglulu const uint64_t __attribute__ ((section(".sa6_bl336src_addr")))
166*91f16700Schasinglulu 				bl336src_addr	= RCAR_BL336SRC_ADDRESS;
167*91f16700Schasinglulu const uint64_t __attribute__ ((section(".sa6_bl336partition")))
168*91f16700Schasinglulu 				bl336partition	= RCAR_BL336_PARTITION;
169*91f16700Schasinglulu const uint64_t __attribute__ ((section(".sa6_bl337src_addr")))
170*91f16700Schasinglulu 				bl337src_addr	= RCAR_BL337SRC_ADDRESS;
171*91f16700Schasinglulu const uint64_t __attribute__ ((section(".sa6_bl337partition")))
172*91f16700Schasinglulu 				bl337partition	= RCAR_BL337_PARTITION;
173*91f16700Schasinglulu const uint64_t __attribute__ ((section(".sa6_bl338src_addr")))
174*91f16700Schasinglulu 				bl338src_addr	= RCAR_BL338SRC_ADDRESS;
175*91f16700Schasinglulu const uint64_t __attribute__ ((section(".sa6_bl338partition")))
176*91f16700Schasinglulu 				bl338partition	= RCAR_BL338_PARTITION;
177*91f16700Schasinglulu const uint32_t __attribute__ ((section(".sa6_bl31dst_addr")))
178*91f16700Schasinglulu 				bl31dst_addr	= RCAR_BL31DST_ADDRESS;
179*91f16700Schasinglulu const uint32_t __attribute__ ((section(".sa6_bl31dst_addrh")))
180*91f16700Schasinglulu 				bl31dst_addrh	= RCAR_BL31DST_ADDRESSH;
181*91f16700Schasinglulu const uint32_t __attribute__ ((section(".sa6_bl31dst_size")))
182*91f16700Schasinglulu 				bl31dst_size	= RCAR_BL31DST_SIZE;
183*91f16700Schasinglulu const uint32_t __attribute__ ((section(".sa6_bl32dst_addr")))
184*91f16700Schasinglulu 				bl32dst_addr	= RCAR_BL32DST_ADDRESS;
185*91f16700Schasinglulu const uint32_t __attribute__ ((section(".sa6_bl32dst_addrh")))
186*91f16700Schasinglulu 				bl32dst_addrh	= RCAR_BL32DST_ADDRESSH;
187*91f16700Schasinglulu const uint32_t __attribute__ ((section(".sa6_bl32dst_size")))
188*91f16700Schasinglulu 				bl32dst_size	= RCAR_BL32DST_SIZE;
189*91f16700Schasinglulu const uint32_t __attribute__ ((section(".sa6_bl33dst_addr")))
190*91f16700Schasinglulu 				bl33dst_addr	= RCAR_BL33DST_ADDRESS;
191*91f16700Schasinglulu const uint32_t __attribute__ ((section(".sa6_bl33dst_addrh")))
192*91f16700Schasinglulu 				bl33dst_addrh	= RCAR_BL33DST_ADDRESSH;
193*91f16700Schasinglulu const uint32_t __attribute__ ((section(".sa6_bl33dst_size")))
194*91f16700Schasinglulu 				bl33dst_size	= RCAR_BL33DST_SIZE;
195*91f16700Schasinglulu const uint32_t __attribute__ ((section(".sa6_bl332dst_addr")))
196*91f16700Schasinglulu 				bl332dst_addr	= RCAR_BL332DST_ADDRESS;
197*91f16700Schasinglulu const uint32_t __attribute__ ((section(".sa6_bl332dst_addrh")))
198*91f16700Schasinglulu 				bl332dst_addrh	= RCAR_BL332DST_ADDRESSH;
199*91f16700Schasinglulu const uint32_t __attribute__ ((section(".sa6_bl332dst_size")))
200*91f16700Schasinglulu 				bl332dst_size	= RCAR_BL332DST_SIZE;
201*91f16700Schasinglulu const uint32_t __attribute__ ((section(".sa6_bl333dst_addr")))
202*91f16700Schasinglulu 				bl333dst_addr	= RCAR_BL333DST_ADDRESS;
203*91f16700Schasinglulu const uint32_t __attribute__ ((section(".sa6_bl333dst_addrh")))
204*91f16700Schasinglulu 				bl333dst_addrh	= RCAR_BL333DST_ADDRESSH;
205*91f16700Schasinglulu const uint32_t __attribute__ ((section(".sa6_bl333dst_size")))
206*91f16700Schasinglulu 				bl333dst_size	= RCAR_BL333DST_SIZE;
207*91f16700Schasinglulu const uint32_t __attribute__ ((section(".sa6_bl334dst_addr")))
208*91f16700Schasinglulu 				bl334dst_addr	= RCAR_BL334DST_ADDRESS;
209*91f16700Schasinglulu const uint32_t __attribute__ ((section(".sa6_bl334dst_addrh")))
210*91f16700Schasinglulu 				bl334dst_addrh	= RCAR_BL334DST_ADDRESSH;
211*91f16700Schasinglulu const uint32_t __attribute__ ((section(".sa6_bl334dst_size")))
212*91f16700Schasinglulu 				bl334dst_size	= RCAR_BL334DST_SIZE;
213*91f16700Schasinglulu const uint32_t __attribute__ ((section(".sa6_bl335dst_addr")))
214*91f16700Schasinglulu 				bl335dst_addr	= RCAR_BL335DST_ADDRESS;
215*91f16700Schasinglulu const uint32_t __attribute__ ((section(".sa6_bl335dst_addrh")))
216*91f16700Schasinglulu 				bl335dst_addrh	= RCAR_BL335DST_ADDRESSH;
217*91f16700Schasinglulu const uint32_t __attribute__ ((section(".sa6_bl335dst_size")))
218*91f16700Schasinglulu 				bl335dst_size	= RCAR_BL335DST_SIZE;
219*91f16700Schasinglulu const uint32_t __attribute__ ((section(".sa6_bl336dst_addr")))
220*91f16700Schasinglulu 				bl336dst_addr	= RCAR_BL336DST_ADDRESS;
221*91f16700Schasinglulu const uint32_t __attribute__ ((section(".sa6_bl336dst_addrh")))
222*91f16700Schasinglulu 				bl336dst_addrh	= RCAR_BL336DST_ADDRESSH;
223*91f16700Schasinglulu const uint32_t __attribute__ ((section(".sa6_bl336dst_size")))
224*91f16700Schasinglulu 				bl336dst_size	= RCAR_BL336DST_SIZE;
225*91f16700Schasinglulu const uint32_t __attribute__ ((section(".sa6_bl337dst_addr")))
226*91f16700Schasinglulu 				bl337dst_addr	= RCAR_BL337DST_ADDRESS;
227*91f16700Schasinglulu const uint32_t __attribute__ ((section(".sa6_bl337dst_addrh")))
228*91f16700Schasinglulu 				bl337dst_addrh	= RCAR_BL337DST_ADDRESSH;
229*91f16700Schasinglulu const uint32_t __attribute__ ((section(".sa6_bl337dst_size")))
230*91f16700Schasinglulu 				bl337dst_size	= RCAR_BL337DST_SIZE;
231*91f16700Schasinglulu const uint32_t __attribute__ ((section(".sa6_bl338dst_addr")))
232*91f16700Schasinglulu 				bl338dst_addr	= RCAR_BL338DST_ADDRESS;
233*91f16700Schasinglulu const uint32_t __attribute__ ((section(".sa6_bl338dst_addrh")))
234*91f16700Schasinglulu 				bl338dst_addrh	= RCAR_BL338DST_ADDRESSH;
235*91f16700Schasinglulu const uint32_t __attribute__ ((section(".sa6_bl338dst_size")))
236*91f16700Schasinglulu 				bl338dst_size	= RCAR_BL338DST_SIZE;
237