Commit Graph

109 Commits

Author SHA1 Message Date
Maurice Ma 64d682755b Add missing ACPI PRES method for SATA ports
On TGL, Linux reported ACPI errors on missing PRES method for SATA
port 0. This patch added the missing PRES implementation for all
SATA ports.

This fixed #1497.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2022-02-17 11:14:39 -08:00
Maurice Ma 3979c356d9 Add conditional scope for I2C pad and panel
Current SBL ACPI table does not define any I2C pad or panel. And
it will cause ACPI error for Linux. This patch added conditional
scope for I2C pad and panel reference so that if pad type or panel
type is not defined, these scope will not be used by ACPI.

This fixed #1496.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2022-02-17 11:14:39 -08:00
Randy Lin a3f5cfaade [TGL] Fix ACPI Errors reported in kernel dmesg
Fix two errors:
ACPI Error: Aborting method \_SB.PR00.GCAP due to previous error
(AE_INVALID_TABLE_LENGTH)
ACPI Error: Aborting method \_SB.PR00._PDC due to previous error
(AE_INVALID_TABLE_LENGTH)

UEFI BIOS always does dynamic loading, but SBL does static loading
instead.

Signed-off-by: Randy Lin <randy.lin@intel.com>
2022-02-17 04:49:37 -08:00
Sai T 20c30ff496 Gpio data convert improvements
Pass in a pch_series param to GpioDataConvert tool
to fetch the correct gpio group info for a platform
based on the pch series.

The tool expects the platform specific config file to
implement a function vir_to_phy_grp () that returns
a BOOL value based on:

If vir_to_phy_grp = False, SBL's config has A->0, B->1 etc. mapping.
And GpioSiLib.c or GpioInitLib.c corresponding libraries will map
this virtual group #s to real physical group #s (if not same).

If vir_to_phy_grp = True, SBL's config has A->G1, B->G2 etc.
physical mapping directly, so the GpioLib library uses this as is.

GpioDataConfig.py file was added for ADL platform.

Signed-off-by: Sai T <sai.kiran.talamudupula@intel.com>
2022-02-15 10:39:12 -07:00
Maurice Ma 7a9cc52e05 [TGL] Update MCFG table template with correct end bus number
Current TGL platform set 0 as the PCI end bus number in ACPI
MCFG table. And it caused incorrect MMCONFIG range calculation in
Linux. This patch updated the template to use 0xFF as the PCI
end bus number.

It should fix #1481, to be confirmed.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2022-02-11 09:48:40 -07:00
Mike Crowe a9d9774ca9 StitchIfwi: Indicate failure through exit status
When run as part of an automated system it's important to ensure that
any failure is reported to the calling process. Writing an error message
and then exiting indicating success leads to difficult-to-diagnose
problems.

Signed-off-by: Mike Crowe <mac@mcrowe.com>
2022-02-11 09:48:23 -07:00
Stanley Chang 7191710225 [TGL] Enable PCIe PM features
The patch enables PCIe PM features by,
1. Store Root Port configuration before FSP-s.
2. Configure Pcie RP in PostPciEnumeration with the stored RP config.

The feature is controlled by ENABLE_PCIE_PM and the corresponding
PcdEnablePciePm

The implementation is silicon-dependent, because of registers definition.
The PciePmNull component is a generic implementation. This patch also
implements PciePm for TGL.

Verified: TGL-U RVP

Signed-off-by: Stanley Chang <stanley.chang@intel.com>
2022-02-08 20:02:23 -08:00
Randy Lin de8ddefeb3 [TGL] Disable s0ix on TGLU RVP
s0ix feature enabling flag also turn off some FSP configs
so that default SBL image can't detect the onboard Lan
and type c devices.

Signed-off-by: Randy Lin <randy.lin@intel.com>
2022-01-27 10:44:30 -08:00
Stanley Chang 0c82e73533 [TGL] Fix UART0 access
This patch fixes no activity on UART0 pins when enabling it for serial
communication.

In TGL, there are two UART0 instances (GPP_C8~C11 and GPP_F0~F4) while
one (GPP_F0~F4) is shared with CNVI. This patch enables GPP_C8~C11 as
the UART0 instance to reduce the conflict with CNVI.

This patch also fixes the GPIO pins definition for TGL-H and moves
serial io initialization code to SerialIo.c to simplfy Stage2BoardInitLib.c.

Test: TGL-UP3 RVP and TGL-H RVP

Signed-off-by: Stanley Chang <stanley.chang@intel.com>
2022-01-21 07:46:23 -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
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
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
Randy Lin fb0a4aec22 Fix ASL compile warnings.
Signed-off-by: Randy Lin <randy.lin@intel.com>
2021-11-30 07:57:32 -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
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
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
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
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 5996369705 Enable GFX framebuffer as WC by BAR parsing
In order to improve the UEFI payload display performance, it is
desirable to have the framebuffer as write-combining for cache
attribute. This patch added a common API to enable this and it
enabled the GFX framebuffer cache for QEMU and TGL. Other
platforms still need porting.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-11-04 11:46:13 -07:00
Maurice Ma 505c484600 [TGL] Fix incorrect pin index in GPIO CFGDATA
On TGL, current GPIO CFGDATA used incorrect pin index for GPIO
group J and G. This patch fixed it.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-11-04 10:49:14 -07:00
Stanley Chang 383500eee7 [TGL] Fix SaGv CfgData to align with FSP
The patch updates CfgData yaml to align with FSP:

1. correct value range for SaGv

2. remove unused variables: FreqSaGvLow and FreqSaGvMid

Signed-off-by: Stanley Chang <stanley.chang@intel.com>
2021-11-04 08:21:55 -07:00
Sai T acccaea853 Add RxRaw field to Gpio config template
Current GpioLib uses 2 bits from OtherSettings to
configure RxRaw field in GPIO PAD CFG DWORD 0. But
Gpio config templates are missing the option to configure
this feature. This patch adds the option in template.

Signed-off-by: Sai T <sai.kiran.talamudupula@intel.com>
2021-11-03 16:18:42 -07:00
Maurice Ma fe5067e5b9 [TGL] Fix the GPIO group ID overriding issue
Current SBL uses DLT file to override the GPIO group id in the
GPIO CFGDATA table because the group ID used in CFGDATA needs to
match the group ID used by GPIO library. This patch decoupled the
GPIO group id with the GPIO library. Instead, a translation was
added to convert the group ID to the value required by the GPIO
library.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-11-02 10:55:04 -07:00
Maurice Ma 4936832cde [TGL] Add SOC specific memory info
This patch updated the memory info for TGL platform using the SOC
specific memory map registers.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-10-26 14:32:20 -07:00
Guo Dong 2064c1f003 [TGL] Enabling WDT for TCC DSO
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.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2021-10-26 13:58:26 -07:00
Maurice Ma c62e24eb8c Add PCD to let platform control the ACPI processor ID base
This patch added PcdAcpiProcessorIdBase to allow platform to
customize the processor ID start base within MADT APIC entry.
Current EHL and TGL declared PR00 processor object in ACPI
with unique ID value 0, but other projects used vlaue 1
instead. This patch will help fix this issue.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-10-25 16:43:20 -07:00
Maurice Ma 4c443f15fd [TGL] Enable PCI 64bit resource in X64 build
This patch enabled several config options for TGL x64 build so that
64 bit PCI resource can be allocated properly. As part of it, the
related GFX bar read/write has been extended to handle 64bit address.

This has been tested on UPX i11 board. X64 SBL can boot to Ubuntu
properly.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-10-21 10:14:03 -07:00
Maurice Ma 21917377c8 Change GetSerialPortBase() API to return 64bit address
When UART bar is alloaced to 64 bit address, the current SBL API
GetSerialPortBase() only returns the lower 32 bit address, which will
cause problem for UART access. This patch fixed this issue.

Please note the patch did not change the payload HOB interface for
UART info. That needs to be updated to 64bit base address too. But this
patch does not cover that.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-10-21 10:09:20 -07:00
Jim 06b5292c20 [TGLU] Expand LPDDR4 DDI Config Array to 16 Entries
The DDI config array for LPDDR4 was incorrectly defined as 13 entries.
There are 16 UPDs that are programmed in UpdateFspConfig, resulting in
random UPD assignments.

This addresses issue
https://github.com/slimbootloader/slimbootloader/issues/1365#issue-1031580997

Signed-off-by: Jim <jim.pelner@intel.com>
2021-10-20 09:50:04 -07:00
Stanley Chang 519ec079be [TGL] Fix S0ix issues
This patch fixes three S0ix issues:

1. a regression caused by commit 20889 where the
   FspsConfig->SerialIoUartMode missed configuring for legacy UART

2. failed s0ix when assigning uart port2 as debug port: root caused
   by Maurice. He pointed out that several uart properties should
   not be reset
   This fixed #1314.

3. conflict with TCC/TSN: In TGL, S0ix should be disabled when either
   TCC or TSN is enabled. If s0ix is enabled, the patch checks TCC/TSN
   enabling status and forces turning off S0ix if TCC/TSN is enabled.

Signed-off-by: Stanley Chang <stanley.chang@intel.com>
2021-10-18 21:25:47 -07:00
Maurice Ma 4f2e81e4be [UPX i11] Clear boot flags in the default USB boot option
By default, the boot option 0 has mender OS boot flag set, and it causes
"root=" to be appended to the Linux boot command line. For Ubuntu OS,
it will cause the wrong root fs parameter and prevent it from booting.
This patch fixed this issue.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-10-18 10:01:54 -07:00
Maurice Ma cf71b4557d [TGL] Report PCI 64bit resource to OS
This patch added PCI MEM64 resource in ACPI table so that OS can
re-allocate 64bit PCI resource if required.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-10-18 09:14:52 -07:00
Sai T 4d17d55a21 Move PchPcrLib to CommonSocPkg
Make PchPcrLib common. Remove redundant headers
not used by some platforms and link the new common
lib with the platforms currently using it.

Signed-off-by: Sai T <sai.kiran.talamudupula@intel.com>
2021-10-18 08:02:42 -07:00
Maurice Ma 145d71041a [TGL] Skip CPU replacement check to allow MRC fast boot
This patch will skip ME CPU replacement check on SBL to always
allow MRC fast boot flow.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-10-15 22:20:54 -07:00
Maurice Ma 05592150d8 [TGL] Fix MRC full training issue on warm reset flow
On TGL warm reset flow, current MRC will always do full MRC training.
It is because of wrong PMC rigster was used in platform code to set
and clear the MRC scratch pad bit.

This fixed #1346.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-10-14 15:19:56 -07:00
Maurice Ma a149d0ebca [UPX i11] Enable Ubuntu boot support
Ubuntu 20.04.3 can support TGL platform. However, current SBL won't
be able to boot without changes. It is caused by following issues:
 - GRUB CFG support is not enabled by default
 - Payload heap is too small to load the full INITRD image
 - USB boot option is set to boot from partition 1 and EXT2 filesystem.

This patch addressed above issues. It has been tested on UPX i11.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-10-14 14:41:09 -07:00
Maurice Ma b9b01e8640 [UPX i11] Address USB boot long delay issue
This patch fixed the USB enumeration long delay issue seen on
UPX i11 board. It disabled the malfunction USB port 8.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-10-14 11:04:05 -07:00
Maurice Ma 9aa774f635 Issue cache flush before FWU reset in Shell
Since the commit below was reverted
24f5aa59b5. The cache flush
need to be moved into the place where data consistency
across warm reset is required. The patch added the WBINVD
to flush the cache before "fwupdate" command issues warm
reset.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-10-13 14:58:35 -07:00
Jim A. Pelner 8d4b0dc19d [TGLH] Fix Yocto Boot Issue with TCC Enabled
In the TGL implementation of UpdateFspConfig() in Stage1BBoardInitLib.c,
there are two missing UPD updates that have been validated for TGLH. This
manifested itself when enabling the TCC feature by setting ENABLE_TCC in
BoardConfig.py by reporting a bad VT-d descriptor and hanging.

This patch incorporates these two UPD settings for the TGLH boards.

Signed-off-by: Jim A. Pelner <jim.pelner@intel.com>
2021-10-11 15:06:14 -07:00
Maurice Ma 4189ae986b [TGL] Fix UpdateFspConfig() early return issue
On TGL  UpdateFspConfig() funciton in Stage2BoardInitLib.c has code
path to return early, it will skip all remaining UPD initialization.
The code should always continue the flow to finish the whole
function. This patch fixed this issue.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-10-07 11:28:37 -07:00
Randy Lin 5f7dc196ab [TGL] Disable Intel HD Audio (Azalia)
1. HD Audio and TSN share pins. These are mutually exclusive features.
 2. RVP board should be reworked to support legacy HD Audio mode.

Signed-off-by: Randy Lin <randy.lin@intel.com>
2021-10-05 11:29:04 -07:00
Vincent Chen 93ac9991c6 [TGL] Update FSP and platform version since MR3 is released
- UP3 IoT FSP MR3
- change the FSP headers from FspBin folder to Include folder
- update TGL platform version to 1.3

Signed-off-by: Vincent Chen <vincent.chen@intel.com>
2021-09-30 12:00:49 -07:00
Maurice Ma 1177ad3a1d [TGL] Enable payload selection GPIO configuration
This patch added payload selection GPIO configuration and removed
hardcoded GPIO pin for payload selection.

It also fixed #1195.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-09-20 16:11:37 -07:00
Maurice Ma 907a4ca4b7 [TGL] Group GPIO pin configurations
There are too many pins in GPIO pin configurations in TGL platform.
It is desired to group them into sub-pages to make it easy to find
the proper pin for configurations.  This patch implemented this.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-09-20 16:11:37 -07:00
James Gutbub 631ecff4f1 [TGL] Update UPX GFX and SMBIOS data
For the UPX i11 board we need to set
the SA display table (same as DDR4 RVP),
populate the VBT callback routine (also
same DDR4 RVP), and update the SMBIOS
base board string.

Signed-off-by: James Gutbub <james.gutbub@intel.com>
2021-09-20 16:09:00 -07:00
James Gutbub 42a5eea2f6 [TGL] Set PCIe CFG for UPXi11
Need to adjust the CFG data settings
related to PCIe to enable several
devices for the UP Xtreme i11 board.
Able to detect M.2 NVMe, x4 PCIe slot,
and network controller 8086-0D9F.

Signed-off-by: James Gutbub <james.gutbub@intel.com>
2021-09-17 13:50:43 -07:00
James Gutbub de3b09f331 [TGL] Increase CFG data mempool and skip debug UART init
With the recent additions to the CFG data (new DLT for
UPXi11 and new fields added) the CFG data size alloced
in memory seems to have run out of space, need to add
space to load the CFG data. Also, we need to specify
in FSP-M to skip UART init for the debug port we are
using when it is a PCH UART or we lose debug messages
in Stage2 onward if using a debug FSP.

Signed-off-by: James Gutbub <james.gutbub@intel.com>
2021-09-17 13:50:07 -07:00
James Gutbub 6e3da33852 [TGL] Add CFG for USB20Enable
The default values for USB20Enable from FSP
is set to enabled. Some platforms need to
disable some of these USB20 ports (e.g. TGL-U
DDR4 and LPDDR4 RVP). Add CFG data field for
the USB20Enable settings per port.

Signed-off-by: James Gutbub <james.gutbub@intel.com>
2021-09-15 14:08:55 -07:00