From mboxrd@z Thu Jan 1 00:00:00 1970 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 Authentication-Results: mx.groups.io; dkim=pass header.i=@hpe.com header.s=pps0720 header.b=O+KpE0kT; spf=permerror, err=parse error for token &{10 18 %{ir}.%{v}.%{d}.spf.has.pphosted.com}: invalid domain name (domain: hpe.com, ip: 148.163.143.35, mailfrom: prvs=0083f32eee=abner.chang@hpe.com) 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hpe.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : mime-version; s=pps0720; bh=4ncLSceO+GJXJ2JDndCrWaScGKqNRIAPMHfev2L205I=; b=O+KpE0kTu1E2iLwF8qseEx/iJjj31xzzkN6Anmt/AtxQLQ5R+HUVfwVmKuB2Q/EX2YmP /w0843pyC/XiZzka7C9IYoDKZifmETq+r4nurLm8RFxkh3VyJZNVb5QLdkdhQqa3+PKZ 3GTj8aoqB0OpZqcrvEO56UsO6qc1txn8FuE+M0wML+CbuDJQ9jAgiRNHYHBh42w9grup etDtz5JvJtub659CgMZ8uH4Rcb2+EL2FBsQU0NWeg8VpLbVZM/e+8Qj4387RfrtrEllC Umdt1yzZCq4jKijk5i+hEOfoj4iwpMJO+yZUMxN1QBhrEqGdTafrwh7jMAVQMT4Z2cnX Ew== 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 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) 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: [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> X-Mailer: git-send-email 2.31.1 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 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.850,Hydra:6.0.425,FMLib:17.11.64.514 definitions=2022-03-25_02,2022-03-24_01,2022-02-23_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 clxscore=1015 lowpriorityscore=0 malwarescore=0 bulkscore=0 suspectscore=0 phishscore=0 impostorscore=0 adultscore=0 priorityscore=1501 mlxscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2203250039 Content-Transfer-Encoding: quoted-printable 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= =0D PACKAGE_VERSION =3D 0.90=0D =0D -[Includes]=0D +[Includes.common]=0D Include=0D =0D +[Includes.RISCV64]=0D + Include/Library=0D + Library/RISC-V/RiscVOpensbiLib/opensbi # OpenSBI header file ref= erence ("include/sbi/...")=0D + Library/RISC-V/RiscVOpensbiLib/opensbi/include # Header file reference f= rom opensbi files, ("sbi/...")=0D + Library/RISC-V/RiscVOpensbiLib/opensbi/platform/generic/include # Header= file reference from opensbi files, ("sbi/...")=0D +=0D +=0D [LibraryClasses]=0D ## @libraryclass Defines some routines that are used to register/manag= e/program=0D ## CPU features.=0D 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=0D SmmCpuRendezvousLib|UefiCpuPkg/Library/SmmCpuRendezvousLib/SmmCpuRendezv= ousLib.inf=0D =0D +[LibraryClasses.RISCV64]=0D + RiscVOpensbiLib|UefiCpuPkg/Library/RISC-V/RiscVOpensbiLib/RiscVOpensbiLi= b.inf=0D +=0D [LibraryClasses.common.SEC]=0D HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf=0D MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAlloc= ationLib.inf=0D @@ -185,5 +188,8 @@ UefiCpuPkg/ResetVector/Vtf0/Bin/ResetVector.inf=0D UefiCpuPkg/Library/SmmCpuRendezvousLib/SmmCpuRendezvousLib.inf=0D =0D +[Components.RISCV64]=0D + UefiCpuPkg/Library/RISC-V/RiscVOpensbiLib/RiscVOpensbiLib.inf=0D +=0D [BuildOptions]=0D *_*_*_CC_FLAGS =3D -D DISABLE_NEW_DEPRECATED_INTERFACES=0D 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=0D +# RISC-V Opensbi Library Instance.=0D +#=0D +# Copyright (c) 2022, Hewlett Packard Enterprise Development LP. All righ= ts reserved.
=0D +#=0D +# SPDX-License-Identifier: BSD-2-Clause-Patent=0D +#=0D +##=0D +=0D +[Defines]=0D + INF_VERSION =3D 0x0001001b=0D + BASE_NAME =3D RiscVOpensbiLib=0D + FILE_GUID =3D 6EF0C812-66F6-11E9-93CE-3F5D5F0DF0A7=0D + MODULE_TYPE =3D BASE=0D + VERSION_STRING =3D 1.0=0D + LIBRARY_CLASS =3D RiscVOpensbiLib=0D +=0D +[Sources]=0D + opensbi/lib/sbi/riscv_asm.c=0D + opensbi/lib/sbi/riscv_atomic.c=0D + opensbi/lib/sbi/riscv_hardfp.S=0D + opensbi/lib/sbi/riscv_locks.c=0D + opensbi/lib/sbi/sbi_bitmap.c=0D + opensbi/lib/sbi/sbi_bitops.c=0D + opensbi/lib/sbi/sbi_console.c=0D + opensbi/lib/sbi/sbi_domain.c=0D + opensbi/lib/sbi/sbi_ecall.c=0D + opensbi/lib/sbi/sbi_ecall_base.c=0D + opensbi/lib/sbi/sbi_ecall_hsm.c=0D + opensbi/lib/sbi/sbi_ecall_legacy.c=0D + opensbi/lib/sbi/sbi_ecall_replace.c=0D + opensbi/lib/sbi/sbi_ecall_vendor.c=0D + opensbi/lib/sbi/sbi_emulate_csr.c=0D + opensbi/lib/sbi/sbi_fifo.c=0D + opensbi/lib/sbi/sbi_hart.c=0D + opensbi/lib/sbi/sbi_math.c=0D + opensbi/lib/sbi/sbi_hfence.S=0D + opensbi/lib/sbi/sbi_hsm.c=0D + opensbi/lib/sbi/sbi_illegal_insn.c=0D + opensbi/lib/sbi/sbi_init.c=0D + opensbi/lib/sbi/sbi_ipi.c=0D + opensbi/lib/sbi/sbi_misaligned_ldst.c=0D + opensbi/lib/sbi/sbi_platform.c=0D + opensbi/lib/sbi/sbi_scratch.c=0D + opensbi/lib/sbi/sbi_string.c=0D + opensbi/lib/sbi/sbi_system.c=0D + opensbi/lib/sbi/sbi_timer.c=0D + opensbi/lib/sbi/sbi_tlb.c=0D + opensbi/lib/sbi/sbi_trap.c=0D + opensbi/lib/sbi/sbi_unpriv.c=0D + opensbi/lib/sbi/sbi_expected_trap.S=0D +=0D + opensbi/lib/utils/fdt/fdt_helper.c=0D + opensbi/lib/utils/fdt/fdt_fixup.c=0D + opensbi/lib/utils/fdt/fdt_domain.c=0D + opensbi/lib/utils/ipi/fdt_ipi.c=0D + opensbi/lib/utils/ipi/aclint_mswi.c=0D + opensbi/lib/utils/ipi/fdt_ipi_mswi.c=0D + opensbi/lib/utils/irqchip/fdt_irqchip.c=0D + opensbi/lib/utils/irqchip/fdt_irqchip_plic.c=0D + opensbi/lib/utils/irqchip/plic.c=0D + opensbi/lib/utils/reset/fdt_reset.c=0D + opensbi/lib/utils/reset/fdt_reset_htif.c=0D + opensbi/lib/utils/reset/fdt_reset_sifive.c=0D + opensbi/lib/utils/reset/fdt_reset_thead.c=0D + opensbi/lib/utils/reset/fdt_reset_thead_asm.S=0D + opensbi/lib/utils/serial/fdt_serial.c=0D + opensbi/lib/utils/serial/fdt_serial_htif.c=0D + opensbi/lib/utils/serial/fdt_serial_shakti.c=0D + opensbi/lib/utils/serial/fdt_serial_sifive.c=0D + opensbi/lib/utils/serial/fdt_serial_uart8250.c=0D + opensbi/lib/utils/serial/fdt_serial_gaisler.c=0D + opensbi/lib/utils/serial/gaisler-uart.c=0D + opensbi/lib/utils/serial/shakti-uart.c=0D + opensbi/lib/utils/serial/sifive-uart.c=0D + opensbi/lib/utils/serial/uart8250.c=0D + opensbi/lib/utils/sys/htif.c=0D + opensbi/lib/utils/sys/sifive_test.c=0D + opensbi/lib/utils/timer/fdt_timer.c=0D + opensbi/lib/utils/timer/aclint_mtimer.c=0D + opensbi/lib/utils/timer/fdt_timer_mtimer.c=0D +=0D +[Packages]=0D + EmbeddedPkg/EmbeddedPkg.dec # For libfdt.=0D + MdePkg/MdePkg.dec=0D + UefiCpuPkg/UefiCpuPkg.dec=0D +=0D +[BuildOptions]=0D + GCC:*_*_*_PP_FLAGS =3D -D__ASSEMBLY__=0D --=20 2.31.1