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.web08.2747.1641618753902090817 for ; Fri, 07 Jan 2022 21:12:34 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@hpe.com header.s=pps0720 header.b=D6ASF6cm; 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=000704d8ca=abner.chang@hpe.com) Received: from pps.filterd (m0134425.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 2084mwLN020766 for ; Sat, 8 Jan 2022 05:12:33 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 : mime-version : content-transfer-encoding; s=pps0720; bh=/IpVI+LLN75MTCpBd7kLmT9UKNQlWzwbTtrwsKObHWY=; b=D6ASF6cmxrfCZh1/cjeL9VmVML5izkclw7OaxSgVTCH/CNrQQg7IoPHVs+pqcPV/ahM6 t+K/0aSnMUJV25sx+CGafv+Yng6JNvXrw5bz1tWavq87OSsJX6eGiLizCPc3aN/zanCM 0apPEOe4TXhQ7XR2wEHemaa8iJDXsOR/AfJdddHxczFxSz5hbowef1lvqbF+q6XGGvA3 p0NqqGWgIWPqouGadEhnpUx0DK6Y6+5FTGvcQTFvQRHzz72keb7jWjy66/2eZkbjIlY/ ajAompvrWmK6TGMEldOpjykcsH//4/JREmkvAyQlDOZCqjL8RO8FtkggFobZXx0pqEAG kw== Received: from g2t2354.austin.hpe.com (g2t2354.austin.hpe.com [15.233.44.27]) by mx0b-002e3701.pphosted.com (PPS) with ESMTPS id 3df3wtg3ae-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Sat, 08 Jan 2022 05:12:32 +0000 Received: from g2t2360.austin.hpecorp.net (g2t2360.austin.hpecorp.net [16.196.225.135]) by g2t2354.austin.hpe.com (Postfix) with ESMTP id BF9E683 for ; Sat, 8 Jan 2022 05:12:31 +0000 (UTC) Received: from UB16Abner.asiapacific.hpqcorp.net (ub16abner.asiapacific.hpqcorp.net [15.119.209.229]) by g2t2360.austin.hpecorp.net (Postfix) with ESMTP id 12B1446; Sat, 8 Jan 2022 05:12:30 +0000 (UTC) From: "Abner Chang" To: devel@edk2.groups.io Cc: abner.chang@hpe.com Subject: [PATCH 11/79] ProcesorPkg/Library: NULL instance of RISC-V platform timer library. Date: Sat, 8 Jan 2022 12:10:31 +0800 Message-Id: <20220108041121.16005-10-abner.chang@hpe.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220108041121.16005-1-abner.chang@hpe.com> References: <20220108041121.16005-1-abner.chang@hpe.com> MIME-Version: 1.0 X-Proofpoint-GUID: 5tbghxcPhMy1WlWqW5uulIop6PUKicwk X-Proofpoint-ORIG-GUID: 5tbghxcPhMy1WlWqW5uulIop6PUKicwk X-HPE-SCL: -1 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.11.62.513 definitions=2022-01-08_01,2022-01-07_01,2021-12-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 phishscore=0 bulkscore=0 priorityscore=1501 suspectscore=0 lowpriorityscore=0 spamscore=0 impostorscore=0 mlxscore=0 malwarescore=0 clxscore=1015 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2201080036 Content-Transfer-Encoding: quoted-printable (This is migrated from edk2-platforms:Silicon/RISC-V) NULL instance of RISC-V platform timer library. Signed-off-by: Abner Chang Co-authored-by: Gilbert Chen Reviewed-by: Leif Lindholm Cc: Leif Lindholm Cc: Gilbert Chen --- .../RiscVPlatformTimerLib.inf | 35 ++++++++++++++++ .../RiscVPlatformTimerLibNull.S | 40 +++++++++++++++++++ 2 files changed, 75 insertions(+) create mode 100644 Silicon/RISC-V/ProcessorPkg/Library/RiscVPlatformTimerL= ibNull/RiscVPlatformTimerLib.inf create mode 100644 Silicon/RISC-V/ProcessorPkg/Library/RiscVPlatformTimerL= ibNull/RiscVPlatformTimerLibNull.S diff --git a/Silicon/RISC-V/ProcessorPkg/Library/RiscVPlatformTimerLibNull/= RiscVPlatformTimerLib.inf b/Silicon/RISC-V/ProcessorPkg/Library/RiscVPlatfo= rmTimerLibNull/RiscVPlatformTimerLib.inf new file mode 100644 index 0000000000..6bf168c72e --- /dev/null +++ b/Silicon/RISC-V/ProcessorPkg/Library/RiscVPlatformTimerLibNull/RiscVPl= atformTimerLib.inf @@ -0,0 +1,35 @@ +## @file=0D +# RISC-V CPU lib to override timer mechanism for U500 platform.=0D +#=0D +# Copyright (c) 2019, Hewlett Packard Enterprise Development LP. All right= s reserved.
=0D +#=0D +# SPDX-License-Identifier: BSD-2-Clause-Patent=0D +#=0D +##=0D +=0D +[Defines]=0D + INF_VERSION =3D 0x0001001b=0D + BASE_NAME =3D RiscVPlatformTimerLibNull=0D + FILE_GUID =3D 93FDB133-476E-4726-A65D-C10D5C9A68DE= =0D + MODULE_TYPE =3D BASE=0D + VERSION_STRING =3D 1.0=0D + LIBRARY_CLASS =3D RiscVPlatformTimerLib=0D +=0D +#=0D +# The following information is for reference only and not required by the = build tools.=0D +#=0D +# VALID_ARCHITECTURES =3D RISCV64=0D +#=0D +=0D +[Sources]=0D +=0D +[Sources.RISCV64]=0D + RiscVPlatformTimerLibNull.S=0D +=0D +[Packages]=0D + MdeModulePkg/MdeModulePkg.dec=0D + MdePkg/MdePkg.dec=0D +=0D +=0D +=0D +=0D diff --git a/Silicon/RISC-V/ProcessorPkg/Library/RiscVPlatformTimerLibNull/= RiscVPlatformTimerLibNull.S b/Silicon/RISC-V/ProcessorPkg/Library/RiscVPlat= formTimerLibNull/RiscVPlatformTimerLibNull.S new file mode 100644 index 0000000000..815ab06bac --- /dev/null +++ b/Silicon/RISC-V/ProcessorPkg/Library/RiscVPlatformTimerLibNull/RiscVPl= atformTimerLibNull.S @@ -0,0 +1,40 @@ +//------------------------------------------------------------------------= ------=0D +//=0D +// Null instance of Timer CSR functions.=0D +//=0D +// Copyright (c) 2019, Hewlett Packard Enterprise Development LP. All righ= ts reserved.
=0D +//=0D +// SPDX-License-Identifier: BSD-2-Clause-Patent=0D +//=0D +//------------------------------------------------------------------------= ------=0D +#include =0D +=0D +.data=0D +=0D +.text=0D +.align 3=0D +=0D +.global ASM_PFX(RiscVReadMachineTimer)=0D +.global ASM_PFX(RiscVSetMachineTimerCmp)=0D +.global ASM_PFX(RiscVReadMachineTimerCmp)=0D +=0D +//=0D +// Read machine timer CSR.=0D +// @retval a0 : 64-bit machine timer.=0D +//=0D +ASM_PFX (RiscVReadMachineTimer):=0D + ret=0D +=0D +//=0D +// Set machine timer compare CSR.=0D +// @param a0 : UINT64=0D +//=0D +ASM_PFX (RiscVSetMachineTimerCmp):=0D + ret=0D +=0D +//=0D +// Read machine timer compare CSR.=0D +// @param a0 : UINT64=0D +//=0D +ASM_PFX (RiscVReadMachineTimerCmp):=0D + ret=0D --=20 2.31.1