826 Commits

Author SHA1 Message Date
Benjamin Doron
4d99e03828 KabylakeOpenBoardPkg: Example of board S3
Use silicon code to detect S3 resume state. Apply some relevant policy
modifications.

PcdPeiMemSize must be in common scope, for a DXE module to allocate
required memory. Libraries that produce required PPIs are defined.

BootScriptExecutorDxe should only be linked against a functionally
compatible debug stack.

Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Ankit Sinha <ankit.sinha@intel.com>
Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Jeremy Soller <jeremy@system76.com>
Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>
Cc: Isaac Oram <isaac.w.oram@intel.com>
Signed-off-by: Benjamin Doron <benjamin.doron00@gmail.com>
Reviewed-by: Isaac Oram <isaac.w.oram@intel.com>
2022-10-11 18:04:20 -07:00
Benjamin Doron
b83909ef37 MinPlatformPkg: Implement working S3 resume
Consume S3 resume memory allocation on resume flow.

Also, include complementary FirmwarePerformanceDataTablePei module in
MinPlatform FV for S3 resume performance measurement.

Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Ankit Sinha <ankit.sinha@intel.com>
Cc: Isaac Oram <isaac.w.oram@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Eric Dong <eric.dong@intel.com>
Signed-off-by: Benjamin Doron <benjamin.doron00@gmail.com>
2022-10-11 17:54:23 -07:00
Benjamin Doron
07d0c98908 S3FeaturePkg: Implement working S3 resume
Follow-up commits to MinPlatform (PeiFspWrapperHobProcessLib for
memory) and FSP-related board libraries (policy overrides)
required for successful S3 resume.

Factored allocation logic into new module to avoid MinPlatform
dependency on S3Feature package.

TODO: Can optimise required size.

Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Ankit Sinha <ankit.sinha@intel.com>
Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>
Cc: Isaac Oram <isaac.w.oram@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Signed-off-by: Benjamin Doron <benjamin.doron00@gmail.com>
Reviewed-by: Isaac Oram <isaac.w.oram@intel.com>

S3FeaturePkg/Build: Add libraries needed by S3FeaturePkg

This change is needed for proposed S3FeaturePkg additions.
Changes ensure standalone build for S3FeaturePkg and AdvancedFeaturePkg

Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Benjamin Doron <benjamin.doron00@gmail.com>
Signed-off-by: Isaac Oram <isaac.w.oram@intel.com>
Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>

MinPlatformPkg/S3: Use EFI_PHYSICAL_ADDRESS for address

This change fixes build warnings with type casts from some compilers.
Also changes type for ACPI_S3_MEMORY S3PeiMemBase to EFI_PHYSICAL_ADDRESS.
This generally makes code eaiser to understand as opposed to UINT64.

Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Benjamin Doron <benjamin.doron00@gmail.com>
Signed-off-by: Isaac Oram <isaac.w.oram@intel.com>
Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
2022-10-11 17:52:24 -07:00
Benjamin Doron
12064d5fc0 MinPlatformPkg: Add SmmLockBox to build
The LockBox is used for S3 resume in the follow-up patches, but might be
used to support other features too. So, the module is added to a
MinPlatform FV here.

Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>
Cc: Isaac Oram <isaac.w.oram@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Ankit Sinha <ankit.sinha@intel.com>
Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Eric Dong <eric.dong@intel.com>
Signed-off-by: Benjamin Doron <benjamin.doron00@gmail.com>
Reviewed-by: Isaac Oram <isaac.w.oram@intel.com>
2022-10-11 17:20:39 -07:00
Isaac Oram
ee8d078e39 WhitleyOpenBoardPkg/AcpiPlatform: Fix table install logic
Fix ACPI table install logic issue introduced by incorrect fix
in 4c9b69e590 that prevents
some tables from being installed.

Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Chasel Chiu <chasel.chiu@intel.com>
Signed-off-by: Isaac Oram <isaac.w.oram@intel.com>
Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
2022-10-11 17:09:07 -07:00
Michael Kubacki
66cef08cde WhitleyOpenBoardPkg: Fix invalid debug macros
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=4094

Updates several debug macros in WhitleyOpenBoardPkg to correctly
match print specifiers to actual arguments.

Note: The "EFI_D_ERROR" macro was changed to "DEBUG_ERROR" in
FspWrapperHobProcessLib.c to pass PatchCheck and comply with latest
guidelines.

Cc: Isaac Oram <isaac.w.oram@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Chasel Chiu <chasel.chiu@intel.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Reviewed-by: Isaac Oram <isaac.w.oram@intel.com>
2022-10-10 14:16:11 -07:00
Michael Kubacki
b7d17b66fe TigerLakeOpenBoardPkg: Remove unnecessary debug macro argument
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=4094

Removes an argument passed to a debug macro without a print
specifier. The argument appears to be useless.

Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Heng Luo <heng.luo@intel.com>
Cc: Isaac Oram <isaac.w.oram@intel.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Reviewed-by: Heng Luo <heng.luo@intel.com>
Reviewed-by: Isaac Oram <isaac.w.oram@intel.com>
2022-10-10 14:16:00 -07:00
Michael Kubacki
df65f5d85c MinPlatformPkg: Fix invalid debug macros
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=4094

Updates several debug macros in MinPlatformPkg to correctly match
print specifiers to actual arguments.

Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Isaac Oram <isaac.w.oram@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Eric Dong <eric.dong@intel.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Revied-by: Isaac Oram <isaac.w.oram@intel.com>
2022-10-10 14:11:55 -07:00
Aryeh Chen
ae75c51f27 MinPlatformPkg: Remove _ADR from MinDsdt.asl
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4057

According to ASL Coding Guidelines - Device Identifiers
"A Device should contain either an _ADR or a _HID object, never both."
, so remove _ADR due to _HID exist.

Signed-off-by: Aryeh Chen <aryeh.chen@intel.com>
Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Isaac Oram <isaac.w.oram@intel.com>
Cc: Ankit Sinha <ankit.sinha@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Eric Dong <eric.dong@intel.com>
Reviewed-by: Ankit Sinha <ankit.sinha@intel.com>
2022-10-04 11:41:33 -07:00
James Wang
801d003703 BoardModulePkg/BoardBdsHookLib: Fix F7 overwrites Boot0000
Check if mBootMenuOptionNumber is valid or not before
calling RegisterBootOptionHotkey to avoid overwriting Boot0000

Cc: Eric Dong <eric.dong@intel.com>
Cc: Isaac Oram <isaac.w.oram@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Signed-off-by: James Wang <jameswang@ami.com>
Reviewed-by: Isaac Oram <isaac.w.oram@intel.com>
2022-09-15 17:04:37 -07:00
Isaac Oram
9a7234827f Platform/Intel: Fix missing package issue
Update all consumers of PcdAcpiBaseAddress to include
IntelSiliconPkg/IntelSiliconPkg.dec.

Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Signed-off-by: Isaac Oram <isaac.w.oram@intel.com>
Reviewed-by: Sai Chaganty <rangasai.v.chaganty@intel.com>
2022-09-12 18:14:04 -07:00
Isaac Oram
67bb3e44c1 MinPlatformPkg/Include: Add PEI DevicePathLib instance
PEI DevicePathLib instance required by NvmExpressPei.inf
due to recent change.

Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Eric Dong <eric.dong@intel.com>
Signed-off-by: Isaac Oram <isaac.w.oram@intel.com>
Reviewed-by: Sai Chaganty <rangasai.v.chaganty@intel.com>
2022-09-12 18:13:01 -07:00
Benjamin Doron
b74194d8b8 {Platform,Silicon}/Intel: Move PcdAcpiBaseAddress definition
All these platforms have an ABase, so move the definition to enable
common silicon code in IntelSiliconPkg. Otherwise, library shims would
be required, because PCDs are GUID-ed and package DEC specific.

Cc: Rangasai V Chaganty <rangasai.v.chaganty@intel.com>
Cc: Isaac Oram <isaac.w.oram@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Ankit Sinha <ankit.sinha@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>
Cc: Heng Luo <heng.luo@intel.com>
Signed-off-by: Benjamin Doron <benjamin.doron00@gmail.com>
Reviewed-by: Isaac Oram <isaac.w.oram@intel.com>
Reviewed-by: Sai Chaganty <rangasai.v.chaganty@intel.com>
2022-09-09 14:09:57 -07:00
Michael Kubacki
7f63ab7da9 MinPlatformPkg/TestPointCheckLib: Fix out of bounds array index access
The following code accesses array index "6" which is invalid as
the array is of length 6.

  DEBUG ((DEBUG_INFO, " %08x %08x %08x %08x %08x %08x",
    PciData->Device.Bar[0],
    PciData->Device.Bar[1],
    PciData->Device.Bar[2],
    PciData->Device.Bar[3],
    PciData->Device.Bar[4],
    PciData->Device.Bar[6]   <-- BAD ARRAY INDEX
    ));

PciData is of type "PCI_TYPE00":

  typedef struct {
    PCI_DEVICE_INDEPENDENT_REGION    Hdr;
    PCI_DEVICE_HEADER_TYPE_REGION    Device;
  } PCI_TYPE00;

"PCI_DEVICE_HEADER_TYPE_REGION":

typedef struct {
  UINT32    Bar[6];          <- NOTE: ARRAY LENGTH IS 6
  UINT32    CISPtr;
  UINT16    SubsystemVendorID;
  UINT16    SubsystemID;
  UINT32    ExpansionRomBar;
  UINT8     CapabilityPtr;
  UINT8     Reserved1[3];
  UINT32    Reserved2;
  UINT8     InterruptLine;
  UINT8     InterruptPin;
  UINT8     MinGnt;
  UINT8     MaxLat;
} PCI_DEVICE_HEADER_TYPE_REGION;

This change fixes the array index value.

Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Isaac Oram <isaac.w.oram@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Eric Dong <eric.dong@intel.com>
Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
Reviewed-by: Isaac Oram <isaac.w.oram@intel.com>
2022-09-09 07:42:37 -07:00
Nate DeSimone
4b2a5f42a9 KabylakeOpenBoardPkg/GalagoPro3: Enable HDMI DDC Debug Port
Enables usage of the HDMI DDC I2C Bus SerialPortLib implementation
on the GalagoPro3 board.

Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>
Cc: Isaac Oram <isaac.w.oram@intel.com>
Cc: Benjamin Doron <benjamin.doron00@gmail.com>
Cc: Michael Kubacki <michael.kubacki@microsoft.com>
Cc: Jeremy Soller <jeremy@system76.com>
Signed-off-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
Reviewed-by: Isaac Oram <isaac.w.oram@intel.com>
2022-09-08 18:10:29 -07:00
Nate DeSimone
bf7af31895 MinPlatformPkg: Add PcdDefaultTerminalType support to SerialPortTerminalLib
- Sets the terminal type GUID for ConIn, ConOut, and ConErr to the terminal
   type indicated by PcdDefaultTerminalType.
 - Some improvements to the comments in SerialPortTerminalLib

Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>
Cc: Isaac Oram <isaac.w.oram@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Benjamin Doron <benjamin.doron00@gmail.com>
Cc: Michael Kubacki <michael.kubacki@microsoft.com>
Cc: Jeremy Soller <jeremy@system76.com>
Signed-off-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
Reviewed-by: Isaac Oram <isaac.w.oram@intel.com>
2022-09-08 18:10:24 -07:00
Nate DeSimone
2af3a3eb64 KabylakeOpenBoardPkg: Add SecBoardInitLib
Adds a board-specific implementation of SecBoardInitLib.
This implementation will invoke the GPIO initialization
routine for the HDMI DDC Bus if the HDMI DDC Bus is being
used for debug log output. Adds PCDs for enable/disable
of using HDMI DDC I2C Bus as a Serial Port.

Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>
Cc: Isaac Oram <isaac.w.oram@intel.com>
Cc: Benjamin Doron <benjamin.doron00@gmail.com>
Cc: Michael Kubacki <michael.kubacki@microsoft.com>
Cc: Jeremy Soller <jeremy@system76.com>
Signed-off-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
Reviewed-by: Isaac Oram <isaac.w.oram@intel.com>
2022-09-08 18:10:19 -07:00
Nate DeSimone
dab7561915 KabylakeOpenBoardPkg: Add HdmiDebugGpioInitLib
This library initializes any GPIOs necessary for
the HDMI DDC bus to operate. This can be called
very early (SEC phase) to enable closed chassis
debug through the HDMI DDC I2C bus.

Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>
Cc: Isaac Oram <isaac.w.oram@intel.com>
Cc: Benjamin Doron <benjamin.doron00@gmail.com>
Cc: Michael Kubacki <michael.kubacki@microsoft.com>
Cc: Jeremy Soller <jeremy@system76.com>
Signed-off-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
Reviewed-by: Isaac Oram <isaac.w.oram@intel.com>
2022-09-08 18:10:15 -07:00
Nate DeSimone
63f79db91b KabylakeOpenBoardPkg: Add I2cHdmiDebugSerialPortLib
Add new SerialPortLib implementation that routes log
messages over the I2C bus included in the integrated
graphics HDMI port. Normally this I2C bus is used to
read the EDID data from the monitor. An unintended
but useful property of this interface is that is does
not require DMA to perform I/O. This means that this
interface can be used to perform I/O before DRAM is
initialized.

HDMI video output is a common feature of many laptops.
This makes the HDMI DDC bus the only I/O interface
that is often exposed outside of the laptop chassis
while simultaneously capable of being used in Pre-Memory.
Oddly, this makes it ideal for closed chassis debug.

Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>
Cc: Isaac Oram <isaac.w.oram@intel.com>
Cc: Benjamin Doron <benjamin.doron00@gmail.com>
Cc: Michael Kubacki <michael.kubacki@microsoft.com>
Cc: Jeremy Soller <jeremy@system76.com>
Signed-off-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
Reviewed-by: Isaac Oram <isaac.w.oram@intel.com>
2022-09-08 18:10:10 -07:00
Nate DeSimone
5f9e175123 KabylakeOpenBoardPkg: Add HdmiDebugPchDetectionLib
This library detects the type of PCH present on
the system to the granualarity level needed to
determine which GMBUS pins to use to access the
HDMI DDC I2C bus.

Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>
Cc: Isaac Oram <isaac.w.oram@intel.com>
Cc: Benjamin Doron <benjamin.doron00@gmail.com>
Cc: Michael Kubacki <michael.kubacki@microsoft.com>
Cc: Jeremy Soller <jeremy@system76.com>
Signed-off-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
Reviewed-by: Isaac Oram <isaac.w.oram@intel.com>
2022-09-08 18:09:59 -07:00
Chasel Chiu
07bcc0be8c MinPlatformPkg: Add FSP 2.4 MultiPhase library.
FSP Wrapper has implemented FSP 2.4 MultiPhase support
and required platform to include new library instance.

Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Isaac Oram <isaac.w.oram@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Eric Dong <eric.dong@intel.com>
Signed-off-by: Chasel Chiu <chasel.chiu@intel.com>
Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
2022-09-01 18:52:59 -07:00
Isaac Oram
d9994fa7e1 MinPlatformPkg: Remove unnecessary feature controls
Remove SMI handler profile feature control.
Disable handler profiling on RELEASE builds.

Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Eric Dong <eric.dong@intel.com>
Signed-off-by: Isaac Oram <isaac.w.oram@intel.com>
Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
2022-08-31 18:44:43 -07:00
Isaac Oram
56dac800ba CometlakeOpenBoardPkg/Build: Reduce unnecessary code
Leverage common includes to reduce duplicated or low value code.

Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Rangasai V Chaganty <rangasai.v.chaganty@intel.com>
Cc: Deepika Kethi Reddy <deepika.kethi.reddy@intel.com>
Cc: Kathappan Esakkithevar <kathappan.esakkithevar@intel.com>
Signed-off-by: Isaac Oram <isaac.w.oram@intel.com>
Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
2022-08-31 18:44:32 -07:00
Isaac Oram
0568b1296a KabylakeOpenBoardPkg/Build: Reduce unnecessary code
Leverage common includes to reduce duplicated or low value code.

Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Signed-off-by: Isaac Oram <isaac.w.oram@intel.com>
Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
2022-08-31 18:44:21 -07:00
Isaac Oram
a046333947 PurleyOpenBoardPkg/Build: Reduce unnecessary code
Leverage common includes to reduce duplicated or low value code.

Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Signed-off-by: Isaac Oram <isaac.w.oram@intel.com>
Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
2022-08-31 18:44:09 -07:00