1/*
2 * Copyright (c) 2018-2022 ARM Limited
3 * Copyright (c) 2021 Cypress Semiconductor Corp. All rights reserved.
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 *     http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18#include "region_defs.h"
19
20LR_CODE NS_CODE_START {
21    ER_CODE NS_CODE_START NS_CODE_SIZE {
22        *.o (RESET +First)
23        .ANY (+RO)
24    }
25
26#ifdef RAM_VECTORS_SUPPORT
27    ER_RAM_VECTORS NS_DATA_START ALIGN 256 UNINIT {
28        * (RESET_RAM, +FIRST)
29    }
30#endif
31
32    /* Executable code allocated in RAM */
33    TFM_RAM_CODE +0 ALIGN 32 {
34        * (.ramfunc)
35    }
36
37    /* Use up the rest space of the NS_DATA area */
38    ER_DATA +0 {
39        .ANY (+ZI +RW)
40    }
41
42    /* STACK */
43    ARM_LIB_STACK +0 ALIGN 32 EMPTY NS_STACK_SIZE {
44    }
45
46    ARM_LIB_HEAP +0 ALIGN 8 EMPTY NS_HEAP_SIZE {
47    }
48
49#if defined(PSA_API_TEST_ENABLED)
50    PSA_API_TEST_NVMEM PSA_API_TEST_NVMEM_START EMPTY PSA_API_TEST_NVMEM_SIZE {
51    }
52#endif
53
54#if defined (NS_DATA_SHARED_START)
55    /* Shared memory data */
56    TFM_SHARED_MEM NS_DATA_SHARED_START EMPTY NS_DATA_SHARED_SIZE {
57    }
58#endif
59
60    /* This empty, zero long execution region is here to mark the limit address
61     * of the last execution region that is allocated in SRAM.
62     */
63    SRAM_WATERMARK +0 EMPTY 0x0 {
64    }
65
66    /* Make sure that the sections allocated in the SRAM does not exceed the
67     * size of the SRAM available.
68     */
69    ScatterAssert(ImageLimit(SRAM_WATERMARK) <= NS_DATA_START + NS_DATA_SIZE)
70}
71