Commit Graph

1066 Commits

Author SHA1 Message Date
jinjhuli eb55ede62a [EHL] RTC Initialization
RTC initialization everytime CMOS battery refresh.

Signed-off-by: jinjhuli <jin.jhu.lim@intel.com>
2021-03-23 10:37:56 -07:00
Maurice Ma 4253a9dcdb Fix Shell MTRR print issue
Current MTRR lib assumes the MTRR number is always 10. Instead,
this patch follows the IA manual to get the actual MTRR number
through MTRR capability register.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-03-23 10:36:12 -07:00
Mutha c288f690df [TGL-U] Aligned with IOTG BIOS for lp4 vbt update.
vbt table update is aligned with bios.

Signed-off-by: Mutha <naga.naveen.mutha@intel.com>
2021-03-23 10:04:04 -07:00
Tan Lean Sheng 3afab20f88
[EHL] Fix SPI clock source gating s0ix issue (#1059)
SPI clock source was on and gating s0ix entry, due to linux OS could
trigger SPI Write Protection Disable bit and hence set the SPI
Synchronous SMI Status bit. This CL fixes it by clearing the SPI
Synchronous SMI Status bit prior to S0ix entry.

Traditionally, it is expected for bootloader to clear this bit in
SMI handler upon S0ix entry, due to SBL being free of SMI, clearing
this bit from ACPI table has the same effect.

Signed-off-by: LeanSheng <lean.sheng.tan@intel.com>
2021-03-23 09:19:26 -07:00
Maurice Ma 0c114940c3 Fix QEMU boot issue with KVM enabled
As reported in issue #1055, when "--enable-kvm" flag is enabled
within QEMU, SBL does not boot. It is because KVM does not allow
certain MSR access. This patch removed NO_EVICTION_MODE MSR access
from QEMU FSP TempRamInit. By doing so, it allows QEMU to boot
with KVM enabled.
It fixed #1055.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-03-22 21:22:49 -07:00
Subash Lakkimsetti c2d16b3611 [TGLU] Oem Key revocation feature support
TGL supports multiple OEM keys and their revocation
by CSE. This patch supports HECI APIs for OemkeyRevoke
and to get key status. This is port from TGLH platform
implemetation.

Signed-off-by: Subash Lakkimsetti <subash.lakkimsetti@intel.com>
2021-03-22 21:22:01 -07:00
Subash Lakkimsetti c14cdfdba5 Update path for oem key manifets
Some platforms FIT tool do not detect sourceDir.
Change to absoulte path.

Signed-off-by: Subash Lakkimsetti <subash.lakkimsetti@intel.com>
2021-03-22 21:20:10 -07:00
Subash Lakkimsetti 21b73a70c6 Common boot guard signing as seperate and standalone script
This patch adapts common btg utility and restructures
stitch script and separates security functionality.

BtgSign.py - Common Boot guard signing and oem key manifest generation.
			 It also supports signing in standalone mode. Stanalone mode can
			 be used sign bootloader bin and stitch using FIT tool.

security_stitch_help.py - Interface functionality for Btg manifest and
			 update xml with security updates. This is as per the client
			 platform FIT xml format.

Signed-off-by: Subash Lakkimsetti <subash.lakkimsetti@intel.com>
2021-03-19 22:19:07 -07:00
leanshen b48471af82 [EHL] Fix UART init issue and set UART PCI mode as default
This CL fixes the long time issue where EHL SBL failed to init
properly and solely relies on FSP to handle the UART unit, and
hence the limitation of Hidden Mode UART only, as we observed
the UART output gone missing after PCI enumeration if we set
respective UART port into PCI mode in FSP. By hiding the UART,
OS will not be able to see the UART device as PCI device and
lose control to the UART device.

Due to hardware design, different uart could use different
LPSS_IO_MEM_PCP register offset for UART clock setup.

This CL includes dynamic configuration for clock setup by
reading the size of UART control register. Since this is pretty
generic for most of platforms, will plan to move more UART codes
to common codes in the future.

Second fix changes the default UART mode for both FSP-T and FSP-S
to skip uart init, and let SBL solely handles it and setup as a
PCI device.

Signed-off-by: LeanSheng <lean.sheng.tan@intel.com>
2021-03-19 22:18:03 -07:00
Subash Lakkimsetti 3423529f5a [EHL] Operational region for ACPI Control SMI_EN access
SMIE is checked in Tpm asl before SMI is triggered.
Removal of this definition causes physical presence
usecases failure.

TEST=Verified TPM clear usecases with windows boots

Signed-off-by: Subash Lakkimsetti <subash.lakkimsetti@intel.com>
2021-03-18 21:42:23 -07:00
Maurice Ma 14c974ed4c [APL] Enable IA untrusted mode at end of SBL stage
Current APL SBL code will enable IA_UNTRUSTED mode only at end of
firmware notification. It might be too late for certain conditions.
This patch moves it to be set at end of stage in SBL. In this way,
it ensures the bit is set before launching any external payload.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-03-12 15:29:17 -08:00
Raghava Gudla 7c5464f880
Remove next line char during csme fw update (#1046)
This patch removed next line character printed during
progress update of csme firmware update, this would remove
lot of prints in the next line and show progress much more
user friendly.

Signed-off-by: Raghava Gudla <raghava.gudla@intel.com>
2021-03-11 17:10:17 -08:00
Subash Lakkimsetti aa36ae70d1
Oem Key revocation feature support (#1043)
EHL, TGL supports multiple OEM keys and their revocation
by CSE. This patch supports,
- CMDI interface to perform key revocation using
  OEMKEYREVOCATION string in cmd file.
- EHL HECI APIs for OemkeyRevoke and to get key status
- FW componets are sorted as per required order.
  CSME and BIOS should be signed with new keys and
  both components would go together with capsule update.

Signed-off-by: Subash Lakkimsetti <subash.lakkimsetti@intel.com>
2021-03-08 11:04:44 -08:00
koktong-ong 12a0752e1e
[EHL] Disable s0ix feature (#1044)
Disable s0ix feature (fsp and fadt flag) until fix is ready.

Signed-off-by: Ong Kok Tong <kok.tong.ong@intel.com>
2021-03-08 09:45:41 -08: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
Raghava Gudla de6bc238d4 Fix bug while updating binary not aligned to 4k
This patch fixed an error that occur during updating a
binary that is not aligned to 4k. Current code will always
update next 4K block. This patch adjusted the block length
to remaining size other than 4K.

Signed-off-by: Raghava Gudla <raghava.gudla@intel.com>
2021-02-27 16:44:25 -08:00
Praveen Hp 7b903e83ca [APL] Fix Build error when SOURCE_DEBUG is enabled
This patch fixes the multiple build issues which are observed
when ENABLE_SOURCE_DEBUG config is set to 1.

Signed-off-by: Praveen Hp <praveen.hodagatta.pranesh@intel.com>
2021-02-26 07:17:48 -08:00
Maurice Ma 4eeb962977 Add FSP swapping script
This patch added FSP swapping script to support replace a FSP
binary inside SBL IFWI or BIOS image.

To use it, use
  python BootloaderCorePkg\Tools\FspSwap.py ifwi.bin fsp.bin
The default output directory is "Out".

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-02-25 16:32:05 -08:00
Subash Lakkimsetti 84c8a3ffe2 Update CsmePciReadBuffer callback prototype params
CsmePciReadBuffer function prototype is alligned as
per the CSME fwupdate lib. It fixes issue with
CSME capsule fw update.

Signed-off-by: Subash Lakkimsetti <subash.lakkimsetti@intel.com>
2021-02-24 21:15:03 -08:00
Praveen Hp 640f5db739 [CFL] Set TSeg size to 16MB.
This Patch did the following

-  TsegSize config options is defined in CfgData_Memory.yaml.
-  with 64GB RAM, slow boot issue was reported on ubuntu_20.0.
   Root cuase of the issue is due out of MTTR's and unable to cover
   portion of higher memory ranges. this patch fixes this issue.

Signed-off-by: Praveen Hp <praveen.hodagatta.pranesh@intel.com>
2021-02-23 22:29:27 -08:00
Maurice Ma 3a5aab690c Fix MP waking up issue on some platforms
It was reported that some platform had MP waking up issue after
switching to using X2APIC library. By comparing the library, found
X2APIC removed 2nd IPI sending in the flow. This 2nd IPI is
required per IA specification. The patch added it back.

Tests have been done and confirmed it fixed the issues seen on
thos platforms.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-02-23 15:22:25 -08:00
Maurice Ma eb8a5a777d Fix Azure pipeline build issue
ACPI package has been upgraded to acpica-tools_20200925-1.2_amd64
in order to fix the build issue.  The old ACPICA tool URL is not
valid anymore.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-02-23 10:00:08 -08:00
Ong Kok Tong 0c58a5e444 [EHL] ACPI update
Sync ACPI files with EHL BIOS

Signed-off-by: Ong Kok Tong <kok.tong.ong@intel.com>
2021-02-20 06:54:41 -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 c76e3272d4 Fix MTRR mask programming for GFX framebuffer
Linux reported incorrect MTRR mask programming in SBL. This patch
fixed this issue by using the proper MTRR mask for GFX FB.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-02-18 21:48:51 -08:00
Guo Dong 57fb7e2fb3 [TGL] Update Vtd support
GNVS should be aligned with VTD PCD
Fix a DMR check issue.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2021-02-17 21:44:43 -07:00
tongyana 7af9db9f40 Update Fspbin.inf to pull latest FSP code.
Increase the size of Stage1b
to avoid build failing issue in Linux debug.

Signed-off-by: tongyana <tong.yan.au@intel.com>
2021-02-17 21:43:39 -07:00
Guo Dong 6b6a0e3796 [TGL] Remove WDT
It is not necessary to set WDT for FSPM.
So remove it to avoid potential issue.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2021-02-16 09:51:40 -07:00
Guo Dong d23b509483 [TGL] Update ConfigTdpLevel
Set UPD ConfigTdpLevel in FSPM instead FSPS
Remove unused CFG data

Signed-off-by: Guo Dong <guo.dong@intel.com>
2021-02-16 09:51:12 -07:00
jinjhuli 43d8692fda [EHL] Add require ACPI files for Yocto cpufreq
Add ACPI HWP files to support Yocto acpi_cpufreq

Signed-off-by: jinjhuli <jin.jhu.lim@intel.com>
2021-02-12 17:21:33 -08:00
Aiden Park dd9bff2804 [X64] Read the first time stamp before TempRamInit
Currently, the 1st time stamp includes FSP-T execution time in X64.
This will read the 1st time stamp before TempRamInit.

Signed-off-by: Aiden Park <aiden.park@intel.com>
2021-02-12 17:21:11 -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
Talamudupula 8fe118f1e1 Enhance GpioWriteLockReg in common GpioLib
Certain platforms can't support GpioLockUnlock, so let
them return the Opcode they want to use for locking.
Also updated dependent platform.

Signed-off-by: Talamudupula <stalamudupula@gmail.com>
2021-02-10 20:01:25 -07: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
Aiden Park 2aade4dddb
Fix new Klocwork scanning issues (#1012)
This patch addresses new reported klocwork scanning issues.

Signed-off-by: Aiden Park <aiden.park@intel.com>
2021-02-10 08:55:00 -08:00
jinjhuli 21b4d1d07d [EHL] Fix UEFI Payload debug boot issue
Add LOADER_RSVD_MEM_SIZE in BoardConfig
to fix UEFI payload debug boot ASSERT
error.

Signed-off-by: jinjhuli <jin.jhu.lim@intel.com>
2021-02-09 08:16:25 -07:00
Maurice Ma 6b9463e791
Update QEMU FSP build to latest EDK2 (#1007)
This patch changed QEMU FSP to use INF file to provide commit id.
It also synced up to the latest EDK2 stable tag edk2-stable202011.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-02-08 09:13:37 -08:00
koktong-ong 89c6d7f0f9
[EHL] Fix yocto hang issue and s0ix enable (#1009)
Resolved yocto hang issue after booted into OS
for non Fusa sku.
Enabled s0ix for yocto and windows.

Signed-off-by: Ong Kok Tong <kok.tong.ong@intel.com>
2021-02-08 09:10:40 -08:00
Praveen Hp b715ba0177 [CML] Fix StitchIfwi script error
This Patch fixes below error,
"ModuleNotFoundError: No module named 'defusedxml'"

Signed-off-by: Praveen Hp <praveen.hodagatta.pranesh@intel.com>
2021-02-08 09:36:21 -07:00
Praveen Hp c3e4b75284 [CFL] Add CSME FWU driver build support
This patch adds support to build CSME firmware update driver.

BUILD_CSME_UPDATE_DRIVER in BoardConfig.py must set 1 to build csme FWU
driver.

Signed-off-by: Praveen Hp <praveen.hodagatta.pranesh@intel.com>
2021-02-08 09:32:36 -07:00
Guo Dong 45be2a8daa Build MP CPU TASK info hob
With this hob, user could run a task from AP in Osloader.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2021-02-08 09:31:08 -07:00
Maurice Ma fd436737a6
Delay MP init done for OsLoader payload (#1003)
There is request to utilize MP in OsLoader. To support it, it is
desired to delay MP init done signal to the end of the OsLoader.
This patch moved the MP init done signal into board ReadyToBoot
notification so that MP is still alive in OsLoader phase.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-02-05 16:15:23 -08:00
Maurice Ma f9c97abfdb
Avoid building duplicated GFX HOB (#1002)
In some cases Bootloader will build GFX HOB. This patch updated
SBL to check the bootloader GFX HOB first before building a new
GFX HOB from FSP. This is to avoid duplicated GFX HOB to be
generated in bootloader HOB.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-02-05 09:03:06 -08:00
Raghava Gudla ca738786cc
Fix firmware update failure during sbl svn check (#999)
This patch fixed a failure in firmware update that
occur during SBL version check. Current code assume
that the SBL layout does not change between the existing
firmware and the capsule, when the layout change, stage1A
address change and this is causing error while obtaining
the firmware version.

Code is modified to use the last 4 bytes of the SBL region
which contain Stage1A FV address and this is used to obtain
the version information.

Signed-off-by: Raghava <raghava.gudla@intel.com>
2021-02-05 09:01:26 -08:00
Praveen Hp 4f2ff03f81 [CFL] Fix CSME firmware update failure
during CSME firmware update process, CSME update library throw error
"Could not access PCI device".this patch fixes this issue by adding
back "PciReadBuffer".

TEST=Verified CSME FWU on CFL-H & WHL platforms.

Signed-off-by: Praveen Hp <praveen.hodagatta.pranesh@intel.com>
2021-02-04 13:59:18 -08:00
Aiden Park 680cab980b [PCI] Add an option to allocate PCI PMEM resource first
This introduces an additional PCI Enumeration option.
- self._PCI_ENUM_FLAG_ALLOC_PMEM_FIRST

By deafult, the option will allocate PCI resource by ascending order
(MEM32->PMEM32->MEM64->PMEM64). If it's set to 1, by reversed order.

Signed-off-by: Aiden Park <aiden.park@intel.com>
2021-02-03 17:14:51 -08:00
Adithya Baglody c3d73ff4de commonSocPkg: SpiFlashLib: Permissions bit read per read/write
The RegionPermission doesn't usually represent the current state of
the Region. There is a need to re-read the permission bit for each
read/write. There by making the variable accurately represents the
HW status.

Signed-off-by: Adithya Baglody <adithya.nagaraj.baglody@intel.com>
2021-02-02 22:42:57 -08:00
Maurice Ma f68a5dce1b Add FSP HOB print function
This patch will display FSP HOBs. It will help the debug when FSP
produce incomplete HOBs.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-02-02 19:48:39 -08:00
Maurice Ma b5e0c56cbd Add splash support post PCI enumeration
In some cases FSP does not support GFX and does not produce
GFX hob. But platform will be able to initialize its GFX after
PCI enumeration. This patch allows splash to be displayed post
PCI if the splash has not been displayed yet.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-02-02 14:05:50 -08:00
jinjhuli 87cdd8ebb2 [EHL] Update FSP header and Fix build error
1. Update Beta4 FSP header.
2. Temporary fix build error while pending FSP,
vbt and ucode to be upstream.
3. Fix Fadt syntax error.

Signed-off-by: jinjhuli <jin.jhu.lim@intel.com>
2021-02-01 19:26:20 -07:00