soc/intel/common/block: fix storage size of HEST log address
[coreboot.git] / src / arch / x86 / bootblock.ld
blob3cd09003c99930d8e7a414576d562f9c58fb04bc
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 gdtptr_offset = gdtptr & 0xffff;
4 nullidt_offset = nullidt & 0xffff;
6 /* Symbol _start16bit must be aligned to 4kB to start AP CPUs with
7  * Startup IPI message without RAM.
8  */
9 #if CONFIG(SIPI_VECTOR_IN_ROM)
10 _bogus = ASSERT((_start16bit & 0xfff) == 0, "Symbol _start16bit is not at 4 KiB boundary");
11 ap_sipi_vector_in_rom = (_start16bit >> 12) & 0xff;
12 #endif
14 SECTIONS {
16 #if CONFIG(FIXED_BOOTBLOCK_SIZE)
17         . = _ebootblock - CONFIG_C_ENV_BOOTBLOCK_SIZE;
18 #else
19         . = BOOTBLOCK_TOP - PROGRAM_SZ;
20         . = ALIGN(16);
21 #endif
23         _bootblock = .;
25         INCLUDE "bootblock/lib/program.ld"
27         /*
28          * Allocation reserves extra space here. Alignment requirements
29          * may cause the total size of a section to change when the start
30          * address gets applied.
31          */
32         PROGRAM_SZ = SIZEOF(.text) + 512;
34         . = MIN(_ID_SECTION, _FIT_POINTER) - EARLYASM_SZ;
35         . = CONFIG(SIPI_VECTOR_IN_ROM) ? ALIGN(4096) : ALIGN(16);
36         BOOTBLOCK_TOP = .;
37         .init (.) : {
38                 *(.init._start);
39                 *(.init);
40                 *(.init.*);
41         }
43         /*
44          * Allocation reserves extra space here. Alignment requirements
45          * may cause the total size of a section to change when the start
46          * address gets applied.
47          */
48         EARLYASM_SZ = SIZEOF(.init) + (CONFIG(SIPI_VECTOR_IN_ROM) ? 4096 : 16);
50         . = _ID_SECTION;
51         .id (.): {
52                 KEEP(*(.id));
53         }
55         /* Flashrom and FILO have two alternatives for the location of .id section. */
56         _ID_SECTION_END = SIZEOF(.fit_pointer) && SIZEOF(.id) > 0x28 ? 0xffffff80 : _X86_RESET_VECTOR;
57         _ID_SECTION = _ID_SECTION_END - SIZEOF(.id);
59         . = _FIT_POINTER;
60         .fit_pointer (.): {
61                 KEEP(*(.fit_pointer));
62         }
63         _FIT_POINTER = SIZEOF(.fit_pointer) ? 0xffffffc0 : _X86_RESET_VECTOR;
65         . = 0xfffffff0;
66         _X86_RESET_VECTOR = .;
67         .reset . : {
68                 *(.reset);
69                 . = 15;
70                 BYTE(0x00);
71         }
72         _ebootblock = .;
76  * Tests _bogus1 and _bogus2 are here to detect case of symbol addresses truncated
77  * to 32 bits and intermediate files reaching size of close to 4 GiB.
78  */
79 _bogus1 = ASSERT(_bootblock & 0x80000000, "_bootblock too low, invalid ld script");
80 _bogus2 = ASSERT(_start16bit & 0x80000000, "_start16bit too low, invalid ld script");
81 _bogus3 = ASSERT(_start16bit >= 0xffff0000, "_start16bit too low. Please report.");
82 _bogus4 = ASSERT(_ebootblock - _bootblock <= CONFIG_C_ENV_BOOTBLOCK_SIZE,
83                  "_bootblock too low, increase C_ENV_BOOTBLOCK_SIZE");