Commit Graph

502 Commits

Author SHA1 Message Date
James Gutbub f022d093ba Add SBL logos for community usage
Slim Bootloader has its own set of approved logos. Add them to
the repo for community usage along with guidelines on logo usage.

Signed-off-by: James Gutbub <james.gutbub@intel.com>
2019-04-03 13:33:09 -07:00
Maurice Ma 98f687e692 [QEMU] Allow select UEFI payload from QEMU command line
Current SBL depends on GEN_CFG_DATA.PayloadId to determine which payload
to boot if multiple payloads exist. With this patch, when PayloadId is
set to "AUTO", QEMU will use the QEMU command line parameter
'-boot order' to determine which payload to boot.

For example, adding '-boot order=dba' in QEMU commadn line will boot to
UEFI payload. This provides a simple way to test different payloads using
the same SBL image.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-03-26 16:37:58 -07:00
Maurice Ma ca6b6d56c4 Update SBL to use the approved SBL logo
Slim Bootloader has its own approved logo. Updated the original logo
to use this new one.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-03-26 09:05:09 -07:00
Maurice Ma 1245809d20 [APL] Add full IFWI stitching python script
This script creates a new Apollo Lake Slim Bootloader IFWI image using
FIT tool and other ingredients. The FIT tool and some stitching
ingredients are not public available. Please contact your Intel
representative to get them.

This script can support both Linux and Windows environment.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-03-21 07:23:43 -07:00
Maurice Ma 9f3b9f2a3b Add command line loading CFGDATA support in ConfigEditor
This patch added support to load CFGDATA directly from command line
interface. Minor clean-up work is also done to remove unused and
duplicated functions.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-03-20 16:30:05 -07:00
Raghava Gudla f514ba35b7 Added support for FWST OEM ACPI table
This patch added support for FWST ACPI table. This table
contains generic address structure which has pointer to the
EFI System Resource Table.

ESRT table for now supports only system firmware. This table
will provide the operating system and tools knowledge of what
is the last attempt status and version of the system firmare
update.

Signed-off-by: Raghava Gudla <raghava.gudla@intel.com>
2019-03-20 16:03:57 -07:00
Raghava Gudla ed4f7d1aad This patch add code to handle fsp requested reset
after silicon init API call. Also added code after
memory init to differentitate warm and cold reset requests.

Signed-off-by: Raghava Gudla <raghava.gudla@intel.com>
2019-03-20 15:59:19 -07:00
Maurice Ma dcbe27a70a [APL] Update StitchLoader.py to check Boot Guard status
The APL StitchLoader.py script has its own limitation. For example,
if Boot Guard is enabled in the base image, the final stitched image
with this script might not boot due to security reason. It is better
to check this during stitching process so that it can error out earlier
to notify the user.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-03-19 08:07:27 -07:00
Maurice Ma f6c1b690c2 Disable deprecated EDKII API interfaces
This patch enabled DISABLE_NEW_DEPRECATED_INTERFACES build option by
default so that the deprecated APIs cannot be used in SBL source tree.
It is to enhance the coding for security.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-03-14 11:26:03 -07:00
Maurice Ma afe4dde4fb Remove UPT tool from BaseTools
This patch removed unused UPT tool from BaseTools. This UPT tool
also contains sqlite3.dll binary. It is not preferred in the source
repo.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-03-13 15:07:00 -07:00
Subash Lakkimsetti db58e2358b Log startup locality only when Boot Guard is not enabled
When Boot guard is enabled, Locality event would be
logged from Boot guard library.

Signed-off-by: Subash Lakkimsetti <subashx.lakkimsetti@intel.com>
2019-03-13 08:34:15 -07:00
Maurice Ma a62bd10f63 Add framebuffer info into Multiboot table
Multiboot defined framebuffer structure.  However, it was not
implemented in SBL.  This patch added this support by filling in
the framebuffer information into the multiboot table.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-03-06 13:28:10 -08:00
Matt Borgerson 90e61539bb Add basic pre-build check for OpenSSL/NASM
Signed-off-by: Matt Borgerson <matthew.a.borgerson@intel.com>
2019-03-06 13:27:44 -08:00
Maurice Ma cc21783e0d Allow more flexible config.cfg format
Since grub.cfg is already supported in SBL. It makes sense to support
the similar syntax in config.cfg. This patch enabled config.cfg to
follow grub.cfg format to provide multiple boot options. The old
config.cfg format will still be supported. This patch also added
support for single/double quote around boot menu entry name.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-03-05 07:44:50 -07:00
Agrawal 0486316f5e Remove Stage2 and Payload support for Intel BootGuard
Stage2 and Payload are NOT verified by Intel BootGuard component.
Instead, Slimbootloader verfifies Stage2 and Payload using SBL hash store.

Signed-off-by: Agrawal <sachin.agrawal@intel.com>
2019-03-04 17:42:23 -08:00
Maurice Ma 93d1915742 Add FAT long file name support
This patch enhanced the FAT library to support long file name. The
old driver only supports 8.3 short name. Combined with FAT full path
support, the FAT library now can load any file from the partition.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-03-04 17:42:11 -08:00
Sai Talamudupula 5f09e82c10 Enhance SMMBASE_INFO communication structure
Match the strcture definition with payload

Signed-off-by: Sai Talamudupula <sai.kiran.talamudupula@intel.com>
2019-03-01 21:10:12 -08:00
Maurice Ma d397299797 Add GRUB config file support to boot Ubuntu
This patch added a simple parser for grub.cfg to make it easy to boot
Ubuntu ISO image using OsLoader payload. Without it, it is required to
copy vmlinuz/initrd to root directory and create a config.cfg to list
the kernel boot command line in order to boot the ISO image. This patch
makes it possible to boot the original Ubuntu ISO (16.04 or 18.04)
directly. It provides better user experience for people who wants to
try out SBL.

Please note, same as before, when verified boot is enabled, only debug
build will support this feature. Release build will disable this feature
due to security concern, please use IAS image boot mechnism instead.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-02-28 12:42:44 -08:00
Huang Jin 7fb1584076 Revert "[APL] Enlarge payload heap size from 64MB to 128MB (#68)" (#102)
A work-around for ACRN hypervisor hang loaded by SBL.  The complete
fix requires iasimage tool to support correct alignment for subcomponents

This reverts commit c467303715.
2019-02-28 10:06:35 -08:00
Huang Jin 12874add40 [UP2] Use GPIO to detect memory SKU ID
DDR_ID0: GPIO_214
DDR_ID1: GPIO_215

b00: 2GB 2x Samsung K4F8E304HB-MGCJ
b01: 4GB 4x Samsung K4F8E304HB-MGCJ
b10: 8GB 4x Samsung K4F6E304HB-MGCJ

Signed-off-by: Huang Jin <huang.jin@intel.com>
2019-02-28 08:56:31 -08:00
Sai Talamudupula 14c3862005 Relocate SMM bases on S3 resume path
Smm bases for all the procs need to be relocated on the
S3 resume path (as payload is not run) for Windows boot.

Signed-off-by: Sai Talamudupula <sai.kiran.talamudupula@intel.com>
2019-02-26 11:23:29 -07:00
Maurice Ma 072d5f5427 Add full path support for FAT file loading
Current FAT library can only support loading file from the root
directory of FAT file system. This patch enhanced it to support
load file from FAT file system with any give full path. Both unix
and Windows style path are supported. For example, "efi\boot.cfg",
"\efi\boot.cfg", "/efi/boot.cfg", etc, all are valid path string.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-02-26 08:53:08 -08:00
Subash Lakkimsetti 5e1174fc67 Security Flags updates to LOADER_PLATFORM_INFO
LOADER_GLOBAL_DATA.LdrFeatures is updated in early stages and
subsequent stages could use these flags.

LOADER_PLATFORM_INFO.LdrFeatures is used to for feature updates
and this need to be checked by loader and payloads.

LOADER_PLATFORM_INFO.HwState for Hw supported features as
Boot guard profiles.

Signed-off-by: Subash Lakkimsetti <subashx.lakkimsetti@intel.com>
2019-02-25 10:45:39 -07:00
Guo Dong d6c1ea6964 Add ACPI Firmware Performance Data Table (FPDT) support
This patch adds FPDT table into ACPI table, and updates all
the performance data for S3 path.
It also update basic boot performance data for reset end.
Other boot performance data could be updated by UEFI payload.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2019-02-25 10:03:46 -07:00
Huang Jin 322ec1b91a Include complete Python license
Signed-off-by: Huang Jin <huang.jin@intel.com>
2019-02-21 17:16:02 -08:00
Maurice Ma a11fbf0538 Add multiple VBT table support
Current SBL can only support on VBT file. However, different board
might need different VBT table. It is better to have the capability
to embed multiple VBT table into the image.  This patch implemented
this feature and enabled it on QEMU. By default, it will take the
original behavior. if _MULTI_VBT_FILE in BoardConfig.py is specified,
multiple VBT files can be used.

If multiple VBT table support is required, list them as:
  {VbtImageId1 :VbtFileName1, VbtImageId2 : VbtFileName2, ...}
VbtImageId is ID to identify a VBT image. It is a UINT32 number to
  match the ImageId field in the VBT container.
VbtFileName is the VBT file name. It needs to be located under platform
  VbtBin folder.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-02-13 17:15:33 -08:00
Maurice Ma 1c861c84b3 Fix PCIE configuration issue on LeafHill
The PCIe root ports configurations are not correct in the CFGDATA for
LeafHill/OxbowHill/JuniperHill/UP2. This patch fixed the root ports
configurations properly. It also enabled Windows 10 installation
on Leafhill. It fixed #93 .

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-02-13 17:15:04 -08:00
Aiden Park d7ec54a79f BaseTools: Fix build failure on Fedora29 with gcc 8.2.1
This change includes below commits from the latest EDKII.
- The build failure has been identified on Fedora 29 with gcc version
  8.2.1 20181215 (Red Hat 8.2.1-6).
- Verified no compile errors with below changes from EDKII.

commit 9de306701312f986c9638cb819d3f1f848d55cab
Author: Laszlo Ersek <lersek@redhat.com>
Date:   Fri Mar 2 17:11:52 2018 +0100
    BaseTools/GenVtf: silence false "stringop-overflow" warning with memcpy()

commit 03252ae287c4a61983b3793ff71baeabe2ff3df7
Author: Laszlo Ersek <lersek@redhat.com>
Date:   Wed Jul 25 22:40:09 2018 +0200
    BaseTools/header.makefile: remove "-c" from BUILD_CFLAGS

commit 9222154ae7b3eef75ae88cdb56158256227cb929
Author: Laszlo Ersek <lersek@redhat.com>
Date:   Fri Mar 2 17:11:52 2018 +0100
    BaseTools/header.makefile: add "-Wno-restrict"

commit 1d212a83df0eaf32a6f5d4159beb2d77832e0231
Author: Laszlo Ersek <lersek@redhat.com>
Date:   Fri Mar 2 17:11:52 2018 +0100
    BaseTools/header.makefile: add "-Wno-stringop-truncation"

Signed-off-by: Aiden Park <aiden.park@intel.com>
2019-02-13 10:05:07 -08:00
Maurice Ma 0473e9e30d [APL] Enable GFX OpRegion in ACPI
This patch enabled APL GFX OpRegion in ACPI table. The OpRegion ASL code
was commented out in current DSDT.  It was causing Windows boot issue
due to invalid ASLB field value in ACPI GNVS. This patch addressed this
issue, and it fixed #88 .

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-02-12 08:09:49 -08:00
Guo Dong b702248deb Enhance build script for clean command
BuildLoader.py will failure to run git command if Slim bootloader
source code is not in a git repo. Update Buildloader.py to check
if git repo could not be detected, it will not run git command to
clean un-tracked git files.

TEST=Tested to build/clean APL success without git repo.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2019-02-11 16:10:26 -08:00
Maurice Ma f62c2d4553 Enable QEMU firmware update test
This patch fixed some QEMU firmware update related issues.
It enabled firmware update testing on QEMU using script.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-02-08 08:45:24 -08:00
Maurice Ma 66aa54a5fa Remove Debug/Release field from VerInfo.txt file
In current implementation, FspDebug/BldDebug flag is saved into
VerInfo.txt. But it should be always determined by the build flags
instead of the VerInfo.txt file. This patch fixed #84 .

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-02-07 09:51:05 -08:00
Maurice Ma f9397b39a4 Add duplicated CFGDATA check in GenCfgData.py
CFGDATA name should be unique in the whole CFGDATA database. Current
tool does not check this and will keep silent for this error. This
brings issue into later development stage. The build process should
be enhanced to check this and error out if duplicated CFGDATA item is
found. This patch added this check.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-02-06 08:04:16 -08:00
Maurice Ma 5f5c14b10a Enable UEFI payload boot from IAS image
This is a feature implementation to enabled chained payloads loading
for UEFI. Current SBL boot flow requires UEFI payload to be built in
flash in order to boot UEFI payload. However, for convenience, if
somebody just wants to try UEFI payload, it is better to allow them to
chain-loading the UEFI payload from media devices such as USB, SATA, etc,
and then boot to UEFI payload directly. This patch enabled this feature.
The new supported boot flow is:  SBL->OsLoader->UefiPayload->OS. The
same applies to other ELF/PE32 based other payloads.

To do this the UEFI payload needs to be packed into IAS image using
iasimage script. The command line is as below:
  python iasimage.py create -d TestSigningIasPrivateKey.pem UefiPld.fd
         -o iasimage.bin -i 0x30000
Please use the latest iasimage script from
  http://github.com/intel/iasimage

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-01-31 16:01:48 -08:00
Sai Talamudupula 635645705f Adding print for EXT CFG data and payload ID
Print a debug message if EXT CFG Data fails to append
in the config database. ALso, print the Payload ID in
stage2.

Signed-off-by: Sai Talamudupula <sai.kiran.talamudupula@intel.com>
2019-01-31 14:47:33 -08:00
Maurice Ma 7b37f56ff2 Refactor LiteFvLib/LitePeCoffLib implementation
This patch did some clean up for LiteFvLib and LitePeCoffLib.  It
also moved LoadFvImage() API from Stage2 core code into the LiteFvLib.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-01-31 14:06:36 -08:00
Maurice Ma a6efeb29eb Enable payload loading to high memory by default
This patch enabled payload loading into high memory by default. It
is a more flexible way to allocate memory for payload image instead
of hard-coded base address.  However, in some special cases, such
as UEFI payload, it still needs to be executed at pre-compiled address.
This patch also handled this special case in the flow.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-01-31 08:04:57 -08:00
Maurice Ma ad42a2bd6e [QEMU] Add QEMU SMM support
This patch added SMM TSEG range support in QEMU FSP.  It also added
QEMU TSEG base and size reporting in HOB.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-01-28 20:14:38 -08:00
Maurice Ma da11283b51 Allow payload binaries to be located in platform folder
This patch added support to allow payload binaries in platform folder
instead of PayloadPkg/PayloadBins. Sometimes platform might have its
own customized payload specifically for this platform. In this case,
it is better to put the payload binaries in its platform folder.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-01-28 13:54:25 -08:00
Guo Dong 095f281023 Enhance UEFI payload support
Previously SBL expects UEFI payload entrypoint and base at
hardcoded address of FV header. With this patch, SBL could
parse FV to get these info.

TEST=Tested on Leafhill and boot UEFI payload success.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2019-01-28 13:54:11 -08:00
Raghava Gudla d6d0e92a80 Fix firmware update failure
When UEFI payload or epayload is enabled and firmware update mode
is enabled, current code in prepare payload function will consider
firmware update payload as multi payload. This is causing failure
and end up as halting cpu.

This patch will add an additional check for firmware update mode
and do hash verification

TEST=Verified that firmware update is working when UEFI payload
	 is enabled.

Signed-off-by: Raghava Gudla <raghava.gudla@intel.com>
2019-01-25 17:01:37 -08:00
Guo Dong ee4b3f812f Add SMM support to UEFI payload
Build a new SMM info HOB to payload to report SMM info.
Add UEFI payload variable region into flash map.

TEST=Tested on LeafHill with UEFI payload.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2019-01-22 17:11:54 -07:00
Maurice Ma 650fcf1cb7 Retrieve version info from proper platform repo
SBL supports putting platform packages in a separate repo tree
defined by environment variable PLT_SOURCE. Current build process
will always retrieve the latest commit id info from open source
repo as version even when the platform uses a separate repo tree.
This patch corrected this behavior. When a platform package is in
a separate repo, the git commit id info will be retrieved from that
platform repo instead.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-01-17 13:55:42 -08:00
Huang Jin c467303715
[APL] Enlarge payload heap size from 64MB to 128MB (#68)
This change makes more space for SBL paylaod to load
larger IAS image (e.g. Ubuntu kernel + initrd ~ 33MB)

The payload heap memory is reusable as long as crash mode
is disabled.

TEST=Loaded and booted IAS image containing Ubuntu kernel and
     initrd from USB flash drive on UP2 board.

Signed-off-by: Huang Jin <huang.jin@intel.com>
2019-01-15 09:19:19 -08:00
Maurice Ma 1f972af0cd Fix large file read issue on USB device
The current USB block read library trancated the number of blocks
to read from UINT32 to UINT16. It caused read issue for large file
on USB disk. This patch fixed #63. It has been verified on LeahHill
CRB platform.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-01-07 13:30:57 -08:00
Guo Dong edc112328c Enhance USB keyboard support
Make USB keyboard not depend on OS boot option.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2019-01-03 14:23:14 -08:00
Huang Jin 87aeec3185
[APL] add boot options to boot ACRN Hypervisor (#65)
Boot[1] : the default boot option used by ACRN hypervisor
          iasimage is located on hw part #0, sw part #1 without
          file system.
Boot[4] : boot option to load fastboot code from SPI region.
          SBL enters fastboot mode for eMMC provisioning

TEST=Verified booting to ACRN shell on UP2 board;
     Triggered fastboot mode from shell and verified flashing
     ACRN+SOS to eMMC is successful

Signed-off-by: Huang Jin <huang.jin@intel.com>
2019-01-03 13:24:19 -08:00
Huang Jin 3009428255
Fix bug in file system library
When InitFileSystem() API is given EnumFileSystemTypeFat in argument,
the FAT file system is not initialized. This bug is discovered when
firmware update payload fails to load capsule from FAT partition via
shell interface.

Fixed #62 

TEST=Created FwuImage.bin and perform firmware update from SBL shell on
     UP2 board. Verified successful update and booting to Ubuntu 16.04
     from eMMC

Signed-off-by: Huang Jin <huang.jin@intel.com>
2019-01-03 13:18:25 -08:00
Maurice Ma d97fe977df [APL] Support non-redundant flash layout stitching
Current stitching script assumes the flash layout must be redundant
layout. But the layout could be non-redundant layout if the user
wants. This patch added non-redundant flash layout support for the
APL stitching.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2018-12-21 09:46:19 -08:00
stalamudupula e48f46236d Enhance BuildUtlity tool (#58)
Updated BuildUtility.py to allow IAS file to use relative file path
from platform directory.

Signed-off-by: Sai Talamudupula <sai.kiran.talamudupula@intel.com>
2018-12-19 09:17:38 -08:00