Commit Graph

725 Commits

Author SHA1 Message Date
James Gutbub 7371a65cae Add BootFlags selection to 'boot' command
The boot command currently does not allow you
to enter the BootFlags value which is needed
for some boot images.

Also fix a small issue in the FsType selection
code block.

Signed-off-by: James Gutbub <james.gutbub@intel.com>
2020-08-18 15:21:04 -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
Maurice Ma 90ca0f11dd Allow boot from container component
This patch added support to boot from a component inside a container
from OsLoader. Now a boot option for SPI/memory device can be used
to boot from container component by specifying the boot image name
as '!AAAA/BBBB' format. AAAA is the container name and BBBB is
the component name. This component can be FV/TE/PE image format.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2020-08-14 10:27:29 -07:00
Raghava Gudla 4bee65a8f6 Fix an issue in firmware update
This patch fixed an issue in firmware update. During the saved capsule
signature verification against the capsule signature to make sure
that the capsule did not change during the reboot, instead of using
length of the signature, used the size of the macro that indicate the
length of the signature.

Verified that firmware update is able to pass on WHL.

Signed-off-by: Raghava Gudla <raghava.gudla@intel.com>
2020-08-13 18:10:01 -07:00
Maurice Ma 0000d110a2 Add interface to draw framebuffer from text buffer
This patch added new DrawFrameBuffer interface. It will draw the
framebuffer from a VGA like text buffer. Payload can use this
to sync its own text buffer onto framebuffer screen. It aslo added
extend ASCII char support so that some table char can be displayed.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2020-08-12 18:45:10 -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 8aeed6fd9a Add functions to build CFGDATA from database
This patch added new function to build a full set of the CFGDATA set
from the memory for current platform. It is useful for exporting
current platform CFGDATA for further processing.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2020-08-12 12:33:45 -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 d787a10a77 Extend SBL build process to build individual component
Current SBL build script can only be used to build SBL image.
It would be helpful if it can be extended to support build individual
DSC component, such as some other standalone payload. This patch
introduced a new subcommand "build_dsc" to enable this capability.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2020-08-12 12:32:25 -07:00
Subash Lakkimsetti 39a1f09f01 Provide HeciBaseAddr with GetBootGuardInfo
ME PCI device number is platform dependent and
heci base address is provided with common
CBnT GetBootGuardInfo.

Signed-off-by: Subash Lakkimsetti <subash.lakkimsetti@intel.com>
2020-08-12 12:28:10 -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 6eac355a33 Fix Linux Framebuffer
Linux framebuffer screen_info has been extended to support 64bit
address. This patch added extra fields and set the upper 32 bit
for the framebuffer base.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2020-08-10 10:38:41 -07:00
Maurice Ma 5aa2ad6fb7 Add error check for Stage FV size
When the Stage FD size is set to be smaller than the FSP component
size, it will produce negative FV size value in DSC file and cause
build exception. This patch added more checks to catch this in the
pre-build process.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2020-08-10 10:12:23 -07:00
Maurice Ma 67e6599714
[QEMU] Add general setting CFG page (#803)
This patch added the missing general configuration settings for
QEMU platform.  It also addressed a build issue due to non-ascii
chars in the IPP file.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2020-08-10 09:56:25 -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 205b93df40 IPP crypto library sync
This patch aligns IPP crypto repo sources and headers,
- Update license headers as per IPP crypto
- Naming convention updates
- Partial clean up.

ASM updates will be addressed in next patches.

Signed-off-by: Subash Lakkimsetti <subash.lakkimsetti@intel.com>
2020-08-06 18:55:52 -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 091ba856c6 Move GetHashToExtend to SecureBootLib
This patch moved GetHashToExtend function from BootloaderCommonLib
to SecureBootLib. It is a better place to contain this interface.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2020-08-06 12:08:30 -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 27b196f490 [APL] Add MEM64 PCI resource in ACPI
This patch enables OS to allocate 64bit PCI resource on APL platform.
It will help resolve some cases where 32bit PCI resource is very
limited.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2020-08-05 11:53:19 -07:00
Subash Lakkimsetti 3a66c9857a Remove condition for capsule payload size alignment
Capsule payload size is checked for 4K block allign
and this restriction is not required. Updates as container
or other components generated capsule size can be
any size.

Signed-off-by: Subash Lakkimsetti <subash.lakkimsetti@intel.com>
2020-08-05 11:36:34 -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
Maurice Ma 76eac25201 [APL] Fix reference to DSC file in output image
Since SBL moved to use YAML rather than DSC. The refrence needs to
be fixed to use yaml files too.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2020-08-05 08:16:43 -07:00
Sai Talamudupula ac66d62da1 Fix AHCI init failure when NumPort=0
When a SATA controller has no Ports Implemented
behind it, AHCI mode init returns error even before
allocating buffers for RFis, CommandTable, CommandList.
So, AHCI de-init expects them to be NULL, else any
garbage value for these fields forces the code to do
a FreePool on non-allocated memory.

Signed-off-by: Sai Talamudupula <sai.kiran.talamudupula@intel.com>
2020-08-05 06:39:09 -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 c49b27dfc2 Convert CFGDATA DSC file into YAML file
As discussed in the RFC, SBL will use YAML format for CFGDATA format
going forward. This patch converted CFGDATA files from DSC format into
YAML format for QEMU, CFL and APL platforms.

To convert existing DSC file into YAML file, please use tool:
python BootloaderCorePkg\Tools\Dsc2Yaml.py  <Path to CfgDataDef.dsc>

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2020-08-03 10:43:35 -07:00
Maurice Ma 77673de0cc Enable python3 in windows travis build
This patch switched to use python3 for Windows travis build.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2020-07-31 10:22:26 -07:00
Maurice Ma 2c834d4e6f Add handling for removing certain ACPI table at runtime
This patch fixed some ACPI issue on APL platform.  When VT-d is
disabled, DMAR table should not be populated in ACPI. This patch
fixed it.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2020-07-31 10:20:23 -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
Maurice Ma 9f8d77a002 Use standard template for GEN_CFG_DATA CFGDATA
This patch utilizes the standard CFGHDR_TMPL for GEN_CFG_DATA.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2020-07-21 08:54:08 -07:00
Guo Dong 91d4104ff0 Add LowPowerIdleTable header file
this header file is copied from EDK2 MdePkg and used for low power support.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2020-07-16 13:47:23 -07:00
James Gutbub 6dbdbbe4e5 Add Multiboot image support to PreOsChecker flow
The pre-OS checker/payload flow can support more than
just Linux image type launching; there are use cases
for adding multiboot image support to this flow and
there may be others in the future.

Signed-off-by: James Gutbub <james.gutbub@intel.com>
2020-07-15 06:32:15 -07:00
Subash Lakkimsetti 01c6f83fbc Enhancements to GenerateKeys tool
Currently this tools creates keys and replaces existing ones.
Added user confirmation before existings ones are replaced.
Selecting all replaces subsequent keys getting generated.
Update OS private key name to OS1_TestKey_Priv_RSA3072.pem.

Signed-off-by: Subash Lakkimsetti <subash.lakkimsetti@intel.com>
2020-07-14 13:47:44 -07:00
Maurice Ma 8df013e4df Add InitRd loading for Linux payload
Current Linux payload support in SBL only loads command line and
kernel image, and it does not load InitRd image. It is possible
to have the InitRd image built into the keneral image, but it is
more convenient to have separate InitRd support. This patch added
this.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2020-07-13 10:30:54 -07:00
Subash Lakkimsetti c8bda59231 Capsule update command for SVN commit
Capsule Command support added for anti rollback
security version number. User can create command
in text file and create capsule with CMDI mode.

{ARBSVNCOMMIT}

Platform APIs would be invoked to do SVN
commit operations by useing HECI interfaces.

Signed-off-by: Subash Lakkimsetti <subash.lakkimsetti@intel.com>
2020-07-10 07:47:21 -07:00
Subash Lakkimsetti 57c11052cd Check LocateComponentEntry outputs before its consumed
LocateComponentEntry is modified to locate only container
entry. Additional checks are required at consumer end
for Container entry and CompEntry.

Signed-off-by: Subash Lakkimsetti <subash.lakkimsetti@intel.com>
2020-07-08 20:08:30 -07:00
Subash Lakkimsetti 2e86a775be Add default svn for command line container creation
Use default svn while creation of container using command line
when user do not specify svn. Using layout format, user still need
to specify the SVN value.

Signed-off-by: Subash Lakkimsetti <subash.lakkimsetti@intel.com>
2020-07-08 13:53:34 -07:00
Maurice Ma 48ca17769b Fix MultiBoot image loading issue
The current MulitBoot loading code in SBL did not follow the specification.
The spec stated "The offset in the OS image file at which to start loading
is defined by the offset at which the header was found, minus
(header_addr - load_addr)". However, the current code always copies from
offset 0 of the image file. It caused exception when loading some valid
multiboot image.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2020-07-08 07:53:48 -07:00
Subash Lakkimsetti 99e4ba268c Initialize variables for container svn
Fix klocwork issues.

Signed-off-by: Subash Lakkimsetti <subash.lakkimsetti@intel.com>
2020-07-06 10:32:06 -07:00
Subash Lakkimsetti ad839a3507 Container capsule update svn check
Add support for security version check for
container and its components with ones available
in flash for capsule updates.

Signed-off-by: Subash Lakkimsetti <subash.lakkimsetti@intel.com>
2020-07-01 20:02:41 -07:00
Maurice Ma ea74a63792 [QEMU] Fix GPIO pointer check condition
This patch fixed incorrect GPIO pointer check while appending new GPIO
entries for QEMU.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2020-06-30 20:18:10 -07:00
Maurice Ma fa95fbcb16 [CFL] Incorrect hiding condition for GPIO pin
This patch fixed incorrect hiding conditions for CFL GPIO pins.
Verified the GPIO configuration options can show/hide depending
on the state of GPIO skip option. It fixed #762.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2020-06-26 11:10:49 -07:00
Subash Lakkimsetti 7d4db91590 Default key generation with build
Add option -k with SBL build for key generation.
This is to enable user who do not generate keys
for signing as pre-build step.

Signed-off-by: Subash Lakkimsetti <subash.lakkimsetti@intel.com>
2020-06-26 10:09:34 -07:00