Commit Graph
1419 Commits
Author SHA1 Message Date
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
Gavin Xue d811bebb3c Fix build error caused by non-ASCII characters
If customer uses a non-English version (e.g. Chinese)
Windows OS, the build error will happen.

Signed-off-by: Gavin Xue <gavin.xue@intel.com>
2022-07-13 16:43:19 -07:00
Kevin Tsai 7c584d8059 [ADLN] UPD config update
Aligned FSPS UPD settings with BIOS

Signed-off-by: Kevin Tsai <kevin.tsai@intel.com>
2022-07-13 16:42:36 -07:00
Stanley Chang 132ef1e4da FWU: enhance payload boundary check
This patch enhances the payload boundary check:

1. Calculate the image header from "offset" field defined
   in UEFI spec. The enhancement also fixes the issue of wrong
   img pointer if a embedded payload is present

2. Validate the offset field and image size.

3. Only process the MAX_FW_COMPONENTS payloads in a capsule

4. Add payload info in debug output

Verified: EHL CRB

Signed-off-by: Stanley Chang <stanley.chang@intel.com>
2022-07-11 09:06:45 -07:00
Stanley Chang edbba186f7 FWU: support capsule file placed in non-FAT FS
This patch fixes the support of a capsule file placed in a filesystem
whose fs type is specified by CAPSULE_INFO_CFG_DATA.FsType.

Verify method:
  1. Set disk/partition CAPSULE_INFO_CFG_DATA to a volume of ext2 fs
  2. Set CAPSULE_INFO_CFG_DATA.FsType = 2 (AUTO)
  3. Place FwuImage.bin to the volume
  4. Run firmware update test

Verified: EHL CRB

Signed-off-by: Stanley Chang <stanley.chang@intel.com>
2022-07-11 08:25:39 -07:00
Ong Kok Tong c326806ca3 [ADLN] IT8659 Sio DTT porting
1. Ported IT8659 Sio (Super IO) and DTT (Dynamic Tuning Technology)
for ADL platform
2. Added CfgData to disable or enable the SIO feature
3. Fixed warning for Linux gcc bug -Wmissing-braces in SioChip.c

Signed-off-by: Ong Kok Tong <kok.tong.ong@intel.com>
2022-07-11 08:21:32 -07:00
Vincent Chen 350a4436a5 [TGL] Update FSP/VBT/UCODE/platform version since MR6 is released
- update FSP version to IoT FSP 5143_01_MR6 (0A.00.7B.31)
- update VBT version to IoT FSP 5143_01_MR6 (250)
- update TGLU microcode version to A4
- update TGL platform version to 1.6

Signed-off-by: Vincent Chen <vincent.chen@intel.com>
2022-07-06 17:49:02 -07:00
Sindhura Grandhi 453ee0f24e [ADLS] Disable DAM by default (#1613)
Signed-off-by: Sindhura Grandhi <sindhura.grandhi@intel.com>
2022-07-01 16:25:20 -07:00
Randy Lin ec5b20288b [EHL] Enable Ubuntu boot support
verified on EHL CRB with ubuntu 20.04.

Signed-off-by: Randy Lin <randy.lin@intel.com>
2022-06-30 10:26:00 -07:00
Tasos Sahanidis 05afa2dc07 [TGL] Fix x64 builds
Signed-off-by: Tasos Sahanidis <tasos@tasossah.com>
2022-06-28 15:24:43 -07:00
Sindhura Grandhi f1b0dd123f [ADLN] TSN enabling
Signed-off-by: Sindhura Grandhi <sindhura.grandhi@intel.com>
2022-06-28 15:10:39 -07:00