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>
SBL might change MTRR to enable framebuffer cache. Current code
only handles BSP MTRR programming, and it is necessary to sync
up the MTRR programming for all APs as well. This patch added
a function to sync up MTRRs for all APs.
Please note, this MTRR sync up is a simplified version for SBL
case since SBL will only add new MTRRs for GFX framebuffer.
To do a full generic MTRRs sync up, it is required to flush cache,
reload TLB, etc. And it will come with some performance impacts.
Signed-off-by: Maurice Ma <maurice.ma@intel.com>
For EXT2 filesystem revision 0, there are some fixed fields in the
super block structure according to the documentation. The code should
always use those fixed values for safe regardless of the value inside
the image.
Signed-off-by: Maurice Ma <maurice.ma@intel.com>
UEFI payload built from open sourced EDK2 supports SMM variable now.
So build the required HOBs to work with EDK2.
This patch just changed the common SBL code, so there is no platform
change required.
This patch also added a PCD PcdBuildSmmHobs for old SMM HOBs and new
SMM HOBs. Late old SMM HOBs might be dropped.
Signed-off-by: Guo Dong <guo.dong@intel.com>
This patch adjusted the following debug message for USB libraries:
- For SBL, since mutli-TT is not utilized, it should not be
classified as error message. It is changed to be DEBUG_INFO now.
- Added DeInit debug print for USB so that it tells the USB
resources are de-allocated.
Signed-off-by: Maurice Ma <maurice.ma@intel.com>
When multiple USB mass storage devices are connected to the
target, it is not clear to the end user which one is selected
for boot. This patch added code to print the USB mass storage
device manufacturer and product name string. In this way, it
is easier for the end user to identify specific USB device.
It can also be used to determine the HwPart field for USB boot
option. HwPart for USB boot option is mapped to the USB mass
storage device index detected on the platform. BTW, to allow
boot from multiple USB mass storage devices, the optoin
ENABLE_MULTI_USB_BOOT_DEV needs to be enabled. So this patch
enabled ENABLE_MULTI_USB_BOOT_DEV by default.
Signed-off-by: Maurice Ma <maurice.ma@intel.com>
Current SBL will always append "acpi_rsdp=" as part of the command
line for Linux boot. However, since acpi_rsdp_addr was added in
boot parameter for Linux boot protocol 2.14 and later, it is only
required to do this for old boot protocol. This patch implemented
this.
Signed-off-by: Maurice Ma <maurice.ma@intel.com>
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>
When user disabled PRE_OS in bootflag with boot->idx
command in OSL shell but shell still prompt user to
enter PREOS image file path, This is due to the system
check the existing boot option list instead of the
boot option that user currently updating.
Signed-off-by: Ong Kok Tong <kok.tong.ong@intel.com>
When trying to build tgl target with
VS2015x86 there is some error reported:
TimeStampLib.lib: error LNK2001: unresolved external symbol __allmul
FirmwareUpdate.dll : fatal error LNK1120: 1 unresolved externals
This patch resolves the issue by removing
the UINT8 casting.
Signed-off-by: James Gutbub <james.gutbub@intel.com>
Current SBL will build full address paging table supported by CPU
only at the beginning of the OsLoader. It is better to move it to
Stage2 so that all payloads can have the full range address support
in x64 mode. It also allows Stage2 platform code to access 64bit
PCI resource. This patch addressed this issue.
Signed-off-by: Maurice Ma <maurice.ma@intel.com>
Current SBL only looks into the primary GPT during partition detection.
If it is not valid, then MRB partition will be checked next. In some
case of the Ubuntu USB disk created, only the 2nd GPT is valid. SBL
should check both primary and secondary GPT table before moving to MBR
check. This patch added this fix.
Signed-off-by: Maurice Ma <maurice.ma@intel.com>
This patch cleaned up the NVMe library DEBUG message. Lots of the
DEBUG_INFO level were changed to DEBUG_VERBOSE to reduce normal
output.
It also removed the hardcoded device index 0 for NvmeReadBlocks,
NvmeWriteBlocks and NvmeGetMediaInfo APIs.
Signed-off-by: Maurice Ma <maurice.ma@intel.com>
Current NVMe library reports hardcoded block size 512 and block num
512. It is incorrect. This patch fixed it.
Signed-off-by: Maurice Ma <maurice.ma@intel.com>
Current XHCI library does a big loop to poll the status of a
USB command execution. In each loop it will delay 1us until
it completes or reachs the timeout. When the loop is very big,
the accumulated 1us delay together will be shifted far beyond
the original timeout requested. This is because of the inaccuracy
of the 1us delay provided by ACPI timer library. This patch
addressed this issue by checking the actual executed time rather
than looping with delay.
Signed-off-by: Maurice Ma <maurice.ma@intel.com>
This reverts commit 24f5aa59b5.
There are cases that warm reset is requested before memory is
initialized. Doing WBINVD in this case can cause system hang.
A better approach is to let the caller to decide when to do
cache flush for a warm reset.
Signed-off-by: Maurice Ma <maurice.ma@intel.com>
Sometimes it is helpful if SBL can support firmware update from
SBL FW to UEFI FW, or update from incompatible SBL flash layout.
This will need SBL to write full BIOS region without using
redundant partition. To support this, a special capsule image
flag is added to indicate this special update. Please note, this
update might be very risky. This is only for development purpose.
Signed-off-by: Maurice Ma <maurice.ma@intel.com>
In some cases, the memory needs to keep consistent across a warm
reset. When warm reset is triggered, it might still have modified
cacheline that has not been flushed to memory yet. The patch added
WBINVD to flush cache before the warm reset.
Signed-off-by: Maurice Ma <maurice.ma@intel.com>
KW scan reported a couple errors regarding
Sec*Shdr value, need to check if they are
NULL before using these values.
Signed-off-by: James Gutbub <james.gutbub@intel.com>
Current SBL code uses MSR(0xce) to calculate the CPU TSC frequency.
However, it is not very accurate. A better way is to use CPUID to
calculate the TSC frequency. This patch added new API to get accurate
TSC frequency. It also added APIs to allow conversion between time
and TSC ticks.
Signed-off-by: Maurice Ma <maurice.ma@intel.com>
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>
Universal Payload uses ELF format. As a result, the ELF loading
library has been enhanced to handle more complicated cases. The
Universal Payload library added an abstract layer on top of
ELF lib to make it easer to use by SBL. OsLoader and Stage2 were
modified to work with the new library interfaces.
Signed-off-by: Maurice Ma <maurice.ma@intel.com>
In some cases the paging will be enabled after returning from the
thunked function. To ensure the paging table can be reloaded before
switching back to x64 mode, the paging needs to be in disabled
state. This patch ensures the CR0 bit31 paging bit is cleared.
Signed-off-by: Maurice Ma <maurice.ma@intel.com>
SBL defined SetDeviceAddr/GetDeviceAddr to abstract platform
device info. However, currently only boot media devices are
defined. It has cases that other platform device info is needed,
such as GFX device. This patch extended the concept to define
some other platform devices as an extenstion to
OS_BOOT_MEDIUM_TYPE. The enum values should not overlap with
the ones defined in OS_BOOT_MEDIUM_TYPE.
Signed-off-by: Maurice Ma <maurice.ma@intel.com>
Synced the PrintBootOptions fucntions to print
Pre-OS and extra images.
Fixed bug -> if pre-os or extra images are not enabled
in boot flag and it still output in PrintBootOptions
function
Signed-off-by: Ong Kok Tong <kok.tong.ong@intel.com>
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>
On Simics or QEMU, BOCHS graphics is used. This patch provides
library to initialize BOCHS graphics. It is useful when GFX
initiailzation is not provided by FSP. In this case, the native
code can be used to initialize graphics.
Signed-off-by: Maurice Ma <maurice.ma@intel.com>
When FV extended header exists, the first FFS pointer returned by
GetFirstFfsFileInFv() might not be 8-byte aligned. This patch
adjusted the pointer accordingly to ensure it is aligned per UEFI
spec.
Signed-off-by: Maurice Ma <maurice.ma@intel.com>
Boot command may attempt to use an index which
exceeds the max image type. Check if the value
is larger than the max allowed value and return
if there is an error.
Signed-off-by: James Gutbub <james.gutbub@intel.com>
There is a bug when user use boot->idx command in OSL
shell to modify boot option which contained Pre-OS and extra images
(eg. POSC or RTCM etc.)
Current CmdBoot didnt cover for extra images in idx command.
This patch cover for extra images.
Signed-off-by: Ong Kok Tong <kok.tong.ong@intel.com>
IA32 build from VS2019 toolchain has security violation
because Digest value from SHA512_384 is not matching the
value calculated and stored in hashstore during build.
Aligning the stack to 32-byte boundary during SHA_Update
fixes this error.
Signed-off-by: Talamudupula <stalamudupula@gmail.com>
Resolve link error when using UsbInitLib
UsbInitLib invokes UsbDeInitBot() which is defined in UsbBlockIoLib
Signed-off-by: Vincent Chen <vincent.chen@intel.com>
This patch allows to use a mailbox register (DWORD) to support debug
port. If CCA debug is connected, it is possible to access certain
SOC register through BSSB. Then this register can be used for debug
console input/output.
Signed-off-by: Maurice Ma <maurice.ma@intel.com>
This patch adds DebugPortLib as a platform extention lib to add new
debug port support. It also adds a generic GpioDebugPortLib to allow
GPIO bit bang to emulate UART TX pin.
Signed-off-by: Maurice Ma <maurice.ma@intel.com>
As per specification of the IAS-Image format
https://github.com/intel/iasimage/blob/master/docs/02_mcd.md
the signature and public key are optional.
As per specification of the header format
https://github.com/intel/iasimage/blob/master/docs/02_mcd.md#image-type
The 8th bit indicate if the signature is included, while the 9th bit
indicates whether the public key is included.
While the previous solution checked if public key is enabled, it did
not check if the signature is included, but rather assumed that it
is always included.
This will lead to a miss-calculation of the `IAS_IMAGE_END` and
`IAS_IMAGE_SIZE` which on the other hand will cause `IsIasImageValid()`
to fail, which will fail the loading of unsigned IAS-Images.
Signed-off-by: Jan Schlosser <jan.schlosser@outlook.com>
The PCI address consumed by CSME FW update library is in
EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_PCI_ADDRESS format.
- when register offset is < 0x100, it is : bbddffrr
- when register offset is >= 0x100, it is : rrrbbddff00
Consider the two different cases in CsmePciReadBuffer()
Signed-off-by: Vincent Chen <vincent.chen@intel.com>
This allows to load and execute ELF32 or ELF64 format payloads
regardless of Ia32 or X64 SBL operation modes.
Signed-off-by: Aiden Park <aiden.park@intel.com>
This patch runs basic check during EXT FS initialization
by opening root directory to ensure superblock been
validated.
Signed-off-by: Stanley Chang <stanley.chang@intel.com>
This patch changes the return code of SearchDirectory
to EFI_NOT_FOUND when a file to search cannot be found
Signed-off-by: Stanley Chang <stanley.chang@intel.com>
When the bus master decoding was disabled by default in PCI bus, the
device driver should try to enable it on its own. However, eMMC
driver does not have the enabling code. It caused the eMMC access
failure.
It fixed#1153.
Signed-off-by: Maurice Ma <maurice.ma@intel.com>