Commit Graph

1660 Commits

Author SHA1 Message Date
Aiden Park 4803d940b1 [MpInit] Allow a Board to configure PcdCpuMaxLogicalProcessorNumber
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>
2019-09-09 09:06:57 -07:00
Aiden Park dbe7aaa987 [ACPI] Append Processor Local APIC entries into MADT in runtime
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>
2019-09-09 09:06:57 -07:00
Aiden Park 63439af6db
[AcpiInitLib] Allocate ACPI tables from low to high memory (#314)
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>
2019-09-06 09:11:10 -07:00
Himanshu Sahdev 09245f4e54 BootloaderCore: Handle BIST failure in SecEntry (#311)
- 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
2019-09-06 09:10:41 -07:00
Himanshu Sahdev dbd92ac9c1 BootloaderCorePkg/Stage1A/Ia32/Vtf0/ReadMe.txt: Updating ReadMe
Signed-off-by: Himanshu Sahdev aka CunningLearner <sahdev.himan@gmail.com>
2019-09-04 16:00:10 -07:00
CunningLearner a46605d970 Optimize Stage1A early boot init (#308)
- Clear interrupts at EarlyInit16
- Restore BIST value to EAX register

Signed-off-by: Himanshu Sahdev aka CunningLearner sahdev.himan@gmail.com
2019-09-03 22:32:28 -07:00
Raghava Gudla b04859eb18 Added XML patching for CFLS and CFLH platforms
This patch added support for CFLS and CFLH stitching by patching
proper xml file for the platforms.

Signed-off-by: Raghava Gudla <raghava.gudla@intel.com>
2019-09-03 15:10:55 -07:00
Guo Dong 9435382022 [CFL] Add pre-memory GPIO program
Currently in Stage1B it defined gpio table for pre-memory, but no one
program that gpio table. This patch adds it.
Move full GPIO table program from Stage1B to Stage2
Remove unused global variable mRsvdSmbusAddressTable in Stage1B.

TEST= Build success.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2019-09-03 15:08:05 -07:00
Raghava Gudla 6c53f7d8de Generate BPMGen2 parameters for CFL/WHL
This patch will patch parameters for BpmGen2
based on the example file provided in the BpmGen2
package.

Signed-off-by: Raghava Gudla <raghava.gudla@intel.com>
2019-09-03 13:20:48 -07:00
James Gutbub 49e2f0994f Resolve Klocwork issue in FWU code
If capsule header is NULL or no payloads
found in the capsule return EFI_NOT_FOUND.

Signed-off-by: James Gutbub <james.gutbub@intel.com>
2019-09-03 11:28:33 -07:00
Grandhi 5275a93191 Add ACM3 binary into BIOS region
Signed-off-by: Grandhi <sindhura.grandhi@intel.com>
2019-08-30 16:45:35 -07:00
Raghava Gudla 348aad235a Simplify xml patching in stitchifwi
This patch will use a list of xml changes required and
patch them in a loop rather than patching each change
seperately.

This patch also add parameter to indicate platform for which
ifwi is getting build.

Signed-off-by: Raghava Gudla <raghava.gudla@intel.com>
2019-08-30 13:32:07 -07:00
Raghava Gudla e8d08aacdb Remove using FitHelp.py in StitchIfwi
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>
2019-08-29 15:08:06 -07:00
Sai Talamudupula d22277655a [CFL] GPIO config for Upx board
Configure Gpio pins and update ClkFeatures for PCIE RootPorts.

Signed-off-by: Sai Talamudupula <sai.kiran.talamudupula@intel.com>
2019-08-29 14:50:07 -07:00
James Gutbub 327fbac532 Resolve Klocwork issues in Payload & Platform
Klocwork scanning reported several issues in the
PayloadPkg and Platform code folders, this commit
aims to resolve all of the issues currently being
reported in these folders.

Signed-off-by: James Gutbub <james.gutbub@intel.com>
2019-08-29 10:39:22 -07:00
Maurice Ma cc46751e0c Fix CfgDataTool issue on some platforms (#294)
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>
2019-08-28 10:13:46 -07:00
Maurice Ma 866493b926 Fix klocwork scanning issues in BootloaderCommonPkg
Fixed several issues reported by klockwork scanning.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-08-28 09:33:45 -07:00
Subash Lakkimsetti c3c754a10d Add TCG2 physical presence ACPI to CommonBoardPkg
TpmSsdt.asl is common for supported platforms
SMIE for SMI control access is defined in Platform DSDT
for CFL and APL.

Signed-off-by: Subash Lakkimsetti <subashx.lakkimsetti@intel.com>
2019-08-27 14:57:07 -07:00
Aiden Park 1e33df6aaa [APL] Change debug log level to VERBOSE in HdaLib
To reduce redundant log messages from HdaLib, lower debug log level
from DEBUG_INFO to DEBUG_VERBOSE.

Signed-off-by: Aiden Park <aiden.park@intel.com>
2019-08-26 18:20:55 -07:00
Raghava Gudla 86397f6f75 Add shell command to trigger firmware update
This patch will add shell command to trigger firmware
update on CFL/WHL platforms.

Signed-off-by: Raghava Gudla <raghava.gudla@intel.com>
2019-08-26 18:20:40 -07:00
Aiden Park c722e2da65 [APL] Fix StitchLoader failure in Linux
Linux case-sensitive issue. Update StitchLoader.py with the exact file name.

Signed-off-by: Aiden Park <aiden.park@intel.com>
2019-08-26 18:19:20 -07:00
Raghava Gudla 7641cff41a Seperate SPD config data from memory config data
This patch will seperate SPD config data from memory configuration data,
as a small change in the SPD config data is resulting in duplication
of the memory config data. After sperating SPD config data, duplication
of whole memory cfg data is not required and would result in saving space.

Signed-off-by: Raghava Gudla <raghava.gudla@intel.com>
2019-08-23 14:29:08 -07:00
Raghava Gudla 953c53b572 Fix invalid string in Configuration data
This patch will fix an invalid string in the
configuration data for CFL/WHL platforms.

Signed-off-by: Raghava Gudla <raghava.gudla@intel.com>
2019-08-23 14:14:02 -07:00
Maurice Ma 4e13be369f [QEMU] Add repo clean command before building QEMU FSP
This patch run repo clean to remove previous generated files before
starting a new QEMU FSP build.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-08-23 14:10:58 -07:00
Maurice Ma 47bafebd7c Enable more build options in travis
Current travis build only performs debug build with python 2.
This patch allows to test debug and release build, python2 and
python3 build.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-08-23 11:31:37 -07:00
Maurice Ma b26a56480c [TOOLS] Misc enhancements for build scripts
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>
2019-08-23 08:32:49 -07:00
Maurice Ma 9fff1db6aa [TOOLS] Clean up stitching scripts for flash map
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>
2019-08-23 08:21:34 -07:00
Maurice Ma ea38da7599 [TOOLS] Add python3 build support
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>
2019-08-22 09:18:52 -07:00
Teo Boon Tiong 584489d894 [APL]Increase payload size to fix build error.
Signed-off-by: Teo Boon Tiong <boon.tiong.teo@intel.com>
2019-08-22 06:28:17 -07:00
Sai Talamudupula 9af34bca9a Remove Core pkg references from Common pkg
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>
2019-08-22 06:26:18 -07:00
Maurice Ma d9a6a2f211 [TOOLS] Add IFWI helper script
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>
2019-08-20 10:12:29 -07:00
Maurice Ma 965bcaa64a [WHL] Add flash map print in StitchLoader script
This patch added detailed flash map print in BIOS region for WHL
stitching script StitchLoader.py. In this way the script will
have consistent print format as APL.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-08-19 17:46:52 -07:00
Maurice Ma 2031953dc3 Fix firmware capsule loading assertion issue
This patch fixed a logic bug in firmware update library when
de-allocating memory in error handling flow. It fixed #275.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-08-16 15:35:13 -07:00
Guo Dong 73553318cd Enhance build script to support build flexibility
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>
2019-08-16 07:25:35 -07:00
Sai Talamudupula f0b5eaf43a Add UEFI Get Variable support
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>
2019-08-16 07:25:20 -07:00
Guo Dong ed53beb624 Enhance build support for binary downloading
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>
2019-08-15 18:09:51 -07:00
James Gutbub b0e390f1d3 Fix ContainerLib flash bug
There is a small bug in the ContainerLib
where the check for whether the data is
stored in the flash needs to be adjusted.

Signed-off-by: James Gutbub <james.gutbub@intel.com>
2019-08-15 14:03:46 -07:00
James Gutbub f9335e19a9 Switch to use container for pre-OS checker/payload
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>
2019-08-15 11:08:46 -07:00
Maurice Ma 78e7b0225e Fix FSP and Microcode download path issue
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>
2019-08-15 09:24:34 -07:00
Subash Lakkimsetti fa2124f91e [CFL] Add TPMType param to Loader Platform info HOB
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>
2019-08-14 14:44:23 -07:00
Guo Dong a6e3a23f1d Add common functions on PlatformName and external config data
Getting platform name from config data and set platform name is
common almost for all the platforms. So move it to common library.
Loading external configuration data from SPI is also common, so
add it into common library. Platform could still use its own method
to load config data if the common one doesn't work.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2019-08-14 13:20:50 -07:00
Sai Talamudupula 60e30f6ce1 [CFL] Use correct indices for Gpio DW0,DW1 in Template
Update the indices for Dw0, DW1 in Gpio Template after
the PinOffset Dword has been removed in the previous commits

Signed-off-by: Sai Talamudupula <sai.kiran.talamudupula@intel.com>
2019-08-14 13:17:43 -07:00
Raghava Gudla 8c533a4e56 [CFL] MRC data save is ignored after first boot
Current code will check if the first 4 bytes of the existing
MRC training data, if it is 0xFFFFFFFF then MRC training data
will be saved otherwise even though there is change in the
training data, it will not be saved.

Modified the code to compare the incoming training data to the
saved data, if they do not match, save the incoming training data.

Signed-off-by: Raghava Gudla <raghava.gudla@intel.com>
2019-08-13 17:43:31 -07:00
Maurice Ma 05e712bcbb [Tools] Add !include support for DLT files
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>
2019-08-13 14:34:08 -07:00
Maurice Ma 42b93e3b57 Enable Linux as payload support
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>
2019-08-13 14:32:18 -07:00
Maurice Ma 19a0890a54 Break Load Linux BzImage into more functions
This patch splitted LoadBzImage() into two functions.  One is just
for kernel loading.  The other one UpdateLinuxBootParams() is for
Linux boot parameter updates. It is required to do so because when
kernel loading in Stage2 is enabled the loading occurs before all
HOBs are finalized. The Linux boot parameters depend on HOBs to fill
correct information, such as frame buffer. With this patch, the boot
parameters can be updated at the very end.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-08-12 10:40:11 -07:00
Maurice Ma de675ac5af Fix Linux framebuffer boot parameters
Current SBL code depends on PixelInformation to fill kernel
framebuffer parameters. However, this info is only valid if
PixelFormat is PixelBitMask type. Since FSP will only produce
8bit per pixel format, it is better to use PixelFormat to
determine the pixel bit size and position information. This
patch added this logic. It also fixed #260 .

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2019-08-12 08:33:42 -07:00
Maurice Ma 4a5af4f8b0 Add Linux Kernel Boot Support in Stage2
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>
2019-08-09 16:48:12 -07:00
Raghava Gudla 2d5e431e06 Fix - IFWI built using Stitchloader.py is failing
Because of an error in Stitchloader.py, input file
slimbootloader binary data is not patched to the input
Ifwi. This error is now fixed which will produce correct
Ifwi image.

Signed-off-by: Raghava Gudla <raghava.gudla@intel.com>
2019-08-09 16:47:48 -07:00
Raghava Gudla 69e4e54206 Added StitchIfwi support for WHL/CFL platforms
This patch will add support for StitchIfwi.py to generate
Boot Guard enabled IFWI images for WHL/CFL platforms

Signed-off-by: Raghava Gudla <raghava.gudla@intel.com>
2019-08-08 13:59:40 -07:00