aboutsummaryrefslogtreecommitdiff
path: root/platform/ext/target/arm/mps2/an521/iar/mps2_an521_bl2.icf
blob: c336ef5a2283af973d5f875f77b13798f091ffbc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/*
 * Copyright (c) 2020 Arm Limited
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 *
 * This file is derivative of ../armclang/mps2_an521_bl2.sct
 */

/* Linker script to configure memory regions. */
/* This file will be run trough the pre-processor. */

#include "region_defs.h"

do not initialize  { section .noinit };
initialize by copy { readwrite };

define block ER_CODE        with fixed order, alignment = 8 {
       section .intvec,
       readonly
       };
define block LR_CODE with fixed order, maximum size = BL2_CODE_SIZE {block ER_CODE};
place at address BL2_CODE_START {block LR_CODE};

define block TFM_SHARED_DATA with alignment = 32, size = BOOT_TFM_SHARED_DATA_SIZE { };
define block ER_DATA         with  alignment = 32 {readwrite};
define block ARM_LIB_STACK   with alignment = 32, size = BL2_MSP_STACK_SIZE { };
define block HEAP            with alignment = 8, size = BL2_HEAP_SIZE { };
define block ARM_LIB_HEAP    with alignment = 8, size = BL2_HEAP_SIZE { };
define overlay HEAP_OVL      {block HEAP};
define overlay HEAP_OVL      {block ARM_LIB_HEAP};
keep {block TFM_SHARED_DATA, block ER_DATA, block ARM_LIB_STACK,
      block HEAP, block ARM_LIB_HEAP};

if (isdefinedsymbol(__USE_DLIB_PERTHREAD))
{
  // Required in a multi-threaded application
  initialize by copy with packing = none { section __DLIB_PERTHREAD };
}

define block DATA with fixed order, maximum size = BL2_DATA_SIZE {
       block TFM_SHARED_DATA,
       block ER_DATA,
       block ARM_LIB_STACK,
       overlay HEAP_OVL
};
place at address BL2_DATA_START {block DATA};