Commit Graph

123 Commits

Author SHA1 Message Date
Stanley Chang b78cb1d534 [TGL] Read boot Tjunctions
The patch adds a feature to read Dts at boot. The feature
is analogous to UEFI BIOS:

  Thermal Conf -> Platform Thermal Conf -> Boot DTS Read

Specifically, the feature reads Tjunctions of PCH and CPU
and stores them as Smbios Type-28 entries.

The patch also fixes AppendSmbiosType in SmbiosInitLib:
  A newly added structure should inherit the Handle from
  previous Type-127 (end-of-table) structure.

Signed-off-by: Stanley Chang <stanley.chang@intel.com>
2021-08-24 08:56:51 -07:00
Stanley Chang 02a10d7452 fix TSeg full during warn reset
This patch fixes TSeg region full problem after multiple
warn reset. Each time of warm reset, except S3 resume, the
TSeg region should be clear.

Signed-off-by: Stanley Chang <stanley.chang@intel.com>
2021-08-19 07:59:32 -07:00
Aiden Park 81f7712846 [CorePkg] Add additional APIs to access LoaderGlobalData
This adds additional APIs to make Platform code use APIs to access
LoaderGlobalData instead of accessing variables directly.
- GetS3DataPtr()
- SetFeatureCfg()
- ClearFspHob()
- GetVerInfoPtr()

Signed-off-by: Aiden Park <aiden.park@intel.com>
2021-08-06 12:34:36 -07:00
Aiden Park 49a3a54e6c [CorePkg] Add GetTempRamInfo() API (#1245)
Some platforms need TempRam Base & Size information to calculate
FspmArchUpd StackBase & Size at runtime.
The TempRam Base & Size info will be only valid until TempRamExit.

Signed-off-by: Aiden Park <aiden.park@intel.com>
2021-08-04 09:56:31 -07:00
stanley 748aeb0eaf [TGL] Fix RTC S3 wake hang (#1232)
This patch clears RTC Alarm when RTC is the S3 wake-up source.
Without clearing it, SMI# will be triggered once SMI_EN is set
by RestoreS3RegInfo, but no handler to clear it which results
in hang.

This patch also refactors RegRead/RegWrite in RestoreS3RegInfo
to avoid the misalingment of function pointers and coding
convention.

Signed-off-by: Stanley Chang <stanley.chang@intel.com>
2021-07-28 09:56:56 -07:00
Guo Dong 791d7a0beb Fix SMM rebase S3 issue (#1224)
Currently it will return a valid SMMBASE_INFO if SMMBASE_INFO_COMM_ID
is found in SMM S3 resume memory. It will cause issue in S3 path if there
is no one fill correct data when MpInit uses it to rebase SMM.
This patch adds a check to SMMBASE_INFO to avoid this issue.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2021-07-14 19:33:04 -07:00
stalamudupula f1b98384a2 Add a Pci Enum Hook function (#1185)
This patch adds a platform hook function ability
in Pci Enum Lib to enable platform to perform
PCI Enum specific work-around routines.

Signed-off-by: Talamudupula <stalamudupula@gmail.com>
2021-06-09 15:53:26 -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
James Gutbub 810a0b1c54 Resolve issue with MpInitLib VS2015 compiling
Need to add some typecasting to resolve a build
issue with MpInitLib when using VS2015 compiler.

Signed-off-by: James Gutbub <james.gutbub@intel.com>
2021-04-19 16:49:38 -07:00
Maurice Ma cf5293c55c Restruct MpInit NASM code
This patch restructed MP init library so that more code can be
common between 32bit and 64bit. It is much easier to maintain the
code after the restructure.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-04-19 08:53:55 -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
Talamudupula 85826d40f2 Fix buffer overflow for copy in S3SaveRestore lib
For appending Save/Restore structs in TSEG area,
bootloader should reserve space for TotalSize and
for certain structs, only header info should be
actually populated. Rest should be all Zeros.

Signed-off-by: Talamudupula <stalamudupula@gmail.com>
2021-04-14 11:16:13 -07:00
Maurice Ma 8659c29ac0 Enhance SMM rebase check condition
Current SBL SMM rebasing check is only performed when PcdSmmRebaseMode
is enabled. It does not cover the case to boot UEFI payload. This patch
enhaced the check to cover UEFI payload S3 path as well.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-04-13 16:00:32 -07:00
Maurice Ma a73d37fa91 Delay SMRR enabling
When SMRR is enabled too early, it blocked TSEG access in Stage2.
And it caused S3 related issues. This patch delays the SMRR enabling
to be after PrePayloadLoading BoardInit().

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-04-12 16:52:46 -07:00
Maurice Ma 94d22382bd [APL/CFL] Enable SMM rebase for mon UEFI payload
For non UEFI payload, SBL will install dummy SMI handler for
security concern. For UEFI payload, SMM rebasing is expected
to be done itself. This patch enabled this feature for APL and
CFL platform.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-04-10 15:28:07 -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
Aiden Park 209a159176 [PCI] Disable PCI devices bus master by default
This will disable all PCI bus master by default, and enable it only if
- the original bus master was enabled before PCI enumeration
- Or the device is PCI Bridge

Signed-off-by: Aiden Park <aiden.park@intel.com>
2021-04-06 13:30:59 -07:00
Maurice Ma 41ccfcca7c Clean up release build debug output
Current SBL release debug output has more than what is expected.
This patch reset some of the debug message to proper level to limit
debug message for release build.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-04-04 07:59:03 -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
Guo Dong 39004cc938 Update MP lib to fix CPU task
Need initialize global variable mSysCpuTask.CpuCount to actual
CPU count.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2021-03-26 17:07:17 -07:00
Maurice Ma fc9f1cee6f Fix stack alignment issue in x64 build
GCC x64 build requires stack to be aligned at 16 bytes. In MpInit
nasm file, SBL set the initial stack to be 16-byte aligned. However,
later on unbalanced push/pop breaks the 16-byte alignment. This
patch removed extra stack pop so that the stack will always stay at
the original initial value.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-03-24 06:15:43 -07:00
Talamudupula a005a5772c Program BAR0/1 for PPB
Current PCI Enum Lib scopes for only Apperture resources
for a PPB. But some OSes (like ESXi) expect BAR0 & BAR1
(Offset 0x10/0x14) to be allocated resources accordingly.
Otherwise, PPB enumeration doesnt happen correctly and
devices behind PPB are not registered at all.

This patch adds the functionality to assign valid resources
to BAR0(0x10) and BAR1(0x14) for a PPB also.

Signed-off-by: Talamudupula <stalamudupula@gmail.com>
2021-03-02 20:28:07 -08:00
Maurice Ma bcfba7a847 Move X2APIC enabling to common function
This patch removed duplicated X2APIC enabling code. Instead, it
enables X2APIC in a common function. By doing so, the very first
waking up will be done in APIC mode. Afterwards, it will be using
X2APIC mode if enabled by PCD.
This patch also fixed an X2APIC ACPI MADT issue.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-02-20 06:52:08 -08:00
Maurice Ma 04b162e75e Add CPU X2APIC support
This patch added X2APIC support. It is to enable the case when
APIC ID is greater than 255. This patch only handle core wakeup
portion. Platform still needs to handle ACPI related changes for
X2APIC.

X2APIC lib is backward compatible with XAPIC lib. So there is no
need to use XAPIC lib anymore.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-02-12 17:20:57 -08:00
Guo Dong 234bf55561 Fix the MP hang issue (#1013)
The ApDataPtr->CProcedure was wrongly updated in previous patch.
This patch fixed it and CPU task name from CProcedure to TaskFunc
to avoid confusion.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2021-02-10 09:29:54 -08:00