Subrata Banik has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/81623?usp=email )
Change subject: vc/intel/fsp: Refactor FSP header inclusion for EDK2 compatibility ......................................................................
vc/intel/fsp: Refactor FSP header inclusion for EDK2 compatibility
This change refactors EDK2 essential header management within the FSP directory to ensure compatibility.
Header selection is now dynamically based on:
* FSP specification version: Distinguishes between 1.1 and 2.x * EDK2 revision (for FSP 2.x): Chooses the appropriate FSP info header
FSP Header | |-> FSP 1.1 specification FSP_INFO_HEADER |-> FSP 2.0 specification EDK2 release |-> EDK2_2017 FSP_INFO_HEADER |-> EDK2_2020 FSP_INFO_HEADER |-> EDK2_2021 FSP_INFO_HEADER |-> EDK2_2023 FSP_INFO_HEADER
Any .C/.H file requires to include FSP_INFO_HEADER can now just add the FSP header alone.
BUG=b:242829490 TEST=Able to build google/rex0 with 64-bit FSP.
Change-Id: I29e5002821843c9cffbc8f6317d1062175f014ff Signed-off-by: Subrata Banik subratabanik@google.com --- A src/vendorcode/intel/fsp/fsp2_0/IntelFspPkg/Include/FspInfoHeader.h A src/vendorcode/intel/fsp/fsp_header.h 2 files changed, 42 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/23/81623/1
diff --git a/src/vendorcode/intel/fsp/fsp2_0/IntelFspPkg/Include/FspInfoHeader.h b/src/vendorcode/intel/fsp/fsp2_0/IntelFspPkg/Include/FspInfoHeader.h new file mode 100644 index 0000000..93495c4 --- /dev/null +++ b/src/vendorcode/intel/fsp/fsp2_0/IntelFspPkg/Include/FspInfoHeader.h @@ -0,0 +1,20 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#ifndef _FSP_INFO_HEADER_H_ +#define _FSP_INFO_HEADER_H_ + +#if CONFIG_UDK_VERSION == CONFIG_UDK_2017_VERSION +#include <vendorcode/intel/edk2/UDK2017/IntelFsp2Pkg/Include/Guid/FspHeaderFile.h> +#elif CONFIG_UDK_VERSION == CONFIG_UDK_202005_VERSION +#include <vendorcode/intel/edk2/edk2-stable202005/IntelFsp2Pkg/Include/Guid/FspHeaderFile.h> +#elif CONFIG_UDK_VERSION == CONFIG_UDK_202111_VERSION +#include <vendorcode/intel/edk2/edk2-stable202111/IntelFsp2Pkg/Include/Guid/FspHeaderFile.h> +#elif CONFIG_UDK_VERSION == CONFIG_UDK_2022_VERSION +#include <vendorcode/intel/edk2/edk2-stable2022/IntelFsp2Pkg/Include/Guid/FspHeaderFile.h> +#elif CONFIG_UDK_VERSION == CONFIG_UDK_202302_VERSION +#include <vendorcode/intel/edk2/edk2-stable202302/IntelFsp2Pkg/Include/Guid/FspHeaderFile.h> +#else +#error "Unknown UDK_VESION!" +#endif + +#endif /* _FSP_INFO_HEADER_H_ */ diff --git a/src/vendorcode/intel/fsp/fsp_header.h b/src/vendorcode/intel/fsp/fsp_header.h new file mode 100644 index 0000000..148e8d5 --- /dev/null +++ b/src/vendorcode/intel/fsp/fsp_header.h @@ -0,0 +1,22 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#ifndef _FSP_HEADER_H_ +#define _FSP_HEADER_H_ + +/* + * Intel's code does not have a handle on changing global packing state. + * Therefore, one needs to protect against packing policies that are set + * globally for a compilation unit just by including a header file. + */ +#pragma pack(push) +/* Default bind edk2 UEFI 2.4 types. */ +#include <vendorcode/intel/edk2/uefi_2.4/uefi_types.h> + +#if CONFIG_UDK_VERSION >= CONFIG_UDK_2017_VERSION +#include <vendorcode/intel/fsp/fsp2_0/IntelFspPkg/Include/FspInfoHeader.h> +#else +#include <vendorcode/intel/fsp/fsp1_1/IntelFspPkg/Include/FspInfoHeader.h> +#endif +#pragma pack(pop) + +#endif /* _FSP_HEADER_H_ */