blob: bd3d163d6990996d51d98816c4e40fb7ffc68abc [file] [log] [blame]
Andre Przywara6228e432020-09-16 17:13:33 +01001/*
Chris Kay33bfc5e2023-02-14 11:30:04 +00002 * Copyright (c) 2023, Arm Limited. All rights reserved.
Andre Przywara6228e432020-09-16 17:13:33 +01003 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 *
6 * Linker script for the Arm Ltd. FPGA boards to generate an ELF file that
7 * contains the ROM trampoline, BL31 and the DTB.
8 *
9 * This allows to pass just one file to the uploader tool, and automatically
10 * provides the correct load addresses.
11 */
12
13#include <platform_def.h>
14
15OUTPUT_FORMAT("elf64-littleaarch64")
16OUTPUT_ARCH(aarch64)
17
Andre Przywara6228e432020-09-16 17:13:33 +010018INPUT(./rom_trampoline.o)
Andre Przywara8c6d92d2021-05-14 16:13:28 +010019INPUT(./kernel_trampoline.o)
Andre Przywara6228e432020-09-16 17:13:33 +010020
21TARGET(binary)
Andre Przywarad8057972021-11-04 13:47:17 +000022INPUT(./bl31.bin)
Andre Przywara6228e432020-09-16 17:13:33 +010023INPUT(./fdts/arm_fpga.dtb)
24
25ENTRY(_start)
26
27SECTIONS
28{
29 .rom (0x0): {
30 *rom_trampoline.o(.text*)
31 KEEP(*(.rom))
32 }
33
34 .bl31 (BL31_BASE): {
35 ASSERT(. == ALIGN(PAGE_SIZE), "BL31_BASE is not page aligned");
Andre Przywarad8057972021-11-04 13:47:17 +000036 *bl31.bin
Andre Przywara6228e432020-09-16 17:13:33 +010037 }
38
39 .dtb (FPGA_PRELOADED_DTB_BASE): {
40 ASSERT(. == ALIGN(8), "DTB address is not 8-byte aligned");
41 *arm_fpga.dtb
42 }
43
Andre Przywara8c6d92d2021-05-14 16:13:28 +010044 .kern_tramp (PRELOADED_BL33_BASE): {
45 *kernel_trampoline.o(.text*)
46 KEEP(*(.kern_tramp))
47 }
48
Chris Kay33bfc5e2023-02-14 11:30:04 +000049 /DISCARD/ : { *(.stacks) }
Andre Przywara6228e432020-09-16 17:13:33 +010050 /DISCARD/ : { *(.debug_*) }
51 /DISCARD/ : { *(.note*) }
52 /DISCARD/ : { *(.comment*) }
53}