GpioV2DataConvert.py tool assumes the data value defined in .h file
using decimal format. This enhancement adds hex format support.
Signed-off-by: Guo Dong <guo.dong@intel.com>
CI build failed for the case using ubuntu 20.04. It looks the Azure Pipelines
agent could not be found in the build job.
This PR just changes the settings to use ubuntu 24.04.
Signed-off-by: Guo Dong <guo.dong@intel.com>
New UEFI payload depends on SBL to rebase SMM and reports SMM rebase information.
This patch build SMM rebase related HOB for UEFI payload.
SMM rebase memory is located at the end of SMRAM. and this patch also updated
SMM memory HOB.
Signed-off-by: Guo Dong <guo.dong@intel.com>
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>
Using Ubuntu 24.04 (gcc 13.3.0), build QEMU has this faulure
when building QEMU FSP: Unknown symbol FspSecCoreT:_TempRamInitApi !
The root cause is in the generated map file, it uses 8 bytes address
for the symbol while current script search 16 bytes address.
This patch update the build script to support both 8 and 16 bytes address.
Signed-off-by: Guo Dong <guo.dong@intel.com>
Current implementation only supports the case that ELF file doesn't reload.
If the ELF file has to be reload (e.g.: to meet alignment requirement), SBL
need copy it to a different location and run.
Recently EDKII updated universal payload ELF image link script, and the new
ELF text alignment was changed to 0x1000 from 0x40. Mostly the default file
load location could not meet this requirement. So enhancement SBL to copy
it to a new location for this case.
Signed-off-by: Guo Dong <guo.dong@intel.com>
Build command:
python BuildLoader.py build qemu -a x64
-p "OsLoader.efi:LLDR:Lz4;upl.fit:UEFI:Lzma"
SBL passes bootloader info using FDT instead of HOB
to FIT format universal payload.
Signed-off-by: Guo Dong <guo.dong@intel.com>
New universal payload uses FDT instead HOB to pass information
from bootloader to payload. This BuildFdtLib could help build
the required FDT nodes.
Signed-off-by: Guo Dong <guo.dong@intel.com>
Simplify GPIO programming in Stage1A
Add P2SB devices and remove unused GPIO code in Stage1B.
Use GPIO config data instead of static GPIO table in Stage2.
Update PCH P2SB SMREG_BAR using FSP HOB.
Update ACPI NVS GEIx for SOC and PCH
Signed-off-by: Guo Dong <guo.dong@intel.com>
Make the GpioV2Lib not depend on platform and provide required APIs
Late this library could be used to replace the common GpioV2Lib.
This library could support multiple GPIO controller and the interface
is transparent to caller.
Signed-off-by: Guo Dong <guo.dong@intel.com>
This tool does data convert between [.yaml, .dlt] and [.h].
e.g.: Generate GPIO DLT from GPIO .h file
> python Platform\CommonBoardPkg\Tools\GpioV2DataConvert.py
-w Platform\ArrowlakeBoardPkg;Platform\ArrowlakeBoardPkg\CfgData;
Silicon\ArrowlakePkg
-if GpioTableArlSPostMem.h
-of arls.dlt
NOTE: This tool will search all the paths specified by "-w" to find GPIO
related definitions.
Signed-off-by: Guo Dong <guo.dong@intel.com>
The FdtLib is from EDK2 stable branch 202311.
FdtLib is used to boot FIT image.
Replace tab with space to follow EDK2 coding style.
Signed-off-by: Guo Dong <guo.dong@intel.com>
Universal UEFI payload used a different structure for the
SMI info. So parse the universal payload data structure and
set SMI EN in SBL.
Signed-off-by: Guo Dong <guo.dong@intel.com>
distutils is deprecated in Python 3.10 and 3.11.
And it is removed in Python 3.12. So remove the
dependency.
Signed-off-by: Guo Dong <guo.dong@intel.com>
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>
Previous patch used GCC extension "attribute__((packed))" which
caused windows build failure. This patch fixes it by using
#pragma pack().
Signed-off-by: Guo Dong <guo.dong@intel.com>
In current implementation all FSP notification are sent in SBL.
When using universal UEFI payload with SMM enabled, it is expected
to send ReadyToBoot and EndOfFirmware event in payload.
This patch just skip the FSP notification in SBL. Universal UEFI
payload should make sure FSP notification would be sent.
Signed-off-by: Guo Dong <guo.dong@intel.com>
Currently the build tool always find the config data yaml file
from the brd_name path.
With this update, it will first search yaml file from
brd_name_override path, if yaml file could not be found, then
it will search yaml file from brd_name path.
And currently it would generate ConfigDataStruct.h and
ConfigDataDynamic.h in brd_name path. With this change, generate
them in board common path.
With this change, full config data could be in brd_name or in
brd_name_override path.
Signed-off-by: Guo Dong <guo.dong@intel.com>
New ADL FSP changed TSN UPD from PchTsnEnable to PchTsnEnable[2].
So need update the code to fix the build failure.
Signed-off-by: Guo Dong <guo.dong@intel.com>
There is an error to get nasm from the log.
It looks the URL is not used correctly.
Since its URL is not changed recently, make some changes
to previous commit to check if it could be fixed.
Signed-off-by: Guo Dong <guo.dong@intel.com>
Currently there are only few use cases for the lite variable.
FSP2.4 requires bootloader to have variable support. To avoid
creating a new variable instance, just update lite variable to
align with FSP 2.4 variable requirements.
Signed-off-by: Guo Dong <guo.dong@intel.com>
When building HelloWorld, it would build failure since SBL core
package is missing in PayloadPkg.dsc since
In general, the payload should not depend on BootloaderCorePkg.
Currently PcdAcpiEnabled is used in the payload entry module and
it is defined in the BootloaderCorePkg. This patch updates the
code to remove the dependency.
Signed-off-by: Guo Dong <guo.dong@intel.com>
Signed-off-by: Atharva Lele <atharva.lele@intel.com>
Currently SBL would return when preferred graphics mode is set
in the multiboot image. This patch would continue boot and print
the preferred graphics mode information.
Signed-off-by: Guo Dong <guo.dong@intel.com>
Use the GPIO table from SBL config data instead of
the one from .h file. the .h file will keep there
a while just for reference.
Signed-off-by: Guo Dong <guo.dong@intel.com>
Use a on board switch (Pin B3) as the GPIO to switch
UEFI payload and OsLoader. So update its setting as
GPIO IN for this purpose.
Signed-off-by: Guo Dong <guo.dong@intel.com>
For PAD name (e.g., GPD12), current GpioDataConvert.py get the
pad number using pad_name[4:6]. It should be changed to pad_name[3:5].
Signed-off-by: Guo Dong <guo.dong@intel.com>
Restore SMM registers was done in the PostPciEnumeration.
so remove the duplicated code in EndOfStages
and call ClearS3SaveRegion() in normal path to avoid
appending multiple restore records.
Signed-off-by: Guo Dong <guo.dong@intel.com>
Use the GPIO table for the test boards.
This change would help fix PCIe device detection from PCIe slot.
Late would change post memory gpio table to SBL cfg data.
Signed-off-by: Guo Dong <guo.dong@intel.com>
The default FSP UPD value for Lp5BankMode doesn't work
for all the platforms. It would help override it using
SBL configuration data if it is exposed.
Signed-off-by: Guo Dong <guo.dong@intel.com>
Different use case might want to have a different CPU order.
e.g. P-core first or E-core first.
This patch adds an option to help user sort CPU.
platform could add "self.CPU_SORT_METHOD = value" to
BoardConfig.py to override the default value.
Signed-off-by: Guo Dong <guo.dong@intel.com>
By default OsLoader payload shell is only available in debug build.
In some case customer also wants to have shell in release build.
So add a BootToShell configuration item to enable shell in release build.
By default BootToShell is set to 0. When it is set to 1 the shell behavior
would be same in release and debug build.
NOTE: user could add this line in platform dlt file to set BootToShell.
GEN_CFG_DATA.BootToShell |1
Signed-off-by: Guo Dong <guo.dong@intel.com>
During stitch phase, it would stitch failure if the data
is not signed and the data for the subregion is too small,
so enhance the tool to support the corner case.
Signed-off-by: Guo Dong <guo.dong@intel.com>
* Generate platform build name definition
Same code could be shared by different platforms. At same time,
some platform might need do minor change to the shared code.
In order to support this case, this patch updated the build tool
to generate a macro definition for current build platform name
in a header file. so the shared code could have platform specific
code change with this macro definition.
e.g. add "#define #define PLATFORM_ADLS 1" for ADLS.
Signed-off-by: Guo Dong <guo.dong@intel.com>
* [ADLS] update
FspsUpdUpdateLib could be shared by different platform,
use ADLS macro definition instead of PcdAdlLpSupport for
ADLS specific change.
Signed-off-by: Guo Dong <guo.dong@intel.com>
The default big core number was set to 8, it has to be overridden if
the CPU number is not 8. Had better set to 0xFF to all active big cores.
Also it mentioned the default value is 0xFF in the help message.
Signed-off-by: Guo Dong <guo.dong@intel.com>
When BOARD_PKG_NAME_OVERRIDE is configured, the tool will get
the payload from package BOARD_PKG_NAME_OVERRIDE instead of
package BOARD_PKG_NAME.
Signed-off-by: Guo Dong <guo.dong@intel.com>
IsMarkedBadDso and InvalidateBadDso would be required for all
the platforms that support TCC. And the implementation is also
common, so just move them to common TccLib.
Also updated the implementation to remove SPI flash erase for
InvalidateBadDso().
Signed-off-by: Guo Dong <guo.dong@intel.com>
Currently StitchLoader.py is under platform package, and
the common tool BtgSign.py should not depend on that tool.
And BtgSign.py indeed doesn't depend on it, so just update
it to make it could work without StitchLoader.py.
Signed-off-by: Guo Dong <guo.dong@intel.com>
When BOARD_PKG_NAME_OVERRIDE is configured, the tool will firstly
search from BOARD_PKG_NAME_OVERRIDE, then search BOARD_PKG_NAME
for dlt and vbt files. It also uses BOARD_PKG_NAME_OVERRIDE for the
VerInfo file.
Signed-off-by: Guo Dong <guo.dong@intel.com>
UEFI payload built from open sourced EDK2 supports SMM variable now.
So build the required HOBs to work with EDK2.
This patch just changed the common SBL code, so there is no platform
change required.
This patch also added a PCD PcdBuildSmmHobs for old SMM HOBs and new
SMM HOBs. Late old SMM HOBs might be dropped.
Signed-off-by: Guo Dong <guo.dong@intel.com>
It is useful to have capsule image location info since
capsule image could be configured to different places.
Signed-off-by: Guo Dong <guo.dong@intel.com>
When some settings from DSO caused system hang, the WDT
would cause the system reboot. And in the next boot,
SBL would use the default setting by not apply the DSO
values.
Signed-off-by: Guo Dong <guo.dong@intel.com>
Currently it will return a valid SMMBASE_INFO if SMMBASE_INFO_COMM_ID
is found in SMM S3 resume memory. It will cause issue in S3 path if there
is no one fill correct data when MpInit uses it to rebase SMM.
This patch adds a check to SMMBASE_INFO to avoid this issue.
Signed-off-by: Guo Dong <guo.dong@intel.com>
Add a separate cfgdata dlt file to enable TCC config data.
The TCC dlt file will be appended to board dlt file when
ENABLE_TCC is set in BoardConfig.py.
Removed RTCM subregion and update boot option for RTCM support
TCC is disabled by default.
Signed-off-by: Guo Dong <guo.dong@intel.com>
It will first check the dlt file from source code, it the
dlt file could not be found, then check the build folder.
This enhancement supports the generated dlt file from
build folder.
Signed-off-by: Guo Dong <guo.dong@intel.com>
PreOsChecker is supported in the generic boot flow,
no special code is needed to support PreOsChecker.
So remove these unused code.
Signed-off-by: Guo Dong <guo.dong@intel.com>
MR2 FSP is available so update SBL to use MR2 FSP.
and also use new Microcode required by new FSP
Update platform code on FSP UPDs, especially enable TCC feature.
Update TGL platform version to 1.2 since MR2 released.
Signed-off-by: Guo Dong <guo.dong@intel.com>
RTCM will sit in OS boot media instead of IFWI image
So update SBL logic to load RTCM from OS boot media.
If the RTCM could not be found, SBL should continue
boot normal OS.
Signed-off-by: Guo Dong <guo.dong@intel.com>
Remove TGL-H GPIO definition and program.
Use R_ACPI_IO_SMI_STS instead of "R_ACPI_IO_SMI_EN + 4"
Set PCIE region len to 0x10000000 instead of 0x20000000
Remove data dumping for PSD
Fix other typo
Signed-off-by: Guo Dong <guo.dong@intel.com>
If the PlatformId is already set by stitch data, the platform code
should skip platform settings to avoid PlatformID override.
This patch adds the PlatformId check in platform code.
Signed-off-by: Guo Dong <guo.dong@intel.com>
With latest core code change, it would boot hang.
So need set SMM related PCD early and update platform
to enable SMM rebase.
Signed-off-by: Guo Dong <guo.dong@intel.com>
Update Boot Flags to list PreOs and Extra image.
Hide other options when preOS or Extra Image is selected.
Signed-off-by: Guo Dong <guo.dong@intel.com>
Update TCC config data strings to use the formal names.
And change the default value to make TCC disabled by default.
Signed-off-by: Guo Dong <guo.dong@intel.com>
When PreOS is configured from OS boot option data, the common function
FillBootOptionListFromCfgData () need update it to correct boot option
image LoadImageTypePreOs. Similarly when extra image is specified, need
update to extra image.
Update ImageType value and fix an image load issue for RTCM.
Signed-off-by: Guo Dong <guo.dong@intel.com>
Update the TCC subregion layout.
Use the common TCC config data
Use the common TCC library for RTCT table.
Rename TCC variable to follow TCC V2 naming
Pending the FSP release for TCC V2 support.
Signed-off-by: Guo Dong <guo.dong@intel.com>
1) Add PCD PcdTccEnabled so that TCC could build out when disabled
2) Add HOB gTccRtctHobGuid produced by FSP if FSP support TCC V2
3) Add a common TCC config data in common platform package
4) Add a common TCC lib to update TCC RTCT table.
Signed-off-by: Guo Dong <guo.dong@intel.com>