- 'OpenFile may be used uninitialized' in ExtLib
- 'undefined reference to memcpy' in FatLib
- 'Lasa/Laml may be used uninitialized' in TpmLib
- 'Adjust may be used uninitialized' in Stage2Support
Signed-off-by: Aiden Park <aiden.park@intel.com>
Compile optimization sometimes needs to be disabled for debugging.
EDKII BaseTools provide NOOPT target, so leverage it.
The default GCC '-O0' and VS '/Od' option results in huge size image,
so the optimization level is adjusted with approximately level.
Add a new build option '-no' or '--noopt' for NOOPT target
- Release build option '-r' will ignore '--noopt' option
ex) python BuildLoader.py build qemu --noopt
Signed-off-by: Aiden Park <aiden.park@intel.com>
Current IfwiUtility does not support the old non-redundant image
layout format. This patch added support for non-redundant image by
defining a new FLASH_MAP_REGION key.
Signed-off-by: Maurice Ma <maurice.ma@intel.com>
When config data define with size bigger than 1 byte in array,
GenCfgData will parse as zero value.
This patch to fix the issue.
Signed-off-by: Teo, Boon Tiong <boon.tiong.teo@intel.com>
This patch sets the default PEIM rule to use TE image format.
In this way it does not need rule overriding anymore.
Signed-off-by: Maurice Ma <maurice.ma@intel.com>
Error: conversion from 'UINT32' to 'UINT8', possible loss of data
MADT ProcessorId and ApicId has the size of UINT8. Cast the size from UINT32 to UINT8.
Change-Id: I3f46b2015b0d21c2b3e2f9389ecb8d5364ed5a5e
Signed-off-by: Aiden Park <aiden.park@intel.com>
Make PcdCpuMaxLogicalProcessorNumber configurable on a Board
- PcdCpuMaxLogicalProcessorNumber = 16 by default
- Configurable by CPU_MAX_LOGICAL_PROCESSOR_NUMBER in BoardConfig.py
Signed-off-by: Aiden Park <aiden.park@intel.com>
Currently, the common hook UpdateMadt() was updating fixed size of
ProcessorLocalApic entries.
This allows the hook to append ProcessorLocalApic entries with the number
of detected CPUs in runtime.
Signed-off-by: Aiden Park <aiden.park@intel.com>
To make PlatformUpdateAcpiTable() hook its contents and length easily,
allocate a memory from low to high and appends each tables to higher direction
Signed-off-by: Aiden Park <aiden.park@intel.com>
- Add BistVal in STAGE1A_ASM_HOB structure
- Use MM0 register to preserve the BIST value
- Push BistVal while setup HOB in stack
- Add check for CPU BIST failure and halt the system when failed
Signed-off-by: Himanshu Sahdev aka CunningLearner sahdev.himan@gmail.com
This patch will remove FitHelp.py dependency from StitchIfwi
and reuses code from IfwiUtility to patch ACM binary.
This patch also fixed some case dependency required for python
in xml file patching. without this fix, fit does not work as
expected.
Signed-off-by: Raghava Gudla <raghava.gudla@intel.com>
CfgDataTool was originally developed for APL. On APL, the CFGDATA
region name is 'CFGD'. However, on all other platform, the name
is 'CNFG'. This patch modified the script to handle both. And it
fixed#293.
Signed-off-by: Maurice Ma <maurice.ma@intel.com>
Some misc enhancements for build scripts including:
- Adding all required exectuable check for build
- Removng hardcoded Python27 path
- Printing out used python version and path
- Using EDKII stable201905 tag to build QEMU FSP
Signed-off-by: Maurice Ma <maurice.ma@intel.com>
This patch cleaned APL and CFL stitching script.
- Shared common code for stitching functions on flash map process
- Converted coding style to snake_case for consistent naming convention
Signed-off-by: Maurice Ma <maurice.ma@intel.com>
EDK II build has enabled python3 support. Since SBL has its own scripts,
it is required to port them accordingly to support python3. This patch
added python3 build support for SBL.
Signed-off-by: Maurice Ma <maurice.ma@intel.com>
By design, BootloaderCommonPkg should not refer to
BootloaderCorePkg. Hence removed those references in
the .inf files in Common pkg.
Moving SmbiosInitLib to Core pkg as it is a core feature.
Signed-off-by: Sai Talamudupula <sai.kiran.talamudupula@intel.com>
This patch added IfwiUtility.py script to help parse the IFWI layout
and locate and replace components. It can be used to swap component
listed in the SBL flashmap, such as CFGDATA, MRCDATA, ACM, etc. It
supports different IFWI layout.
For exmaple,
APL MRC data flash layout path:
IFWI/BIOS/NRD/MRCD
CFL MRC data flash layout path:
IFWI/BIOS/BP0/BPDT/BpdtIbb/MRCD
To determine a compoment flash layout path, please use:
python IfwiUtility.py view -i IfwiImage.bin
Signed-off-by: Maurice Ma <maurice.ma@intel.com>
With this change, customer could copy only board package folder
outside of SBL repo and build it without copying silicon folder.
It could help customer create their own repo and use SBL open
source repo as a submodule.
Signed-off-by: Guo Dong <guo.dong@intel.com>
Users might want to have some parameters that can be set
from UEFI environment. UEFI NVRAM variables provide a way
to achieve this functionality. And they require these vars
to be read from bootloader.
This patch provides a library to get read access to the
UEFI variables stored in NV region. The driver was ported
from MdeModulePkg\Universal\Variable\Pei @ EDKII Open Source.
Signed-off-by: Sai Talamudupula <sai.kiran.talamudupula@intel.com>
Removing hard code in PrepareBuildComponentBin.py, so it could
support other platforms. And enhance its logic to support to
run in different places.
Moving repo and commit information to driver INF so this script
could reuse code to support different drivers.
Signed-off-by: Guo Dong <guo.dong@intel.com>
Since we may want to perform FW update on
pre-OS checker/payload binaries separately
from the OS Loader payload we will search
for pre-OS checker/payload in the container
entries instead of adding it into the OS
Loader FD.
Signed-off-by: James Gutbub <james.gutbub@intel.com>
When downloading FSP and Microcode into local tree, it is required
to support board/silicon packages at different locations since the
board/silicon packages might be located outside of the SBL tree pointed
by PLT_SOURCE environment variable. Current code always assumes the
board/silicon is inside SBL tree, and it needs to be fixed. This
patch fixed#269 .
Signed-off-by: Maurice Ma <maurice.ma@intel.com>
Update TpmType to LoaderPlatform info hob based on
Type updated in Platform Info. LoaderPlatformInfo revision
is updated.
Signed-off-by: Subash Lakkimsetti <subashx.lakkimsetti@intel.com>
To make it easier to share the most common configuration items in a
DLT file, it is better to support '!include' in DLT file. This patch
added this feature. It also added examples in QEMU to test this.
Signed-off-by: Maurice Ma <maurice.ma@intel.com>
This patch enabled Linux as payload support on QEMU platform. To build
Linux as payload, please follow instructions mentioned in commit:
4a5af4f8b0
In addtion, to boot Linux payload on QEMU, please append following
into QEMU command line to set Payload ID to 'LINX' dynamically.
-boot order=abc
Signed-off-by: Maurice Ma <maurice.ma@intel.com>
OsLoader has the capability to boot a Linux kernel. However, to support
LinuxBoot type of payload, it is required to load kernel in Stage2. This
patch abstracts the standard Linux loading logic into common LinuxLib
class so that it can be linked in Stage2 or Payload such as OsLoader.
A new PcdLinuxPayloadEnabled is introduced to control if this feature
should be enabled or not.
To boot a Linux kernel from Stage2, it is required to put the command
line file and kernel image into the EPAYLOAD container during the build.
And the PayloadId CFGDATA needs to be set to 'LINX'.
For example:
python BuildLoader.py build qemu
-p OsLoader.efi::Lz4;vmlinuz:LINX:Dummy;cmdline.txt:CMDL:Dummy
vmlinuz and cmdkube.txt need to be copied to PayloadPkg/PayloadBins
folder. If kernel size cannot fit into EPAYLOAD, EPAYLOAD_SIZE in
BoardConfig.py needs to be adjusted accordingly.
Signed-off-by: Maurice Ma <maurice.ma@intel.com>
The current implementation used a huge array to represent boot options in
a single CFGDATA tag. With this approach, when a different board needs
to modify a single field, the whole array needs to be duplicated in the
CFGDATA. It is not efficient. A better approach is to break the options
into individual boot option CFGDATA tag. It will reduce the overall CFGDATA
in general. This patch implemented this mechanism. A library interface
FillBootOptionListFromCfgData() is provided to convert the CFGDATA into
the required OS_BOOT_OPTION_LIST.
Signed-off-by: Maurice Ma <maurice.ma@intel.com>
This patch enabled container use case for EPAYLOAD loading.
It also switched to use LoadComponent() API for Stage2 and
payload loading. It simplified the code flow. An example in
QEMU was added to demonstrate on how to add a container in
build and load it in Stage2 code.
To define a container layout, it is required to provide
GetContainerList() in BoardConfig.py. Then in stage or payload
code, LoadComponent() can be used to load a component from the
container.
Signed-off-by: Maurice Ma <maurice.ma@intel.com>
Since HASH_INDEX_* is a 1:1 mapping with
COMP_TYPE_* we can remove HASH_INDEX_* and
replace with COMP_TYPE_*.
Also fix some misspellings.
Signed-off-by: James Gutbub <james.gutbub@intel.com>
This patch added a ContainerLib to support load and location a
component from a specified container. It copies the component
from flash to memory, authenticate it, and then decompress it if
required. It can also be used to support load component from flash
map in SBL stage2 or payload, such as payload or e-payload.
Signed-off-by: Maurice Ma <maurice.ma@intel.com>
This patch added GenContainer.py script to create, extrace, replace,
sign and display a container image. If platform provides
GetContainerList() in BoardConfig.py, the build process will consume
it to create container images.
Signed-off-by: Maurice Ma <maurice.ma@intel.com>
There are cases where temporary memory is required in stages. Since
MemoryAllocationLib instance for stages has no de-allocation function,
it needs special handling. This patch added temporary memory management
into standard MemoryAllocatoinLib interface.
Signed-off-by: Maurice Ma <maurice.ma@intel.com>
SmmBase Info should not be expected by MpInit if the
platform/payload has not updated the Tseg region.
Check for the COMM signature before proceeding to Rebase.
Signed-off-by: Sai Talamudupula <sai.kiran.talamudupula@intel.com>
Restore the register information saved during the
normal boot, on S3 resume path for UEFI payload only.
Signed-off-by: Sai Talamudupula <sai.kiran.talamudupula@intel.com>
This issue happens when a template file includes another files
since template dictionary has '!include' line itself instead of
its contents.
Signed-off-by: Aiden Park <aiden.park@intel.com>
This patch allows platform to use BoardConfig.py to override the
LOGO_FILE path so that customized logo file can be used instead of
the common one.
Signed-off-by: Maurice Ma <maurice.ma@intel.com>
In ConfigEditor, when open DSC files, many files will show up. It
is expected to only open the CfgDataDef.dsc. This patch changed
the file match pattern to only list *Def.dsc file. In this way,
user will not make mistake to open some include DSC file.
Signed-off-by: Maurice Ma <maurice.ma@intel.com>
The previous implementation has a little confusion in license header.
To avoid further annoying, simply re-implement ElfLib.
- 32bits, little-endian, executable elf only supported
- elf32.h/elf_common.h from BaseTools/Source/C/GenFw
- LoadElfImage() interface changed
Signed-off-by: Aiden Park <aiden.park@intel.com>
Previous commit 4061d47f30 missed one
condition while handling the board notification calls. For built-in
payload such as OsLoader and FwUpdate, it will issue notifications
from payload through SBL platform services. So for these payloads,
board notification should not be called in SBL Stage2. This patch
fixed this.
Signed-off-by: Maurice Ma <maurice.ma@intel.com>
Current SBL does not call board ReadyToBoot & EndOfFirmware phases
in Stage on normal boot flow. Current open source UEFI payload does not
do it either. It caused some security concerns. The patch enforced
these notification calls on normal boot flow in SBL for all payloads
except for those that can handle board and FSP notification on its own.
It fixed#191.
Signed-off-by: Maurice Ma <maurice.ma@intel.com>
This patch utilizes information from FspBin.inf to checkout specific
tag from FSP repo and copy files to SBL source tree.
Signed-off-by: Maurice Ma <maurice.ma@intel.com>
Synced up MdePkg, IntelFsp2Pkg and BaseTools to EDK2 stable tag
edk2-stable201905.
There are several changes for MdePkg and BaseTools.
MdePkg:
- Support light print to reduce SBL size
MdePkg\Library\BasePrintLib\PrintLibInternal.c
MdePkg\Include\Library\DebugLib.h
- TCG TPM2 spec changes and remove dependencies
MdePkg\Include\IndustryStandard\UefiTcgPlatform.h
MdePkg\Include\IndustryStandard\Tpm2Acpi.h
- Use old NVM protocol file
MdePkg\Include\Protocol\NvmExpressPassthru.h
- Removed unused files
BaseTools:
- Added LZ4 support
- Removed unused files
Signed-off-by: Maurice Ma <maurice.ma@intel.com>