]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdePkg: UEFI JSON Capsule Support
authorOleksiy Yakovlev <oleksiyy@ami.com>
Wed, 13 May 2020 19:52:48 +0000 (03:52 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Fri, 15 May 2020 05:05:52 +0000 (05:05 +0000)
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 <oleksiyy@ami.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Zhiguang Liu <zhiguang.liu@intel.com>
MdePkg/Include/Guid/CapsuleReport.h
MdePkg/Include/Guid/JsonCapsule.h [new file with mode: 0644]
MdePkg/Include/Uefi/UefiSpec.h
MdePkg/MdePkg.dec

index 93d2bb75a50b68c886c33fe0a7cf9024ed51929a..cd91e6d8cd38780e8994acdc5334499f72b33517 100644 (file)
@@ -93,6 +93,35 @@ typedef struct {
   ///\r
 } EFI_CAPSULE_RESULT_VARIABLE_FMP;\r
 \r
+typedef struct {\r
+\r
+  ///\r
+  /// Version of this structure, currently 0x00000001\r
+  ///\r
+  UINT32    Version;\r
+\r
+  ///\r
+  /// The unique identifier of the capsule whose processing result is recorded in this variable.\r
+  /// 0x00000000 - 0xEFFFFFFF - Implementation Reserved\r
+  /// 0xF0000000 - 0xFFFFFFFF - Specification Reserved\r
+  /// #define REDFISH_DEFINED_JSON_SCHEMA 0xF000000\r
+  /// The JSON payload shall conform to a Redfish-defined JSON schema, see DMTF-Redfish\r
+  /// Specification.\r
+  ///\r
+  UINT32 CapsuleId;\r
+\r
+  ///\r
+  /// The length of Resp in bytes.\r
+  ///\r
+  UINT32 RespLength;\r
+\r
+  ///\r
+  /// Variable length buffer containing the replied JSON payload to the caller who delivered JSON\r
+  /// capsule to system. The definition of the JSON schema used in the replied payload is beyond\r
+  /// the scope of this specification.\r
+  ///\r
+  UINT8 Resp[];\r
+ } EFI_CAPSULE_RESULT_VARIABLE_JSON;\r
 \r
 extern EFI_GUID gEfiCapsuleReportGuid;\r
 \r
diff --git a/MdePkg/Include/Guid/JsonCapsule.h b/MdePkg/Include/Guid/JsonCapsule.h
new file mode 100644 (file)
index 0000000..b34d6e3
--- /dev/null
@@ -0,0 +1,98 @@
+/** @file\r
+Guid & data structure for tables defined for reporting firmware configuration data to EFI\r
+Configuration Tables and also for processing JSON payload capsule.\r
+\r
+\r
+Copyright (c) 2020, American Megatrends International LLC. All rights reserved.<BR>\r
+SPDX-License-Identifier: BSD-2-Clause-Patent\r
+\r
+**/\r
+\r
+#ifndef __JSON_CAPSULE_GUID_H__\r
+#define __JSON_CAPSULE_GUID_H__\r
+\r
+//\r
+// The address reported in the table entry identified by EFI_JSON_CAPSULE_DATA_TABLE_GUID will be\r
+// referenced as physical and will not be fixed up when transition from preboot to runtime phase. The\r
+// addresses reported in these table entries identified by EFI_JSON_CONFIG_DATA_TABLE_GUID and\r
+// EFI_JSON_CAPSULE_RESULT_TABLE_GUID will be referenced as virtual and will be fixed up when\r
+// transition from preboot to runtime phase.\r
+//\r
+#define EFI_JSON_CONFIG_DATA_TABLE_GUID \\r
+    {0x87367f87, 0x1119, 0x41ce, \\r
+    {0xaa, 0xec, 0x8b, 0xe0, 0x11, 0x1f, 0x55, 0x8a }}\r
+#define EFI_JSON_CAPSULE_DATA_TABLE_GUID \\r
+    {0x35e7a725, 0x8dd2, 0x4cac, \\r
+    {0x80, 0x11, 0x33, 0xcd, 0xa8, 0x10, 0x90, 0x56 }}\r
+#define EFI_JSON_CAPSULE_RESULT_TABLE_GUID \\r
+    {0xdbc461c3, 0xb3de, 0x422a,\\r
+    {0xb9, 0xb4, 0x98, 0x86, 0xfd, 0x49, 0xa1, 0xe5 }}\r
+#define EFI_JSON_CAPSULE_ID_GUID \\r
+    {0x67d6f4cd, 0xd6b8,  0x4573, \\r
+    {0xbf, 0x4a, 0xde, 0x5e, 0x25, 0x2d, 0x61, 0xae }}\r
+\r
+\r
+#pragma pack(1)\r
+\r
+typedef struct {\r
+  ///\r
+  /// Version of the structure, initially 0x00000001.\r
+  ///\r
+  UINT32 Version;\r
+\r
+  ///\r
+  /// The unique identifier of this capsule.\r
+  ///\r
+  UINT32 CapsuleId;\r
+\r
+  ///\r
+  /// The length of the JSON payload immediately following this header, in bytes.\r
+  ///\r
+  UINT32 PayloadLength;\r
+\r
+  ///\r
+  /// Variable length buffer containing the JSON payload that should be parsed and applied to the system. The\r
+  /// definition of the JSON schema used in the payload is beyond the scope of this specification.\r
+  ///\r
+  UINT8 Payload[];\r
+} EFI_JSON_CAPSULE_HEADER;\r
+\r
+typedef struct {\r
+  ///\r
+  /// The length of the following ConfigData, in bytes.\r
+  ///\r
+  UINT32 ConfigDataLength;\r
+\r
+  ///\r
+  /// Variable length buffer containing the JSON payload that describes one group of configuration data within\r
+  /// current system. The definition of the JSON schema used in this payload is beyond the scope of this specification.\r
+  ///\r
+  UINT8 ConfigData[];\r
+} EFI_JSON_CONFIG_DATA_ITEM;\r
+\r
+typedef struct {\r
+  ///\r
+  /// Version of the structure, initially 0x00000001.\r
+  ///\r
+  UINT32 Version;\r
+\r
+  ///\r
+  ////The total length of EFI_JSON_CAPSULE_CONFIG_DATA, in bytes.\r
+  ///\r
+  UINT32 TotalLength;\r
+\r
+  ///\r
+  /// Array of configuration data groups.\r
+  ///\r
+  EFI_JSON_CONFIG_DATA_ITEM ConfigDataList[];\r
+} EFI_JSON_CAPSULE_CONFIG_DATA;\r
+\r
+#pragma pack()\r
+\r
+extern EFI_GUID gEfiJsonConfigDataTableGuid;\r
+extern EFI_GUID gEfiJsonCapsuleDataTableGuid;\r
+extern EFI_GUID gEfiJsonCapsuleResultTableGuid;\r
+extern EFI_GUID gEfiJsonCapsuleIdGuid;\r
+\r
+\r
+#endif\r
index b9282cc51bad06670701110d845e10eb36d999c2..3547345bd6242f33afead8bae9159bd3a6ed0367 100644 (file)
@@ -1783,6 +1783,7 @@ EFI_STATUS
 #define EFI_OS_INDICATIONS_FMP_CAPSULE_SUPPORTED            0x0000000000000008\r
 #define EFI_OS_INDICATIONS_CAPSULE_RESULT_VAR_SUPPORTED     0x0000000000000010\r
 #define EFI_OS_INDICATIONS_START_PLATFORM_RECOVERY          0x0000000000000040\r
+#define EFI_OS_INDICATIONS_JSON_CONFIG_DATA_REFRESH         0x0000000000000080\r
 \r
 //\r
 // EFI Runtime Services Table\r
index 5ae190d1c6ff84f5544f275e11950f3fb81744f7..86d0cd5f4ec47aeb83c8e38dd42f2094f65bc551 100644 (file)
 \r
   # GUIDs defined in UEFI2.8\r
   #\r
+  ## Include/Guid/JsonCapsule.h\r
+  gEfiJsonConfigDataTableGuid      = { 0x87367f87, 0x1119, 0x41ce, { 0xaa, 0xec, 0x8b, 0xe0, 0x11, 0x1f, 0x55, 0x8a }}\r
+  gEfiJsonCapsuleDataTableGuid     = { 0x35e7a725, 0x8dd2, 0x4cac, { 0x80, 0x11, 0x33, 0xcd, 0xa8, 0x10, 0x90, 0x56 }}\r
+  gEfiJsonCapsuleResultTableGuid   = { 0xdbc461c3, 0xb3de, 0x422a, { 0xb9, 0xb4, 0x98, 0x86, 0xfd, 0x49, 0xa1, 0xe5 }}\r
+  gEfiJsonCapsuleIdGuid            = { 0x67d6f4cd, 0xd6b8, 0x4573, { 0xbf, 0x4a, 0xde, 0x5e, 0x25, 0x2d, 0x61, 0xae }}\r
+\r
   ## Include/Guid/HiiPlatformSetupFormset.h\r
   gEfiHiiResetStyleFormsetGuid     = { 0x790217bd, 0xbecf, 0x485b, { 0x91, 0x70, 0x5f, 0xf7, 0x11, 0x31, 0x8b, 0x27 }}\r
 \r