stm32mp1.ld.S 1.86 KB
Newer Older
1
/*
2
 * Copyright (c) 2015-2019, ARM Limited and Contributors. All rights reserved.
3
4
5
6
 *
 * SPDX-License-Identifier: BSD-3-Clause
 */

7
8
9
#ifndef STM32MP1_LD_S
#define STM32MP1_LD_S

10
#include <lib/xlat_tables/xlat_tables_defs.h>
11
12
13
14
15
16
17
18
19
#include <platform_def.h>

OUTPUT_FORMAT(PLATFORM_LINKER_FORMAT)
OUTPUT_ARCH(PLATFORM_LINKER_ARCH)

ENTRY(__BL2_IMAGE_START__)

MEMORY {
	HEADER (rw) : ORIGIN = 0x00000000, LENGTH = 0x3000
20
	RAM (rwx) : ORIGIN = STM32MP_BINARY_BASE, LENGTH = STM32MP_BINARY_SIZE
21
22
23
24
25
26
27
28
29
30
31
32
33
34
}

SECTIONS
{
    /*
     * TF mapping must conform to ROM code specification.
     */
    .header : {
        __HEADER_START__ = .;
        KEEP(*(.header))
        . = ALIGN(4);
        __HEADER_END__ = .;
    } >HEADER

35
    . = STM32MP_BINARY_BASE;
36
37
38
39
40
41
42
43
44
45
    .data . : {
        . = ALIGN(PAGE_SIZE);
        __DATA_START__ = .;
        *(.data*)

        /*
         * dtb.
         * The strongest and only alignment contraint is MMU 4K page.
         * Indeed as images below will be removed, 4K pages will be re-used.
         */
46
        . = ( STM32MP_DTB_BASE - STM32MP_BINARY_BASE );
47
48
49
50
51
52
53
54
55
        __DTB_IMAGE_START__ = .;
        *(.dtb_image*)
        __DTB_IMAGE_END__ = .;

        /*
         * bl2.
         * The strongest and only alignment contraint is MMU 4K page.
         * Indeed as images below will be removed, 4K pages will be re-used.
         */
56
        . = ( STM32MP_BL2_BASE - STM32MP_BINARY_BASE );
57
58
59
60
61
62
63
64
65
        __BL2_IMAGE_START__ = .;
        *(.bl2_image*)
        __BL2_IMAGE_END__ = .;

        /*
         * bl32 will be settled by bl2.
         * The strongest and only alignment constraint is 8 words to simplify
         * memraise8 assembly code.
         */
66
        . = ( STM32MP_BL32_BASE - STM32MP_BINARY_BASE );
67
68
69
70
71
72
73
74
75
76
        __BL32_IMAGE_START__ = .;
        *(.bl32_image*)
        __BL32_IMAGE_END__ = .;

        __DATA_END__ = .;
    } >RAM

    __TF_END__ = .;

}
77
#endif /* STM32MP1_LD_S */