From nobody Mon Feb 9 19:06:01 2026 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+88019+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+88019+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=hpe.com ARC-Seal: i=1; a=rsa-sha256; t=1648192620; cv=none; d=zohomail.com; s=zohoarc; b=Gc6ApDl8aRLy9KDCptSUN6qP+iXEt306y0DdE2X7JQCD8XsxvwGmye9PwBbz6QQ8ZafL22IJYcY9wOhB3AR9F+v7WgVsjDqKKctP6fOfC+YBHXCcIargLG8GD/UKd0TamYqM/yHYUdEE/CJgVI1oqnYhYmmh/oXLMwE4ndWOB3E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1648192620; 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=JwXttS1GlLGoa8lydDklu/oZDNzCAuhnn2TcUZdPIFA=; b=Vc59Kjf9whtJW5vj4YyBo2MJVuXzx/8NWeLhMFh5nY3KRz5yZtumoAQiEUV/sSpFwu5+owMj27Cy1CPRVKo/8HWaAFrdkL5FzEc7MucxEfF2mf8edSyhZwTIh8tIWSitjafklDKZAWZnsbYAJwR2GmZL44KSXbVqKEQnRnI9qlI= 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+88019+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 1648192620226702.3765112670098; Fri, 25 Mar 2022 00:17:00 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id a3VMYY1788612xPT7dIbrqFI; Fri, 25 Mar 2022 00:16:59 -0700 X-Received: from mx0b-002e3701.pphosted.com (mx0b-002e3701.pphosted.com [148.163.143.35]) by mx.groups.io with SMTP id smtpd.web11.2326.1648192619055821877 for ; Fri, 25 Mar 2022 00:16:59 -0700 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 ESMTP id 22P5ub4E000921; Fri, 25 Mar 2022 07:16:58 GMT X-Received: from g4t3425.houston.hpe.com (g4t3425.houston.hpe.com [15.241.140.78]) by mx0b-002e3701.pphosted.com (PPS) with ESMTPS id 3f1164bhwj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 25 Mar 2022 07:16:58 +0000 X-Received: from g4t3433.houston.hpecorp.net (g4t3433.houston.hpecorp.net [16.208.49.245]) by g4t3425.houston.hpe.com (Postfix) with ESMTP id 8E4078D; Fri, 25 Mar 2022 07:16:57 +0000 (UTC) X-Received: from UB16Abner.asiapacific.hpqcorp.net (ub16abner.asiapacific.hpqcorp.net [15.119.209.229]) by g4t3433.houston.hpecorp.net (Postfix) with ESMTP id 81E9B54; Fri, 25 Mar 2022 07:16:55 +0000 (UTC) From: "Abner Chang" To: devel@edk2.groups.io Cc: abner.chang@hpe.com, Daniel Schaefer , Eric Dong , Ray Ni , Rahul Kumar , Sunil V L , Leif Lindholm , Michael D Kinney , Chao Li Subject: [edk2-devel] [PATCH V2 7/8] [RFC] UefiCpuPkg/Library: Add RiscVOpensbiLib Date: Fri, 25 Mar 2022 14:12:48 +0800 Message-Id: <20220325061249.30626-8-abner.chang@hpe.com> In-Reply-To: <20220325061249.30626-1-abner.chang@hpe.com> References: <20220325061249.30626-1-abner.chang@hpe.com> X-Proofpoint-ORIG-GUID: ODopSPwOmEd7Ud7Y88N4-COfwzj20MLZ X-Proofpoint-GUID: ODopSPwOmEd7Ud7Y88N4-COfwzj20MLZ X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 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: obbLfnEDQ7ATCwJE81EPMzSZx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1648192619; bh=JTa4mDBoIWSvgzo4mXd/GTj0lvxhcB3DrjC+la7GY48=; h=Cc:Date:From:Reply-To:Subject:To; b=K0jliCMoCmnnIv1H0d9kJWI62jmHsEMtuVKt0Yf+QCDZM64JaRhcKJxGwKztmjpRcK/ 83U5QWEK0CZWnT3Q3T3iyS4DQLoCrVu25wlETfvDj2XxQ2hBKSLP9xYHzZAUHhMWzkZZe Ay+VbtU5GSjk3ZkS6SEStQObgFUd3N73J1o= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1648192621169100001 Content-Type: text/plain; charset="utf-8" https://bugzilla.tianocore.org/show_bug.cgi?id=3D3860 (This is migrated from edk2-platforms:Silicon/RISC-V) EDK2 RISC-V OpenSBI library which pull in external source files under UefiCpuPkg/Library/RISC-V/RiscVOpensbiLib/opensbi to the build process. Signed-off-by: Abner Chang Co-authored-by: Daniel Schaefer Cc: Eric Dong Cc: Ray Ni Cc: Rahul Kumar Cc: Sunil V L Cc: Leif Lindholm Cc: Michael D Kinney Cc: Chao Li --- UefiCpuPkg/UefiCpuPkg.dec | 9 +- UefiCpuPkg/UefiCpuPkg.dsc | 6 ++ .../RiscVOpensbiLib/RiscVOpensbiLib.inf | 89 +++++++++++++++++++ 3 files changed, 103 insertions(+), 1 deletion(-) create mode 100644 UefiCpuPkg/Library/RISC-V/RiscVOpensbiLib/RiscVOpensbiL= ib.inf diff --git a/UefiCpuPkg/UefiCpuPkg.dec b/UefiCpuPkg/UefiCpuPkg.dec index 613881368b..f7e7142882 100644 --- a/UefiCpuPkg/UefiCpuPkg.dec +++ b/UefiCpuPkg/UefiCpuPkg.dec @@ -15,9 +15,16 @@ PACKAGE_GUID =3D 2171df9b-0d39-45aa-ac37-2de190010d23 PACKAGE_VERSION =3D 0.90 =20 -[Includes] +[Includes.common] Include =20 +[Includes.RISCV64] + Include/Library + Library/RISC-V/RiscVOpensbiLib/opensbi # OpenSBI header file ref= erence ("include/sbi/...") + Library/RISC-V/RiscVOpensbiLib/opensbi/include # Header file reference f= rom opensbi files, ("sbi/...") + Library/RISC-V/RiscVOpensbiLib/opensbi/platform/generic/include # Header= file reference from opensbi files, ("sbi/...") + + [LibraryClasses] ## @libraryclass Defines some routines that are used to register/manag= e/program ## CPU features. diff --git a/UefiCpuPkg/UefiCpuPkg.dsc b/UefiCpuPkg/UefiCpuPkg.dsc index 50c9fc294c..374e951f29 100644 --- a/UefiCpuPkg/UefiCpuPkg.dsc +++ b/UefiCpuPkg/UefiCpuPkg.dsc @@ -66,6 +66,9 @@ MicrocodeLib|UefiCpuPkg/Library/MicrocodeLib/MicrocodeLib.inf SmmCpuRendezvousLib|UefiCpuPkg/Library/SmmCpuRendezvousLib/SmmCpuRendezv= ousLib.inf =20 +[LibraryClasses.RISCV64] + RiscVOpensbiLib|UefiCpuPkg/Library/RISC-V/RiscVOpensbiLib/RiscVOpensbiLi= b.inf + [LibraryClasses.common.SEC] HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAlloc= ationLib.inf @@ -185,5 +188,8 @@ UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.inf UefiCpuPkg/Library/SmmCpuRendezvousLib/SmmCpuRendezvousLib.inf =20 +[Components.RISCV64] + UefiCpuPkg/Library/RISC-V/RiscVOpensbiLib/RiscVOpensbiLib.inf + [BuildOptions] *_*_*_CC_FLAGS =3D -D DISABLE_NEW_DEPRECATED_INTERFACES diff --git a/UefiCpuPkg/Library/RISC-V/RiscVOpensbiLib/RiscVOpensbiLib.inf = b/UefiCpuPkg/Library/RISC-V/RiscVOpensbiLib/RiscVOpensbiLib.inf new file mode 100644 index 0000000000..54eed050d4 --- /dev/null +++ b/UefiCpuPkg/Library/RISC-V/RiscVOpensbiLib/RiscVOpensbiLib.inf @@ -0,0 +1,89 @@ +## @file +# RISC-V Opensbi Library Instance. +# +# Copyright (c) 2022, Hewlett Packard Enterprise Development LP. All righ= ts reserved.
+# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +[Defines] + INF_VERSION =3D 0x0001001b + BASE_NAME =3D RiscVOpensbiLib + FILE_GUID =3D 6EF0C812-66F6-11E9-93CE-3F5D5F0DF0A7 + MODULE_TYPE =3D BASE + VERSION_STRING =3D 1.0 + LIBRARY_CLASS =3D RiscVOpensbiLib + +[Sources] + opensbi/lib/sbi/riscv_asm.c + opensbi/lib/sbi/riscv_atomic.c + opensbi/lib/sbi/riscv_hardfp.S + opensbi/lib/sbi/riscv_locks.c + opensbi/lib/sbi/sbi_bitmap.c + opensbi/lib/sbi/sbi_bitops.c + opensbi/lib/sbi/sbi_console.c + opensbi/lib/sbi/sbi_domain.c + opensbi/lib/sbi/sbi_ecall.c + opensbi/lib/sbi/sbi_ecall_base.c + opensbi/lib/sbi/sbi_ecall_hsm.c + opensbi/lib/sbi/sbi_ecall_legacy.c + opensbi/lib/sbi/sbi_ecall_replace.c + opensbi/lib/sbi/sbi_ecall_vendor.c + opensbi/lib/sbi/sbi_emulate_csr.c + opensbi/lib/sbi/sbi_fifo.c + opensbi/lib/sbi/sbi_hart.c + opensbi/lib/sbi/sbi_math.c + opensbi/lib/sbi/sbi_hfence.S + opensbi/lib/sbi/sbi_hsm.c + opensbi/lib/sbi/sbi_illegal_insn.c + opensbi/lib/sbi/sbi_init.c + opensbi/lib/sbi/sbi_ipi.c + opensbi/lib/sbi/sbi_misaligned_ldst.c + opensbi/lib/sbi/sbi_platform.c + opensbi/lib/sbi/sbi_scratch.c + opensbi/lib/sbi/sbi_string.c + opensbi/lib/sbi/sbi_system.c + opensbi/lib/sbi/sbi_timer.c + opensbi/lib/sbi/sbi_tlb.c + opensbi/lib/sbi/sbi_trap.c + opensbi/lib/sbi/sbi_unpriv.c + opensbi/lib/sbi/sbi_expected_trap.S + + opensbi/lib/utils/fdt/fdt_helper.c + opensbi/lib/utils/fdt/fdt_fixup.c + opensbi/lib/utils/fdt/fdt_domain.c + opensbi/lib/utils/ipi/fdt_ipi.c + opensbi/lib/utils/ipi/aclint_mswi.c + opensbi/lib/utils/ipi/fdt_ipi_mswi.c + opensbi/lib/utils/irqchip/fdt_irqchip.c + opensbi/lib/utils/irqchip/fdt_irqchip_plic.c + opensbi/lib/utils/irqchip/plic.c + opensbi/lib/utils/reset/fdt_reset.c + opensbi/lib/utils/reset/fdt_reset_htif.c + opensbi/lib/utils/reset/fdt_reset_sifive.c + opensbi/lib/utils/reset/fdt_reset_thead.c + opensbi/lib/utils/reset/fdt_reset_thead_asm.S + opensbi/lib/utils/serial/fdt_serial.c + opensbi/lib/utils/serial/fdt_serial_htif.c + opensbi/lib/utils/serial/fdt_serial_shakti.c + opensbi/lib/utils/serial/fdt_serial_sifive.c + opensbi/lib/utils/serial/fdt_serial_uart8250.c + opensbi/lib/utils/serial/fdt_serial_gaisler.c + opensbi/lib/utils/serial/gaisler-uart.c + opensbi/lib/utils/serial/shakti-uart.c + opensbi/lib/utils/serial/sifive-uart.c + opensbi/lib/utils/serial/uart8250.c + opensbi/lib/utils/sys/htif.c + opensbi/lib/utils/sys/sifive_test.c + opensbi/lib/utils/timer/fdt_timer.c + opensbi/lib/utils/timer/aclint_mtimer.c + opensbi/lib/utils/timer/fdt_timer_mtimer.c + +[Packages] + EmbeddedPkg/EmbeddedPkg.dec # For libfdt. + MdePkg/MdePkg.dec + UefiCpuPkg/UefiCpuPkg.dec + +[BuildOptions] + GCC:*_*_*_PP_FLAGS =3D -D__ASSEMBLY__ --=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 (#88019): https://edk2.groups.io/g/devel/message/88019 Mute This Topic: https://groups.io/mt/90017690/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-