From nobody Mon Apr 29 04:05:54 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+103761+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+103761+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1682666011; cv=none; d=zohomail.com; s=zohoarc; b=XreHc8O1mObnOts7hq8zGyUUnBGZWpEln9wp4Bwcj8h7z9YNazZBL3FqetvTughKyUrA8TZfm3P0U+/FPelOC7C9aOZz5yRNDGwLg7Hd3elLPj0iRWHJlsvGGcwFOE0GiAJOnBF0O9vGkQw9YMMRdt0MGsQNM1sfLnAKwN0tgHU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1682666011; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=95m+XVPMwFB3KDorYCG5rTAQ2K/yEIFkb0IkpUR54yo=; b=GNeK4ahZBSpPXM5r/NyF/6b7Ldt7zrJa5Eo5YIu9tJXxLEHysKxEv5gEADiV3kn2uwX8b2Z8iZqchotXyvDe1o/o6qwbVvw7zCAHfwo37KxsnhXHD7whJsGI04mcF9xL52o1MS5VPqGoH+G4D5Ai3ghNlfvGbn4X1aWcI+1+xmM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+103761+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 168266601134262.26545562700221; Fri, 28 Apr 2023 00:13:31 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id UxQsYY1788612xtR6NpVr1SN; Fri, 28 Apr 2023 00:13:30 -0700 X-Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mx.groups.io with SMTP id smtpd.web11.13719.1682666010229387527 for ; Fri, 28 Apr 2023 00:13:30 -0700 X-IronPort-AV: E=McAfee;i="6600,9927,10693"; a="336720014" X-IronPort-AV: E=Sophos;i="5.99,233,1677571200"; d="scan'208";a="336720014" X-Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Apr 2023 00:13:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10693"; a="940999008" X-IronPort-AV: E=Sophos;i="5.99,233,1677571200"; d="scan'208";a="940999008" X-Received: from bennyli1-mobl2.gar.corp.intel.com ([10.252.187.210]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Apr 2023 00:13:28 -0700 From: "Benny Lin" To: devel@edk2.groups.io Cc: Benny Lin , Leif Lindholm , Michael D Kinney , Andrew Fish Subject: [edk2-devel] [PATCH v5 1/3] Tianocore: Support FDT library. Date: Fri, 28 Apr 2023 15:13:09 +0800 Message-Id: <20230428071311.1669-2-benny.lin@intel.com> In-Reply-To: <20230428071311.1669-1-benny.lin@intel.com> References: <20230428071311.1669-1-benny.lin@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: 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,benny.lin@intel.com X-Gm-Message-State: UecVYh5kuSHsUApOytW2HtsGx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1682666010; bh=6/CdNyWzRu1GxvTyvR0JmNC1fEe+n4yDCcuDnyngZMQ=; h=Cc:Date:From:Reply-To:Subject:To; b=qSpbHBuJp1MZ6Hyvnb5iblwwmnHwuAh+x/2brtIhtjhhooOPqNxnMFwjgnSjRbqGbH7 MdL8utN77Fa7XwOigOVePlnDDm0ZZptgCxFoQTXzoefJPDGu0WRA9asn4faDMUIdf462L qyYpM79Mt3DL9wNFalS2m+aWE/dxwIfxua4= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1682666012380100001 Content-Type: text/plain; charset="utf-8" From: Benny Lin REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4392 Add FDT support in EDK2 by submodule 3rd party libfdt (https://github.com/devicetree-org/pylibfdt/tree/main/libfdt) Add submodule libfdt and update ReadMe for the licence. Reviewed-by: Leif Lindholm Reviewed-by: Michael D Kinney Cc: Andrew Fish Cc: Leif Lindholm Cc: Michael D Kinney Signed-off-by: Benny Lin Acked-by: Pedro Falcato --- .gitmodules | 3 +++ MdePkg/Library/BaseFdtLib/libfdt | 1 + ReadMe.rst | 1 + 3 files changed, 5 insertions(+) diff --git a/.gitmodules b/.gitmodules index fe8a43be93..b1888c3488 100644 --- a/.gitmodules +++ b/.gitmodules @@ -26,3 +26,6 @@ [submodule "UnitTestFrameworkPkg/Library/SubhookLib/subhook"] path =3D UnitTestFrameworkPkg/Library/SubhookLib/subhook url =3D https://github.com/Zeex/subhook.git +[submodule "MdePkg/Library/BaseFdtLib/libfdt"] + path =3D MdePkg/Library/BaseFdtLib/libfdt + url =3D https://github.com/devicetree-org/pylibfdt.git diff --git a/MdePkg/Library/BaseFdtLib/libfdt b/MdePkg/Library/BaseFdtLib/l= ibfdt new file mode 160000 index 0000000000..cfff805481 --- /dev/null +++ b/MdePkg/Library/BaseFdtLib/libfdt @@ -0,0 +1 @@ +Subproject commit cfff805481bdea27f900c32698171286542b8d3c diff --git a/ReadMe.rst b/ReadMe.rst index 91b9cf3c5e..d46c534229 100644 --- a/ReadMe.rst +++ b/ReadMe.rst @@ -96,6 +96,7 @@ that are covered by additional licenses. - `UnitTestFrameworkPkg/Library/GoogleTestLib/googletest `__ - `UnitTestFrameworkPkg/Library/SubhookLib/subhook `__ - `RedfishPkg/Library/JsonLib/jansson `__ +- `MdePkg/Library/BaseFdtLib/libfdt `__ =20 The EDK II Project is composed of packages. The maintainers for each packa= ge are listed in `Maintainers.txt `__. --=20 2.39.1.windows.1 -=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 (#103761): https://edk2.groups.io/g/devel/message/103761 Mute This Topic: https://groups.io/mt/98553641/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- From nobody Mon Apr 29 04:05:54 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+103762+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+103762+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1682666013; cv=none; d=zohomail.com; s=zohoarc; b=Ivwl/4fbE7BfaHzngrzF5vkBdC6sEcaiSx8Po8AZlG+xs5nw1gMaP4howKQzYDtB+ikFP8IAudwxbF5eagDaYZSQ3ueARu6Btv54+xbhgNiSQ/VNRRwCXRl3VZC/zwLKDrU2X8+JBZx7+xfetJp+39TY4M2AgvYe6i/I+Wdt/aY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1682666013; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=AwRsHsT9lYA//3wqdLYqz26ElFpyJf8tVDi3fggjANg=; b=CsXTgGvQZtb/KMy0Rze+y59oErMr4UeKd2AD7xsI4xO0nhjSlgm2l59IsaW8+uL/+VrWWU6vo7Y9eLrIFbVcT2YrwJt3wDeUiXfMrpmm/IKCy5Xuv5gJZwCzDMTeR2kigZHdDZ1RXe4kKSqLr3FzMeajJ5hbPE64cX24yXFKLFI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+103762+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1682666013186488.8047796188289; Fri, 28 Apr 2023 00:13:33 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id NqDxYY1788612x4MF9bIYxaX; Fri, 28 Apr 2023 00:13:32 -0700 X-Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mx.groups.io with SMTP id smtpd.web10.13692.1682666012074048181 for ; Fri, 28 Apr 2023 00:13:32 -0700 X-IronPort-AV: E=McAfee;i="6600,9927,10693"; a="336720032" X-IronPort-AV: E=Sophos;i="5.99,233,1677571200"; d="scan'208";a="336720032" X-Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Apr 2023 00:13:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10693"; a="940999016" X-IronPort-AV: E=Sophos;i="5.99,233,1677571200"; d="scan'208";a="940999016" X-Received: from bennyli1-mobl2.gar.corp.intel.com ([10.252.187.210]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Apr 2023 00:13:29 -0700 From: "Benny Lin" To: devel@edk2.groups.io Cc: Benny Lin , Michael D Kinney , Liming Gao , Zhiguang Liu , Pedro Falcato Subject: [edk2-devel] [PATCH v5 2/3] MdePkg: Support FDT library. Date: Fri, 28 Apr 2023 15:13:10 +0800 Message-Id: <20230428071311.1669-3-benny.lin@intel.com> In-Reply-To: <20230428071311.1669-1-benny.lin@intel.com> References: <20230428071311.1669-1-benny.lin@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: 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,benny.lin@intel.com X-Gm-Message-State: ihlww2UfGuwD4Pm2MrDQwXzkx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1682666012; bh=jx7PV//gNe7LcGIVSVZ+sKUMNtsJv4FJm+axnMNGV6Q=; h=Cc:Date:From:Reply-To:Subject:To; b=l/PXAzGY/NmFuteuEgaD15DEvAfpWySV0etmsw+e7ECPVcK4ocPenroHYeI6bb+2JNS I7egKp/VOo/MS8GipthEGVWEngFfq2p4aM1P2461KMXKDyMQcKyzIK8TfKIkWTUGctvZK jK/1wuWuSavBH9LoJuQ0PQ/MSN43mA0JmVU= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1682666014174100009 Content-Type: text/plain; charset="utf-8" From: Benny Lin REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4392 Add FDT support in EDK2 by submodule 3rd party libfdt (https://github.com/devicetree-org/pylibfdt/tree/main/libfdt) and refer to LibcLib implementation by Pedro. Cc: Michael D Kinney Cc: Liming Gao Cc: Zhiguang Liu Acked-by: Pedro Falcato Signed-off-by: Benny Lin --- MdePkg/Include/Library/FdtLib.h | 311 ++++++++++++++++++++ MdePkg/Library/BaseFdtLib/BaseFdtLib.inf | 62 ++++ MdePkg/Library/BaseFdtLib/BaseFdtLib.uni | 14 + MdePkg/Library/BaseFdtLib/FdtLib.c | 301 +++++++++++++++++++ MdePkg/Library/BaseFdtLib/LibFdtSupport.h | 99 +++++++ MdePkg/Library/BaseFdtLib/LibFdtWrapper.c | 173 +++++++++++ MdePkg/Library/BaseFdtLib/limits.h | 10 + MdePkg/Library/BaseFdtLib/stdbool.h | 10 + MdePkg/Library/BaseFdtLib/stddef.h | 10 + MdePkg/Library/BaseFdtLib/stdint.h | 10 + MdePkg/Library/BaseFdtLib/stdlib.h | 10 + MdePkg/Library/BaseFdtLib/string.h | 10 + MdePkg/MdePkg.ci.yaml | 15 +- MdePkg/MdePkg.dec | 4 + MdePkg/MdePkg.dsc | 1 + 15 files changed, 1039 insertions(+), 1 deletion(-) diff --git a/MdePkg/Include/Library/FdtLib.h b/MdePkg/Include/Library/FdtLi= b.h new file mode 100644 index 0000000000..1894de6dc3 --- /dev/null +++ b/MdePkg/Include/Library/FdtLib.h @@ -0,0 +1,311 @@ +/** @file + Flattened Device Tree Library. + + All structure data are in big-endian format. Need to call SwapBytes** + function to convert between little-endia and big-endian. + For example, pushing data to FDT blob need convert to big-endian with Sw= apByte**. + For retrieving data from FDT blob need translate to little-endian with S= wapByte**. + Refer to FDT specification: https://www.devicetree.org/specifications/ + + Copyright (c) 2023, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#ifndef FDT_LIB_H_ +#define FDT_LIB_H_ + +/** + Flattened Device Tree definition + + The Devicetree Blob (DTB) format is a binary encoding with big-endian. + When producing or consuming the blob data, must translate with SwapBytes= XX + provided by edk2 BaseLib between big-endian and little-endian. +**/ +typedef struct { + UINT32 Magic; /* magic word FDT_MAGIC */ + UINT32 TotalSize; /* total size of DT block */ + UINT32 OffsetDtStruct; /* offset to structure */ + UINT32 OffsetDtStrings; /* offset to strings */ + UINT32 OffsetMemRsvmap; /* offset to memory reserve map */ + UINT32 Version; /* format version */ + UINT32 LastCompVersion; /* last compatible version */ + + /* version 2 fields below */ + UINT32 BootCpuidPhys; /* Which physical CPU id we're + booting on */ + /* version 3 fields below */ + UINT32 SizeDtStrings; /* size of the strings block */ + + /* version 17 fields below */ + UINT32 SizeDtStruct; /* size of the structure block */ +} FDT_HEADER; + +typedef struct { + UINT64 Address; + UINT64 Size; +} FDT_RESERVE_ENTRY; + +typedef struct { + UINT32 Tag; + CHAR8 Name[]; +} FDT_NODE_HEADER; + +typedef struct { + UINT32 Tag; + UINT32 Length; + UINT32 NameOffset; + CHAR8 Data[]; +} FDT_PROPERTY; + +/** + Verify the header of the Flattened Device Tree + + @param[in] Fdt The pointer to FDT blob. + + @return Zero for successfully, otherwise failed. + +**/ +INT32 +EFIAPI +FdtCheckHeader ( + IN CONST VOID *Fdt + ); + +/** + Create a empty Flattened Device Tree. + + @param[in] Buffer The pointer to allocate a pool for FDT blob. + @param[in] BufferSize The BufferSize to the pool size. + + @return Zero for successfully, otherwise failed. + +**/ +RETURN_STATUS +EFIAPI +FdtCreateEmptyTree ( + IN VOID *Buffer, + IN UINTN BufferSize + ); + +/** + Returns a offset of next node from the given node. + + @param[in] Fdt The pointer to FDT blob. + @param[in] Offset The offset to previous node. + @param[in] Depth The depth to the level of tree hierarchy. + + @return The offset to next node offset. + +**/ +INT32 +EFIAPI +FdtNextNode ( + IN CONST VOID *Fdt, + IN INT32 Offset, + IN INT32 *Depth + ); + +/** + Returns a offset of first node under the given node. + + @param[in] Fdt The pointer to FDT blob. + @param[in] Offset The offset to previous node. + + @return The offset to next node offset. + +**/ +INT32 +EFIAPI +FdtFirstSubnode ( + IN CONST VOID *Fdt, + IN INT32 Offset + ); + +/** + Returns a offset of next node from the given node. + + @param[in] Fdt The pointer to FDT blob. + @param[in] Offset The offset to previous node. + + @return The offset to next node offset. + +**/ +INT32 +EFIAPI +FdtNextSubnode ( + IN CONST VOID *Fdt, + IN INT32 Offset + ); + +/** + Returns a offset of first node which includes the given name. + + @param[in] Fdt The pointer to FDT blob. + @param[in] ParentOffset The offset to the node which start find under. + @param[in] Name The name to search the node with the name. + @param[in] NameLength The length of the name to check only. + + @return The offset to node offset with given node name. + +**/ +INT32 +EFIAPI +FdtSubnodeOffsetNameLen ( + IN CONST VOID *Fdt, + IN INT32 ParentOffset, + IN CONST CHAR8 *Name, + IN INT32 NameLength + ); + +/** + Returns a offset of first node which includes the given property name an= d value. + + @param[in] Fdt The pointer to FDT blob. + @param[in] StartOffset The offset to the starting node to find. + @param[in] PropertyName The property name to search the node includin= g the named property. + @param[in] PropertyValue The property value to check the same property= value. + @param[in] PropertyLength The length of the value in PropertValue. + + @return The offset to node offset with given property. + +**/ +INT32 +EFIAPI +FdtNodeOffsetByPropValue ( + IN CONST VOID *Fdt, + IN INT32 StartOffset, + IN CONST CHAR8 *PropertyName, + IN CONST VOID *PropertyValue, + IN INT32 PropertyLength + ); + +/** + Returns a property with the given name from the given node. + + @param[in] Fdt The pointer to FDT blob. + @param[in] NodeOffset The offset to the given node. + @param[in] Name The name to the property which need be searched + @param[in] Length The length to the size of the property found. + + @return The property to the structure of the found property. + +**/ +CONST FDT_PROPERTY * +EFIAPI +FdtGetProperty ( + IN CONST VOID *Fdt, + IN INT32 NodeOffset, + IN CONST CHAR8 *Name, + IN INT32 *Length + ); + +/** + Returns a offset of first property in the given node. + + @param[in] Fdt The pointer to FDT blob. + @param[in] Offset The offset to the node which need be searched. + + @return The offset to first property offset in the given node. + +**/ +INT32 +EFIAPI +FdtFirstPropertyOffset ( + IN CONST VOID *Fdt, + IN INT32 NodeOffset + ); + +/** + Returns a offset of next property from the given property. + + @param[in] Fdt The pointer to FDT blob. + @param[in] Offset The offset to previous property. + + @return The offset to next property offset. + +**/ +INT32 +EFIAPI +FdtNextPropertyOffset ( + IN CONST VOID *Fdt, + IN INT32 Offset + ); + +/** + Returns a property from the given offset of the property. + + @param[in] Fdt The pointer to FDT blob. + @param[in] Offset The offset to the given offset of the property. + @param[in] Length The length to the size of the property found. + + @return The property to the structure of the given property offset. + +**/ +CONST FDT_PROPERTY * +EFIAPI +FdtGetPropertyByOffset ( + IN CONST VOID *Fdt, + IN INT32 Offset, + IN INT32 *Length + ); + +/** + Returns a string by the given string offset. + + @param[in] Fdt The pointer to FDT blob. + @param[in] StrOffset The offset to the location in the strings bloc= k of FDT. + @param[in] Length The length to the size of string which need be= retrieved. + + @return The string to the given string offset. + +**/ +CONST CHAR8 * +EFIAPI +FdtGetString ( + IN CONST VOID *Fdt, + IN INT32 StrOffset, + IN INT32 *Length OPTIONAL + ); + +/** + Add a new node to the FDT. + + @param[in] Fdt The pointer to FDT blob. + @param[in] ParentOffset The offset to the node offset which want to ad= d in. + @param[in] Name The name to name the node. + + @return The offset to the new node. + +**/ +INT32 +EFIAPI +FdtAddSubnode ( + IN VOID *Fdt, + IN INT32 ParentOffset, + IN CONST CHAR8 *Name + ); + +/** + Add or modify a property in the given node. + + @param[in] Fdt The pointer to FDT blob. + @param[in] NodeOffset The offset to the node offset which want to ad= d in. + @param[in] Name The name to name the property. + @param[in] Value The value to the property value. + @param[in] Length The length to the size of the property. + + @return Zero for successfully, otherwise failed. + +**/ +INT32 +EFIAPI +FdtSetProp ( + IN VOID *Fdt, + IN INT32 NodeOffset, + IN CONST CHAR8 *Name, + IN CONST VOID *Value, + IN UINT32 Length + ); + +#endif /* FDT_LIB_H_ */ diff --git a/MdePkg/Library/BaseFdtLib/BaseFdtLib.inf b/MdePkg/Library/Base= FdtLib/BaseFdtLib.inf new file mode 100644 index 0000000000..730e568ff6 --- /dev/null +++ b/MdePkg/Library/BaseFdtLib/BaseFdtLib.inf @@ -0,0 +1,62 @@ +## @file +# Flattened Device Tree Library. +# +# Copyright (c) 2023, Intel Corporation. All rights reserved.
+# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +# +## + +[Defines] + INF_VERSION =3D 0x0001001B + BASE_NAME =3D BaseFdtLib + MODULE_UNI_FILE =3D BaseFdtLib.uni + FILE_GUID =3D C64DCB01-B037-4FF6-9CF3-E8CEC206DE04 + MODULE_TYPE =3D BASE + VERSION_STRING =3D 1.0 + LIBRARY_CLASS =3D FdtLib + + DEFINE FDT_LIB_PATH =3D libfdt/libfdt + +# +# VALID_ARCHITECTURES =3D IA32 X64 +# + +[Sources] + FdtLib.c + LibFdtWrapper.c + # header Wrapper files + limits.h + stdbool.h + stddef.h + stdint.h + stdlib.h + string.h + + $(FDT_LIB_PATH)/fdt.c + $(FDT_LIB_PATH)/fdt.h + $(FDT_LIB_PATH)/fdt_addresses.c + $(FDT_LIB_PATH)/fdt_check.c + $(FDT_LIB_PATH)/fdt_empty_tree.c + $(FDT_LIB_PATH)/fdt_overlay.c + $(FDT_LIB_PATH)/fdt_ro.c + $(FDT_LIB_PATH)/fdt_rw.c + $(FDT_LIB_PATH)/fdt_strerror.c + $(FDT_LIB_PATH)/fdt_sw.c + $(FDT_LIB_PATH)/fdt_wip.c + $(FDT_LIB_PATH)/libfdt.h + $(FDT_LIB_PATH)/libfdt_env.h + $(FDT_LIB_PATH)/libfdt_internal.h + +[Packages] + MdePkg/MdePkg.dec + +[LibraryClasses] + BaseLib + BaseMemoryLib + +[BuildOptions] + MSFT:*_*_IA32_CC_FLAGS =3D /wd4146 /wd4245 + MSFT:*_*_X64_CC_FLAGS =3D /wd4146 /wd4244 /wd4245 /wd4267 + diff --git a/MdePkg/Library/BaseFdtLib/BaseFdtLib.uni b/MdePkg/Library/Base= FdtLib/BaseFdtLib.uni new file mode 100644 index 0000000000..3f7e45ea6f --- /dev/null +++ b/MdePkg/Library/BaseFdtLib/BaseFdtLib.uni @@ -0,0 +1,14 @@ +// /** @file +// Flattened Device Tree Library. +// +// Copyright (c) 2023, Intel Corporation. All rights reserved.
+// +// SPDX-License-Identifier: BSD-2-Clause-Patent +// +// **/ + + +#string STR_MODULE_ABSTRACT #language en-US "Instance of FDT L= ibrary" + +#string STR_MODULE_DESCRIPTION #language en-US "This module provi= des FDT Library implementation." + diff --git a/MdePkg/Library/BaseFdtLib/FdtLib.c b/MdePkg/Library/BaseFdtLib= /FdtLib.c new file mode 100644 index 0000000000..ba95b41007 --- /dev/null +++ b/MdePkg/Library/BaseFdtLib/FdtLib.c @@ -0,0 +1,301 @@ +/** @file + Flattened Device Tree Library. + + Copyright (c) 2023, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include + +/** + Verify the header of the Flattened Device Tree + + @param[in] Fdt The pointer to FDT blob. + + @return Zero for successfully, otherwise failed. + +**/ +INT32 +EFIAPI +FdtCheckHeader ( + IN CONST VOID *Fdt + ) +{ + return fdt_check_header (Fdt); +} + +/** + Create a empty Flattened Device Tree. + + @param[in] Buffer The pointer to allocate a pool for FDT blob. + @param[in] BufferSize The BufferSize to the pool size. + + @return Zero for successfully, otherwise failed. + +**/ +INT32 +EFIAPI +FdtCreateEmptyTree ( + IN VOID *Buffer, + IN UINT32 BufferSize + ) +{ + return fdt_create_empty_tree (Buffer, (int)BufferSize); +} + +/** + Returns a offset of next node from the given node. + + @param[in] Fdt The pointer to FDT blob. + @param[in] Offset The offset to previous node. + @param[in] Depth The depth to the level of tree hierarchy. + + @return The offset to next node offset. + +**/ +INT32 +EFIAPI +FdtNextNode ( + IN CONST VOID *Fdt, + IN INT32 Offset, + IN INT32 *Depth + ) +{ + return fdt_next_node (Fdt, Offset, Depth); +} + +/** + Returns a offset of first node under the given node. + + @param[in] Fdt The pointer to FDT blob. + @param[in] Offset The offset to previous node. + + @return The offset to next node offset. + +**/ +INT32 +EFIAPI +FdtFirstSubnode ( + IN CONST VOID *Fdt, + IN INT32 Offset + ) +{ + return fdt_first_subnode (Fdt, Offset); +} + +/** + Returns a offset of next node from the given node. + + @param[in] Fdt The pointer to FDT blob. + @param[in] Offset The offset to previous node. + + @return The offset to next node offset. + +**/ +INT32 +EFIAPI +FdtNextSubnode ( + IN CONST VOID *Fdt, + IN INT32 Offset + ) +{ + return fdt_next_subnode (Fdt, Offset); +} + +/** + Returns a offset of first node which includes the given name. + + @param[in] Fdt The pointer to FDT blob. + @param[in] ParentOffset The offset to the node which start find under. + @param[in] Name The name to search the node with the name. + @param[in] NameLength The length of the name to check only. + + @return The offset to node offset with given node name. + +**/ +INT32 +EFIAPI +FdtSubnodeOffsetNameLen ( + IN CONST VOID *Fdt, + IN INT32 ParentOffset, + IN CONST CHAR8 *Name, + IN INT32 NameLength + ) +{ + return fdt_subnode_offset_namelen (Fdt, ParentOffset, Name, NameLength); +} + +/** + Returns a offset of first node which includes the given property name an= d value. + + @param[in] Fdt The pointer to FDT blob. + @param[in] StartOffset The offset to the starting node to find. + @param[in] PropertyName The property name to search the node includin= g the named property. + @param[in] PropertyValue The property value to check the same property= value. + @param[in] PropertyLength The length of the value in PropertValue. + + @return The offset to node offset with given property. + +**/ +INT32 +EFIAPI +FdtNodeOffsetByPropValue ( + IN CONST VOID *Fdt, + IN INT32 StartOffset, + IN CONST CHAR8 *PropertyName, + IN CONST VOID *PropertyValue, + IN INT32 PropertyLength + ) +{ + return fdt_node_offset_by_prop_value (Fdt, StartOffset, PropertyName, Pr= opertyValue, PropertyLength); +} + +/** + Returns a property with the given name from the given node. + + @param[in] Fdt The pointer to FDT blob. + @param[in] NodeOffset The offset to the given node. + @param[in] Name The name to the property which need be searched + @param[in] Length The length to the size of the property found. + + @return The property to the structure of the found property. + +**/ +CONST struct fdt_property * +EFIAPI +FdtGetProperty ( + IN CONST VOID *Fdt, + IN INT32 NodeOffset, + IN CONST CHAR8 *Name, + IN INT32 *Length + ) +{ + return fdt_get_property (Fdt, NodeOffset, Name, Length); +} + +/** + Returns a offset of first property in the given node. + + @param[in] Fdt The pointer to FDT blob. + @param[in] NodeOffset The offset to the node which need be searched. + + @return The offset to first property offset in the given node. + +**/ +INT32 +EFIAPI +FdtFirstPropertyOffset ( + IN CONST VOID *Fdt, + IN INT32 NodeOffset + ) +{ + return fdt_first_property_offset (Fdt, NodeOffset); +} + +/** + Returns a offset of next property from the given property. + + @param[in] Fdt The pointer to FDT blob. + @param[in] Offset The offset to previous property. + + @return The offset to next property offset. + +**/ +INT32 +EFIAPI +FdtNextPropertyOffset ( + IN CONST VOID *Fdt, + IN INT32 Offset + ) +{ + return fdt_next_property_offset (Fdt, Offset); +} + +/** + Returns a property from the given offset of the property. + + @param[in] Fdt The pointer to FDT blob. + @param[in] Offset The offset to the given offset of the property. + @param[in] Length The length to the size of the property found. + + @return The property to the structure of the given property offset. + +**/ +CONST struct fdt_property * +EFIAPI +FdtGetPropertyByOffset ( + IN CONST VOID *Fdt, + IN INT32 Offset, + IN INT32 *Length + ) +{ + return fdt_get_property_by_offset (Fdt, Offset, Length); +} + +/** + Returns a string by the given string offset. + + @param[in] Fdt The pointer to FDT blob. + @param[in] StrOffset The offset to the location in the strings bloc= k of FDT. + @param[in] Length The length to the size of string which need be= retrieved. + + @return The string to the given string offset. + +**/ +CONST CHAR8 * +EFIAPI +FdtGetString ( + IN CONST VOID *Fdt, + IN INT32 StrOffset, + IN INT32 *Length OPTIONAL + ) +{ + return fdt_get_string (Fdt, StrOffset, Length); +} + +/** + Add a new node to the FDT. + + @param[in] Fdt The pointer to FDT blob. + @param[in] ParentOffset The offset to the node offset which want to ad= d in. + @param[in] Name The name to name the node. + + @return The offset to the new node. + +**/ +INT32 +EFIAPI +FdtAddSubnode ( + IN VOID *Fdt, + IN INT32 ParentOffset, + IN CONST CHAR8 *Name + ) +{ + return fdt_add_subnode (Fdt, ParentOffset, Name); +} + +/** + Add or modify a property in the given node. + + @param[in] Fdt The pointer to FDT blob. + @param[in] NodeOffset The offset to the node offset which want to ad= d in. + @param[in] Name The name to name the property. + @param[in] Value The value to the property value. + @param[in] Length The length to the size of the property. + + @return Zero for successfully, otherwise failed. + +**/ +INT32 +EFIAPI +FdtSetProp ( + IN VOID *Fdt, + IN INT32 NodeOffset, + IN CONST CHAR8 *Name, + IN CONST VOID *Value, + IN UINT32 Length + ) +{ + return fdt_setprop (Fdt, NodeOffset, Name, Value, (int)Length); +} diff --git a/MdePkg/Library/BaseFdtLib/LibFdtSupport.h b/MdePkg/Library/Bas= eFdtLib/LibFdtSupport.h new file mode 100644 index 0000000000..393019324b --- /dev/null +++ b/MdePkg/Library/BaseFdtLib/LibFdtSupport.h @@ -0,0 +1,99 @@ +/** @file + Root include file of C runtime library to support building the third-par= ty + libfdt library. + + Copyright (c) 2023, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#ifndef FDT_LIB_SUPPORT_H_ +#define FDT_LIB_SUPPORT_H_ + +#include +#include +#include + +typedef UINT8 uint8_t; +typedef UINT16 uint16_t; +typedef INT32 int32_t; +typedef UINT32 uint32_t; +typedef UINT64 uint64_t; +typedef UINTN uintptr_t; +typedef UINTN size_t; +typedef BOOLEAN bool; + +#define true (1 =3D=3D 1) +#define false (1 =3D=3D 0) + +// +// Definitions for global constants used by libfdt library routines +// +#define INT_MAX 0x7FFFFFFF /* Maximum (signed) int value */ +#define INT32_MAX 0x7FFFFFFF /* Maximum (signed) int32 value */ +#define UINT32_MAX 0xFFFFFFFF /* Maximum unsigned int32 value */ + +// +// Function prototypes of libfdt Library routines +// +void * +memset ( + void *, + int, + size_t + ); + +int +memcmp ( + const void *, + const void *, + size_t + ); + +int +strcmp ( + const char *, + const char * + ); + +char * +strchr ( + const char *, + int + ); + +char * +strrchr ( + const char *, + int + ); + +unsigned long +strtoul ( + const char *, + char **, + int + ); + +char * +strcpy ( + char *strDest, + const char *strSource + ); + +// +// Macros that directly map functions to BaseLib, BaseMemoryLib, and Debug= Lib functions +// +#define memcpy(dest, source, count) CopyMem(dest,source, (UINTN)(c= ount)) +#define memset(dest, ch, count) SetMem(dest, (UINTN)(count),(U= INT8)(ch)) +#define memchr(buf, ch, count) ScanMem8(buf, (UINTN)(count),(= UINT8)ch) +#define memcmp(buf1, buf2, count) (int)(CompareMem(buf1, buf2, (= UINTN)(count))) +#define memmove(dest, source, count) CopyMem(dest, source, (UINTN)(= count)) +#define strlen(str) (size_t)(AsciiStrLen(str)) +#define strnlen(str, count) (size_t)(AsciiStrnLenS(str, co= unt)) +#define strncpy(strDest, strSource, count) AsciiStrnCpyS(strDest, MAX_STR= ING_SIZE, strSource, (UINTN)count) +#define strcat(strDest, strSource) AsciiStrCatS(strDest, MAX_STRI= NG_SIZE, strSource) +#define strcmp(string1, string2, count) (int)(AsciiStrCmp(string1, str= ing2)) +#define strncmp(string1, string2, count) (int)(AsciiStrnCmp(string1, st= ring2, (UINTN)(count))) + +#endif /* FDT_LIB_SUPPORT_H_ */ diff --git a/MdePkg/Library/BaseFdtLib/LibFdtWrapper.c b/MdePkg/Library/Bas= eFdtLib/LibFdtWrapper.c new file mode 100644 index 0000000000..ef6452914f --- /dev/null +++ b/MdePkg/Library/BaseFdtLib/LibFdtWrapper.c @@ -0,0 +1,173 @@ +/** @file + ISO C implementations of strchr, strrchr and strtoul. + + Copyright (c) 2023, Intel Corporation. All rights reserved.
+ Copyright (c) 2023 Pedro Falcato All rights reserved. + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include + +#define ULONG_MAX 0xFFFFFFFF /* Maximum unsigned long value */ + +// Very quick notes: +// We only go through the string once for both functions +// They are minimal implementations (not speed optimized) of ISO C semanti= cs +// strchr and strrchr also include the null terminator as part of the stri= ng +// so the code gets a bit clunky to handle that case specifically. + +char * +strchr ( + const char *Str, + int Char + ) +{ + char *S; + + S =3D (char *)Str; + + for ( ; ; S++) { + if (*S =3D=3D Char) { + return S; + } + + if (*S =3D=3D '\0') { + return NULL; + } + } +} + +char * +strrchr ( + const char *Str, + int Char + ) +{ + char *S, *last; + + S =3D (char *)Str; + last =3D NULL; + + for ( ; ; S++) { + if (*S =3D=3D Char) { + last =3D S; + } + + if (*S =3D=3D '\0') { + return last; + } + } +} + +STATIC +int +__isspace ( + int ch + ) +{ + // basic ASCII ctype.h:isspace(). Not efficient + return ch =3D=3D '\r' || ch =3D=3D '\n' || ch =3D=3D ' ' || ch =3D=3D '\= t' || ch =3D=3D '\v' || ch =3D=3D '\f'; +} + +unsigned long +strtoul ( + const char *Nptr, + char **EndPtr, + int Base + ) +{ + BOOLEAN Negate; + BOOLEAN Overflow; + unsigned long Val; + + Negate =3D FALSE; + Overflow =3D FALSE; + Val =3D 0; + + // Reject bad numeric bases + if ((Base < 0) || (Base =3D=3D 1) || (Base > 36)) { + return 0; + } + + // Skip whitespace + while (__isspace (*Nptr)) { + Nptr++; + } + + // Check for + or - prefixes + if (*Nptr =3D=3D '-') { + Negate =3D TRUE; + Nptr++; + } else if (*Nptr =3D=3D '+') { + Nptr++; + } + + // Consume the start, autodetecting base if needed + if ((Nptr[0] =3D=3D '0') && ((Nptr[1] =3D=3D 'x') || (Nptr[1] =3D=3D 'X'= )) && ((Base =3D=3D 0) || (Base =3D=3D 16))) { + // Hex + Nptr +=3D 2; + Base =3D 16; + } else if ((Nptr[0] =3D=3D '0') && ((Nptr[1] =3D=3D 'b') || (Nptr[1] =3D= =3D 'B')) && ((Base =3D=3D 0) || (Base =3D=3D 2))) { + // Binary (standard pending C23) + Nptr +=3D 2; + Base =3D 2; + } else if ((Nptr[0] =3D=3D '0') && ((Base =3D=3D 0) || (Base =3D=3D 8)))= { + // Octal + Nptr++; + Base =3D 8; + } else { + if (Base =3D=3D 0) { + // Assume decimal + Base =3D 10; + } + } + + while (TRUE) { + int Digit; + char C; + unsigned long NewVal; + + C =3D *Nptr; + Digit =3D -1; + + if ((C >=3D '0') && (C <=3D '9')) { + Digit =3D C - '0'; + } else if ((C >=3D 'a') && (C <=3D 'z')) { + Digit =3D C - 'a' + 10; + } else if ((C >=3D 'A') && (C <=3D 'Z')) { + Digit =3D C - 'A' + 10; + } + + if ((Digit =3D=3D -1) || (Digit >=3D Base)) { + // Note that this case also handles the \0 + if (EndPtr) { + *EndPtr =3D (char *)Nptr; + } + + break; + } + + NewVal =3D Val * Base + Digit; + + if (NewVal < Val) { + // Overflow + Overflow =3D TRUE; + } + + Val =3D NewVal; + + Nptr++; + } + + if (Negate) { + Val =3D -Val; + } + + if (Overflow) { + Val =3D ULONG_MAX; + } + + // TODO: We're lacking errno here. + return Val; +} diff --git a/MdePkg/Library/BaseFdtLib/limits.h b/MdePkg/Library/BaseFdtLib= /limits.h new file mode 100644 index 0000000000..f6cf8d5702 --- /dev/null +++ b/MdePkg/Library/BaseFdtLib/limits.h @@ -0,0 +1,10 @@ +/** @file + Include file to support building the third-party libfdt library. + +Copyright (c) 2023, Intel Corporation. All rights reserved.
+SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include + diff --git a/MdePkg/Library/BaseFdtLib/stdbool.h b/MdePkg/Library/BaseFdtLi= b/stdbool.h new file mode 100644 index 0000000000..f6cf8d5702 --- /dev/null +++ b/MdePkg/Library/BaseFdtLib/stdbool.h @@ -0,0 +1,10 @@ +/** @file + Include file to support building the third-party libfdt library. + +Copyright (c) 2023, Intel Corporation. All rights reserved.
+SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include + diff --git a/MdePkg/Library/BaseFdtLib/stddef.h b/MdePkg/Library/BaseFdtLib= /stddef.h new file mode 100644 index 0000000000..f6cf8d5702 --- /dev/null +++ b/MdePkg/Library/BaseFdtLib/stddef.h @@ -0,0 +1,10 @@ +/** @file + Include file to support building the third-party libfdt library. + +Copyright (c) 2023, Intel Corporation. All rights reserved.
+SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include + diff --git a/MdePkg/Library/BaseFdtLib/stdint.h b/MdePkg/Library/BaseFdtLib= /stdint.h new file mode 100644 index 0000000000..f6cf8d5702 --- /dev/null +++ b/MdePkg/Library/BaseFdtLib/stdint.h @@ -0,0 +1,10 @@ +/** @file + Include file to support building the third-party libfdt library. + +Copyright (c) 2023, Intel Corporation. All rights reserved.
+SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include + diff --git a/MdePkg/Library/BaseFdtLib/stdlib.h b/MdePkg/Library/BaseFdtLib= /stdlib.h new file mode 100644 index 0000000000..f6cf8d5702 --- /dev/null +++ b/MdePkg/Library/BaseFdtLib/stdlib.h @@ -0,0 +1,10 @@ +/** @file + Include file to support building the third-party libfdt library. + +Copyright (c) 2023, Intel Corporation. All rights reserved.
+SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include + diff --git a/MdePkg/Library/BaseFdtLib/string.h b/MdePkg/Library/BaseFdtLib= /string.h new file mode 100644 index 0000000000..f6cf8d5702 --- /dev/null +++ b/MdePkg/Library/BaseFdtLib/string.h @@ -0,0 +1,10 @@ +/** @file + Include file to support building the third-party libfdt library. + +Copyright (c) 2023, Intel Corporation. All rights reserved.
+SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include + diff --git a/MdePkg/MdePkg.ci.yaml b/MdePkg/MdePkg.ci.yaml index 6ba85ebe61..035c34b3ad 100644 --- a/MdePkg/MdePkg.ci.yaml +++ b/MdePkg/MdePkg.ci.yaml @@ -67,7 +67,8 @@ "Include/Library/PcdLib.h", "Include/Library/SafeIntLib.h", "Include/Protocol/DebugSupport.h", - "Test/UnitTest/Library/BaseSafeIntLib/TestBaseSafeIntLib.c" + "Test/UnitTest/Library/BaseSafeIntLib/TestBaseSafeIntLib.c", + "Library/BaseFdtLib" ] }, ## options defined ci/Plugin/CompilerPlugin @@ -164,5 +165,17 @@ "ExtendWords": [], # words to extend to the dictionary f= or this package "IgnoreStandardPaths": [], # Standard Plugin defined paths that = should be ignore "AdditionalIncludePaths": [] # Additional paths to spell check (wi= ldcards supported) + }, + # options defined in .pytool/Plugin/UncrustifyCheck + "UncrustifyCheck": { + "IgnoreFiles": [ + "Library/BaseFdtLib/libfdt", + "Library/BaseFdtLib/limits.h", + "Library/BaseFdtLib/stdbool.h", + "Library/BaseFdtLib/stddef.h", + "Library/BaseFdtLib/stdint.h", + "Library/BaseFdtLib/stdlib.h", + "Library/BaseFdtLib/string.h" + ] } } diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec index e70182bf7f..9804a7a6bd 100644 --- a/MdePkg/MdePkg.dec +++ b/MdePkg/MdePkg.dec @@ -289,6 +289,10 @@ # ArmTrngLib|Include/Library/ArmTrngLib.h =20 + ## @libraryclass Provides APIs for third-party library libfdt. + # + FdtLib|Include/Library/FdtLib.h + [LibraryClasses.IA32, LibraryClasses.X64, LibraryClasses.AARCH64] ## @libraryclass Provides services to generate random number. # diff --git a/MdePkg/MdePkg.dsc b/MdePkg/MdePkg.dsc index 152c02991a..b38c863812 100644 --- a/MdePkg/MdePkg.dsc +++ b/MdePkg/MdePkg.dsc @@ -137,6 +137,7 @@ MdePkg/Library/SmmCpuRendezvousLibNull/SmmCpuRendezvousLibNull.inf =20 MdePkg/Library/JedecJep106Lib/JedecJep106Lib.inf + MdePkg/Library/BaseFdtLib/BaseFdtLib.inf =20 [Components.IA32, Components.X64, Components.ARM, Components.AARCH64] # --=20 2.39.1.windows.1 -=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 (#103762): https://edk2.groups.io/g/devel/message/103762 Mute This Topic: https://groups.io/mt/98553642/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- From nobody Mon Apr 29 04:05:54 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+103763+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+103763+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1682666013; cv=none; d=zohomail.com; s=zohoarc; b=ETik0OBr0RMhrnXSAQUzAcMVJheOxuo9isdYw1ekXwVTfn/kNQid3go1IRi4jNMbNn7UFh5KfkIVa9oO7LrvbxAAeOqzwuLDhmBXZ2z64TLlWSo3wf6ddHwiK8EOK56T3YXBmWgmmgZ1equDRKKuA4+ZS7z9Iaejzvimatr3s78= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1682666013; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=bB4y6oF/Ppszax0l/Lx56+o9CNGt95zseB6YQN/9OK0=; b=fwhpdBLDhKrUK0j8U6QYJjOHSYNOe/11Jr/3GWVw4UE9+Zq6Bw/wEo1PJQeQHP0p6G+qQbc+j7QcFE5bDpZwX3qF0j6tbE3s6n7xROYxdCKbdO4hmEdDEw2GJeG6S/wRwzINkh1St6AalxzOgZ7w6o6k5OXJ4MSSh+httA9Os2s= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+103763+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1682666013979174.67018341089317; Fri, 28 Apr 2023 00:13:33 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id MfYaYY1788612xC38QS4gBio; Fri, 28 Apr 2023 00:13:33 -0700 X-Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mx.groups.io with SMTP id smtpd.web10.13692.1682666012074048181 for ; Fri, 28 Apr 2023 00:13:33 -0700 X-IronPort-AV: E=McAfee;i="6600,9927,10693"; a="336720049" X-IronPort-AV: E=Sophos;i="5.99,233,1677571200"; d="scan'208";a="336720049" X-Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Apr 2023 00:13:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10693"; a="940999026" X-IronPort-AV: E=Sophos;i="5.99,233,1677571200"; d="scan'208";a="940999026" X-Received: from bennyli1-mobl2.gar.corp.intel.com ([10.252.187.210]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Apr 2023 00:13:31 -0700 From: "Benny Lin" To: devel@edk2.groups.io Cc: Benny Lin , Michael D Kinney , Sean Brogan , Michael Kubacki , Liming Gao Subject: [edk2-devel] [PATCH v5 3/3] .pytool: Support FDT library. Date: Fri, 28 Apr 2023 15:13:11 +0800 Message-Id: <20230428071311.1669-4-benny.lin@intel.com> In-Reply-To: <20230428071311.1669-1-benny.lin@intel.com> References: <20230428071311.1669-1-benny.lin@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: 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,benny.lin@intel.com X-Gm-Message-State: miokLSWOgaBieDmSyPjUT2zix1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1682666013; bh=wUmZ4SMtUWOmwBmVDO6DHWMEp4/FhCk3CWuC6HyYRRc=; h=Cc:Date:From:Reply-To:Subject:To; b=SMkgKe2l1/DvJe03cfTcL0iwLVxID6/ZrSy/RR7k1Rw9uycxqalsNteoqYLsoFYlzq8 sWHRwIXzojAPyU8a3XQwkhH7zuqaBgTr3traMGXwMq1xBnZFv3CgymZNBHGCvKLvahq0i /2OylbfMkWkmgDabCopKHGwhWI6QaNZuip0= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1682666016122100014 Content-Type: text/plain; charset="utf-8" From: Benny Lin REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4392 Add FDT support in EDK2 by submodule 3rd party libfdt (https://github.com/devicetree-org/pylibfdt/tree/main/libfdt) Add RequiredSubmodule object for CI setting. Reviewed-by: Michael D Kinney Cc: Sean Brogan Cc: Michael Kubacki Cc: Michael D Kinney Cc: Liming Gao Signed-off-by: Benny Lin Acked-by: Pedro Falcato --- .pytool/CISettings.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.pytool/CISettings.py b/.pytool/CISettings.py index e3f44add58..2fb99f2a17 100644 --- a/.pytool/CISettings.py +++ b/.pytool/CISettings.py @@ -195,6 +195,8 @@ class Settings(CiBuildSettingsManager, UpdateSettingsMa= nager, SetupSettingsManag "RedfishPkg/Library/JsonLib/jansson", False)) rs.append(RequiredSubmodule( "UnitTestFrameworkPkg/Library/SubhookLib/subhook", False)) + rs.append(RequiredSubmodule( + "MdePkg/Library/BaseFdtLib/libfdt", False)) return rs =20 def GetName(self): --=20 2.39.1.windows.1 -=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 (#103763): https://edk2.groups.io/g/devel/message/103763 Mute This Topic: https://groups.io/mt/98553643/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-