2098 Commits

Author SHA1 Message Date
Ard Biesheuvel
0286233f3b Platform/ARM: switch to local version of NorFlashDxe drivers
Drop the dependency on the ArmPlatformPkg version of NorFlashDxe and
NorFlashStandaloneMm, which will be going away soon. Instead, depend on
the local version under Platform/ARM.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
2022-10-19 16:57:37 +02:00
Ard Biesheuvel
d7b286ae5f Platform/ARM: clone NorFlashDxe from ArmPlatformPkg
The ArmPlatformPkg version of NorFlashDxe and NorFlashStandaloneMm will
be going away, so clone them into Platform/ARM where the ARM platforms
that rely on this driver can keep using it.

Other than updating the INF version, refreshing the file GUIDs and
reorganizing the various INF sections, no changes have been made to the
driver.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
2022-10-19 16:57:26 +02:00
Ard Biesheuvel
0e2cb9ba9d Platform/ARM: create local definition of NorFlashPlatformLib
The version of NorFlashPlatformLib defined in ArmPlatformPkg will go
away once we retire its version of NorFlashDxe, so switch to a local
Platform/ARM version instead.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
2022-10-19 16:55:45 +02:00
Ard Biesheuvel
e073492f49 Platform/ARM/BootMonFs: drop spurious dependency on ArmPlatformPkg
Don't include NorFlashPlatformLib.h unnecessarily from BootMonFs, and
drop the reference to ArmPlatformPkg.dec, which isn't needed after that
either.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
2022-10-19 16:55:22 +02:00
Ard Biesheuvel
85280b124e Silicon/SynQuacer: Drop dependency on NorFlashPlatformLib
Fip006Dxe is part of the SynQuacer platform, which is its only user, and
yet, it relies on NorFlashPlatformLib to carry the platform specific NOR
geometry. This library is tied to ArmPlatformPkg's NorFlashDxe, which
will be going away, so let's stop using it.

Since the abstraction serves no purpose here, let's just merge the
library with its only user.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Reviewed-by: Leif Lindholm <quic_llindhol@quicinc.com>
2022-10-19 16:51:15 +02:00
Ard Biesheuvel
cf45696d24 Platform: Remove ComCast RDK
The Comcast RDK platform was contributed years ago, but since then,
nobody has expressed any interest in it, leaving it to the maintainers
to keep it in shape. As it turns out, the maintainers can think of
better ways to spend their time, so let's just drop it.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Reviewed-by: Leif Lindholm <quic_llindhol@quicinc.com>
2022-10-19 16:48:58 +02:00
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
Adrien Thierry
ad00518399 Platform/RaspberryPi: fix pci DT node address in SyncPcie()
To make sure the XHCI controller does not get reset by Linux in DT mode,
we remove its pci parent node from the device tree. However, the pci
node address has been updated in the Raspberry Pi 4 device tree [1] and
no longer matches the one we are trying to remove in SyncPcie(). This
results in the XHCI controller actually being reset by Linux, which
leads to errors during USB initialization:

[    3.563963] xhci_hcd 0000:01:00.0: xHCI Host Controller
[    3.569538] xhci_hcd 0000:01:00.0: new USB bus registered, assigned bus number 1
[    3.577452] xhci_hcd 0000:01:00.0: hcc params 0x002841eb hci version 0x100 quirks 0x0000040000000890
[    3.587725] xhci_hcd 0000:01:00.0: xHCI Host Controller
[    3.593115] xhci_hcd 0000:01:00.0: new USB bus registered, assigned bus number 2
[    3.600693] xhci_hcd 0000:01:00.0: Host supports USB 3.0 SuperSpeed
[    3.608106] hub 1-0:1.0: USB hub found
[    3.612026] hub 1-0:1.0: 1 port detected
[    3.616819] hub 2-0:1.0: USB hub found
[    3.620726] hub 2-0:1.0: 4 ports detected
[    3.875902] usb 1-1: new high-speed USB device number 2 using xhci_hcd
[    4.008123] usb 1-1: device descriptor read/64, error -71
[    4.256088] usb 1-1: device descriptor read/64, error -71
[    4.495882] usb 1-1: new high-speed USB device number 3 using xhci_hcd
[    4.628111] usb 1-1: device descriptor read/64, error -71
[    4.872083] usb 1-1: device descriptor read/64, error -71
[    5.407888] usb 1-1: new high-speed USB device number 4 using xhci_hcd
[    6.023964] xhci_hcd 0000:01:00.0: Setup ERROR: setup address command for slot 1.
[    6.239977] xhci_hcd 0000:01:00.0: Setup ERROR: setup address command for slot 1.

This patch allows matching any address for the pci node, thus working
with both legacy and new device trees.

[1] https://lore.kernel.org/all/20210831125843.1233488-1-nsaenzju@redhat.com/

Fixes: efff29cdcd ("Platform/RaspberryPi: Always use non translating DMA in DT mode")
Signed-off-by: Adrien Thierry <athierry@redhat.com>
Reviewed-by: Jeremy Linton <jeremy.linton@arm.com>
Tested-by: Jeremy Linton <jeremy.linton@arm.com>
2022-10-10 11:14:17 +02: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
Nhi Pham
727e458d63 SbsaQemu/OemMiscLib: Fix typo of "AssetTagType02"
This fixes the typo of AssetTagType02 according to the recent changes
from OemMiscLib.h in the edk2.

Signed-off-by: Nhi Pham <nhi@os.amperecomputing.com>
Reviewed-by: Leif Lindholm <quic_llindhol@quicinc.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
2022-09-22 14:01:01 +01:00
Nhi Pham
4b5aa97715 SbsaQemu/OemMiscLib: Update for new OemMiscLib APIs
This is to reflect the new APIs added to edk2/OemMiscLib library.

Signed-off-by: Nhi Pham <nhi@os.amperecomputing.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
2022-09-22 14:00:48 +01: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
Rohit Mathew
8d8bb28d2c Platform/Sgi: Add serial debug controller to SSDT
Add a new device entry in the SSDT ACPI table to describe the serial
port used as the debug port. On the Neoverse reference design platforms,
the UART0 port of the SoC is used as the debug port.

Signed-off-by: Rohit Mathew <rohit.mathew@arm.com>
Reviewed-by: Thomas Abraham <thomas.abraham@arm.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Tested-by: Thomas Abraham <thomas.abraham@arm.com>
2022-09-15 18:05:14 +01:00
Rohit Mathew
69bd631ff5 Platform/Sgi: Update ACPI tables to use console UART
Patch 433b5b1b0f ("Platform/Sgi: Route logs to different sets of
consoles") assigns different address for the console UART and the debug
UART. Correspondingly, update the SPCR and SSDT ACPI tables to use the
address of the console UART port instead of the debug UART port.

Signed-off-by: Rohit Mathew <rohit.mathew@arm.com>
Reviewed-by: Thomas Abraham <thomas.abraham@arm.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Tested-by: Thomas Abraham <thomas.abraham@arm.com>
2022-09-15 18:04:46 +01:00
Theo Jehl
f4679715a4 QemuOpenBoardPkg: Enable stage 4
Enable MinPlatform stage 4 (OS boot) functionality.
It adds ACPI, SMBIOS and SMM drivers required for stage 4.
This should boot Windows and Linux with PIIX4 or Q35 configurations.
In the current state, SMM only works on Qemu Q35 system if you set
SMM_REQUIRED = TRUE in QemuOpenBoardPkg.dsc or via command-line.

Cc: Leif Lindholm <quic_llindhol@quicinc.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Isaac Oram <isaac.w.oram@intel.com>
Cc: Pedro Falcato <pedro.falcato@gmail.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Stefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: Theo Jehl <theojehl76@gmail.com>
Series Reviewed-by: Isaac Oram <isaac.w.oram@intel.com>
Acked-by: Michael D Kinney <michael.d.kinney@intel.com>
Series-Reviewed-by: Pedro Falcato <pedro.falcato@gmail.com>
2022-09-14 13:10:59 -07:00
Th?o Jehl
aff2bbaaf0 QemuOpenBoardPkg: Enable stage 3
This patch adds MinPlatform stage 3 (UEFI boot) functionality
Stage 3 adds DxeMain, drivers and modules necessary to reach UEFI shell.

Cc: Leif Lindholm <quic_llindhol@quicinc.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Isaac Oram <isaac.w.oram@intel.com>
Cc: Pedro Falcato <pedro.falcato@gmail.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Stefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: Theo Jehl <theojehl76@gmail.com>
Series Reviewed-by: Isaac Oram <isaac.w.oram@intel.com>
Acked-by: Michael D Kinney <michael.d.kinney@intel.com>
Series-Reviewed-by: Pedro Falcato <pedro.falcato@gmail.com>
2022-09-14 13:10:44 -07:00
Theo Jehl
76d39ba4fd QemuOpenBoardPkg: Enable stage 2
Enables MinPlatform stage 2 (memory init) functionality.

Cc: Leif Lindholm <quic_llindhol@quicinc.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Isaac Oram <isaac.w.oram@intel.com>
Cc: Pedro Falcato <pedro.falcato@gmail.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Stefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: Theo Jehl <theojehl76@gmail.com>
Series Reviewed-by: Isaac Oram <isaac.w.oram@intel.com>
Acked-by: Michael D Kinney <michael.d.kinney@intel.com>
Series-Reviewed-by: Pedro Falcato <pedro.falcato@gmail.com>
2022-09-14 13:10:26 -07:00
Theo Jehl
6966d7b001 QemuOpenBoardPkg: Add QemuOpenBoardPkg
QemuOpenBoardPkg adds a MinPlatform port to QEMU x86_64.
This port brings a starting place for understanding the MinPlatform,
and board porting.

This patch adds the base for QemuOpenBoardPkg.
It also enables MinPlatform stage 1 (debug) functionality which
includes serial debug messages.

Cc: Leif Lindholm <quic_llindhol@quicinc.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Isaac Oram <isaac.w.oram@intel.com>
Cc: Pedro Falcato <pedro.falcato@gmail.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Stefan Hajnoczi <stefanha@gmail.com>
Signed-off-by: Theo Jehl <theojehl76@gmail.com>
Series Reviewed-by: Isaac Oram <isaac.w.oram@intel.com>
Acked-by: Michael D Kinney <michael.d.kinney@intel.com>
Series-Reviewed-by: Pedro Falcato <pedro.falcato@gmail.com>
2022-09-14 13:09:31 -07:00