summaryrefslogtreecommitdiff
path: root/Platform/AMD
diff options
context:
space:
mode:
Diffstat (limited to 'Platform/AMD')
-rw-r--r--Platform/AMD/AmdMinBoardPkg/AmdMinBoardPkg.ci.yaml206
-rw-r--r--Platform/AMD/AmdMinBoardPkg/AmdMinBoardPkg.dec6
-rw-r--r--Platform/AMD/AmdMinBoardPkg/AmdMinBoardPkg.dsc34
-rw-r--r--Platform/AMD/AmdMinBoardPkg/AmdMinBoardPkg.inc.dsc23
-rw-r--r--Platform/AMD/AmdMinBoardPkg/Library/SetCacheMtrrLib/SetCacheMtrrLib.c5
5 files changed, 241 insertions, 33 deletions
diff --git a/Platform/AMD/AmdMinBoardPkg/AmdMinBoardPkg.ci.yaml b/Platform/AMD/AmdMinBoardPkg/AmdMinBoardPkg.ci.yaml
new file mode 100644
index 0000000000..dceee056c9
--- /dev/null
+++ b/Platform/AMD/AmdMinBoardPkg/AmdMinBoardPkg.ci.yaml
@@ -0,0 +1,206 @@
+## @file
+# CI configuration for AmdMinBoardPkg
+#
+# Copyright (C) 2024 - 2026 Advanced Micro Devices, Inc. All rights reserved.
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+##
+{
+ "PrEval": {
+ "DscPath": "AmdMinBoardPkg.dsc",
+ },
+ ## options defined .pytool/Plugin/LicenseCheck
+ "LicenseCheck": {
+ "IgnoreFiles": []
+ },
+ "EccCheck": {
+ ## Exception sample looks like below:
+ ## "ExceptionList": [
+ ## "<ErrorID>", "<KeyWord>"
+ ## ]
+ ## ECC runs without the full PACKAGES_PATH so it cannot resolve library
+ ## classes from external packages (MdePkg, MdeModulePkg, etc.).
+ ## This produces false-positive [10002], [10006], and [10022] errors for
+ ## every standard EDK2 library class used by modules in this package.
+ "ExceptionList": [
+ "10002", "BaseLib",
+ "10002", "BaseMemoryLib",
+ "10002", "DebugLib",
+ "10002", "DevicePathLib",
+ "10002", "DxeServicesTableLib",
+ "10002", "HobLib",
+ "10002", "IoLib",
+ "10002", "IpmiCommandLib",
+ "10002", "MemoryAllocationLib",
+ "10002", "MtrrLib",
+ "10002", "PcdLib",
+ "10002", "PeiServicesLib",
+ "10002", "PerformanceLib",
+ "10002", "PrintLib",
+ "10002", "SecBoardInitLib",
+ "10002", "Tcg2PhysicalPresenceLib",
+ "10002", "TestPointCheckLib",
+ "10002", "UefiBootManagerLib",
+ "10002", "UefiBootServicesTableLib",
+ "10002", "UefiLib",
+ "10002", "UefiRuntimeServicesTableLib",
+ "10006", "BaseLib",
+ "10006", "BaseMemoryLib",
+ "10006", "DebugLib",
+ "10006", "DevicePathLib",
+ "10006", "DxeServicesTableLib",
+ "10006", "HobLib",
+ "10006", "IoLib",
+ "10006", "IpmiCommandLib",
+ "10006", "MemoryAllocationLib",
+ "10006", "MtrrLib",
+ "10006", "PcdLib",
+ "10006", "PeiServicesLib",
+ "10006", "PerformanceLib",
+ "10006", "PrintLib",
+ "10006", "SecBoardInitLib",
+ "10006", "Tcg2PhysicalPresenceLib",
+ "10006", "TestPointCheckLib",
+ "10006", "UefiBootManagerLib",
+ "10006", "UefiBootServicesTableLib",
+ "10006", "UefiLib",
+ "10006", "UefiRuntimeServicesTableLib",
+ "10022", "BaseLib",
+ "10022", "BaseMemoryLib",
+ "10022", "DebugLib",
+ "10022", "DevicePathLib",
+ "10022", "DxeServicesTableLib",
+ "10022", "HobLib",
+ "10022", "IoLib",
+ "10022", "IpmiCommandLib",
+ "10022", "MemoryAllocationLib",
+ "10022", "MtrrLib",
+ "10022", "PcdLib",
+ "10022", "PeiServicesLib",
+ "10022", "PerformanceLib",
+ "10022", "PrintLib",
+ "10022", "SecBoardInitLib",
+ "10022", "Tcg2PhysicalPresenceLib",
+ "10022", "TestPointCheckLib",
+ "10022", "UefiBootManagerLib",
+ "10022", "UefiBootServicesTableLib",
+ "10022", "UefiLib",
+ "10022", "UefiRuntimeServicesTableLib",
+ ],
+ ## Both file path and directory path are accepted.
+ "IgnoreFiles": [
+ ]
+ },
+ ## options defined ci/Plugin/CompilerPlugin
+ "CompilerPlugin": {
+ "DscPath": "AmdMinBoardPkg.dsc"
+ },
+ ## options defined ci/Plugin/HostUnitTestCompilerPlugin
+ ## Disabled until Test/AmdMinBoardPkgHostTest.dsc (GoogleTest unit tests +
+ ## Mock library stubs) available.
+ ## below for the same reasoning.
+ "HostUnitTestCompilerPlugin-skip": {
+ "DscPath": "Test/AmdMinBoardPkgHostTest.dsc"
+ },
+
+ ## options defined ci/Plugin/CharEncodingCheck
+ "CharEncodingCheck": {
+ "IgnoreFiles": []
+ },
+
+ ## options defined ci/Plugin/DependencyCheck
+ "DependencyCheck-skip": {
+ "AcceptableDependencies": [
+ "AmdMinBoardPkg/AmdMinBoardPkg.dec",
+ "AmdPlatformPkg/AmdPlatformPkg.dec",
+ "BoardModulePkg/BoardModulePkg.dec",
+ "DynamicTablesPkg/DynamicTablesPkg.dec",
+ "IpmiFeaturePkg/IpmiFeaturePkg.dec",
+ "ManageabilityPkg/ManageabilityPkg.dec",
+ "MdeModulePkg/MdeModulePkg.dec",
+ "MdePkg/MdePkg.dec",
+ "MinPlatformPkg/MinPlatformPkg.dec",
+ "PcAtChipsetPkg/PcAtChipsetPkg.dec",
+ "SecurityPkg/SecurityPkg.dec",
+ "UefiCpuPkg/UefiCpuPkg.dec",
+ "UnitTestFrameworkPkg/UnitTestFrameworkPkg.dec",
+ "AgesaModulePkg/AgesaCommonModulePkg.dec",
+ "AgesaModulePkg/AgesaModuleNbioPkg.dec"
+ ],
+ # For host based unit tests
+ "AcceptableDependencies-HOST_APPLICATION":[
+ "UnitTestFrameworkPkg/UnitTestFrameworkPkg.dec"
+ ],
+ # For UEFI shell based apps
+ "AcceptableDependencies-UEFI_APPLICATION":[],
+ "IgnoreInf": []
+ },
+
+ ## options defined ci/Plugin/DscCompleteCheck
+ "DscCompleteCheck": {
+ "IgnoreInf": [
+ ## Per-instance BoardInitLib wrappers used only by the host unit test
+ ## DSC (AmdMinBoardPkgHostTest.dsc). These are test-only library
+ ## stubs that compile production DxeBoardInitLib sources under unique
+ ## FILE_GUIDs to avoid shared .gcda file collisions during coverage
+ ## collection. They must not appear in the main AmdMinBoardPkg.dsc.
+ "AmdMinBoardPkg/Test/GoogleTest/DxeBoardInitLib/DxeBoardInitLibGoogleTestLib.inf",
+ "AmdMinBoardPkg/Test/GoogleTest/DxeBoardInitLib/DxeBoardInitLibNoDebugGoogleTestLib.inf"
+ ],
+ "DscPath": "AmdMinBoardPkg.dsc"
+ },
+ ## options defined ci/Plugin/HostUnitTestDscCompleteCheck
+ "HostUnitTestDscCompleteCheck": {
+ # "IgnoreInf": [],
+ # "DscPath": "Test/AmdMinBoardPkgHostTest.dsc"
+ },
+
+ ## options defined ci/Plugin/GuidCheck
+ "GuidCheck": {
+ "IgnoreGuidName": [],
+ "IgnoreGuidValue": [],
+ "IgnoreFoldersAndFiles": [],
+ "IgnoreDuplicates": []
+ },
+
+ ## options defined ci/Plugin/LibraryClassCheck
+ "LibraryClassCheck": {
+ "IgnoreHeaderFile": []
+ },
+
+ ## options defined ci/Plugin/SpellCheck
+ "SpellCheck": {
+ "AuditOnly": False, # If True, only audit the files, do not fail the build
+ "IgnoreStandardPaths": [ # Standard Plugin defined paths that should be ignore
+ ## "*.c", "*.asm", "*.h", "*.nasm", "*.s", "*.asl", "*.inf"
+ ],
+ "IgnoreFiles": [ # use gitignore syntax to ignore errors in matching files
+ ],
+ "ExtendWords": [ # words to extend to the dictionary for this package
+ "acpitable",
+ "agesa",
+ "bootxxxx",
+ "coverity",
+ "lapic",
+ "pciexbar",
+ "pmioa",
+ "rdtsc"
+ ],
+ "AdditionalIncludePaths": [] # Additional paths to spell check relative to package root (wildcards supported)
+ },
+ "DebugMacroCheck": {
+ "StringSubstitutions": {
+ # Reason: Expansion of macro that contains a print specifier.
+ # AMD can write its own print specifier.
+ # "AMD_PRINT": "0x%lx"
+ }
+ },
+ "CodeQlAnalyze": {
+ "AuditOnly": False, # Fail the build if there are errors.
+ "QuerySpecifiers": "", # Query specifiers to pass to CodeQL CLI.
+ "Filters": [ # Inclusion/exclusion filters
+ "-**/MdePkg/**/*", # outside the scope of this package
+ "-**/MdeModulePkg/**/*", # outside the scope of this package
+ "-**/UnitTestFrameworkPkg/**/*" # test framework internals (cmocka, googletest)
+ ]
+ }
+}
diff --git a/Platform/AMD/AmdMinBoardPkg/AmdMinBoardPkg.dec b/Platform/AMD/AmdMinBoardPkg/AmdMinBoardPkg.dec
index e85ba67e42..09bf769839 100644
--- a/Platform/AMD/AmdMinBoardPkg/AmdMinBoardPkg.dec
+++ b/Platform/AMD/AmdMinBoardPkg/AmdMinBoardPkg.dec
@@ -4,7 +4,7 @@
# This package supports AMD processor family based board as per the MinPlatform
# Arch specification.
#
-# Copyright (c) 2023 - 2025, Advanced Micro Devices, Inc. All rights reserved.
+# Copyright (C) 2023 - 2026 Advanced Micro Devices, Inc. All rights reserved.
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
# @par Specification Reference:
@@ -56,5 +56,9 @@
gAmdMinBoardPkgTokenSpaceGuid.PcdPciExpressBaseAddressLow |0xE0000000|UINT32|0x1000000E # Lower 32 bit address of PCIe config base.
gAmdMinBoardPkgTokenSpaceGuid.PcdPciExpressBaseAddressHi |0x00000000|UINT32|0x1000000F # Upper 32 bit address of PCIe config base.
+ ## Indicates the offset and of BVM CBS Override Binary.
+ gAmdMinBoardPkgTokenSpaceGuid.PcdFlashBvmOffset |0x00021000|UINT32|0x10000010
+ gAmdMinBoardPkgTokenSpaceGuid.PcdFlashBvmSize |0x00002000|UINT32|0x10000011
+
[PcdsFixedAtBuild, PcdsPatchableInModule]
gAmdMinBoardPkgTokenSpaceGuid.PcdFlashFvAdvancedSecurityBase |0x00000000|UINT32|0x10000012
diff --git a/Platform/AMD/AmdMinBoardPkg/AmdMinBoardPkg.dsc b/Platform/AMD/AmdMinBoardPkg/AmdMinBoardPkg.dsc
index 0862abc4e2..8a9261ae7c 100644
--- a/Platform/AMD/AmdMinBoardPkg/AmdMinBoardPkg.dsc
+++ b/Platform/AMD/AmdMinBoardPkg/AmdMinBoardPkg.dsc
@@ -22,9 +22,7 @@
MinPlatformPkg/MinPlatformPkg.dec
UefiCpuPkg/UefiCpuPkg.dec
-[LibraryClasses]
- SpcrDeviceLib|AmdMinBoardPkg/Library/SpcrDeviceLib/SpcrDeviceLib.inf
- ReportFvLib|AmdMinBoardPkg/Library/PeiReportFvLib/PeiReportFvLib.inf
+!include AmdMinBoardPkg/AmdMinBoardPkg.inc.dsc
[LibraryClasses.common]
BaseLib|MdePkg/Library/BaseLib/BaseLib.inf
@@ -33,19 +31,12 @@
MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
RegisterFilterLib|MdePkg/Library/RegisterFilterLibNull/RegisterFilterLibNull.inf
+ StackCheckLib|MdePkg/Library/StackCheckLibNull/StackCheckLibNull.inf
UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf
UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf
-[LibraryClasses.common.SEC]
- PlatformSecLib|AmdMinBoardPkg/Library/PlatformSecLib/PlatformSecLib.inf
-
-[LibraryClasses.common.PEIM]
- SetCacheMtrrLib|AmdMinBoardPkg/Library/SetCacheMtrrLib/SetCacheMtrrLib.inf
- BoardInitLib|AmdMinBoardPkg/Library/PeiBoardInitPreMemLib/PeiBoardInitPreMemLib.inf
-
-[LibraryClasses.common.DXE_DRIVER]
- BoardBdsHookLib|AmdMinBoardPkg/Library/BoardBdsHookLib/BoardBdsHookLib.inf
- BoardInitLib|AmdMinBoardPkg/Library/DxeBoardInitLib/DxeBoardInitLib.inf
+[PcdsDynamicDefault]
+ gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseSize|0x10000000
[Components]
AmdMinBoardPkg/Library/SpcrDeviceLib/SpcrDeviceLib.inf
@@ -59,20 +50,3 @@
[Components.X64]
AmdMinBoardPkg/Library/BoardBdsHookLib/BoardBdsHookLib.inf
AmdMinBoardPkg/Library/DxeBoardInitLib/DxeBoardInitLib.inf
-
-# to make PcdSet64S working
-[PcdsDynamicDefault]
- gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseSize|0x10000000
-
-[BuildOptions]
- GCC:*_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES
- INTEL:*_*_*_CC_FLAGS = /D DISABLE_NEW_DEPRECATED_INTERFACES
- MSFT:*_*_*_CC_FLAGS = /D DISABLE_NEW_DEPRECATED_INTERFACES
-
- GCC:*_*_*_CC_FLAGS = -D USE_EDKII_HEADER_FILE
-
- # Turn off DEBUG messages for Release Builds
- GCC:RELEASE_*_*_CC_FLAGS = -D MDEPKG_NDEBUG
- INTEL:RELEASE_*_*_CC_FLAGS = /D MDEPKG_NDEBUG
- MSFT:RELEASE_*_*_CC_FLAGS = /D MDEPKG_NDEBUG
-
diff --git a/Platform/AMD/AmdMinBoardPkg/AmdMinBoardPkg.inc.dsc b/Platform/AMD/AmdMinBoardPkg/AmdMinBoardPkg.inc.dsc
new file mode 100644
index 0000000000..7970f3d1fb
--- /dev/null
+++ b/Platform/AMD/AmdMinBoardPkg/AmdMinBoardPkg.inc.dsc
@@ -0,0 +1,23 @@
+## @file
+# AmdMinBoardPkg.inc.dsc
+#
+# Description file for AMD AmdMinBoardPkg
+#
+# Copyright (c) 2025, Advanced Micro Devices, Inc. All rights reserved.
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+##
+
+[LibraryClasses]
+ ReportFvLib|AmdMinBoardPkg/Library/PeiReportFvLib/PeiReportFvLib.inf
+ SpcrDeviceLib|AmdMinBoardPkg/Library/SpcrDeviceLib/SpcrDeviceLib.inf
+
+[LibraryClasses.common.SEC]
+ PlatformSecLib|AmdMinBoardPkg/Library/PlatformSecLib/PlatformSecLib.inf
+
+[LibraryClasses.common.PEIM]
+ BoardInitLib|AmdMinBoardPkg/Library/PeiBoardInitPreMemLib/PeiBoardInitPreMemLib.inf
+ SetCacheMtrrLib|AmdMinBoardPkg/Library/SetCacheMtrrLib/SetCacheMtrrLib.inf
+
+[LibraryClasses.common.DXE_DRIVER]
+ BoardBdsHookLib|AmdMinBoardPkg/Library/BoardBdsHookLib/BoardBdsHookLib.inf
+ BoardInitLib|AmdMinBoardPkg/Library/DxeBoardInitLib/DxeBoardInitLib.inf
diff --git a/Platform/AMD/AmdMinBoardPkg/Library/SetCacheMtrrLib/SetCacheMtrrLib.c b/Platform/AMD/AmdMinBoardPkg/Library/SetCacheMtrrLib/SetCacheMtrrLib.c
index 06f530582c..58d3d15e8d 100644
--- a/Platform/AMD/AmdMinBoardPkg/Library/SetCacheMtrrLib/SetCacheMtrrLib.c
+++ b/Platform/AMD/AmdMinBoardPkg/Library/SetCacheMtrrLib/SetCacheMtrrLib.c
@@ -120,8 +120,9 @@ SetCacheMtrrAfterEndOfPei (
)
{
EFI_STATUS Status;
- UINT32 Mmio64Hi = 0, Mmio64Low = 0;
- UINT64 ROM3MmioBase = 0;
+ UINT32 Mmio64Hi;
+ UINT32 Mmio64Low;
+ UINT64 ROM3MmioBase;
Status = MtrrSetMemoryAttribute (
PcdGet32 (PcdFlashAreaBaseAddress),