2020-03-04 15:10:45 +01:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
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
|
|
|
|
*/
|
security/vboot: Decouple measured boot from verified boot
Currently, those who want to use measured boot implemented within
vboot should enable verified boot first, along with sections such
as GBB and RW slots defined with manually written fmd files, even
if they do not actually want to verify anything.
As discussed in CB:34977, measured boot should be decoupled from
verified boot and make them two fully independent options. Crypto
routines necessary for measurement could be reused, and TPM and CRTM
init should be done somewhere other than vboot_logic_executed() if
verified boot is not enabled.
In this revision, only TCPA log is initialized during bootblock.
Before TPM gets set up, digests are not measured into tpm immediately,
but cached in TCPA log, and measured into determined PCRs right after
TPM is up.
This change allows those who do not want to use the verified boot
scheme implemented by vboot as well as its requirement of a more
complex partition scheme designed for chromeos to make use of the
measured boot functionality implemented within vboot library to
measure the boot process.
TODO: Measure MRC Cache somewhere, as MRC Cache has never resided in
CBFS any more, so it cannot be covered by tspi_measure_cbfs_hook().
Change-Id: I1fb376b4a8b98baffaee4d574937797bba1f8aee
Signed-off-by: Bill XIE <persmule@hardenedlinux.org>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/35077
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Philipp Deppenwiese <zaolin.daisuki@gmail.com>
Reviewed-by: Julius Werner <jwerner@chromium.org>
Reviewed-by: Werner Zeh <werner.zeh@siemens.com>
2019-08-22 14:28:36 +02:00
|
|
|
#if CONFIG(TPM_MEASURED_BOOT)
|
|
|
|
TPM_TCPA_LOG(., 2K)
|
2019-04-21 23:59:47 +02:00
|
|
|
#endif
|
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-11-09 06:50:20 +01:00
|
|
|
_car_stack = .;
|
2016-02-09 02:17:05 +01:00
|
|
|
. += CONFIG_DCACHE_BSP_STACK_SIZE;
|
2019-11-09 06:50:20 +01:00
|
|
|
_ecar_stack = .;
|
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
|
2019-08-22 14:06:50 +02:00
|
|
|
|
2018-05-18 08:30:28 +02:00
|
|
|
TIMESTAMP(., 0x200)
|
2019-11-18 22:01:06 +01:00
|
|
|
|
|
|
|
#if !CONFIG(NO_FMAP_CACHE)
|
2019-11-07 04:29:44 +01:00
|
|
|
FMAP_CACHE(., FMAP_SIZE)
|
2019-11-18 22:01:06 +01:00
|
|
|
#endif
|
2019-08-22 14:06:50 +02:00
|
|
|
|
2019-11-09 06:50:20 +01:00
|
|
|
_car_ehci_dbg_info = .;
|
2019-01-31 07:29:32 +01:00
|
|
|
/* Reserve sizeof(struct ehci_dbg_info). */
|
2019-01-31 18:24:04 +01:00
|
|
|
. += 80;
|
2019-11-09 06:50:20 +01:00
|
|
|
_ecar_ehci_dbg_info = .;
|
2019-08-22 14:06:50 +02:00
|
|
|
|
2019-08-22 11:56:22 +02:00
|
|
|
/* _bss and _ebss provide symbols to per-stage
|
2015-09-24 19:18:07 +02:00
|
|
|
* 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
|
2019-11-28 14:00:01 +01:00
|
|
|
* basis when more than one stage uses cache-as-ram. */
|
2019-08-22 11:56:22 +02:00
|
|
|
|
|
|
|
. = ALIGN(ARCH_POINTER_ALIGN_SIZE);
|
|
|
|
_bss = .;
|
2019-08-22 08:44:44 +02:00
|
|
|
/* Allow global uninitialized variables for stages without CAR teardown. */
|
2018-10-30 19:15:10 +01:00
|
|
|
*(.bss)
|
|
|
|
*(.bss.*)
|
|
|
|
*(.sbss)
|
|
|
|
*(.sbss.*)
|
2015-09-05 20:31:14 +02:00
|
|
|
. = ALIGN(ARCH_POINTER_ALIGN_SIZE);
|
2019-08-22 11:56:22 +02:00
|
|
|
_ebss = .;
|
2019-08-22 11:56:22 +02:00
|
|
|
_car_unallocated_start = .;
|
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.*)
|
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
|
2018-11-12 19:26:54 +01:00
|
|
|
_bogus3 = ASSERT(CONFIG_DCACHE_BSP_STACK_SIZE > 0x0, "BSP stack size not configured");
|