From nobody Fri Apr 26 04:54:02 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+83736+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+83736+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=hpe.com ARC-Seal: i=1; a=rsa-sha256; t=1636948553; cv=none; d=zohomail.com; s=zohoarc; b=iczDmhDUROh3OFIFIFBHmjE36p0weLR49Hx03hCCd9tS2yMnuCnXmAkhDid/qlv1LiivH9RvTwccTY/4kjp5JBj27xx1+XAkvdxRqOmGnBC2RTvV8W4/jIq7aLv6MuFbuJlm00klgY2CJ4nQd5NO4Qlt4i1vsuYROlE/vHVXv6M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1636948553; 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=q1TRtoe1tmmTZwDgPCoQZHqjlsZ2DItDR631IMAg5Nk=; b=coiMrcNMjwwRM9cNu3cVqA9DZLacAVKGGh8MBQoj8EvY7sK1mAgMkZyOTdOuvKDyYWQfL/mBdKc9QUezK1nohxb8aIyJQUV0vrlETPm+ZBDOPtsRhzDlciJn8wl5qnpgjIBGs7MyDdknuTHCk568hTnI87mEk/XMDIog1HYI9XQ= 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+83736+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 1636948553149212.3456719574799; Sun, 14 Nov 2021 19:55:53 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id uWcQYY1788612xaNxfUPbQOy; Sun, 14 Nov 2021 19:55:52 -0800 X-Received: from mx0a-002e3701.pphosted.com (mx0a-002e3701.pphosted.com [148.163.147.86]) by mx.groups.io with SMTP id smtpd.web09.18271.1636948547911060056 for ; Sun, 14 Nov 2021 19:55:52 -0800 X-Received: from pps.filterd (m0150241.ppops.net [127.0.0.1]) by mx0a-002e3701.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 1AEN29W0031059; Mon, 15 Nov 2021 03:55:46 GMT X-Received: from g2t2353.austin.hpe.com (g2t2353.austin.hpe.com [15.233.44.26]) by mx0a-002e3701.pphosted.com with ESMTP id 3ca3wr3r3v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 15 Nov 2021 03:55:46 +0000 X-Received: from g2t2360.austin.hpecorp.net (g2t2360.austin.hpecorp.net [16.196.225.135]) by g2t2353.austin.hpe.com (Postfix) with ESMTP id 3338B6D; Mon, 15 Nov 2021 03:55:44 +0000 (UTC) X-Received: from UB16Abner.asiapacific.hpqcorp.net (ub16abner.asiapacific.hpqcorp.net [15.119.209.229]) by g2t2360.austin.hpecorp.net (Postfix) with ESMTP id 6225736; Mon, 15 Nov 2021 03:55:43 +0000 (UTC) From: "Abner Chang" To: devel@edk2.groups.io Cc: abner.chang@hpe.com, Daniel Schaefer , Sunil V L Subject: [edk2-devel] [edk2-platforms][PATCH 01/14] RiscVPlatformPkg/U500: Pass DTB from PEI to DXE Date: Mon, 15 Nov 2021 10:56:27 +0800 Message-Id: <20211115025640.12897-2-abner.chang@hpe.com> In-Reply-To: <20211115025640.12897-1-abner.chang@hpe.com> References: <20211115025640.12897-1-abner.chang@hpe.com> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: EEOjWH0bogr4Tyb8Dn9_xzUBLjpPrxtu X-Proofpoint-GUID: EEOjWH0bogr4Tyb8Dn9_xzUBLjpPrxtu X-HPE-SCL: -1 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,abner.chang@hpe.com X-Gm-Message-State: 5x8WdR8SPBipvjO7D6JKaMVmx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1636948552; bh=4tP+Mp5925llpSw2YYZLIxsK1bro+Kd44Ql4ehvL99Y=; h=Cc:Date:From:Reply-To:Subject:To; b=IZDdj9iu294t371tqfbMCT9yCdHccL3ZqllDvm0U+bsObdeWByJVVV/mam7m15crnNI S3DchVW6BbO5/qKo5IH8xCIxAjivPWUUQzW80nbnjGEM+GDObWMYy0BfWHhjCr+/BrIKL 6KUquafEfRovZCUME3qVtRsWjyjieKOyG2k= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1636948558737100002 Content-Type: text/plain; charset="utf-8" Add FdtPeim to build for passing DTB from PEI to DXE via HOB. Signed-off-by: Abner Chang Cc: Daniel Schaefer Cc: Sunil V L Reviewed-by: Daniel Schaefer --- Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc | 5 +++++ Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf | 1 + 2 files changed, 6 insertions(+) diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc b/P= latform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc index e680e330ed..e858b0bdea 100644 --- a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc +++ b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc @@ -149,6 +149,9 @@ RiscVPlatformTimerLib|Platform/SiFive/U5SeriesPkg/Library/RiscVPlatformT= imerLib/RiscVPlatformTimerLib.inf CpuExceptionHandlerLib|Silicon/RISC-V/ProcessorPkg/Library/RiscVExceptio= nLib/CpuExceptionHandlerDxeLib.inf =20 + # Flattened Device Tree (FDT) access library + FdtLib|EmbeddedPkg/Library/FdtLib/FdtLib.inf + [LibraryClasses.common.SEC] !ifdef $(DEBUG_ON_SERIAL_PORT) DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf @@ -402,6 +405,8 @@ PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf } =20 + Platform/RISC-V/PlatformPkg/Universal/FdtPeim/FdtPeim.inf + # # DXE Phase modules # diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf b/P= latform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf index 7db3a02bcb..b9d238994b 100644 --- a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf +++ b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf @@ -100,6 +100,7 @@ INF MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf =20 # RISC-V Platform PEI Driver INF Platform/RISC-V/PlatformPkg/Universal/Pei/PlatformPei/PlatformPei.inf +INF Platform/RISC-V/PlatformPkg/Universal/FdtPeim/FdtPeim.inf =20 ##########################################################################= ###### =20 --=20 2.31.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 (#83736): https://edk2.groups.io/g/devel/message/83736 Mute This Topic: https://groups.io/mt/87062610/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 Fri Apr 26 04:54:02 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+83741+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+83741+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=hpe.com ARC-Seal: i=1; a=rsa-sha256; t=1636948559; cv=none; d=zohomail.com; s=zohoarc; b=U+kbCt3utESFJ+SXKdkWYy8bq2ApiZVcwgckXxoSbn/eF6YOuV2i958TgSI7e/+aakzI3NCfuJMpZmIvEpR7XIqWKm/WRYF7XYmgfNMhgmy9fYD6Ej8QiuH8zZDpficmSAuzKzJtNEx8wFusOHGKlMBlPVZaR/8HUTNARTK+X0U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1636948559; 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=A1InisShz3UJJ+7tIT6026tEXBPx04S3jqsyZaKCTak=; b=RytJc6yPBm7wpGpat4XOlgSmHajGLSk6DASsZiT7eAlmZ2oXdWqJ4TrTJ6YEJ6m/9Y74ZEeTk9AvUgGVmeH9uUF95Qc3XPo8uKo0GaWXW0uLx/fiiUyiebSLP1orbe/NGG9bb71MFL5eid49fjKGz2+QgHShpbyyBKpKFYh1lN4= 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+83741+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 1636948559106988.1934288324541; Sun, 14 Nov 2021 19:55:59 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id M5sZYY1788612xyFvMET6LLd; Sun, 14 Nov 2021 19:55:58 -0800 X-Received: from mx0a-002e3701.pphosted.com (mx0a-002e3701.pphosted.com [148.163.147.86]) by mx.groups.io with SMTP id smtpd.web10.17939.1636948548553075420 for ; Sun, 14 Nov 2021 19:55:55 -0800 X-Received: from pps.filterd (m0148663.ppops.net [127.0.0.1]) by mx0a-002e3701.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 1AF1nAUE025614; Mon, 15 Nov 2021 03:55:46 GMT X-Received: from g2t2354.austin.hpe.com (g2t2354.austin.hpe.com [15.233.44.27]) by mx0a-002e3701.pphosted.com with ESMTP id 3cbe7bgk0f-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 15 Nov 2021 03:55:46 +0000 X-Received: from g2t2360.austin.hpecorp.net (g2t2360.austin.hpecorp.net [16.196.225.135]) by g2t2354.austin.hpe.com (Postfix) with ESMTP id D3CDF81; Mon, 15 Nov 2021 03:55:45 +0000 (UTC) X-Received: from UB16Abner.asiapacific.hpqcorp.net (ub16abner.asiapacific.hpqcorp.net [15.119.209.229]) by g2t2360.austin.hpecorp.net (Postfix) with ESMTP id C426137; Mon, 15 Nov 2021 03:55:44 +0000 (UTC) From: "Abner Chang" To: devel@edk2.groups.io Cc: abner.chang@hpe.com, Daniel Schaefer , Sunil V L Subject: [edk2-devel] [edk2-platforms][PATCH 02/14] RiscVPlatformPkg/U500: Fix up FDT and install into config table Date: Mon, 15 Nov 2021 10:56:28 +0800 Message-Id: <20211115025640.12897-3-abner.chang@hpe.com> In-Reply-To: <20211115025640.12897-1-abner.chang@hpe.com> References: <20211115025640.12897-1-abner.chang@hpe.com> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: UImDlXTeURaVEJmY3HDFJ5ErfcGb1t-N X-Proofpoint-GUID: UImDlXTeURaVEJmY3HDFJ5ErfcGb1t-N X-HPE-SCL: -1 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,abner.chang@hpe.com X-Gm-Message-State: L3CuzmzIGABOUUw1T0LktraSx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1636948558; bh=PNWrdLLgZ9UM3Zv4P8BLPMb86dgKg4diIb2OWo1y6u0=; h=Cc:Date:From:Reply-To:Subject:To; b=DrqHK0rwHMf+gjSzoS8vKfQyITwSnsvn05wYT6Oj5uGqP3nSg/KeGilcd9CRsJIkjOp RZ5LjRdqB1pK0TplTiru3SKkI+JLrG/LukUnQWuhbh3lFJ8IdZIMV+LP3595zlu4qqgfH TpLgM+2as6u5BEfO5xTUHTGDRvI5R2qcOaQ= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1636948560897100019 Content-Type: text/plain; charset="utf-8" The Linux EFISTUB reads the FDT from the EFI system configuration table. Before installing the FDT needs to be patched with the booting hartid, because the kernel in S-Mode cannot determine it. Add RISC-V ProcessPkg/FdtDxe driver to build. Signed-off-by: Abner Chang Cc: Daniel Schaefer Cc: Sunil V L Reviewed-by: Daniel Schaefer --- Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc | 2 +- Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc b/P= latform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc index e858b0bdea..8b7c851dbc 100644 --- a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc +++ b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc @@ -515,7 +515,7 @@ MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBusDxe.inf MdeModulePkg/Bus/Usb/UsbKbDxe/UsbKbDxe.inf MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassStorageDxe.inf - + Silicon/RISC-V/ProcessorPkg/Universal/FdtDxe/FdtDxe.inf # # FAT filesystem + GPT/MBR partitioning + UDF filesystem # diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf b/P= latform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf index b9d238994b..cf9b673e97 100644 --- a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf +++ b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf @@ -181,6 +181,7 @@ INF MdeModulePkg/Universal/DisplayEngineDxe/DisplayEng= ineDxe.inf INF MdeModulePkg/Universal/MemoryTest/NullMemoryTestDxe/NullMemoryTestDxe= .inf INF FatPkg/EnhancedFatDxe/Fat.inf INF MdeModulePkg/Universal/Disk/UdfDxe/UdfDxe.inf +INF Silicon/RISC-V/ProcessorPkg/Universal/FdtDxe/FdtDxe.inf =20 !ifndef $(SOURCE_DEBUG_ENABLE) INF MdeModulePkg/Universal/SerialDxe/SerialDxe.inf --=20 2.31.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 (#83741): https://edk2.groups.io/g/devel/message/83741 Mute This Topic: https://groups.io/mt/87062616/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 Fri Apr 26 04:54:02 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+83739+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+83739+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=hpe.com ARC-Seal: i=1; a=rsa-sha256; t=1636948557; cv=none; d=zohomail.com; s=zohoarc; b=ch0nDIIaM+Yus/mRDWaPXOHLDEPx2Qf9R0c8nJ8q42DEoYF0fukR+U5ZEBb5UlIszT/KB/G9BeJJCkZbrEHYMAL2NmchEoGju9KSIzA3RNYMRr4EHDC27NPKK8mUC/nab3CzpZNTeHHnalalOy/hoqF8gxQdm5wmUvxCLVuBUJ4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1636948557; 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=SaJoHbAS220rTH/XoUVMxhPvIiqGawZwA8BtcxdjX3w=; b=n5b4i5/yQkqKJDo8zWhUB6hicjdzgWdv2b7pLT7UX9nvKSpHkedE/noy1/4Sw6foDDSsfbnrDjpgrPP6UQozeLCp1jdYS1z49ku7MMu/aQIacTaEbB+e8jXko+lpdk0gU0SoehP86DSI1D68q3KuinkrjSX9Sntg2g+JZqbdijo= 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+83739+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 1636948557164170.12833858087993; Sun, 14 Nov 2021 19:55:57 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id w1CzYY1788612x0hFVDRcCzD; Sun, 14 Nov 2021 19:55:56 -0800 X-Received: from mx0a-002e3701.pphosted.com (mx0a-002e3701.pphosted.com [148.163.147.86]) by mx.groups.io with SMTP id smtpd.web12.18147.1636948549548999175 for ; Sun, 14 Nov 2021 19:55:55 -0800 X-Received: from pps.filterd (m0134421.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 1AF227wk028403; Mon, 15 Nov 2021 03:55:48 GMT X-Received: from g2t2352.austin.hpe.com (g2t2352.austin.hpe.com [15.233.44.25]) by mx0b-002e3701.pphosted.com with ESMTP id 3ca3jg3sa1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 15 Nov 2021 03:55:48 +0000 X-Received: from g2t2360.austin.hpecorp.net (g2t2360.austin.hpecorp.net [16.196.225.135]) by g2t2352.austin.hpe.com (Postfix) with ESMTP id 478E09C; Mon, 15 Nov 2021 03:55:47 +0000 (UTC) X-Received: from UB16Abner.asiapacific.hpqcorp.net (ub16abner.asiapacific.hpqcorp.net [15.119.209.229]) by g2t2360.austin.hpecorp.net (Postfix) with ESMTP id 32B6E36; Mon, 15 Nov 2021 03:55:46 +0000 (UTC) From: "Abner Chang" To: devel@edk2.groups.io Cc: abner.chang@hpe.com, Daniel Schaefer , Sunil V L Subject: [edk2-devel] [edk2-platforms][PATCH 03/14] RiscVPlatformPkg/U500: Use FirmwareContext library Date: Mon, 15 Nov 2021 10:56:29 +0800 Message-Id: <20211115025640.12897-4-abner.chang@hpe.com> In-Reply-To: <20211115025640.12897-1-abner.chang@hpe.com> References: <20211115025640.12897-1-abner.chang@hpe.com> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: i5saZ048aIFFq0Ikwyc2_5XURdfGNAAf X-Proofpoint-GUID: i5saZ048aIFFq0Ikwyc2_5XURdfGNAAf X-HPE-SCL: -1 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,abner.chang@hpe.com X-Gm-Message-State: 8ZxsUPezf3V3zG2LtmcuZRypx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1636948556; bh=gzOoVANgSMe0opAzDHT/48eHxKS3djxpxa0phB410ds=; h=Cc:Date:From:Reply-To:Subject:To; b=PdcZECC1bhXNUkDl2VJa5LqD0RDj2Rmwh8s6KpMdveF8Vx5OEoRG+y5obotBi6x4Pi3 sVet2z6z27a2Y5VjRnZCcfNHjxpoGIHpIWFWOZ29nZ5Dg61laYO5wR3zcHPGeFzhvgjxo ZlAdA27+pMRSoMnfJjdVdADXxogSVloczdE= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1636948560230100009 Content-Type: text/plain; charset="utf-8" Use RISC-V FirmwareContext library to set and get the pointer of PeiService on SiFive U5 series platforms. Signed-off-by: Abner Chang Cc: Daniel Schaefer Cc: Sunil V L Reviewed-by: Daniel Schaefer --- Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc b/P= latform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc index 8b7c851dbc..e59fdda59f 100644 --- a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc +++ b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc @@ -177,6 +177,7 @@ [LibraryClasses.common.PEI_CORE] HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf PeiServicesTablePointerLib|Silicon/RISC-V/ProcessorPkg/Library/PeiServic= esTablePointerLibOpenSbi/PeiServicesTablePointerLibOpenSbi.inf + RiscVFirmwareContextLib|Silicon/RISC-V/ProcessorPkg/Library/RiscVFirmwar= eContextSscratchLib/RiscVFirmwareContextSscratchLib.inf PeiServicesLib|MdePkg/Library/PeiServicesLib/PeiServicesLib.inf MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAlloc= ationLib.inf PeiCoreEntryPoint|MdePkg/Library/PeiCoreEntryPoint/PeiCoreEntryPoint.inf @@ -193,6 +194,7 @@ [LibraryClasses.common.PEIM] HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf PeiServicesTablePointerLib|Silicon/RISC-V/ProcessorPkg/Library/PeiServic= esTablePointerLibOpenSbi/PeiServicesTablePointerLibOpenSbi.inf + RiscVFirmwareContextLib|Silicon/RISC-V/ProcessorPkg/Library/RiscVFirmwar= eContextSscratchLib/RiscVFirmwareContextSscratchLib.inf PeiServicesLib|MdePkg/Library/PeiServicesLib/PeiServicesLib.inf MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAlloc= ationLib.inf PeimEntryPoint|MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf --=20 2.31.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 (#83739): https://edk2.groups.io/g/devel/message/83739 Mute This Topic: https://groups.io/mt/87062614/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 Fri Apr 26 04:54:02 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+83738+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+83738+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=hpe.com ARC-Seal: i=1; a=rsa-sha256; t=1636948558; cv=none; d=zohomail.com; s=zohoarc; b=DaN5AnwD0e8wf2FjBzQ2Vty5M8gcd1dLv3l000+geGSg71wLaVE5yli174jGG3ufmXCDX4/8uXRz0QogAZkhn0rcxK+Mqoy7RBfZmAoyxt8JXAva5yfGomgaXB0xkOtnVU+Ho3NaN25/vpOrUecYKKnkRiGO9T+YuajUqxK0h3M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1636948558; 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=PVRDbTxEuqBLDbSw4wcjPF9SKt82KJHjkuLqWuHTt9A=; b=Kf4daOIdWWPz9UUV32iltRJW60Jt0ySJK0+bJKqfY6NxleWjLGkymMmRcUF1qDWZ6bUXu9HT92w43X/8Jp28JnWTiuxoXzy2eAE4BmoZU3IsenV5QlxK+HKArc5s/mzNbGLszYORZg3CuFwTNGP+R7PJhxbAwT6IWu/150YfPVk= 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+83738+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 1636948558376580.384201760405; Sun, 14 Nov 2021 19:55:58 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id uRo3YY1788612xufPhtKSsXK; Sun, 14 Nov 2021 19:55:58 -0800 X-Received: from mx0b-002e3701.pphosted.com (mx0b-002e3701.pphosted.com [148.163.143.35]) by mx.groups.io with SMTP id smtpd.web11.18025.1636948550698590155 for ; Sun, 14 Nov 2021 19:55:55 -0800 X-Received: from pps.filterd (m0150244.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 1AEIWNn5007567; Mon, 15 Nov 2021 03:55:49 GMT X-Received: from g2t2353.austin.hpe.com (g2t2353.austin.hpe.com [15.233.44.26]) by mx0b-002e3701.pphosted.com with ESMTP id 3ca617kanm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 15 Nov 2021 03:55:49 +0000 X-Received: from g2t2360.austin.hpecorp.net (g2t2360.austin.hpecorp.net [16.196.225.135]) by g2t2353.austin.hpe.com (Postfix) with ESMTP id A58BB6D; Mon, 15 Nov 2021 03:55:48 +0000 (UTC) X-Received: from UB16Abner.asiapacific.hpqcorp.net (ub16abner.asiapacific.hpqcorp.net [15.119.209.229]) by g2t2360.austin.hpecorp.net (Postfix) with ESMTP id 96B6D36; Mon, 15 Nov 2021 03:55:47 +0000 (UTC) From: "Abner Chang" To: devel@edk2.groups.io Cc: abner.chang@hpe.com, Daniel Schaefer , Sunil V L Subject: [edk2-devel] [edk2-platforms][PATCH 04/14] RiscVPlatformPkg/U500: Use generic platform library Date: Mon, 15 Nov 2021 10:56:30 +0800 Message-Id: <20211115025640.12897-5-abner.chang@hpe.com> In-Reply-To: <20211115025640.12897-1-abner.chang@hpe.com> References: <20211115025640.12897-1-abner.chang@hpe.com> MIME-Version: 1.0 X-Proofpoint-GUID: eNp1QjZ_WKnUsIiF0DJRkfYkvGoB7U2j X-Proofpoint-ORIG-GUID: eNp1QjZ_WKnUsIiF0DJRkfYkvGoB7U2j X-HPE-SCL: -1 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,abner.chang@hpe.com X-Gm-Message-State: oE7E798ekSQDahR8YzrrDiEGx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1636948558; bh=qLPrO4SGMRcryEWluw/NQNNkLfDdl8Y4ON6GUaKhWHU=; h=Cc:Date:From:Reply-To:Subject:To; b=LIwDs1sc92OCeHk2SebRdOenrPQohFqoLDl9kx+HYXyJopVtIPb68c25qmWtnYhUxpW 1VGFULbpMPaNPY6XWpFADPesZaXAJ7YMivRsu+Uqw3pYPyyPrPZm9pwrb9/01AdTKJN9d xSCb1yYDOJcnzmegbsXMvdcLGQrt2u4sDs8= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1636948560598100013 Content-Type: text/plain; charset="utf-8" Also removed the one under U500 package. Signed-off-by: Abner Chang Cc: Daniel Schaefer Cc: Sunil V L Reviewed-by: Daniel Schaefer --- .../FreedomU500VC707Board/U500.dsc | 2 +- .../OpensbiPlatformLib/OpensbiPlatformLib.inf | 54 ----- .../Library/OpensbiPlatformLib/Platform.c | 206 ------------------ 3 files changed, 1 insertion(+), 261 deletions(-) delete mode 100644 Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/Libra= ry/OpensbiPlatformLib/OpensbiPlatformLib.inf delete mode 100644 Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/Libra= ry/OpensbiPlatformLib/Platform.c diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc b/P= latform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc index e59fdda59f..fb1b5b5d22 100644 --- a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc +++ b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc @@ -172,7 +172,7 @@ # # OpenSBi Platform Library # - RiscVOpensbiPlatformLib|Platform/SiFive/U5SeriesPkg/FreedomU500VC707Boar= d/Library/OpensbiPlatformLib/OpensbiPlatformLib.inf + RiscVOpensbiPlatformLib|Platform/RISC-V/PlatformPkg/Library/OpensbiPlatf= ormLib/OpensbiPlatformLib.inf =20 [LibraryClasses.common.PEI_CORE] HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/Library/Open= sbiPlatformLib/OpensbiPlatformLib.inf b/Platform/SiFive/U5SeriesPkg/Freedom= U500VC707Board/Library/OpensbiPlatformLib/OpensbiPlatformLib.inf deleted file mode 100644 index f38b339770..0000000000 --- a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/Library/OpensbiPlat= formLib/OpensbiPlatformLib.inf +++ /dev/null @@ -1,54 +0,0 @@ -## @file -# RISC-V OpenSBI Platform Library -# This is the the library which provides platform -# level opensbi functions follow RISC-V OpenSBI implementation. -# -# Copyright (c) 2019, Hewlett Packard Enterprise Development LP. All righ= ts reserved.
-# -# SPDX-License-Identifier: BSD-2-Clause-Patent -# -## - -[Defines] - INF_VERSION =3D 0x0001001b - BASE_NAME =3D RiscVOpensbiPlatformLib - FILE_GUID =3D 9424ED54-EBDA-4FB5-8FF6-8291B07BB151 - MODULE_TYPE =3D SEC - VERSION_STRING =3D 1.0 - LIBRARY_CLASS =3D RiscVOpensbiPlatformLib - -# -# The following information is for reference only and not required by the = build tools. -# -# VALID_ARCHITECTURES =3D RISCV64 -# - -[Sources] - Platform.c - -[Packages] - EmbeddedPkg/EmbeddedPkg.dec - MdeModulePkg/MdeModulePkg.dec - MdePkg/MdePkg.dec - Platform/SiFive/U5SeriesPkg/U5SeriesPkg.dec - Platform/RISC-V/PlatformPkg/RiscVPlatformPkg.dec - Silicon/RISC-V/ProcessorPkg/RiscVProcessorPkg.dec - -[LibraryClasses] - BaseLib - BaseMemoryLib - DebugLib - DebugAgentLib - FdtLib - PcdLib - PrintLib - RiscVCpuLib - -[FixedPcd] - gUefiRiscVPlatformPkgTokenSpaceGuid.PcdBootHartId - gUefiRiscVPlatformPkgTokenSpaceGuid.PcdHartCount - gUefiRiscVPlatformPkgTokenSpaceGuid.PcdBootableHartNumber - gUefiRiscVPlatformPkgTokenSpaceGuid.PcdOpenSbiStackSize - - gSiFiveU5SeriesPlatformsPkgTokenSpaceGuid.PcdU5UartBase - gSiFiveU5SeriesPlatformsPkgTokenSpaceGuid.PcdU5PlatformSystemClock diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/Library/Open= sbiPlatformLib/Platform.c b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Boa= rd/Library/OpensbiPlatformLib/Platform.c deleted file mode 100644 index b346eccaf0..0000000000 --- a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/Library/OpensbiPlat= formLib/Platform.c +++ /dev/null @@ -1,206 +0,0 @@ -/* - * - * Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All righ= ts reserved.
- * - * SPDX-License-Identifier: BSD-2-Clause - * - * Copyright (c) 2019 Western Digital Corporation or its affiliates. - * - * Authors: - * Atish Patra - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define U500_HART_COUNT FixedPcdGet32(PcdHartCount) -#define U500_BOOTABLE_HART_COUNT FixedPcdGet32(PcdBootableHartNumber) -#define U500_HART_STACK_SIZE FixedPcdGet32(PcdOpenSbiStackSize) -#define U500_BOOT_HART_ID FixedPcdGet32(PcdBootHartId) - -#define U500_SYS_CLK FixedPcdGet32(PcdU5PlatformSystemClock) - -#define U500_PLIC_ADDR 0xc000000 -#define U500_PLIC_NUM_SOURCES 0x35 -#define U500_PLIC_NUM_PRIORITIES 7 - -#define U500_UART_ADDR FixedPcdGet32(PcdU5UartBase) - -#define U500_UART_BAUDRATE 115200 - -/* PRCI clock related macros */ -//TODO: Do we need a separate driver for this ? -#define U500_PRCI_BASE_ADDR 0x10000000 -#define U500_PRCI_CLKMUXSTATUSREG 0x002C -#define U500_PRCI_CLKMUX_STATUS_TLCLKSEL (0x1 << 1) - -/* Full tlb flush always */ -#define U500_TLB_RANGE_FLUSH_LIMIT 0 - -unsigned long log2roundup(unsigned long x); - -static struct plic_data plic =3D { - .addr =3D U500_PLIC_ADDR, - .num_src =3D U500_PLIC_NUM_SOURCES, -}; - -static struct clint_data clint =3D { - .addr =3D CLINT_REG_BASE_ADDR, - .first_hartid =3D 0, - .hart_count =3D U500_HART_COUNT, - .has_64bit_mmio =3D TRUE, -}; - -static void U500_modify_dt(void *fdt) -{ - u32 i, size; - int chosen_offset, err; - int cpu_offset; - char cpu_node[32] =3D ""; - const char *mmu_type; - - for (i =3D 0; i < U500_HART_COUNT; i++) { - sbi_sprintf(cpu_node, "/cpus/cpu@%d", i); - cpu_offset =3D fdt_path_offset(fdt, cpu_node); - mmu_type =3D fdt_getprop(fdt, cpu_offset, "mmu-type", NULL); - if (mmu_type && (!AsciiStrCmp(mmu_type, "riscv,sv39") || - !AsciiStrCmp(mmu_type,"riscv,sv48"))) - continue; - else - fdt_setprop_string(fdt, cpu_offset, "status", "masked"); - memset(cpu_node, 0, sizeof(cpu_node)); - } - size =3D fdt_totalsize(fdt); - err =3D fdt_open_into(fdt, fdt, size + 256); - if (err < 0) - sbi_printf("Device Tree can't be expanded to accmodate new node"); - - chosen_offset =3D fdt_path_offset(fdt, "/chosen"); - fdt_setprop_string(fdt, chosen_offset, "stdout-path", - "/soc/serial@10010000:115200"); - - fdt_plic_fixup(fdt, "riscv,plic0"); -} - -static int U500_final_init(bool cold_boot) -{ - void *fdt; - struct sbi_scratch *ThisScratch; - - if (!cold_boot) - return 0; - - fdt =3D sbi_scratch_thishart_arg1_ptr(); - U500_modify_dt(fdt); - // - // Set PMP of firmware regions to R and X. We will lock this in the en= d of PEI. - // This region only protects SEC, PEI and Scratch buffer. - // - ThisScratch =3D sbi_scratch_thishart_ptr (); - pmp_set(0, PMP_R | PMP_X | PMP_W, ThisScratch->fw_start, log2roundup (= ThisScratch->fw_size)); - return 0; -} - -static int U500_console_init(void) -{ - unsigned long peri_in_freq; - - peri_in_freq =3D U500_SYS_CLK/2; - return sifive_uart_init(U500_UART_ADDR, peri_in_freq, U500_UART_BAUDRA= TE); -} - -static int U500_irqchip_init(bool cold_boot) -{ - int rc; - u32 hartid =3D current_hartid(); - - if (cold_boot) { - rc =3D plic_cold_irqchip_init(&plic); - if (rc) - return rc; - } - - return plic_warm_irqchip_init(&plic, - (hartid) ? (2 * hartid - 1) : 0, - (hartid) ? (2 * hartid) : -1); -} - -static int U500_ipi_init(bool cold_boot) -{ - int rc; - - if (cold_boot) { - rc =3D clint_cold_ipi_init(&clint); - if (rc) - return rc; - - } - - return clint_warm_ipi_init(); -} - -static u64 U500_get_tlbr_flush_limit(void) -{ - return U500_TLB_RANGE_FLUSH_LIMIT; -} - -static int U500_timer_init(bool cold_boot) -{ - int rc; - - if (cold_boot) { - rc =3D clint_cold_timer_init(&clint, NULL); - if (rc) - return rc; - } - - return clint_warm_timer_init(); -} -/** - * The U500 SoC has 4 HARTs, Boot HART ID is determined by - * PcdBootHartId. - */ -static u32 u500_hart_index2id[U500_BOOTABLE_HART_COUNT] =3D {0, 1, 2, 3}; - -static void U500_system_reset(u32 type, u32 second_param) -{ - /* For now nothing to do. */ -} - -const struct sbi_platform_operations platform_ops =3D { - .final_init =3D U500_final_init, - .console_putc =3D sifive_uart_putc, - .console_getc =3D sifive_uart_getc, - .console_init =3D U500_console_init, - .irqchip_init =3D U500_irqchip_init, - .ipi_send =3D clint_ipi_send, - .ipi_clear =3D clint_ipi_clear, - .ipi_init =3D U500_ipi_init, - .get_tlbr_flush_limit =3D U500_get_tlbr_flush_limit, - .timer_value =3D clint_timer_value, - .timer_event_stop =3D clint_timer_event_stop, - .timer_event_start =3D clint_timer_event_start, - .timer_init =3D U500_timer_init, - .system_reset =3D U500_system_reset -}; - -const struct sbi_platform platform =3D { - .opensbi_version =3D OPENSBI_VERSION, // The O= penSBI version this platform table is built bassed on. - .platform_version =3D SBI_PLATFORM_VERSION(0x0001, 0x0000), // SBI P= latform version 1.0 - .name =3D "SiFive Freedom U500", - .features =3D SBI_PLATFORM_DEFAULT_FEATURES, - .hart_count =3D U500_BOOTABLE_HART_COUNT, - .hart_index2id =3D u500_hart_index2id, - .hart_stack_size =3D U500_HART_STACK_SIZE, - .platform_ops_addr =3D (unsigned long)&platform_ops -}; --=20 2.31.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 (#83738): https://edk2.groups.io/g/devel/message/83738 Mute This Topic: https://groups.io/mt/87062613/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 Fri Apr 26 04:54:02 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+83742+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+83742+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=hpe.com ARC-Seal: i=1; a=rsa-sha256; t=1636948559; cv=none; d=zohomail.com; s=zohoarc; b=WuM5eQzWTjVzgnA2ElZUbuSmb52Fy1MuR2pWenSVQue+RHVMUzwAz0YU4qPBgPoR7SYhBktwhTcdQIekxY0Z9Clc+c1Ie7SZRprdhvL0325vbBg4Kr8ADfhnz45clfKc/ow1pGuJrgC4X+A3vbh0n13aDkordfXW+y05RBLD5T0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1636948559; 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=juDVRXIG/ZE2NsLAobjyVC8BImMsjd83cLgsBfGtRkg=; b=BfP0k1Shf2M7GP8WbQusJafhwpUoCD4ji4FirE/8YFuRo16EG1FkE8oCj6dWI0nSqdyXtdm4u8lT5tHe7Bp9LOoaQ2Q/Uj+s4O7lxk7XjDx1z3jD4/jILvglA/bVNYo3c+javK9j82L+iJnFcU1pqi2vBhH8ZUe4SS9EEfFj7eg= 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+83742+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 1636948559469150.61112762788764; Sun, 14 Nov 2021 19:55:59 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id xOy0YY1788612xd0CjK5mIVR; Sun, 14 Nov 2021 19:55:59 -0800 X-Received: from mx0b-002e3701.pphosted.com (mx0b-002e3701.pphosted.com [148.163.143.35]) by mx.groups.io with SMTP id smtpd.web10.17941.1636948551872071330 for ; Sun, 14 Nov 2021 19:55:55 -0800 X-Received: from pps.filterd (m0134423.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 1AENWMoe032299; Mon, 15 Nov 2021 03:55:50 GMT X-Received: from g2t2353.austin.hpe.com (g2t2353.austin.hpe.com [15.233.44.26]) by mx0b-002e3701.pphosted.com with ESMTP id 3ca2vf4byg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 15 Nov 2021 03:55:50 +0000 X-Received: from g2t2360.austin.hpecorp.net (g2t2360.austin.hpecorp.net [16.196.225.135]) by g2t2353.austin.hpe.com (Postfix) with ESMTP id 110E06D; Mon, 15 Nov 2021 03:55:50 +0000 (UTC) X-Received: from UB16Abner.asiapacific.hpqcorp.net (ub16abner.asiapacific.hpqcorp.net [15.119.209.229]) by g2t2360.austin.hpecorp.net (Postfix) with ESMTP id 0375536; Mon, 15 Nov 2021 03:55:48 +0000 (UTC) From: "Abner Chang" To: devel@edk2.groups.io Cc: abner.chang@hpe.com, Daniel Schaefer , Sunil V L Subject: [edk2-devel] [edk2-platforms][PATCH 05/14] RiscVPlatformPkg/U500: Creates opensbi firmware domains Date: Mon, 15 Nov 2021 10:56:31 +0800 Message-Id: <20211115025640.12897-6-abner.chang@hpe.com> In-Reply-To: <20211115025640.12897-1-abner.chang@hpe.com> References: <20211115025640.12897-1-abner.chang@hpe.com> MIME-Version: 1.0 X-Proofpoint-GUID: n6CziG5FxDJacd0CrZKCTamY7WhatlBR X-Proofpoint-ORIG-GUID: n6CziG5FxDJacd0CrZKCTamY7WhatlBR X-HPE-SCL: -1 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,abner.chang@hpe.com X-Gm-Message-State: tB4rAeuWiGc03dO5TFN36U1Ex1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1636948559; bh=EWBbaqdYzoKiCKEPCRzEHHcBJeOFw8Q2gP0XPS/yw4w=; h=Cc:Date:From:Reply-To:Subject:To; b=tNQk74NUFXCKl84Yb86u2RSWghhYjpm6SyhyrmmBUvSOKw2kFQhOXsqP9cM4j/W141W PDtGRIaRQlQRs6MVn4cm/EnEWpEA0lLpQjptmvxuiJ0SwV+0MUaAN5/oSVjPwqVnGro+x VXSAVwuL2JfW5rJqFJh58LEBKma53BuU01U= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1636948561144100023 Content-Type: text/plain; charset="utf-8" Incorporate with opensbi to create three firmware domains, - Addjust the ROM layout. - Boot firmware domain, which built with opensbi library as M-mode access o= nly region. - Firmware domain which includes PEI and DXE regions, the PMP attribute is readable, wriable and executable. - EFI Variable region which is readable and writable. Signed-off-by: Abner Chang Cc: Daniel Schaefer Cc: Sunil V L Reviewed-by: Daniel Schaefer --- .../FreedomU500VC707Board/U500.fdf.inc | 73 ++++++++++++++----- .../FreedomU500VC707Board/VarStore.fdf.inc | 6 +- 2 files changed, 57 insertions(+), 22 deletions(-) diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf.inc= b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf.inc index e88aee8c02..abfb013a92 100644 --- a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf.inc +++ b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf.inc @@ -10,35 +10,70 @@ DEFINE BLOCK_SIZE =3D 0x1000 =20 DEFINE FW_BASE_ADDRESS =3D 0x80000000 -DEFINE FW_SIZE =3D 0x00800000 -DEFINE FW_BLOCKS =3D 0x800 +DEFINE FW_SIZE =3D 0x00900000 +DEFINE FW_BLOCKS =3D 0x900 =20 # -# 0x000000-0x7DFFFF code -# 0x7E0000-0x800000 variables +# 0x000000-0x800000 code +# 0x800000-0x818000 variables # DEFINE CODE_BASE_ADDRESS =3D 0x80000000 -DEFINE CODE_SIZE =3D 0x007E0000 -DEFINE CODE_BLOCKS =3D 0x7E0 +DEFINE CODE_SIZE =3D 0x00800000 +DEFINE CODE_BLOCKS =3D 0x800 DEFINE VARS_BLOCKS =3D 0x20 =20 -DEFINE SECFV_OFFSET =3D 0x00000000 -DEFINE SECFV_SIZE =3D 0x00030000 -DEFINE PEIFV_OFFSET =3D 0x00030000 -DEFINE PEIFV_SIZE =3D 0x00080000 -DEFINE SCRATCH_OFFSET =3D 0x000b0000 -DEFINE SCRATCH_SIZE =3D 0x00010000 -DEFINE FVMAIN_OFFSET =3D 0x00100000 # Must be power of 2 for PMP setti= ng -DEFINE FVMAIN_SIZE =3D 0x0018C000 -DEFINE VARS_OFFSET =3D 0x007E0000 -DEFINE VARS_SIZE =3D 0x00020000 +# +# SEC + opensbi library is the root FW domain. +# The base address must be round up to log2. +# +DEFINE SECFV_OFFSET =3D 0x00000000 +DEFINE SECFV_SIZE =3D 0x00040000 +DEFINE ROOT_FW_DOMAIN_SIZE =3D $(SECFV_SIZE) + +# +# Other FV regions are in the second FW domain. +# The size of memory region must be power of 2. +# The base address must be aligned with the size. +# +# FW memory region +# +DEFINE PEIFV_OFFSET =3D 0x00400000 +DEFINE PEIFV_SIZE =3D 0x00180000 +DEFINE FVMAIN_OFFSET =3D 0x00580000 +DEFINE FVMAIN_SIZE =3D 0x00280000 + +# +# EFI Variable memory region. +# The total size of EFI Variable FD must include +# all of sub regions of EFI Variable +# +DEFINE VARS_OFFSET =3D 0x00800000 +DEFINE VARS_SIZE =3D 0x00007000 +DEFINE VARS_FTW_WORKING_OFFSET =3D 0x00807000 +DEFINE VARS_FTW_WORKING_SIZE =3D 0x00001000 +DEFINE VARS_FTW_SPARE_OFFSET =3D 0x00808000 +DEFINE VARS_FTW_SPARE_SIZE =3D 0x00018000 + +# +# Scratch area memory region +# +DEFINE SCRATCH_OFFSET =3D 0x00840000 +DEFINE SCRATCH_SIZE =3D 0x00010000 + +DEFINE FW_DOMAIN_SIZE =3D $(FVMAIN_OFFSET) + $(FVMAIN_SIZE) - $(PEIFV_O= FFSET) +DEFINE VARIABLE_FW_SIZE =3D $(VARS_FTW_SPARE_OFFSET) + $(VARS_FTW_SPARE_S= IZE) - $(VARS_OFFSET) + +SET gUefiRiscVPlatformPkgTokenSpaceGuid.PcdRootFirmwareDomainBaseAddress = =3D $(CODE_BASE_ADDRESS) + $(SECFV_OFFSET) +SET gUefiRiscVPlatformPkgTokenSpaceGuid.PcdRootFirmwareDomainSize = =3D $(ROOT_FW_DOMAIN_SIZE) +SET gUefiRiscVPlatformPkgTokenSpaceGuid.PcdFirmwareDomainBaseAddress = =3D $(CODE_BASE_ADDRESS) + $(PEIFV_OFFSET) +SET gUefiRiscVPlatformPkgTokenSpaceGuid.PcdFirmwareDomainSize = =3D $(FW_DOMAIN_SIZE) =20 SET gUefiRiscVPlatformPkgTokenSpaceGuid.PcdVariableFdBaseAddress =3D $(FW_= BASE_ADDRESS) + $(VARS_OFFSET) -SET gUefiRiscVPlatformPkgTokenSpaceGuid.PcdVariableFdSize =3D $(VAR= S_SIZE) +SET gUefiRiscVPlatformPkgTokenSpaceGuid.PcdVariableFdSize =3D $(VAR= S_SIZE) + $(VARS_FTW_WORKING_SIZE) + $(VARS_FTW_SPARE_SIZE) SET gUefiRiscVPlatformPkgTokenSpaceGuid.PcdVariableFdBlockSize =3D $(BLO= CK_SIZE) +SET gUefiRiscVPlatformPkgTokenSpaceGuid.PcdVariableFirmwareRegionBaseAddre= ss =3D $(CODE_BASE_ADDRESS) + $(VARS_OFFSET) +SET gUefiRiscVPlatformPkgTokenSpaceGuid.PcdVariableFirmwareRegionSize = =3D $(VARIABLE_FW_SIZE) =20 -SET gUefiRiscVPlatformPkgTokenSpaceGuid.PcdFwStartAddress =3D $(CODE_BASE_= ADDRESS) -SET gUefiRiscVPlatformPkgTokenSpaceGuid.PcdFwEndAddress =3D $(CODE_BASE_AD= DRESS) + $(SECFV_SIZE) + $(PEIFV_SIZE) + $(SCRATCH_SIZE) SET gUefiRiscVPlatformPkgTokenSpaceGuid.PcdOpenSbiStackSize =3D 8192 SET gUefiRiscVPlatformPkgTokenSpaceGuid.PcdScratchRamBase =3D $(CODE_BASE_= ADDRESS) + $(SCRATCH_OFFSET) SET gUefiRiscVPlatformPkgTokenSpaceGuid.PcdScratchRamSize =3D $(SCRATCH_SI= ZE) diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/VarStore.fdf= .inc b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/VarStore.fdf.inc index c287bb4336..d7d75fa494 100644 --- a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/VarStore.fdf.inc +++ b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/VarStore.fdf.inc @@ -9,7 +9,7 @@ # ## =20 -$(VARS_OFFSET)|0x00007000 +$(VARS_OFFSET)|$(VARS_SIZE) gUefiRiscVPlatformPkgTokenSpaceGuid.PcdPlatformFlashNvStorageVariableBase|= gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize # # NV_VARIABLE_STORE @@ -56,7 +56,7 @@ DATA =3D { 0x5A, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } =20 -0x007e7000|0x00001000 +$(VARS_FTW_WORKING_OFFSET)|$(VARS_FTW_WORKING_SIZE) gUefiRiscVPlatformPkgTokenSpaceGuid.PcdPlatformFlashNvStorageFtwWorkingBas= e|gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize # #NV_FTW_WROK @@ -72,7 +72,7 @@ DATA =3D { 0xE0, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } =20 -0x007e8000|0x00018000 +$(VARS_FTW_SPARE_OFFSET)|$(VARS_FTW_SPARE_SIZE) gUefiRiscVPlatformPkgTokenSpaceGuid.PcdPlatformFlashNvStorageFtwSpareBase|= gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize # #NV_FTW_SPARE --=20 2.31.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 (#83742): https://edk2.groups.io/g/devel/message/83742 Mute This Topic: https://groups.io/mt/87062617/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 Fri Apr 26 04:54:02 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+83743+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+83743+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=hpe.com ARC-Seal: i=1; a=rsa-sha256; t=1636948560; cv=none; d=zohomail.com; s=zohoarc; b=jy0Gbzqtjn4Z9i2+ULe5XQ/4c+mgbD16Az1Rczc3hqwH1qUt2smc7fjdMnmrJj+zPL0Jvmj+CHZCP1TAOpF8Vuu1HgvKirWB5eigw0DlawRpQPY/CudLCyQJTpatwFkG+Qhi8Jagv063TDSW9cj1CL+crEHkydUqCEOWRZMfsE4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1636948560; 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=lAv5LCEbBEtI5dUA0RXKV3a7O1TeWwcvR7Y1vlEzps0=; b=D8zH6QW8fPLNKF5wHRJ4s3cOVxNGAxyHlRt4B7ol+imU7zxwCjh/iGlwWw3CKgFLvCLL4VhpSBv0oehrFLzIQECbkAuT7KhVCPAp0jeQPa5G7txnxI9T/pHrOOqiWtkIkjDpD+XEIyi8uXFBdhd3rNIDo9tPtpUePoRdWVfk430= 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+83743+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 1636948560227978.2600621267168; Sun, 14 Nov 2021 19:56:00 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id A7YNYY1788612x78Nxr7dzm9; Sun, 14 Nov 2021 19:55:59 -0800 X-Received: from mx0b-002e3701.pphosted.com (mx0b-002e3701.pphosted.com [148.163.143.35]) by mx.groups.io with SMTP id smtpd.web12.18149.1636948552954208823 for ; Sun, 14 Nov 2021 19:55:55 -0800 X-Received: from pps.filterd (m0134424.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 1AELU01p002751; Mon, 15 Nov 2021 03:55:52 GMT X-Received: from g2t2353.austin.hpe.com (g2t2353.austin.hpe.com [15.233.44.26]) by mx0b-002e3701.pphosted.com with ESMTP id 3ca4bsusgu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 15 Nov 2021 03:55:52 +0000 X-Received: from g2t2360.austin.hpecorp.net (g2t2360.austin.hpecorp.net [16.196.225.135]) by g2t2353.austin.hpe.com (Postfix) with ESMTP id 7B8C46D; Mon, 15 Nov 2021 03:55:51 +0000 (UTC) X-Received: from UB16Abner.asiapacific.hpqcorp.net (ub16abner.asiapacific.hpqcorp.net [15.119.209.229]) by g2t2360.austin.hpecorp.net (Postfix) with ESMTP id 63CD136; Mon, 15 Nov 2021 03:55:50 +0000 (UTC) From: "Abner Chang" To: devel@edk2.groups.io Cc: abner.chang@hpe.com, Daniel Schaefer , Sunil V L Subject: [edk2-devel] [edk2-platforms][PATCH 06/14] RiscVPlatformPkg/U500: Uses RISC-V PeiCoreEntryPoint library Date: Mon, 15 Nov 2021 10:56:32 +0800 Message-Id: <20211115025640.12897-7-abner.chang@hpe.com> In-Reply-To: <20211115025640.12897-1-abner.chang@hpe.com> References: <20211115025640.12897-1-abner.chang@hpe.com> MIME-Version: 1.0 X-Proofpoint-GUID: zP7IyhbfzhyDzFvW77cHXJdtr4IczoAT X-Proofpoint-ORIG-GUID: zP7IyhbfzhyDzFvW77cHXJdtr4IczoAT X-HPE-SCL: -1 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,abner.chang@hpe.com X-Gm-Message-State: bX0Awkz8to9Q1wDhC6F5u6C4x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1636948559; bh=dhrI5pWnxdohGHYAqCDa9Ms6Ztfkdx31Fb2u6e4DwY0=; h=Cc:Date:From:Reply-To:Subject:To; b=E5otc0zfDqkCliuS51pL87ZAbPHNLQlj5sO3UI/R9pJBXzg6KpiCvTSULgh7gmL2pMq 5YHnqdFAXGPUIJG653nzu2Q1BsCydBe/Qk2cU2InNY32Zlr+2jQA9R35vbT8Sh09TYxKD RfdCRNj3slB2+5uB2nwgiZ/IH8elLdWm93M= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1636948561353100029 Content-Type: text/plain; charset="utf-8" 1. Use RISC-V PeiCoreEntryPoint library instance for opensbi to switch to the next phase with arg0 as HART Id and arg1 as the SEC to PEI handoff data. 2. Introduce EDK2 opensbi platform operation functions. With this, OEM can has its won platform initialization code before and/or after opensbi vendor platform functions. Signed-off-by: Abner Chang Cc: Daniel Schaefer Cc: Sunil V L Reviewed-by: Daniel Schaefer --- Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc b/P= latform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc index fb1b5b5d22..398da5238c 100644 --- a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc +++ b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc @@ -190,6 +190,8 @@ DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf !endif PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf + # RISC-V platform PEI core entry point. + PeiCoreEntryPoint|Platform/RISC-V/PlatformPkg/Library/PeiCoreEntryPoint/= PeiCoreEntryPoint.inf =20 [LibraryClasses.common.PEIM] HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf --=20 2.31.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 (#83743): https://edk2.groups.io/g/devel/message/83743 Mute This Topic: https://groups.io/mt/87062618/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 Fri Apr 26 04:54:02 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+83737+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+83737+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=hpe.com ARC-Seal: i=1; a=rsa-sha256; t=1636948555; cv=none; d=zohomail.com; s=zohoarc; b=O3DrFTOwkwTEqZcJvbw8fAKduQsiTma7vX3KjwalsmhWaPioKfmP0FpaL7FqAbI/7zBQFuDaf+T5uX4XHIq4nCw86kIhZg9/pU+uSEK+J4d1wrR+fppXwZtlOZg4rYpTdRbtnLaX/lq3HR2IH5P6o1GhfDpHuFqpQiF42JaUfJs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1636948555; 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=kLSsJd4qoQHtSDNU8eKflo1EdPRIBNu+cgpjDHhN45c=; b=fz24aYJ/QmAAiQYiKyLcOw5mozXCE4nl1yhEfPDPk+YWYS+4rVRjGnK6uXae9t/Oy5aH+JZrQiumMzqwNEsQggZNW1aVpvpf+sg0Ru1C0cb1Ca583/sdQs8PVsFvCSTt+9hBimseTY+N2P0qsPE5kjaiT+u6cVjwKbOw/3+okgI= 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+83737+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 1636948555050307.4446044309093; Sun, 14 Nov 2021 19:55:55 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id rvOAYY1788612xr7Mc7jIsBm; Sun, 14 Nov 2021 19:55:54 -0800 X-Received: from mx0a-002e3701.pphosted.com (mx0a-002e3701.pphosted.com [148.163.147.86]) by mx.groups.io with SMTP id smtpd.web08.18245.1636948553958639890 for ; Sun, 14 Nov 2021 19:55:54 -0800 X-Received: from pps.filterd (m0150241.ppops.net [127.0.0.1]) by mx0a-002e3701.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 1AF3VwCo018590; Mon, 15 Nov 2021 03:55:53 GMT X-Received: from g2t2354.austin.hpe.com (g2t2354.austin.hpe.com [15.233.44.27]) by mx0a-002e3701.pphosted.com with ESMTP id 3ca3wr3r4a-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 15 Nov 2021 03:55:53 +0000 X-Received: from g2t2360.austin.hpecorp.net (g2t2360.austin.hpecorp.net [16.196.225.135]) by g2t2354.austin.hpe.com (Postfix) with ESMTP id E789A91; Mon, 15 Nov 2021 03:55:52 +0000 (UTC) X-Received: from UB16Abner.asiapacific.hpqcorp.net (ub16abner.asiapacific.hpqcorp.net [15.119.209.229]) by g2t2360.austin.hpecorp.net (Postfix) with ESMTP id CE49436; Mon, 15 Nov 2021 03:55:51 +0000 (UTC) From: "Abner Chang" To: devel@edk2.groups.io Cc: abner.chang@hpe.com, Daniel Schaefer , Sunil V L Subject: [edk2-devel] [edk2-platforms][PATCH 07/14] RiscVPlatformPkg/U500: Use PlatormSecPpiLib Date: Mon, 15 Nov 2021 10:56:33 +0800 Message-Id: <20211115025640.12897-8-abner.chang@hpe.com> In-Reply-To: <20211115025640.12897-1-abner.chang@hpe.com> References: <20211115025640.12897-1-abner.chang@hpe.com> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: 30H8IfjbJONa_Rxa1C2Fwkq8puAJ5M9i X-Proofpoint-GUID: 30H8IfjbJONa_Rxa1C2Fwkq8puAJ5M9i X-HPE-SCL: -1 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,abner.chang@hpe.com X-Gm-Message-State: tI8HaNna2Ny5rajghzWzvIx2x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1636948554; bh=G57M7BLb6KOB3VT3Zr37mLAyGgKSaR/qxgOWwqlQT6M=; h=Cc:Date:From:Reply-To:Subject:To; b=j4l1GDSNo59yBREScvV5COhJyv47L4oQKPudvACatq658FI8GJJeUindYfMMIcvVyUW SsoQ3Nxggu709v+9P1LSYCTD9fF5Y416xq2H5tztqe4OagdCWy/SC7r2A59cvnzi9Ct/I QynUkYf6SdfE3SQFNrT4sA8J6wQg+MYollY= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1636948559570100005 Content-Type: text/plain; charset="utf-8" Use PlatormSecPpiLib on U500 platform. Signed-off-by: Abner Chang Cc: Daniel Schaefer Cc: Sunil V L Reviewed-by: Daniel Schaefer --- Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc | 1 + 1 file changed, 1 insertion(+) diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc b/P= latform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc index 398da5238c..9c9a676de5 100644 --- a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc +++ b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc @@ -192,6 +192,7 @@ PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf # RISC-V platform PEI core entry point. PeiCoreEntryPoint|Platform/RISC-V/PlatformPkg/Library/PeiCoreEntryPoint/= PeiCoreEntryPoint.inf + PlatformSecPpiLib|Platform/SiFive/U5SeriesPkg/Library/PlatformSecPpiLib/= PlatformSecPpiLib.inf =20 [LibraryClasses.common.PEIM] HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf --=20 2.31.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 (#83737): https://edk2.groups.io/g/devel/message/83737 Mute This Topic: https://groups.io/mt/87062611/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 Fri Apr 26 04:54:02 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+83744+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+83744+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=hpe.com ARC-Seal: i=1; a=rsa-sha256; t=1636948560; cv=none; d=zohomail.com; s=zohoarc; b=L0A7riOmgqEEJy0xz1Up3AiyCzGGMSbLyg2qGVRSL+G1Ax/qreFbEYNaKJViG4NQjtr+YEonIQrA1+XxIBDOA2Smwm7hNGo8iqWqQ1TFG9+zmNFRXtdjLt01bX7VGj+vS0CQR3mDYdqxMu3H0If5DlK3TAwzaO2hUbMpph+C4LI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1636948560; 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=jX+jLNO6Hc2czkwaGGuy9w8djj4NeSb6a8OY2Kn97xM=; b=mX633c6Os/E2YSVrJXbNHy1uYmXfHlkWhCGZ4fXpcnmivambtqDjBttQ9QoTJJjEJl0EJLNbgAiGtSwR9xW6hEt8tBQMP0XWW1LYELS0tjHRibGafXKsF4axx3K3UNCuvqfrVSqvZPZZ9jKtEeoE1eyMY76Uink4ZBIUoJTlqH4= 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+83744+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 1636948560628151.27220157060117; Sun, 14 Nov 2021 19:56:00 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id nR98YY1788612xdO0MSJUtAH; Sun, 14 Nov 2021 19:56:00 -0800 X-Received: from mx0a-002e3701.pphosted.com (mx0a-002e3701.pphosted.com [148.163.147.86]) by mx.groups.io with SMTP id smtpd.web08.18246.1636948556860411929 for ; Sun, 14 Nov 2021 19:55:56 -0800 X-Received: from pps.filterd (m0150242.ppops.net [127.0.0.1]) by mx0a-002e3701.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 1AEIkvQt015938; Mon, 15 Nov 2021 03:55:55 GMT X-Received: from g2t2354.austin.hpe.com (g2t2354.austin.hpe.com [15.233.44.27]) by mx0a-002e3701.pphosted.com with ESMTP id 3caq0jpnyb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 15 Nov 2021 03:55:55 +0000 X-Received: from g2t2360.austin.hpecorp.net (g2t2360.austin.hpecorp.net [16.196.225.135]) by g2t2354.austin.hpe.com (Postfix) with ESMTP id 5DF9381; Mon, 15 Nov 2021 03:55:54 +0000 (UTC) X-Received: from UB16Abner.asiapacific.hpqcorp.net (ub16abner.asiapacific.hpqcorp.net [15.119.209.229]) by g2t2360.austin.hpecorp.net (Postfix) with ESMTP id 45D0C39; Mon, 15 Nov 2021 03:55:53 +0000 (UTC) From: "Abner Chang" To: devel@edk2.groups.io Cc: abner.chang@hpe.com, Daniel Schaefer , Sunil V L Subject: [edk2-devel] [edk2-platforms][PATCH 08/14] RiscVPlatformPkg/U500: U500 uses mtime CSR library Date: Mon, 15 Nov 2021 10:56:34 +0800 Message-Id: <20211115025640.12897-9-abner.chang@hpe.com> In-Reply-To: <20211115025640.12897-1-abner.chang@hpe.com> References: <20211115025640.12897-1-abner.chang@hpe.com> MIME-Version: 1.0 X-Proofpoint-GUID: GPzU7Sk9bih8LwR9mnfO04OclYeyTUxa X-Proofpoint-ORIG-GUID: GPzU7Sk9bih8LwR9mnfO04OclYeyTUxa X-HPE-SCL: -1 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,abner.chang@hpe.com X-Gm-Message-State: sbNY75I3Bfs5uPxRoAo9Bs2gx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1636948560; bh=VV9qpkfrQEFOX6vNskbdY2d/B3x7H+eIkjdGH4AF1ds=; h=Cc:Date:From:Reply-To:Subject:To; b=u4/p9DylMFjX1RxP7nHzAIgJYrIrVi4yPanHDUPj2mzby1Zr5CI4AQScPseg3X7uOUD R+cALGHx8cyGKRqV0bjOxQmYUpzxqU/eS+z6c+RAkPX73VNs5dv/0hbU35qoaGhDm5j8V 4IzSgelEcnM+q0AF4dMT60aOtlz3yGKgvko= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1636948561507100034 Content-Type: text/plain; charset="utf-8" Use mtime CSR library interface to access mtime CSR in Timer DXE driver. Signed-off-by: Abner Chang Cc: Daniel Schaefer Cc: Sunil V L Reviewed-by: Daniel Schaefer --- Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc | 1 + 1 file changed, 1 insertion(+) diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc b/P= latform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc index 9c9a676de5..587f1dfa62 100644 --- a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc +++ b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc @@ -147,6 +147,7 @@ RiscVCpuLib|Silicon/RISC-V/ProcessorPkg/Library/RiscVCpuLib/RiscVCpuLib.= inf RiscVEdk2SbiLib|Silicon/RISC-V/ProcessorPkg/Library/RiscVEdk2SbiLib/Risc= VEdk2SbiLib.inf RiscVPlatformTimerLib|Platform/SiFive/U5SeriesPkg/Library/RiscVPlatformT= imerLib/RiscVPlatformTimerLib.inf + MachineModeTimerLib|Silicon/RISC-V/ProcessorPkg/Library/RiscVReadMachine= ModeTimer/EmulatedMachineModeTimerLib/EmulatedMachineModeTimerLib.inf CpuExceptionHandlerLib|Silicon/RISC-V/ProcessorPkg/Library/RiscVExceptio= nLib/CpuExceptionHandlerDxeLib.inf =20 # Flattened Device Tree (FDT) access library --=20 2.31.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 (#83744): https://edk2.groups.io/g/devel/message/83744 Mute This Topic: https://groups.io/mt/87062620/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 Fri Apr 26 04:54:02 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+83746+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+83746+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=hpe.com ARC-Seal: i=1; a=rsa-sha256; t=1636948566; cv=none; d=zohomail.com; s=zohoarc; b=NXBrj2J+6OCG0mrmVc2xlrxUs9liL49pru3qty/qH4pPxkSudLYRnSwsRLSvkyaeAsVydV/iWlb3KgRRYDrMec5mbruCCmUiltEHjWOiEnSf2WmrUaZ7QN5Q4lXUHFJLYspzZ/9lsgWHfTM72SYvRq7Cf4iBZrsVN1YlGN48bfQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1636948566; 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=xaDmxy8Jfegh/x8+K57Ar650HcGn0CxZBf3xVIxHvng=; b=fCWGNwEHgOfv8x8CJCOvxtgg98Le1VostmZDhAyEL3AnTEMInKH4WvUiYsaLKVgO2HvUdOgmAQ9Nxiv9mC+flXbCDA/fqaHPESzXHuJKw2Qu24ZFaBvkES38X+gkfzlbapuBEJIws1la2/ZZDFSfjh1Pq4N7h1TBJysOSMIbfGg= 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+83746+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 1636948566995206.5879747763886; Sun, 14 Nov 2021 19:56:06 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id 98K4YY1788612x8q1A2FPTki; Sun, 14 Nov 2021 19:56:06 -0800 X-Received: from mx0a-002e3701.pphosted.com (mx0a-002e3701.pphosted.com [148.163.147.86]) by mx.groups.io with SMTP id smtpd.web11.18027.1636948557796028091 for ; Sun, 14 Nov 2021 19:56:05 -0800 X-Received: from pps.filterd (m0134422.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 1AEI2GLA018197; Mon, 15 Nov 2021 03:55:56 GMT X-Received: from g2t2354.austin.hpe.com (g2t2354.austin.hpe.com [15.233.44.27]) by mx0b-002e3701.pphosted.com with ESMTP id 3ca6rmjwrb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 15 Nov 2021 03:55:56 +0000 X-Received: from g2t2360.austin.hpecorp.net (g2t2360.austin.hpecorp.net [16.196.225.135]) by g2t2354.austin.hpe.com (Postfix) with ESMTP id C250F91; Mon, 15 Nov 2021 03:55:55 +0000 (UTC) X-Received: from UB16Abner.asiapacific.hpqcorp.net (ub16abner.asiapacific.hpqcorp.net [15.119.209.229]) by g2t2360.austin.hpecorp.net (Postfix) with ESMTP id B270236; Mon, 15 Nov 2021 03:55:54 +0000 (UTC) From: "Abner Chang" To: devel@edk2.groups.io Cc: abner.chang@hpe.com, Daniel Schaefer , Sunil V L Subject: [edk2-devel] [edk2-platforms][PATCH 09/14] RiscVPlatformPkg/U500: Determines hart number from DTB Date: Mon, 15 Nov 2021 10:56:35 +0800 Message-Id: <20211115025640.12897-10-abner.chang@hpe.com> In-Reply-To: <20211115025640.12897-1-abner.chang@hpe.com> References: <20211115025640.12897-1-abner.chang@hpe.com> MIME-Version: 1.0 X-Proofpoint-GUID: O2ZY9EaMGPj0jpYYXCKSCC2L3jZKLA3F X-Proofpoint-ORIG-GUID: O2ZY9EaMGPj0jpYYXCKSCC2L3jZKLA3F X-HPE-SCL: -1 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,abner.chang@hpe.com X-Gm-Message-State: JpU8iiPNYAXqIFVeqDJcBlGBx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1636948566; bh=MP3iO1nxbiEC3oAIfyBnto/3e/8C8lFe4cV+6HquVFE=; h=Cc:Date:From:Reply-To:Subject:To; b=bPeaIf/X2wFX/TOnbz3YWNXMagg0rye/ft9+piuNuKZWRgGQzUclY7i1XVsIheto+Id WDy+QPQATHa56SS1qCGRBgoDBmhjBjPfrEpb0uyuqLTY8RmwFDDjiQ/2IX9VqCXrDIb00 t4b4iJD0nnoMC3xbPFshrqai0o1B1IaFVE0= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1636948567817100003 Content-Type: text/plain; charset="utf-8" Determine total number of HARTs from DTB instead of using PCD. Also specify the desired boot HART ID. Signed-off-by: Abner Chang Cc: Daniel Schaefer Cc: Sunil V L Reviewed-by: Daniel Schaefer --- .../SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf.inc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf.inc= b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf.inc index abfb013a92..3b40f5486c 100644 --- a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf.inc +++ b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf.inc @@ -83,10 +83,13 @@ SET gUefiRiscVPlatformPkgTokenSpaceGuid.PcdTemporaryRam= Size =3D 0x10000 =20 SET gUefiRiscVPkgTokenSpaceGuid.PcdRiscVMachineTimerFrequencyInHerz =3D= 1000000 SET gSiFiveU5SeriesPlatformsPkgTokenSpaceGuid.PcdU5PlatformSystemClock =3D= 100000000 # 100Mhz system clock -SET gUefiRiscVPlatformPkgTokenSpaceGuid.PcdHartCount =3D= 4 # Total cores on U500 platform SET gUefiRiscVPlatformPkgTokenSpaceGuid.PcdBootableHartNumber =3D= 4 # The bootable hart core number. = # Which is incorporate with OpenSBI = # platform hart_index2id value. +# +# Use hart ID 0, 1, 2, 3 +# +SET gUefiRiscVPlatformPkgTokenSpaceGuid.PcdBootableHartIndexToId =3D= {0x0,0x1,0x2,0x3} =20 SET gSiFiveU5SeriesPlatformsPkgTokenSpaceGuid.PcdNumberofU5Cores =3D= 4 # Total U5 cores enabled on U500 platform SET gSiFiveU5SeriesPlatformsPkgTokenSpaceGuid.PcdE5MCSupported =3D= False # Enable optional E51 MC core? --=20 2.31.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 (#83746): https://edk2.groups.io/g/devel/message/83746 Mute This Topic: https://groups.io/mt/87062626/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 Fri Apr 26 04:54:02 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+83747+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+83747+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=hpe.com ARC-Seal: i=1; a=rsa-sha256; t=1636948566; cv=none; d=zohomail.com; s=zohoarc; b=F7vYTXmUnnigiaNehCml3G6YKeJw8FkK+iRptg/mQaGB7VnyMWGAcdk/lcID4V0wQg3DhXOthcj/UitGJ5R14iL1Vs7H7oNVXTgQk00MxPeEIQPCRpQDXZqmybZSGC3ygtK7Wr4Qcof2J6sPtkFnPJ2YtXaKKkbEw/7wRs8YuZA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1636948566; 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=PqgBLOhicbNTmK23EjcO73PXc6vkB1AcU/m/f/iNr1M=; b=OmAw3e1LNDcPXekRO/6UREeuTF1J++SUoxeDgj/EPy7/Cb7IPvhyua7APuH9x2kSEOhKCnMoUU2shY9gIDYKTxJJuZpfhdsp9l3QcZ98NcvOo7+B9x1l+J5LQkBDCVdyFszFF3P66C5VsSYnxKMWqsQ3G2H6wrYpdvIiUUyDwGg= 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+83747+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 1636948566459258.3972465943674; Sun, 14 Nov 2021 19:56:06 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id qxNIYY1788612xpqI40M2iJY; Sun, 14 Nov 2021 19:56:06 -0800 X-Received: from mx0a-002e3701.pphosted.com (mx0a-002e3701.pphosted.com [148.163.147.86]) by mx.groups.io with SMTP id smtpd.web10.17942.1636948558319015751 for ; Sun, 14 Nov 2021 19:56:05 -0800 X-Received: from pps.filterd (m0134420.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 1AEFXJSu001768; Mon, 15 Nov 2021 03:55:58 GMT X-Received: from g2t2354.austin.hpe.com (g2t2354.austin.hpe.com [15.233.44.27]) by mx0b-002e3701.pphosted.com with ESMTP id 3ca2r841ew-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 15 Nov 2021 03:55:58 +0000 X-Received: from g2t2360.austin.hpecorp.net (g2t2360.austin.hpecorp.net [16.196.225.135]) by g2t2354.austin.hpe.com (Postfix) with ESMTP id 39A4D81; Mon, 15 Nov 2021 03:55:57 +0000 (UTC) X-Received: from UB16Abner.asiapacific.hpqcorp.net (ub16abner.asiapacific.hpqcorp.net [15.119.209.229]) by g2t2360.austin.hpecorp.net (Postfix) with ESMTP id 20A6836; Mon, 15 Nov 2021 03:55:55 +0000 (UTC) From: "Abner Chang" To: devel@edk2.groups.io Cc: abner.chang@hpe.com, Daniel Schaefer , Sunil V L Subject: [edk2-devel] [edk2-platforms][PATCH 10/14] RiscVPlatformPkg/U500: Use NULL instance of RiscVSpecialPlatformLib Date: Mon, 15 Nov 2021 10:56:36 +0800 Message-Id: <20211115025640.12897-11-abner.chang@hpe.com> In-Reply-To: <20211115025640.12897-1-abner.chang@hpe.com> References: <20211115025640.12897-1-abner.chang@hpe.com> MIME-Version: 1.0 X-Proofpoint-GUID: MP9lgRxk8Vfgg9WlbNLxnNdNQJtjGnPG X-Proofpoint-ORIG-GUID: MP9lgRxk8Vfgg9WlbNLxnNdNQJtjGnPG X-HPE-SCL: -1 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,abner.chang@hpe.com X-Gm-Message-State: kZmlBEFA7ZKufmX2wnGWhO4Hx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1636948566; bh=Xl+dLZeo3FPnnjmFcutiqw94SmF+tgHfgAXZ1tNH2uw=; h=Cc:Date:From:Reply-To:Subject:To; b=Wqp/MNLq1Skdt6V1qHi5EgVYWqqN+4j9Yf+y83Ss+GNx3xpmqwhpX7qzKHT9m6At4DG YBTRBRp0LowXlAgnDnVOe3A/ZRYMw83Sl4f6SM7mUok+fc92mLuQg64obJ3fUsvpoIMLV qbz6p0qwUrMOFr+X5wjuqb8QJ8QdhXnYeMo= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1636948567701100002 Content-Type: text/plain; charset="utf-8" Signed-off-by: Abner Chang Cc: Daniel Schaefer Cc: Sunil V L Reviewed-by: Daniel Schaefer --- Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc | 1 + 1 file changed, 1 insertion(+) diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc b/P= latform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc index 587f1dfa62..9faa68fd6d 100644 --- a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc +++ b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc @@ -163,6 +163,7 @@ ReportStatusCodeLib|MdeModulePkg/Library/PeiReportStatusCodeLib/PeiRepor= tStatusCodeLib.inf ExtractGuidedSectionLib|MdePkg/Library/BaseExtractGuidedSectionLib/BaseE= xtractGuidedSectionLib.inf Edk2OpensbiPlatformWrapperLib|Platform/RISC-V/PlatformPkg/Library/Edk2Op= ensbiPlatformWrapperLib/Edk2OpensbiPlatformWrapperLib.inf + RiscVSpecialPlatformLib|Platform/RISC-V/PlatformPkg/Library/RiscVSpecial= PlatformLibNull/RiscVSpecialPlatformLibNull.inf =20 !ifdef $(SOURCE_DEBUG_ENABLE) DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/SecPeiDebugAgentLib= .inf --=20 2.31.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 (#83747): https://edk2.groups.io/g/devel/message/83747 Mute This Topic: https://groups.io/mt/87062627/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 Fri Apr 26 04:54:02 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+83745+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+83745+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=hpe.com ARC-Seal: i=1; a=rsa-sha256; t=1636948567; cv=none; d=zohomail.com; s=zohoarc; b=QLrjOsH7Znb22xfrj4ixYih8Unl4mC6ECCDrsZNRn4n/Z1vkM7tOpztLiovztQ6i4d+pbVaUXjFb2HBLQa5V/NqPakQ/Pkn57yd/u0DsAc6tznKxakBUA6CIxVU4//2TYCbuE5NL7Qmqe6PWMJ3gSVKjr9eX3HmoSH343J5cX/g= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1636948567; 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=V68IMUsDWpKzCK2zhx7TKG8G6HWumMA/GC+5HXo455c=; b=dniYAzCySyAuBk8VMi/wSv7NRhI+OLW7Rvn5MMefoA96yjDh62DcpHQbOW8BemFKCwThug5AamuLGUe9j6/1RAlSHWA5rdV4wt8l6iJkMZovrZUiNKUre2bpEYsJTn8X4usc3pWbFTLLrmqAPQnBUPEK6KZ2cdRqPbbldDhnMOY= 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+83745+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 1636948567107899.6266419949836; Sun, 14 Nov 2021 19:56:07 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id liZTYY1788612xlRJm5ElOcg; Sun, 14 Nov 2021 19:56:06 -0800 X-Received: from mx0b-002e3701.pphosted.com (mx0b-002e3701.pphosted.com [148.163.143.35]) by mx.groups.io with SMTP id smtpd.web11.18030.1636948560211227513 for ; Sun, 14 Nov 2021 19:56:05 -0800 X-Received: from pps.filterd (m0134424.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 1AEKooSD029985; Mon, 15 Nov 2021 03:55:59 GMT X-Received: from g2t2353.austin.hpe.com (g2t2353.austin.hpe.com [15.233.44.26]) by mx0b-002e3701.pphosted.com with ESMTP id 3ca4bsushc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 15 Nov 2021 03:55:59 +0000 X-Received: from g2t2360.austin.hpecorp.net (g2t2360.austin.hpecorp.net [16.196.225.135]) by g2t2353.austin.hpe.com (Postfix) with ESMTP id 9A9446D; Mon, 15 Nov 2021 03:55:58 +0000 (UTC) X-Received: from UB16Abner.asiapacific.hpqcorp.net (ub16abner.asiapacific.hpqcorp.net [15.119.209.229]) by g2t2360.austin.hpecorp.net (Postfix) with ESMTP id 8C31636; Mon, 15 Nov 2021 03:55:57 +0000 (UTC) From: "Abner Chang" To: devel@edk2.groups.io Cc: abner.chang@hpe.com, Daniel Schaefer , Sunil V L Subject: [edk2-devel] [edk2-platforms][PATCH 11/14] RiscVPlatformPkg/U500: Add device tree for U500 platform Date: Mon, 15 Nov 2021 10:56:37 +0800 Message-Id: <20211115025640.12897-12-abner.chang@hpe.com> In-Reply-To: <20211115025640.12897-1-abner.chang@hpe.com> References: <20211115025640.12897-1-abner.chang@hpe.com> MIME-Version: 1.0 X-Proofpoint-GUID: EGN1Hu0sfH2QFtgt-iFE87c_AAqv_KLM X-Proofpoint-ORIG-GUID: EGN1Hu0sfH2QFtgt-iFE87c_AAqv_KLM X-HPE-SCL: -1 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,abner.chang@hpe.com X-Gm-Message-State: MvCvUbcFIikPGqM33VGmTrk1x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1636948566; bh=sk3uCQ26bcFalcQZEJ3niqfQHKY9JZVpgcVQ+2HTwvc=; h=Cc:Date:From:Reply-To:Subject:To; b=jkA3pXj6k5+Li2aF/X65NhjhAkqi4y3ZeNQhHylfxgPx4ZqLYVoKNzjjtRadS+8tr63 VMkj64zJxZXzCbEKYOYxwR2C4GkK6Dlg6UnjavMpqUmJf4bdsTatBW/hueWbetZmnGKKi 28Fx5Vbu57IEH5MYrB6T+FNBPqwnUPcrmYo= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1636948567981100007 Content-Type: text/plain; charset="utf-8" Signed-off-by: Abner Chang Cc: Daniel Schaefer Cc: Sunil V L Reviewed-by: Daniel Schaefer --- .../DeviceTree/U500DeviceTree.inf | 25 ++ .../FreedomU500VC707Board/DeviceTree/gpio.h | 45 +++ .../DeviceTree/sifive-fu500-prci.h | 19 ++ .../DeviceTree/fu500-c000.dtsi | 276 ++++++++++++++++++ .../DeviceTree/hifive-unleashed-a00.dts | 108 +++++++ 5 files changed, 473 insertions(+) create mode 100644 Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/Devic= eTree/U500DeviceTree.inf create mode 100644 Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/Devic= eTree/gpio.h create mode 100644 Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/Devic= eTree/sifive-fu500-prci.h create mode 100644 Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/Devic= eTree/fu500-c000.dtsi create mode 100644 Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/Devic= eTree/hifive-unleashed-a00.dts diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/DeviceTree/U= 500DeviceTree.inf b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/Devic= eTree/U500DeviceTree.inf new file mode 100644 index 0000000000..3eeb8c51f4 --- /dev/null +++ b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/DeviceTree/U500Devi= ceTree.inf @@ -0,0 +1,25 @@ +## @file +# +# Device tree description of SiFive U500 VC707 platform +# +# Copyright (c) 2021, Hewlett Packard Enterprise Development LP. All righ= ts reserved. +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +[Defines] + INF_VERSION =3D 0x0001001A + BASE_NAME =3D U500DeviceTree + FILE_GUID =3D 25462CDA-221F-47DF-AC1D-259CFAA4E326 # gDtPlatformDef= aultDtbFileGuid + MODULE_TYPE =3D USER_DEFINED + VERSION_STRING =3D 1.0 + +[Sources] + gpio.h + hifive-unleashed-a00.dts + fu500-c000.dtsi + sifive-fu500-prci.h + +[Packages] + MdePkg/MdePkg.dec diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/DeviceTree/g= pio.h b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/DeviceTree/gpio.h new file mode 100644 index 0000000000..bc7e2fe7a1 --- /dev/null +++ b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/DeviceTree/gpio.h @@ -0,0 +1,45 @@ +/** @file + This header provides constants for most GPIO bindings. + + Most GPIO bindings include a flags cell as part of the GPIO specifier. + In most cases, the format of the flags cell uses the standard values + defined in this header. + + Copyright (c) 2021, Hewlett Packard Enterprise Development LP. All right= s reserved.
+ + SPDX-License-Identifier: BSD-2-Clause-Patent +**/ + +#ifndef DT_BINDINGS_GPIO_GPIO_H_ +#define DT_BINDINGS_GPIO_GPIO_H_ + +/* Bit 0 express polarity */ +#define GPIO_ACTIVE_HIGH 0 +#define GPIO_ACTIVE_LOW 1 + +/* Bit 1 express single-endedness */ +#define GPIO_PUSH_PULL 0 +#define GPIO_SINGLE_ENDED 2 + +/* Bit 2 express Open drain or open source */ +#define GPIO_LINE_OPEN_SOURCE 0 +#define GPIO_LINE_OPEN_DRAIN 4 + +// +// Open Drain/Collector is the combination of single-ended open drain inte= rface. +// Open Source/Emitter is the combination of single-ended open source inte= rface. +// +#define GPIO_OPEN_DRAIN (GPIO_SINGLE_ENDED | GPIO_LINE_OPEN_DRAIN) +#define GPIO_OPEN_SOURCE (GPIO_SINGLE_ENDED | GPIO_LINE_OPEN_SOURCE) + +/* Bit 3 express GPIO suspend/resume and reset persistence */ +#define GPIO_PERSISTENT 0 +#define GPIO_TRANSITORY 8 + +/* Bit 4 express pull up */ +#define GPIO_PULL_UP 16 + +/* Bit 5 express pull down */ +#define GPIO_PULL_DOWN 32 + +#endif diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/DeviceTree/s= ifive-fu500-prci.h b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/Devi= ceTree/sifive-fu500-prci.h new file mode 100644 index 0000000000..7efa0006a0 --- /dev/null +++ b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/DeviceTree/sifive-f= u500-prci.h @@ -0,0 +1,19 @@ +/**@file + + SPDX-License-Identifier: (GPL-2.0 OR MIT) + Copyright (c) 2018-2019 SiFive, Inc + + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ +#ifndef __DT_BINDINGS_CLOCK_SIFIVE_FU500_PRCI_H +#define __DT_BINDINGS_CLOCK_SIFIVE_FU500_PRCI_H + +/* Clock indexes for use by Device Tree data and the PRCI driver */ + +#define PRCI_CLK_COREPLL 0 +#define PRCI_CLK_DDRPLL 1 +#define PRCI_CLK_GEMGXLPLL 2 +#define PRCI_CLK_TLCLK 3 + +#endif diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/DeviceTree/f= u500-c000.dtsi b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/DeviceTr= ee/fu500-c000.dtsi new file mode 100644 index 0000000000..82f10e71e0 --- /dev/null +++ b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/DeviceTree/fu500-c0= 00.dtsi @@ -0,0 +1,276 @@ +/**@file + U500 VC707 Device Tree, compatible with fu540-c000 platform. + + SPDX-License-Identifier: (GPL-2.0 OR MIT) + Copyright (c) 2018-2019 SiFive, Inc + + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +/dts-v1/; + +#include "sifive-fu500-prci.h" + +/ { + #address-cells =3D <2>; + #size-cells =3D <2>; + compatible =3D "sifive,fu540-c000", "sifive,fu540"; + + aliases { + serial0 =3D &uart0; + ethernet0 =3D ð0; + }; + + chosen { + }; + + cpus { + #address-cells =3D <1>; + #size-cells =3D <0>; + cpu0: cpu@0 { + compatible =3D "sifive,u54-mc", "sifive,rocket0", = "riscv"; + d-cache-block-size =3D <64>; + d-cache-sets =3D <64>; + d-cache-size =3D <32768>; + d-tlb-sets =3D <1>; + d-tlb-size =3D <32>; + device_type =3D "cpu"; + i-cache-block-size =3D <64>; + i-cache-sets =3D <64>; + i-cache-size =3D <32768>; + i-tlb-sets =3D <1>; + i-tlb-size =3D <32>; + mmu-type =3D "riscv,sv39"; + reg =3D <0>; + riscv,isa =3D "rv64imafdc"; + tlb-split; + next-level-cache =3D <&l2cache>; + cpu0_intc: interrupt-controller { + #interrupt-cells =3D <1>; + compatible =3D "riscv,cpu-intc"; + interrupt-controller; + }; + }; + cpu1: cpu@1 { + compatible =3D "sifive,u54-mc", "sifive,rocket0", = "riscv"; + d-cache-block-size =3D <64>; + d-cache-sets =3D <64>; + d-cache-size =3D <32768>; + d-tlb-sets =3D <1>; + d-tlb-size =3D <32>; + device_type =3D "cpu"; + i-cache-block-size =3D <64>; + i-cache-sets =3D <64>; + i-cache-size =3D <32768>; + i-tlb-sets =3D <1>; + i-tlb-size =3D <32>; + mmu-type =3D "riscv,sv39"; + reg =3D <1>; + riscv,isa =3D "rv64imafdc"; + tlb-split; + next-level-cache =3D <&l2cache>; + cpu1_intc: interrupt-controller { + #interrupt-cells =3D <1>; + compatible =3D "riscv,cpu-intc"; + interrupt-controller; + }; + }; + cpu2: cpu@2 { + compatible =3D "sifive,u54-mc", "sifive,rocket0", = "riscv"; + d-cache-block-size =3D <64>; + d-cache-sets =3D <64>; + d-cache-size =3D <32768>; + d-tlb-sets =3D <1>; + d-tlb-size =3D <32>; + device_type =3D "cpu"; + i-cache-block-size =3D <64>; + i-cache-sets =3D <64>; + i-cache-size =3D <32768>; + i-tlb-sets =3D <1>; + i-tlb-size =3D <32>; + mmu-type =3D "riscv,sv39"; + reg =3D <2>; + riscv,isa =3D "rv64imafdc"; + tlb-split; + next-level-cache =3D <&l2cache>; + cpu2_intc: interrupt-controller { + #interrupt-cells =3D <1>; + compatible =3D "riscv,cpu-intc"; + interrupt-controller; + }; + }; + cpu3: cpu@3 { + compatible =3D "sifive,u54-mc", "sifive,rocket0", = "riscv"; + d-cache-block-size =3D <64>; + d-cache-sets =3D <64>; + d-cache-size =3D <32768>; + d-tlb-sets =3D <1>; + d-tlb-size =3D <32>; + device_type =3D "cpu"; + i-cache-block-size =3D <64>; + i-cache-sets =3D <64>; + i-cache-size =3D <32768>; + i-tlb-sets =3D <1>; + i-tlb-size =3D <32>; + mmu-type =3D "riscv,sv39"; + reg =3D <3>; + riscv,isa =3D "rv64imafdc"; + tlb-split; + next-level-cache =3D <&l2cache>; + cpu3_intc: interrupt-controller { + #interrupt-cells =3D <1>; + compatible =3D "riscv,cpu-intc"; + interrupt-controller; + }; + }; + }; + soc { + #address-cells =3D <2>; + #size-cells =3D <2>; + compatible =3D "sifive,fu540-c000", "sifive,fu540", "simpl= e-bus"; + ranges; + plic0: interrupt-controller@c000000 { + #interrupt-cells =3D <1>; + compatible =3D "sifive,plic-1.0.0"; + reg =3D <0x0 0xc000000 0x0 0x4000000>; + riscv,ndev =3D <53>; + interrupt-controller; + interrupts-extended =3D < + &cpu0_intc 0xffffffff &cpu0_intc 9 + &cpu1_intc 0xffffffff &cpu1_intc 9 + &cpu2_intc 0xffffffff &cpu2_intc 9 + &cpu3_intc 0xffffffff &cpu3_intc 9>; + }; + prci: clock-controller@10000000 { + compatible =3D "sifive,fu540-c000-prci"; + reg =3D <0x0 0x10000000 0x0 0x1000>; + clocks =3D <&hfclk>, <&rtcclk>; + #clock-cells =3D <1>; + }; + uart0: serial@54000000 { + compatible =3D "sifive,fu540-c000-uart", "sifive,u= art0"; + reg =3D <0x0 0x54000000 0x0 0x1000>; + interrupt-parent =3D <&plic0>; + interrupts =3D <4>; + clocks =3D <&prci PRCI_CLK_TLCLK>; + status =3D "disabled"; + }; + dma: dma@3000000 { + compatible =3D "sifive,fu540-c000-pdma"; + reg =3D <0x0 0x3000000 0x0 0x8000>; + interrupt-parent =3D <&plic0>; + interrupts =3D <23 24 25 26 27 28 29 30>; + #dma-cells =3D <1>; + }; + i2c0: i2c@10030000 { + compatible =3D "sifive,fu540-c000-i2c", "sifive,i2= c0"; + reg =3D <0x0 0x10030000 0x0 0x1000>; + interrupt-parent =3D <&plic0>; + interrupts =3D <50>; + clocks =3D <&prci PRCI_CLK_TLCLK>; + reg-shift =3D <2>; + reg-io-width =3D <1>; + #address-cells =3D <1>; + #size-cells =3D <0>; + status =3D "disabled"; + }; + qspi0: spi@10040000 { + compatible =3D "sifive,fu540-c000-spi", "sifive,sp= i0"; + reg =3D <0x0 0x10040000 0x0 0x1000 + 0x0 0x20000000 0x0 0x10000000>; + interrupt-parent =3D <&plic0>; + interrupts =3D <51>; + clocks =3D <&prci PRCI_CLK_TLCLK>; + #address-cells =3D <1>; + #size-cells =3D <0>; + status =3D "disabled"; + }; + qspi1: spi@10041000 { + compatible =3D "sifive,fu540-c000-spi", "sifive,sp= i0"; + reg =3D <0x0 0x10041000 0x0 0x1000 + 0x0 0x30000000 0x0 0x10000000>; + interrupt-parent =3D <&plic0>; + interrupts =3D <52>; + clocks =3D <&prci PRCI_CLK_TLCLK>; + #address-cells =3D <1>; + #size-cells =3D <0>; + status =3D "disabled"; + }; + qspi2: spi@10050000 { + compatible =3D "sifive,fu540-c000-spi", "sifive,sp= i0"; + reg =3D <0x0 0x10050000 0x0 0x1000>; + interrupt-parent =3D <&plic0>; + interrupts =3D <6>; + clocks =3D <&prci PRCI_CLK_TLCLK>; + #address-cells =3D <1>; + #size-cells =3D <0>; + status =3D "disabled"; + }; + eth0: ethernet@10090000 { + compatible =3D "sifive,fu540-c000-gem"; + interrupt-parent =3D <&plic0>; + interrupts =3D <53>; + reg =3D <0x0 0x10090000 0x0 0x2000 + 0x0 0x100a0000 0x0 0x1000>; + local-mac-address =3D [00 00 00 00 00 00]; + clock-names =3D "pclk", "hclk"; + clocks =3D <&prci PRCI_CLK_GEMGXLPLL>, + <&prci PRCI_CLK_GEMGXLPLL>; + #address-cells =3D <1>; + #size-cells =3D <0>; + status =3D "disabled"; + }; + pwm0: pwm@10020000 { + compatible =3D "sifive,fu540-c000-pwm", "sifive,pw= m0"; + reg =3D <0x0 0x10020000 0x0 0x1000>; + interrupt-parent =3D <&plic0>; + interrupts =3D <42 43 44 45>; + clocks =3D <&prci PRCI_CLK_TLCLK>; + #pwm-cells =3D <3>; + status =3D "disabled"; + }; + pwm1: pwm@10021000 { + compatible =3D "sifive,fu540-c000-pwm", "sifive,pw= m0"; + reg =3D <0x0 0x10021000 0x0 0x1000>; + interrupt-parent =3D <&plic0>; + interrupts =3D <46 47 48 49>; + clocks =3D <&prci PRCI_CLK_TLCLK>; + #pwm-cells =3D <3>; + status =3D "disabled"; + }; + l2cache: cache-controller@2010000 { + compatible =3D "sifive,fu540-c000-ccache", "cache"; + cache-block-size =3D <64>; + cache-level =3D <2>; + cache-sets =3D <1024>; + cache-size =3D <2097152>; + cache-unified; + interrupt-parent =3D <&plic0>; + interrupts =3D <1 2 3>; + reg =3D <0x0 0x2010000 0x0 0x1000>; + }; + gpio: gpio@10060000 { + compatible =3D "sifive,fu540-c000-gpio", "sifive,g= pio0"; + interrupt-parent =3D <&plic0>; + interrupts =3D <7>, <8>, <9>, <10>, <11>, <12>, <1= 3>, + <14>, <15>, <16>, <17>, <18>, <19>, <= 20>, + <21>, <22>; + reg =3D <0x0 0x10060000 0x0 0x1000>; + gpio-controller; + #gpio-cells =3D <2>; + interrupt-controller; + #interrupt-cells =3D <2>; + clocks =3D <&prci PRCI_CLK_TLCLK>; + status =3D "disabled"; + }; + clint: clint@2000000 { + compatible =3D "riscv,clint0"; + interrupts-extended =3D <&cpu0_intc 3 &cpu0_intc 7 + &cpu1_intc 3 &cpu1_intc 7 + &cpu2_intc 3 &cpu2_intc 7 + &cpu3_intc 3 &cpu3_intc 7>; + reg =3D <0x0 0x2000000 0x0 0xc0000>; + }; + }; +}; diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/DeviceTree/h= ifive-unleashed-a00.dts b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board= /DeviceTree/hifive-unleashed-a00.dts new file mode 100644 index 0000000000..2074b18fa8 --- /dev/null +++ b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/DeviceTree/hifive-u= nleashed-a00.dts @@ -0,0 +1,108 @@ +/**@file + U500 VC707 Device Tree + + SPDX-License-Identifier: (GPL-2.0 OR MIT) + Copyright (c) 2018-2019 SiFive, Inc + + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include "fu500-c000.dtsi" +#include "gpio.h" + +/* Clock frequency (in Hz) of the PCB crystal for rtcclk */ +#define RTCCLK_FREQ 1000000 + +/ { + #address-cells =3D <2>; + #size-cells =3D <2>; + model =3D "SiFive HiFive Unleashed A00"; + compatible =3D "sifive,hifive-unleashed-a00", "sifive,fu540-c000"; + + chosen { + stdout-path =3D "serial0"; + }; + + cpus { + timebase-frequency =3D ; + }; + + memory@80000000 { + device_type =3D "memory"; + reg =3D <0x0 0x80000000 0x2 0x00000000>; + }; + + soc { + }; + + hfclk: hfclk { + #clock-cells =3D <0>; + compatible =3D "fixed-clock"; + clock-frequency =3D <33333333>; + clock-output-names =3D "hfclk"; + }; + + rtcclk: rtcclk { + #clock-cells =3D <0>; + compatible =3D "fixed-clock"; + clock-frequency =3D ; + clock-output-names =3D "rtcclk"; + }; + gpio-restart { + compatible =3D "gpio-restart"; + gpios =3D <&gpio 10 GPIO_ACTIVE_LOW>; + }; +}; + +&uart0 { + status =3D "okay"; +}; + +&i2c0 { + status =3D "okay"; +}; + +&qspi0 { + status =3D "okay"; + flash@0 { + compatible =3D "issi,is25wp256", "jedec,spi-nor"; + reg =3D <0>; + spi-max-frequency =3D <50000000>; + m25p,fast-read; + spi-tx-bus-width =3D <4>; + spi-rx-bus-width =3D <4>; + }; +}; + +&qspi2 { + status =3D "okay"; + mmc@0 { + compatible =3D "mmc-spi-slot"; + reg =3D <0>; + spi-max-frequency =3D <20000000>; + voltage-ranges =3D <3300 3300>; + disable-wp; + }; +}; + +ð0 { + status =3D "okay"; + phy-mode =3D "gmii"; + phy-handle =3D <&phy0>; + phy0: ethernet-phy@0 { + reg =3D <0>; + }; +}; + +&pwm0 { + status =3D "okay"; +}; + +&pwm1 { + status =3D "okay"; +}; + +&gpio { + status =3D "okay"; +}; --=20 2.31.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 (#83745): https://edk2.groups.io/g/devel/message/83745 Mute This Topic: https://groups.io/mt/87062625/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 Fri Apr 26 04:54:02 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+83750+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+83750+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=hpe.com ARC-Seal: i=1; a=rsa-sha256; t=1636948568; cv=none; d=zohomail.com; s=zohoarc; b=SOQ1cJBNZG6zHdrK3c9h8PInulI+ZY8JJHJuAArqRS2jbDh7quOWLWHcky/4bfdUbzLG956sz4bwfGH1kjNIzqK7CbnlnGjiB/WPOF6hG3nfQFMMONu6785eMxVIkUOS2F7by4OP07e3mviXO6H5CG4ZsUOg+35STMa8KaYxRik= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1636948568; 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=1OoAZbaOE0K/tvYRZj3kv0qc7ZkRPIDbK7HJZdOL7q4=; b=DI5p67xHezlFkgXKkv4wxkgStX3NBWGR27Q1VxVhheX7TrvFW1MRnJ2CCbC/GL74qRkY5mfKuE+fdSDeG1N6osomd4bOU/CVDz0hcJbo2jPBmuyw2l+eq2fuB6pt/8xGd8f95O4EmtVMxY3GD1gRtrzuP1NMpfwObUJXfsorF2Q= 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+83750+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 1636948568281651.2034103323781; Sun, 14 Nov 2021 19:56:08 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id okZOYY1788612x1hSUBCtihm; Sun, 14 Nov 2021 19:56:07 -0800 X-Received: from mx0a-002e3701.pphosted.com (mx0a-002e3701.pphosted.com [148.163.147.86]) by mx.groups.io with SMTP id smtpd.web10.17944.1636948561506932040 for ; Sun, 14 Nov 2021 19:56:05 -0800 X-Received: from pps.filterd (m0148663.ppops.net [127.0.0.1]) by mx0a-002e3701.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 1AF1n218025340; Mon, 15 Nov 2021 03:56:00 GMT X-Received: from g2t2352.austin.hpe.com (g2t2352.austin.hpe.com [15.233.44.25]) by mx0a-002e3701.pphosted.com with ESMTP id 3cbe7bgk1b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 15 Nov 2021 03:56:00 +0000 X-Received: from g2t2360.austin.hpecorp.net (g2t2360.austin.hpecorp.net [16.196.225.135]) by g2t2352.austin.hpe.com (Postfix) with ESMTP id 0954A63; Mon, 15 Nov 2021 03:56:00 +0000 (UTC) X-Received: from UB16Abner.asiapacific.hpqcorp.net (ub16abner.asiapacific.hpqcorp.net [15.119.209.229]) by g2t2360.austin.hpecorp.net (Postfix) with ESMTP id EDC0439; Mon, 15 Nov 2021 03:55:58 +0000 (UTC) From: "Abner Chang" To: devel@edk2.groups.io Cc: abner.chang@hpe.com, Daniel Schaefer , Sunil V L Subject: [edk2-devel] [edk2-platforms][PATCH 12/14] RiscVPlatformPkg/U500: Add device tree to build Date: Mon, 15 Nov 2021 10:56:38 +0800 Message-Id: <20211115025640.12897-13-abner.chang@hpe.com> In-Reply-To: <20211115025640.12897-1-abner.chang@hpe.com> References: <20211115025640.12897-1-abner.chang@hpe.com> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: OOUrgieyC7R1MfMbuAWKyTz90dBri5YX X-Proofpoint-GUID: OOUrgieyC7R1MfMbuAWKyTz90dBri5YX X-HPE-SCL: -1 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,abner.chang@hpe.com X-Gm-Message-State: Vd5VH3lu5gD9c1EFGOi3OPFfx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1636948567; bh=deQ3ZA1PxqbUAvow0z2wZYPjsUaS/mQs+xyG07twVaE=; h=Cc:Date:From:Reply-To:Subject:To; b=uDM6aXFD2KZ0QxewVd945eyUhQ+SC5Pz5B+OLpMGp6tlJBNqNao6AnUenY3XGwpREpk 2IeNblbPWC96PEa3sqMQaTnfo36v7aAIh1ZyzibhrZg3fzq1WYEhVldpHh3eF7Bv8FhnP zMw8uwZrUz8JoBHnLobyb0j1JM9G5ED1xyg= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1636948568680100014 Content-Type: text/plain; charset="utf-8" Signed-off-by: Abner Chang Cc: Daniel Schaefer Cc: Sunil V L Reviewed-by: Daniel Schaefer --- .../FreedomU500VC707Board/U500.dsc | 2 ++ .../FreedomU500VC707Board/U500.fdf | 6 ++++ .../FreedomU500VC707Board/DeviceTree.fdf.inc | 33 +++++++++++++++++++ .../FreedomU500VC707Board/U500.fdf.inc | 8 ++++- 4 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/Devic= eTree.fdf.inc diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc b/P= latform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc index 9faa68fd6d..318851332a 100644 --- a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc +++ b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc @@ -503,6 +503,8 @@ MdeModulePkg/Universal/MemoryTest/NullMemoryTestDxe/NullMemoryTestDxe.inf MdeModulePkg/Universal/SerialDxe/SerialDxe.inf =20 + Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/DeviceTree/U500DeviceT= ree.inf + # # SMBIOS Support # diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf b/P= latform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf index cf9b673e97..4ce192799f 100644 --- a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf +++ b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf @@ -33,6 +33,7 @@ gUefiRiscVPlatformPkgTokenSpaceGuid.PcdRiscVDxeFvBase|gUe= fiRiscVPlatformPkgToken FV =3D FVMAIN_COMPACT =20 !include VarStore.fdf.inc +!include DeviceTree.fdf.inc =20 ##########################################################################= ###### =20 @@ -327,3 +328,8 @@ FILE FV_IMAGE =3D 9E21FD93-9C72-4c15-8C4B-E77F1DB2D792 { RAW ACPI |.acpi RAW ASL |.aml } + +[Rule.Common.USER_DEFINED.DTB] + FILE FREEFORM =3D $(NAMED_GUID) { + RAW BIN |.dtb + } diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/DeviceTree.f= df.inc b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/DeviceTree.fdf.i= nc new file mode 100644 index 0000000000..5ddaa6b8f2 --- /dev/null +++ b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/DeviceTree.fdf.inc @@ -0,0 +1,33 @@ +## @file +# FDF include file with Layout Regions that define an empty variable stor= e. +# +# Copyright (c) 2021, Hewlett Packard Enterprise Development LP. All righ= ts reserved.
+# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +$(DTB_OFFSET)|$(DTB_SIZE) +gUefiRiscVPlatformPkgTokenSpaceGuid.PcdRiscVDtbFvBase|gUefiRiscVPlatformPk= gTokenSpaceGuid.PcdRiscVDtbFvSize +FV =3D DTBFV + +[FV.DTBFV] +BlockSize =3D 0x1000 +FvAlignment =3D 16 +ERASE_POLARITY =3D 1 +MEMORY_MAPPED =3D TRUE +STICKY_WRITE =3D TRUE +LOCK_CAP =3D TRUE +LOCK_STATUS =3D TRUE +WRITE_DISABLED_CAP =3D TRUE +WRITE_ENABLED_CAP =3D TRUE +WRITE_STATUS =3D TRUE +WRITE_LOCK_CAP =3D TRUE +WRITE_LOCK_STATUS =3D TRUE +READ_DISABLED_CAP =3D TRUE +READ_ENABLED_CAP =3D TRUE +READ_STATUS =3D TRUE +READ_LOCK_CAP =3D TRUE +READ_LOCK_STATUS =3D TRUE + +INF RuleOverride =3D DTB Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board= /DeviceTree/U500DeviceTree.inf diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf.inc= b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf.inc index 3b40f5486c..d7da76f4d3 100644 --- a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf.inc +++ b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf.inc @@ -54,10 +54,16 @@ DEFINE VARS_FTW_WORKING_SIZE =3D 0x00001000 DEFINE VARS_FTW_SPARE_OFFSET =3D 0x00808000 DEFINE VARS_FTW_SPARE_SIZE =3D 0x00018000 =20 +# +# Device Tree memory region +# +DEFINE DTB_OFFSET =3D 0x00840000 +DEFINE DTB_SIZE =3D 0x00002000 + # # Scratch area memory region # -DEFINE SCRATCH_OFFSET =3D 0x00840000 +DEFINE SCRATCH_OFFSET =3D 0x00880000 DEFINE SCRATCH_SIZE =3D 0x00010000 =20 DEFINE FW_DOMAIN_SIZE =3D $(FVMAIN_OFFSET) + $(FVMAIN_SIZE) - $(PEIFV_O= FFSET) --=20 2.31.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 (#83750): https://edk2.groups.io/g/devel/message/83750 Mute This Topic: https://groups.io/mt/87062630/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 Fri Apr 26 04:54:02 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+83749+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+83749+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=hpe.com ARC-Seal: i=1; a=rsa-sha256; t=1636948568; cv=none; d=zohomail.com; s=zohoarc; b=fHBYwAcktiUZ0NOEwLMTJG3cnw5M/nHqChZULEmduLIg5WoZ8wxZpk8Beaooj2Ouy7zuuultvwGIF5EqJjdswoWVJuOv3LSPo5MjLchMZsd0S2ea6IfR8coYwh8cL8eilBHdzIweQEeWROfo5vk0wsmrzgp8OcOmrAzOhq4tiqQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1636948568; 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=pGChKCWzv0fWAUBXRCT1kxZD0+BNzSow1M115j4orJ4=; b=lctRxgHKIZ75xqF8JpuIgKGYKFHGRGvQNAjWH8EO7224nDx83vosyP7m7SXYjWnswtixRk/S4tIyPA5ARGVuIIp+J2hea5O5HG4bujQ6A1k85SVEhkbnwGW14P9Z8GVuBiS7vJp+ixyBT9Jdm337klfhS81RxCCQzQfPFK9AFSQ= 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+83749+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 163694856821926.700004025111866; Sun, 14 Nov 2021 19:56:08 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id jjUlYY1788612xhLC5AqvXOH; Sun, 14 Nov 2021 19:56:07 -0800 X-Received: from mx0a-002e3701.pphosted.com (mx0a-002e3701.pphosted.com [148.163.147.86]) by mx.groups.io with SMTP id smtpd.web10.17945.1636948562260591146 for ; Sun, 14 Nov 2021 19:56:05 -0800 X-Received: from pps.filterd (m0148663.ppops.net [127.0.0.1]) by mx0a-002e3701.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 1AF1mrUo024631; Mon, 15 Nov 2021 03:56:02 GMT X-Received: from g2t2352.austin.hpe.com (g2t2352.austin.hpe.com [15.233.44.25]) by mx0a-002e3701.pphosted.com with ESMTP id 3cbe7bgk1h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 15 Nov 2021 03:56:01 +0000 X-Received: from g2t2360.austin.hpecorp.net (g2t2360.austin.hpecorp.net [16.196.225.135]) by g2t2352.austin.hpe.com (Postfix) with ESMTP id 6BBAA63; Mon, 15 Nov 2021 03:56:01 +0000 (UTC) X-Received: from UB16Abner.asiapacific.hpqcorp.net (ub16abner.asiapacific.hpqcorp.net [15.119.209.229]) by g2t2360.austin.hpecorp.net (Postfix) with ESMTP id 5AB553A; Mon, 15 Nov 2021 03:56:00 +0000 (UTC) From: "Abner Chang" To: devel@edk2.groups.io Cc: abner.chang@hpe.com, Daniel Schaefer , Sunil V L Subject: [edk2-devel] [edk2-platforms][PATCH 13/14] Platform/RISC-V: Add debug message to SecMain.c Date: Mon, 15 Nov 2021 10:56:39 +0800 Message-Id: <20211115025640.12897-14-abner.chang@hpe.com> In-Reply-To: <20211115025640.12897-1-abner.chang@hpe.com> References: <20211115025640.12897-1-abner.chang@hpe.com> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: Lqw2d6yHkRgtqVJ7b7arEQBtq0Lcwb4c X-Proofpoint-GUID: Lqw2d6yHkRgtqVJ7b7arEQBtq0Lcwb4c X-HPE-SCL: -1 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,abner.chang@hpe.com X-Gm-Message-State: peu2uK2W5ITOLvPYEljkcP8qx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1636948567; bh=kV7Z3X/R48/YilFVCsfLWxV6d4qYHBP09DjkgOyYH3k=; h=Cc:Date:From:Reply-To:Subject:To; b=bsz5+aT1jRPF+dodJmQevCOFs2qoya0KhnvRjqyIahlZwYjI6jRvsgog4BmU8//6yja Z/F4n7Ci2+Xnedye4lxXfTjO5dmqk4iWfGLCAF4aT9cq3Iee80haij6zPBLUbof2wAZSm RSSm8j/XjcE4+xwP4sYWo+J8lVA6jAN0+Xg= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1636948568650100013 Content-Type: text/plain; charset="utf-8" Add more debug messages when search FFS in SEC phase. Signed-off-by: Abner Chang Cc: Daniel Schaefer Cc: Sunil V L Reviewed-by: Daniel Schaefer --- .../RISC-V/PlatformPkg/Universal/Sec/SecMain.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Platform/RISC-V/PlatformPkg/Universal/Sec/SecMain.c b/Platform= /RISC-V/PlatformPkg/Universal/Sec/SecMain.c index 17f33a02cc..05f228c44d 100644 --- a/Platform/RISC-V/PlatformPkg/Universal/Sec/SecMain.c +++ b/Platform/RISC-V/PlatformPkg/Universal/Sec/SecMain.c @@ -166,6 +166,8 @@ FindFfsFileAndSection ( UINT32 Size; EFI_PHYSICAL_ADDRESS EndOfFile; =20 + DEBUG ((DEBUG_INFO, "%a: DBT FV at 0x%x\n", __FUNCTION__, Fv)); + if (Fv->Signature !=3D EFI_FVH_SIGNATURE) { DEBUG ((DEBUG_ERROR, "%a: FV at %p does not have FV header signature\n= ", __FUNCTION__, Fv)); return EFI_VOLUME_CORRUPTED; @@ -181,17 +183,20 @@ FindFfsFileAndSection ( =20 CurrentAddress =3D (EndOfFile + 7) & ~(7ULL); if (CurrentAddress > EndOfFirmwareVolume) { + DEBUG ((DEBUG_ERROR, "%a: FV corrupted\n", __FUNCTION__)); return EFI_VOLUME_CORRUPTED; } =20 File =3D (EFI_FFS_FILE_HEADER*)(UINTN) CurrentAddress; Size =3D *(UINT32*) File->Size & 0xffffff; if (Size < (sizeof (*File) + sizeof (EFI_COMMON_SECTION_HEADER))) { + DEBUG ((DEBUG_ERROR, "%a: FV corrupted\n", __FUNCTION__)); return EFI_VOLUME_CORRUPTED; } =20 EndOfFile =3D CurrentAddress + Size; if (EndOfFile > EndOfFirmwareVolume) { + DEBUG ((DEBUG_ERROR, "%a: FV corrupted\n", __FUNCTION__)); return EFI_VOLUME_CORRUPTED; } =20 @@ -199,6 +204,7 @@ FindFfsFileAndSection ( // Look for the request file type // if (File->Type !=3D FileType) { + DEBUG ((DEBUG_INFO, "%a: (File->Type !=3D FileType), find next FFS\n= ", __FUNCTION__)); continue; } =20 @@ -208,9 +214,15 @@ FindFfsFileAndSection ( SectionType, FoundSection ); - if (!EFI_ERROR (Status) || (Status =3D=3D EFI_VOLUME_CORRUPTED)) { + if (!EFI_ERROR(Status)) { + DEBUG ((DEBUG_INFO, "%a: Get firmware file section\n", __FUNCTION__)= ); + return Status; + } + if (Status =3D=3D EFI_VOLUME_CORRUPTED) { + DEBUG ((DEBUG_ERROR, "%a: FV corrupted\n", __FUNCTION__)); return Status; } + DEBUG ((DEBUG_INFO, "%a: Find next FFS\n", __FUNCTION__)); } } =20 --=20 2.31.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 (#83749): https://edk2.groups.io/g/devel/message/83749 Mute This Topic: https://groups.io/mt/87062629/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 Fri Apr 26 04:54:02 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+83748+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+83748+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=hpe.com ARC-Seal: i=1; a=rsa-sha256; t=1636948567; cv=none; d=zohomail.com; s=zohoarc; b=bWjk+KPyIZ2qFxhdCMqUMkbnMYBcJ8gEQYM1oZ0xtFq+y5aIdB5zOreOWZFOyGam+5wlNWW8fph+Z/aS0oQUehItNtsDnz4TREB7NCqtdVsAG/a2zzj1/ZF3dJtNeJNNCOCABcv0xryMSyFZLOx14T86EIQnfMxsfRqC9kqb2IU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1636948567; 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=d8Ad7LP94TfpjJohUg/TE7qZMTlapGlv30PZvxcvhFs=; b=eXuCx3DUd3KpYyaB0fEWoK/VkQlXjxwoezYxnSRfzHNa6/xlB8wEbBgd5aBsN0bpUVPSZnozmupai0U9xFjUDh7UooFcfhcqm7xf1o6jTdFhbtSZQXszwqVA5LmvHlgBEuB2mDJJTIc7AyHzNZMmWNOuo37gbWkVsVJxw9yeXEw= 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+83748+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 1636948567879152.84719859240272; Sun, 14 Nov 2021 19:56:07 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id HIV3YY1788612xlKXtn3W7Cw; Sun, 14 Nov 2021 19:56:07 -0800 X-Received: from mx0a-002e3701.pphosted.com (mx0a-002e3701.pphosted.com [148.163.147.86]) by mx.groups.io with SMTP id smtpd.web10.17947.1636948563942209004 for ; Sun, 14 Nov 2021 19:56:05 -0800 X-Received: from pps.filterd (m0150241.ppops.net [127.0.0.1]) by mx0a-002e3701.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 1AEM1xTL026137; Mon, 15 Nov 2021 03:56:03 GMT X-Received: from g2t2352.austin.hpe.com (g2t2352.austin.hpe.com [15.233.44.25]) by mx0a-002e3701.pphosted.com with ESMTP id 3ca3wr3r59-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 15 Nov 2021 03:56:03 +0000 X-Received: from g2t2360.austin.hpecorp.net (g2t2360.austin.hpecorp.net [16.196.225.135]) by g2t2352.austin.hpe.com (Postfix) with ESMTP id D787963; Mon, 15 Nov 2021 03:56:02 +0000 (UTC) X-Received: from UB16Abner.asiapacific.hpqcorp.net (ub16abner.asiapacific.hpqcorp.net [15.119.209.229]) by g2t2360.austin.hpecorp.net (Postfix) with ESMTP id BDD0439; Mon, 15 Nov 2021 03:56:01 +0000 (UTC) From: "Abner Chang" To: devel@edk2.groups.io Cc: abner.chang@hpe.com, Daniel Schaefer , Sunil V L Subject: [edk2-devel] [edk2-platforms][PATCH 14/14] Platform/RISC-V: Initialize variable to zero Date: Mon, 15 Nov 2021 10:56:40 +0800 Message-Id: <20211115025640.12897-15-abner.chang@hpe.com> In-Reply-To: <20211115025640.12897-1-abner.chang@hpe.com> References: <20211115025640.12897-1-abner.chang@hpe.com> MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: GSVlhNOJ0ZkIbpp56ebqnhLoRO9Q_eCj X-Proofpoint-GUID: GSVlhNOJ0ZkIbpp56ebqnhLoRO9Q_eCj X-HPE-SCL: -1 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,abner.chang@hpe.com X-Gm-Message-State: cU8uLmJuRJEe8x4emwouX6OSx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1636948567; bh=FBKsDLFat/Yhy/iFOS5KHK7Chdj2jr3ZDHzp4gm3sps=; h=Cc:Date:From:Reply-To:Subject:To; b=v/bJYtwCdg7FSjWm/VCl2Mt4XWTS5uYy2EGgcYPzQYiYaf9vgDJVfh2i9/9cNNbbOUN s6ClX1RqwwJFGqC8nGqWEFb/lDjyz/Q+LJSk0km8GqFqxawnwSqq9j4ePxtv1VtczRSx8 okYefx93btZt8k1RawFe1X1zSjnZTSvhmvw= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1636948568621100010 Content-Type: text/plain; charset="utf-8" Initialize variable NumberOfPlatformInArray to 0. Signed-off-by: Abner Chang Cc: Daniel Schaefer Cc: Sunil V L Reviewed-by: Daniel Schaefer --- .../RiscVSpecialPlatformLibNull/RiscVSpecialPlatformLib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Platform/RISC-V/PlatformPkg/Library/RiscVSpecialPlatformLibNul= l/RiscVSpecialPlatformLib.c b/Platform/RISC-V/PlatformPkg/Library/RiscVSpec= ialPlatformLibNull/RiscVSpecialPlatformLib.c index 18c152001c..f64bde4535 100644 --- a/Platform/RISC-V/PlatformPkg/Library/RiscVSpecialPlatformLibNull/RiscV= SpecialPlatformLib.c +++ b/Platform/RISC-V/PlatformPkg/Library/RiscVSpecialPlatformLibNull/RiscV= SpecialPlatformLib.c @@ -16,5 +16,5 @@ =20 const struct platform_override *special_platforms =3D NULL; const struct platform_override *SpecialPlatformArray =3D NULL; -INTN NumberOfPlaformsInArray; +INTN NumberOfPlaformsInArray =3D 0; =20 --=20 2.31.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 (#83748): https://edk2.groups.io/g/devel/message/83748 Mute This Topic: https://groups.io/mt/87062628/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-