From nobody Tue Feb 10 01:14:56 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+59457+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+59457+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1589399623; cv=none; d=zohomail.com; s=zohoarc; b=Y+lsM33R5mLLIQ2kYYel3XN2yke0e+DtrlSsQpZF1DyEnJZi5Igclhz6F3jcsgnNiMVRtfGlohvn7JXi2eTwlccuD8MXxwcRl7r9wWq9EG5JQ18oPtVtTMeMZL73WwJobmRyJ0eaxxH3HR3ObqyjLBaFeoiLMOVPEEMVXaUbpEU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1589399623; h=Content-Type:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=YFn3GpZ5FG8HY5mnkVE/Y2wTsUSs9mwEVz2JVlWg3Ng=; b=LiBG8b257GnzcJjA5F5cxVCzjIiZydVlcHdYHmIcFjsaVvvnIe0Exb49xxTXSrEs2qsMb1MQKJUf0PPV4Sk1EEwADoTilkm2bkzdsFeZjVUNYQhxJpYWuc+eN18wxYT5pymeDudb3090b0eKnWijhDdLvsQGxfsNSYShRM8e9aU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+59457+1787277+3901457@groups.io Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 158939962309532.59063665848748; Wed, 13 May 2020 12:53:43 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id oviNYY1788612xIWBKry11nT; Wed, 13 May 2020 12:53:42 -0700 X-Received: from atlmailgw2.ami.com (atlmailgw2.ami.com []) by mx.groups.io with SMTP id smtpd.web12.3069.1589399614869206417 for ; Wed, 13 May 2020 12:53:42 -0700 X-AuditID: ac10606f-049ff70000001b62-69-5ebc50444be7 X-Received: from atlms1.us.megatrends.com (atlms1.us.megatrends.com [172.16.96.144]) (using TLS with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (Client did not present a certificate) by atlmailgw2.ami.com (Symantec Messaging Gateway) with SMTP id 86.14.07010.4405CBE5; Wed, 13 May 2020 15:53:41 -0400 (EDT) X-Received: from Oleksiy77.us.megatrends.com (172.16.97.158) by atlms1.us.megatrends.com (172.16.96.144) with Microsoft SMTP Server id 14.3.468.0; Wed, 13 May 2020 15:52:58 -0400 From: "Oleksiy Yakovlev" To: CC: , , , , Subject: [edk2-devel] [PATCH v7 7/7] MdePkg: UEFI JSON Capsule Support Date: Wed, 13 May 2020 15:52:48 -0400 Message-ID: <20200513195248.50296-8-oleksiyy@ami.com> In-Reply-To: <20200513195248.50296-1-oleksiyy@ami.com> References: <20200513195248.50296-1-oleksiyy@ami.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrKIsWRmVeSWpSXmKPExsWyRiBhgq5rwJ44g8t9fBa/js5js2ifMJvN YsW9DewWHR3/mBxYPLZ/v8DosXjPS6YApqgGRpvEvLz8ksSSVIWU1OJkW6WAosyyxORKJYXM FFslQyWFgpzE5NTc1LwSW6XEgoLUvBQlOy4FDGADVJaZp5Cal5yfkpmXbqvkGeyva2Fhaqlr qGQXkpGqkJmXll+Um1iSmZ+nkJyfVwJUnZoCFFVI6ObMuPT1GmPBXuOKs+dusDcwvtDsYuTk kBAwkfg+/yxzFyMXh5DALiaJxVdusUA4WxglfkzrZwSpYhPQlDhwbAqYLSIgJTHlwEwmEJtZ oELi6conLCC2sIClxI22xawgNouAqsSiTT/AbF4BU4n+lX2MENs0JKatuQvWyylgJvH13itm EFsIqOb5hbksEPWCEidnQsxkFpCQOPjiBVSNrETb8efsExj5ZyEpm4WkbAEj0ypGocSSnNzE zJz0ciO9xNxMveT83E2MkDjL38H48aP5IUYmDsZDjBIczEoivH7rd8cJ8aYkVlalFuXHF5Xm pBYfYnQCemAisxQ3KASBURJvbGAgJQrjGJqYmZgbmRtampgbGyuJ805auyZOSCAdGLXZqakF qUUwQ5g4OKUaGJUuT9m2+3JrfwAP3xdLcefZQqVs87pfFE/zu3b7j+w7gbjJT0osnHUkZQ+X WzsFxXvXOkq9eXV4s2sK81Nt6XevTh3ks4su2LPeuz5fv2jr1g2G/ye6sLPNSWvp/FY7Z+fK y++8lkXvqb1v9PvJxEkrJ0vo8vqK/dRaem6DyvrIB88Lr9sf0FNiKc5INNRiLipOBADFU8tx yAIAAA== Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,oleksiyy@ami.com X-Gm-Message-State: w40XUZjXf2e0Iv9U527mjGSGx1787277AA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1589399622; bh=aZ+MpV2jcKQoTt6+fV0y0i2H9IMvasa+f9Oy5WaproE=; h=CC:Content-Type:Date:From:Reply-To:Subject:To; b=Cg1iAeToE1DZzyrz8bGDmgCCpbwfwziQUqnKCqJCcDfSulB9m8UKB6FPeFvNsbSJay8 VkxsK3p9BZGoFR6EWt0y+5tS0O6OCWkV4bPt0BbOkn1fxavTg3J78fA2sHJvZVjNT2XzF 7kW0nguRx6VV0KoFQSm6AEeOJM4875jYgHs= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Added Guids and structures, that defines the work flow to perform capsule update using JSON objects. (UEFI 2.8 mantis 1935) Signed-off-by: Oleksiy Yakovlev Reviewed-by: Liming Gao --- MdePkg/Include/Guid/CapsuleReport.h | 29 +++++++++++ MdePkg/Include/Guid/JsonCapsule.h | 98 +++++++++++++++++++++++++++++++++= ++++ MdePkg/Include/Uefi/UefiSpec.h | 1 + MdePkg/MdePkg.dec | 6 +++ 4 files changed, 134 insertions(+) create mode 100644 MdePkg/Include/Guid/JsonCapsule.h diff --git a/MdePkg/Include/Guid/CapsuleReport.h b/MdePkg/Include/Guid/Caps= uleReport.h index 93d2bb7..cd91e6d 100644 --- a/MdePkg/Include/Guid/CapsuleReport.h +++ b/MdePkg/Include/Guid/CapsuleReport.h @@ -93,6 +93,35 @@ typedef struct { /// } EFI_CAPSULE_RESULT_VARIABLE_FMP; =20 +typedef struct { + + /// + /// Version of this structure, currently 0x00000001 + /// + UINT32 Version; + + /// + /// The unique identifier of the capsule whose processing result is reco= rded in this variable. + /// 0x00000000 - 0xEFFFFFFF - Implementation Reserved + /// 0xF0000000 - 0xFFFFFFFF - Specification Reserved + /// #define REDFISH_DEFINED_JSON_SCHEMA 0xF000000 + /// The JSON payload shall conform to a Redfish-defined JSON schema, see= DMTF-Redfish + /// Specification. + /// + UINT32 CapsuleId; + + /// + /// The length of Resp in bytes. + /// + UINT32 RespLength; + + /// + /// Variable length buffer containing the replied JSON payload to the ca= ller who delivered JSON + /// capsule to system. The definition of the JSON schema used in the rep= lied payload is beyond + /// the scope of this specification. + /// + UINT8 Resp[]; + } EFI_CAPSULE_RESULT_VARIABLE_JSON; =20 extern EFI_GUID gEfiCapsuleReportGuid; =20 diff --git a/MdePkg/Include/Guid/JsonCapsule.h b/MdePkg/Include/Guid/JsonCa= psule.h new file mode 100644 index 0000000..b34d6e3 --- /dev/null +++ b/MdePkg/Include/Guid/JsonCapsule.h @@ -0,0 +1,98 @@ +/** @file +Guid & data structure for tables defined for reporting firmware configurat= ion data to EFI +Configuration Tables and also for processing JSON payload capsule. + + +Copyright (c) 2020, American Megatrends International LLC. All rights rese= rved.
+SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#ifndef __JSON_CAPSULE_GUID_H__ +#define __JSON_CAPSULE_GUID_H__ + +// +// The address reported in the table entry identified by EFI_JSON_CAPSULE_= DATA_TABLE_GUID will be +// referenced as physical and will not be fixed up when transition from pr= eboot to runtime phase. The +// addresses reported in these table entries identified by EFI_JSON_CONFIG= _DATA_TABLE_GUID and +// EFI_JSON_CAPSULE_RESULT_TABLE_GUID will be referenced as virtual and wi= ll be fixed up when +// transition from preboot to runtime phase. +// +#define EFI_JSON_CONFIG_DATA_TABLE_GUID \ + {0x87367f87, 0x1119, 0x41ce, \ + {0xaa, 0xec, 0x8b, 0xe0, 0x11, 0x1f, 0x55, 0x8a }} +#define EFI_JSON_CAPSULE_DATA_TABLE_GUID \ + {0x35e7a725, 0x8dd2, 0x4cac, \ + {0x80, 0x11, 0x33, 0xcd, 0xa8, 0x10, 0x90, 0x56 }} +#define EFI_JSON_CAPSULE_RESULT_TABLE_GUID \ + {0xdbc461c3, 0xb3de, 0x422a,\ + {0xb9, 0xb4, 0x98, 0x86, 0xfd, 0x49, 0xa1, 0xe5 }} +#define EFI_JSON_CAPSULE_ID_GUID \ + {0x67d6f4cd, 0xd6b8, 0x4573, \ + {0xbf, 0x4a, 0xde, 0x5e, 0x25, 0x2d, 0x61, 0xae }} + + +#pragma pack(1) + +typedef struct { + /// + /// Version of the structure, initially 0x00000001. + /// + UINT32 Version; + + /// + /// The unique identifier of this capsule. + /// + UINT32 CapsuleId; + + /// + /// The length of the JSON payload immediately following this header, in= bytes. + /// + UINT32 PayloadLength; + + /// + /// Variable length buffer containing the JSON payload that should be pa= rsed and applied to the system. The + /// definition of the JSON schema used in the payload is beyond the scop= e of this specification. + /// + UINT8 Payload[]; +} EFI_JSON_CAPSULE_HEADER; + +typedef struct { + /// + /// The length of the following ConfigData, in bytes. + /// + UINT32 ConfigDataLength; + + /// + /// Variable length buffer containing the JSON payload that describes on= e group of configuration data within + /// current system. The definition of the JSON schema used in this paylo= ad is beyond the scope of this specification. + /// + UINT8 ConfigData[]; +} EFI_JSON_CONFIG_DATA_ITEM; + +typedef struct { + /// + /// Version of the structure, initially 0x00000001. + /// + UINT32 Version; + + /// + ////The total length of EFI_JSON_CAPSULE_CONFIG_DATA, in bytes. + /// + UINT32 TotalLength; + + /// + /// Array of configuration data groups. + /// + EFI_JSON_CONFIG_DATA_ITEM ConfigDataList[]; +} EFI_JSON_CAPSULE_CONFIG_DATA; + +#pragma pack() + +extern EFI_GUID gEfiJsonConfigDataTableGuid; +extern EFI_GUID gEfiJsonCapsuleDataTableGuid; +extern EFI_GUID gEfiJsonCapsuleResultTableGuid; +extern EFI_GUID gEfiJsonCapsuleIdGuid; + + +#endif diff --git a/MdePkg/Include/Uefi/UefiSpec.h b/MdePkg/Include/Uefi/UefiSpec.h index b9282cc..3547345 100644 --- a/MdePkg/Include/Uefi/UefiSpec.h +++ b/MdePkg/Include/Uefi/UefiSpec.h @@ -1783,6 +1783,7 @@ EFI_STATUS #define EFI_OS_INDICATIONS_FMP_CAPSULE_SUPPORTED 0x000000000000= 0008 #define EFI_OS_INDICATIONS_CAPSULE_RESULT_VAR_SUPPORTED 0x000000000000= 0010 #define EFI_OS_INDICATIONS_START_PLATFORM_RECOVERY 0x000000000000= 0040 +#define EFI_OS_INDICATIONS_JSON_CONFIG_DATA_REFRESH 0x000000000000= 0080 =20 // // EFI Runtime Services Table diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec index 5ae190d..86d0cd5 100644 --- a/MdePkg/MdePkg.dec +++ b/MdePkg/MdePkg.dec @@ -647,6 +647,12 @@ =20 # GUIDs defined in UEFI2.8 # + ## Include/Guid/JsonCapsule.h + gEfiJsonConfigDataTableGuid =3D { 0x87367f87, 0x1119, 0x41ce, { 0xa= a, 0xec, 0x8b, 0xe0, 0x11, 0x1f, 0x55, 0x8a }} + gEfiJsonCapsuleDataTableGuid =3D { 0x35e7a725, 0x8dd2, 0x4cac, { 0x8= 0, 0x11, 0x33, 0xcd, 0xa8, 0x10, 0x90, 0x56 }} + gEfiJsonCapsuleResultTableGuid =3D { 0xdbc461c3, 0xb3de, 0x422a, { 0xb= 9, 0xb4, 0x98, 0x86, 0xfd, 0x49, 0xa1, 0xe5 }} + gEfiJsonCapsuleIdGuid =3D { 0x67d6f4cd, 0xd6b8, 0x4573, { 0xb= f, 0x4a, 0xde, 0x5e, 0x25, 0x2d, 0x61, 0xae }} + ## Include/Guid/HiiPlatformSetupFormset.h gEfiHiiResetStyleFormsetGuid =3D { 0x790217bd, 0xbecf, 0x485b, { 0x9= 1, 0x70, 0x5f, 0xf7, 0x11, 0x31, 0x8b, 0x27 }} =20 --=20 2.9.0.windows.1 Please consider the environment before printing this email. The information contained in this message may be confidential and proprieta= ry to American Megatrends (AMI). This communication is intended to be read= only by the individual or entity to whom it is addressed or by their desig= nee. If the reader of this message is not the intended recipient, you are o= n notice that any distribution of this message, in any form, is strictly pr= ohibited. Please promptly notify the sender by reply e-mail or by telephon= e at 770-246-8600, and then delete or destroy all copies of the transmissio= n. -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#59457): https://edk2.groups.io/g/devel/message/59457 Mute This Topic: https://groups.io/mt/74190450/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-