Commit Graph

1261 Commits

Author SHA1 Message Date
James Gutbub 4b82461065 Update IASL to version 20190509
For Azure and toolchain check we
can update to using IASL version
20190509 since some of the newer
SBL platforms require a newer
IASL version.

Signed-off-by: James Gutbub <james.gutbub@intel.com>
2022-01-05 12:01:15 -08:00
Randy Lin 071686dacd [CML] Fix ACPI GPE 0x6F interrupt storm
RTD3 table isn't ready so that comment _L6F out.

Signed-off-by: Randy Lin <randy.lin@intel.com>
2022-01-05 12:01:05 -08:00
Randy Lin 4a436f44ab [CFL] Fix Klocwork scanning issue
Fix Expression 'BootMode' can never reach the value

Signed-off-by: Randy Lin <randy.lin@intel.com>
2022-01-04 13:32:16 -08:00
Stanley Chang 07b7a1f0e0 Fix fwupdate check for BAD DSO mark
BAD DSO mark is simplified to only use Signature=0
when moving DSO update/check to TccLib.
Related check in fwupdate has to be updated too.

Signed-off-by: Stanley Chang <stanley.chang@intel.com>
2021-12-24 06:27:19 -08:00
Guo Dong bf4a56033f
Move DSO update/check to TccLib (#1444)
IsMarkedBadDso and InvalidateBadDso would be required for all
the platforms that support TCC. And the implementation is also
common, so just move them to common TccLib.
Also updated the implementation to remove SPI flash erase for
InvalidateBadDso().

Signed-off-by: Guo Dong <guo.dong@intel.com>
2021-12-23 15:11:03 -08:00
Randy Lin 500300c537 [CMLV] Fix wrong value of PchMaxPciePort
According to H410 PCH EDS data, it should be 20.

Signed-off-by: Randy Lin <randy.lin@intel.com>
2021-12-23 10:04:36 -08:00
Vincent Chen 62b5d48e6c [TGL] Update FSP, UCODE and platform version since MR4 is released
- update FSP/VBT version to UP3 IoT FSP MR4
- update TGLU microcode version to 9A
- update TGL platform version to 1.4
- remove redundant files in case of files not being updated

Signed-off-by: Vincent Chen <vincent.chen@intel.com>
2021-12-22 17:11:28 -07:00
Stanley Chang d66202f25d [TGL] Invalidate bad DSO region
This patch invalidates the DSO region with a marker after
a DSO hang (caused by corrupted DSO) is detected (by WDT timeout).
With the marker, stage1b can know the DSO tuning should be skipped.

The bad DSO mark is defined as both Signature and Size in the
TCCT component header are zero.

With this patch, the previous defined WDT scratchpad bit,
WDT_FLAG_TCC_BAD_DSO, is removed.

TEST=Verified on TGL-U RVP

Signed-off-by: Stanley Chang <stanley.chang@intel.com>
2021-12-22 06:11:29 -08:00
Subash Lakkimsetti c533416ef8 Check fit header entry location
For bootguard event log fit header location is retrieved
from fit pointer. Added a condition to check the FIT header
range to fix KW error.

Signed-off-by: Subash Lakkimsetti <subash.lakkimsetti@intel.com>
2021-12-21 12:31:06 -08:00
Yongxin Liu c3c9ebb1e2 add private key check for PKCS8 format
Since openssl 3.0.0, in commit 10203a34725e ("Support writing RSA
keys using the traditional format again"), the default format of
private key has been changed to PKCS#8.

Signed-off-by: Yongxin Liu <yongxin.liu@windriver.com>
2021-12-20 18:47:02 -08:00
Guo Dong 16d7d22040 Update BtgSign tool
Currently StitchLoader.py is under platform package, and
the common tool BtgSign.py should not depend on that tool.
And BtgSign.py indeed doesn't depend on it, so just update
it to make it could work without StitchLoader.py.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2021-12-16 08:11:53 -07:00
Ong Kok Tong 9cd53b65fd [EHL] WA for POSC issue
Rearrange SBL Global Data Structure for POSC
issue workaround. This is due to the POSC accessing
SBL Global Data and it get corrupted when SBL rearrange
or restructure the data structure.

Signed-off-by: Ong Kok Tong <kok.tong.ong@intel.com>
2021-12-15 20:45:48 -08:00
Maurice Ma 4a9390c3f8 [CFL][CML] Fix board hook call sequence issue
On CFL and CML, the board hook PostMemoryInit was called before
FspMemoryInit API. This should be called afterwards instead.

This patch fixed this issue. It is because of missing "break"
statement. It fixed #1435.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-12-15 10:15:17 -07:00
Guo Dong d0fac9b442 Enhance the tool
When BOARD_PKG_NAME_OVERRIDE is configured, the tool will firstly
search from BOARD_PKG_NAME_OVERRIDE, then search BOARD_PKG_NAME
for dlt and vbt files. It also uses BOARD_PKG_NAME_OVERRIDE for the
VerInfo file.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2021-12-13 16:13:04 -07:00
Maurice Ma e3cc5cacac Update LZMA to match EDK2 LZMA SDK 19
This patch updated LZMA to LZMA SDK 19.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-12-13 14:08:25 -08:00
Maurice Ma 5b5edd2168 Fix EDK2 rebasing caused AzurePipeline build issue
This patch fixed several build issue reported by Azure Pipeline.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-12-13 14:08:25 -08:00
Maurice Ma 749c32b71c [BootloaderCorePkg] Fix build after syncing up to EDK2 stable tag
EDK2 stable tag 202111 changed some field name in SMBIOS structure.
This patch matched the changes to fix the build issue for SBL. It
also added new library class in DSC.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-12-13 14:08:25 -08:00
Maurice Ma dda4d34fb3 [IntelFsp2Pkg] Update to latest EDK2 stable tag 202111
This patch updated SBL IntelFsp2Pkg to be in sync with EDK2 stable tag
202111.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-12-13 14:08:25 -08:00
Maurice Ma c7e1623c29 [MdePkg] Update to latest EDK2 stable tag 202111
This patch updated SBL MdePkg to be in sync with EDK2 stable tag
202111.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-12-13 14:08:25 -08:00
Maurice Ma 069031c9f8 [BaseTools] Update to latest EDK2 stable tag 202111
This patch updated SBL BaseTools to be in sync with EDK2 stable tag
202111.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-12-13 14:08:25 -08:00
Ong Kok Tong 6737caaed0 [EHL] UP2 6000 support
Aaeon UP2 6000 board first boot

1. Added platform ID support
2. Added BoardID read from GPIO
3. Added UP2 6000 dlt file

Signed-off-by: Ong Kok Tong <kok.tong.ong@intel.com>
2021-12-10 23:10:18 -08:00
Ong Kok Tong 6ebcc6971c [EHL] Fix ASL compiler warnings
Fixed ASL warning for SBL EHL

Signed-off-by: Ong Kok Tong <kok.tong.ong@intel.com>
2021-12-10 23:08:04 -08:00
Stanley Chang bfbc7943e0 [TGL] Fix infinite reset loop caused by bad DSO
This patch solves an infinite reset loop issue caused
by bad DSO with the scenario:
  After platform reset (due to WDT timeout), FSPm asks
  for another reset, but before that, WDT_FLAG_TCC_DSO_IN_PROGRESS
  is already cleaned. As a result, in the thrid reset, stage1B
  will have no idea about the DSO is corrupted and it
  continues boot with Tcc Tuning flow, which causes WDT
  timeout reset again.

This patch introduces a WDT_FLAG_TCC_BAD_DSO flag in WDT
scrachpad (bit 18). The flag is a marker that is set when
a bad DSO is detected. The new booting flow for "bad DSO" case
if Tcc_Tuning enabled will be:

  1st boot: (after fwupdate)
     - TCC_DSO and WDT set by stage1b and stage2
     - FSP hangs and trigger WDT reset
  2nd boot:
     - Stage1b detects "bad DSO" because of WDT and
       TCC_DSO_IN_PROGRESS. For this case:
         Clear TCC_DSO_IN_PROGRESS and WDT.
         Set TCC_BAD_DSO.
       Then it continues boot that will skip Tcc Tuning
       (because of TCC_DSO_IN_PROGRESS unset)
     - FSPm asks for a reset
  3rd boot:
     - Stage1b detects "bad DSO" because of TCC_BAD_DSO
       It continues boot that will skip Tcc Tuning
       (because of TCC_DSO_IN_PROGRESS unset)

The patch does not remove the 200-sec abnormal boot-up symptom
because the symptom is noticeable to user. So user can be aware
of something wrong (bad DSO).

The "bad DSO" flag will be clear before fwupdate, so a fwupdate
with a correct DSO can solve the 200 sec abnormal boot up time.

Signed-off-by: Stanley Chang <stanley.chang@intel.com>
2021-12-10 23:07:48 -08:00
Randy Lin 1e5a04030c [TGL] Add stitch option to support TGL-H RVP Config 3
Config 1/3 RVP boards can't share same IFWI image
and it is required to adjust the FIT parameters.
Add -o cfg3 to support this.

Signed-off-by: Randy Lin <randy.lin@intel.com>
2021-12-03 07:20:47 -08:00
Aiden Park ec2d06768c [X64] Fix invalid 1st timestamp at reset vector
The timestamp value is saved in edi:esi at reset vector in X64, but
PreparePagingTable is using esi and makes 1st timestamp value invalid.

This saves/restores edi:esi before/after PreparePagingTable to keep
proper timestamp value at reset vector.

Signed-off-by: Aiden Park <aiden.park@intel.com>
2021-12-03 07:20:33 -08:00
kokweich 8529406967 [EHL] Microcode MR2 update
Update microcode version to MR2 in inf files

Signed-off-by: kokweich <kok.wei.chan@intel.com>
2021-12-03 07:20:12 -08:00
Maurice Ma c0e68ede88 Fix cfgdata_dir argument issue in CfgDataStitch
This patch fixed the issue that "cfgdata_dir" argument is not
used properly by the CfgDataStitch script. The "cfgdata_dir"
will contain the CfgDataDef.yaml file and optional DLT files
if provided. Otherwise, the DLT files will be extracted from
the IFWI binary and stored in "cfgdata_dir".

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-12-02 09:21:10 -08:00
Subash Lakkimsetti 7a3bab7fa3
[TGL][EHL] Fix regression for Flash descriptor lock (#1425)
Add BootMediaWriteByType and use for flash descriptor
update.

Signed-off-by: Subash Lakkimsetti <subash.lakkimsetti@intel.com>
2021-12-01 22:25:11 -07:00
Randy Lin fb0a4aec22 Fix ASL compile warnings.
Signed-off-by: Randy Lin <randy.lin@intel.com>
2021-11-30 07:57:32 -08:00
kokweich 5a1e01d40b [EHL] Update FSP to MR2
Update FSP version to MR2 in inf file

Signed-off-by: kokweich <kok.wei.chan@intel.com>
2021-11-29 15:39:49 -08:00
Ong Kok Tong e4a00293f4 [EHL] Removed hardcoded PSE PWM pin enable
Removed hardcoded PSE PWM pin enable and adapt from
CfgData in Stage2.

Signed-off-by: Ong Kok Tong <kok.tong.ong@intel.com>
2021-11-29 15:35:30 -08:00
Lennert Buytenhek 644b8474da Fix Stage1 StackTop computation for Ia32, and align stack to 16 bytes
Adding the following bit of debug code to DetectUsedStackBottom() in
BootloaderCommonPkg/Library/BootloaderCommonLib/BootloaderCommonLib.c:

@@ -290,7 +290,10 @@ DetectUsedStackBottom (
 {
   UINT32  *StackBot;

+  DEBUG ((DEBUG_INFO, "StackTop is %x\n", StackTop));
   StackBot = (UINT32 *) ((StackTop - StackSize) & ~ (sizeof (UINTN) - 1));
+  DEBUG ((DEBUG_INFO, "StackBot is %p %x\n", StackBot, *StackBot));
   ASSERT (*StackBot == STACK_DEBUG_FILL_PATTERN);

   while ((UINT32)(UINTN)StackBot < StackTop) {

shows this for the Stage1 stack on qemu X64, as expected:

	StackTop is 2000
	StackBot is 0 5AA55AA5

but it shows this on qemu Ia32, which appears to be incorrect:

	StackTop is 2004
	StackBot is 4 5AA55AA5

This Stage1 StackTop mismatch on Ia32 seems to be caused by the setup
code in BootloaderCorePkg/Stage1A/Ia32/SecEntry.nasm pushing only a single
32-bit word onto the stack for the 'Status' field of STAGE1A_ASM_PARAM,
while that field is actually a 64-bit field, which causes this line in
BootloaderCorePkg/Stage1A/Stage1A.c to compute a stack top address that
is off by 4 bytes:

  StackTop = (UINT32)(UINTN)Params + sizeof (STAGE1A_ASM_PARAM);

This patch makes the Ia32 Stage1A setup code push an extra 32-bit
word onto the stack before calling SecStartup, which fixes the Stage1
StackTop computation.

While we are at it, let's push another dummy word onto the stack in
the Stage1A setup code to make the Stage1A stack be 16-byte aligned,
like what is already the case for X64, so that we follow Version 1.0
of the System V Intel386 ABI supplement, and satisfy any expectations
our compiler may have regarding stack alignment.

Also add a comment to both the Ia32 and X64 Stage1A setup code to
remind the reader that the structure we build on the stack before
calling SecStartup has to match the layout of STAGE1A_ASM_PARAM.

Signed-off-by: Lennert Buytenhek <buytenh@arista.com>
2021-11-19 13:41:44 -08:00
Lennert Buytenhek 5b51c32146 Align the Ia32 Stage1B/Stage2 stack to 16 bytes
Much like the corresponding Stage1A patch, this patch aligns the
Ia32 Stage1B and Stage2 stacks to 16 bytes, like what is already the
case for X64, so that we follow Version 1.0 of the System V Intel386
ABI supplement, and satisfy any expectations our compiler may have
regarding stack alignment.

A nice side effect of this change is that it allows building an Ia32
Slimbootloader with -msse which can run on real hardware, which requires
16-byte stack alignment.  Slimbootloader currently already enables SSE
in XCR0 early on in Stage1A, and it has SSE versions of various helper
functions written in assembly, in other words, it already makes use of
SSE, but allowing the compiler to emit SSE instructions requires 16-byte
stack alignment, because access to unaligned on-stack SSE variables
will throw #GP on real hardware.  (QEMU doesn't seem to enforce the
requirement for natural alignment of SSE memory arguments.)

Suggested-by: Peter Edwards <peadar@arista.com>
Signed-off-by: Lennert Buytenhek <buytenh@arista.com>
2021-11-19 13:41:33 -08:00
Lennert Buytenhek 0a90065ac9 Print code bytes around eip/rip when taking a fatal exception
When we die due to a fatal exception, we get a debug message that
looks like this:

	Exception #6 from 0x0010:0x000728E9 !!!

This message by itself is not incredibly useful for figuring out
which code caused the exception.

This patch borrows an idea from the Linux kernel, and extends the
exception information with a dump of the opcode bytes around the
instruction pointer, which means that the exception debug message
will now look like this:

	Exception #6 from 0x0010:0x000728E9 !!!
	000728C9: 07 00 6A 40 E8 E0 E8 FF-FF 83 C4 0C 68 00 00 07  [...]
	000728D9: 00 68 DA 3A 07 00 6A 40-E8 CC E8 FF FF 83 C4 10  [...]
	000728E9: 0F 0B E8 8E F2 FF FF 8D-55 98 80 78 0E 01 8D 45  [...]
	000728F9: 94 75 06 52 50 6A 01 EB-04 52 50 6A 00 68 53 47  [...]

Tested by inserting a UD2 instruction into Stage1A and verifying on
qemu ia32 and on qemu x64 that the right information is printed.

Signed-off-by: Lennert Buytenhek <buytenh@arista.com>
2021-11-19 12:20:46 -08:00
James Gutbub fe6cf32721 Add common GPIO payload selection CFG
GPIO payload selection settings can be made
into a platform optional common config. This
will ensure that the options display the same
across all platforms which add support for
the GPIO payload selection feature. Each
platform will need to include the
CfgData_PayloadSelection.yaml and needs to
create their own CfgData_GpioPadGroups.yaml
to provide the list of GPIO pad groups to
select from.

Signed-off-by: James Gutbub <james.gutbub@intel.com>
2021-11-18 13:49:44 -07:00
Kok Tong Ong 18fc9592a8 [EHL] Enable Gbe TSN config in yaml
Enable Gbe TSN config in silicon yaml file below:
- PchTsnGbeSgmiiEnable
- PseTsnGbeSgmiiEnable
- PseTsnGbePhyInterfaceType

Signed-off-by: Kok Tong Ong <kok.tong.ong@intel.com>
2021-11-17 11:43:00 -08:00
Maurice Ma 3bcbb0492c
Add SMBIOS type 4 for processor info (#1413)
This patch added required SMBIOS type 4 for processor info.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-11-16 15:36:03 -08:00
Sai T b9422c7969 Enhance Smbios Init Lib
This patch does the following updates to SmBiosInitLib:

  1. Provide AddSmbiosType() to add a SmBios Type header.
  2. Provide AddSmbiosString() to append strings to Type header.
  3. Move Finalize() to after 'PrePayloadLoading' board init phase.
     All Smbios related calls need to be done before this.
  4. Modified TGL project to adjust to these changes.

Signed-off-by: Sai T <sai.kiran.talamudupula@intel.com>
2021-11-16 12:35:12 -08:00
Ong Kok Tong 97fbf9349c [EHL] Increase epayload size
Increase epayload size to 0x00162000 for compilation
error with latest debug version of uefi-payload

Signed-off-by: Ong Kok Tong <kok.tong.ong@intel.com>
2021-11-15 19:06:24 -08:00
Sai T 6eaea8fafa Add a PCD to set RTCM RSVD SIZE
If the number of cores are more and the RTCM is
required to support HyperThreading, then it needs
more reserved size, preferably 511 pages instead of
current 255 pages.

So, add a FixedPcd and let each platform override
the default 255 pages value to whatever is required.

Signed-off-by: Sai T <sai.kiran.talamudupula@intel.com>
2021-11-15 19:05:05 -08:00
Maurice Ma d424a15994 Add boot from multiple USB devices
When multiple USB devices are attached, current SBL will try to
boot the device with index specified by HwPart in the boot option.
However, it is hard to determine the USB device index order since
it depends on which port the device is connected to. Instead, for
USB devices, SBL can try to boot from each of them until the boot
image is loaded successfully or all USB devices have been tried out.
This patch added this support.

To enable this feature, it is required to set the USB boot option
HwPart to 0xFF.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-11-10 14:28:31 -08:00
Maurice Ma cccb003280 PatchCheck: Skip more files that contain non-standard whitespace
This patch added additional files to be excluded from patch check.
For example, txt, ini, app, common, template, rule, Makefile,
GNUmakefile, etc.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-11-10 14:28:17 -08:00
Maurice Ma fb17a7389f PatchCheck: Skip more files that contain non-standard whitespace
This patch added additional files to be excluded from patch check.
For example, txt, ini, app, common, template, rule, Makefile,
GNUmakefile, etc.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-11-10 13:15:04 -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
Ong Kok Tong 8c75111faa [EHL] Disabled AC split lock by default
Disabled AC split lock by default in CfgData yaml file.

Signed-off-by: Ong Kok Tong <kok.tong.ong@intel.com>
2021-11-08 18:02:37 -08:00
Jim c035269a4a [TGL] Remove SGX Configurability
This patch removes SGX configurability from Slim Bootloader as
SGX is not supported on TGL.

Signed-off-by: Jim <jim.pelner@intel.com>
2021-11-08 11:02:43 -08:00
Maurice Ma acfe51f382 Sync up MTRR for MP before boot
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>
2021-11-05 11:09:16 -07:00
Maurice Ma f4a184ef35 Enhance Ext2 filesystem library
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>
2021-11-05 07:27:13 -07:00
Aiden Park 95f335b6b0
Fix variable not initialized KW issue (#1398)
This is to initialize a Boolean variable to fix KW issue

Signed-off-by: Aiden Park <aiden.park@intel.com>
2021-11-04 20:29:53 -07:00