]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/toolchain/gnu/ddram.ld
Add SAMA5D2 Xplained IAR demo.
[freertos] / FreeRTOS / Demo / CORTEX_A5_SAMA5D2x_Xplained_IAR / AtmelFiles / target / sama5d2 / toolchain / gnu / ddram.ld
1 /* ----------------------------------------------------------------------------\r
2  *         SAM Software Package License\r
3  * ----------------------------------------------------------------------------\r
4  * Copyright (c) 2015, Atmel Corporation\r
5  *\r
6  * All rights reserved.\r
7  *\r
8  * Redistribution and use in source and binary forms, with or without\r
9  * modification, are permitted provided that the following conditions are met:\r
10  *\r
11  * - Redistributions of source code must retain the above copyright notice,\r
12  * this list of conditions and the disclaimer below.\r
13  *\r
14  * Atmel's name may not be used to endorse or promote products derived from\r
15  * this software without specific prior written permission.\r
16  *\r
17  * DISCLAIMER: THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR\r
18  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\r
19  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE\r
20  * DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT, INDIRECT,\r
21  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\r
22  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,\r
23  * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\r
24  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\r
25  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\r
26  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
27  * ----------------------------------------------------------------------------\r
28  */\r
29 \r
30 /*------------------------------------------------------------------------------\r
31  *      Linker script for running in internal DDRAM on the SAMA5-MIURA\r
32  *----------------------------------------------------------------------------*/\r
33 \r
34 OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")\r
35 OUTPUT_ARCH(arm)\r
36 ENTRY(entry)\r
37 SEARCH_DIR(.)\r
38 \r
39 /* Memory Spaces Definitions */\r
40 MEMORY\r
41 {\r
42         sram        (W!RX) : ORIGIN = 0x200000,   LENGTH = 128K /* sram */\r
43         ddr         (W!RX) : ORIGIN = 0x20000000, LENGTH = 64M  /* ddr */\r
44         ddr_nocache  (RWX) : ORIGIN = 0x24000000, LENGTH = 16M  /* ddr (non-cached) */\r
45 }\r
46 \r
47 /* Sizes of the stacks used by the application. NOTE: you need to adjust */\r
48 C_STACK_SIZE   = 0x3000;\r
49 IRQ_STACK_SIZE = 0x60;\r
50 FIQ_STACK_SIZE = 0x60;\r
51 SYS_STACK_SIZE = 0x40;\r
52 ABT_STACK_SIZE = 0x40;\r
53 UND_STACK_SIZE = 0x40;\r
54 HEAP_SIZE      = 0x200;\r
55 \r
56 /* Section Definitions */\r
57 SECTIONS\r
58 {\r
59         .fixed0 :\r
60         {\r
61                 . = ALIGN(4);\r
62                 _sfixed = .;\r
63                 *(.textEntry)\r
64                 *(.text .text.* .gnu.linkonce.t.*)\r
65                 *(.glue_7t) *(.glue_7)\r
66                 *(.cp15_*)\r
67                 *(.rodata .rodata* .gnu.linkonce.r.*)\r
68                 *(.ARM.extab* .gnu.linkonce.armextab.*)\r
69 \r
70                 /* Support C constructors, and C destructors in both user code\r
71                    and the C library. This also provides support for C++ code. */\r
72                 . = ALIGN(4);\r
73                 KEEP(*(.init))\r
74                 . = ALIGN(4);\r
75                 __preinit_array_start = .;\r
76                 KEEP (*(.preinit_array))\r
77                 __preinit_array_end = .;\r
78 \r
79                 . = ALIGN(4);\r
80                 __init_array_start = .;\r
81                 KEEP (*(SORT(.init_array.*)))\r
82                 KEEP (*(.init_array))\r
83                 __init_array_end = .;\r
84 \r
85                 . = ALIGN(0x4);\r
86                 KEEP (*crtbegin.o(.ctors))\r
87                 KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))\r
88                 KEEP (*(SORT(.ctors.*)))\r
89                 KEEP (*crtend.o(.ctors))\r
90 \r
91                 . = ALIGN(4);\r
92                 KEEP(*(.fini))\r
93 \r
94                 . = ALIGN(4);\r
95                 __fini_array_start = .;\r
96                 KEEP (*(.fini_array))\r
97                 KEEP (*(SORT(.fini_array.*)))\r
98                 __fini_array_end = .;\r
99 \r
100                 KEEP (*crtbegin.o(.dtors))\r
101                 KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))\r
102                 KEEP (*(SORT(.dtors.*)))\r
103                 KEEP (*crtend.o(.dtors))\r
104                 *(.data .data.*);\r
105                 . = ALIGN(4);\r
106                 _efixed = .;            /* End of text section */\r
107         } >ddr\r
108 \r
109         /* .ARM.exidx is sorted, so has to go in its own output section.  */\r
110         PROVIDE_HIDDEN (__exidx_start = .);\r
111         .ARM.exidx :\r
112         {\r
113                 *(.ARM.exidx* .gnu.linkonce.armexidx.*)\r
114         } >ddr\r
115         PROVIDE_HIDDEN (__exidx_end = .);\r
116 \r
117         /* _etext must be just before .relocate section */\r
118         . = ALIGN(4);\r
119         _etext = .;\r
120 \r
121         .relocate :\r
122         {\r
123                 . = ALIGN(4);\r
124                 _srelocate = .;\r
125                 *(.vectors);\r
126                 *(.ramfunc)\r
127                 . = ALIGN(4);\r
128                 _erelocate = .;\r
129         } >sram AT>ddr\r
130 \r
131         .region_sram (NOLOAD) :\r
132         {\r
133                 . = ALIGN(4);\r
134                 *(.region_sram)\r
135         } >sram\r
136 \r
137         .region_ddr (NOLOAD) :\r
138         {\r
139                 . = ALIGN(4);\r
140                 *(.region_ddr)\r
141         } >ddr\r
142 \r
143         .region_ddr_nocache (NOLOAD) :\r
144         {\r
145                 . = ALIGN(4);\r
146                 *(.region_ddr_nocache)\r
147         } >ddr_nocache\r
148 \r
149         /* .bss section which is used for uninitialized data */\r
150         .bss (NOLOAD) :\r
151         {\r
152                 . = ALIGN(4);\r
153                 _sbss = . ;\r
154                 _szero = .;\r
155                 *(.bss .bss.*)\r
156                 *(COMMON)\r
157                 . = ALIGN(4);\r
158                 _ebss = . ;\r
159                 _ezero = .;\r
160         } >ddr\r
161 \r
162         .stack (NOLOAD) :\r
163         {\r
164                 __stack_start__ = . ;\r
165 \r
166                 . += IRQ_STACK_SIZE;\r
167                 . = ALIGN (4);\r
168                 _irqstack = . ;\r
169 \r
170                 . += FIQ_STACK_SIZE;\r
171                 . = ALIGN (4);\r
172                 _fiqstack = . ;\r
173 \r
174                 . += ABT_STACK_SIZE;\r
175                 . = ALIGN (4);\r
176                 _abtstack = . ;\r
177 \r
178                 . += UND_STACK_SIZE;\r
179                 . = ALIGN (4);\r
180                 _undstack = . ;\r
181 \r
182                 . += SYS_STACK_SIZE;\r
183                 . = ALIGN (4);\r
184                 _sysstack = . ;\r
185 \r
186                 . += C_STACK_SIZE;\r
187                 . = ALIGN (4);\r
188                 _cstack = . ;\r
189 \r
190                 . += HEAP_SIZE;\r
191                 . = ALIGN (4);\r
192                 _heap = . ;\r
193 \r
194                 __stack_end__ = .;\r
195         } >ddr\r
196 }\r