ArmScmiPerformanceProtocolPrivate.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /** @file
  2. Copyright (c) 2017-2021, Arm Limited. All rights reserved.
  3. SPDX-License-Identifier: BSD-2-Clause-Patent
  4. System Control and Management Interface V1.0
  5. http://infocenter.arm.com/help/topic/com.arm.doc.den0056a/
  6. DEN0056A_System_Control_and_Management_Interface.pdf
  7. **/
  8. #ifndef ARM_SCMI_PERFORMANCE_PROTOCOL_PRIVATE_H_
  9. #define ARM_SCMI_PERFORMANCE_PROTOCOL_PRIVATE_H_
  10. #include <Protocol/ArmScmiPerformanceProtocol.h>
  11. // Number of performance levels returned by a call to the SCP, Lvls Bits[11:0]
  12. #define NUM_PERF_LEVELS_MASK 0x0FFF
  13. #define NUM_PERF_LEVELS(Lvls) (Lvls & NUM_PERF_LEVELS_MASK)
  14. // Number of performance levels remaining after a call to the SCP, Lvls Bits[31:16]
  15. #define NUM_REMAIN_PERF_LEVELS_SHIFT 16
  16. #define NUM_REMAIN_PERF_LEVELS(Lvls) (Lvls >> NUM_REMAIN_PERF_LEVELS_SHIFT)
  17. /** Return values for ScmiMessageIdPerformanceDescribeLevels command.
  18. SCMI Spec section 4.5.2.5
  19. **/
  20. typedef struct {
  21. UINT32 NumLevels;
  22. // NOTE: Since EDK2 does not allow flexible array member [] we declare
  23. // here array of 1 element length. However below is used as a variable
  24. // length array.
  25. SCMI_PERFORMANCE_LEVEL PerfLevel[1]; // Offset to array of performance levels
  26. } PERF_DESCRIBE_LEVELS;
  27. /** Initialize performance management protocol and install on a given Handle.
  28. @param[in] Handle Handle to install performance management
  29. protocol.
  30. @retval EFI_SUCCESS Performance protocol installed successfully.
  31. **/
  32. EFI_STATUS
  33. ScmiPerformanceProtocolInit (
  34. IN EFI_HANDLE* Handle
  35. );
  36. #endif /* ARM_SCMI_PERFORMANCE_PROTOCOL_PRIVATE_H_ */