Commit Graph

892 Commits

Author SHA1 Message Date
jinjhuli b22ae3c147 [EHL] Initial silicon package baseline for EHL platform support
Build command
python BuildLoader.py build ehl

Stitch command
python Platform/ElkhartlakeBoardPkg/Script/StitchLoader.py
-i <EXISTING_IFWI_IMAGE>
-o <SBL_IFWI_IMAGE>
-s Outputs/ehl/SlimBootloader.bin

*Both command will only works after adding Elkhartlake platform
package in upcoming patch.

Signed-off-by: jinjhuli <jin.jhu.lim@intel.com>
2021-01-21 08:19:50 -07:00
Maurice Ma ee92586656 Fix 32bit payload calling convention
Current Execute32BitCode() passes in 64bit arguments into stack.
It should use 32bit arguments instead according to 32bit calling
convention. This patch fixed this issue.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-01-20 13:58:12 -08:00
jinjhuli 0d91f28053 [EHL] Initial platform package baseline for EHL platform support
Build command
python BuildLoader.py build ehl

Stitch command
python Platform/ElkhartlakeBoardPkg/Script/StitchLoader.py
-i <EXISTING_IFWI_IMAGE>
-o <SBL_IFWI_IMAGE>
-s Outputs/ehl/SlimBootloader.bin

Signed-off-by: jinjhuli <jin.jhu.lim@intel.com>
2021-01-19 22:04:24 -08:00
Raghava Gudla 46e4a98cd1 Get SVN ver from capsule during firmware update
During firmware update svn check for SBL region, Current code
assumes that Stage1A base does not change, because of this when
Stage1A base changed in capsule image, getting svn version from
the capsule fails and firmware update is failing.

This patch addressed above issue by reading stage1A base from
capsule image, this way even if stage1A base changes, code will
be able to read it and get svn version from capsule.

Signed-off-by: Raghava Gudla <raghava.gudla@intel.com>
2021-01-16 09:41:04 -07:00
Guo Dong 78cce60ce8 Enhance PreOS support
SBL support to load PreOS and normal OS in a single boot option.
This patch tries to standardize the PreOS support.
The PreOS could be TrustyOS, PreOsChecker or others.
As long as PreOS flag is set in boot option, SBL will load and
boot PreOS before normal OS. If the preOS has specific requirement,
it could be addressed using PreOS image type.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2021-01-15 21:29:43 -07:00
Jim Pelner b233392924 Corrected invalid octal constant declarations TGL ASL
Corrected declaration of _PSD methods (ApPsd.asl) and _TPC, _PTC,
_TSS and _TSD methods (ApTst.asl) under index 10. Indexes 8 and 9
were declared 08 and 09, respectively, which represent invalid
"octal" constants. These were not flagged as errors in the currently
supported ASL compiler, but these the ACPI specification clearly
indicates these were invalid, and they would actually flag an error
when the recommended ASL compiler is updated to a newer version.

Signed-off-by: Jim Pelner <jim.pelner@intel.com>
2021-01-15 14:10:01 -07:00
Subash Lakkimsetti 1f0b99cf3b Update get_openssl_path to return absoulte path
Tools as MEU used for signing and generating key manifests
expects to pass abosulte openssl paths. Updating
get_openssl_path to return paths for linux cases.

Signed-off-by: Subash Lakkimsetti <subash.lakkimsetti@intel.com>
2021-01-15 13:24:07 -07:00
Guo Dong c408c94737 use different workspace to prepare binaries
Different projects might use different repo to get binaries.
or different project might be built at same time. so change
to use different workspace for different project to avoid
potential conflict.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2021-01-14 10:47:02 -08:00
Maurice Ma a85f327ad8 Enhance BGRT BMP support for logo display
BGRT can be used by bootloader to pass logo to OS. But BGRT can
only support 24bit or 32bit BMP format. If the bootloader uses
other bit format or indexed color format, the image has to be
converted before passing it to BGRT. This patch added support
to convert other BMP image format into 32bit format required by
BGRT.

This has been tested with Windows on Leafhill board. The SBL
logo was dispalyed properly while booting Windows.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-01-14 09:52:36 -08:00
Talamudupula 4f981f69ae Add missing EFIAPI in GpioSocLib.h
Adding the EFIAPI modifier to make sure all lib
function calls follow correct calling convention.

Signed-off-by: Talamudupula <stalamudupula@gmail.com>
2021-01-13 17:23:28 -07:00
Sai Talamudupula d3f601b67d Add common GpioLib
This patch adds a common GpioLib that all platforms
can link to. Common GpioLib requires platforms to
implement the GpioInfoLib to provide platform-specific
information like GroupInfo etc.

Signed-off-by: Sai Talamudupula <sai.kiran.talamudupula@intel.com>
2021-01-13 10:56:15 -07:00
Praveen Hp b111c8f75e [CFL]Fix payload selection GPIO issue
WHL CRB board is configured to boot different payload based on GPIO pin
status, which is not working currenly.
this patch ensures to boot to Osloader payload when PayloadSelGpioData=1
otherwise boot to UEFI payload.

TEST= Boot test on WHL CRB and verified board able to switch between
OSloader & UEFI payload based on DIP switch R4H1B_4 status.

Signed-off-by: Praveen Hp <praveen.hodagatta.pranesh@intel.com>
2021-01-12 14:41:06 -08:00
jinjhuli f3076fbb60 [TGL] Update flags to align with UEFI BIOS
Updated flags that missed out from baseline patch
and to align with UEFI BIOS.

Signed-off-by: jinjhuli <jin.jhu.lim@intel.com>
2021-01-12 15:12:56 -07:00
Maurice Ma 86a24b8171 Fix GenContainer python scripts
After GenContainer script was created, there ware more changes
introduced for signing and compression. However, GenContainer
was not updated to match those new changes. This patch addressed
this issue.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-01-12 15:06:58 -07:00
jinjhuli 7bbc273c1b
Revert "[CMLV] Fix PMC register offset value (#887)" (#951)
This reverts commit b53de73b53.
Revert the particular commit to solve Gpio error.

Signed-off-by: jinjhuli <jin.jhu.lim@intel.com>
2021-01-12 14:04:00 -08:00
Sachin Agrawal e3cedba233 Handle TPMStartup error during S3 resume
As per TCG spec, if a Tpm2Startup(TPM_SU_STATE) fails during
S3 resume, a host reset should be done.

When BootGuard is enabled, ACM will notify of this failure via Bit46 in
BootGuardBootStatus register.


Signed-off-by: Sachin Agrawal <sachin.agrawal@intel.com>
2021-01-11 12:43:11 -08:00
Guo Dong 12067aac3f [TGL] Add missing binary files
Added missing SPD config files.
And removed TsnMacAddr.bin requirement from build.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2021-01-11 12:41:33 -08:00
jinjhuli 94aa044b1a [TGL] Initial platform package baseline for TGL platform support
- Build command
  python BuildLoader.py build tgl

- Stitch command
  python Platform/TigerlakeBoardPkg/Script/StitchLoader.py
  -i <EXISTING_IFWI_IMAGE>
  -o <SBL_IFWI_IMAGE>
  -s Outputs/tgl/SlimBootloader.bin

Signed-off-by: jinjhuli <jin.jhu.lim@intel.com>
2021-01-11 08:37:11 -07:00
Guo Dong 89c7b82b84 Fix the HelloWord build failure
Add required library for HelloWorld build.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2021-01-11 08:20:30 -07:00
Talamudupula c62c995e49 Update correct BarType field for VF Bar program
ProgramBar() routine uses 'OrgBarType' field to
determine BarType. So, if a BarType is valid, copy
it to OrgBarType for VF also.

Signed-off-by: Talamudupula <stalamudupula@gmail.com>
2021-01-07 20:22:54 -08:00
Guo Dong 5873b52d6b Add '.exe' extension if missing for windows build
run_process is used several places. Sometime
the extension name is not given for windows build.
In this case, if same file without file extension
exist (e.g. fit and fit.exe), then fit will be used
for windows build. It is not expected, so this patch
will add the missing .exe extension for this case.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2021-01-07 08:55:17 -07:00
Maurice Ma a2725951ad Removed deprecated python imp module usage
Python 3.4 and above have deprecated imp module in favor of
importlib.  This patch removed imp module usage from SBL, and
used importlib instead.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-01-06 11:16:59 -08:00
Divneil Rai Wadhawan e028de5c4a [CommonSocPkg]: Remove ME BIOS Payload (MBP) handling from HeciLib
o MBP is platform specific data which may be different for derivative
  platforms, so, the handling is moved back to platform code

Signed-off-by: Divneil Rai Wadhawan <divneil.r.wadhawan@intel.com>
2021-01-06 11:11:45 -08:00
James Gutbub 6a1ad8f5e3 Make Python lz4 module optional
To avoid any dependency on non-standard python modules
it is preferred to make the binary Lz4 compression the
default flow and try the python module as a backup. Also
recommend to use a known working version of the lz4
python module, 3.1.1.

Signed-off-by: James Gutbub <james.gutbub@intel.com>
2021-01-04 15:05:50 -08:00
James Gutbub ab49d6c9a0 Use Python lz4 module for LZ4
To make SBL scripts/tools more OS-agnostic the
lz4 (de)compression module can be used instead of
relying on the BaseTools LZ4 package/executable.

Need to update the azure pipeline to install
the python lz4 module before running the builds.

TEST=Confirmed that the python lz4.block.compress
     routine is compatible with Lz4DecompressLib
     during SBL runtime to decompress LZ4 binaries.

Signed-off-by: James Gutbub <james.gutbub@intel.com>
2020-12-22 13:19:52 -08:00
jinjhuli 99fe66faf8 [TGL] Initial silicon PCH package baseline for TGL platform support
Build command
python BuildLoader.py build tgl

Stitch command
python Platform/TigerlakeBoardPkg/Script/StitchLoader.py
-i <EXISTING_IFWI_IMAGE>
-o <SBL_IFWI_IMAGE>
-s Outputs/tgl/SlimBootloader.bin

*Both command will only works after adding Tigerlake platform
package in upcoming patch.

Signed-off-by: jinjhuli <jin.jhu.lim@intel.com>
2020-12-21 09:17:23 -07:00
jinjhuli 36714c6745 [TGL] Initial silicon package baseline for TGL platform support
- Build command
  python BuildLoader.py build tgl

- Stitch command
  python Platform/TigerlakeBoardPkg/Script/StitchLoader.py
  -i <EXISTING_IFWI_IMAGE>
  -o <SBL_IFWI_IMAGE>
  -s Outputs/tgl/SlimBootloader.bin

*Both command will only works after adding Tigerlake platform
package in upcoming patch.

Signed-off-by: jinjhuli <jin.jhu.lim@intel.com>
2020-12-18 08:51:37 -07:00
Talamudupula 29ecb88d14 Fix ModuleGuid print in FPDT record
This patch prints the correct ModuleGuid in FPDT.

Signed-off-by: Talamudupula <sai.kiran.talamudupula@intel.com>
2020-12-17 06:10:53 -08:00
Subash Lakkimsetti 72ab5b437a Openssl 1.1.1i tool support
Openssl 1.1.1 is an installable and it creates
openssl.exe in a bin folder.
default slimboot path: c:\Openssl\bin\openssl.exe

Added support to populate OPENSSL_PATH
from bin dir incase its available.

Signed-off-by: Subash Lakkimsetti <subash.lakkimsetti@intel.com>
2020-12-16 13:27:51 -08:00
Perni e41578e663 TGL KW issue 19321
Added check for swpart to avoid accessing out of array elements

Signed-off-by: Perni <ramesh.chandra.perni@intel.com>
2020-12-15 23:01:41 -07:00
Praveen Hp c1aa50eac6 Print readable MRC status
Print MRC status to defferentiate first flash boot and MRC fast boot.
if Debug logs print status as 'Already started', it means MRC data in
SPI flash is matched and saving is skipped.

for example,
First flash boot:
   MRC data successfully cached to 0x1FF000
   Save MRC Training Data (0x8D131480 0x0018E0) ...Success

MRC fast boot:
   Save MRC Training Data (0x8D131398 0x0018E0) ...Already started

Signed-off-by: Praveen Hp <praveen.hodagatta.pranesh@intel.com>
2020-12-15 14:08:46 -08:00
Aiden Park eabaac12ad Add PCI Resource Allocation Table
This introduces a new PCD 'PcdPciResAllocTableBase' to allow a platform
to provide its specific PCI resource allocation pool at runtime.
PCI Enumerator will allocate required resources in the range.
If the PCD is not provided, a default range will be used.

Signed-off-by: Aiden Park <aiden.park@intel.com>
2020-12-15 14:05:25 -08:00
Aiden Park 67cb685614 [APL] Fix the infinite reboot issue in firmware update
This will fix an invalid data size of HECI_REQ_IFWI_PREPARE_FOR_UPDATE
command. Due to the invalid data sent, CSE rejected the IFWI prepare
update request and it caused infinite reboot issue.

The Issue #925 will be addressed with this patch.

Signed-off-by: Aiden Park <aiden.park@intel.com>
2020-12-13 21:26:15 -08:00
Praveen bf3f3d2e06
[CFL]: Fix onboard display issue on CFL-S & CFL-H (#922)
As per board design the DDI ports are routed as per below,

CFL-S:
DDI1-->PORTB-->LSPCON-->HDMI
DDI2-->PORTC-->DP
CFL-H:
DDI1-->PORTB-->DP1
DDI2-->PORTC-->DP2
DDI3-->PORTC-->LSPCON-->HDMI

Hence add separate VBT binaries accordingly.

-Set HPD of DDI port F to disable as default since it's not used by
 H/S/U processor line.

TEST: verified onboard display's ports booting to UEFI shell & Yocto.

Signed-off-by: Praveen Hp <praveen.hodagatta.pranesh@intel.com>
2020-12-11 17:40:09 -08:00
James Gutbub c7a1ca0da3 Add EXT4 to print in 'boot' command
Since the EXT library we have in OS Loader
supports 2, 3, and 4 it will help to reduce
confusion for users who have noticed that
only 2 and 3 are currently printed.

Signed-off-by: James Gutbub <james.gutbub@intel.com>
2020-12-07 22:39:41 -08:00
Maurice Ma c4de1ca3e0 [CFL] Fix DEBUG FSP build error
Current CFL SBL build with DEBUG FSP will fail due to size issue.
This patch fixed this issue by adjusting size properly when DEBUG
FSP is used.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2020-12-07 22:39:03 -08:00
Maurice Ma 0c284e3612 Fix path issue for WORKSPACE variable
This patch fixed one issue on the WORKSPACE path. The current
script used "realpath" instead of "abspath".  It will cause issue
if "subst" is used for the drive path since it returns the real
path before "subst".  The expected behavior is to use the
path after "subst".

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2020-12-03 14:25:25 -08:00
Maurice Ma 6117ebaa7c Enable ACPI BGRT table support
This patch enabled ACPI BGRT support. It is used to pass splash
display information from bootloader to payload and OS.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2020-12-02 12:40:18 -08:00
Aiden Park 0b7c653cfd Allow PatchCheck only in PR condition
The master build trigger does not have PullRequest variable.
This will allow PatchCheck to be run only in PR condition.

Signed-off-by: Aiden Park <aiden.park@intel.com>
2020-12-02 07:41:46 -08:00
Maurice Ma 8be5159c25
Enable PatchCheck script for Azure Pipelines (#915)
The current PatchCheck does not work properly in Azure Pipelines.
Synced up with EDK2 to update script to address this issue.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2020-12-01 22:37:11 -08:00
Chin Keong Ang d6d21f507e Config Editor: Update default yaml file search dir
User experience improvement:
If there is no yaml found in current directory
then default to start browsing at platform directory

Signed-off-by: Chin Keong Ang <chin.keong.ang@intel.com>
2020-12-01 20:55:00 -08:00
Chin Keong Ang 653382dbd1 Fix hang at STAGE1B when compile with MSVC 2017 for IA32 Debug
Removed the Oy- flag for DEBUG_VS2017_IA32_CC_FLAGS
which was introduced recently in commit 9f3d2b5fc3
it causes hang when calculating SHA384 by CryptoLib call by SecureBootLib driver

Signed-off-by: Chin Keong Ang <chin.keong.ang@intel.com>
2020-12-01 20:54:10 -08:00
Maurice Ma 7ec367c38f Enable Windows build target for Azure Pipelines
This patch enabled Windows build targes for APL, CFL, CML, CMLv
and QEMU.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2020-12-01 16:38:38 -08:00
Maurice Ma e51ab53016 Enhance grub.cfg to support CentOS
CentOS live CD iso image has different path for grub.cfg file. It
also used "linuxefi" and "initrdefi" for keywords. This patch added
support for it. With this patch, verified it can boot to CentOS
live-cd on APL platform.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2020-12-01 16:19:21 -08:00
Maurice Ma 5f1923604d Fix InitRd image alignment issue
Current SBL used AllocatePool to allocae space for Linux files
including Kernel and InitRd. However, since InitRd is required to
be aligned at page boundary, it needs to use AllocatePages instead.
This patch addressed this issue. It fixed #908.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2020-12-01 13:09:34 -08:00
Maurice Ma 589238aeed Set up initial CI with Azure Pipelines
Migrated to Azure Pipelines for SBL CI to align with EDK2 project.
This is an initial commit to enable basic check. Currently it will
verify patch format and QEMU GCC build and test.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2020-12-01 12:38:53 -08:00
Singh Nitin G 7011ce1bf0 Fix HeciGetFwCapsSkuMsg api to update MBP
Made changes to ensure the ME BIOS data information
is correctly reported.

Signed-off-by: Divneil Rai Wadhawan <divneil.r.wadhawan@intel.com>
2020-11-24 15:40:54 -08:00
Maurice Ma c6feaaf3e3
Add ACPI RSDP to Linux BOOT_PARAMS (#905)
For UEFI Linux boot, a new parameter was added into BOOT_PARAMS.
This patch added this parameter support so that ACPI base can
be passed directly to kernel.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2020-11-22 21:08:19 -08:00
Maurice Ma bd07c6504c
Add legacy EF segment memory config (#904)
Current SBL code will build pointers in E/F segment for ACPI
and SMBIOS table. On some platforms, E/F segment is not supported.
So a new configuration ENABLE_LEGACY_EF_SEG is added.  When
it is enabled, SBL will not use legacy E/F segment memory.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2020-11-22 21:06:38 -08:00
Maurice Ma 9cf145bf57 Allow platform to override SOC or board specific inf files
In current SBL BootloaderCorePkg dsc and fdf files, it contains
hard-coded INF file path for SOC or board, such as ACPI INF
file and SOC/Board init library INF file. It makes it hard for
platform to provide its own overriding using different path.
This patch addressed this issue by allowing platform to override
the default paths in BoardConfig.py.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2020-11-13 16:03:39 -08:00