public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Chang, Abner" <abner.chang@amd.com>
To: <devel@edk2.groups.io>
Cc: Michael D Kinney <michael.d.kinney@intel.com>,
	Liming Gao <gaoliming@byosoft.com.cn>,
	Zhiguang Liu <zhiguang.liu@intel.com>,
	"Nickle Wang" <nicklew@nvidia.com>,
	Igor Kulchytskyy <igork@ami.com>,
	Isaac Oram <isaac.w.oram@intel.com>,
	Abdul Lateef Attar <AbdulLateef.Attar@amd.com>
Subject: [PATCH] MdePkg/Include: Add DMTF PLDM SMBIOS definitions
Date: Sun, 2 Apr 2023 09:56:45 +0800	[thread overview]
Message-ID: <20230402015645.819-1-abner.chang@amd.com> (raw)

From: Abner Chang <abner.chang@amd.com>

BZ #4396
This change adds definitions for DMTF PLDM
SMBIOS Transfer specification.

Spec ref:
https://www.dmtf.org/sites/default/files/standards/documents/DSP0246_1.0.1.pdf

Signed-off-by: Abner Chang <abner.chang@amd.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Zhiguang Liu <zhiguang.liu@intel.com>
Cc: Nickle Wang <nicklew@nvidia.com>
Cc: Igor Kulchytskyy <igork@ami.com>
Cc: Isaac Oram <isaac.w.oram@intel.com>
Cc: Abdul Lateef Attar <AbdulLateef.Attar@amd.com>
---
 .../IndustryStandard/PldmSmbiosTransfer.h     | 182 ++++++++++++++++++
 1 file changed, 182 insertions(+)
 create mode 100644 MdePkg/Include/IndustryStandard/PldmSmbiosTransfer.h

diff --git a/MdePkg/Include/IndustryStandard/PldmSmbiosTransfer.h b/MdePkg/Include/IndustryStandard/PldmSmbiosTransfer.h
new file mode 100644
index 00000000000..2fcbe116abe
--- /dev/null
+++ b/MdePkg/Include/IndustryStandard/PldmSmbiosTransfer.h
@@ -0,0 +1,182 @@
+/**
+  The definitions of DMTF Platform Level Data Model (PLDM)
+  SMBIOS Transfer Specification.
+
+  Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+  @par Revision Reference:
+  DMTF Platform Level Data Model (PLDM) SMBIOS Transfer Specification
+  Version 1.0.1
+  https://www.dmtf.org/sites/default/files/standards/documents/DSP0246_1.0.1.pdf
+
+**/
+
+#ifndef PLDM_SMBIOS_H_
+#define PLDM_SMBIOS_H_
+
+#include <IndustryStandard/Pldm.h>
+
+#pragma pack(1)
+
+///
+/// Smbios-related definitions from PLDM for SMBIOS Transfer
+/// Specification (DMTF DSP0246)
+///
+#define PLDM_GET_SMBIOS_STRUCTURE_TABLE_METADATA_COMMAND_CODE  0x01
+#define PLDM_SET_SMBIOS_STRUCTURE_TABLE_METADATA_COMMAND_CODE  0x02
+#define PLDM_GET_SMBIOS_STRUCTURE_TABLE_COMMAND_CODE           0x03
+#define PLDM_SET_SMBIOS_STRUCTURE_TABLE_COMMAND_CODE           0x04
+#define PLDM_GET_SMBIOS_STRUCTURE_BY_TYPE_COMMAND_CODE         0x05
+#define PLDM_GET_SMBIOS_STRUCTURE_BY_HANDLE_COMMAND_CODE       0x06
+
+///
+/// PLDM SMBIOS transfer command specific completion code.
+///
+#define PLDM_COMPLETION_CODE_INVALID_DATA_TRANSFER_HANDLE        0x80
+#define PLDM_COMPLETION_CODE_INVALID_TRANSFER_OPERATION_FLAG     0x81
+#define PLDM_COMPLETION_CODE_INVALID_TRANSFER_FLAG               0x82
+#define PLDM_COMPLETION_CODE_NO_SMBIOS_STRUCTURE_TABLE_METADATA  0x83
+#define PLDM_COMPLETION_CODE_INVALID_DATA_INTEGRITY_CHECK        0x84
+#define PLDM_COMPLETION_CODE_SMBIOS_STRUCTURE_TABLE_UNAVAILABLE  0x85
+
+///
+/// Get SMBIOS Structure Table Metadata Response.
+///
+typedef struct {
+  UINT8     SmbiosMajorVersion;
+  UINT8     SmbiosMinorVersion;
+  UINT16    MaximumStructureSize;
+  UINT16    SmbiosStructureTableLength;
+  UINT16    NumberOfSmbiosStructures;
+  UINT32    SmbiosStructureTableIntegrityChecksum;
+} PLDM_SMBIOS_STRUCTURE_TABLE_METADATA;
+
+typedef struct {
+  PLDM_RESPONSE_HEADER                    ResponseHeader;
+  PLDM_SMBIOS_STRUCTURE_TABLE_METADATA    SmbiosStructureTableMetadata;
+} PLDM_GET_SMBIOS_STRUCTURE_TABLE_METADATA_RESPONSE_FORMAT;
+
+///
+/// Set SMBIOS Structure Table Metadata Request.
+///
+typedef struct {
+  PLDM_REQUEST_HEADER                     RequestHeader;
+  PLDM_SMBIOS_STRUCTURE_TABLE_METADATA    SmbiosStructureTableMetadata;
+} PLDM_SET_SMBIOS_STRUCTURE_TABLE_METADATA_REQUEST_FORMAT;
+
+///
+/// Set SMBIOS Structure Table Metadata Response.
+///
+typedef struct {
+  PLDM_RESPONSE_HEADER    ResponseHeader;
+} PLDM_SET_SMBIOS_STRUCTURE_TABLE_METADATA_RESPONSE_FORMAT;
+
+///
+/// Get SMBIOS Structure Table Request.
+///
+typedef struct {
+  UINT32    DataTransferHandle;
+  UINT8     TransferOperationFlag;
+} PLDM_GET_SMBIOS_STRUCTURE_TABLE_REQUEST;
+
+typedef struct {
+  PLDM_REQUEST_HEADER                        RequestHeader;
+  PLDM_GET_SMBIOS_STRUCTURE_TABLE_REQUEST    GetSmbiosStructureTableRequest;
+} PLDM_GET_SMBIOS_STRUCTURE_TABLE_REQUEST_FORMAT;
+
+///
+/// Get SMBIOS Structure Table Response.
+///
+typedef struct {
+  UINT32    NextDataTransferHandle;
+  UINT8     TransferFlag;
+  UINT8     Table[0];
+} PLDM_GET_SMBIOS_STRUCTURE_TABLE_RESPONSE;
+
+typedef struct {
+  PLDM_RESPONSE_HEADER                        ResponseHeader;
+  PLDM_GET_SMBIOS_STRUCTURE_TABLE_RESPONSE    GetSmbiosStructureTableResponse;
+} PLDM_GET_SMBIOS_STRUCTURE_TABLE_RESPONSE_FORMAT;
+
+///
+/// Set SMBIOS Structure Table Request.
+///
+typedef struct {
+  UINT32    DataTransferHandle;
+  UINT8     TransferFlag;
+  UINT8     Table[0];
+} PLDM_SET_SMBIOS_STRUCTURE_TABLE_REQUEST;
+
+typedef struct {
+  PLDM_REQUEST_HEADER                        RequestHeader;
+  PLDM_SET_SMBIOS_STRUCTURE_TABLE_REQUEST    SetSmbiosStructureTableRequest;
+} PLDM_SET_SMBIOS_STRUCTURE_TABLE_REQUEST_FORMAT;
+
+///
+/// Set SMBIOS Structure Table Response.
+///
+typedef struct {
+  PLDM_RESPONSE_HEADER    ResponseHeader;
+  UINT32                  NextDataTransferHandle;
+} PLDM_SET_SMBIOS_STRUCTURE_TABLE_RESPONSE_FORMAT;
+
+///
+/// Get SMBIOS Structure by Type Request.
+///
+typedef struct {
+  UINT32    DataTransferHandle;
+  UINT8     TransferOperationFlag;
+  UINT8     Type;
+  UINT16    StructureInstanceId;
+} PLDM_GET_SMBIOS_STRUCTURE_BY_TYPE_REQUEST;
+
+typedef struct {
+  PLDM_REQUEST_HEADER                          RequestHeader;
+  PLDM_GET_SMBIOS_STRUCTURE_BY_TYPE_REQUEST    GetSmbiosStructureByTypeRequest;
+} PLDM_GET_SMBIOS_STRUCTURE_BY_TYPE_REQUEST_FORMAT;
+
+///
+/// Get SMBIOS Structure by Type Response.
+///
+typedef struct {
+  UINT32    NextDataTransferHandle;
+  UINT8     TransferFlag;
+  UINT8     Table[0];
+} PLDM_GET_SMBIOS_STRUCTURE_BY_TYPE_RESPONSE;
+
+typedef struct {
+  PLDM_RESPONSE_HEADER                          ResponseHeader;
+  PLDM_GET_SMBIOS_STRUCTURE_BY_TYPE_RESPONSE    GetSmbiosStructureByTypeResponse;
+} PLDM_GET_SMBIOS_STRUCTURE_BY_TYPE_RESPONSE_FORMAT;
+
+///
+/// Get SMBIOS Structure by Handle Request.
+///
+typedef struct {
+  UINT32    DataTransferHandle;
+  UINT8     TransferOperationFlag;
+  UINT16    Handle;
+} PLDM_GET_SMBIOS_STRUCTURE_BY_HANDLE_REQUEST;
+
+typedef struct {
+  PLDM_REQUEST_HEADER                            RequestHeader;
+  PLDM_GET_SMBIOS_STRUCTURE_BY_HANDLE_REQUEST    GetSmbiosStructureByHandleRequest;
+} PLDM_GET_SMBIOS_STRUCTURE_BY_HANDLE_REQUEST_FORMAT;
+
+///
+/// Get SMBIOS Structure by Handle Response.
+///
+typedef struct {
+  UINT32    NextDataTransferHandle;
+  UINT8     TransferFlag;
+  UINT8     Table[0];
+} PLDM_GET_SMBIOS_STRUCTURE_BY_HANDLE_RESPONSE;
+
+typedef struct {
+  PLDM_RESPONSE_HEADER                            ResponseHeader;
+  PLDM_GET_SMBIOS_STRUCTURE_BY_HANDLE_RESPONSE    GetSmbiosStructureByTypeResponse;
+} PLDM_GET_SMBIOS_STRUCTURE_BY_HANDLE_RESPONSE_FORMAT;
+#pragma pack()
+
+#endif // PLDM_SMBIOS_H_
-- 
2.37.1.windows.1


             reply	other threads:[~2023-04-02  1:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-02  1:56 Chang, Abner [this message]
2023-04-18 17:48 ` [edk2-devel] [PATCH] MdePkg/Include: Add DMTF PLDM SMBIOS definitions Michael D Kinney
2023-04-19  2:15   ` Chang, Abner

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=20230402015645.819-1-abner.chang@amd.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