|
| 1 | +/**************************************************************************** |
| 2 | + * boards/arm/s32k3xx/mr-canhubk3/scripts/sram.ld |
| 3 | + * |
| 4 | + * SPDX-License-Identifier: Apache-2.0 |
| 5 | + * |
| 6 | + * Licensed to the Apache Software Foundation (ASF) under one or more |
| 7 | + * contributor license agreements. See the NOTICE file distributed with |
| 8 | + * this work for additional information regarding copyright ownership. The |
| 9 | + * ASF licenses this file to you under the Apache License, Version 2.0 (the |
| 10 | + * "License"); you may not use this file except in compliance with the |
| 11 | + * License. You may obtain a copy of the License at |
| 12 | + * |
| 13 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 14 | + * |
| 15 | + * Unless required by applicable law or agreed to in writing, software |
| 16 | + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 17 | + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 18 | + * License for the specific language governing permissions and limitations |
| 19 | + * under the License. |
| 20 | + * |
| 21 | + ****************************************************************************/ |
| 22 | + |
| 23 | +/* Copyright 2022 NXP */ |
| 24 | + |
| 25 | +/* Linker script for NXP MR-CANHUBK3 when running from internal SRAM. |
| 26 | + * |
| 27 | + * 0x20400000 - 0x20443fff 272K SRAM (all sections placed here) |
| 28 | + * Flash/BOOT_HEADER kept in MEMORY only for FLASH_* symbol compatibility. |
| 29 | + */ |
| 30 | + |
| 31 | +MEMORY |
| 32 | +{ |
| 33 | + BOOT_HEADER (R) : ORIGIN = 0x00400000, LENGTH = 0x00001000 |
| 34 | + flash (rx) : ORIGIN = 0x00401000, LENGTH = 0x003cffff |
| 35 | + sram0_stdby (rwx) : ORIGIN = 0x20400000, LENGTH = 32K |
| 36 | + sram (rwx) : ORIGIN = 0x20400000, LENGTH = 272K |
| 37 | + itcm (rwx) : ORIGIN = 0x00000000, LENGTH = 64K |
| 38 | + dtcm (rwx) : ORIGIN = 0x20000000, LENGTH = 128K |
| 39 | +} |
| 40 | + |
| 41 | +OUTPUT_ARCH(arm) |
| 42 | +EXTERN(_vectors) |
| 43 | +ENTRY(_stext) |
| 44 | + |
| 45 | +SECTIONS |
| 46 | +{ |
| 47 | + |
| 48 | + .text : |
| 49 | + { |
| 50 | + _stext = ABSOLUTE(.); |
| 51 | + *(.vectors) |
| 52 | + *(.text.__start) |
| 53 | + *(.text .text.*) |
| 54 | + *(.fixup) |
| 55 | + *(.gnu.warning) |
| 56 | + *(.rodata .rodata.*) |
| 57 | + *(.gnu.linkonce.t.*) |
| 58 | + *(.glue_7) |
| 59 | + *(.glue_7t) |
| 60 | + *(.got) |
| 61 | + *(.gcc_except_table) |
| 62 | + *(.gnu.linkonce.r.*) |
| 63 | + _etext = ABSOLUTE(.); |
| 64 | + } > sram |
| 65 | + |
| 66 | + .init_section : |
| 67 | + { |
| 68 | + _sinit = ABSOLUTE(.); |
| 69 | + KEEP(*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*))) |
| 70 | + KEEP(*(.init_array EXCLUDE_FILE(*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o) .ctors)) |
| 71 | + _einit = ABSOLUTE(.); |
| 72 | + } > sram |
| 73 | + |
| 74 | + .ARM.extab : |
| 75 | + { |
| 76 | + *(.ARM.extab*) |
| 77 | + } > sram |
| 78 | + |
| 79 | + .ARM.exidx : |
| 80 | + { |
| 81 | + __exidx_start = ABSOLUTE(.); |
| 82 | + *(.ARM.exidx*) |
| 83 | + __exidx_end = ABSOLUTE(.); |
| 84 | + } > sram |
| 85 | + |
| 86 | + /* Due ECC initialization sequence __data_start__ and __data_end__ should be aligned on 8 bytes */ |
| 87 | + .data : |
| 88 | + { |
| 89 | + . = ALIGN(8); |
| 90 | + _sdata = ABSOLUTE(.); |
| 91 | + *(.data .data.*) |
| 92 | + *(.gnu.linkonce.d.*) |
| 93 | + CONSTRUCTORS |
| 94 | + . = ALIGN(8); |
| 95 | + _edata = ABSOLUTE(.); |
| 96 | + } > sram |
| 97 | + |
| 98 | + .ramfunc ALIGN(8): |
| 99 | + { |
| 100 | + _sramfuncs = ABSOLUTE(.); |
| 101 | + *(.ramfunc .ramfunc.*) |
| 102 | + _eramfuncs = ABSOLUTE(.); |
| 103 | + } > sram |
| 104 | + |
| 105 | + _framfuncs = LOADADDR(.ramfunc); |
| 106 | + |
| 107 | + /* Due ECC initialization sequence __bss_start__ and __bss_end__ should be aligned on 8 bytes */ |
| 108 | + .bss : |
| 109 | + { |
| 110 | + . = ALIGN(8); |
| 111 | + _sbss = ABSOLUTE(.); |
| 112 | + *(.bss .bss.*) |
| 113 | + *(.gnu.linkonce.b.*) |
| 114 | + *(COMMON) |
| 115 | + . = ALIGN(8); |
| 116 | + _ebss = ABSOLUTE(.); |
| 117 | + } > sram |
| 118 | + |
| 119 | + CM7_0_START_ADDRESS = ORIGIN(sram); |
| 120 | + |
| 121 | + /* Stabs debugging sections. */ |
| 122 | + |
| 123 | + .stab 0 : { *(.stab) } |
| 124 | + .stabstr 0 : { *(.stabstr) } |
| 125 | + .stab.excl 0 : { *(.stab.excl) } |
| 126 | + .stab.exclstr 0 : { *(.stab.exclstr) } |
| 127 | + .stab.index 0 : { *(.stab.index) } |
| 128 | + .stab.indexstr 0 : { *(.stab.indexstr) } |
| 129 | + .comment 0 : { *(.comment) } |
| 130 | + .debug_abbrev 0 : { *(.debug_abbrev) } |
| 131 | + .debug_info 0 : { *(.debug_info) } |
| 132 | + .debug_line 0 : { *(.debug_line) } |
| 133 | + .debug_pubnames 0 : { *(.debug_pubnames) } |
| 134 | + .debug_aranges 0 : { *(.debug_aranges) } |
| 135 | + |
| 136 | + SRAM_BASE_ADDR = ORIGIN(sram); |
| 137 | + SRAM_END_ADDR = ORIGIN(sram) + LENGTH(sram); |
| 138 | + SRAM_STDBY_BASE_ADDR = ORIGIN(sram0_stdby); |
| 139 | + SRAM_STDBY_END_ADDR = ORIGIN(sram0_stdby) + LENGTH(sram0_stdby); |
| 140 | + SRAM_INIT_END_ADDR = ORIGIN(sram) + 320K; |
| 141 | + ITCM_BASE_ADDR = ORIGIN(itcm); |
| 142 | + ITCM_END_ADDR = ORIGIN(itcm) + LENGTH(itcm); |
| 143 | + DTCM_BASE_ADDR = ORIGIN(dtcm); |
| 144 | + DTCM_END_ADDR = ORIGIN(dtcm) + LENGTH(dtcm); |
| 145 | + FLASH_BASE_ADDR = ORIGIN(BOOT_HEADER); |
| 146 | + FLASH_END_ADDR = ORIGIN(flash) + LENGTH(flash); |
| 147 | +} |
0 commit comments