summaryrefslogtreecommitdiff
path: root/src/vendorcode/intel/edk2
diff options
context:
space:
mode:
authorPatrick Rudolph <patrick.rudolph@9elements.com>2020-11-30 15:50:06 +0100
committerPatrick Georgi <pgeorgi@google.com>2021-02-04 10:21:42 +0000
commit31218a4259708233c17fa8b09fa9d9c06ea1f2ad (patch)
treea1d32df5213f557c61430bc341da1b64aa7f7c4d /src/vendorcode/intel/edk2
parent37cae540343d8f02258c3209f90114e7189753e2 (diff)
drivers/intel/fsp2_0: Fix running on x86_64
Add new Kconfig symbols to mark FSP binary as x86_32. Fix the FSP headers and replace void pointers by fixed sized integers depending on the used mode to compile the FSP. This issue has been reported here: https://github.com/intel/FSP/issues/59 This is necessary to run on x86_64, as pointers have different size. Add preprocessor error to warn that x86_64 FSP isn't supported by the current code. Tested on Intel Skylake. FSP-M no longer returns the error "Invalid Parameter". Change-Id: I6015005c4ee3fc2f361985cf8cff896bcefd04fb Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/48174 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Diffstat (limited to 'src/vendorcode/intel/edk2')
-rw-r--r--src/vendorcode/intel/edk2/UDK2015/IntelFsp2Pkg/Include/FspEas/FspApi.h12
-rw-r--r--src/vendorcode/intel/edk2/UDK2017/IntelFsp2Pkg/Include/FspEas/FspApi.h12
-rw-r--r--src/vendorcode/intel/edk2/edk2-stable202005/IntelFsp2Pkg/Include/FspEas/FspApi.h16
3 files changed, 33 insertions, 7 deletions
diff --git a/src/vendorcode/intel/edk2/UDK2015/IntelFsp2Pkg/Include/FspEas/FspApi.h b/src/vendorcode/intel/edk2/UDK2015/IntelFsp2Pkg/Include/FspEas/FspApi.h
index c58b169f99..df2b7dcd73 100644
--- a/src/vendorcode/intel/edk2/UDK2015/IntelFsp2Pkg/Include/FspEas/FspApi.h
+++ b/src/vendorcode/intel/edk2/UDK2015/IntelFsp2Pkg/Include/FspEas/FspApi.h
@@ -50,6 +50,7 @@ typedef struct {
UINT8 Reserved[23];
} FSP_UPD_HEADER;
+#if CONFIG(PLATFORM_USES_FSP2_X86_32)
///
/// FSPM_ARCH_UPD Configuration.
///
@@ -63,12 +64,16 @@ typedef struct {
/// Pointer to the non-volatile storage (NVS) data buffer.
/// If it is NULL it indicates the NVS data is not available.
///
- VOID *NvsBufferPtr;
+ /// Note: This ought to be VOID*, but that won't allow calling this binary on x86_64.
+ ///
+ UINT32 NvsBufferPtr;
///
/// Pointer to the temporary stack base address to be
/// consumed inside FspMemoryInit() API.
///
- VOID *StackBase;
+ /// Note: This ought to be VOID*, but that won't allow calling this binary on x86_64.
+ ///
+ UINT32 StackBase;
///
/// Temporary stack size to be consumed inside
/// FspMemoryInit() API.
@@ -85,6 +90,9 @@ typedef struct {
UINT32 BootMode;
UINT8 Reserved1[8];
} FSPM_ARCH_UPD;
+#else
+#error You need to implement this struct for x86_64 FSP
+#endif
///
/// FSPT_UPD_COMMON Configuration.
diff --git a/src/vendorcode/intel/edk2/UDK2017/IntelFsp2Pkg/Include/FspEas/FspApi.h b/src/vendorcode/intel/edk2/UDK2017/IntelFsp2Pkg/Include/FspEas/FspApi.h
index 29c98ee163..c22b701ede 100644
--- a/src/vendorcode/intel/edk2/UDK2017/IntelFsp2Pkg/Include/FspEas/FspApi.h
+++ b/src/vendorcode/intel/edk2/UDK2017/IntelFsp2Pkg/Include/FspEas/FspApi.h
@@ -50,6 +50,7 @@ typedef struct {
UINT8 Reserved[23];
} FSP_UPD_HEADER;
+#if CONFIG(PLATFORM_USES_FSP2_X86_32)
///
/// FSPM_ARCH_UPD Configuration.
///
@@ -63,12 +64,16 @@ typedef struct {
/// Pointer to the non-volatile storage (NVS) data buffer.
/// If it is NULL it indicates the NVS data is not available.
///
- VOID *NvsBufferPtr;
+ /// Note: This ought to be VOID*, but that won't allow calling this binary on x86_64.
+ ///
+ UINT32 NvsBufferPtr;
///
/// Pointer to the temporary stack base address to be
/// consumed inside FspMemoryInit() API.
///
- VOID *StackBase;
+ /// Note: This ought to be VOID*, but that won't allow calling this binary on x86_64.
+ ///
+ UINT32 StackBase;
///
/// Temporary stack size to be consumed inside
/// FspMemoryInit() API.
@@ -85,6 +90,9 @@ typedef struct {
UINT32 BootMode;
UINT8 Reserved1[8];
} FSPM_ARCH_UPD;
+#else
+#error You need to implement this struct for x86_64 FSP
+#endif
///
/// FSPT_UPD_COMMON Configuration.
diff --git a/src/vendorcode/intel/edk2/edk2-stable202005/IntelFsp2Pkg/Include/FspEas/FspApi.h b/src/vendorcode/intel/edk2/edk2-stable202005/IntelFsp2Pkg/Include/FspEas/FspApi.h
index eb9ce86124..8314f0b979 100644
--- a/src/vendorcode/intel/edk2/edk2-stable202005/IntelFsp2Pkg/Include/FspEas/FspApi.h
+++ b/src/vendorcode/intel/edk2/edk2-stable202005/IntelFsp2Pkg/Include/FspEas/FspApi.h
@@ -128,6 +128,7 @@ typedef struct {
UINT8 Reserved1[20];
} FSPT_ARCH_UPD;
+#if CONFIG(PLATFORM_USES_FSP2_X86_32)
///
/// FSPM_ARCH_UPD Configuration.
///
@@ -141,12 +142,16 @@ typedef struct {
/// Pointer to the non-volatile storage (NVS) data buffer.
/// If it is NULL it indicates the NVS data is not available.
///
- VOID *NvsBufferPtr;
+ /// Note: This ought to be VOID*, but that won't allow calling this binary on x86_64.
+ ///
+ UINT32 NvsBufferPtr;
///
/// Pointer to the temporary stack base address to be
/// consumed inside FspMemoryInit() API.
///
- VOID *StackBase;
+ /// Note: This ought to be VOID*, but that won't allow calling this binary on x86_64.
+ ///
+ UINT32 StackBase;
///
/// Temporary stack size to be consumed inside
/// FspMemoryInit() API.
@@ -165,9 +170,14 @@ typedef struct {
/// Optional event handler for the bootloader to be informed of events occurring during FSP execution.
/// This value is only valid if Revision is >= 2.
///
- FSP_EVENT_HANDLER *FspEventHandler;
+ /// Note: This ought to be FSP_EVENT_HANDLER*, but that won't allow calling this binary on x86_64.
+ ///
+ UINT32 FspEventHandler;
UINT8 Reserved1[4];
} FSPM_ARCH_UPD;
+#else
+#error You need to implement this struct for x86_64 FSP
+#endif
typedef struct {
///