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 38BCFD80091 for ; Fri, 24 May 2024 02:05:11 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=qfj7LHIYPKXNH/YeTwWh+IqdxWajckZiDdM7AQ523jk=; 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=1716516309; v=1; b=od5723IPpjxUuVDsqCgKNPPMYO6a7hXjRuNQsFljrz0iTPbgBilB3naoe8OLA6ydxLwswTrG X5zVco+VjjdRJ/27BUCuQFNXiTPkr2AOnCItaJONGZf5A5MrqH10hCAwd2vM95A5vhytezGAvSd HCzaQpHmu4z7fnYBiigHYFow30ey2p6KpDtC+Zgv3slcNS8PB7lGB6hoFjgNLqmJlmXtrcfi2JT 9e5Ty4XY1pDeokJEcyE0Wgr+XmalOhdJYOVbYwO4MLo382UuJmNZ7k2e62sJO9eKDXYPSCUe8OH pANOwCNnga/086JeHlAakKBBitqeIPmQCkWPq/oTSLStw== X-Received: by 127.0.0.2 with SMTP id QUubYY7687511xAvoBax0Rlm; Thu, 23 May 2024 19:05:09 -0700 X-Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.8]) by mx.groups.io with SMTP id smtpd.web11.6900.1716516308796641778 for ; Thu, 23 May 2024 19:05:08 -0700 X-CSE-ConnectionGUID: 62zDKvqGSO+quq6rnQuy0w== X-CSE-MsgGUID: y8A+hR7NQ62ZDf0+gH8ZMw== X-IronPort-AV: E=McAfee;i="6600,9927,11081"; a="30408833" X-IronPort-AV: E=Sophos;i="6.08,184,1712646000"; d="scan'208";a="30408833" X-Received: from orviesa007.jf.intel.com ([10.64.159.147]) by fmvoesa102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 May 2024 19:05:09 -0700 X-CSE-ConnectionGUID: o41uYa8eR5u4BUZ6WY0IjQ== X-CSE-MsgGUID: WbJCTpoSRiu4FkTjktmyOg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,184,1712646000"; d="scan'208";a="34471840" X-Received: from linusliu-desk1.gar.corp.intel.com ([10.225.76.64]) by orviesa007.jf.intel.com with ESMTP; 23 May 2024 19:05:07 -0700 From: "Linus Liu" To: devel@edk2.groups.io Cc: Benny Lin , Gua Guo , Chasel Chiu , James Lu , Dhaval Sharma Subject: [edk2-devel] [PATCH v1 2/6] UefiPayloadPkg: Addd header files for FDT structure and function. Date: Thu, 23 May 2024 19:04:57 -0700 Message-Id: <20240524020457.1390-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: Thu, 23 May 2024 19:05:08 -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: NlUWIIMk5jVk5oPNuFgYgsyWx7686176AA= 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=od5723IP; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.224.7 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=intel.com (policy=none) 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 (#119173): https://edk2.groups.io/g/devel/message/119173 Mute This Topic: https://groups.io/mt/106274757/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-