public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Sami Mujawar <sami.mujawar@arm.com>
To: edk2-devel@lists.01.org
Cc: alexei.fedorov@arm.com, leif.lindholm@linaro.org,
	Matteo.Carlini@arm.com,  Stephanie.Hughes-Fitt@arm.com,
	nd@arm.com
Subject: [PATCH v2 08/22] DynamicTablesPkg: Configuration Manager Objects
Date: Thu, 24 Jan 2019 15:44:22 +0000	[thread overview]
Message-ID: <20190124154436.21996-9-sami.mujawar@arm.com> (raw)
In-Reply-To: <20190124154436.21996-1-sami.mujawar@arm.com>

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>
---
 DynamicTablesPkg/Include/ConfigurationManagerObject.h | 182 ++++++++++++++++++++
 1 file changed, 182 insertions(+)

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




  parent reply	other threads:[~2019-01-24 15:44 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-24 15:44 [PATCH v2 00/22] DynamicTablesPkg: Introduce Dynamic Tables Framework Sami Mujawar
2019-01-24 15:44 ` [PATCH v2 01/22] DynamicTablesPkg: " Sami Mujawar
2019-01-24 15:44 ` [PATCH v2 02/22] DynamicTablesPkg: Table Generator definition Sami Mujawar
2019-01-24 15:44 ` [PATCH v2 03/22] DynamicTablesPkg: Acpi Table Generator Sami Mujawar
2019-01-24 15:44 ` [PATCH v2 04/22] DynamicTablesPkg: SMBIOS " Sami Mujawar
2019-01-24 15:44 ` [PATCH v2 05/22] DynamicTablesPkg: DT " Sami Mujawar
2019-01-24 15:44 ` [PATCH v2 06/22] DynamicTablesPkg: Standard NameSpace Objects Sami Mujawar
2019-01-24 15:44 ` [PATCH v2 07/22] DynamicTablesPkg: Arm " Sami Mujawar
2019-01-24 15:44 ` Sami Mujawar [this message]
2019-01-24 15:44 ` [PATCH v2 09/22] DynamicTablesPkg: Configuration Manager Protocol Sami Mujawar
2019-01-24 15:44 ` [PATCH v2 10/22] DynamicTablesPkg: Configuration Manager Helper Sami Mujawar
2019-01-24 15:44 ` [PATCH v2 11/22] DynamicTablesPkg: Table Helper Library Sami Mujawar
2019-01-24 15:44 ` [PATCH v2 12/22] DynamicTablesPkg: Dynamic Table Factory Protocol Sami Mujawar
2019-01-24 15:44 ` [PATCH v2 13/22] DynamicTablesPkg: Dynamic Table Factory Dxe Sami Mujawar
2019-01-24 15:44 ` [PATCH v2 14/22] DynamicTablesPkg: Dynamic Table Manager Dxe Sami Mujawar
2019-01-24 15:44 ` [PATCH v2 15/22] DynamicTablesPkg: Arm Raw/DSDT/SSDT Generator Sami Mujawar
2019-01-24 15:44 ` [PATCH v2 16/22] DynamicTablesPkg: Arm ACPI FADT Generator Sami Mujawar
2019-01-24 15:44 ` [PATCH v2 17/22] DynamicTablesPkg: Arm ACPI MADT Generator Sami Mujawar
2019-01-24 15:44 ` [PATCH v2 18/22] DynamicTablesPkg: Arm ACPI GTDT Generator Sami Mujawar
2019-01-24 15:44 ` [PATCH v2 19/22] DynamicTablesPkg: Arm SPCR Table Generator Sami Mujawar
2019-01-24 15:44 ` [PATCH v2 20/22] DynamicTablesPkg: Arm DBG2 " Sami Mujawar
2019-01-24 15:44 ` [PATCH v2 21/22] DynamicTablesPkg: Arm PCI MCFG " Sami Mujawar
2019-01-24 15:44 ` [PATCH v2 22/22] DynamicTablesPkg: Arm IORT " Sami Mujawar
2019-01-29 11:27 ` [PATCH v2 00/22] DynamicTablesPkg: Introduce Dynamic Tables Framework Alexei Fedorov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190124154436.21996-9-sami.mujawar@arm.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox