2010-02-19 20:59:03 +01:00
|
|
|
/*
|
2010-04-13 15:43:35 +02:00
|
|
|
* This file is part of the coreboot project.
|
2010-02-19 20:59:03 +01:00
|
|
|
*
|
2010-04-13 15:43:35 +02:00
|
|
|
* Copyright (C) 2006 Advanced Micro Devices, Inc.
|
|
|
|
* Copyright (C) 2008-2010 coresystems GmbH
|
2015-09-04 19:06:05 +02:00
|
|
|
* Copyright 2015 Google Inc
|
2010-04-13 15:43:35 +02:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; version 2 of the License.
|
2010-02-19 20:59:03 +01:00
|
|
|
*
|
2010-04-13 15:43:35 +02:00
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
2010-02-19 20:59:03 +01:00
|
|
|
*/
|
|
|
|
|
2015-09-05 20:31:14 +02:00
|
|
|
/* This file is included inside a SECTIONS block */
|
|
|
|
. = CONFIG_DCACHE_RAM_BASE;
|
|
|
|
.car.data . (NOLOAD) : {
|
2016-02-26 02:22:17 +01:00
|
|
|
_car_region_start = . ;
|
2019-03-06 01:53:33 +01:00
|
|
|
#if CONFIG(PAGING_IN_CACHE_AS_RAM)
|
2018-04-18 09:00:27 +02:00
|
|
|
/* Page table pre-allocation. CONFIG_DCACHE_RAM_BASE should be 4KiB
|
|
|
|
* aligned when using this option. */
|
|
|
|
_pagetables = . ;
|
|
|
|
. += 4096 * CONFIG_NUM_CAR_PAGE_TABLE_PAGES;
|
|
|
|
_epagetables = . ;
|
|
|
|
#endif
|
2019-02-21 05:37:55 +01:00
|
|
|
/* Vboot work buffer only needs to be available when verified boot
|
|
|
|
* starts in bootblock. */
|
2019-03-06 01:53:33 +01:00
|
|
|
#if CONFIG(VBOOT_STARTS_IN_BOOTBLOCK)
|
2019-02-21 05:36:55 +01:00
|
|
|
VBOOT2_WORK(., 12K)
|
2016-02-09 02:17:05 +01:00
|
|
|
#endif
|
2018-11-10 00:35:02 +01:00
|
|
|
/* Vboot measured boot TCPA log measurements.
|
|
|
|
* Needs to be transferred until CBMEM is available
|
|
|
|
*/
|
|
|
|
VBOOT2_TPM_LOG(., 2K)
|
2016-02-09 02:17:05 +01:00
|
|
|
/* Stack for CAR stages. Since it persists across all stages that
|
|
|
|
* use CAR it can be reused. The chipset/SoC is expected to provide
|
|
|
|
* the stack size. */
|
2019-03-06 01:53:33 +01:00
|
|
|
#if CONFIG(C_ENVIRONMENT_BOOTBLOCK)
|
2016-02-09 02:17:05 +01:00
|
|
|
_car_stack_start = .;
|
|
|
|
. += CONFIG_DCACHE_BSP_STACK_SIZE;
|
|
|
|
_car_stack_end = .;
|
2015-09-29 23:31:20 +02:00
|
|
|
#endif
|
2015-09-24 19:18:07 +02:00
|
|
|
/* The pre-ram cbmem console as well as the timestamp region are fixed
|
2018-12-28 17:53:36 +01:00
|
|
|
* in size. Therefore place them above the car global section so that
|
|
|
|
* multiple stages (romstage and verstage) have a consistent
|
|
|
|
* link address of these shared objects. */
|
2018-06-03 11:29:50 +02:00
|
|
|
PRERAM_CBMEM_CONSOLE(., CONFIG_PRERAM_CBMEM_CONSOLE_SIZE)
|
2019-03-06 01:53:33 +01:00
|
|
|
#if CONFIG(PAGING_IN_CACHE_AS_RAM)
|
2018-04-18 09:00:27 +02:00
|
|
|
. = ALIGN(32);
|
|
|
|
/* Page directory pointer table resides here. There are 4 8-byte entries
|
|
|
|
* totalling 32 bytes that need to be 32-byte aligned. The reason the
|
|
|
|
* pdpt are not colocated with the rest of the page tables is to reduce
|
|
|
|
* fragmentation of the CAR space that persists across stages. */
|
|
|
|
_pdpt = .;
|
|
|
|
. += 32;
|
|
|
|
_epdpt = .;
|
|
|
|
#endif
|
2016-02-26 02:22:17 +01:00
|
|
|
_car_relocatable_data_start = .;
|
2015-09-24 19:18:07 +02:00
|
|
|
/* The timestamp implementation relies on this storage to be around
|
|
|
|
* after migration. One of the fields indicates not to use it as the
|
|
|
|
* backing store once cbmem comes online. Therefore, this data needs
|
2016-02-26 02:22:17 +01:00
|
|
|
* to reside in the migrated area (between _car_relocatable_data_start
|
|
|
|
* and _car_relocatable_data_end). */
|
2018-05-18 08:30:28 +02:00
|
|
|
TIMESTAMP(., 0x200)
|
2018-12-28 17:53:36 +01:00
|
|
|
_car_ehci_dbg_info_start = .;
|
2019-01-31 07:29:32 +01:00
|
|
|
/* Reserve sizeof(struct ehci_dbg_info). */
|
2019-01-31 18:24:04 +01:00
|
|
|
. += 80;
|
2018-12-28 17:53:36 +01:00
|
|
|
_car_ehci_dbg_info_end = .;
|
2015-09-24 19:18:07 +02:00
|
|
|
/* _car_global_start and _car_global_end provide symbols to per-stage
|
|
|
|
* variables that are not shared like the timestamp and the pre-ram
|
|
|
|
* cbmem console. This is useful for clearing this area on a per-stage
|
|
|
|
* basis when more than one stage uses cache-as-ram for CAR_GLOBALs. */
|
|
|
|
_car_global_start = .;
|
2019-03-06 01:53:33 +01:00
|
|
|
#if CONFIG(NO_CAR_GLOBAL_MIGRATION)
|
2018-10-30 19:15:10 +01:00
|
|
|
/* Allow global unitialized variables when CAR_GLOBALs are not used. */
|
|
|
|
*(.bss)
|
|
|
|
*(.bss.*)
|
|
|
|
*(.sbss)
|
|
|
|
*(.sbss.*)
|
|
|
|
#else
|
|
|
|
/* .car.global_data objects only around when
|
|
|
|
* !CONFIG_NO_CAR_GLOBAL_MIGRATION is employed. */
|
2015-09-05 20:31:14 +02:00
|
|
|
*(.car.global_data);
|
2018-10-30 19:15:10 +01:00
|
|
|
#endif
|
2015-09-05 20:31:14 +02:00
|
|
|
. = ALIGN(ARCH_POINTER_ALIGN_SIZE);
|
2015-09-24 19:18:07 +02:00
|
|
|
_car_global_end = .;
|
2016-02-26 02:22:17 +01:00
|
|
|
_car_relocatable_data_end = .;
|
|
|
|
|
2019-04-22 00:25:05 +02:00
|
|
|
#if (CONFIG(NORTHBRIDGE_INTEL_SANDYBRIDGE) || \
|
|
|
|
CONFIG(NORTHBRIDGE_INTEL_IVYBRIDGE)) && \
|
2019-03-06 01:53:33 +01:00
|
|
|
!CONFIG(USE_NATIVE_RAMINIT)
|
2019-01-30 07:19:49 +01:00
|
|
|
. = ABSOLUTE(0xff7e1000);
|
|
|
|
_mrc_pool = .;
|
|
|
|
. += 0x5000;
|
|
|
|
_emrc_pool = .;
|
|
|
|
#endif
|
|
|
|
|
2019-03-06 01:53:33 +01:00
|
|
|
#if !CONFIG(C_ENVIRONMENT_BOOTBLOCK)
|
2018-12-28 18:18:46 +01:00
|
|
|
_car_stack_start = .;
|
|
|
|
_car_stack_end = _car_region_end;
|
|
|
|
#endif
|
2016-02-26 02:22:17 +01:00
|
|
|
_car_region_end = . + CONFIG_DCACHE_RAM_SIZE - (. - _car_region_start);
|
2015-09-05 20:31:14 +02:00
|
|
|
}
|
2011-10-01 13:27:32 +02:00
|
|
|
|
2015-09-05 20:31:14 +02:00
|
|
|
/* Global variables are not allowed in romstage
|
|
|
|
* This section is checked during stage creation to ensure
|
|
|
|
* that there are no global variables present
|
|
|
|
*/
|
2014-10-30 19:53:38 +01:00
|
|
|
|
2015-09-05 20:31:14 +02:00
|
|
|
. = 0xffffff00;
|
|
|
|
.illegal_globals . : {
|
2016-01-23 01:24:33 +01:00
|
|
|
*(EXCLUDE_FILE ("*/libagesa.*.a:" "*/romstage*/buildOpts.o" "*/romstage*/agesawrapper.o" "*/vendorcode/amd/agesa/*" "*/vendorcode/amd/cimx/*") .data)
|
|
|
|
*(EXCLUDE_FILE ("*/libagesa.*.a:" "*/romstage*/buildOpts.o" "*/romstage*/agesawrapper.o" "*/vendorcode/amd/agesa/*" "*/vendorcode/amd/cimx/*") .data.*)
|
2019-03-06 01:53:33 +01:00
|
|
|
#if !CONFIG(NO_CAR_GLOBAL_MIGRATION)
|
2015-09-05 20:31:14 +02:00
|
|
|
*(.bss)
|
|
|
|
*(.bss.*)
|
|
|
|
*(.sbss)
|
|
|
|
*(.sbss.*)
|
2018-10-30 19:15:10 +01:00
|
|
|
#else
|
|
|
|
/* In case something sneaks through when it shouldn't. */
|
|
|
|
*(.car.global_data);
|
|
|
|
#endif
|
2010-02-19 20:59:03 +01:00
|
|
|
}
|
2015-09-05 20:31:14 +02:00
|
|
|
|
2015-09-24 19:18:07 +02:00
|
|
|
_bogus = ASSERT((CONFIG_DCACHE_RAM_SIZE == 0) || (SIZEOF(.car.data) <= CONFIG_DCACHE_RAM_SIZE), "Cache as RAM area is too full");
|
2019-03-06 01:53:33 +01:00
|
|
|
#if CONFIG(PAGING_IN_CACHE_AS_RAM)
|
2018-04-18 09:00:27 +02:00
|
|
|
_bogus2 = ASSERT(_pagetables == ALIGN(_pagetables, 4096), "_pagetables aren't 4KiB aligned");
|
|
|
|
#endif
|
2019-03-06 01:53:33 +01:00
|
|
|
#if CONFIG(C_ENVIRONMENT_BOOTBLOCK)
|
2018-11-12 19:26:54 +01:00
|
|
|
_bogus3 = ASSERT(CONFIG_DCACHE_BSP_STACK_SIZE > 0x0, "BSP stack size not configured");
|
|
|
|
#endif
|