flash/nor: add support for TI MSP432 devices
[fw/openocd] / contrib / loaders / flash / msp432 / msp432p411x / msp432p411x.lds
1 /******************************************************************************
2 *
3 * Copyright (C) 2012-2018 Texas Instruments Incorporated - http://www.ti.com/
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 *
9 *  Redistributions of source code must retain the above copyright
10 *  notice, this list of conditions and the following disclaimer.
11 *
12 *  Redistributions in binary form must reproduce the above copyright
13 *  notice, this list of conditions and the following disclaimer in the
14 *  documentation and/or other materials provided with the
15 *  distribution.
16 *
17 *  Neither the name of Texas Instruments Incorporated nor the names of
18 *  its contributors may be used to endorse or promote products derived
19 *  from this software without specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 *
33 ******************************************************************************/
34
35 MEMORY {
36         MAIN_FLASH (RX) : ORIGIN = 0x00000000, LENGTH = 0x00200000
37         INFO_FLASH (RX) : ORIGIN = 0x00200000, LENGTH = 0x00008000
38         SRAM_CODE_0(RWX): ORIGIN = 0x01000000, LENGTH = 0x00000110
39         SRAM_CODE_1(RWX): ORIGIN = 0x01000110, LENGTH = 0x00000030
40         SRAM_CODE_2(RWX): ORIGIN = 0x01000150, LENGTH = 0x00000040
41         SRAM_CODE_3(RWX): ORIGIN = 0x01000190, LENGTH = 0x00001E70
42         SRAM_CODE_4(RWX): ORIGIN = 0x01002000, LENGTH = 0x00000200
43         SRAM_DATA  (RW) : ORIGIN = 0x20002000, LENGTH = 0x00001000
44 }
45
46 REGION_ALIAS("REGION_INTVECT", SRAM_CODE_0);
47 REGION_ALIAS("REGION_RESET", SRAM_CODE_1);
48 REGION_ALIAS("REGION_DESCRIPTOR", SRAM_CODE_2);
49 REGION_ALIAS("REGION_TEXT", SRAM_CODE_3);
50 REGION_ALIAS("REGION_BSS", SRAM_CODE_3);
51 REGION_ALIAS("REGION_DATA", SRAM_DATA);
52 REGION_ALIAS("REGION_STACK", SRAM_CODE_4);
53 REGION_ALIAS("REGION_HEAP", SRAM_DATA);
54 REGION_ALIAS("REGION_ARM_EXIDX", SRAM_CODE_3);
55 REGION_ALIAS("REGION_ARM_EXTAB", SRAM_CODE_3);
56
57 SECTIONS {
58         /* section for the interrupt vector area */
59         .intvecs : {
60                 KEEP (*(.intvecs))
61         } > REGION_INTVECT
62
63         PROVIDE (_vtable_base_address =
64                 DEFINED(_vtable_base_address) ? _vtable_base_address : 0x20000000);
65
66         .vtable (_vtable_base_address) : AT (_vtable_base_address) {
67                 KEEP (*(.vtable))
68         } > REGION_DATA
69
70         .descriptor :{
71                 FILL(0x00000000);
72                 . = ORIGIN(REGION_DESCRIPTOR) + LENGTH(REGION_DESCRIPTOR) - 1;
73                 BYTE(0x00);
74                 __ROM_AT = .;
75         } > REGION_DESCRIPTOR
76
77         .reset : {
78                 KEEP(*(.reset))
79         } > REGION_RESET AT> REGION_RESET
80
81         .text : {
82                 CREATE_OBJECT_SYMBOLS
83                 KEEP (*(.text))
84                 *(.text.*)
85                 . = ALIGN(0x4);
86                 KEEP (*(.ctors))
87                 . = ALIGN(0x4);
88                 KEEP (*(.dtors))
89                 . = ALIGN(0x4);
90                 __init_array_start = .;
91                 KEEP (*(.init_array*))
92                 __init_array_end = .;
93                 KEEP (*(.init))
94                 KEEP (*(.fini*))
95         } > REGION_TEXT AT> REGION_TEXT
96
97         .rodata : {
98                 *(.rodata)
99                 *(.rodata.*)
100         } > REGION_TEXT AT> REGION_TEXT
101
102         .ARM.exidx : {
103                 __exidx_start = .;
104                 *(.ARM.exidx* .gnu.linkonce.armexidx.*)
105                 __exidx_end = .;
106         } > REGION_ARM_EXIDX AT> REGION_ARM_EXIDX
107
108         .ARM.extab : {
109                 KEEP (*(.ARM.extab* .gnu.linkonce.armextab.*))
110         } > REGION_ARM_EXTAB AT> REGION_ARM_EXTAB
111
112         __etext = .;
113
114         .data : {
115                 __data_load__ = LOADADDR (.data);
116                 __data_start__ = .;
117                 KEEP (*(.data))
118                 KEEP (*(.data*))
119                 . = ALIGN (4);
120                 __data_end__ = .;
121         } > REGION_DATA AT> REGION_TEXT
122
123         .bss : {
124                 __bss_start__ = .;
125                 *(.shbss)
126                 KEEP (*(.bss))
127                 *(.bss.*)
128                 *(COMMON)
129                 . = ALIGN (4);
130                 __bss_end__ = .;
131         } > REGION_BSS AT> REGION_BSS
132
133         .heap : {
134                 __heap_start__ = .;
135                 end = __heap_start__;
136                 _end = end;
137                 __end = end;
138                 KEEP (*(.heap))
139                 __heap_end__ = .;
140                 __HeapLimit = __heap_end__;
141         } > REGION_HEAP AT> REGION_HEAP
142
143         .stack (NOLOAD) : ALIGN(0x8) {
144                 _stack = .;
145                 KEEP(*(.stack))
146         } > REGION_STACK AT> REGION_STACK
147
148         __stack_top = ORIGIN(REGION_STACK) + LENGTH(REGION_STACK);
149         PROVIDE(__stack = __stack_top);
150 }
151