2 * This file is part of the coreboot project.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 2 of the License.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
14 /* This file is included inside a SECTIONS block */
15 . = CONFIG_DCACHE_RAM_BASE;
16 .car.data . (NOLOAD) : {
17 _car_region_start = . ;
18 #if CONFIG(PAGING_IN_CACHE_AS_RAM)
19 /* Page table pre-allocation. CONFIG_DCACHE_RAM_BASE should be 4KiB
20 * aligned when using this option. */
22 . += 4096 * CONFIG_NUM_CAR_PAGE_TABLE_PAGES;
25 /* Vboot work buffer only needs to be available when verified boot
26 * starts in bootblock. */
27 #if CONFIG(VBOOT_STARTS_IN_BOOTBLOCK)
30 /* Vboot measured boot TCPA log measurements.
31 * Needs to be transferred until CBMEM is available
33 #if CONFIG(VBOOT_MEASURED_BOOT)
36 /* Stack for CAR stages. Since it persists across all stages that
37 * use CAR it can be reused. The chipset/SoC is expected to provide
39 #if !CONFIG(ROMCC_BOOTBLOCK)
41 . += CONFIG_DCACHE_BSP_STACK_SIZE;
44 /* The pre-ram cbmem console as well as the timestamp region are fixed
45 * in size. Therefore place them above the car global section so that
46 * multiple stages (romstage and verstage) have a consistent
47 * link address of these shared objects. */
48 PRERAM_CBMEM_CONSOLE(., CONFIG_PRERAM_CBMEM_CONSOLE_SIZE)
49 #if CONFIG(PAGING_IN_CACHE_AS_RAM)
51 /* Page directory pointer table resides here. There are 4 8-byte entries
52 * totalling 32 bytes that need to be 32-byte aligned. The reason the
53 * pdpt are not colocated with the rest of the page tables is to reduce
54 * fragmentation of the CAR space that persists across stages. */
62 #if !CONFIG(NO_FMAP_CACHE)
63 FMAP_CACHE(., FMAP_SIZE)
66 _car_ehci_dbg_info = .;
67 /* Reserve sizeof(struct ehci_dbg_info). */
69 _ecar_ehci_dbg_info = .;
71 /* _bss and _ebss provide symbols to per-stage
72 * variables that are not shared like the timestamp and the pre-ram
73 * cbmem console. This is useful for clearing this area on a per-stage
74 * basis when more than one stage uses cache-as-ram for CAR_GLOBALs. */
76 . = ALIGN(ARCH_POINTER_ALIGN_SIZE);
78 #if ENV_STAGE_HAS_BSS_SECTION
79 /* Allow global uninitialized variables for stages without CAR teardown. */
85 _car_global_start = .;
89 . = ALIGN(ARCH_POINTER_ALIGN_SIZE);
91 _car_unallocated_start = .;
93 #if CONFIG(ROMCC_BOOTBLOCK)
95 _ecar_stack = _car_region_end;
97 _car_region_end = . + CONFIG_DCACHE_RAM_SIZE - (. - _car_region_start);
100 /* Global variables are not allowed in romstage
101 * This section is checked during stage creation to ensure
102 * that there are no global variables present
106 .illegal_globals . : {
107 *(EXCLUDE_FILE ("*/libagesa.*.a:" "*/romstage*/buildOpts.o" "*/romstage*/agesawrapper.o" "*/vendorcode/amd/agesa/*" "*/vendorcode/amd/cimx/*") .data)
108 *(EXCLUDE_FILE ("*/libagesa.*.a:" "*/romstage*/buildOpts.o" "*/romstage*/agesawrapper.o" "*/vendorcode/amd/agesa/*" "*/vendorcode/amd/cimx/*") .data.*)
109 #if CONFIG(CAR_GLOBAL_MIGRATION)
115 /* In case something sneaks through when it shouldn't. */
120 _bogus = ASSERT((CONFIG_DCACHE_RAM_SIZE == 0) || (SIZEOF(.car.data) <= CONFIG_DCACHE_RAM_SIZE), "Cache as RAM area is too full");
121 #if CONFIG(PAGING_IN_CACHE_AS_RAM)
122 _bogus2 = ASSERT(_pagetables == ALIGN(_pagetables, 4096), "_pagetables aren't 4KiB aligned");
124 #if !CONFIG(ROMCC_BOOTBLOCK)
125 _bogus3 = ASSERT(CONFIG_DCACHE_BSP_STACK_SIZE > 0x0, "BSP stack size not configured");