forked from SynthstromAudible/DelugeFirmware
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlinker_script_rz_a1l.ld
282 lines (249 loc) · 9.08 KB
/
linker_script_rz_a1l.ld
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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
/*
* Copyright © 2020-2023 Synthstrom Audible Limited
*
* This file is part of The Synthstrom Audible Deluge Firmware.
*
* The Synthstrom Audible Deluge Firmware is free software: you can redistribute it and/or modify it under the
* terms of the GNU General Public License as published by the Free Software Foundation,
* either version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with this program.
* If not, see <https://www.gnu.org/licenses/>.
*/
/*******************************************************************************
* DISCLAIMER
* This software is supplied by Renesas Electronics Corporation and is only
* intended for use with Renesas products. No other uses are authorized. This
* software is owned by Renesas Electronics Corporation and is protected under
* all applicable laws, including copyright laws.
* THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING
* THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT
* LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
* AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED.
* TO THE MAXIMUM EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS
* ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES SHALL BE LIABLE
* FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR
* ANY REASON RELATED TO THIS SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE
* BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
* Renesas reserves the right, without notice, to make changes to this software
* and to discontinue the availability of this software. By using this software,
* you agree to the additional terms and conditions found by accessing the
* following link:
* http://www.renesas.com/disclaimer
*
* Copyright (C) 2014 Renesas Electronics Corporation. All rights reserved.
*******************************************************************************/
/******************************************************************************
* File Name : GNU_e2studio-IRAM.ld
* Device(s) : RZ/A1H (R7S721001)
* Tool-Chain : GNUARM-NONEv14.02-EABI
* H/W Platform : RSK+RZA1H CPU Board
* Description : Linker file for projects that require to run from
* : Internal device RAM
******************************************************************************/
/******************************************************************************
* History : DD.MM.YYYY Version Description
* : 21.10.2014 1.00
******************************************************************************/
OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm")
OUTPUT_ARCH(arm)
ENTRY(start)
/* Base Address RAM Memory Table 10-Mbyte on-chip RAM */
/* Total RAM available 10112K */
MEMORY
{
/* Internal RAM address range H'2000_0000 to H'2001_FFFF is configured as data retention RAM */
/* Write access to this address range has to be enabled by writing to registers SYSCR1 and SYSCR2 */
RAM0L (rwx) : ORIGIN = 0x20020000, LENGTH = 0x000E0000 /* Page 0 Lower bank ( 896KB) H'20020000 to H'200FFFFF */
RAM1L (rwx) : ORIGIN = 0x20100000, LENGTH = 0x00100000 /* Page 1 Upper bank (1024KB) H'20100000 to H'201FFFFF */
RAM2L (rwx) : ORIGIN = 0x20200000, LENGTH = 0x00100000 /* Page 2 Upper bank (1024KB) H'20200000 to H'202FFFFF */
RAM3L (rwx) : ORIGIN = 0x20300000, LENGTH = 0x00100000 /* Page 3 Upper bank (1024KB) H'20300000 to H'203FFFFF */
RAM4L (rwx) : ORIGIN = 0x20400000, LENGTH = 0x00100000 /* Page 4 Upper bank (1024KB) H'20400000 to H'204FFFFF */
RAM0U (rwx) : ORIGIN = 0x20500000, LENGTH = 0x00100000 /* Page 0 Upper bank (1024KB) H'20500000 to H'205FFFFF */
RAM1U (rwx) : ORIGIN = 0x20600000, LENGTH = 0x00100000 /* Page 1 Upper bank (1024KB) H'20600000 to H'206FFFFF */
RAM2U (rwx) : ORIGIN = 0x20700000, LENGTH = 0x00100000 /* Page 2 Upper bank (1024KB) H'20700000 to H'207FFFFF */
RAM3U (rwx) : ORIGIN = 0x20800000, LENGTH = 0x00100000 /* Page 3 Upper bank (1024KB) H'20800000 to H'208FFFFF */
RAM4U (rwx) : ORIGIN = 0x20900000, LENGTH = 0x00100000 /* Page 4 Upper bank (1024KB) H'20900000 to H'209FFFFF */
SDRAM (rwx) : ORIGIN = 0x48000000, LENGTH = 0x02000000 /* SDRAM 32MB attached to CS2 H'08000000 to H'09FFFFFF */
RAM012L (rwx) : ORIGIN = 0x20020000, LENGTH = 0x002E0000
RAM01234L (rwx) : ORIGIN = 0x20020000, LENGTH = 0x007E0000
RAM012U (rwx) : ORIGIN = 0x20500000, LENGTH = 0x00300000
ROM (rw) : ORIGIN = 0x18000000, LENGTH = 0x02000000 /* SPI ROM attached to H'18000000 to H'19FFFFFF */
VRAM (rw) : ORIGIN = 0x60300000, LENGTH = 0x00700000
}
PROGRAM_STACK_SIZE = 0x8000; /* Application stack */
IRQ_STACK_SIZE = 0x2000; /* IRQ mode stack */
FIQ_STACK_SIZE = 0x2000; /* FRQ mode stack */
SVC_STACK_SIZE = 0x2000; /* SVC mode stack */
ABT_STACK_SIZE = 0x2000; /* ABT mode stack */
TTB_SIZE = 0x8000; /* Level-1 Translation Table for MMU */
INTERNAL_RAM_START = 0x20020000;
INTERNAL_RAM_END = 0x20300000;
SECTIONS
{
/* L1 translation table must be aligned to 16KB Boundary! */
/* Please refer to Cortex-A Series Version: 4.0 Programmer’s Guide, */
/* section 9.4 First level address translation */
.ttb_mmu1 INTERNAL_RAM_START : ALIGN(0x4000)
{
ttb_mmu1_base = .;
. += TTB_SIZE;
. = ALIGN(0x4);
ttb_mmu1_end = .;
} >RAM012L
.irq_stack :
{
irq_stack_start = .;
. += IRQ_STACK_SIZE;
. = ALIGN(0x4);
irq_stack_end = .;
fiq_stack_start = .;
. += FIQ_STACK_SIZE;
. = ALIGN(0x4);
fiq_stack_end = .;
svc_stack_start = .;
. += SVC_STACK_SIZE;
. = ALIGN(0x4);
svc_stack_end = .;
abt_stack_start = .;
. += ABT_STACK_SIZE;
. = ALIGN(0x4);
abt_stack_end = .;
} >RAM012L
.bss (NOLOAD) :
{
_bss = .;
PROVIDE(__bss_start__ = .);
*(.bss)
*(.bss.**)
*(COMMON)
. = ALIGN(0x4);
PROVIDE(__bss_end__ = .);
_ebss = .;
} >RAM012L
/* ALIGN(0x20) is only necessary for v0 bootloaders */
.reset : ALIGN(0x20) /* 0x10 isn't enough. Not sure why any of this is necessary though. */
{
execute = .;
*start.S.obj (.text)
*start.S.obj (.rodata)
*start.S.obj (.data)
*access.S.obj (.text)
*access.S.obj (.rodata)
*access.S.obj (.data)
*initsct.S.obj (.text)
*initsct.S.obj (.rodata)
*initsct.S.obj (.data)
*reset_handler.S.obj (.text)
*reset_handler.S.obj (.rodata)
*reset_handler.S.obj (.data)
*ttb_init.S.obj (.text)
*ttb_init.S.obj (.rodata)
*ttb_init.S.obj (.data)
. = ALIGN(0x4);
_stext = .;
*(.text)
*(.text*)
*(.text.startup)
_etext = .;
address_end_reset = .;
} > RAM012L
.rodata :
{
. = ALIGN(0x4);
*(.rodata)
*(.rodata*)
*(.glue_7) /* stubs generated by gcc to glue ARM7 code calling Thumb code */
*(.glue_7t) /* stubs generated by gcc to glue Thumb code calling ARM7 code */
KEEP(*(.init))
KEEP(*(.fini))
. = ALIGN(0x4);
} > RAM012L
.preinit_array :
{
PROVIDE_HIDDEN(__preinit_array_start = .);
KEEP(*(.preinit_array*))
PROVIDE_HIDDEN(__preinit_array_end = .);
} > RAM012L
.init_array :
{
PROVIDE_HIDDEN(__init_array_start = .);
KEEP(*(SORT(.init_array*)))
KEEP(*(.init_array*))
PROVIDE_HIDDEN(__init_array_end = .);
} > RAM012L
.fini_array :
{
PROVIDE_HIDDEN(__fini_array_start = .);
KEEP(*(.fini_array*))
KEEP(*(SORT(.fini_array*)))
PROVIDE_HIDDEN(__fini_array_end = .);
} > RAM012L
/* See http://embdev.net/topic/282936 */
.ARM.exidx : {
PROVIDE_HIDDEN(__exidx_start = .);
*(.ARM.exidx*)
*(.gnu.linkonce.armexidx.*)
PROVIDE_HIDDEN(__exidx_end = .);
} > RAM012L
.data :
{
. = ALIGN(0x8);
address_start_data_ROM = .;
_data = .;
_sdata = .;
*(.data)
*(.data*)
*(.igot.plt)
*(.got.plt)
*(.got)
. = ALIGN(0x8);
address_end_data_ROM = .;
_edata = .;
} > RAM012L
.tors :
{
__CTOR_LIST__ = .;
. = ALIGN(2);
__ctors = .;
*(.ctors)
__ctors_end = .;
__CTOR_END__ = .;
__DTOR_LIST__ = .;
___dtors = .;
*(.dtors)
___dtors_end = .;
__DTOR_END__ = .;
. = ALIGN(2);
_mdata = .;
} > RAM012L
. = ALIGN(4);
/* End of user data. Heap starts from here */
end = .;
_end = .;
/* For more information see: rdimon's libgloss/arm/syscall.c @ _sbrk */
/* See also: https://ww1.microchip.com/downloads/en/DeviceDoc/Frequently-Asked-Questions-4.9.3.26.txt point 12 */
.heap (NOLOAD) :
{
. = ALIGN(4);
PROVIDE(__heap_start__ = .);
PROVIDE(__heap_start = .);
PROVIDE(_nl_heap_start = .);
KEEP(*(.heap))
. = ALIGN(0x4);
PROVIDE(__heap_end__ = .);
PROVIDE(__heap_end = .);
PROVIDE(_nl_heap_end = .);
} > RAM012L
.program_stack (INTERNAL_RAM_END - PROGRAM_STACK_SIZE) :
{
program_stack_start = .;
. += PROGRAM_STACK_SIZE;
. = ALIGN(0x4);
program_stack_end = .;
} >RAM012L
}