Commit Graph

105 Commits

Author SHA1 Message Date
Sean McGinn 4808bd4481 Support ACM FW Capsule Update
*Adds code to support the updating
of ACM FW via capsule

*Adds code that disallows for the
roll back of ACM FW

Signed-off-by: Sean McGinn <sean.mcginn@intel.com>
2022-05-05 10:18:26 -07:00
Maurice Ma c4ac8e1939 Update loader serial port hob to support 64bit base
This patch added a new 64bit base field in the loader serial
port hob to support 64bit resource. The revision is updated
to 2. It is backward compatible with revision 1.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2022-03-03 12:45:00 -08:00
kokweich dabb3143d1 Enable Grahpics Console during firmware update
This patch enables graphics console when entering FWU payload.
FWU progress will show on both graphics console and serial port.

Signed-off-by: kokweich <kok.wei.chan@intel.com>
2022-02-24 13:31:59 -08:00
Maurice Ma d94ff784bd Remove trailing whitespace/tabs from source files
Current PatchChecker.py still complains lots of files with
trailing whitespace and tabs. This patch addressed these
error reporting.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-11-10 13:15:04 -08:00
Mike Crowe 990e3e81e6 Use LF line endings in the repository
Convert the line endings stored for all text files in the repository to
LF. The majority previously used DOS-style CRLF line endings. Add a
.gitattributes file to enforce this and treat certain extensions as
never being text files.

Update PatchCheck.py to insist on LF line endings rather than CRLF.
However, its other checks fail on this commit due to lots of
pre-existing complaints that it only notices because the line endings
have changed.

Silicon/QemuSocPkg/FspBin/Patches/0001-Build-QEMU-FSP-2.0-binaries.patch
needs to be treated as binary since it contains a mixture of line
endings.

This change has implications depending on the client platform you are
using the repository from:

* Windows

The usual configuration for Git on Windows means that text files will
be checked out to the work tree with DOS-style CRLF line endings. If
that's not the case then you can configure Git to do so for the entire
machine with:

 git config --global core.autocrlf true

or for just the repository with:

 git config core.autocrlf true

Line endings will be normalised to LF when they are committed to the
repository. If you commit a text file with only LF line endings then it
will be converted to CRLF line endings in your work tree.

* Linux, MacOS and other Unices

The usual configuration for Git on such platforms is to check files out
of the repository with LF line endings. This is probably the right thing
for you. In the unlikely even that you are using Git on Unix but editing
or compiling on Windows for some reason then you may need to tweak your
configuration to force the use of CRLF line endings as described above.

* General

For more information see
https://docs.github.com/en/get-started/getting-started-with-git/configuring-git-to-handle-line-endings .

Fixes: https://github.com/slimbootloader/slimbootloader/issues/1400
Signed-off-by: Mike Crowe <mac@mcrowe.com>
2021-11-10 12:46:42 -08:00
Maurice Ma 5996369705 Enable GFX framebuffer as WC by BAR parsing
In order to improve the UEFI payload display performance, it is
desirable to have the framebuffer as write-combining for cache
attribute. This patch added a common API to enable this and it
enabled the GFX framebuffer cache for QEMU and TGL. Other
platforms still need porting.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-11-04 11:46:13 -07:00
Maurice Ma aa219ecd67 [QEMU] Enable CFGDATA update test using CfgDataStitch tool
This patch added test cases to verify CfgDataStitch flow for
CFGDATA modification.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-10-29 16:17:39 -07:00
Maurice Ma 2e9cdbf5a7 [QEMU] Add GPIO fields to enable more tests
This patch added more fields in QEMU GPIO so that more CFGDATA
related tests can be done on QEMU platform.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-10-29 16:17:39 -07:00
Maurice Ma 0e0eb047e3 Add UpdateMemoryInfo implementation for all open platforms
This patch implemented SOC specific hook to update the memory
map info through UpdateMemoryInfo() API.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-10-29 07:49:55 -07:00
Maurice Ma d0594faf84 [QEMU] Enable SMBIOS support
This patch enable SMBIOS support for QEMU. It allows to test SMBIOS
on QEMU platform.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-10-25 16:46:33 -07:00
Maurice Ma 21917377c8 Change GetSerialPortBase() API to return 64bit address
When UART bar is alloaced to 64 bit address, the current SBL API
GetSerialPortBase() only returns the lower 32 bit address, which will
cause problem for UART access. This patch fixed this issue.

Please note the patch did not change the payload HOB interface for
UART info. That needs to be updated to 64bit base address too. But this
patch does not cover that.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-10-21 10:09:20 -07:00
Maurice Ma eea78479da [QEMU] Add UEFI universal payload test case
This patch added UEFI universal payload boot test on QEMU.
It fixed #1332.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-10-11 15:23:42 -07:00
Aiden Park bea07fdc60 [Tool] Allow each platforms to override min tool versions
This allows each platforms to override its own minimum tool versions.

Current SBL default minimum tool 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'

If a board needs to use VS2008 and nasm2.14,
In BoardConfig.py,
    def GetPlatformToolchainVersions(self):
        version_dict = {
            'nasm'      : '2.14',
            'vs'        : '2008',
        }
        return version_dict

Signed-off-by: Aiden Park <aiden.park@intel.com>
2021-10-08 20:05:10 -07:00
Maurice Ma 8d0b3467b5 [QEMU] Fix AUTO boot option index
On SBL, it can support boot option selection through QEMU command line
"-boot order" parameter. However, it does not work anymore. It was
because of the MAX_BOOT_OPTION_CFGDATA_ENTRY adjustment in other commit.
This patch decoupled internal boot option index with the CFGDATA boot
option index so that it does not have impacts on each other. With this
change, QEMU boot option can be altered through command line again.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-10-04 12:00:05 -07:00
James Gutbub a6a0c317dd Resolve fs cmd KW issue
Currently the PLT_DEVICE_TABLE is limited
to only using OS_BOOT_MEDIUM_TYPE devices
but ideally should be capable of mapping
any system device into the table. For the
time being we will remove the OsBootDeviceGraphics
since it created some KW issue in the fs command.

Signed-off-by: James Gutbub <james.gutbub@intel.com>
2021-09-27 17:08:32 -07:00
Maurice Ma 7f461c59e0 Enable native GFX initialization support
On QEMU or Smimics, it might need to do native GFX initialization
if the GFX is not initialized by FSP. This patch added the native
GFX support for BOCHS graphics controller.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-09-23 09:15:13 -07:00
Aiden Park 4b2e566921 Cleanup Platform/Silicon code to access LoaderGlobalData via APIs
This makes all Platform & Silicon code use APIs to access
LoaderGlobalData instead of accessing variables directly.

Signed-off-by: Aiden Park <aiden.park@intel.com>
2021-08-06 12:34:36 -07:00
stanley f87b8c3c49
[QEMU] extend auto test timeout (#1247)
Recently, github CI test case, Qemu-linux_boot.py, randomly fails.

Comparing the logs between failed and pass cases, we can find:

  1. the failure is caused by timeout before Minimal Linux
     completely boots into console and shows "Welcome to Minimal
     Linux" messages.

     Although such timeout can be a real error (true-positive),
     it is also possible just a false alarm (false-positive)...

  2. for a failed case, a force push to trigger another CI check
     can result in pass, even no code changes. Thus, the timeout
     failure points to CI environment (e.g., loading) - a false alarm.

  3. the margin (of pass case to timeout) is about 0.4 sec.

This patch increases timeout for 2 seconds to avoid unexpected
test timeout caused CI envornment (e.g., loading).

Signed-off-by: Stanley Chang <stanley.chang@intel.com>
2021-08-04 09:45:08 -07:00
Talamudupula fc8a3b33ce GpioLib header clean-up
Inconsistent and redundant header files are removed.
All projects going forward

 - Use API declared in GpioLib.h
 - Provide instance of GpioSiLib.h
 - Use common defines in GpioConfig.h

[QEMU][APL][CFL][CML][CMLV]
 - Follow above header model
 - Have own instance of GpioLib

[EHL][TGL]
 - Follow above header model
 - Use common GpioLib instance

Signed-off-by: Talamudupula <stalamudupula@gmail.com>
2021-07-01 11:24:03 -07:00
Vincent Chen 8bb52daaca [QEMU] Fix compiler error for NOOPT build in Windows
- fix __aullshr link error due to compiler intrinsics functions
  for NOOPT build in Windows
- adjust Stage1A/TopSwap/OsLoader FD size for NOOPT target
- adjust Stage2 size for NOOPT target when DEBUG FSP is used

Signed-off-by: Vincent Chen <vincent.chen@intel.com>
2021-05-25 21:20:38 -07:00
Maurice Ma 8b0075039a [QSP/QEMU] Enhance virtual platform
This patch includes several enhancements for QSP and QEMU:
  - Change boot option to use 1st AHCI port with drives attached
  - Add ACPI APIC routing table and enable APIC mode
  - Add 64bit PCI resource
  - Update GFX HOBs using correct PCI device

Verified Linux boot on both QEMU and QSP.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-05-07 11:58:58 -07:00
leanshen 26d604a7e5 [QSP] Add Simics QSP board support based on QEMU package
Officially add Simics QSP board (X58Ich10Board) support on top of
QEMU package.

Here are the changes:
1. Add Simics QSP detection based on Host Bridge DID
2. Add new QSP dlt file (Platform ID: 2) and QSP name changes
3. Set the PCI_MEM32 base to 0xF0000000 for QSP
4. Update minor version and date

Signed-off-by: LeanSheng <lean.sheng.tan@intel.com>
2021-05-05 15:14:34 -07:00
Maurice Ma fb1e05a51c Enable QEMU SMM rebasing
This patch enables QEMU SMM TSEG programming in FSP. And it also
enables SBL QEMU SMM rebasing. It can be used to test many SMM
related flow.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-04-19 08:53:55 -07:00
Maurice Ma 62532aa7fa
Set PayloadId earlier in Stage2 (#1125)
QEMU currently set PayloadId in Post PCI enumeration. To be in
sync with other platform, this patch moves it to PreSiliconInit
hook point.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-04-19 08:49:34 -07:00
Maurice Ma af807ee2d0 Enable SMRR programming in SMM rebasing flow
In normal UEFI payload case, the UEFI will handle SMM rebasing.
If SMM rebasing is handled by SBL, SBL will put a dummy SMI handler
at the new SMBASE to prevent SMM hang.  Beyond SMM rebasing, it
is also required to program SMRR registers. This patch added this
support for core code. It also added TSEG PCD init for CFL.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-04-10 15:28:07 -07:00
Maurice Ma 631489e1e4 [QEMU] Allow to run specific test case
This patch added argument support for qemu_test.py so that a
specified test case can be launched separately. Wilecard chars
are supported for the test case name.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-04-05 09:41:37 -07:00
Maurice Ma 3b849acccf Allow platform to create ACPI table dynamically
This patch implemented a common method for platform to create ACPI
table dynamically. Platform can provide ACPI tempalte array through
PCD PcdAcpiTableTemplatePtr. If provided, ACPI core code will try to
call platform code to patch the table, and then install the table to
ACPI RSDT/XSDT.
It also added sample code implementation in QEMU to show case how to
do it from platform code.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-03-28 21:24:27 -07:00
Maurice Ma f68a5dce1b Add FSP HOB print function
This patch will display FSP HOBs. It will help the debug when FSP
produce incomplete HOBs.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-02-02 19:48:39 -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
Maurice Ma 9a4407018d [QEMU] Fix NOOPT build failure
This patch fixed NOOPT build failure for QEMU.
It fixed #871.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2020-10-12 13:00:44 -07:00
Raghava Gudla 418e31ad38 [CFL] Added support for mutiple VBT
This patch did the following

1) Added common routines LocateVbtByImageId to look for VBT image using
   ImageId provided by configuration data and GetVbtAddress.
2) GetVbtAddress routine will provide abstaction for all platforms
   irrespective of multiple VBT or single VBT used by the platform.
3) LocateVbtByImageId routine is moved from platform local function to
   common package.
4) VbtImageId configuration option defined in QEMU platform config is
   moved to common configuration in CfgData_Common.yaml
5) ApolloLake VBT ID selection is now done using configuration data.
6) Added latest VBT binary for CFL, WHL is using existing VBT.

Signed-off-by: Raghava Gudla <raghava.gudla@intel.com>
2020-09-18 17:41:12 -07:00
Maurice Ma 5f5cbaebaa Represent data in required format in ConfigEditor
Current ConfigEditor relies on the original input data format in YAML
to determine how to represent data in GUI. For example, if the data
value is HEX in YAML, then the data will be displayed in HEX format.
This patch switched to use the specified format type to reformat the
value string so that the display is always consistent with the required
format type.

It fixed #844.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2020-09-15 07:33:14 -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 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 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 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
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
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
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
Maurice Ma 7455ead93e
Add linux boot test in travis (#657)
This patch added test script for Linux boot test in travis for QEMU.

It fixed #656.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2020-04-12 22:27:12 -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 e738eeafac
Add CurrentBoot CFGDATA option (#643)
Current SBL does not provide CFGDATA to change the current boot
option although it can be done in SBL shell. This patch added this
into CFGDATA so that it can changed using board CFGDATA. A special
option AUTO is introduced to indicate the priority between CFGDATA
and board specific overriding. When AUTO is selected, board specific
overriding should be used. Otherwise, CFGDATA should be used for
CurrentBoot option.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2020-04-06 22:46:52 -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