100 Commits
Author SHA1 Message Date
Guo Dong c7f0e5e1a1 Enhance GPIO data convert Tool
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>
2025-07-16 20:03:53 -07:00
Guo Dong c699a20a3f Fix CI build failure
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>
2025-05-21 08:56:04 -07:00
Guo Dong d48ada5da2 Add SMM rebase HOB
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>
2025-04-14 21:36:08 -07:00
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
Guo Dong dc2ff793fe Qemu: Fix build failure on Ubuntu 24.04
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>
2025-03-21 14:55:08 -07:00
Guo Dong 8d32ccbcdf Enhance ELF loading
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>
2025-03-20 13:46:34 -07:00
Guo Dong 2d7225ee3e [MTL] Cleanup: Remove unused empty function
Remove empty function InterruptRoutingInit and file it located.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2025-02-26 14:11:38 -05:00
Guo Dong a1c91378e1 [IDV] Cleanup: Remove unused empty function
Remove empty function InterruptRoutingInit and file it located.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2025-02-26 14:11:38 -05:00
Guo Dong 4e36d33c40 [ARL] Cleanup: Remove unused empty function
Remove empty function InterruptRoutingInit and file it located.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2025-02-26 14:11:38 -05:00
Guo Dong 174215a669 [ADL] Cleanup: Remove unused empty function
Remove empty function InterruptRoutingInit and file it located.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2025-02-26 14:11:38 -05:00
Guo Dong 367b37e87c QEMU: Add FDT universal payload support
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>
2025-01-10 13:19:29 -07:00
Guo Dong c1326e0ae2 Add FDT support for universal payload
New universal payload use FDT (Flat Device Tree) instead
of HOB to pass info to payload.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2025-01-10 13:19:29 -07:00
Guo Dong 927f60e884 Add BuildFdtLib for universal payload support
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>
2025-01-10 13:19:29 -07:00
Guo Dong 801618ebfe Update FdtLib for universal payload support
Sync FdtLib from EDK2

Signed-off-by: Guo Dong <guo.dong@intel.com>
2025-01-10 13:19:29 -07:00
Guo Dong c8bb5eda5d ARL: Add shutdown support
Add S5 support in ARL reset system library.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2024-12-12 09:06:26 +08:00
Guo Dong 1fa71b957f CI: Fix the Linux CI Build
acpica-tools_20200925-8_amd64.deb is not available from
http://archive.ubuntu.com/ubuntu/pool/universe/a/acpica-unix
Change to acpica-tools_20200925-6_amd64.deb instead.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2024-12-03 11:39:03 -05:00
Guo Dong 7e0e5d36b8 MTL: Update to use GPIOV2 common Library
Update Platform code to use common P2sb and GPIOV2 lib.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2024-10-31 21:29:23 -07:00
Guo Dong 6410a9bf78 Enhance OsLoader shell perf command
Add a parameter to show the boot performance data
in MicroSecond. By default it uses MilliSecond as-is.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2024-10-11 09:23:25 -07:00
Guo Dong f0b05d57f9 ARL: Fix the Coverity issues
Add some checks to avoid Out-of-bounds and Untrusted loop bound
from Coverity checks.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2024-10-02 07:39:11 -07:00
Guo Dong 096e866ade ARL: Fix GCC build issues
Several errors are reported in GCC build. This PR fixed
below issues:

Signed-off-by: Guo Dong <guo.dong@intel.com>
2024-10-02 07:39:11 -07:00
Guo Dong 45273c82ca Enhance CfgDataTool
Add a check for a corner case.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2024-09-29 16:26:50 -07:00
Guo Dong b3f07cce9c ARL: Update platform code to use GPIOV2Lib
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>
2024-09-29 16:26:50 -07:00
Guo Dong 7130aa602f ARL: Update PcieRbLib
Update MtlPchPcieRpLib and PcieRpSocLib.
Late could combine these 2 libraries.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2024-09-29 16:26:50 -07:00
Guo Dong 1aff591aa2 ARL: Add GPIO shell command
This is based on GPIO V2 library.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2024-09-29 16:26:50 -07:00
Guo Dong 69e9996e56 ARL: clean up the code
Remove unused file, definitions or libraries.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2024-09-29 16:26:50 -07:00
Guo Dong 76ee9f23c6 ARL: Update Top swap lib
Update this library using new P2SB lib.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2024-09-29 16:26:50 -07:00
Guo Dong 5d51ee9fd4 ARL: Update GpioV2Lib
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>
2024-09-29 16:26:50 -07:00
Guo Dong a199513b27 GPIOV2: Add GPIOV2 data convert tool
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>
2024-09-29 16:26:50 -07:00
Guo Dong 2445f86b29 ARL: Update GPIOV2 silicon library
Update the GPIOV2 platform support library.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2024-09-29 16:26:50 -07:00
Guo Dong 1503b7558b [ARL]: Add P2sb library
This is a common P2sb read/write library for all the P2SB
devices inside PCH, SOC and IOE.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2024-09-29 16:26:50 -07:00
Guo Dong 872ae851f7 [TGL][APL]: Update Stage2 size
With FIT support, update Stage2 size to make sure build success.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2024-04-24 09:32:51 -07:00
Guo Dong 4e19c9d66a [RPLS]: Support FIT image payload
FIT image is a little bigger in size

Signed-off-by: Guo Dong <guo.dong@intel.com>
2024-04-24 09:32:51 -07:00
Guo Dong c781b14a03 feat: Add FIT image support
New universal payload used FIT image format.
The spec defined https://universalpayload.github.io/spec/chapter2-payload-image-format.html
This change could boot FIT universal payload.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2024-04-24 09:32:51 -07:00
Guo Dong 49a213d77e feat: Add FitLib
Add FitLib which is required to support FIT image.
New universal payload used FIT image format.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2024-04-24 09:32:51 -07:00
Guo Dong bb44e17f86 feat: Add FdtLib
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>
2024-04-24 09:32:51 -07:00
Guo Dong 22063ec518 Fix SMRR setting for universal UEFI payload
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>
2023-12-11 16:56:32 -07:00
Guo Dong 4d5df7b913 feat: Fix the syntax warning
Fix the build warning using Python 3.12.
The warning message "SyntaxWarning: invalid escape sequence"

Signed-off-by: Guo Dong <guo.dong@intel.com>
2023-11-03 13:03:23 -07:00
Guo Dong caefea4df3 * feat: Fix the build failure with Python 3.12
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>
2023-11-03 13:03:23 -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
Guo Dong 7db779439b [ADL/RPL] Update reset reason
Add reset reason caused by S4.
Update ADL to set reset reason.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2023-09-26 09:18:00 -07:00
Guo Dong cf38997cca Fix windows build failure
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>
2023-09-20 14:57:31 -07:00
Guo Dong 9380ed2d0e Send FSP notification in universal UEFI payload
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>
2023-09-05 20:30:51 -07:00
Guo Dong 60c2df3de3 [TOOL]: Enhance build tool for CFG data
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>
2023-08-29 10:47:43 -07:00
Guo Dong 9b8d2cdce1 feat: Fix ADLS build failure
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>
2023-07-19 12:22:50 -07:00
Guo Dong f9898fc7bd feat: update CI build
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>
2023-07-19 09:51:42 -07:00
Guo Dong 474fb76f1d feat: Update the lite variable usage
Since lite variable API change, this patch Update
the caller to align with variable library.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2023-05-10 12:16:57 -07:00
Guo Dong 25c804da79 feat: Update Lite variable library
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>
2023-05-10 12:16:57 -07:00
Guo Dong bd36df5fa7 feat: (ADL/RPL) Config FSP post code via Port80 or I2C
Add config data for FSP post code

Signed-off-by: Guo Dong <guo.dong@intel.com>
2023-04-19 09:25:26 -07:00
Guo Dong d087b7d21d feat: (RPL) Add Crash log data PCD
Define PCD PcdCrashLogDataPtr for Crash log.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2023-04-14 11:17:56 -07:00
Guo Dong 42492ffea9 feat: Fix the HelloWorld build failure
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>
2023-04-11 11:05:29 -07:00
Guo Dong e5fb055c0c Update universal payload ID
Update the universal payload ID to align with
the universal payload specification.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2022-12-08 14:42:56 -07:00
Guo Dong ba6a502ae9 Enable Azure Pipeline build for IDV
This patch enabled auto build for IDV Azure Pipelines.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2022-11-16 14:49:01 -07:00
Guo Dong 505209d9c3 Enhance multiboot support
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>
2022-10-24 10:52:03 -07:00
Guo Dong e81a4872a9 [RPL] Add a new RPL CPU support
Adding RAPTORLAKE 2 DT HALO support

Signed-off-by: Guo Dong <guo.dong@intel.com>
2022-10-17 14:13:02 -07:00
Guo Dong 49e23bb324 [RPLP] Add RPL-P PR01 board support
Signed-off-by: Guo Dong <guo.dong@intel.com>
2022-08-05 14:01:10 -07:00
Guo Dong 7440dec946 [CFL] Increase payload size
Increase the payload size to fix the build failure.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2022-08-02 07:42:55 -07:00
Guo Dong 77cbf823bf [TESTS] Use GPIO table from config data
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>
2022-08-01 21:39:13 -07:00
Guo Dong 58d265f553 [TESTS] payload switch GPIO
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>
2022-08-01 21:39:13 -07:00
Guo Dong 90e917e62b Enhance GPIO convert tool for GPD group support
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>
2022-08-01 21:38:49 -07:00
Guo Dong 0c1092528a [ADL] Remove duplicated S3 code
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>
2022-08-01 18:11:09 -07:00
Guo Dong 69fb535cc5 [TESTS] revert the premem gpio change for S17 board
Premem GPIO table for S17 board caused boot hang,
so revert the change back.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2022-07-23 00:34:44 -07:00
Guo Dong 4ce3649eb1 [TEST-S] Update GPIO for test boards
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>
2022-07-22 16:05:49 -07:00
Guo Dong 8763f1e5fa [TESTS] Fix PCIE device detection issue
The PCIE device could not be detected without this change.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2022-07-22 16:05:49 -07:00
Guo Dong 4a734902f1 [ADL] Adjust debug message level
Low debug message level to avoid too many
error message in the release build.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2022-04-26 07:49:50 -07:00
Guo Dong 388640654c [ADL] Add a new CPU ID support
Add a new CPU ID in the list.
And update debug message level to avoid
error message in the release build.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2022-04-26 07:49:50 -07:00
Guo Dong fde2520f5c [ADL] expose Lp5BankMode FSP UPD in SBL configuration data
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>
2022-04-26 07:49:50 -07:00
Guo Dong a7163e897a Support different CPU sort method
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>
2022-04-14 10:23:27 -07:00
Guo Dong c2e2dfa6ac Add BootToShell configuration item
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>
2022-04-13 14:07:43 -07:00
Guo Dong 37befc027c [ADL-TEST] Program TSN GPIO
Add TEST-S platform to program the TSN GPIO table.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2022-04-11 16:35:08 -07:00
Guo Dong 4a2acfd592 Enhance GenContainer.py
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>
2022-04-05 14:22:10 -07:00
Guo Dong 977450bae8 Add platform name (#1540)
* 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>
2022-04-01 11:55:11 -07:00
Guo Dong 23076e447a [RPLS] Update big core number default value (#1533)
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>
2022-03-29 16:28:11 -07:00
Guo Dong eb91954c66 [ADL] Add a new platform
Add a new SO DDR5 platform ID 0x31.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2022-03-23 14:27:51 -07:00
Guo Dong 7fa6a59174 Enhance build tool
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>
2022-01-14 11:08:31 -08:00
Guo Dong bf4a56033f Move DSO update/check to TccLib (#1444)
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>
2021-12-23 15:11:03 -08:00
Guo Dong 16d7d22040 Update BtgSign tool
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>
2021-12-16 08:11:53 -07:00
Guo Dong d0fac9b442 Enhance the tool
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>
2021-12-13 16:13:04 -07:00
Guo Dong 5d0195f962 Build SMM HOBs for universal payload
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>
2021-11-04 11:50:00 -07:00
Guo Dong 992d637f27 Add capsule image location info
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>
2021-11-01 20:55:26 -07:00
Guo Dong 2064c1f003 [TGL] Enabling WDT for TCC DSO
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>
2021-10-26 13:58:26 -07:00
Guo Dong 93d4460686 Add a common watch dog timer
This library provides a watch dog timer instance using
Over-Clocking Watchdog Timer.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2021-10-26 13:58:26 -07:00
Guo Dong 791d7a0beb Fix SMM rebase S3 issue (#1224)
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>
2021-07-14 19:33:04 -07:00
Guo Dong 3989cd5122 [TGL] Add EC config data for EC enable/disable
Use the ECEnable cfgdata, to disable all the EC
related code.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2021-06-11 08:31:32 -07:00
Guo Dong be9f726139 [EHL] Remove unused feature flag for PreOS checker
FEATURE_PRE_OS_CHECKER_BOOT is not used by any core or platform code.
So just remove it.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2021-06-10 13:31:16 -07:00
Guo Dong 64dca520ef [TGL] Make TCC setting consistent
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>
2021-06-10 13:30:58 -07:00
Guo Dong aa034dd72c Enhance gen_config_file in BuildUtility script
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>
2021-06-10 13:30:58 -07:00
Guo Dong 7886a8ec66 Remove unused code ever used for PreOsChecker (#1182)
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>
2021-06-09 15:59:42 -07:00
Guo Dong 7e53dc3e70 [TGL] Use MR2 FSP and Microcode for TGL-U (#1186)
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>
2021-06-09 15:51:00 -07:00
Guo Dong 29073e4782 Get RTCM from OS boot media instead IFWI (#1179)
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>
2021-06-09 08:05:56 -07:00
Guo Dong 8658d66c2b [TGL] Set PayloadId to "AUTO" by default
Update PayloadId to "AUTO" to align with other platforms to
have consistent behavior.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2021-06-04 11:14:34 -07:00
Guo Dong 99c9617db0 [TGL] Update PayloadId settings in dlt files
Update the comments and actual setting in dlt files to
make them in alignment.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2021-06-02 15:32:34 -07:00
Guo Dong a8bd06f8f2 [TGL] reset when TPM startup failure on S3
As per PC Client spec, SRTM should perform a host platform reset
when TPM startup failure on S3

Signed-off-by: Guo Dong <guo.dong@intel.com>
2021-06-02 15:32:34 -07:00
Guo Dong f7401ea952 [TGL] Minor code clean up
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>
2021-06-02 15:32:34 -07:00
Guo Dong 383a5b4e23 [TGL] Fix PlatformId override issue
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>
2021-05-27 09:33:04 -07:00
Guo Dong d14b67caff [TGL] Fix boot issue and enable SMM rebase
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>
2021-04-13 17:19:48 -07:00
Guo Dong 6c418f47f0 Update boot option Template
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>
2021-04-10 14:44:13 -07:00
Guo Dong f058ea7941 Update TCC config data strings
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>
2021-04-08 07:30:23 -07:00
Guo Dong d4f1efd8d6 Fix the boot option
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>
2021-04-01 17:02:25 -07:00
Guo Dong ed93255929 [TGL] Add TCC V2 support (#1081)
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>
2021-03-31 13:06:26 -07:00
Guo Dong c551826af5 Add TCC V2 support
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>
2021-03-30 22:09:00 -07:00