blob: 9432a74844e1e524e48979652e0c5363c5203daa [file] [log] [blame]
Sandrine Bailleux3cd87d72018-10-09 11:12:55 +02001/*
2 * Copyright (c) 2018, Arm Limited. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#include <platform_def.h>
8#include <xlat_tables_defs.h>
9
10OUTPUT_FORMAT(PLATFORM_LINKER_FORMAT)
11OUTPUT_ARCH(PLATFORM_LINKER_ARCH)
12ENTRY(tftf_entrypoint)
13
14MEMORY {
15 RAM (rwx): ORIGIN = DRAM_BASE, LENGTH = DRAM_SIZE
16}
17
18
19SECTIONS
20{
21 . = TFTF_BASE;
22 __TFTF_BASE__ = .;
23
24 ro . : {
25 __RO_START__ = .;
26 *entrypoint.o(.text*)
27 *(.text*)
28 *(.rodata*)
29 *(.vectors)
30 __RO_END_UNALIGNED__ = .;
31 /*
32 * Memory page(s) mapped to this section will be marked as
33 * read-only, executable. No RW data from the next section must
34 * creep in. Ensure the rest of the current memory page is unused.
35 */
36 . = NEXT(PAGE_SIZE);
37 __RO_END__ = .;
38 } >RAM
39
40 .data : {
41 __DATA_START__ = .;
42 *(.data*)
43 __DATA_END__ = .;
44 } >RAM
45
46 stacks (NOLOAD) : {
47 __STACKS_START__ = .;
48 *(tftf_normal_stacks)
49 __STACKS_END__ = .;
50 } >RAM
51
52 /*
53 * The .bss section gets initialised to 0 at runtime.
54 * Its base address must be 16-byte aligned.
55 */
56 .bss : ALIGN(16) {
57 __BSS_START__ = .;
58 *(SORT_BY_ALIGNMENT(.bss*))
59 *(COMMON)
60 __BSS_END__ = .;
61 } >RAM
62
63 /*
64 * The xlat_table section is for full, aligned page tables (4K).
65 * Removing them from .bss avoids forcing 4K alignment on
66 * the .bss section and eliminates the unecessary zero init
67 */
68 xlat_table (NOLOAD) : {
69 *(xlat_table)
70 } >RAM
71
72 /*
73 * The base address of the coherent memory section must be page-aligned (4K)
74 * to guarantee that the coherent data are stored on their own pages and
75 * are not mixed with normal data. This is required to set up the correct
76 * memory attributes for the coherent data page tables.
77 */
78 coherent_ram (NOLOAD) : ALIGN(PAGE_SIZE) {
79 __COHERENT_RAM_START__ = .;
80 *(tftf_coherent_stacks)
81 *(tftf_coherent_mem)
82 __COHERENT_RAM_END_UNALIGNED__ = .;
83 /*
84 * Memory page(s) mapped to this section will be marked
85 * as device memory. No other unexpected data must creep in.
86 * Ensure the rest of the current memory page is unused.
87 */
88 . = NEXT(PAGE_SIZE);
89 __COHERENT_RAM_END__ = .;
90 } >RAM
91
92 __COHERENT_RAM_UNALIGNED_SIZE__ =
93 __COHERENT_RAM_END_UNALIGNED__ - __COHERENT_RAM_START__;
94
95
96 __TFTF_END__ = .;
97
98 __BSS_SIZE__ = SIZEOF(.bss);
99
100}