aboutsummaryrefslogtreecommitdiff
path: root/arch/src/armv7-m/scatter.S
blob: 98103100fc55f96c89a08c0f3381fcd883290749 (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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
/*
 * Arm SCP/MCP Software
 * Copyright (c) 2018-2020, Arm Limited and Contributors. All rights reserved.
 *
 * SPDX-License-Identifier: BSD-3-Clause
 *
 * Description:
 *      Arm Compiler 6 scatter file.
 */

#include "scatter.h"

#if FMW_MEM_MODE == ARCH_MEM_MODE_SINGLE_REGION
/*
 * Single region memory layout:
 *  - MEM0 accepts:
 *      - Read-only sections
 *      - Read-write sections
 *      - Executable sections
 */

#    define ARCH_X_BASE +0
#    define ARCH_R_BASE +0
#    define ARCH_W_BASE +0
#elif FMW_MEM_MODE == ARCH_MEM_MODE_DUAL_REGION_RELOCATION
/*
 * Dual region memory layout with initialized data relocation:
 *  - MEM0 accepts:
 *      - Read-only sections
 *      - Executable sections
 *
 *  - MEM1 accepts:
 *      - Read-write sections
 */

#    define ARCH_X_BASE +0
#    define ARCH_R_BASE +0

#    define ARCH_W_BASE FMW_MEM1_BASE
#elif FMW_MEM_MODE == ARCH_MEM_MODE_DUAL_REGION_NO_RELOCATION
    /*
     * Dual region memory layout without initialized data relocation:
     *  - MEM0 accepts:
     *      - Executable sections
     *
     *  - MEM1 accepts:
     *      - Read-only sections
     *      - Read-write sections
     */

#    define ARCH_X_BASE +0

#    define ARCH_R_BASE FMW_MEM1_BASE
#    define ARCH_W_BASE +0
#endif

#if FMW_MEM_MODE == ARCH_MEM_MODE_SINGLE_REGION
#    define ARCH_W_LIMIT ARCH_MEM0_LIMIT
#else
#    define ARCH_W_LIMIT ARCH_MEM1_LIMIT
#endif

LR_FIRMWARE FMW_MEM0_BASE {
    ER_EXCEPTIONS ARCH_X_BASE {
        *(.exceptions)
    }

    ER_TEXT +0 {
        *(+CODE)
    }

    ER_RODATA ARCH_R_BASE {
        *(+CONST)
    }

    ER_DATA ARCH_W_BASE {
        *(+DATA)
    }

    ER_BSS +0 {
        *(+BSS)
    }

    ARM_LIB_STACKHEAP +0 EMPTY (ARCH_W_LIMIT - +0) { }
}