diff options
-rw-r--r-- | ArmPkg/Drivers/ArmScmiDxe/Scmi.c | 5 | ||||
-rw-r--r-- | ArmPkg/Drivers/ArmScmiDxe/ScmiDxe.c | 27 | ||||
-rw-r--r-- | ArmPkg/Drivers/ArmScmiDxe/ScmiDxe.h | 1 |
3 files changed, 21 insertions, 12 deletions
diff --git a/ArmPkg/Drivers/ArmScmiDxe/Scmi.c b/ArmPkg/Drivers/ArmScmiDxe/Scmi.c index 1e279f6..d247d3a 100644 --- a/ArmPkg/Drivers/ArmScmiDxe/Scmi.c +++ b/ArmPkg/Drivers/ArmScmiDxe/Scmi.c @@ -22,11 +22,6 @@ #include "ScmiPrivate.h"
-// SCMI Specification 1.0
-#define MAX_PROTOCOLS 6
-
-#define PROTOCOL_MASK 0xF
-
// Arbitrary timeout value 20ms.
#define RESPONSE_TIMEOUT 20000
diff --git a/ArmPkg/Drivers/ArmScmiDxe/ScmiDxe.c b/ArmPkg/Drivers/ArmScmiDxe/ScmiDxe.c index a56c7b2..0400799 100644 --- a/ArmPkg/Drivers/ArmScmiDxe/ScmiDxe.c +++ b/ArmPkg/Drivers/ArmScmiDxe/ScmiDxe.c @@ -63,8 +63,8 @@ ArmScmiDxeEntryPoint ( UINT32 Index;
UINT32 NumProtocols;
UINT32 ProtocolIndex;
- UINT8 SupportedList[MAX_PROTOCOLS];
- UINT32 SupportedListSize = sizeof (SupportedList);
+ UINT8 *SupportedList;
+ UINT32 SupportedListSize;
// Every SCMI implementation must implement the base protocol.
ASSERT (Protocols[0].Id == SCMI_PROTOCOL_ID_BASE);
@@ -108,13 +108,26 @@ ArmScmiDxeEntryPoint ( ASSERT (NumProtocols != 0);
+ SupportedListSize = (NumProtocols * sizeof (*SupportedList));
+
+ Status = gBS->AllocatePool (
+ EfiBootServicesData,
+ SupportedListSize,
+ (VOID**)&SupportedList
+ );
+ if (EFI_ERROR (Status)) {
+ ASSERT (FALSE);
+ return Status;
+ }
+
// Get the list of protocols supported by SCP firmware on the platform.
Status = BaseProtocol->DiscoverListProtocols (
- BaseProtocol,
- &SupportedListSize,
- SupportedList
- );
+ BaseProtocol,
+ &SupportedListSize,
+ SupportedList
+ );
if (EFI_ERROR (Status)) {
+ gBS->FreePool (SupportedList);
ASSERT (FALSE);
return Status;
}
@@ -134,5 +147,7 @@ ArmScmiDxeEntryPoint ( }
}
+ gBS->FreePool (SupportedList);
+
return EFI_SUCCESS;
}
diff --git a/ArmPkg/Drivers/ArmScmiDxe/ScmiDxe.h b/ArmPkg/Drivers/ArmScmiDxe/ScmiDxe.h index 222e54f..c9a9072 100644 --- a/ArmPkg/Drivers/ArmScmiDxe/ScmiDxe.h +++ b/ArmPkg/Drivers/ArmScmiDxe/ScmiDxe.h @@ -19,7 +19,6 @@ #include "ScmiPrivate.h"
-#define MAX_PROTOCOLS 6
#define MAX_VENDOR_LEN SCMI_MAX_STR_LEN
/** Pointer to protocol initialization function.
|