Commit Graph

744 Commits

Author SHA1 Message Date
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
Guo Dong 47f7aad39e Zero the LOADER_PLATFORM_INFO HOB
Just clear the memory after the HOB is built to avoid Platform
code forgot to init some fields.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2020-06-24 16:15:48 -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
Sai Talamudupula 0febb04905 Make Gpio convert tool common
Gpio convert tool can be common and accepts a
platform specific config file with Group Info
and other settings as input.

Example for CFL/WHL:

  Convert gpio.csv into .dsc format:

  python
  ($SBL)\SblOpen\Platform\CommonBoardPkg\Tools\GpioDataConvert.py
  -if gpio.csv
  -of dsc
  -cf ($SBL)\SblOpen\Platform\CoffeelakeBoardPkg\Script\GpioDataConfig.py

Signed-off-by: Sai Talamudupula <sai.kiran.talamudupula@intel.com>
2020-06-22 14:58:36 -07:00
Sai Talamudupula 69a77bf0da Fix smbiosview issue on Uefi payload
Smbios spec advises to use 'Handle' field in the
Type header to get the type information. This patch
updates the Handle field with the 'Type' value to
be unique. Also, update the Entry Point struct to
report the number of Types implemented currently.

Signed-off-by: Sai Talamudupula <sai.kiran.talamudupula@intel.com>
2020-06-22 14:57:51 -07:00
Mutha 1da8b17c55 OS loader Optimization for Raw Partition Boot.
In FindPartitions() identifying memory device
using MediaGetInterfaceType().

Signed-off-by: Mutha <naga.naveen.mutha@intel.com>
2020-06-22 14:54:36 -07:00
Subash Lakkimsetti 6bd8370c03 Remove test private keys
Signing interface is updated to use keys generated
from GenerateKeys.py available in tools.

Signed-off-by: Subash Lakkimsetti <subash.lakkimsetti@intel.com>
2020-06-19 15:19:44 -07:00
Aiden Park f1d04b0dcd Print file size in unsigned format in 'fs ls'
File size shows negative number, so unsigned print format is used.

Signed-off-by: Aiden Park <aiden.park@intel.com>
2020-06-17 15:13:18 -07:00
Aiden Park 0feb2ecd62 Support media instance in 'fs' shell command
The 'fs' shell command initializes media device with media type info,
but it's not able to initialize another controller of same media type.
Therefore, 'fs init' accepts device instance number.
ex) SATA(0), SATA device instance 1, hwpart 2, swpart 3
    fs init 0:1 2 3

Signed-off-by: Aiden Park <aiden.park@intel.com>
2020-06-17 15:13:18 -07:00
Subash Lakkimsetti 3c3a9763f6 Handling CFGDATA_KEY_ID in CfgDataStitch
Do not check for key file when KEY ID is
used.

Signed-off-by: Subash Lakkimsetti <subash.lakkimsetti@intel.com>
2020-06-16 12:42:18 -07:00
Subash Lakkimsetti b4e431ace5 Single signings scripts improvements
Udated error handling for SBL Key dir and error
messages to guide user to use GenerateKeys tool.

Signed-off-by: Subash Lakkimsetti <subash.lakkimsetti@intel.com>
2020-06-16 12:41:18 -07:00
Maurice Ma 0311566858 Use container format for key hash store
This patch converted key hash store in SBL image into container
format. In this way unified data structure can be used to
simplify code.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2020-06-16 11:20:12 -07:00
Aiden Park 745555ede5
Fix invalid PPB check in PciGetMaxBusNumber() (#747)
A PPB PCI_IO_DEVICE instance has BIT31 in its Address field to identify
the device as PPB type. But, the bit is set after scanning the PPB.
This skips PPB type check in PciGetMaxBusNumber() and let a caller
guarantee PPB type check instead of adding a field in PCI_IO_DEVICE
for PPB device.

Signed-off-by: Aiden Park <aiden.park@intel.com>
2020-06-15 13:14:17 -07:00
Ravi Rangarajan 4d9688f4c3
Update README.md
Added mailing list archive link
2020-06-12 17:13:01 -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 26f2b48f62 Generation of dummy public keys for OS Image
Dummy keys are generated for Os Image Pub Key.
This is to get key hash component generated along
with PUBKEY_OS. User need to replace OS1_TestKey_Pub_**
with appropriate keys.

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
Aiden Park 9704eaecec Add PciGetMaxBusNumber for PCI Bridge Subordinate Bus
At PciScanBus, a PCI bridge sets PCI Bridge Subordinate Bus to 0xFF
temporary to go thru any PPB. But, a platform has some reserved buses
(ex. 0xFB-0xFF) on PCI hierarchy, and writing 0xFF regardless of
reserved bus ranges causes system hang.

Therefore, PciGetMaxBusNumber will be used for PCI Bridge Subordinate
Bus and it gets the number of buses from PCI Enum Policy to skip the
reserved buses.

Signed-off-by: Aiden Park <aiden.park@intel.com>
2020-06-11 11:55:55 -07:00
Aiden Park 2045b00eef Remove wbinvd() in warm reset
The unnecessary wbinvd() is removed from the common ResetSystemLib,
and it moves to a platform specific reset routine.

Signed-off-by: Aiden Park <aiden.park@intel.com>
2020-06-11 10:17:15 -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
andreyv1978 4e57ca0e92 IPC and SideBand Interfaces - Adding IPC/Sideband
- Created BaseIpcLib
- Sideband Interface picked from
    tianocore/edk2-platforms
    branch: devel-IntelAtomProcessorE3900
    commit: 181f9e6c6ccde6e3fa62278b3a8b39cfb5844a7c
- IPC Interface picked from
    tianocore/edk2-platforms
    branch: devel-IntelAtomProcessorE3900
    commit: 181f9e6c6ccde6e3fa62278b3a8b39cfb5844a7c
- Updated Stage1BBoardInitLib.C with a test function

Signed-off-by: Andrey Vinokurtsev <avinok@gmail.com>
2020-06-09 14:23:28 -07:00
Subash Lakkimsetti c8dc8b756e Generate default test keys for RSA2048 and RSA3072
RSA keys are generated based on key ids defined.
User can append signing_keys as per their requirements.

Signed-off-by: Subash Lakkimsetti <subash.lakkimsetti@intel.com>
2020-06-08 11:53:08 -07:00
Subash Lakkimsetti f764b32506 Add key ids to single sign script
This patch adds support to key ids in single sign script.
Following pre-requistes to enable usage of key ids,
- Generate required RSA keys as per GenerateKeys.py
- SLIMBOOT_KEY_DIR env variable set to key folder
- Set private key paths to respective ids in
  buildloader.py and boardconfigs files
- Update key hash store generation to use respective key ids

Enabling keyids in slimboot would be done subsequently.

Signed-off-by: Subash Lakkimsetti <subash.lakkimsetti@intel.com>
2020-06-08 11:52:56 -07:00
Mutha f254d2762d Booting linux from BIOS and PDR region.
SPI driver is updated to support read linux from
BIOS and PDR region, When boot device SPI is
selected.

Signed-off-by: Mutha <naga.naveen.mutha@intel.com>
2020-06-08 11:52:40 -07:00
Ravi Rangarajan c6ddb227fa
Update README.md
Updated mailing list link.
2020-06-04 11:10:42 -07:00
Subash Lakkimsetti ee7fcc7abb Remove TestSigningPrivateKey as default in GenContainer
TestSigningPrivateKey is defaulted for container
creation in non-layout form and key dir is used.
In CfgDataStitch also TestSigningPrivateKey is
defaulted when key dir is specified.

Signed-off-by: Subash Lakkimsetti <subash.lakkimsetti@intel.com>
2020-06-03 13:24:41 -07:00
Perni 7ecb423fab FspsUpd Updated to Global Variable
FspsUpd variable made global so that it could be accessed out of
    FspSilicon function.

    Patchable PCD has been created for FspsUpd and Memory pool allocated.

Signed-off-by: Perni <ramesh.chandra.perni@intel.com>
2020-06-02 08:32:38 -07:00
Subash Lakkimsetti a1fa102214 Segregate sign utilities to an separate script
CommonUtility.py – It contains common functionality
    for signing and extraction Of public key info.
 	It adds the necessary structures for signed data.
SingleSign.py – It contains core functionality related
    to openssl for sign operations. This script will
	be enhanced for accessing key store.

Signed-off-by: Subash Lakkimsetti <subash.lakkimsetti@intel.com>
2020-06-02 08:32:06 -07:00
Maurice Ma 8eb31ee3f6 [APL] Fix SD card boot issue on Intel CRB boards
This patch fixed OsLoader boot from SD card issue on Intel APL CRB
borads. The SD/eMMC library was updated to follow the proper sequence
for SD card. Also platform code was updated to detect SD card and
apply SD card power using proper GPIO pins.

It fixed #729.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2020-06-01 10:08:51 -07:00
Guo Dong 7edce89fb1
Support X64 UEFI payload (#728)
IA32 UEFI payload uses PE format and X64 UEFI payload uses
PE+ format. So update LitePeCofflib to support both PE and
PE+.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2020-05-29 10:15:12 -07:00
Sm NARAYANAN 64f27c41c3 SMBIOS Implementation - Adding SMBIOS Default Table.
- Default SMBIOS Table initialized when SMBIOS is enabled.
- If required, Every Platform can override platform specific information.
- Enable SMBIOS in Qemu platform.
- Update Memory allocation for SmbiosStringsPtr for 32 entries.

Signed-off-by: Sm NARAYANAN <s.m.narayanan@intel.com>
2020-05-28 10:39:54 -07:00