]> git.proxmox.com Git - mirror_edk2.git/commitdiff
DynamicTablesPkg: Configuration Manager Objects
authorSami Mujawar <sami.mujawar@arm.com>
Sat, 15 Dec 2018 11:59:07 +0000 (11:59 +0000)
committerSami Mujawar <sami.mujawar@arm.com>
Tue, 19 Feb 2019 10:37:29 +0000 (10:37 +0000)
The dynamic tables frameworks core communicates with the
platform specific implementation using the configuration
manager protocol interface. The dynamic tables framework
core uses this interface to retrieve information required
for generating the firmware tables. This information is
represented in the form of objects, which are classified
as standard namespace objects, Arm namespace objects or
as Custom/OEM namespace objects.

The configuration manager objects provides a convenient
way for wrapping up the namespaces using a well defined
configuration manager object Id.

The configuration manager is a platform specific component
that collates the platform information required for generating
firmware tables and represents them as configuration manager
objects.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
Reviewed-by: Alexei Fedorov <alexei.fedorov@arm.com>
DynamicTablesPkg/Include/ConfigurationManagerObject.h [new file with mode: 0644]

diff --git a/DynamicTablesPkg/Include/ConfigurationManagerObject.h b/DynamicTablesPkg/Include/ConfigurationManagerObject.h
new file mode 100644 (file)
index 0000000..ad67e1c
--- /dev/null
@@ -0,0 +1,182 @@
+/** @file\r
+\r
+  Copyright (c) 2017 - 2019, ARM Limited. All rights reserved.\r
+\r
+  This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+  @par Glossary:\r
+    - Cm or CM   - Configuration Manager\r
+    - Obj or OBJ - Object\r
+**/\r
+\r
+#ifndef CONFIGURATION_MANAGER_OBJECT_H_\r
+#define CONFIGURATION_MANAGER_OBJECT_H_\r
+\r
+#include <ArmNameSpaceObjects.h>\r
+#include <StandardNameSpaceObjects.h>\r
+\r
+#pragma pack(1)\r
+\r
+/** The CM_OBJECT_ID type is used to identify the Configuration Manager\r
+    objects.\r
+\r
+ Description of Configuration Manager Object ID\r
+_______________________________________________________________________________\r
+|31 |30 |29 |28 || 27 | 26 | 25 | 24 || 23 | 22 | 21 | 20 || 19 | 18 | 17 | 16|\r
+-------------------------------------------------------------------------------\r
+| Name Space ID ||  0 |  0 |  0 |  0 ||  0 |  0 |  0 |  0 ||  0 |  0 |  0 |  0|\r
+_______________________________________________________________________________\r
+\r
+Bits: [31:28] - Name Space ID\r
+                0000 - Standard\r
+                0001 - ARM\r
+                1000 - Custom/OEM\r
+                All other values are reserved.\r
+\r
+Bits: [27:16] - Reserved.\r
+_______________________________________________________________________________\r
+|15 |14 |13 |12 || 11 | 10 |  9 |  8 ||  7 |  6 |  5 |  4 ||  3 |  2 |  1 |  0|\r
+-------------------------------------------------------------------------------\r
+| 0 | 0 | 0 | 0 ||  0 |  0 |  0 |  0 ||                 Object ID             |\r
+_______________________________________________________________________________\r
+\r
+Bits: [15:8] - Are reserved and must be zero.\r
+\r
+Bits: [7:0] - Object ID\r
+\r
+Object ID's in the Standard Namespace:\r
+  0 - Configuration Manager Revision\r
+  1 - ACPI Table List\r
+  2 - SMBIOS Table List\r
+\r
+Object ID's in the ARM Namespace:\r
+   0 - Reserved\r
+   1 - Boot Architecture Info\r
+   2 - CPU Info\r
+   3 - Power Management Profile Info\r
+   4 - GICC Info\r
+   5 - GICD Info\r
+   6 - GIC MSI Frame Info\r
+   7 - GIC Redistributor Info\r
+   8 - GIC ITS Info\r
+   9 - Serial Console Port Info\r
+  10 - Serial Debug Port Info\r
+  11 - Generic Timer Info\r
+  12 - Platform GT Block Info\r
+  13 - Platform Generic Watchdog\r
+  14 - PCI Configuration Space Info\r
+  15 - Hypervisor Vendor Id\r
+  16 - Fixed feature flags for FADT\r
+*/\r
+typedef UINT32  CM_OBJECT_ID;\r
+\r
+/** A mask for Object ID\r
+*/\r
+#define OBJECT_ID_MASK            0xFF\r
+\r
+/** A mask for Namespace ID\r
+*/\r
+#define NAMESPACE_ID_MASK         0xF\r
+\r
+/** Starting bit position for Namespace ID\r
+*/\r
+#define NAMESPACE_ID_BIT_SHIFT    28\r
+\r
+/** The EOBJECT_NAMESPACE_ID enum describes the defined namespaces\r
+    for the Configuration Manager Objects.\r
+*/\r
+typedef enum ObjectNameSpaceID {\r
+  EObjNameSpaceStandard,      ///< Standard Objects Namespace\r
+  EObjNameSpaceArm,           ///< ARM Objects Namespace\r
+  EObjNameSpaceOem = 0x8,     ///< OEM Objects Namespace\r
+  EObjNameSpaceMax\r
+} EOBJECT_NAMESPACE_ID;\r
+\r
+/** A descriptor for Configuration Manager Objects.\r
+\r
+  The Configuration Manager Protocol interface uses this descriptor\r
+  to return the Configuration Manager Objects.\r
+*/\r
+typedef struct CmObjDescriptor {\r
+  /// Object Id\r
+  CM_OBJECT_ID  ObjectId;\r
+\r
+  /// Size of the described Object or Object List\r
+  UINT32        Size;\r
+\r
+  /// Pointer to the described Object or Object List\r
+  VOID        * Data;\r
+\r
+  /// Count of objects in the list\r
+  UINT32        Count;\r
+} CM_OBJ_DESCRIPTOR;\r
+\r
+#pragma pack()\r
+\r
+/** This macro returns the namespace ID from the CmObjectID.\r
+\r
+  @param [in] CmObjectId  The Configuration Manager Object ID.\r
+\r
+  @retval Returns the Namespace ID corresponding to the CmObjectID.\r
+**/\r
+#define GET_CM_NAMESPACE_ID(CmObjectId)               \\r
+          (((CmObjectId) >> NAMESPACE_ID_BIT_SHIFT) & \\r
+            NAMESPACE_ID_MASK)\r
+\r
+/** This macro returns the Object ID from the CmObjectID.\r
+\r
+  @param [in] CmObjectId  The Configuration Manager Object ID.\r
+\r
+  @retval Returns the Object ID corresponding to the CmObjectID.\r
+**/\r
+#define GET_CM_OBJECT_ID(CmObjectId)    ((CmObjectId) & OBJECT_ID_MASK)\r
+\r
+/** This macro returns a Configuration Manager Object ID\r
+    from the NameSpace ID and the ObjectID.\r
+\r
+  @param [in] NameSpaceId The namespace ID for the Object.\r
+  @param [in] ObjectId    The Object ID.\r
+\r
+  @retval Returns the Configuration Manager Object ID.\r
+**/\r
+#define CREATE_CM_OBJECT_ID(NameSpaceId, ObjectId)                           \\r
+          ((((NameSpaceId) & NAMESPACE_ID_MASK) << NAMESPACE_ID_BIT_SHIFT) | \\r
+            ((ObjectId) & OBJECT_ID_MASK))\r
+\r
+/** This macro returns a Configuration Manager Object ID\r
+    in the Standard Object Namespace.\r
+\r
+  @param [in] ObjectId    The Object ID.\r
+\r
+  @retval Returns a Standard Configuration Manager Object ID.\r
+**/\r
+#define CREATE_CM_STD_OBJECT_ID(ObjectId) \\r
+          (CREATE_CM_OBJECT_ID (EObjNameSpaceStandard, ObjectId))\r
+\r
+/** This macro returns a Configuration Manager Object ID\r
+    in the ARM Object Namespace.\r
+\r
+  @param [in] ObjectId    The Object ID.\r
+\r
+  @retval Returns an ARM Configuration Manager Object ID.\r
+**/\r
+#define CREATE_CM_ARM_OBJECT_ID(ObjectId) \\r
+          (CREATE_CM_OBJECT_ID (EObjNameSpaceArm, ObjectId))\r
+\r
+/** This macro returns a Configuration Manager Object ID\r
+    in the OEM Object Namespace.\r
+\r
+  @param [in] ObjectId    The Object ID.\r
+\r
+  @retval Returns an OEM Configuration Manager Object ID.\r
+**/\r
+#define CREATE_CM_OEM_OBJECT_ID(ObjectId) \\r
+          (CREATE_CM_OBJECT_ID (EObjNameSpaceOem, ObjectId))\r
+\r
+#endif // CONFIGURATION_MANAGER_OBJECT_H_\r