Commit Graph

1454 Commits

Author SHA1 Message Date
M Karuppasamy 3fa000888f Fix build issues due to increased payload and image size
Fixed FV image size issue for ADLS.

Signed-off-by: M Karuppasamy karuppasamy.m@intel.com
Signed-off-by: Sachin Kamat sachin.kamat@intel.com
Signed-off-by: Akshatha Thekkade akshatha.thekkade@intel.com
2022-08-17 11:37:28 -07:00
M Karuppasamy 5cea7fbbf3 GPIO shell command for ADL platform
This patch supports GPIO read and write through shell command.

Signed-off-by: M Karuppasamy <karuppasamy.m@intel.com>
Signed-off-by: Sachin Kamat <sachin.kamat@intel.com>
Signed-off-by: Akshatha Thekkade <akshatha.thekkade@intel.com>
2022-08-17 11:37:28 -07:00
koktong-ong 387f4a8aaa
[ADL] Clear RTC EN SCI to avoid interrupt storming (#1661)
Clear the RTC EN SCI flag to avoid interrupt storming
that cause system hang when using rtcwake method to perform
powre management test

Signed-off-by: Ong Kok Tong <kok.tong.ong@intel.com>

Signed-off-by: Ong Kok Tong <kok.tong.ong@intel.com>
2022-08-12 10:21:36 -07:00
Randy Lin a1117575ac [EHL] UPDs for Zephyr support
1. Expose PchPseEcliteEnabled
2. PchPseSpiCs1Enable is unconfigurable, fix it.

Signed-off-by: Randy Lin <randy.lin@intel.com>
2022-08-12 08:46:36 -07:00
Sindhura Grandhi 9537bda97d [ADLS] Update FSP/VBT/UCODE/platform version since MR2 is released
- FSP version - 0C.00.69.74
- Vbt version - 1077
- Microcode version - m_07_90672_00000023
- Minor version updated to '2' for MR2.

Signed-off-by: Sindhura Grandhi <sindhura.grandhi@intel.com>
2022-08-12 08:38:25 -07:00
Sindhura Grandhi bf9ab4299f [ADLS] Tcc related fixes
- Increase PlatformMemorySize to get rid of FSP error caused
during Tcc SRAM init.
- Sort the CPUs in ascending order for Tcc validation purpose.

Signed-off-by: Sindhura Grandhi <sindhura.grandhi@intel.com>
2022-08-08 13:34:22 -07:00
Bejean Mosher 5b451b6fca [RPL-P] RPL-P DDR5 RVP Board/Platform ID support.
Added support for RPL-P DDR5 RVP board ID from EC.

Signed-off-by: Bejean Mosher <bejean.mosher@intel.com>
2022-08-07 17:21:57 -07:00
Sean McGinn 7fd35cba10 Refactor TCO timer APIs
This change creates TCO timer APIs
for initialization, starting,
stopping, and setting timeout

This change removes TCO timer APIs
for disabling and enabling

Signed-off-by: Sean McGinn <sean.mcginn@intel.com>
2022-08-07 17:21:33 -07:00
Sean McGinn 2987ba8724 Remove TopSwapLib's TGL header file dependency
Signed-off-by: Sean McGinn <sean.mcginn@intel.com>
2022-08-07 17:21:33 -07:00
Sean McGinn 7625d492e2 Move TcoTimerLib, TopSwapLib, and WatchDogTimerLib header files
Move files to CommonSocPkg from BootloaderCorePkg

Signed-off-by: Sean McGinn <sean.mcginn@intel.com>
2022-08-07 17:21:33 -07:00
Sean McGinn 38a67cb867 Add macros for TCO-related PCI bus, device, and function
Signed-off-by: Sean McGinn <sean.mcginn@intel.com>
2022-08-07 17:21:33 -07:00
Sean McGinn 82e1f4988d Amend SmbusLib for SBL resiliency
Signed-off-by: Sean McGinn <sean.mcginn@intel.com>
2022-08-07 17:21:33 -07:00
Sean McGinn 092ce7fcf8 Amend WatchDogTimerLib for SBL resiliency
Signed-off-by: Sean McGinn <sean.mcginn@intel.com>
2022-08-07 17:21:33 -07:00
Sean McGinn 1da1768bc1 Create TopSwapLib for SBL resiliency
Signed-off-by: Sean McGinn <sean.mcginn@intel.com>
2022-08-07 17:21:33 -07:00
Sean McGinn 5087516d68 Create TcoTimerLib for SBL resiliency
Signed-off-by: Sean McGinn <sean.mcginn@intel.com>
2022-08-07 17:21:33 -07:00
Guo Dong 49e23bb324 [RPLP] Add RPL-P PR01 board support
Signed-off-by: Guo Dong <guo.dong@intel.com>
2022-08-05 14:01:10 -07:00
Guo Dong 7440dec946 [CFL] Increase payload size
Increase the payload size to fix the build failure.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2022-08-02 07:42:55 -07:00
Guo Dong 77cbf823bf [TESTS] Use GPIO table from config data
Use the GPIO table from SBL config data instead of
the one from .h file. the .h file will keep there
a while just for reference.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2022-08-01 21:39:13 -07:00
Guo Dong 58d265f553 [TESTS] payload switch GPIO
Use a on board switch (Pin B3) as the GPIO to switch
UEFI payload and OsLoader. So update its setting as
GPIO IN for this purpose.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2022-08-01 21:39:13 -07:00
Guo Dong 90e917e62b Enhance GPIO convert tool for GPD group support
For PAD name (e.g., GPD12), current GpioDataConvert.py get the
pad number using pad_name[4:6]. It should be changed to pad_name[3:5].

Signed-off-by: Guo Dong <guo.dong@intel.com>
2022-08-01 21:38:49 -07:00
Ong Kok Tong a5b2581f41 [ADLPS] Remove PlatformNvs parameters
Current PlatformNvs parameters are causing the power management
(S3, S4 and S5) in Windows OS. Removing the Nvs parameters will fixed
the issues.

Signed-off-by: Ong Kok Tong <kok.tong.ong@intel.com>
2022-08-01 21:17:49 -07:00
Randy Lin 1db52ed784 [TGL][EHL] Fix CSME FW update hang on debug fsp build
The HPET timer address is wrong at first time invoke.
Assign to fixed value directly.

Verified on EHL TGLU.

Signed-off-by: Randy Lin <randy.lin@intel.com>
2022-08-01 18:13:53 -07:00
Guo Dong 0c1092528a [ADL] Remove duplicated S3 code
Restore SMM registers was done in the PostPciEnumeration.
so remove the duplicated code in EndOfStages
and call ClearS3SaveRegion() in normal path to avoid
appending multiple restore records.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2022-08-01 18:11:09 -07:00
Biswas Arghya 414e39f4e5 Add shell command to list USB devices
New shell command 'usbdev' added to enumerate USB bus and list down
all the USB devices that are found on the bus.

Signed-off-by: Biswas Arghya <arghya.biswas@intel.com>
Signed-off-by: Sachin Kamat <sachin.kamat@intel.com>
2022-07-31 20:13:23 -07:00
Gavin Xue ac08bd1209 [EHL] Fix incorrect PSE DMA2 BAR in ACPI code
Signed-off-by: Gavin Xue <gavin.xue@intel.com>
2022-07-30 16:48:31 -07:00
Bejean Mosher 5fe393da46 [ADL] Fix for THC1 PEP constraints appearing when device is disabled.
FSP-S UPD format for THC port assignment was updated, but PEP logic
was using the old format, and causing the PEP constraint to always be
enabled. This issue didn't seem to be causing a problem, but resulted
in noncompliant low power idle constraints.

Signed-off-by: Bejean Mosher <bejean.mosher@intel.com>
2022-07-29 12:09:08 -07:00
Aakash Panwar 4e16fe4c6b Fix build issues due to increased payload and image size.
This Patch fix the build issues due to the increased payload and image size
in windows and linux environment.
- Fixed PAYLOAD size greater than padding size issue for CML.
- Fixed FWUPDATE size greater than padding size issue for EHL.
- Fixed FV image size issue for CMLV,TGL,EHL and ADLS.

Signed-off-by: Aakash Panwar <aakash.panwar@intel.com>
2022-07-29 11:13:30 -07:00
Aakash Panwar 3eba958a4c Enable UFS support for common Intel Platforms.
This Patch adds the support for UFS(Universal Flash Storage)
as a boot media.
- Added support to Enable all Lun's for UFS
- Added support to change power modes in UFS
- Enable Bus master for proper PCI addressing

Signed-off-by: Aakash Panwar <aakash.panwar@intel.com>
Signed-off-by: Sachin Kamat <sachin.kamat@intel.com>
Signed-off-by: Chirag Vijay Kolhe <chirag.vijay.kolhe@intel.com>
Signed-off-by: Aakash Panwar <aakash.panwar@intel.com>
2022-07-29 11:13:30 -07:00
Vincent Chen 5536008324 FWU: refine the reboot timing for different payload combinations
- If BIOS update is followed by any payload,
  reboot to ensure the update is completed.
- Before processing CMDI payload, ensure CSME update has
  taken effect to prevent {OEMKEYREVOCATION} command failure.

Signed-off-by: Vincent Chen <vincent.chen@intel.com>
2022-07-29 09:01:57 -07:00
Sindhura Grandhi 676c1b93a1 [ADLP] Upstream Build/Stitch/Cfgdata
This patch will let ADLP project to build and stitch images from
open source.

TEST = Smoke-test to boot to Windows/Yocto

Signed-off-by: Sindhura Grandhi <sindhura.grandhi@intel.com>
2022-07-28 15:10:54 -07:00
Bejean Mosher 3fe4087e70 [ADL-P] Revert USB4 CM mode to FW CM only.
Previous setting of SW-first CM mode was causing a hang during S3/S4 entry. Likely this setting requires additional ACPI/driver support which is missing.

Signed-off-by: Bejean Mosher <bejean.mosher@intel.com>
2022-07-27 10:56:43 -07:00
Bejean Mosher 15d7abd016 [ADL-N/P/PS] Workaround for S4 resume when S0ix disabled.
Remove OS version check in PEPD _STA method. This is a change to the intelpep.sys ASL device (PEPD) for low power idle support. Previously, _STA would always return present/enabled for Win10 even if S0ix config flag was disabled. Changed version always returns status based on S0ix flag. Without this workaround, S4 resume was failing on ADL-N/P/PS.

Signed-off-by: Bejean Mosher <bejean.mosher@intel.com>
2022-07-27 10:55:05 -07:00
Sean McGinn 8a8109be73 Move SG1B and UCOD into TS region
This change adds a board configuration flag to turn
this flash layout change off and on

This change eliminates FSP rebasing in SG1B when this
flash layout change occurs as the addressing is
different in TS region

Signed-off-by: Sean McGinn <sean.mcginn@intel.com>
2022-07-27 10:51:00 -07:00
Guo Dong 69fb535cc5 [TESTS] revert the premem gpio change for S17 board
Premem GPIO table for S17 board caused boot hang,
so revert the change back.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2022-07-23 00:34:44 -07:00
Guo Dong 4ce3649eb1 [TEST-S] Update GPIO for test boards
Use the GPIO table for the test boards.
This change would help fix PCIe device detection from PCIe slot.
Late would change post memory gpio table to SBL cfg data.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2022-07-22 16:05:49 -07:00
Guo Dong 8763f1e5fa [TESTS] Fix PCIE device detection issue
The PCIE device could not be detected without this change.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2022-07-22 16:05:49 -07:00
Vincent Chen 1de595d3e0 [EHL] Update StitchIfwi.py and StitchIfwiConfig.py
- skip the component replacemnt if the component is not located in SBL image
- print the skipped replacement components
- indicate failure through exit status for easily diagnosing problems
  when checking stitch config parameters
- add required flash image region 5=EC for new FIT (15.40.26.2632)
- remove 'sata' stitch option since it is no function

Signed-off-by: Vincent Chen <vincent.chen@intel.com>
2022-07-22 10:26:40 -07:00
Atharva Lele c3af4b6d9d Dockerfile: Update Ubuntu container to 22.04
acpica-tools needed to be updated from 20190509-6 to 20190509-7 due to
package availability but the newer tool depends on a newer libc that is
not present in Ubuntu 18.04.

Update Ubuntu instead to fix both issues since Ubuntu now has acpica-tools
included in its repositories

Signed-off-by: Atharva Lele <atharva.lele@intel.com>
2022-07-22 10:16:34 -07:00
Sindhura Grandhi 09d45b857c [ADLN] Gpio Cfg data from dlt file
- Process Gpio Cfg data from the dlt file instead of the hard-coded
  GPIO table.
- The table in the PostMem hdr file is only for reference.

Signed-off-by: Sindhura Grandhi <sindhura.grandhi@intel.com>
2022-07-22 10:06:11 -07:00
Stanley Chang d63d75f616 FWU: Fix Klocwork issues
This patch fixed KW issue for FindImage failed

Signed-off-by: Stanley Chang <stanley.chang@intel.com>
2022-07-21 09:20:55 -07:00
Stanley Chang 625abcb2bd [Tools] Enhance GpioDataConvert to support GPD
The patch adds support of "GPD" group when parsing a .h header file.
It also
  - adds supports for Pch-N,
  - fixes leading whitespaces in h file.

Test commands:

  # h to dlt
  $ python Platform/CommonBoardPkg/Tools/GpioDataConvert.py \
      -cf Platform/AlderlakeBoardPkg/Script/GpioDataConfig.py \
      -if example_adls.h -of dlt -p s \
      -o out_adls.dlt

  # h to yaml
  $ python Platform/CommonBoardPkg/Tools/GpioDataConvert.py \
      -cf Platform/AlderlakeBoardPkg/Script/GpioDataConfig.py \
      -if example_adls.h -of yaml -p s \
      -o out_adls.yaml

  # yaml to h
  $ python Platform/CommonBoardPkg/Tools/GpioDataConvert.py \
      -cf Platform/AlderlakeBoardPkg/Script/GpioDataConfig.py \
      -if out_adls.yaml -of h -p s \
      -o out_h_from_yaml.h

  # dlt to h
  $ python Platform/CommonBoardPkg/Tools/GpioDataConvert.py \
      -cf Platform/AlderlakeBoardPkg/Script/GpioDataConfig.py \
      -if out_adls.yaml -of h -p s \
      -o out_h_from_dlt.h
  # check: compare example_adls.h and out_h_from_dlt.h

  # yaml to txt
  $ python Platform/CommonBoardPkg/Tools/GpioDataConvert.py \
      -cf Platform/AlderlakeBoardPkg/Script/GpioDataConfig.py \
      -if out_adls.yaml -of txt -p s \
      -o out_txt_from_yaml.txt

  # dlt to txt
  $ python Platform/CommonBoardPkg/Tools/GpioDataConvert.py \
      -cf Platform/AlderlakeBoardPkg/Script/GpioDataConfig.py \
      -if out_adls.dlt -of txt -p s \
      -o out_txt_from_dlt.txt

Signed-off-by: Stanley Chang <stanley.chang@intel.com>
2022-07-20 08:29:07 -07:00
Stanley Chang f61bb6c116 FWU: support OEM key revocation together with BIOS/CSME update
The steps of OEM key revocation are:
  1. Replace OEM KM (signed with key2) by updating CSME
  2. Replace BIOS region (signed with key2)
  3. Reboot with new BIOS region (to make key1 inactive)
  4. Revoke key1

Before this patch, it requires 2 firmware updates and 2 capsules for
step 1~2 and step 4 respectively. The patch combines them into a single
update/capsule.

To implement the feature, the patch:
  1. Double max # of payloads to allow CSME/CSMD/BIOS/CMDI update
     in one capsule image.
  2. Prevent from failing update of a critical component.
     e.g., if step 1(CSME) fails, step 2(BIOS) should be skipped

Verified cases:

 Case 1: Capsule having CSMD/CSMD/BIOS/CMDI.
         Expectation: successful

    $ python BootloaderCorePkg/Tools/GenCapsuleFirmware.py \
      -p CSME FWUpdate.bin \
      -p CSMD CsmeUpdateDriver.efi \
      -p BIOS new_BiosRegion.bin \
      -p CMDI cmdi.txt \
      ...(skip)

 Case 2: Capsule having CSME/BIOS/CMDI but no CSMD.
         Expectation: no update

 Case 3: Inject fault flow (no partition switch after first flash),
         Capsule having CSME/CSMD/BIOS/CMDI.
         Expectation: no CMDI update

Verification: EHL CRB

Signed-off-by: Stanley Chang <stanley.chang@intel.com>
2022-07-19 15:31:23 -07:00
Vincent Chen 3112989fdc [EHL] Update FSP/VBT/UCODE/platform version since MR4 is released
- update FSP version to MR4 FSP (09.04.25.11)
- update VBT version to MR4 FSP (244)
- update microcode version to 16
- update EHL platform version to 1.4

Signed-off-by: Vincent Chen <vincent.chen@intel.com>
2022-07-19 15:02:55 -07:00
Vincent Chen adc3aebbdb FWU: reset the system after CSME firmware update
This patch is to support OEM root key revocation feature.
When the firmware update is done processing CSME payload
containing OEM KM with revocation extension, the system
needs to reset for the changes to take effect. Otherwise,
the following CMDI {OEMKEYREVOCATION} command will fail.

Signed-off-by: Vincent Chen <vincent.chen@intel.com>
2022-07-15 16:03:05 -07:00
Vincent Chen f74c113997 FWU: Adjust the starting offset of BIOS payload in capsule
When firmware update is processing BIOS payload, it will
locate Stage1A FV and get SBL version file for verification.
The files in FV are expected to be located at 8-byte aligned
offset. There is chance to break the alignment when a payload
of variable size, e.g. CMDI file, is packed in front of BIOS
payload. So this patch adjusts the starting offset of BIOS
payload to be 8-byte aligned with 0xFF paddings.

Signed-off-by: Vincent Chen <vincent.chen@intel.com>
2022-07-15 16:02:03 -07:00
Gavin Xue f5e230ca7c [EHL] Fix Kernel DMA driver cannot be registered issue
EHL DMA controllers are hidden at PSF level in reference code,
DMA controllers are reported as ACPI devices if ownership is Host.
So should not check DMA PCI header for DSDT table patching.
Update the change follow EHL reference code.

Signed-off-by: Gavin Xue <gavin.xue@intel.com>
2022-07-15 14:56:35 -07:00
Aiman Rosli bd05d78232 [EHL] Enable WDT for TCC
When some settings from DSO caused system hang,
the WDT would cause the system reboot.
And in the next boot, SBL would use the default
setting by not apply the DSO values.

Verify on EHL CRB.

Signed-off-by: Aiman Rosli <muhammad.aiman.rosli@intel.com>
2022-07-15 14:52:56 -07:00
Stanley Chang 03325fabfe FWU: fix infinite fwu caused by a/b update failure
In A/B update, after FWU updates partition B, it switches to and boots
with partition B. If boot fails because of anything wrong with the update,
CSME will switch back to booting with partition A.

Before this patch, unfortunately, the EnforceFwUpdatePolicy will
immediately try to boot again with partition B, which results in
an infinite FWU loop:

   try B -> failed -> boot A -> try B -> failed ...
   (Same for initial with "try A -> failed" scheme.)

This patch adds a retry count field in FW_UPDATE_STATUS.
Using retry count field to determine if retry also reaches a
max times. If so, stop the loop.

To simplify the implementation for SPI, the retry count field is
implemented as continuous 1 (ONE) of a bit array.

Test scenarios:
  Case 1. update bios region. Expectation: PASS
  Case 2. update non-bios region. Expectation: PASS
  Case 3. Inject fault flow (no partition switch after first flash),
          and update bios region. Expectation: Stop retry after few times.

Verify: EHL RVP

Signed-off-by: Stanley Chang <stanley.chang@intel.com>
2022-07-15 14:50:47 -07:00
Stanley Chang c8c53b894e FWU: clean up the end firmware update
The patch fixes potential infinite FWU loop if InitFirmwareUpdate fails.

An infinite FWU loop occurs when (Count != MAX_FW_COMPONENTS). Thus,
without this patch, it increases the error-handling complexity in
InitFirmwareUpdate in the future (i.e., all early-return/abort cases must
take care of FW_UPDATE_SM_DONE by themselves).

The fixes simplfes the end firmware update by:
  1. set SM as FW_UPDATE_SM_DONE at EndFirmwareUpdate
  2. move reboot to EndFirmwareUpdate

Verified: EHL CRB

Signed-off-by: Stanley Chang <stanley.chang@intel.com>
2022-07-15 14:33:09 -07:00
Randy Lin a5dffd1171 [TGL] Ignore TCC DSO tuning on FW update process
Verify on TGL-UP3 RVP.

Signed-off-by: Randy Lin <randy.lin@intel.com>
2022-07-14 14:40:54 -07:00