[6319] | 1 | /****************************************************/ |
---|
| 2 | /* */ |
---|
| 3 | /* Mango 802.11 Reference Design */ |
---|
| 4 | /* Linker script for CPU High on WARP v3 */ |
---|
| 5 | /* Copyright (c) 2017 Mango Communications, Inc. */ |
---|
| 6 | /* All rights reserved. */ |
---|
| 7 | /****************************************************/ |
---|
| 8 | |
---|
| 9 | _STACK_SIZE = DEFINED(_STACK_SIZE) ? _STACK_SIZE : 0x1000; |
---|
| 10 | _HEAP_SIZE = DEFINED(_HEAP_SIZE) ? _HEAP_SIZE : 0x2000; |
---|
| 11 | |
---|
| 12 | /* The I/DLMB for CPU High is implemented as two 128kB */ |
---|
| 13 | /* BRAM blocks. These blocks are mapped into continguous */ |
---|
| 14 | /* addresses for CPU High, allowing the linker to map */ |
---|
| 15 | /* sections into these memories as if it were a single */ |
---|
| 16 | /* memory block. The mb_high_ilmb MEMORY below represents */ |
---|
| 17 | /* the full 256kB logical I/DLMB memory area. */ |
---|
| 18 | |
---|
| 19 | MEMORY |
---|
| 20 | { |
---|
| 21 | mb_high_ilmb : ORIGIN = 0x00000050, LENGTH = 0x0003FFB0 |
---|
| 22 | pkt_buff_rx_bram : ORIGIN = 0x90000000, LENGTH = 0x00010000 |
---|
| 23 | pkt_buff_tx_bram : ORIGIN = 0x91000000, LENGTH = 0x00010000 |
---|
| 24 | mb_high_aux_bram : ORIGIN = 0xA0000000, LENGTH = 0x00010000 |
---|
| 25 | ddr3_sodimm : ORIGIN = 0xC0000000, LENGTH = 0x40000000 |
---|
| 26 | } |
---|
| 27 | |
---|
| 28 | /* Specify the default entry point to the program */ |
---|
| 29 | |
---|
| 30 | ENTRY(_start) |
---|
| 31 | |
---|
| 32 | /* Define the sections, and where they are mapped in memory */ |
---|
| 33 | |
---|
| 34 | SECTIONS |
---|
| 35 | { |
---|
| 36 | .vectors.reset 0x00000000 : { |
---|
| 37 | KEEP (*(.vectors.reset)) |
---|
| 38 | } |
---|
| 39 | |
---|
| 40 | .vectors.sw_exception 0x00000008 : { |
---|
| 41 | KEEP (*(.vectors.sw_exception)) |
---|
| 42 | } |
---|
| 43 | |
---|
| 44 | .vectors.interrupt 0x00000010 : { |
---|
| 45 | KEEP (*(.vectors.interrupt)) |
---|
| 46 | } |
---|
| 47 | |
---|
| 48 | .vectors.hw_exception 0x00000020 : { |
---|
| 49 | KEEP (*(.vectors.hw_exception)) |
---|
| 50 | } |
---|
| 51 | |
---|
| 52 | .text : { |
---|
| 53 | *(.text) |
---|
| 54 | *(.text.*) |
---|
| 55 | *(.gnu.linkonce.t.*) |
---|
| 56 | } > mb_high_ilmb |
---|
| 57 | |
---|
| 58 | /****************************************************************** |
---|
| 59 | * CPU High Linker Data in DDR |
---|
| 60 | * |
---|
| 61 | * Since on device BRAM is being used for many different things, it |
---|
| 62 | * becomes necessary to link data sections into DDR. The section |
---|
| 63 | * cpu_high_ddr_linker_data is used for this data. |
---|
| 64 | * |
---|
| 65 | * However, since this section is located in DDR, which cannot be |
---|
| 66 | * loaded by the SDK, we inlucde the (NOLOAD) directive for this |
---|
| 67 | * section. This means that the initial value of the section will be |
---|
| 68 | * random (ie whatever was last in DDR). |
---|
| 69 | * |
---|
| 70 | * If this section needs to be initialized, then the function |
---|
| 71 | * wlan_mac_high_cpu_linker_data_init() must be updated in |
---|
| 72 | * wlan_mac_high.c. |
---|
| 73 | * |
---|
| 74 | ******************************************************************/ |
---|
| 75 | |
---|
| 76 | .init : { |
---|
| 77 | KEEP (*(.init)) |
---|
| 78 | } > mb_high_ilmb |
---|
| 79 | |
---|
| 80 | .fini : { |
---|
| 81 | KEEP (*(.fini)) |
---|
| 82 | } > mb_high_ilmb |
---|
| 83 | |
---|
| 84 | .ctors : { |
---|
| 85 | __CTOR_LIST__ = .; |
---|
| 86 | ___CTORS_LIST___ = .; |
---|
| 87 | KEEP (*crtbegin.o(.ctors)) |
---|
| 88 | KEEP (*(EXCLUDE_FILE(*crtend.o) .ctors)) |
---|
| 89 | KEEP (*(SORT(.ctors.*))) |
---|
| 90 | KEEP (*(.ctors)) |
---|
| 91 | __CTOR_END__ = .; |
---|
| 92 | ___CTORS_END___ = .; |
---|
| 93 | } > mb_high_ilmb |
---|
| 94 | |
---|
| 95 | .dtors : { |
---|
| 96 | __DTOR_LIST__ = .; |
---|
| 97 | ___DTORS_LIST___ = .; |
---|
| 98 | KEEP (*crtbegin.o(.dtors)) |
---|
| 99 | KEEP (*(EXCLUDE_FILE(*crtend.o) .dtors)) |
---|
| 100 | KEEP (*(SORT(.dtors.*))) |
---|
| 101 | KEEP (*(.dtors)) |
---|
| 102 | PROVIDE(__DTOR_END__ = .); |
---|
| 103 | PROVIDE(___DTORS_END___ = .); |
---|
| 104 | } > mb_high_ilmb |
---|
| 105 | |
---|
| 106 | .rodata : { |
---|
| 107 | __rodata_start = .; |
---|
| 108 | *(.rodata) |
---|
| 109 | *(.rodata.*) |
---|
| 110 | *(.gnu.linkonce.r.*) |
---|
| 111 | __rodata_end = .; |
---|
| 112 | } > mb_high_ilmb |
---|
| 113 | |
---|
| 114 | .sdata2 : { |
---|
| 115 | . = ALIGN(8); |
---|
| 116 | __sdata2_start = .; |
---|
| 117 | *(.sdata2) |
---|
| 118 | *(.sdata2.*) |
---|
| 119 | *(.gnu.linkonce.s2.*) |
---|
| 120 | . = ALIGN(8); |
---|
| 121 | __sdata2_end = .; |
---|
| 122 | } > mb_high_ilmb |
---|
| 123 | |
---|
| 124 | .sbss2 : { |
---|
| 125 | __sbss2_start = .; |
---|
| 126 | *(.sbss2) |
---|
| 127 | *(.sbss2.*) |
---|
| 128 | *(.gnu.linkonce.sb2.*) |
---|
| 129 | __sbss2_end = .; |
---|
| 130 | } > mb_high_ilmb |
---|
| 131 | |
---|
| 132 | .data : { |
---|
| 133 | . = ALIGN(4); |
---|
| 134 | __data_start = .; |
---|
| 135 | *(.data) |
---|
| 136 | *(.data.*) |
---|
| 137 | *(.gnu.linkonce.d.*) |
---|
| 138 | __data_end = .; |
---|
| 139 | } > mb_high_ilmb |
---|
| 140 | |
---|
| 141 | .got : { |
---|
| 142 | *(.got) |
---|
| 143 | } > mb_high_ilmb |
---|
| 144 | |
---|
| 145 | .got1 : { |
---|
| 146 | *(.got1) |
---|
| 147 | } > mb_high_ilmb |
---|
| 148 | |
---|
| 149 | .got2 : { |
---|
| 150 | *(.got2) |
---|
| 151 | } > mb_high_ilmb |
---|
| 152 | |
---|
| 153 | .eh_frame : { |
---|
| 154 | *(.eh_frame) |
---|
| 155 | } > mb_high_ilmb |
---|
| 156 | |
---|
| 157 | .jcr : { |
---|
| 158 | *(.jcr) |
---|
| 159 | } > mb_high_ilmb |
---|
| 160 | |
---|
| 161 | .gcc_except_table : { |
---|
| 162 | *(.gcc_except_table) |
---|
| 163 | } > mb_high_ilmb |
---|
| 164 | |
---|
| 165 | .sdata : { |
---|
| 166 | . = ALIGN(8); |
---|
| 167 | __sdata_start = .; |
---|
| 168 | *(.sdata) |
---|
| 169 | *(.sdata.*) |
---|
| 170 | *(.gnu.linkonce.s.*) |
---|
| 171 | . += 16; /* fix for linker false error message */ |
---|
| 172 | __sdata_end = .; |
---|
| 173 | } > mb_high_ilmb |
---|
| 174 | |
---|
| 175 | .sbss (NOLOAD) : { |
---|
| 176 | . = ALIGN(4); |
---|
| 177 | __sbss_start = .; |
---|
| 178 | *(.sbss) |
---|
| 179 | *(.sbss.*) |
---|
| 180 | *(.gnu.linkonce.sb.*) |
---|
| 181 | . = ALIGN(8); |
---|
| 182 | __sbss_end = .; |
---|
| 183 | } > mb_high_ilmb |
---|
| 184 | |
---|
| 185 | .tdata : { |
---|
| 186 | __tdata_start = .; |
---|
| 187 | *(.tdata) |
---|
| 188 | *(.tdata.*) |
---|
| 189 | *(.gnu.linkonce.td.*) |
---|
| 190 | __tdata_end = .; |
---|
| 191 | } > mb_high_ilmb |
---|
| 192 | |
---|
| 193 | .tbss : { |
---|
| 194 | __tbss_start = .; |
---|
| 195 | *(.tbss) |
---|
| 196 | *(.tbss.*) |
---|
| 197 | *(.gnu.linkonce.tb.*) |
---|
| 198 | __tbss_end = .; |
---|
| 199 | } > mb_high_ilmb |
---|
| 200 | |
---|
| 201 | .bss (NOLOAD) : { |
---|
| 202 | . = ALIGN(4); |
---|
| 203 | __bss_start = .; |
---|
| 204 | *(.bss) |
---|
| 205 | *(.bss.*) |
---|
| 206 | *(.gnu.linkonce.b.*) |
---|
| 207 | *(COMMON) |
---|
| 208 | . = ALIGN(4); |
---|
| 209 | __bss_end = .; |
---|
| 210 | } > mb_high_ilmb |
---|
| 211 | |
---|
| 212 | _SDA_BASE_ = __sdata_start + ((__sbss_end - __sdata_start) / 2 ); |
---|
| 213 | |
---|
| 214 | _SDA2_BASE_ = __sdata2_start + ((__sbss2_end - __sdata2_start) / 2 ); |
---|
| 215 | |
---|
| 216 | /* Generate Stack and Heap definitions */ |
---|
| 217 | |
---|
| 218 | .heap (NOLOAD) : { |
---|
| 219 | . = ALIGN(8); |
---|
| 220 | _heap = .; |
---|
| 221 | _heap_start = .; |
---|
| 222 | . += _HEAP_SIZE; |
---|
| 223 | _heap_end = .; |
---|
| 224 | } > mb_high_ilmb |
---|
| 225 | |
---|
| 226 | .stack (NOLOAD) : { |
---|
| 227 | _stack_end = .; |
---|
| 228 | . += _STACK_SIZE; |
---|
| 229 | . = ALIGN(8); |
---|
| 230 | _stack = .; |
---|
| 231 | __stack = _stack; |
---|
| 232 | } > mb_high_ilmb |
---|
| 233 | |
---|
| 234 | _end = .; |
---|
| 235 | } |
---|
| 236 | |
---|