From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail05.groups.io (mail05.groups.io [45.79.224.7]) by spool.mail.gandi.net (Postfix) with ESMTPS id ABA0E740035 for ; Mon, 3 Jun 2024 02:18:13 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=EUWiJBZNf5WNJmjZA9gXraTHAr838/WBmh7/jfmDFAE=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20240206; t=1717381093; v=1; b=KvD4k6sUaosIKTizlM9pm8VOnnZQHYzA32qXfsuGto5o3OQQMDnZzY7F7XuRIsRMjyLX1tlT mvWHPbIqFEHRqX0O7tWmwEjwcZ38iGgNQlahTFGMyhfRSMasw6SSPIuFbxpO6wfpif2pXMvVW8W mNv9kTtooPlFCktJ3/Oi+u3ACbXYkdlEe8cjWb+qucuA5971FgdPSXSxKmSi7NPmnbUSUIF4Y65 HQdCYYRi2YHky8kTKhCNfvff8VPb9o3zgx0+0JdYSbRoUo4PC50RRYFaxCSEkmDOrdwXCWnJ9rg +UxYpp7t5eWpInpcem0Vot7Ca+LaQ5hHxEzOwObSoWeqQ== X-Received: by 127.0.0.2 with SMTP id U2p7YY7687511xWQpqiWwXsl; Sun, 02 Jun 2024 19:18:12 -0700 X-Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.11]) by mx.groups.io with SMTP id smtpd.web11.73912.1717381091631763328 for ; Sun, 02 Jun 2024 19:18:11 -0700 X-CSE-ConnectionGUID: JQLOU5k6RLiuCCxIg0bfIw== X-CSE-MsgGUID: t3t+J5wlRQWRNl7WG6BBVw== X-IronPort-AV: E=McAfee;i="6600,9927,11091"; a="24437140" X-IronPort-AV: E=Sophos;i="6.08,210,1712646000"; d="scan'208";a="24437140" X-Received: from orviesa009.jf.intel.com ([10.64.159.149]) by orvoesa103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jun 2024 19:18:11 -0700 X-CSE-ConnectionGUID: ZpKOqXs7SbG0qs+IqctcCQ== X-CSE-MsgGUID: 4kgH5mdXSg6adWiboU6lUA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,210,1712646000"; d="scan'208";a="36825941" X-Received: from linusliu-desk1.gar.corp.intel.com ([10.225.76.64]) by orviesa009.jf.intel.com with ESMTP; 02 Jun 2024 19:18:09 -0700 From: "Linus Liu" To: devel@edk2.groups.io Cc: Benny Lin , Gua Guo , Chasel Chiu , James Lu , Dhaval Sharma Subject: [edk2-devel] [PATCH v4 2/6] UefiPayloadPkg: Addd header files for FDT structure and function. Date: Sun, 2 Jun 2024 19:18:04 -0700 Message-Id: <20240603021804.224-1-linus.liu@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Resent-Date: Sun, 02 Jun 2024 19:18:11 -0700 Resent-From: linus.liu@intel.com Reply-To: devel@edk2.groups.io,linus.liu@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: AJpDkrPslppcLRRueKg1w5Rfx7686176AA= Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=KvD4k6sU; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=intel.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.224.7 as permitted sender) smtp.mailfrom=bounce@groups.io Add Library header, DeviceTree hob header and PCD definitions. Cc: Benny Lin Cc: Gua Guo Cc: Chasel Chiu Cc: James Lu Cc: Dhaval Sharma Signed-off-by: Linus Liu --- 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/UefiPaylo= adPkg/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;=0D } UNIVERSAL_PAYLOAD_BASE;=0D =0D +#define UNIVERSAL_PAYLOAD_BASE_REVISION 1=0D +=0D #endif // UNIVERSAL_PAYLOAD_BASE_H_=0D 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=0D + This library will parse the FDT (flat device tree) table information.=0D +=0D + Copyright (c) 2024, Intel Corporation. All rights reserved.
=0D + SPDX-License-Identifier: BSD-2-Clause-Patent=0D +**/=0D +=0D +#ifndef FDT_PARSER_LIB_H_=0D +#define FDT_PARSER_LIB_H_=0D +=0D +/**=0D + It will parse FDT based on DTB.=0D +=0D + @param[in] FdtBase Address of the Fdt data.=0D +=0D + @retval EFI_SUCCESS If it completed successfully.=0D + @retval Others If it failed to parse DTB.=0D +**/=0D +UINTN=0D +EFIAPI=0D +ParseDtb (=0D + IN VOID *FdtBase=0D + );=0D +=0D +/**=0D + It will Parse FDT -node based on information.=0D + @param[in] FdtBase The starting memory address of FdtBase=0D + @retval HobList The base address of Hoblist.=0D +=0D +**/=0D +UINT64=0D +EFIAPI=0D +FdtNodeParser (=0D + IN VOID *FdtBase=0D + );=0D +=0D +/**=0D + It will Parse FDT -custom node based on information.=0D + @param[in] FdtBase The starting memory address of FdtBase=0D + @param[in] HostList The starting memory address of New Hob list.=0D +=0D +**/=0D +UINTN=0D +EFIAPI=0D +CustomFdtNodeParser (=0D + IN VOID *FdtBase,=0D + IN VOID *HostList=0D + );=0D +=0D +/**=0D + It will initialize HOBs for UPL.=0D +=0D + @param[in] FdtBase Address of the Fdt data.=0D +=0D + @retval EFI_SUCCESS If it completed successfully.=0D + @retval Others If it failed to initialize HOBs.=0D +**/=0D +UINTN=0D +EFIAPI=0D +UplInitHob (=0D + IN VOID *FdtBase=0D + );=0D +=0D +#endif=0D diff --git a/UefiPayloadPkg/Include/UniversalPayload/DeviceTree.h b/UefiPay= loadPkg/Include/UniversalPayload/DeviceTree.h new file mode 100644 index 000000000000..b7c2163e1e0d --- /dev/null +++ b/UefiPayloadPkg/Include/UniversalPayload/DeviceTree.h @@ -0,0 +1,30 @@ +/** @file=0D + This file defines the structure for the PCI Root Bridges.=0D +=0D + Copyright (c) 2024, Intel Corporation. All rights reserved.
=0D + SPDX-License-Identifier: BSD-2-Clause-Patent=0D +=0D + @par Revision Reference:=0D + - Universal Payload Specification 0.8 (https://universalpayload.github= .io/spec/)=0D +**/=0D +=0D +#ifndef UNIVERSAL_PAYLOAD_DEVICE_TREE_H_=0D +#define UNIVERSAL_PAYLOAD_DEVICE_TREE_H_=0D +=0D +#include =0D +#include =0D +=0D +#pragma pack (1)=0D +=0D +typedef struct {=0D + UNIVERSAL_PAYLOAD_GENERIC_HEADER Header;=0D + EFI_PHYSICAL_ADDRESS DeviceTreeAddress;=0D +} UNIVERSAL_PAYLOAD_DEVICE_TREE;=0D +=0D +#pragma pack()=0D +=0D +#define UNIVERSAL_PAYLOAD_DEVICE_TREE_REVISION 1=0D +=0D +extern GUID gUniversalPayloadDeviceTreeGuid;=0D +=0D +#endif // UNIVERSAL_PAYLOAD_SMBIOS_TABLE_H_=0D diff --git a/UefiPayloadPkg/UefiPayloadPkg.dec b/UefiPayloadPkg/UefiPayload= Pkg.dec index 23dcdf9a0c9c..ca11a083ecdb 100644 --- a/UefiPayloadPkg/UefiPayloadPkg.dec +++ b/UefiPayloadPkg/UefiPayloadPkg.dec @@ -27,6 +27,8 @@ ## Include/Guid/UniversalPayloadBase.h=0D gUniversalPayloadBaseGuid =3D { 0x03d4c61d, 0x2713, 0x4ec5, {0xa1, 0xcc,= 0x88, 0x3b, 0xe9, 0xdc, 0x18, 0xe5 } }=0D =0D + ## Include/UniversalPayload/DeviceTree.h=0D + gUniversalPayloadDeviceTreeGuid =3D { 0x6784b889, 0xb13c, 0x4c3b, {0xae,= 0x4b, 0xf, 0xa, 0x2e, 0x32, 0xe, 0xa3 } }=0D gEdkiiDebugPrintErrorLevelGuid =3D { 0xad82f436, 0x75c5, 0x4aa9, { 0x92,= 0x93, 0xc5, 0x55, 0x0a, 0x7f, 0xf9, 0x71 }}=0D gUefiAcpiBoardInfoGuid =3D {0xad3d31b, 0xb3d8, 0x4506, {0xae, 0x71, 0x= 2e, 0xf1, 0x10, 0x6, 0xd9, 0xf}}=0D gUefiSerialPortInfoGuid =3D { 0x6c6872fe, 0x56a9, 0x4403, { 0xbb, 0x98,= 0x95, 0x8d, 0x62, 0xde, 0x87, 0xf1 } }=0D @@ -42,6 +44,13 @@ [Ppis]=0D gEfiPayLoadHobBasePpiGuid =3D { 0xdbe23aa1, 0xa342, 0x4b97, {0x85, 0xb6,= 0xb2, 0x26, 0xf1, 0x61, 0x73, 0x89} }=0D =0D + #=0D + # This PPI is used to trigger Payload callback event in end of PEI.=0D + #=0D + gUplReadyToPayloadPpiGuid =3D { 0x67c8dfb1, 0x61f4, 0x439c, { 0x84, 0x4e= , 0x2b, 0xdf, 0xf1, 0x07, 0xad, 0x51 }}=0D +=0D +[Protocols]=0D +=0D ##########################################################################= ######=0D #=0D # PCD Declarations section - list of all PCDs Declared by this Package=0D @@ -75,3 +84,16 @@ gUefiPayloadPkgTokenSpaceGuid.PcdBootManagerEscape|FALSE= |BOOLEAN|0x00000020 ## FFS filename to find the default variable initial data file.=0D # @Prompt FFS Name of variable initial data file=0D gUefiPayloadPkgTokenSpaceGuid.PcdNvsDataFile |{ 0x1a, 0xf1, 0xb1, 0xae, 0= x42, 0xcc, 0xcf, 0x4e, 0xac, 0x60, 0xdb, 0xab, 0xf6, 0xca, 0x69, 0xe6 }|VOI= D*|0x00000025=0D +=0D +=0D +## Indicates if Universal payload support FDT=0D +#- PcdHandOffFdtEnable is TRUE, HandOffData is FDT=0D +#- PcdHandOffFdtEnable is FALSE, HandOffData is HOB=0D +gUefiPayloadPkgTokenSpaceGuid.PcdHandOffFdtEnable|TRUE|BOOLEAN|0x00000026= =0D +=0D +=0D +gUefiPayloadPkgTokenSpaceGuid.PcdPciReservedPMemBase |0xFFFFFFFF |= UINT32|0x00000027=0D +gUefiPayloadPkgTokenSpaceGuid.PcdPciReservedPMemLimit |0x00000000 |= UINT32|0x00000028=0D +gUefiPayloadPkgTokenSpaceGuid.PcdPciReservedPMemAbove4GBBase |0xFFFFFFFFFF= FFFFFF |UINT64|0x00000029=0D +gUefiPayloadPkgTokenSpaceGuid.PcdPciReservedPMemAbove4GBLimit|0x0000000000= 000000 |UINT64|0x0000002A=0D +=0D --=20 2.39.2.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#119417): https://edk2.groups.io/g/devel/message/119417 Mute This Topic: https://groups.io/mt/106455153/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-