ConfigurationManagerObject.h 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. /** @file
  2. Copyright (c) 2017 - 2022, ARM Limited. All rights reserved.
  3. SPDX-License-Identifier: BSD-2-Clause-Patent
  4. @par Glossary:
  5. - Cm or CM - Configuration Manager
  6. - Obj or OBJ - Object
  7. **/
  8. #ifndef CONFIGURATION_MANAGER_OBJECT_H_
  9. #define CONFIGURATION_MANAGER_OBJECT_H_
  10. #include <ArmNameSpaceObjects.h>
  11. #include <StandardNameSpaceObjects.h>
  12. #pragma pack(1)
  13. /** The CM_OBJECT_ID type is used to identify the Configuration Manager
  14. objects.
  15. Description of Configuration Manager Object ID
  16. _______________________________________________________________________________
  17. |31 |30 |29 |28 || 27 | 26 | 25 | 24 || 23 | 22 | 21 | 20 || 19 | 18 | 17 | 16|
  18. -------------------------------------------------------------------------------
  19. | Name Space ID || 0 | 0 | 0 | 0 || 0 | 0 | 0 | 0 || 0 | 0 | 0 | 0|
  20. _______________________________________________________________________________
  21. Bits: [31:28] - Name Space ID
  22. 0000 - Standard
  23. 0001 - ARM
  24. 1000 - Custom/OEM
  25. All other values are reserved.
  26. Bits: [27:16] - Reserved.
  27. _______________________________________________________________________________
  28. |15 |14 |13 |12 || 11 | 10 | 9 | 8 || 7 | 6 | 5 | 4 || 3 | 2 | 1 | 0|
  29. -------------------------------------------------------------------------------
  30. | 0 | 0 | 0 | 0 || 0 | 0 | 0 | 0 || Object ID |
  31. _______________________________________________________________________________
  32. Bits: [15:8] - Are reserved and must be zero.
  33. Bits: [7:0] - Object ID
  34. Object ID's in the Standard Namespace:
  35. 0 - Configuration Manager Revision
  36. 1 - ACPI Table List
  37. 2 - SMBIOS Table List
  38. Object ID's in the ARM Namespace:
  39. 0 - Reserved
  40. 1 - Boot Architecture Info
  41. 2 - CPU Info
  42. 3 - Power Management Profile Info
  43. 4 - GICC Info
  44. 5 - GICD Info
  45. 6 - GIC MSI Frame Info
  46. 7 - GIC Redistributor Info
  47. 8 - GIC ITS Info
  48. 9 - Serial Console Port Info
  49. 10 - Serial Debug Port Info
  50. 11 - Generic Timer Info
  51. 12 - Platform GT Block Info
  52. 13 - Generic Timer Block Frame Info
  53. 14 - Platform Generic Watchdog
  54. 15 - PCI Configuration Space Info
  55. 16 - Hypervisor Vendor Id
  56. 17 - Fixed feature flags for FADT
  57. 18 - ITS Group
  58. 19 - Named Component
  59. 20 - Root Complex
  60. 21 - SMMUv1 or SMMUv2
  61. 22 - SMMUv3
  62. 23 - PMCG
  63. 24 - GIC ITS Identifier Array
  64. 25 - ID Mapping Array
  65. 26 - SMMU Interrupt Array
  66. 27 - Processor Hierarchy Info
  67. 28 - Cache Info
  68. 29 - Processor Hierarchy Node ID Info
  69. 30 - CM Object Reference
  70. */
  71. typedef UINT32 CM_OBJECT_ID;
  72. //
  73. // Helper macro to format a CM_OBJECT_ID.
  74. //
  75. #define FMT_CM_OBJECT_ID "0x%lx"
  76. /** A mask for Object ID
  77. */
  78. #define OBJECT_ID_MASK 0xFF
  79. /** A mask for Namespace ID
  80. */
  81. #define NAMESPACE_ID_MASK 0xF
  82. /** Starting bit position for Namespace ID
  83. */
  84. #define NAMESPACE_ID_BIT_SHIFT 28
  85. /** The EOBJECT_NAMESPACE_ID enum describes the defined namespaces
  86. for the Configuration Manager Objects.
  87. */
  88. typedef enum ObjectNameSpaceID {
  89. EObjNameSpaceStandard, ///< Standard Objects Namespace
  90. EObjNameSpaceArm, ///< ARM Objects Namespace
  91. EObjNameSpaceOem = 0x8, ///< OEM Objects Namespace
  92. EObjNameSpaceMax
  93. } EOBJECT_NAMESPACE_ID;
  94. /** A descriptor for Configuration Manager Objects.
  95. The Configuration Manager Protocol interface uses this descriptor
  96. to return the Configuration Manager Objects.
  97. */
  98. typedef struct CmObjDescriptor {
  99. /// Object Id
  100. CM_OBJECT_ID ObjectId;
  101. /// Size of the described Object or Object List
  102. UINT32 Size;
  103. /// Pointer to the described Object or Object List
  104. VOID *Data;
  105. /// Count of objects in the list
  106. UINT32 Count;
  107. } CM_OBJ_DESCRIPTOR;
  108. #pragma pack()
  109. /** This macro returns the namespace ID from the CmObjectID.
  110. @param [in] CmObjectId The Configuration Manager Object ID.
  111. @retval Returns the Namespace ID corresponding to the CmObjectID.
  112. **/
  113. #define GET_CM_NAMESPACE_ID(CmObjectId) \
  114. (((CmObjectId) >> NAMESPACE_ID_BIT_SHIFT) & \
  115. NAMESPACE_ID_MASK)
  116. /** This macro returns the Object ID from the CmObjectID.
  117. @param [in] CmObjectId The Configuration Manager Object ID.
  118. @retval Returns the Object ID corresponding to the CmObjectID.
  119. **/
  120. #define GET_CM_OBJECT_ID(CmObjectId) ((CmObjectId) & OBJECT_ID_MASK)
  121. /** This macro returns a Configuration Manager Object ID
  122. from the NameSpace ID and the ObjectID.
  123. @param [in] NameSpaceId The namespace ID for the Object.
  124. @param [in] ObjectId The Object ID.
  125. @retval Returns the Configuration Manager Object ID.
  126. **/
  127. #define CREATE_CM_OBJECT_ID(NameSpaceId, ObjectId) \
  128. ((((NameSpaceId) & NAMESPACE_ID_MASK) << NAMESPACE_ID_BIT_SHIFT) | \
  129. ((ObjectId) & OBJECT_ID_MASK))
  130. /** This macro returns a Configuration Manager Object ID
  131. in the Standard Object Namespace.
  132. @param [in] ObjectId The Object ID.
  133. @retval Returns a Standard Configuration Manager Object ID.
  134. **/
  135. #define CREATE_CM_STD_OBJECT_ID(ObjectId) \
  136. (CREATE_CM_OBJECT_ID (EObjNameSpaceStandard, ObjectId))
  137. /** This macro returns a Configuration Manager Object ID
  138. in the ARM Object Namespace.
  139. @param [in] ObjectId The Object ID.
  140. @retval Returns an ARM Configuration Manager Object ID.
  141. **/
  142. #define CREATE_CM_ARM_OBJECT_ID(ObjectId) \
  143. (CREATE_CM_OBJECT_ID (EObjNameSpaceArm, ObjectId))
  144. /** This macro returns a Configuration Manager Object ID
  145. in the OEM Object Namespace.
  146. @param [in] ObjectId The Object ID.
  147. @retval Returns an OEM Configuration Manager Object ID.
  148. **/
  149. #define CREATE_CM_OEM_OBJECT_ID(ObjectId) \
  150. (CREATE_CM_OBJECT_ID (EObjNameSpaceOem, ObjectId))
  151. #endif // CONFIGURATION_MANAGER_OBJECT_H_