summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--MdeModulePkg/Library/ArmFfaLib/ArmFfaCommon.c41
-rw-r--r--RedfishPkg/Include/Library/RedfishPlatformWantedDeviceLib.h37
-rw-r--r--RedfishPkg/Library/RedfishPlatformWantedDeviceLibNull/RedfishPlatformWantedDeviceLibNull.c41
-rw-r--r--RedfishPkg/Library/RedfishPlatformWantedDeviceLibNull/RedfishPlatformWantedDeviceLibNull.inf28
-rw-r--r--RedfishPkg/RedfishPkg.dec7
-rw-r--r--RedfishPkg/RedfishPkg.dsc4
-rw-r--r--RedfishPkg/RedfishRestExDxe/RedfishRestExDriver.c23
-rw-r--r--RedfishPkg/RedfishRestExDxe/RedfishRestExDriver.h2
-rw-r--r--RedfishPkg/RedfishRestExDxe/RedfishRestExDxe.inf3
9 files changed, 152 insertions, 34 deletions
diff --git a/MdeModulePkg/Library/ArmFfaLib/ArmFfaCommon.c b/MdeModulePkg/Library/ArmFfaLib/ArmFfaCommon.c
index 8f66a4a245..1a2d8985e2 100644
--- a/MdeModulePkg/Library/ArmFfaLib/ArmFfaCommon.c
+++ b/MdeModulePkg/Library/ArmFfaLib/ArmFfaCommon.c
@@ -754,31 +754,12 @@ ArmFfaLibCommonInit (
IN VOID
)
{
- EFI_STATUS Status;
- UINT16 CurrentMajorVersion;
- UINT16 CurrentMinorVersion;
- ARM_FFA_ARGS FfaArgs;
+ EFI_STATUS Status;
+ UINT16 CurrentMajorVersion;
+ UINT16 CurrentMinorVersion;
gFfaSupported = FALSE;
- ZeroMem (&FfaArgs, sizeof (ARM_SMC_ARGS));
- FfaArgs.Arg0 = SMCCC_VERSION;
- ArmCallFfa (&FfaArgs);
- if ((INT32)FfaArgs.Arg0 < 0) {
- DEBUG ((DEBUG_ERROR, "%a: SMCCC_VERSION not supported\n", __func__));
- return EFI_UNSUPPORTED;
- }
-
- // According to SMCCC Specification v1.6 G BET0
- // Table F0-1: Changelog: Starting from SMCCC_VERSION v1.2, the interface
- // - Permits calls to use R4–R7 as return register
- // - Permits calls to use X4–X17 as return registers
- // - Permits calls to use X8–X17 as argument registers
- if ((INT32)FfaArgs.Arg0 < 0x10002) {
- DEBUG ((DEBUG_ERROR, "%a: SMCCC_VERSION %x < 1.2\n", __func__, (UINT32)FfaArgs.Arg0));
- return EFI_UNSUPPORTED;
- }
-
Status = ArmFfaLibGetVersion (
ARM_FFA_MAJOR_VERSION,
ARM_FFA_MINOR_VERSION,
@@ -789,6 +770,22 @@ ArmFfaLibCommonInit (
return EFI_UNSUPPORTED;
}
+ if ((ARM_FFA_MAJOR_VERSION != CurrentMajorVersion) ||
+ (ARM_FFA_MINOR_VERSION > CurrentMinorVersion))
+ {
+ DEBUG ((
+ DEBUG_INFO,
+ "Incompatible FF-A Versions.\n" \
+ "Request Version: Major=0x%x, Minor=0x%x.\n" \
+ "Current Version: Major=0x%x, Minor>=0x%x.\n",
+ ARM_FFA_MAJOR_VERSION,
+ ARM_FFA_MINOR_VERSION,
+ CurrentMajorVersion,
+ CurrentMinorVersion
+ ));
+ return EFI_UNSUPPORTED;
+ }
+
Status = ArmFfaLibPartitionIdGet (&gPartId);
if (EFI_ERROR (Status)) {
return Status;
diff --git a/RedfishPkg/Include/Library/RedfishPlatformWantedDeviceLib.h b/RedfishPkg/Include/Library/RedfishPlatformWantedDeviceLib.h
new file mode 100644
index 0000000000..31d4c93886
--- /dev/null
+++ b/RedfishPkg/Include/Library/RedfishPlatformWantedDeviceLib.h
@@ -0,0 +1,37 @@
+/** @file
+ Definitions of RedfishPlatformWantedDeviceLib.
+
+ Copyright (c) 2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+
+ SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#ifndef REDFISH_PLATFORM_WANTED_DEVICE_LIB_H_
+#define REDFISH_PLATFORM_WANTED_DEVICE_LIB_H_
+
+#include <Uefi.h>
+
+/**
+ This is the function to decide if input controller is the device
+ that platform want to support. By returning EFI_UNSUPPORTED to
+ caller (normally Supported function), caller should ignore this device
+ and do not provide Redfish service on this controller.
+
+ @param[in] ControllerHandle The handle of the controller to test.
+ @param[in] RemainingDevicePath A pointer to the remaining portion of a device path.
+ This is optional.
+
+ @retval EFI_SUCCESS This is the device supported by platform.
+ @retval EFI_UNSUPPORTED This device is not supported by platform.
+ @retval EFI_INVALID_PARAMETER ControllerHandle is NULL.
+
+**/
+EFI_STATUS
+EFIAPI
+IsPlatformWantedDevice (
+ IN EFI_HANDLE ControllerHandle,
+ IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL
+ );
+
+#endif
diff --git a/RedfishPkg/Library/RedfishPlatformWantedDeviceLibNull/RedfishPlatformWantedDeviceLibNull.c b/RedfishPkg/Library/RedfishPlatformWantedDeviceLibNull/RedfishPlatformWantedDeviceLibNull.c
new file mode 100644
index 0000000000..11ae0607ee
--- /dev/null
+++ b/RedfishPkg/Library/RedfishPlatformWantedDeviceLibNull/RedfishPlatformWantedDeviceLibNull.c
@@ -0,0 +1,41 @@
+/** @file
+ NULL instace of RedfishPlatformWantedDeviceLib
+
+ Copyright (c) 2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+
+ SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+#include <Library/RedfishPlatformWantedDeviceLib.h>
+
+/**
+ This is the function to decide if input controller is the device
+ that platform want to support. By returning EFI_UNSUPPORTED to
+ caller (normally Supported function), caller should ignore this device
+ and do not provide Redfish service on this controller.
+
+ @param[in] ControllerHandle The handle of the controller to test.
+ @param[in] RemainingDevicePath A pointer to the remaining portion of a device path.
+ This is optional.
+
+ @retval EFI_SUCCESS This is the device supported by platform.
+ @retval EFI_UNSUPPORTED This device is not supported by platform.
+ @retval EFI_INVALID_PARAMETER ControllerHandle is NULL.
+
+**/
+EFI_STATUS
+EFIAPI
+IsPlatformWantedDevice (
+ IN EFI_HANDLE ControllerHandle,
+ IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL
+ )
+{
+ if (ControllerHandle == NULL) {
+ return EFI_INVALID_PARAMETER;
+ }
+
+ //
+ // Always support Redfish on ControllerHandle.
+ //
+ return EFI_SUCCESS;
+}
diff --git a/RedfishPkg/Library/RedfishPlatformWantedDeviceLibNull/RedfishPlatformWantedDeviceLibNull.inf b/RedfishPkg/Library/RedfishPlatformWantedDeviceLibNull/RedfishPlatformWantedDeviceLibNull.inf
new file mode 100644
index 0000000000..1cad2950ec
--- /dev/null
+++ b/RedfishPkg/Library/RedfishPlatformWantedDeviceLibNull/RedfishPlatformWantedDeviceLibNull.inf
@@ -0,0 +1,28 @@
+## @file
+# NULL instance of RedfishPlatformWantedDeviceLib
+#
+# Copyright (c) 2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+##
+
+[Defines]
+ INF_VERSION = 0x0001000b
+ BASE_NAME = RedfishPlatformWantedDeviceLibNull
+ FILE_GUID = C5AEFFCA-3692-401E-8F82-9FFAA0622E45
+ MODULE_TYPE = DXE_DRIVER
+ VERSION_STRING = 1.0
+ LIBRARY_CLASS = RedfishPlatformWantedDeviceLib
+
+#
+# VALID_ARCHITECTURES = IA32 X64 ARM AARCH64 RISCV64
+#
+
+[Sources]
+ RedfishPlatformWantedDeviceLibNull.c
+
+[Packages]
+ MdePkg/MdePkg.dec
+ MdeModulePkg/MdeModulePkg.dec
+ RedfishPkg/RedfishPkg.dec
diff --git a/RedfishPkg/RedfishPkg.dec b/RedfishPkg/RedfishPkg.dec
index f80c6795ae..88f84adcb3 100644
--- a/RedfishPkg/RedfishPkg.dec
+++ b/RedfishPkg/RedfishPkg.dec
@@ -4,7 +4,7 @@
# Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
# (C) Copyright 2021 Hewlett Packard Enterprise Development LP<BR>
# Copyright (c) 2023, American Megatrends International LLC.
-# Copyright (c) 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+# Copyright (c) 2023-2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -75,6 +75,11 @@
#
RedfishHttpLib|Include/Library/RedfishHttpLib.h
+ ## @libraryclass Provides the library functions for platform to decide
+ # if this is the device platform supported.
+ #
+ RedfishPlatformWantedDeviceLib|Include/Library/RedfishPlatformWantedDeviceLib.h
+
[LibraryClasses.Common.Private]
## @libraryclass Provides the private C runtime library functions.
# CRT library is currently used by edk2 JsonLib (open source
diff --git a/RedfishPkg/RedfishPkg.dsc b/RedfishPkg/RedfishPkg.dsc
index 789f0408b5..5412cc23f2 100644
--- a/RedfishPkg/RedfishPkg.dsc
+++ b/RedfishPkg/RedfishPkg.dsc
@@ -4,7 +4,7 @@
# Copyright (c) 2019 - 2021, Intel Corporation. All rights reserved.<BR>
# (C) Copyright 2021 Hewlett-Packard Enterprise Development LP.
# Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.
-# Copyright (c) 2023-2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+# Copyright (c) 2023-2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
@@ -47,6 +47,7 @@
RedfishContentCodingLib|RedfishPkg/Library/RedfishContentCodingLibNull/RedfishContentCodingLibNull.inf
ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf
SortLib|MdeModulePkg/Library/UefiSortLib/UefiSortLib.inf
+ RedfishPlatformWantedDeviceLib|RedfishPkg/Library/RedfishPlatformWantedDeviceLibNull/RedfishPlatformWantedDeviceLibNull.inf
# NULL instance of IPMI related library.
IpmiLib|MdeModulePkg/Library/BaseIpmiLibNull/BaseIpmiLibNull.inf
@@ -67,5 +68,6 @@
RedfishPkg/Library/HiiUtilityLib/HiiUtilityLib.inf
RedfishPkg/Library/RedfishPlatformConfigLib/RedfishPlatformConfigLib.inf
RedfishPkg/Library/RedfishHttpLib/RedfishHttpLib.inf
+ RedfishPkg/Library/RedfishPlatformWantedDeviceLibNull/RedfishPlatformWantedDeviceLibNull.inf
!include RedfishPkg/Redfish.dsc.inc
diff --git a/RedfishPkg/RedfishRestExDxe/RedfishRestExDriver.c b/RedfishPkg/RedfishRestExDxe/RedfishRestExDriver.c
index e601bb633d..26266691eb 100644
--- a/RedfishPkg/RedfishRestExDxe/RedfishRestExDriver.c
+++ b/RedfishPkg/RedfishRestExDxe/RedfishRestExDriver.c
@@ -3,7 +3,7 @@
Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
(C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR>
- Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+ Copyright (c) 2023-2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -375,14 +375,19 @@ RedfishRestExDriverBindingSupported (
//
// Test for the HttpServiceBinding Protocol.
//
- return gBS->OpenProtocol (
- ControllerHandle,
- &gEfiHttpServiceBindingProtocolGuid,
- NULL,
- This->DriverBindingHandle,
- ControllerHandle,
- EFI_OPEN_PROTOCOL_TEST_PROTOCOL
- );
+ Status = gBS->OpenProtocol (
+ ControllerHandle,
+ &gEfiHttpServiceBindingProtocolGuid,
+ NULL,
+ This->DriverBindingHandle,
+ ControllerHandle,
+ EFI_OPEN_PROTOCOL_TEST_PROTOCOL
+ );
+ if (EFI_ERROR (Status)) {
+ return Status;
+ }
+
+ return IsPlatformWantedDevice (ControllerHandle, RemainingDevicePath);
}
/**
diff --git a/RedfishPkg/RedfishRestExDxe/RedfishRestExDriver.h b/RedfishPkg/RedfishRestExDxe/RedfishRestExDriver.h
index f0107a453f..2f081cd912 100644
--- a/RedfishPkg/RedfishRestExDxe/RedfishRestExDriver.h
+++ b/RedfishPkg/RedfishRestExDxe/RedfishRestExDriver.h
@@ -5,6 +5,7 @@
(C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR>
Copyright (c) 2023, Ampere Computing LLC. All rights reserved.<BR>
Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.<BR>
+ Copyright (c) 2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -23,6 +24,7 @@
#include <Library/HttpIoLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/NetLib.h>
+#include <Library/RedfishPlatformWantedDeviceLib.h>
#include <Library/UefiLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/UefiDriverEntryPoint.h>
diff --git a/RedfishPkg/RedfishRestExDxe/RedfishRestExDxe.inf b/RedfishPkg/RedfishRestExDxe/RedfishRestExDxe.inf
index 6da416ddb9..f951b41d9b 100644
--- a/RedfishPkg/RedfishRestExDxe/RedfishRestExDxe.inf
+++ b/RedfishPkg/RedfishRestExDxe/RedfishRestExDxe.inf
@@ -4,7 +4,7 @@
# Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
# (C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR>
# Copyright (c) 2023, American Megatrends International LLC.
-# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+# Copyright (c) 2023-2025, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -47,6 +47,7 @@
MemoryAllocationLib
NetLib
RedfishDebugLib
+ RedfishPlatformWantedDeviceLib
UefiLib
UefiBootServicesTableLib
UefiDriverEntryPoint