183 Commits

Author SHA1 Message Date
Guo Dong
317c43386c Update SMM rebase support
Currently SBL supports SMM REBASE based on configuration.
1) When payload doesn't support SMM, SBL need enable SMM rebase.
   So SBL will rebase SMM to SMRAM and set SMRR to prevent SMRAM
   access out of SMM and prevent payload SMM driver dispatch.
2) When payload support SMM, SBL need disable SMM rebase.
   In this case SBL do nothing for SMM. Payload will do SMM
   rebase.

In new UEFI payload (after stable branch 202311), SMM relocation
was removed CPU SMM driver. To work with new UEFI payload, SMM
relocation is expected in SBL, but SMRR should not be set so that
SMM drivers in UEFI payload could be dispatched into SMRAM.

This patch adds a new SMM rebase configuration that it rebase SMM
but it doesn't set SMRR.
Currently SBL supports rebase AUTO setting based on payload. This
patch also add auto support.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2025-04-14 21:36:08 -07:00
Kevin Tsai
30e04de2db fix: [Common] Update PcdFspResetStatus size
Update PcdFspResetStatus size to support 64Bit FSP return status.

Signed-off-by: Kevin Tsai <kevin.tsai@intel.com>
2025-03-31 09:37:56 -07:00
Biswas Arghya
246e497c0c fix:[common] Fix Coverity issue in FspNotifyPhase
fix Coverity issue in FspApiLib/FspNotifyPhase.c.

Signed-off-by: Biswas Arghya <arghya.biswas@intel.com>
2025-02-12 13:46:45 -07:00
Chirag Vijay Kolhe
a41dc0aad4 fix: [Common] Remove IAS boot image support
IAS boot image format is deprecated; it is recommended to use container
boot image.

 - Removed references,files related to IAS image.
 - Replaced IAS image boot options with container type image.

Signed-off-by: Chirag Vijay Kolhe <chirag.vijay.kolhe@intel.com>
2025-02-11 13:45:09 -07:00
Bejean Mosher
0bcefec921 feat: Support calling into x64 FSP
FSP 2.4 introduces the possibility of FSP built for x64 architecture.
This adds support for x64 FSP calling conventions based on the header x64
support attribute. Support for x64 FSP-T requires entering long mode
prior to FSP-T execution.

Signed-off-by: Bejean Mosher <bejean.mosher@intel.com>
2025-02-06 10:08:15 -07:00
Bejean Mosher
4d4d5a6fa3 fix: Allocate FSPM UPD from heap instead of stack
FSP 2.4 with MultiPhase support expects FSP UPD buffer to stay accessible
after CallFspMemoryInit() returns, so FSP must be allocated from the heap
instead of stack.

Signed-off-by: Bejean Mosher <bejean.mosher@intel.com>
2025-02-06 10:08:15 -07:00
Bejean Mosher
e69378bc2d feat: Add Board flag for AP Init Wait time
Some silicon requires longer than provided for all APs to enter the wakeup
routine. This change makes this platform configurable. The default wait
time is none and can be increased for platforms with higher core count Si.

Signed-off-by: Bejean Mosher <bejean.mosher@intel.com>
2024-11-21 14:22:48 -07:00
tsaikevin
8ad2c625b5 fix: [Common] Assign PCI_MAX_BUS to BusLimit for BusScanTypeList type (#2315)
When platform chooses BusScanTypeList for PCI enumeration, the BusLimit should be set to PCI_MAX_BUS.
The BusScanItems defines primary bus for PCie root port. If there is device attached to root port,
which will present on secondary bus, in the meantime the bus number is greater than Buslimit, this device
cannot be found from enumeration. Assign PCI_MAX_BUS to BusLimit to prevent this issue.

Signed-off-by: Kevin Tsai <kevin.tsai@intel.com>
2024-10-23 10:57:15 +08:00
Pastorcici, Mariano-paulX
c50658ae6b feat: [common] Enable PCIe resizable BAR support
This commit adds support for PCIe resizable BARsupport.
The feature can be enabled by setting PcdResizableBarSupport
for the board build script and its disabled by default.

Signed-off-by: pastorcx <mariano-paulx.pastorcici@intel.com>
2024-09-09 10:30:57 -07:00
Bejean Mosher
04132381bd feat: Add BoardConfig field to control Stage1B remap
Adding new Board Config item REMAP_STAGE1B to control remapping Stage1B
into permanent memory after FSP-M. Decouple this from ENABLE_FAST_BOOT
and STAGE1B_XIP. This makes it simpler to enable this remap when the
slight performance boost may be needed, and leave it disabled by default.

Signed-off-by: Bejean Mosher <bejean.mosher@intel.com>
2024-06-04 13:07:16 -07:00
bejeanmo
6a1da85c9f fix: FSP 2.4 issues (#2171)
1) Some FSP 2.4 implementations are non-conforming and use FSPM_ARCH_UPD
instead of FSPM_ARCH2_UPD as indicated by the specification. Logic is
changed to check FSPM UPD header revision for structure version instead
of FSP spec revision.

2) MultiPhase FSP PhaseIndex is one-based so loop comparisons need to take
this into account. Side effect is that the last phase may be missed. No
current platform FSP is utilizing this.

Signed-off-by: Bejean Mosher <bejean.mosher@intel.com>
2024-05-03 08:26:03 -04:00
Yi Li
6adb9072d5 Let Stage1B run in memory accoss all stages in fast boot mode
This will increase time of Board PostMemoryInit hook and TempRamExit,
but improve the performance of PostTempRamExit hook, PreSiliconInit hook
and FSP-S.

In total, the boot time can be reduced by ~20ms.

Signed-off-by: Yi Li <yi1.li@intel.com>
2024-04-02 09:45:30 -07:00
bejeanmo
9c527d99c8 fix: Only register root bridges with actual devices, not empty ones. (#2142)
Registering logical root bridges with no devices can cause unexpected
behavior for platforms that use _PCI_ENUM_BUS_SCAN_TYPE = "range", since
all empty buses in the range will be compared against the resource
allocation table entries.

Signed-off-by: Bejean Mosher <bejean.mosher@intel.com>
2024-02-16 10:34:49 -07:00
bejeanmo
fed94258ac fix: Remove check for physical root bridge device before scanning. (#2140)
Not all root bridges have a physical device at dev 0 func 0 of the root
bus, and this requirement prevents some platforms from being fully scanned.
From this point, PciEnumerationLib doesn't access the root bridge
configuration space at all, so this is an unnecessary check.

Instead, root bus scanning will continue without dev 0 func 0 present. If
no devices are found on the root bus, scanning will continue to the next
root bridge.

Signed-off-by: Bejean Mosher <bejean.mosher@intel.com>
2024-02-15 13:49:02 -07:00
Bejean Mosher
1d38f8e69f feat: Validate BMP headers to protect against LogoFAIL.
The SBL logo is verified as part of Stage2 verification, so untrusted
logos won't be parsed, but it's still good to prevent dereferencing BMP
header pointers that may fall outside of BMP file.

Signed-off-by: Bejean Mosher <bejean.mosher@intel.com>
2024-01-08 15:04:47 -07:00
Chirag Vijay Kolhe
7e3a4cb601 fix: [Common] Fix debug message to print cpu state
Fixed debug message to print cpu index, APIC ID and cpu state in order.

Signed-off-by: Chirag Vijay Kolhe <chirag.vijay.kolhe@intel.com>
2023-12-14 15:57:57 -07:00
Guo Dong
6570aa9037 Update FPDT Table
Update the FPDT header length to include the length
of boot records. This way we could easily get all the
boot records from dumped ACPI FPDT table.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2023-10-12 08:35:13 -07:00
cshur
83e3f07c9d feat: Update # of X2Apic Processor Local APIC
Since # of PROCESSOR_LOCAL_APICs are
Madt Local Apic # is 1.
Madt X2 Local Apic # is 9.

Need to update # of structure type of X2Apic.

Signed-off-by: cshur <cs.hur@intel.com>
2023-09-05 15:48:55 -07:00
Sachin Kamat
2e2ceabafd fix: [PCIe] Fix assert check
Assert check was one off causing problem for corner cases.
Upated the check.

Signed-off-by: Sachin Kamat <sachin.kamat@intel.com>
2023-08-03 11:28:39 -07:00
Kevin Tsai
877ac9ffc9 fix: [Common] Fix Coverity issues
Resolved below issues.
Untrusted pointer read(CWE 129)
Operands don't affect result(CWE 569)
Unchecked return value(CWE 252)
Logically dead code(CWE 561)
Unused value(CWE 563)
Unintended sign extension(CWE 194)
Out-of-bounds access(CWE 119)

Signed-off-by: Kevin Tsai <kevin.tsai@intel.com>
2023-07-27 15:51:26 -07:00
Guo Dong
2b8ca86087 feat: fix Klocwork issue (#1947)
Fix the issue - Uninitialized Variable ResetVectorTime

Signed-off-by: Guo Dong <guo.dong@intel.com>
2023-06-29 11:45:42 -07:00
Guo Dong
475ff9daca feat: Fix ACPI FPDT SBL boot performance (#1935)
In current code, BoardNotifyPhase() would update FPDT SBL performance
table in S3 path. It could cause S3 issue since PcdAcpiTablesRsdp is
not updated.
Move the FPDT related code to AcpiFpdt.c
Update FPDT SBL performance table in stage2 so that this table
could be updated for all payloads.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2023-06-25 21:06:43 -07:00
Atharva Lele
1d2e75b5be fix: resolve FPDT related Klocwork issues
- Add a null check for Rsdp pointer before accessing it
- Initialize ResetVectorTime, Time to some value before using it
- Add debug print for success / failure

Signed-off-by: Atharva Lele <atharva.lele@intel.com>
2023-06-18 16:42:21 -07:00
koktong-ong
d7727bc60c fix: [Common] Fix KW issues (#1920)
Fixed Klocwork issues

Signed-off-by: Kobe <kok.tong.ong@intel.com>
2023-06-12 09:09:25 -04:00
bejeanmo
a34e54e175 feat: [FSP2.4] Added FSP variable serivices, Multi Phase Mem and SI. (#1901)
FSP 2.4 adds a requirement for Bootloader to respond to FSP Variable
requests in a way that is similar to UEFI variable services. This
implementation adds support for using the updated SBL VariableLib so that
the FspVariableServicesLib wrapper is no longer needed.

Additionally, support for Multi-Phase mem and SI init is added. FSP 2.4
introduces the mandatory MultiPhaseMemInit call, and makes the
MultiPhaseSiInit call mandatory where it was previously optional.

Signed-off-by: Bejean Mosher <bejean.mosher@intel.com>
2023-05-24 14:36:35 -04:00