Commit Graph

331 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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 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
Guo Dong 7979fc9329 Update Microcode path to support customization
Microcode module locates in different place.
so each platform could specify the path by
MICROCODE_INF_FILE in BoardConfig.py.
By default, it uses the same path if there
is no MICROCODE_INF_FILE defined in platform.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2020-11-06 13:38:03 -07:00
Aiden Park 2d7c2b920f Add PCI resource downgrade option for all Bus-0 devices
In 64-bit operation, some PCI devices have high mmio BARs,
but 32-bit FSP can only access 32-bit memory space.
This introduces and additional PCI resource downgrade option
to downgrade all PCI devices under Bus-0.
- self._PCI_ENUM_DOWNGRADE_BUS0 = 1
  Force to have 32-bit BAR for all Bus-0 devices

Signed-off-by: Aiden Park <aiden.park@intel.com>
2020-11-02 10:57:15 -08:00
Aiden Park 149b0f03dc Revert "Reserve Pcie config space region as a reserved memory"
This reverts commit cadc49893b.
2020-10-30 10:40:14 -07:00
Guo Dong d909151879 Add build config for fastboot
With this flag, platform could update the settings to
get the expected boot performance data

Signed-off-by: Guo Dong <guo.dong@intel.com>
2020-10-28 09:18:51 -07:00
Aiden Park cadc49893b Reserve Pcie config space region as a reserved memory
This will report pcie config space region as a reserved memory in e820
and let Linux use the PCI MMCONFIG which has bus range information.
If it is not reserved, the pcie config space region will be freed/available
for PCI devices.

Signed-off-by: Aiden Park <aiden.park@intel.com>
2020-10-21 12:10:20 -07:00
Maurice Ma b6d2c307af Fix duplicated PlatformId in DLT file
Using ConfigEditor to save back DLT changes, it will produce two
PlatformId lines in DLT file. This patch removed the extra line.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2020-10-19 23:35:51 -07:00
Maurice Ma 5eb9ae3d46 Fix save full delta file issue in ConfigEditor
Current ConfigEditor produces the same result for
"Save full cfg data" vs "save cfg changes".  This patch provided
a fix for it.  It fixed #882.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2020-10-16 13:20:33 -07:00
Maurice Ma eb43c7e8f4 Fix default value change issue in ConfigEditor
In ConfigEditor, while scrolling page using mouse middle wheel,
the Combo configuration items will change its default value. It
is because Combo control will bind MouseWheel event by default.
To address it, added code to unbind it explicitly.

It fixed #878.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2020-10-14 15:07:53 -07:00
Maurice Ma 1002d880a2 Enable mixed payload mode calling
Since SBL could be built into either x86 or x64 mode, and the payload
can also be x86 or x64 mode. When mixed modes are used, it is required
to switch to proper mode first before calling into payload entrypoint.
This patch added this check to switch to required mode before calling
into payload entry point.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2020-10-12 13:01:07 -07:00
Maurice Ma 9a4407018d [QEMU] Fix NOOPT build failure
This patch fixed NOOPT build failure for QEMU.
It fixed #871.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2020-10-12 13:00:44 -07:00
Aiden Park 26a24f5ab2 [CFL] Fix the ucode checkout issue
This will fix the ucode repo checkout issue on 'cfl' target.

FYI, here are simple steps to reproduce.
1) Build 'apl' target first
2) Build 'cfl' target -> fails to checkout ucode repo

Signed-off-by: Aiden Park <aiden.park@intel.com>
2020-10-08 13:07:46 -07:00
Maurice Ma dd8fe22046 Add MultiBoot support for X64 build
During X64 enabling, there was a pending task to enable 32bit
MultiBoot support. It is not implemented.  This patch added the
support to allow X64 SBL to boot a 32bit MB image through thunking.
As part of this patch, the ThunkLib is separated from the FspApiLib
so that it can be shared by other component.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2020-10-07 14:20:50 -07:00
James Gutbub 467c804172 Add IGD Op Region version macros
Different SoCs can use different versions of
Gen graphics and subsequently may use different
versions of the IGD Op Region; the OVER variable
will determine how the OS GFX driver interprets
the IGD Op Region provided in ACPI space.

Signed-off-by: James Gutbub <james.gutbub@intel.com>
2020-10-02 21:20:11 -07:00
Maurice Ma 5f5cbaebaa Represent data in required format in ConfigEditor
Current ConfigEditor relies on the original input data format in YAML
to determine how to represent data in GUI. For example, if the data
value is HEX in YAML, then the data will be displayed in HEX format.
This patch switched to use the specified format type to reformat the
value string so that the display is always consistent with the required
format type.

It fixed #844.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2020-09-15 07:33:14 -07:00
Guo Dong cfba21067c Add EndOfStage callback in S3 flow
EndOfStage callback is missing in S3 boot flow.
so just add it in case platform need do something.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2020-09-10 17:24:52 -07:00
Maurice Ma 98b55affa1 Add payload module support in OsLoader
This patch added support to launch payload module on top of OsLoader.
Comparing with payload binary, payload module will utilize the API
services provided by OsLoader, so it will have smaller size. Other
than this, the concept is exactly same as normal payload. For payload
module, additional parameter is required to pass into the payload
module entry point.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2020-09-02 15:42:36 -07:00
Maurice Ma d6a4598869 Add SBL Setup tool and feature PCD
This patch added SBL python setup script. It can run on either host
or target MicroPython environment. A new PCD PcdEnableSetup is added
to control if Setup feature should be supported by core.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2020-09-02 15:42:36 -07:00
Subash Lakkimsetti febbb749ff SVN for container component signing
Add svn parameter when component is signed
using command line mode.

Signed-off-by: Subash Lakkimsetti <subash.lakkimsetti@intel.com>
2020-09-01 17:59:59 -07:00
Sindhura Grandhi aeef6df940 Generate zero size dummy data in the Component Entry
This patch generate a component binary of zero size if not
already present.

Signed-off-by: Sindhura Grandhi <sindhura.grandhi@intel.com>
2020-08-24 14:41:35 -07:00
Maurice Ma 61b56613f8 Add VS2019 build support
This patch added VS2019 build support.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2020-08-14 12:49:44 -07:00
Aiden Park 21e9d1a51e Check PPB decode space and assign BAR accordingly
All child devices under a PPB must be in scope of its PPB's decode space.
Therefore, all PPB checks the decode capability and downgrades its child
devices' resources accordingly.

Signed-off-by: Aiden Park <aiden.park@intel.com>
2020-08-12 17:18:04 -07:00
Maurice Ma 162b849e11 Add HelloWorld payload example
This patch added an example on how to build a HelloWorld payload
from separate DSC file.

To build a standalone HelloWorld payload, use the following command:
  BuildLoader.py build_dsc -p PayloadPkg\PayloadPkg.dsc

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2020-08-12 12:33:20 -07:00
Maurice Ma 3899916563 Generate CFGDATA json file in build process
CFGDATA json can be used for CFGDATA representation. This patch
enabled generating CFGDATA json file. It can be used by target
to parse CFGDATA items.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2020-08-11 19:11:41 -07:00
Maurice Ma ae40b7164d Adjust search path for GenContainer script
This patch allowed GenContainer to search for the input
component binaries from both input and output directory.
It is useful when the component binary is in build FV
directory.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2020-08-11 19:11:41 -07:00
Maurice Ma 1ed701be11 Fix P2P bridge alignement issue
The following commit 9fcb3a6be1
caused a regression on PCI bridge resource allocation. At minimum
the PCI bridge needs to have IO apperture aligned at 4KB and MMIO
apperture aligned at 1MB. The new code did not adjust the
alignment for P2P bridge following this rule.  This patch fixed
this issue.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2020-08-10 17:19:51 -07:00
Maurice Ma 9fcb3a6be1 PCI resource allocation minor adjustment
This patch adjusted some alignment on PCI resource allocation so
that PCI resource is more efficently utilized. It aslo adjusted
the framebuffer MTRR range to match PCI resource allocation.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2020-08-08 06:53:25 -07:00
Subash Lakkimsetti d2d1da84ed Tool for External Key Hash store generation
This patch adds initial support for external public
key hash store generation in container format.
It uses layout file as input with usage and key file or id.
Common functionality available is resued for KEYH
component generation.

Signed-off-by: Subash Lakkimsetti <subash.lakkimsetti@intel.com>
2020-08-06 12:09:32 -07:00
Maurice Ma 37f3366da0 Fix some Klocwork scanning issues
This patch fixed some Klocwork scanning issues reported by the new
version.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2020-08-06 12:02:37 -07:00
Maurice Ma 36b8e0a3c4
Fix PCI enumeration issue with multiple PCI bridges (#801)
When multiple level of PCI bridges exists on a platform, current
SBL PCI bus library could not find all devices. This issue was
caused by incorrect root bridge bus limit got from the data
structure. This patch fixed this issue.
It also fixed #800.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2020-08-06 11:32:53 -07:00
Subash Lakkimsetti 76eec9a127 Configdata firmware update svn check
Add support for security version check for
config data blob update. SVN is checked
for redundant region which would be updated.

Fixed python errors in CfgDataTool and
GenCapsuleFirmware.

Signed-off-by: Subash Lakkimsetti <subash.lakkimsetti@intel.com>
2020-08-05 13:49:45 -07:00
Maurice Ma ce21d58ef6 Enforce Python3 for SBL build
This patch will enforce to use python 3.6 or above to build SBL.
Python 2.x is EOL, so drop the support from now.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2020-08-05 08:18:58 -07:00
Raghava Gudla 9f37517921 Added firmware update trigger script for Linux
This script is intended to be called by firmware update
application to triggere firmware update after receiving
update capsule in Linux. This script is provided as a
reference implementation and does the following:

1. Copies the capsule to a known location where SBL
   will look for (/boot/efi/FwuImage.bin)

2. Signals FW update to SBL using the WMI interface
   provided by SBL. The WMI interface is provided
   by the ASL (https://github.com/slimbootloader/slimbootloader
/blob/master/Platform/CommonBoardPkg/AcpiTables/Dsdt/FwuWmi.asl)
   and linux kernel driver (https://lkml.org/lkml/2020/4/27/1289)

Reboot command was removed from the script, need to be
included if required.

Signed-off-by: Raghava Gudla <raghava.gudla@intel.com>
2020-08-04 09:38:41 -07:00
Maurice Ma bd63dac72a Expland embedded file value in generated YAML file
The final generated YAML file under Build folder should include
everything required. However, current tool will not expand the
embedded binary file. This patch addressed it.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2020-08-04 09:00:34 -07:00
Maurice Ma 087eed1f8e [APL] Structure changes to make build pass
The new YAML format represented some data structure a little bit
differently from original DSC format. This patch did minor adjustment
to make the build pass on APL platform.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2020-08-03 10:43:35 -07:00
Maurice Ma 7822e69364 Updated tools to support CFGDATA yaml format
This patch modified required tools ConfigEditor, GenCfgData, etc to
support YAML CFGDATA format.

To convert existing DSC to YAML, Dsc2Yaml tool can be used.
For example, to convert QEMU DSC to YAML, the following can be used:
  python Dsc2Yaml.py -i Platform\QemuBoardPkg\CfgData\CfgDataDef.dsc
It will generate all required YAML files at current directory.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2020-08-03 10:43:35 -07:00
Maurice Ma d8258bebf2 Enhance efficiency some basic common python functions
This patch improved some function implementation in CommonUtility.py.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2020-07-21 17:29:10 -07:00