Commit Graph

530 Commits

Author SHA1 Message Date
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
Maurice Ma eea78479da [QEMU] Add UEFI universal payload test case
This patch added UEFI universal payload boot test on QEMU.
It fixed #1332.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-10-11 15:23:42 -07:00
Maurice Ma 1caacefeb5 [UPX] Disable malfunctioned USB2 port
On UPX, one USB2 port does not respond properly during PCI enumeration.
It needs to be disabled.  The current SBL code disabled the wrong port.
It should be port 10 (USB2 index 9).

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-10-11 15:23:09 -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 0b5581895f [UPX] Disable trace hub debug interface by default
During UP Extreme board enabling, trace hub interface was enabled
to help debug. But it should be disabled by default. This patch
fixed it.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-10-09 07:14:30 -07:00
Aiden Park bea07fdc60 [Tool] Allow each platforms to override min tool versions
This allows each platforms to override its own minimum tool versions.

Current SBL default minimum tool versions:
    'python'    : '3.6.0'
    'nasm'      : '2.12.02'
    'iasl'      : '20160422'
    'openssl'   : '1.1.0g'
    'git'       : '2.20.0'
    'vs'        : '2015'
    'gcc'       : '7.3'
    'clang'     : '9.0.0'

If a board needs to use VS2008 and nasm2.14,
In BoardConfig.py,
    def GetPlatformToolchainVersions(self):
        version_dict = {
            'nasm'      : '2.14',
            'vs'        : '2008',
        }
        return version_dict

Signed-off-by: Aiden Park <aiden.park@intel.com>
2021-10-08 20:05:10 -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
James Gutbub 26bb66cedf [CFL] Increase PAYLOAD size
Seems some recent patches may have added additional
size to OS Loader and now the internal pre-commit build
test in Jenkins is failing due to not enough space
for PAYLOAD. Other platforms are also using 29000h
so might be best to increase the CFL value as well.

Signed-off-by: James Gutbub <james.gutbub@intel.com>
2021-10-04 22:37:32 -07:00
Maurice Ma 8c85533285 Add accurate TSC frequency calculation support
Current SBL code uses MSR(0xce) to calculate the CPU TSC frequency.
However, it is not very accurate. A better way is to use CPUID to
calculate the TSC frequency. This patch added new API to get accurate
TSC frequency.  It also added APIs to allow conversion between time
and TSC ticks.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-10-04 13:16:51 -07:00
Maurice Ma 4d45a48ac0 Add gitignore file in Silicon and Platform folder
Current SBL build will show lots of FSP files as untracked files.
This patch re-orgnized the rules for .gitignore file so that it
has better control at different folder level. With these new rules
no untracked files will be shown for the FSP and VBT files.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-10-04 12:20:26 -07:00
Maurice Ma 8d0b3467b5 [QEMU] Fix AUTO boot option index
On SBL, it can support boot option selection through QEMU command line
"-boot order" parameter. However, it does not work anymore. It was
because of the MAX_BOOT_OPTION_CFGDATA_ENTRY adjustment in other commit.
This patch decoupled internal boot option index with the CFGDATA boot
option index so that it does not have impacts on each other. With this
change, QEMU boot option can be altered through command line again.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-10-04 12:00:05 -07:00
Maurice Ma edadef9b5d [EHL][CMLv] Fix Universal Payload build issue
The newly added code caused build issue for EHL and CMLv x64 due to
insuffiant flash space. This patch adjusted the flash layout to fix
the build failure.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-10-04 11:59:55 -07:00
Stanley Chang 53496b3423 [CML] Fix RTC S3 wake hang
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.

In addition to clearing RTC SMI#, this patch also clears other
SMI# as UEFI BIOS does.

Test method: rtcwake -m -s 15

Signed-off-by: Stanley Chang <stanley.chang@intel.com>
2021-10-04 06:18:23 -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
Ong Kok Tong 62db9dc92c [EHL] Disable New GPIO scheme by default
Disable the new GPIO scheme by default in dlt file
Only enable this option for kernel version 4.18.0-315
Alternatively with kernel module parameter
'module_blacklist=pinctrl_elkhartlake' will works
without enabling this GPIO scheme.

Signed-off-by: Ong Kok Tong <kok.tong.ong@intel.com>
2021-09-30 10:58:59 -07:00
James Gutbub a6a0c317dd Resolve fs cmd KW issue
Currently the PLT_DEVICE_TABLE is limited
to only using OS_BOOT_MEDIUM_TYPE devices
but ideally should be capable of mapping
any system device into the table. For the
time being we will remove the OsBootDeviceGraphics
since it created some KW issue in the fs command.

Signed-off-by: James Gutbub <james.gutbub@intel.com>
2021-09-27 17:08:32 -07:00
Maurice Ma 7f461c59e0 Enable native GFX initialization support
On QEMU or Smimics, it might need to do native GFX initialization
if the GFX is not initialized by FSP. This patch added the native
GFX support for BOCHS graphics controller.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-09-23 09:15:13 -07:00
Ong Kok Tong b628b95e90 [EHL] Update the EHL BoardPkg version to 1.2
Update EHL BoardPkg version to 1.2 to allign with current
software package version:

ERINFO_PROJ_MAJOR_VER: 1 PV Quality release
VERINFO_PROJ_MINOR_VER: 0: PV  1: MR1  2: MR2 etc.

PROJ_MAJOR_VER -> 1 (Maintenance Release candidate)
PROJ_MINOR_VER -> 2 (1st revision of MR2 release)

Signed-off-by: Ong Kok Tong <kok.tong.ong@intel.com>
2021-09-22 21:19:13 -07:00
Praveen Hp 1e93e7bec2 [CML] Fix chipsec SMM issues in S3 path
This patch upstreams previous CML patch for RC3 hotfix:
  [CMLV] Fix chipsec SMM issues in S3 path:
    Trigger SMI in S3 path to let UEFI payload restore registers.

Signed-off-by: Stanley Chang <stanley.chang@intel.com>
2021-09-22 21:01:20 -07:00
Maurice Ma b61baa5a8d [EHL] Add GPIO payload selection configuration
This patch added payload selection GPIO configuration
hardcoded GPIO pin for payload selection.

It also fixed #1196.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
Co-authored-by: Lean Sheng Tan <lean.sheng.tan@intel.com>
Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-09-22 07:20:48 -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
Randy Lin 0cbd8a79c4 [CML][TGL] Fix klockwork scanning issues.
Add check for Pointer 'HdaVerbTablePtr' returned from call to function
'AllocateZeroPool'

Signed-off-by: Randy Lin <randy.lin@intel.com>
2021-09-15 09:26:50 -07:00
James Gutbub 38495b01c2 [TGL] UPXi11 GPIO Sync
The GPIO for the UP Xtreme i11 board
needs to be synced by obtaining the
GPIO diff between the default BIOS on
the board and the default GPIO programming
being performed currently by SBL.

Signed-off-by: James Gutbub <james.gutbub@intel.com>
2021-09-15 09:25:23 -07:00
Lean Sheng Tan 208891f9e2 [EHL][TGL] Hide CFG fields when S0ix is enabled
There are several config options that will be overridden in Stage
code when S0ix is enabled and so we should hide these in the
ConfigEditor if S0ix is enabled.

Signed-off-by: Lean Sheng Tan <lean.sheng.tan@intel.com>
2021-09-15 08:33:30 -07:00
Lean Sheng Tan e7a47908b4 [TGL] Rename LowPowerS0Idle to S0ix
For consistency and public understanding, rework to change
'LowPowerS0Idle' to 'S0ix'.
- rename LowPowerS0Idle to S0ix
- enable s0ix by default for TGL-U
- add s0ix variable in PlatformData.h
- add s0ix flag check in stage 1B
- move Tcc s0ix support flag from stage 2 to stage 1B

Signed-off-by: Lean Sheng Tan <lean.sheng.tan@intel.com>
2021-09-15 08:33:30 -07:00
Lean Sheng Tan a7063eb30a [EHL] Rename LowPowerS0Idle to S0ix
For consistency and public understanding, rework to change
'LowPowerS0Idle' to 'S0ix'.
- rename LowPowerS0Idle to S0ix
- add s0ix variable in PlatformData.h
- add s0ix flag check in stage 1B
- move Tcc s0ix support flag from stage 2 to stage 1B

Signed-off-by: Lean Sheng Tan <lean.sheng.tan@intel.com>
2021-09-15 08:33:30 -07:00
Stanley Chang 8879f35447 [TGL] fix fw update hang due to rom size change
This patch fixes a hang issue during fw update caused by
mismatching bios rom size. For a fw update, the TopSwap
size, Redundant Region size, and total BIOS region must be
identical.

This patch also adds check on rom size during fw update.
The check only works for a running SBL built with this patch.

Signed-off-by: Stanley Chang <stanley.chang@intel.com>
2021-09-11 07:18:45 -07:00
Ong Kok Tong 84ccab354e [EHL] Adding option to select new gpio scheme
There is a discrepancy between how Linux reads GPIO
and how bootloader is presenting it. This causes Linux
distros to crash, even in the installer,unless a kernel
module parameter has been passed:
'module_blacklist=pinctrl_elkhartlake'

The customer, Red Hat, is using RHEL 8 4.18.0-315.
There appears to be a discrepancy between how Linux reads GPIO and how
the Intel BIOS is presenting it.

Signed-off-by: Ong Kok Tong <kok.tong.ong@intel.com>
2021-09-11 07:15:54 -07:00
James Gutbub 45698d436e [TGL] Enable UPX i11 basic boot
Support for Up Xtreme i11 TGL based board has
been started, with this patch we are able to
boot the board using Slim Bootloader via OS
Loader payload. The PCIe x4 slot on the board
is able to detect NVMe-to-PCIe x4 adapter media
but the other IO on the Up Xtreme i11 board
will need enabling in subsequent patches. Debug
output is coming from header CN11 on the board
(e.g. UART2).

To stitch the SlimBootloader.bin into the default
IFWI retrieved from the Up Xterme i11 use the
StitchLoader.py script with '-p' argument as given
below:

python Platform\TigerlakeBoardPkg\Script\StitchLoader.py -p 0xAA000204
-i board_default_ifwi_orig.bin -s Outputs\tgl\SlimBootloader.bin
-o sbl_ifwi_tgl-upx.bin

Signed-off-by: James Gutbub <james.gutbub@intel.com>
2021-09-08 20:58:32 -07:00
James Gutbub 10672a765c [TGL] Add Fusa Enable CFG option
Not every board will want to boot with
Fusa Enabled (ex. UPX i11 board). We can
allow for Fusa to be skipped using CFG
instead of just BoardConfig flag.

Signed-off-by: James Gutbub <james.gutbub@intel.com>
2021-09-08 19:36:05 -07:00
Sai T 772da78bfa Move BdatLib to CommonSocPkg
This patch adds BdatLib to CommonSocPkg so that all projects
can refer to one single instance of BdatLib. Also removed the
redundant platform-specific package folders.

Signed-off-by: Sai T <sai.kiran.talamudupula@intel.com>
2021-09-08 16:39:56 -07:00
Raghava Gudla 878190fadf
Enable Oem key has generation for Btg0 profile (#1279)
Latest BpmGen2 require Oem Key hash generation for
Btg legacy profile also. This patch enabled oem key generation
for Btg0 profile.

Signed-off-by: Raghava Gudla <raghava.gudla@intel.com>
2021-08-31 10:54:42 -07:00
Randy Lin 76b1539645 [TGL] Disable DMIC by default
Asserting will occure when booting with legacy HD audio enabled.

Signed-off-by: Randy Lin <randy.lin@intel.com>
2021-08-26 21:36:07 -07:00
James Gutbub ea1cd3f0ac
Remove trailing space from OemPublicKeyHash field (#1274)
When boot guard profile is non-zero the OemPublicKeyHash
will be populated in the stitching XML file but FIT/mFIT
is giving a warning message:

OemPublicKeyHash. Exception: set_value failed.

This will remove the trailing space added to the last byte
given in the OemPublicKeyHash and resolve the warning.

Signed-off-by: James Gutbub <james.gutbub@intel.com>
2021-08-25 15:37:35 -07:00
Stanley Chang ddd3e022de [CML] enable stitch tools for linux
The patch enables stitching CML/CMLV IFWI under Linux.

  CML/CMLV stitch tools do not natively support for Linux.
  A wrapper using 'wine' is required and works.

Signed-off-by: Stanley Chang <stanley.chang@intel.com>
2021-08-24 10:51:08 -07:00
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
Randy Lin 6495e7effb [TGL] Fix klockwork scanning issue
SiCfgData return NULL will be dereferenced

Signed-off-by: Randy Lin <randy.lin@intel.com>
2021-08-23 07:44:11 -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
Randy Lin c1fe5878c6 [TGL] Support HDA Audio
Use PchHdaEnable in cfgdata for user to configure the desire value.

TEST=Verified audio function on tglu platform

Signed-off-by: Randy Lin <randy.lin@intel.com>
2021-08-17 10:49:47 -07:00
Jim 9081525430 [TGL-H] PV Upstream
Signed-off-by: Jim <jim.pelner@intel.com>
2021-08-11 18:07:23 -07:00
Stanley Chang 699dd064f9 [EHL] fix stitching TSN fw without tsn option
when 'tsn' is not specified in stitching option, TSN FWs
should be not replaced.

Signed-off-by: Stanley Chang <stanley.chang@intel.com>
2021-08-11 13:37:32 -07:00
Stanley Chang 22981de95c [TGL] increase stack size for FSP-m
MRC requires a larger stack when MrcSafeConfig is disabled
with FSP-m UPD.

Signed-off-by: Stanley Chang <stanley.chang@intel.com>
2021-08-11 07:09:03 -07:00
Lean 54592933fe [EHL] Make TSN config binaries optional
For EHL, PCH & PSE TSNs are required to be turned on for ethernet
connection. However, TSN configurations binaries (TSN Mac address,
TSN manual config & PSE TSN IP config binaries) are optional, and
only used for refined controls.

This CL decouples optional TSN binaries loading and can be enabled
with BoardConfig flag "ENABLE_TSN". If those binaries are
not included, OS TSN driver will load TSNs with default configs and
assign MAC address to them dynamically.

ENABLE_TSN is turned off by default.

Signed-off-by: Lean Sheng Tan <lean.sheng.tan@intel.com>
2021-08-10 10:13:15 -07:00
Lean 8be478c850 [EHL] Enable stichifwi to dynamically replace IPFW components
EHL stitchifwi script enables user to replace IFWI IPFW components
during stitching time.
This CL enables user to only replace IPFW component only if the
specific component is included in IPFW folder of stitch workspace
directory.

Besides, this CL also adds TCC CRL to the replaceable IFWI IPFW
components list.

Signed-off-by: Lean Sheng Tan <lean.sheng.tan@intel.com>
2021-08-10 09:56:23 -07:00
Ong Kok Tong 477932b86c [EHL] Enabled TGPIO
Enabled TimedGPIO 0/1 in PCH Nvs referring to
FSP UPD of TimedPgio 0/1

Signed-off-by: Ong Kok Tong <kok.tong.ong@intel.com>
2021-08-10 08:06:47 -07:00
Ong Kok Tong 87cdb90c84 [EHL] Gbe device status fix
Check Gbe device status and update it to D0
if non-D0 state was detected.

Signed-off-by: Ong Kok Tong <kok.tong.ong@intel.com>
2021-08-10 08:05:53 -07:00
Lean Sheng Tan 5579f47e40 [EHL] Fix ConfigEditor tool crash and invalid options
Here are the changes:
1. Update mismatched & incorrect config options & variables
2. Fix invalid boot options configs
3. [common] Include 'preOS + mender' support for boot flags in
   boot options template

Signed-off-by: Lean Sheng Tan <lean.sheng.tan@intel.com>
2021-08-09 13:17:41 -07:00
Aiden Park 4b2e566921 Cleanup Platform/Silicon code to access LoaderGlobalData via APIs
This makes all Platform & Silicon code use APIs to access
LoaderGlobalData instead of accessing variables directly.

Signed-off-by: Aiden Park <aiden.park@intel.com>
2021-08-06 12:34:36 -07:00
Stanley Chang 5e03a76a53 [TGL] add control for TCSS PTM Enable
According to EDS, TCSS PTM Enable (PTME on [B0,D7,F0] offset 158h)
should not be set unless a associated downstream port already has
PTM Enable set.

This patch adds a CfgData control for each TCSS PCIe Root Port.
User can enable each of them when a downstream port meets the
requirement. The new CfgData control is similiar to the following
setup in UEFI BIOS Menu:

  Intel Advanced -> SA -> TCSS -> PCIE RP[]

Last, this patch also removes redundant PTM configurations,
because (a) this PTM settings will be overridden by built-in
CfgData_Silicon.yaml or customized DLT; b) even for customized SBL,
FSP can use default PTM settings.

Signed-off-by: Stanley Chang <stanley.chang@intel.com>
2021-08-06 09:14:42 -07:00
Lean a352ecb940 [TGL][EHL] Allow TCC CRL binary to be included in SBL build
Allow user to include TCC CRL binary to be included in SBL
binary build. The script will check if crl.bin is there (binary
folder) and then only include it.

Signed-off-by: Lean Sheng Tan <lean.sheng.tan@intel.com>
2021-08-04 21:33:15 -07:00
stanley ab3a47d33a
[TGL] refactor TSN enablement control (#1242)
This patch refactors TSN enablement control by

 - rename ENABLE_TSN_MAC_ADDRESS with ENABLE_TSN:
     align the naming with ENABLE_TCC

 - ENABLE_TSN can be used as a one-stop control knob
     to reserve FW spaces and include proper TSN CfgData

 - collect TSN-specific CfgData into CfgData_Tsn_Feature.dlt

With the new control, inconsistent TSN settings are fixed:
  - TSN MAC FW space is reserved but PchTsnEnable is not set

Signed-off-by: Stanley Chang <stanley.chang@intel.com>
2021-08-04 11:07:21 -07:00
stanley f87b8c3c49
[QEMU] extend auto test timeout (#1247)
Recently, github CI test case, Qemu-linux_boot.py, randomly fails.

Comparing the logs between failed and pass cases, we can find:

  1. the failure is caused by timeout before Minimal Linux
     completely boots into console and shows "Welcome to Minimal
     Linux" messages.

     Although such timeout can be a real error (true-positive),
     it is also possible just a false alarm (false-positive)...

  2. for a failed case, a force push to trigger another CI check
     can result in pass, even no code changes. Thus, the timeout
     failure points to CI environment (e.g., loading) - a false alarm.

  3. the margin (of pass case to timeout) is about 0.4 sec.

This patch increases timeout for 2 seconds to avoid unexpected
test timeout caused CI envornment (e.g., loading).

Signed-off-by: Stanley Chang <stanley.chang@intel.com>
2021-08-04 09:45:08 -07:00
Subash Lakkimsetti 237b5f3d45
[CFL] Fix reading bpmgen2 params (#1241)
Default Bpmgen params created by bpmgen tool
has unicode characters. This patch fixes reading the
file with unicode chars.

Signed-off-by: Subash Lakkimsetti <subash.lakkimsetti@intel.com>
2021-08-03 15:30:12 -07:00
Raghava Gudla 2874564a43
Fix normalization error (#1227)
when pin number in pad name is not in <group name><xx> where
xx is pin number format. for example GPIO_VER2_LP_GPP_C2 instead of
GPIO_VER2_LP_GPP_C02, current code has a bug which does not give the
desired output which is GPP_C02.
This patch fixed this issue.

TEST= Verified on multiple platforms that the issue is fixed

Signed-off-by: Raghava <raghava.gudla@intel.com>
2021-07-30 10:46:25 -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
Ong Kok Tong 6a5511883e [EHL] Fix for Gbe device status for Fusa
TSN GBE PMECTRLSTATUS register returned 0x3 after
booting into OS and only occured in Fusa sku
This fix will check TSN PMECTRLSTATUS register and
update value to 0x0 if non-zero value was returned
Only applicable if TSN is enabled

Signed-off-by: Ong Kok Tong <kok.tong.ong@intel.com>
2021-07-27 14:45:50 -07:00
stanley 3614cbd494
[TGL] Fix CPOC Duplication ACPI Error (#1233) (#1236)
CPOC is defined in both Cpu0Hwp.asl and Dsdt/Cpu.asl,
which results in Linux kernel warning and wrong CPU
base speed shown in Windows 10.

Signed-off-by: Stanley Chang <stanley.chang@intel.com>
2021-07-27 09:45:35 -07:00
koktong-ong db419e23f9
[EHL] Support TCC in all boot options (#1220)
To support rtcm image for all boot options in SBL EHL
Uncomment boot flags and image type in Tcc_Feature.dlt for
enabling tcc in dedicated boot option

Signed-off-by: Ong Kok Tong <kok.tong.ong@intel.com>
2021-07-16 17:09:15 -07:00
Ong Kok Tong fcba69d599 [Common] Fix config data boot option index
Current index only support up to 0xF as the CFGHDR_TMPL
as it amend into 0x05 (eg. 0x05$(1))
Update the logic to (0x050 + $(1)) instead to support
index larger than 0xF

Signed-off-by: Ong Kok Tong <kok.tong.ong@intel.com>
2021-07-14 15:32:51 -07:00
Ong Kok Tong 570d263e2b [EHL] Fix in RVP board support
Added Gpio Lock config in dlt file for RVP board

Signed-off-by: Ong Kok Tong <kok.tong.ong@intel.com>
2021-07-14 15:20:59 -07:00
stanley 2832972ad6
[TGL] Add iTBT PCIe root port enablement config (#1217)
This patch replaces the original hard-coded iTBT
root ports enabling control with a CFG option.
The default value is to enable them.

Signed-off-by: Stanley Chang <stanley.chang@intel.com>
2021-07-07 09:06:54 -07:00
koktong-ong c8b21cae2e
[EHL] Enable DAM option stitchIfwi update (#1215)
Enable DAM option in stitchifwi script for
ITP/CCA debug purpose with -o debug paramter
Example: To enable SATA and DAM enabled "-o sata;debug"

Signed-off-by: Ong Kok Tong <kok.tong.ong@intel.com>
2021-07-06 09:18:01 -07:00
koktong-ong 43455674ac
[EHL] Update the EHL BoardPkg version to 2.0 (#1218)
Update EHL BoardPkg version to 2.0 to allign with current
software package version:
PROJ_MAJOR_VER -> 2 (Maintenance Release candidate)
PROJ_MINOR_VER -> 0 (1st revision of MR1 release)

Signed-off-by: Ong Kok Tong <kok.tong.ong@intel.com>
2021-07-06 09:10:29 -07:00
koktong-ong 74c91a946a
[EHL] Enable tcc in boot option (#1214)
Re-enable sbl_rtcm in EHL boot option due to
mistakenly removed it in previous commit of
f01a5b33fb

Signed-off-by: Ong Kok Tong <kok.tong.ong@intel.com>
2021-07-06 09:10:07 -07:00
Talamudupula fc8a3b33ce GpioLib header clean-up
Inconsistent and redundant header files are removed.
All projects going forward

 - Use API declared in GpioLib.h
 - Provide instance of GpioSiLib.h
 - Use common defines in GpioConfig.h

[QEMU][APL][CFL][CML][CMLV]
 - Follow above header model
 - Have own instance of GpioLib

[EHL][TGL]
 - Follow above header model
 - Use common GpioLib instance

Signed-off-by: Talamudupula <stalamudupula@gmail.com>
2021-07-01 11:24:03 -07:00
Maurice Ma d26709e289 [WHL] Add mailbox debug port example code
This patch provides exampole on how to enable mailbox debug port on
WHL. To enable it, the following needs to be set in BoardConfig.py.
  self.DEBUG_OUTPUT_DEVICE_MASK = 0x07
  self.CONSOLE_IN_DEVICE_MASK   = 0x00000005
  self.CONSOLE_OUT_DEVICE_MASK  = 0x00000005
Also adjust the PcdMailboxDebugPortMmioBase value in BoardConfig.py
as needed.

On host side, python script can be used in ISD to read/write this
register using IPC interfaces. EX:
  import ipccli
  ipc = ipccli.baseaccess()
  ipc.stateport.cnp_tpsb0.tap2iosfsb32 (...)
Please refere to MailboxDebugPort.py for example.

This was tested on UPX board with CCA debuger connected.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-07-01 11:22:16 -07:00
Maurice Ma d8c0177fe9 Added mailbox debug port support
This patch allows to use a mailbox register (DWORD) to support debug
port. If CCA debug is connected, it is possible to access certain
SOC register through BSSB. Then this register can be used for debug
console input/output.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-07-01 11:22:16 -07:00
Maurice Ma 800d4e4f0f [CFL] Add GPIO big bang debug port support
This patch added an example on how to enable GPIO  big bang debug
port on CFL platform.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-07-01 11:22:16 -07:00
Maurice Ma 163458e32d Add GPIO bit bang debug port library
This patch adds DebugPortLib as a platform extention lib to add new
debug port support. It also adds a generic GpioDebugPortLib to allow
GPIO bit bang to emulate UART TX pin.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-07-01 11:22:16 -07:00
Ong Kok Tong 6d2286cf42 [EHL] Enable POSC for all boot option
Enable POSC for all boot medium in Cfgdata_BootOption.yaml
by default
If Non-Fusa sku was detect and the boot flag will
change to exclude POSC
User can modify the boot flag to exclude the POSC in
yaml file as well

Signed-off-by: Ong Kok Tong <kok.tong.ong@intel.com>
2021-07-01 05:24:51 -07:00
Lean f01a5b33fb [EHL] Add TCC V2 support
Add latest Intel® Time Coordinated Computing support for EHL.

Here are the changes:
- Update the TCC subregion layout
- Use the common TCC config data
- Use the common TCC library for RTCT table
- Support TCC DSO cfg, Cache cfg and CRL binaries loading
- Rename TCC variable to follow TCC V2 naming
- Increase the stage 2 size from 0x89000 to 0x91000 to accommodate
  the new changes
- Add latest FspmUpd and FspsUpd header files for TCC v2 support
  (will be removed once FSP github updated the latest EHL FSP package)
- Change default boot options for RTCM support

TCC mode is turned off by default.

Signed-off-by: Lean Sheng <lean.sheng.tan@intel.com>
2021-06-25 12:54:40 -07:00
Ong Kok Tong ad6a88e34d [EHL] Fix Stage2 Boot Option checking
Fix mPchSciSupported flag checking before changing the
flag value of boot option.
This bug was introduced from commit
b78cbcf128

Signed-off-by: Ong Kok Tong <kok.tong.ong@intel.com>
2021-06-25 06:39:30 -07:00
Ong Kok Tong 30e2458126 [EHL] PlatformID fix
Fixed issue #1197
Check PlatformID before proceed to detect from SMBus
Moved PlatformIdInitialize to PostConfigInit

Signed-off-by: Ong Kok Tong <kok.tong.ong@intel.com>
2021-06-23 06:06:33 -07:00
Ong Kok Tong b78cbcf128 [EHL] s0ix fix for Fusa sku
Enable s0ix only for Non-Fusa sku
Removed PcdPreOsCheckerEnabled PCD flag

Signed-off-by: Ong Kok Tong <kok.tong.ong@intel.com>
2021-06-22 06:26:34 -07:00
Pedro Queiros 94b4198742 [EHL] Rework Fusa PT settings
- Add knob for setting up the ISI configuration file (isi_conf)
 - Fix PT test mask value to be aligned with default PT binary
   capabilities. Only add mask when PT is enabled.
 - "pt" parameter always requires isi_conf file. Dependency added
   automatically. isi_conf is also externally configurable since can
   be used without PT.

Signed-off-by: Pedro Queiros <pedro.queiros@intel.com>
2021-06-18 06:35:58 -07:00
Guo Dong 3989cd5122 [TGL] Add EC config data for EC enable/disable
Use the ECEnable cfgdata, to disable all the EC
related code.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2021-06-11 08:31:32 -07:00
Guo Dong be9f726139 [EHL] Remove unused feature flag for PreOS checker
FEATURE_PRE_OS_CHECKER_BOOT is not used by any core or platform code.
So just remove it.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2021-06-10 13:31:16 -07:00
Guo Dong 64dca520ef [TGL] Make TCC setting consistent
Add a separate cfgdata dlt file to enable TCC config data.
The TCC dlt file will be appended to board dlt file when
ENABLE_TCC is set in BoardConfig.py.

Removed RTCM subregion and update boot option for RTCM support
TCC is disabled by default.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2021-06-10 13:30:58 -07:00
Ong Kok Tong e90c7a1501 [EHL] Removed TCC FSP UPD
Removed TCC FSP UPD and Increased stage2B size to adpot
the changes in FSP 09.03.19.22

Signed-off-by: Ong Kok Tong <kok.tong.ong@intel.com>
2021-06-09 21:45:11 -07:00
Guo Dong 7e53dc3e70
[TGL] Use MR2 FSP and Microcode for TGL-U (#1186)
MR2 FSP is available so update SBL to use MR2 FSP.
and also use new Microcode required by new FSP
Update platform code on FSP UPDs, especially enable TCC feature.
Update TGL platform version to 1.2 since MR2 released.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2021-06-09 15:51:00 -07:00
Ong Kok Tong 60f5423552 [EHL] Gpio common lib integration
Integrated EHL GPIO lib into common GPIO lib.

Signed-off-by: Ong Kok Tong <kok.tong.ong@intel.com>
2021-06-04 11:16:39 -07:00
Guo Dong 8658d66c2b [TGL] Set PayloadId to "AUTO" by default
Update PayloadId to "AUTO" to align with other platforms to
have consistent behavior.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2021-06-04 11:14:34 -07:00
leanshen 474666bc6f [EHL] Update the EHL BoardPkg version to 1.1
Update EHL BoardPkg version to 1.1 to allign with current
software package version:
PROJ_MAJOR_VER -> 1 (Production Release candidate)
PROJ_MINOR_VER -> 1 (2nd revision of PV release)

Signed-off-by: LeanSheng <lean.sheng.tan@intel.com>
2021-06-02 20:33:49 -07:00
Guo Dong 99c9617db0 [TGL] Update PayloadId settings in dlt files
Update the comments and actual setting in dlt files to
make them in alignment.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2021-06-02 15:32:34 -07:00
Guo Dong a8bd06f8f2 [TGL] reset when TPM startup failure on S3
As per PC Client spec, SRTM should perform a host platform reset
when TPM startup failure on S3

Signed-off-by: Guo Dong <guo.dong@intel.com>
2021-06-02 15:32:34 -07:00
Guo Dong f7401ea952 [TGL] Minor code clean up
Remove TGL-H GPIO definition and program.
Use R_ACPI_IO_SMI_STS instead of "R_ACPI_IO_SMI_EN + 4"
Set PCIE region len to 0x10000000 instead of 0x20000000
Remove data dumping for PSD
Fix other typo

Signed-off-by: Guo Dong <guo.dong@intel.com>
2021-06-02 15:32:34 -07:00
Sindhura Grandhi 66a5487148 Add TccErrorLog feature in Tcc mode
Make Error logging capability configurable under
Tcc mode. This will be consumed later.

Signed-off-by: Sindhura Grandhi <sindhura.grandhi@intel.com>
2021-06-02 11:37:50 -07:00
jinjhuli 46e90b83fd [EHL] Clone FSP and Microcode from open source repo
1. Clone FSP from
https://github.com/intel/FSP/tree/master/ElkhartLakeFspBinPkg
2. Clone microcode from
https://github.com/tianocore/edk2-non-osi/tree/master/Silicon/Intel/ElkhartlakeSiliconBinPkg

Signed-off-by: jinjhuli <jin.jhu.lim@intel.com>
2021-05-28 15:13:54 -07:00
Ong Kok Tong 41a7ab5aee [EHL] BiProchot changes for Fusa
Change BiProcHot value to 0 for Fusa sku as per
requested from PMC team to fulfill Fusa requirement

Signed-off-by: Ong Kok Tong <kok.tong.ong@intel.com>
2021-05-28 15:13:18 -07:00
Maurice Ma c44a7f3146 [TGL] Skip PCH UART init in later stages
When PCH UART is used as debug UART, the later stage code should
not do re-initializaiton. This patch will skip PCH UART GPIO
reprogramming and FSP-S UART re-initialization.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-05-28 11:57:43 -07:00
Maurice Ma 9480958ee8 [TGL] Fix TGL PCH Debug UART issue
On TGL platform, if change current DEBUG UART to PCH UART, there
is no output from SBL at all.

This patch fixed this issue by:
  - Skip UART init in FSP-T and let SBL do UART init itself.
  - Disable any debug output before UART init is done.

Signed-off-by: Maurice Ma <maurice.ma@intel.com>
2021-05-27 14:51:01 -07:00
Guo Dong 383a5b4e23 [TGL] Fix PlatformId override issue
If the PlatformId is already set by stitch data, the platform code
should skip platform settings to avoid PlatformID override.
This patch adds the PlatformId check in platform code.

Signed-off-by: Guo Dong <guo.dong@intel.com>
2021-05-27 09:33:04 -07:00