soc/amd/common/block/psp: introduce AMD_SOC_SEPARATE_EFS_SECTION

On systems that use the first 128kByte of the SPI flash for the EC
firmware, it is not possible to place the EFS/amdfw part at the lowest
location in flash where the on-chip PSP firmware will look for the EFS,
since this is at an offset of 128kByte into the flash which is where the
cbfs master header resides when the main CBFS is placed right after the
EC firmware. This patch introduces the AMD_SOC_SEPARATE_EFS_SECTION
option that allows putting the EFS in a separate FMAP section that can
be located right after the EC firmware FMAP section. The EFS FMAP
partition is checked to ensure it begins at the expected location.

Change-Id: I5ed0f76c9c9c9c180ee5f1b96f88689d0979bb5e
Signed-off-by: Fred Reitberger <reitbergerfred@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/61558
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
This commit is contained in:
Fred Reitberger 2022-02-02 13:30:18 -05:00 committed by Felix Held
parent 4b38a0b860
commit 1e25fd426a
3 changed files with 18 additions and 0 deletions

View File

@ -27,3 +27,11 @@ config SOC_AMD_PSP_SELECTABLE_SMU_FW
and each mainboard can choose to select an appropriate fanless or
fanned set of blobs. Ask your AMD representative whether your APU
is considered fanless.
config AMD_SOC_SEPARATE_EFS_SECTION
bool
help
Use separate EFS FMAP section instead of putting EFS into CBFS. The
FMAP section must begin exactly at the location the EFS needs to be
placed in the flash. This option can be used to place the EFS right
after the 128kByte EC firmware at the beginning of the flash.

View File

@ -6,6 +6,7 @@ smm-y += psp.c
smm-y += psp_smm.c
bootblock-y += psp_efs.c
bootblock-$(CONFIG_AMD_SOC_SEPARATE_EFS_SECTION) += efs_fmap_check.c
verstage-y += psp_efs.c
endif # CONFIG_SOC_AMD_COMMON_BLOCK_PSP

View File

@ -0,0 +1,9 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#include <amdblocks/psp_efs.h>
#include <assert.h>
#include <fmap_config.h>
#include <soc/iomap.h>
_Static_assert(FMAP_SECTION_EFS_START == (FLASH_BASE_ADDR + EFS_OFFSET),
"FMAP EFS Offset does not match EFS Offset - check your config");