Commit Graph

744 Commits

Author SHA1 Message Date
Subash Lakkimsetti 6a1c024a6a Naming convention update for secureboot and IppLibs
Added EFIAPI to missing APIs

Signed-off-by: Subash Lakkimsetti <subash.lakkimsetti@intel.com>
2020-09-08 08:07:30 -07:00
Maurice Ma 340b870842 Fix GCC x64 Crypto boot issue
This patch fixed GCC x64 Crypto boot issue. The issue was related
to the calling convention. "EFIAPI" was missing for several ASM
provided functions.
It also fixed #834.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2020-09-04 15:34:33 -07:00
Praveen Hp ddffeb3bde [CFL] Use Latest FSP and microcode release
This patch adds following chnages,

- Revise FSP github commit id to use latest FSP 7.0.74.20 and
  also rename FSP.fd to Fsp.fd to fix GCC build error.
- Add latest Microcode Release Tag.

- starting from FSP 7.0.65.50 FSP shares same stack with Bootloader
  to run FSP-M, hence adjust stack using  FSP_M_STACK_TOP variable in
  BoardConfig.py file.

Test: Build and Boot test on CFL,WHL platforms and verified successfull
      boot till yocto OS.

Signed-off-by: Praveen Hp <praveen.hodagatta.pranesh@intel.com>
2020-09-04 10:01:11 -07:00
James Gutbub 06e21fbb9b Sync IntelFsp2Pkg to support FSP 2.2
There are several definitions that have
been added to the IntelFsp2Pkg in order
to support FSP v2.2. These changes are
backwards compatible with FSP 2.0 and 2.1.

In order to support x64 build of Slim
Bootloader we have overriden the VOID*
and FSP_EVENT_HANDLER[*] to UINT32 since
FSP only supports 32-bit build/pointers
currently.

For more info please see the Intel
FSP External Architecture Specification
v2.2 at the site below:

https://www.intel.com/content/www/us/en/intelligent-systems/intel-firmware-support-package/intel-fsp-overview.html

Signed-off-by: James Gutbub <james.gutbub@intel.com>
2020-09-03 14:17:01 -07:00
Praveen 5cf67d53d1 [CFL] Fix klockwork issue
This patch adds code to check FitEntry for NULL to avoid null pointer
dereference.

Signed-off-by: Praveen <praveen.hodagatta.pranesh@intel.com>
2020-09-03 10:55:38 -07:00
Maurice Ma 68ac0bda34 Resolve build issue when verified boot is disabled
When HAVE_VERIFIED_BOOT is disabed in the latest SBL, the build will
fail because of missing key hashes. This patch resolved this issue.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2020-09-03 09:45:44 -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 bf24ae424b [QEMU] Add setup support for CFGDATA
This patch added required changes to support SBL setup for QEMU.
To enable this, set 'self.ENABLE_SBL_SETUP = 1' in BoardConfig.py.
In QEMU command line, use '-boot order=a' to trigger launching
Setup instead of normal boot flow.

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
Maurice Ma 7779f127af Added restricted boot in boot option
This patch added restricted boot flag support. When restricted boot
flag is set, the OsLoader will only try the current boot option
selected without falling through all other boot options. Also it will
not allow to get into Shell.  This is for the usage to run some
critical applications such as bootloader Setup.

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
Aiden Park 02e43b4760 PayloadPkg: Build paging table to cover high MMIO region
A device in boot options can have a BAR greater than 4GB depending on PCI
64Mem/PMem resource policy.
This will allow Payload to build a paging table to cover high MMIO area.

Signed-off-by: Aiden Park <aiden.park@intel.com>
2020-09-01 17:58:58 -07:00
andreyv1978 302bb701de Always set framebuffer cache attribute
- Allocate framebuffer resource even if  ENABLE_FRAMEBUFFER_INIT=0

Signed-off-by: Andrey Vinokurtsev <avinok@gmail.com>
2020-09-01 07:41:51 -07:00
Subash Lakkimsetti 1b62d76ae7 Klocwork: Validate fit entry ptr
Check fit entry read from fit entry offset before
its dereferenced.

Signed-off-by: Subash Lakkimsetti <subash.lakkimsetti@intel.com>
2020-08-31 13:18:08 -07:00
Raghava Gudla 2ce0ceb9d3 [CFL] Add VBT file for Coffeelake
This patch added vbt.bsf and vbt.bat for coffeelake. Opensourced
vbt from github does not support DP port, newly added
vbt supports DP.

Signed-off-by: Raghava Gudla <raghava.gudla@intel.com>
2020-08-27 14:45:57 -07:00
Praveen HP f7c26922d3 [CFL] Fix Klockwork scanning issues
This patch adds necessary check to avoid NULL pointer dereference

Signed-off-by: Praveen HP <praveen.hodagatta.pranesh@intel.com>
2020-08-27 12:01:25 -07:00
Maurice Ma 99332b68dc Fix new Klocwork scanning issues
This patch fixed some new reported klocwork scanning issues.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2020-08-25 09:57:23 -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
James Gutbub dadd8bdcd2 Fixed improper use of sizeof with pointer
This will resolve some issues reported by
the Klocwork scan.

Signed-off-by: James Gutbub <james.gutbub@intel.com>
2020-08-24 10:22:38 -07:00
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