Commit Graph

123 Commits

Author SHA1 Message Date
Maurice Ma 0eff01eb53 Update SBL core revision to 1.0
The SBL core revision has not been updated since the creation of
the project. Now with more and more platforms being enabled with
SBL, it is the proper time to upgrade the core revision to be 1.0.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-06-18 08:44:47 -07:00
Maurice Ma 97124b133f Patch FSP-T UPD microcode base
When redundant partition is enabled, the FSP-T microcode base UPD
always points to the microcode region in 1st partition. Instead,
it should points to the microcode rgion in its own partition. This
patch fixed this issue.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-05-28 15:07:15 -07:00
Aiden Park bc5584d176 [Build] Verify toolchain versions
This will check the minimum required toolchain versions
before starting build process.
If any of these toolchains does not meet the required version,
the build process will stop immediately.

Here are the initial minimum toolchain versions.
- python : 3.6.0
- nasm   : 2.12.02
- iasl   : 20160422
- openssl: 1.1.0g
- git    : 2.20.0
- vs     : 2015
- gcc    : 7.3
- clang  : 9.0.0

Signed-off-by: Aiden Park <aiden.park@intel.com>
2021-04-26 09:07:04 -07:00
Maurice Ma fda951e10a Add image ARCH type into SBL version info
SBL can support IA32 and X64 build. But this info is not indicated
in the SBL version info. This patch added one bit to indicate the
SBL is IA32 or X64.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-04-11 20:32:21 -07:00
Maurice Ma 94d22382bd [APL/CFL] Enable SMM rebase for mon UEFI payload
For non UEFI payload, SBL will install dummy SMI handler for
security concern. For UEFI payload, SMM rebasing is expected
to be done itself. This patch enabled this feature for APL and
CFL platform.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-04-10 15:28:07 -07:00
Maurice Ma 454efdda2e Add CLANG toolchain build support
This patch will enable CLANG toolchain build on Linux and Windows.
Currently CLANG toolchain build still needs Visual Studio to provide
nmake utility in Windows.
To build with CLANG, please add build option "-t clang". It assume
CLANG is installed at default path. It has been tested with SBL
QEMU x86 build.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-04-02 09:07:57 -07:00
Maurice Ma 040ab276b8 Add Visual Studio toolchain version select option
Current SBL always uses the latest VS toolchain detected to build
SBL. However, sometimes a different verion might be preferred.
This patch added a build option "-t" to specify the perferred VS
toolchain version. It is useful when mulitple VS toolchain versions
are installed.

For example, add '-t vs2015' to use VS2015 as the toolchain for
SBL build.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-03-25 17:14:15 -07:00
Maurice Ma 04b162e75e Add CPU X2APIC support
This patch added X2APIC support. It is to enable the case when
APIC ID is greater than 255. This patch only handle core wakeup
portion. Platform still needs to handle ACPI related changes for
X2APIC.

X2APIC lib is backward compatible with XAPIC lib. So there is no
need to use XAPIC lib anymore.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-02-12 17:20:57 -08:00
Aiden Park 680cab980b [PCI] Add an option to allocate PCI PMEM resource first
This introduces an additional PCI Enumeration option.
- self._PCI_ENUM_FLAG_ALLOC_PMEM_FIRST

By deafult, the option will allocate PCI resource by ascending order
(MEM32->PMEM32->MEM64->PMEM64). If it's set to 1, by reversed order.

Signed-off-by: Aiden Park <aiden.park@intel.com>
2021-02-03 17:14:51 -08:00
Aiden Park ba39f788cf [BoardConfig] Support Inherited BoardConfig
This will allow inherited BoardConfig from the existing one
in the same BoardPkg. It will be useful when a new BoardConfig
has very minimum difference from the existing one.

See Platform/QemuBoardPkg/BoardConfigOverride.py as a reference.

Signed-off-by: Aiden Park <aiden.park@intel.com>
2021-01-21 08:27:42 -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
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
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 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 b5d78531df Fix MicroCode path
Use the default path only when MICROCODE_INF_FILE
is not defined in platform board. Currently it will
override the one defined in platform.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2020-11-09 16:47:24 -07: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
Maurice Ma f371334318 Enable build without FSP binary
Current SBL build needs the actual FSP binary to pass the build.
This patch enables a mode to test the build without the actual FSP
bianry. It is useful for test before the FSP binary is available.
It is controlled by HAVE_FSP_BIN option. It can be overriden in
BoardConfig.py file.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2020-11-02 10:52:07 -08: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
Guo Dong 05ac9b4e2d
Enhance FSP build path support (#859)
Currently the build tool will always find FSP binaries from
Silicon'\self._board.SILICON_PKG_NAME\FspBin folder.
This patch enhance the build tool to support to get FSP from
_FSP_PATH_NAME. If _FSP_PATH_NAME is not specified, the default
behavior is same with current build.

If user wants to use a different one, they could override it
in BoardConfig.py as below:
self._FSP_PATH_NAME  = 'Silicon/Fsp'

Signed-off-by: Guo Dong <guo.dong@intel.com>
2020-09-29 15:25:03 -07:00
Maurice Ma e5329259c1
Enable extra including path for build (#858)
This patch added support to allow platform to add specific include
folders for the build. All include paths will be relative to the
SBL $(WORKSPACE).

To eanable this feature, please add similar definitions as below
into BoardConfig.py. For example,
  self._EXTRA_INC_PATH = ['Silicon/QemuSocPkg/Include/Fsp']

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2020-09-28 20:15:22 -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 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
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
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
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
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
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
Subash Lakkimsetti fb98b7902f Security version number to container
Add svn field to container generation. SVN need
to be verified while doing container capsule
update. svn is added as end parameter to layout.

Signed-off-by: Subash Lakkimsetti <subash.lakkimsetti@intel.com>
2020-06-24 12:01:59 -07:00
Subash Lakkimsetti cf5257c563 Extend Key Ids to include sign and size types.
KEY IDs are extended to include key type and sizes.
Platforms can configure corresponding RSA2048 and
RSA3072 KEY IDs. Updated tools to adjust hash type
based on key size.

Signed-off-by: Subash Lakkimsetti <subash.lakkimsetti@intel.com>
2020-06-22 16:29:20 -07:00
Subash Lakkimsetti 735d7b905f Update travis for private key generation
GenerateKeys.py is invoked before automated
build gets triggered.

Signed-off-by: Subash Lakkimsetti <subash.lakkimsetti@intel.com>
2020-06-11 15:50:49 -07:00
Subash Lakkimsetti 6328ea56c7 Enable key ids usage for private keys
This patch enables usage of key id for private keys
in slimboot repo. Key ids are configured in
BuildLoader and platform BoardConfig files.
SLIMBOOT_KEY_DIR is set to default folder outside
sblopen.

Generation of extrenal Keyhash OS key hash to be configured
for QEMU/CGL/APL with appropriate keys.

Signed-off-by: Subash Lakkimsetti <subash.lakkimsetti@intel.com>
2020-06-11 15:50:49 -07:00
Subash Lakkimsetti 00c1345f1a Increase hash store size allocated in bootloader
Maintaining individual public hashes for external key hash and
considering SHA384 sizes this value increases.

Signed-off-by: Subash Lakkimsetti <subash.lakkimsetti@intel.com>
2020-06-10 16:59:13 -07:00
Subash Lakkimsetti 442cb62fce Validate board config hash types
SIGN_HASH_TYPE and IPP_HASH_LIB_SUPPORTED_MASK are derived from
_SIGN_HASH. AT times only _SIGN_HASH is configured in
BoardConfig.py which causes in incorrect hash set to
respective PCDs.

Signed-off-by: Subash Lakkimsetti <subash.lakkimsetti@intel.com>
2020-05-26 11:49:54 -07:00
Maurice Ma 0788c6da42 Allow using bootloader stack to call FspMemoryInit
FSP 2.1 introduced new requirement to use bootloader stack for FSP-M. It
will cause issue for SBL since SBL only uses a small stack in Stage1. To
address this issue, a new PCD PcdFSPMStackTop is added to control the
stack settings for FSP-M.
  - If it is 0, it will not switch stack before calling FspMemoryInit API.
  - If it is 0xffffffff, it will switch to the new default FSP stack
    before calling FspMemoryInit API.
  - For other values, it will switch to the new stack at specified value
    before calling FspMemoryInit API.
This PCD will be set automatically by FSP_M_STACK_TOP variable in
BoardConfig.py file.

This code has been tested on UP Extreme board with latest FSP version.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2020-05-21 09:27:59 -07:00
Aiden Park 9f146afd47
Add PCI SR-IOV Support (#714)
This will support PCI SR-IOV(Single Root I/O Virtualization).
- Controlled by PcdSrIovSupport (SUPPORT_SR_IOV in BoardConfig)
- Disabled by default

Signed-off-by: Aiden Park <aiden.park@intel.com>
2020-05-14 09:57:10 -07:00
Subash Lakkimsetti 56d1e5a400 Increase OsLoader FD size
Osloader FD size is increased to 0x0004B000

Signed-off-by: Subash Lakkimsetti <subash.lakkimsetti@intel.com>
2020-05-05 15:07:15 -07:00
Aiden Park 43146f6c7b Fix a typo in board_build_hook
A typo. fix for pre-build:after

Signed-off-by: Aiden Park <aiden.park@intel.com>
2020-05-04 15:57:37 -07:00
stalamudupula 6cfe319efc
Support 64-bit XHCI MMIO address (#675)
If Platform code assigns 64-bit BAR address to XHCI,
get the full 64-bit address to access MMIO space.
Behavior is undefined if building IA32 and assigning
64-bit XHCI resources.

Signed-off-by: Sai Talamudupula <sai.kiran.talamudupula@intel.com>
2020-04-15 14:02:29 -07:00
Maurice Ma 52b24dede0
Add build hooks for board (#674)
This patch added build hooks for boards so that each board can do
specific actions in different build phases. This patch also added
an example for QEMU to use build hook to generate new binaries into
the flash layout.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2020-04-15 14:01:00 -07:00
Subash Lakkimsetti 98066ce797
Remove Verified Boot Hash Mask (#663)
PcdVerifiedBootHashMask is no longer used while
verification except for stage1B. Remove Hash mask and
added PcdVerifiedBootStage1B for stage1B verification.

Signed-off-by: Subash Lakkimsetti <subash.lakkimsetti@intel.com>
2020-04-14 09:06:18 -07:00
Subash Lakkimsetti 85617ef888
RSA PSS scheme in signing tools (#641)
Added an build config _SIGNING_SCHEME for
selection of signing schmemes. Updated tools
with param for selecting the signing scheme when
they are run in stand alone mode. Authtypes in
container are updated.

Supported Signing schemes - RSA_PCKS_1_5, RSA_PSS
Intel Crypto recommends PSS and same defaulted in
SlimBoot.

Signed-off-by: Subash Lakkimsetti <subash.lakkimsetti@intel.com>
2020-04-10 17:25:58 -07:00
Maurice Ma 80b61a8ea0
[CFL] Enable SBL X64 boot (#638)
This patch adjusted the Stage1A heap size and OsLoader size to
satisfy CFL build and boot requirment. This has been tested on
UPX board. It has dependeny on preivous PR #636.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2020-04-03 15:50:09 -07:00
Maurice Ma bd09d97b18
Allow more flexible DSC customization by board (#639)
Current build only allows board to customize the DSC libraries.
It is better to allow more flexible DSC customization. This patch
enabled this capability. Board can override library, PCDs, etc.
As part of it, the old GetDscLibrary() interface will be deprecated.
Please use GetPlatformDsc() instead.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2020-04-03 15:47:43 -07:00
Maurice Ma 762eee35b7 Common code change for QEMU x64 boot
This patch added additional changes for QEMU x64 boot.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2020-04-02 09:00:14 -07:00
Maurice Ma 72cb08ee7d Enable QEMU Stage1A boot in X64 mode (#621)
* [QEMU] Enable Stage1A boot in X64 mode

This patch added necessary changes to enable QEMU boot through
Stage1A in SBL X64 build.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>

* [QEMU] Enable QEMU Linux boot in X64 mode

This patch enabled SBL X64 boot for Linux. At this moment, since
FSP is still in 32 bit mode, it is required to thunk back into
32 bit mode to call FSP APIs.
It fixed #622.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2020-04-02 07:30:43 -07:00
Aiden Park 6bec45136f Make x64 buildable (#619)
* Add missing X64 MdePkg Library

This adds some missing Library from EDKII Stable201911.
- MdePkg/Library/BaseMemoryLibRepStr/X64
- MdePkg/Library/BaseSynchronizationLib/X64

Signed-off-by: Aiden Park <aiden.park@intel.com>

* Make X64 target buildable

This is just to build X64 target - Not functional.

Signed-off-by: Aiden Park <aiden.park@intel.com>
2020-04-02 07:28:14 -07:00
Maurice Ma 203a741a3c Add SBL x64 build for VTF (#609)
This an initial patch to add x64 build for SBL.  A new build flag
'-x64' is added to indicate x64 arch build. This cannot be fully
used at this moment because it has many dependencies on other x64
libraries. Only VTF reset vector x64 build is tested.

VTF x64 flow is different from IA32.  It switches to 32 bit
mode as usual and then calls into FspTempRamInit to set up CAR.
Once CAR is ready, it builds 4GB identical mapping page table for
x64 and then switches to x64 long mode. Finally, it locates the
STAGE1A entry point and tranfers the control to STAGE1A in pure
64 bit mode.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2020-04-02 07:25:06 -07:00