public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Linus Liu" <linus.liu@intel.com>
To: devel@edk2.groups.io
Cc: Benny Lin <benny.lin@intel.com>, Gua Guo <gua.guo@intel.com>,
	Chasel Chiu <chasel.chiu@intel.com>,
	James Lu <james.lu@intel.com>,
	Dhaval Sharma <dhaval@rivosinc.com>
Subject: [edk2-devel] [PATCH v3 2/6] UefiPayloadPkg: Addd header files for FDT structure and function.
Date: Thu, 23 May 2024 21:12:59 -0700	[thread overview]
Message-ID: <20240524041259.63-1-linus.liu@intel.com> (raw)

Add Library header, DeviceTree hob header and PCD definitions.

Cc: Benny Lin <benny.lin@intel.com>
Cc: Gua Guo <gua.guo@intel.com>
Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: James Lu <james.lu@intel.com>
Cc: Dhaval Sharma <dhaval@rivosinc.com>

Signed-off-by: Linus Liu <linus.liu@intel.com>
---
 UefiPayloadPkg/Include/Guid/UniversalPayloadBase.h   |  2 +
 UefiPayloadPkg/Include/Library/FdtParserLib.h        | 64 ++++++++++++++++++++
 UefiPayloadPkg/Include/UniversalPayload/DeviceTree.h | 30 +++++++++
 UefiPayloadPkg/UefiPayloadPkg.dec                    | 22 +++++++
 4 files changed, 118 insertions(+)

diff --git a/UefiPayloadPkg/Include/Guid/UniversalPayloadBase.h b/UefiPayloadPkg/Include/Guid/UniversalPayloadBase.h
index 60f2aa37dd3e..a2d4d491bdfb 100644
--- a/UefiPayloadPkg/Include/Guid/UniversalPayloadBase.h
+++ b/UefiPayloadPkg/Include/Guid/UniversalPayloadBase.h
@@ -16,4 +16,6 @@ typedef struct {
   EFI_PHYSICAL_ADDRESS                Entry;
 } UNIVERSAL_PAYLOAD_BASE;
 
+#define UNIVERSAL_PAYLOAD_BASE_REVISION  1
+
 #endif // UNIVERSAL_PAYLOAD_BASE_H_
diff --git a/UefiPayloadPkg/Include/Library/FdtParserLib.h b/UefiPayloadPkg/Include/Library/FdtParserLib.h
new file mode 100644
index 000000000000..87109f1190bd
--- /dev/null
+++ b/UefiPayloadPkg/Include/Library/FdtParserLib.h
@@ -0,0 +1,64 @@
+/** @file
+  This library will parse the FDT (flat device tree) table information.
+
+  Copyright (c) 2024, Intel Corporation. All rights reserved.<BR>
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+**/
+
+#ifndef FDT_PARSER_LIB_H_
+#define FDT_PARSER_LIB_H_
+
+/**
+  It will parse FDT based on DTB.
+
+  @param[in]  FdtBase               Address of the Fdt data.
+
+  @retval EFI_SUCCESS               If it completed successfully.
+  @retval Others                    If it failed to parse DTB.
+**/
+UINTN
+EFIAPI
+ParseDtb (
+  IN VOID  *FdtBase
+  );
+
+/**
+  It will Parse FDT -node based on information.
+  @param[in]  FdtBase   The starting memory address of FdtBase
+  @retval HobList   The base address of Hoblist.
+
+**/
+UINT64
+EFIAPI
+FdtNodeParser (
+  IN VOID  *FdtBase
+  );
+
+/**
+  It will Parse FDT -custom node based on information.
+  @param[in]  FdtBase The starting memory address of FdtBase
+  @param[in]  HostList The starting memory address of New Hob list.
+
+**/
+UINTN
+EFIAPI
+CustomFdtNodeParser (
+  IN VOID  *FdtBase,
+  IN VOID  *HostList
+  );
+
+/**
+  It will initialize HOBs for UPL.
+
+  @param[in]  FdtBase        Address of the Fdt data.
+
+  @retval EFI_SUCCESS        If it completed successfully.
+  @retval Others             If it failed to initialize HOBs.
+**/
+UINTN
+EFIAPI
+UplInitHob (
+  IN VOID  *FdtBase
+  );
+
+#endif
diff --git a/UefiPayloadPkg/Include/UniversalPayload/DeviceTree.h b/UefiPayloadPkg/Include/UniversalPayload/DeviceTree.h
new file mode 100644
index 000000000000..b7c2163e1e0d
--- /dev/null
+++ b/UefiPayloadPkg/Include/UniversalPayload/DeviceTree.h
@@ -0,0 +1,30 @@
+/** @file
+  This file defines the structure for the PCI Root Bridges.
+
+  Copyright (c) 2024, Intel Corporation. All rights reserved.<BR>
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+  @par Revision Reference:
+    - Universal Payload Specification 0.8 (https://universalpayload.github.io/spec/)
+**/
+
+#ifndef UNIVERSAL_PAYLOAD_DEVICE_TREE_H_
+#define UNIVERSAL_PAYLOAD_DEVICE_TREE_H_
+
+#include <Uefi.h>
+#include <UniversalPayload/UniversalPayload.h>
+
+#pragma pack (1)
+
+typedef struct {
+  UNIVERSAL_PAYLOAD_GENERIC_HEADER    Header;
+  EFI_PHYSICAL_ADDRESS                DeviceTreeAddress;
+} UNIVERSAL_PAYLOAD_DEVICE_TREE;
+
+#pragma pack()
+
+#define UNIVERSAL_PAYLOAD_DEVICE_TREE_REVISION  1
+
+extern GUID  gUniversalPayloadDeviceTreeGuid;
+
+#endif // UNIVERSAL_PAYLOAD_SMBIOS_TABLE_H_
diff --git a/UefiPayloadPkg/UefiPayloadPkg.dec b/UefiPayloadPkg/UefiPayloadPkg.dec
index 23dcdf9a0c9c..ca11a083ecdb 100644
--- a/UefiPayloadPkg/UefiPayloadPkg.dec
+++ b/UefiPayloadPkg/UefiPayloadPkg.dec
@@ -27,6 +27,8 @@
   ## Include/Guid/UniversalPayloadBase.h
   gUniversalPayloadBaseGuid = { 0x03d4c61d, 0x2713, 0x4ec5, {0xa1, 0xcc, 0x88, 0x3b, 0xe9, 0xdc, 0x18, 0xe5 } }
 
+  ## Include/UniversalPayload/DeviceTree.h
+  gUniversalPayloadDeviceTreeGuid = { 0x6784b889, 0xb13c, 0x4c3b, {0xae, 0x4b, 0xf, 0xa, 0x2e, 0x32, 0xe, 0xa3 } }
   gEdkiiDebugPrintErrorLevelGuid = { 0xad82f436, 0x75c5, 0x4aa9, { 0x92, 0x93, 0xc5, 0x55, 0x0a, 0x7f, 0xf9, 0x71 }}
   gUefiAcpiBoardInfoGuid   = {0xad3d31b, 0xb3d8, 0x4506, {0xae, 0x71, 0x2e, 0xf1, 0x10, 0x6, 0xd9, 0xf}}
   gUefiSerialPortInfoGuid  = { 0x6c6872fe, 0x56a9, 0x4403, { 0xbb, 0x98, 0x95, 0x8d, 0x62, 0xde, 0x87, 0xf1 } }
@@ -42,6 +44,13 @@
 [Ppis]
   gEfiPayLoadHobBasePpiGuid = { 0xdbe23aa1, 0xa342, 0x4b97, {0x85, 0xb6, 0xb2, 0x26, 0xf1, 0x61, 0x73, 0x89} }
 
+  #
+  # This PPI is used to trigger Payload callback event in end of PEI.
+  #
+  gUplReadyToPayloadPpiGuid = { 0x67c8dfb1, 0x61f4, 0x439c, { 0x84, 0x4e, 0x2b, 0xdf, 0xf1, 0x07, 0xad, 0x51 }}
+
+[Protocols]
+
 ################################################################################
 #
 # PCD Declarations section - list of all PCDs Declared by this Package
@@ -75,3 +84,16 @@ gUefiPayloadPkgTokenSpaceGuid.PcdBootManagerEscape|FALSE|BOOLEAN|0x00000020
 ## FFS filename to find the default variable initial data file.
 # @Prompt FFS Name of variable initial data file
  gUefiPayloadPkgTokenSpaceGuid.PcdNvsDataFile |{ 0x1a, 0xf1, 0xb1, 0xae, 0x42, 0xcc, 0xcf, 0x4e, 0xac, 0x60, 0xdb, 0xab, 0xf6, 0xca, 0x69, 0xe6 }|VOID*|0x00000025
+
+
+## Indicates if Universal payload support FDT
+#-  PcdHandOffFdtEnable is TRUE, HandOffData is FDT
+#-  PcdHandOffFdtEnable is FALSE, HandOffData is HOB
+gUefiPayloadPkgTokenSpaceGuid.PcdHandOffFdtEnable|TRUE|BOOLEAN|0x00000026
+
+
+gUefiPayloadPkgTokenSpaceGuid.PcdPciReservedPMemBase         |0xFFFFFFFF |UINT32|0x00000027
+gUefiPayloadPkgTokenSpaceGuid.PcdPciReservedPMemLimit        |0x00000000 |UINT32|0x00000028
+gUefiPayloadPkgTokenSpaceGuid.PcdPciReservedPMemAbove4GBBase |0xFFFFFFFFFFFFFFFF |UINT64|0x00000029
+gUefiPayloadPkgTokenSpaceGuid.PcdPciReservedPMemAbove4GBLimit|0x0000000000000000 |UINT64|0x0000002A
+
-- 
2.39.2.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#119194): https://edk2.groups.io/g/devel/message/119194
Mute This Topic: https://groups.io/mt/106275986/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



                 reply	other threads:[~2024-05-24  4:13 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20240524041259.63-1-linus.liu@intel.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