]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/CORTEX_A5_SAMA5D2x_Xplained_IAR/AtmelFiles/target/sama5d2/toolchain/gnu/sram.ld
Add SAMA5D2 Xplained IAR demo.
[freertos] / FreeRTOS / Demo / CORTEX_A5_SAMA5D2x_Xplained_IAR / AtmelFiles / target / sama5d2 / toolchain / gnu / sram.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 SRAM on the SAMA5D2\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                 KEEP(*(.vectors .vectors.*))\r
64                 *(.textEntry)\r
65                 *(.text .text.* .gnu.linkonce.t.*)\r
66                 *(.glue_7t) *(.glue_7)\r
67                 *(.cp15_*)\r
68                 *(.rodata .rodata* .gnu.linkonce.r.*)\r
69                 *(.ARM.extab* .gnu.linkonce.armextab.*)\r
70 \r
71                 /* Support C constructors, and C destructors in both user code\r
72                    and the C library. This also provides support for C++ code. */\r
73                 . = ALIGN(4);\r
74                 KEEP(*(.init))\r
75                 . = ALIGN(4);\r
76                 __preinit_array_start = .;\r
77                 KEEP (*(.preinit_array))\r
78                 __preinit_array_end = .;\r
79 \r
80                 . = ALIGN(4);\r
81                 __init_array_start = .;\r
82                 KEEP (*(SORT(.init_array.*)))\r
83                 KEEP (*(.init_array))\r
84                 __init_array_end = .;\r
85 \r
86                 . = ALIGN(0x4);\r
87                 KEEP (*crtbegin.o(.ctors))\r
88                 KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))\r
89                 KEEP (*(SORT(.ctors.*)))\r
90                 KEEP (*crtend.o(.ctors))\r
91 \r
92                 . = ALIGN(4);\r
93                 KEEP(*(.fini))\r
94 \r
95                 . = ALIGN(4);\r
96                 __fini_array_start = .;\r
97                 KEEP (*(.fini_array))\r
98                 KEEP (*(SORT(.fini_array.*)))\r
99                 __fini_array_end = .;\r
100 \r
101                 KEEP (*crtbegin.o(.dtors))\r
102                 KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))\r
103                 KEEP (*(SORT(.dtors.*)))\r
104                 KEEP (*crtend.o(.dtors))\r
105                 *(.data .data.*);\r
106                 . = ALIGN(4);\r
107                 _efixed = .;            /* End of text section */\r
108 \r
109                 /* no relocation when running from sram */\r
110                 _srelocate = .;\r
111                 _erelocate = .;\r
112         } >sram\r
113 \r
114         /* .ARM.exidx is sorted, so has to go in its own output section.  */\r
115         PROVIDE_HIDDEN (__exidx_start = .);\r
116         .ARM.exidx :\r
117         {\r
118                 *(.ARM.exidx* .gnu.linkonce.armexidx.*)\r
119         } >sram\r
120         PROVIDE_HIDDEN (__exidx_end = .);\r
121 \r
122         . = ALIGN(4);\r
123         _etext = .;\r
124 \r
125         .region_sram (NOLOAD) :\r
126         {\r
127                 . = ALIGN(4);\r
128                 *(.region_sram)\r
129         } >sram\r
130 \r
131         .region_ddr (NOLOAD) :\r
132         {\r
133                 . = ALIGN(4);\r
134                 *(.region_ddr)\r
135         } >ddr\r
136 \r
137         .region_ddr_nocache (NOLOAD) :\r
138         {\r
139                 . = ALIGN(4);\r
140                 *(.region_ddr_nocache)\r
141         } >ddr_nocache\r
142 \r
143         /* .bss section which is used for uninitialized data */\r
144         .bss (NOLOAD) :\r
145         {\r
146                 . = ALIGN(4);\r
147                 _sbss = . ;\r
148                 _szero = .;\r
149                 *(.bss .bss.*)\r
150                 *(COMMON)\r
151                 . = ALIGN(4);\r
152                 _ebss = . ;\r
153                 _ezero = .;\r
154         } >sram\r
155 \r
156         .stack (NOLOAD) :\r
157         {\r
158                 __stack_start__ = . ;\r
159 \r
160                 . += IRQ_STACK_SIZE;\r
161                 . = ALIGN (4);\r
162                 _irqstack = . ;\r
163 \r
164                 . += FIQ_STACK_SIZE;\r
165                 . = ALIGN (4);\r
166                 _fiqstack = . ;\r
167 \r
168                 . += ABT_STACK_SIZE;\r
169                 . = ALIGN (4);\r
170                 _abtstack = . ;\r
171 \r
172                 . += UND_STACK_SIZE;\r
173                 . = ALIGN (4);\r
174                 _undstack = . ;\r
175 \r
176                 . += SYS_STACK_SIZE;\r
177                 . = ALIGN (4);\r
178                 _sysstack = . ;\r
179 \r
180                 . += C_STACK_SIZE;\r
181                 . = ALIGN (4);\r
182                 _cstack = . ;\r
183 \r
184                 . += HEAP_SIZE;\r
185                 . = ALIGN (4);\r
186                 _heap = . ;\r
187 \r
188                 __stack_end__ = .;\r
189         } >sram\r
190 \r
191         _end = . ;\r
192         __end = . ;\r
193         PROVIDE(end = .);\r
194 }\r