soc/intel/apollolake: Provide FIT pointer in bootblock at build time

Before TXE releases the CPU out of reset a pointer to the constructed
FIT in SRAM is patched into the loaded bootblock at offset 4G - 64B.
Since this patched bootblock gets measured during runtime it will not
match the one that is potentially measured from the coreboot image.

This patch adds a dedicated fit.c file for Apollo Lake where the FIT
pointer is already set to the address TXE will be using at runtime.

Test=Compare sha256 sum from coreboot runtime and coreboot.rom of the
bootblock and make sure they match.

Change-Id: Ia0fd2a19517c70f50ef37e6a2dc2408bae28df10
Signed-off-by: Werner Zeh <werner.zeh@siemens.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/64539
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
This commit is contained in:
Werner Zeh 2022-05-20 07:02:50 +02:00 committed by Felix Held
parent 859305d457
commit 458cfaea9f
2 changed files with 12 additions and 1 deletions

View File

@ -155,7 +155,7 @@ endif
# table + pointer, but reserving the pointer is still needed. Otherwise the # table + pointer, but reserving the pointer is still needed. Otherwise the
# IBBL loader thrashes code there. So include fit.c so that the linker # IBBL loader thrashes code there. So include fit.c so that the linker
# reserves that pointer. # reserves that pointer.
bootblock-y += ../../../cpu/intel/fit/fit.c bootblock-y += bootblock/fit.c
# DSP firmware settings files. # DSP firmware settings files.
ifeq ($(CONFIG_SOC_INTEL_GEMINILAKE),y) ifeq ($(CONFIG_SOC_INTEL_GEMINILAKE),y)

View File

@ -0,0 +1,11 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#include <stdint.h>
/*
* At runtime TXE creates the FIT table in the shared SRAM and patches the bootblock
* at the fixed address 4G - 64 byte with a pointer to this FIT table. In order to be able
* to pre-compute the PCR value for the bootblock this FIT pointer needs to be added to the
* image as well. Since the FIT location is fixed in TXE, this can be done at build time.
*/
__attribute__((used, __section__(".fit_pointer"))) const uint64_t fit_ptr = 0xfffe0000;