From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-002e3701.pphosted.com (mx0a-002e3701.pphosted.com [148.163.147.86]) by mx.groups.io with SMTP id smtpd.web10.1900.1614828111155287793 for ; Wed, 03 Mar 2021 19:21:51 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@hpe.com header.s=pps0720 header.b=QSGfeCqj; spf=pass (domain: hpe.com, ip: 148.163.147.86, mailfrom: prvs=06976aa159=daniel.schaefer@hpe.com) Received: from pps.filterd (m0134421.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 1243J0CC029131; Thu, 4 Mar 2021 03:21:45 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-type : content-transfer-encoding : mime-version; s=pps0720; bh=wrv6qIE+5n1hsQZXh+wOkRHQqf25ummAusNoEaY6RnQ=; b=QSGfeCqjTDlDBjhvY8NgECL5k55NPOjHxnhZiri9BQfYtwzuLQTU9QoDwpviubTp88tF gyhD6D81Mkc12+/uC1KcfZ211QPmgu6MjhjBI6dPSsOqOUYQvMGa0GtQKvGRDudDI+hu f4VcdQqIs/ndRseF5FviX5OqTy3/tqW4Mnp8Nzaz2RsG57c0L1zOrw4Z9HQCgIDlKZ3h uxwb6Q5tHC0digKkyNYV4mUQYjDTdRwTXpOeGX40SvtY877yt3uLPP1ek3IgZNBuC4/8 cK+abybL38xTUVjijJP09bysQatUuIHAxPDrjvxLa/Sv/MX57tIOOIwtqQS8mSizoumk hg== Received: from g2t2353.austin.hpe.com (g2t2353.austin.hpe.com [15.233.44.26]) by mx0b-002e3701.pphosted.com with ESMTP id 372nt2gj07-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 04 Mar 2021 03:21:45 +0000 Received: from G2W6310.americas.hpqcorp.net (g2w6310.austin.hp.com [16.197.64.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by g2t2353.austin.hpe.com (Postfix) with ESMTPS id 85C016D; Thu, 4 Mar 2021 03:21:44 +0000 (UTC) Received: from G1W8107.americas.hpqcorp.net (2002:10c1:483b::10c1:483b) by G2W6310.americas.hpqcorp.net (2002:10c5:4034::10c5:4034) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 4 Mar 2021 03:21:44 +0000 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (15.241.52.11) by G1W8107.americas.hpqcorp.net (16.193.72.59) with Microsoft SMTP Server (TLS) id 15.0.1497.2 via Frontend Transport; Thu, 4 Mar 2021 03:21:43 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cM03vNkFzphF6qeH3OBiq9LNFyeN8QM09IqJfT2mBo3NJAR/pf4eCYag1LWur7WX/14guYzXGrZUKqMAMiJEJXr+vcDEYtuJhgnphTbNaIf40v6FnzaiUW/YFzg7u77sOZyFG+GQAt1ZO97ArxE2HOTklea3QdYlXTjbqTOoPcDd5sI9eicr7aA70MjxG/Vqb6ZcNe963nDndiB+UpEHbwCs5BCJlUW9QQRme07GQ1bSJaI03Nq7qTr7A/KRbguIKG+i1RX2rhQS22A4A8SwZMBB0NmXlINcZkv5d27Hsa1JRzSnLh4wOicxox8xSJBPmvzCEybIZ9q9DPftNPrB0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=wrv6qIE+5n1hsQZXh+wOkRHQqf25ummAusNoEaY6RnQ=; b=WoudCgKjsjpccCtWr6DmEjTLDi3u53pL8ktqGcA7AxMePxoNJPoqrzh0JzBR4uELODQjYu4LPQkObtygRz06EJ3Jmd4P7YxY+yxQIGAtv36eL2K9tJ80d+zp5AYnIwuGO39OdwRD8XakycYsVUV9f+2fGsdDK5/gcc+mSCnLSGcVSuxC961Yumj9hTzDnJ3RTp2mH6yW7f7Qbx54jRi5l2X4wRnxopO3B9PdBARqCcu+0pNSs1vVTmBvfH4A0ToBxUUkhD2sCy/yIgnbNVlqBk3Uq/fDl+J82wxFn67L8AE70POaeSh/c58YYOHwQqgbNyXyobD9Q+24idrlg49vmQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=hpe.com; dmarc=pass action=none header.from=hpe.com; dkim=pass header.d=hpe.com; arc=none Authentication-Results: edk2.groups.io; dkim=none (message not signed) header.d=none;edk2.groups.io; dmarc=none action=none header.from=hpe.com; Received: from DF4PR8401MB0444.NAMPRD84.PROD.OUTLOOK.COM (2a01:111:e400:760d::23) by DF4PR8401MB0506.NAMPRD84.PROD.OUTLOOK.COM (2a01:111:e400:7606::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3912.17; Thu, 4 Mar 2021 03:21:42 +0000 Received: from DF4PR8401MB0444.NAMPRD84.PROD.OUTLOOK.COM ([fe80::ad2c:ff74:846c:5318]) by DF4PR8401MB0444.NAMPRD84.PROD.OUTLOOK.COM ([fe80::ad2c:ff74:846c:5318%7]) with mapi id 15.20.3912.017; Thu, 4 Mar 2021 03:21:42 +0000 From: "Daniel Schaefer" To: CC: G Edhaya Chandran , Barton Gao , Samer El-Haj-Mahmoud , Eric Jin , Arvin Chen , Leif Lindholm , Heinrich Schuchardt , Abner Chang Subject: [edk2-test PATCHv3 2/5] SctPkg: Adapt Aarch64 sources for Riscv64 Date: Thu, 4 Mar 2021 11:21:13 +0800 Message-ID: <20210304032116.24357-3-daniel.schaefer@hpe.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210304032116.24357-1-daniel.schaefer@hpe.com> References: <20210304032116.24357-1-daniel.schaefer@hpe.com> X-Originating-IP: [15.211.146.34] X-ClientProxiedBy: SG2PR06CA0172.apcprd06.prod.outlook.com (2603:1096:1:1e::26) To DF4PR8401MB0444.NAMPRD84.PROD.OUTLOOK.COM (2a01:111:e400:760d::23) X-MS-Exchange-MessageSentRepresentingType: 1 Received: from x360-nix.wireless.hpe.com (15.211.146.34) by SG2PR06CA0172.apcprd06.prod.outlook.com (2603:1096:1:1e::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3912.17 via Frontend Transport; Thu, 4 Mar 2021 03:21:39 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 428e7650-7e66-4828-2e17-08d8debca1c6 X-MS-TrafficTypeDiagnostic: DF4PR8401MB0506: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: oqC2qguXAE7Ieg/ZjxyZqt0stVAEM9VfW5Hv3WKMkvSzr6CQHz4AsGPS2qmznzffqF8eOMHteqiRXR86jBplcWTTspLsmqLXJGp/5JbpUk/d5MR/6G9g+vNEi/nR9iUvlH+AoYtVBp61Lm4Xk7KiobEDcHljZN5qtPUdcr4IBo1f1VR7zgXkexG2pX42PzwlAxpJHytEhh7bDVQhUgGlfLuJeuXUiuS+TlkkO9kKD1FJeP0gIwcH5+NlxfmxCN8DP/aoGhNiB5Id7N+uzNT78Wtzs4qiX1QOzUA1jglIRJCHNUn/O/TCZwagWQoIcwdk1SW1RS2iusqNBcS9U1qsPGTLMzT8mr2ixuPqLI/WA7KLmJId/xzxaefvpa6VgB1lXcELPZq4VMEdenFwgs6Xfr8MXIr595gTQaQ9Ve2RfnDxgkGSReO6LRRbhCPNSkvkAOQLpALs7f1N1DFhfnarKHdh6ilq+hsb7FTj7w6VxskF/eeCjLyYlptuKJTE8itOv3CmR2WFxxbsb2C9kbD04e+L2ndrCZ5xRX8f5R19UhWLkowJJh47CZhrofHVXORc/uOVMFacUnHrW7SQigNVd8lNE7QAVy94wXsxVzUYacw= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DF4PR8401MB0444.NAMPRD84.PROD.OUTLOOK.COM;PTR:;CAT:NONE;SFS:(136003)(366004)(346002)(396003)(376002)(39860400002)(316002)(5660300002)(26005)(186003)(83380400001)(1076003)(86362001)(30864003)(66946007)(2616005)(6916009)(8936002)(6666004)(956004)(2906002)(44832011)(36756003)(16526019)(66556008)(66476007)(4326008)(19627235002)(8676002)(7696005)(478600001)(52116002)(15188155005)(6486002)(16799955002)(54906003)(966005);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?lrzUG0aYtA7ldb6lAlpeLj/EGtbRR3SVx5E2U/mfj/Vzd39iiAx4tZQTwx7J?= =?us-ascii?Q?dn+YWJmHxm6hDT49OTzuehwAGLY2JmePyi3mFdX4+3288FC59AGl8Ek6tDs8?= =?us-ascii?Q?T71jLPH+lznsTSRjDvogEt1P2GoOQqgJb6ojbueNQ92vUACyYb+a5sU5JLS6?= =?us-ascii?Q?Bjh0qnlUglWj2/kAatKIRSSELDD2PiqXc/NBfZjAoOG70TtE5UxYTLeDMsaA?= =?us-ascii?Q?jkvGPdKwGSyZyVBamwagU5S9aNGWCkuTFaJhNOLOhOEDgF2ptUet+JjIhr/q?= =?us-ascii?Q?w5zihh0QbQ9+NJgIrNcl9Tb9lUgkyOEPPOVxTMnOXqa2TBPja6Eunn3aGsXU?= =?us-ascii?Q?DrJIkSoJG7x/h/VGMee0cYQWWd8LKdhns0MWprtclh6vC7Eoep4nBiKkOu+j?= =?us-ascii?Q?cD98JImZNjwzndiVxIVOE+QciXzEVGtoGYkCeC7B7kcNDpT9IDIXMCOIAoBW?= =?us-ascii?Q?Z/uCRN1ecufa2F9tJiRNduwUPUZWzrYaTvSjaBjEAA6qHuOWa+4wFSfdrFWK?= =?us-ascii?Q?ZeOgRn3si6OW3LzSjshYzlF7D2WrvlX/id8jMwv7MdeTkeUiizuCB20Gi2Rj?= =?us-ascii?Q?oAfhJ7jDCO3RJMT1eMTkmvNrK5MRVUnLDInxfjtTuHsi18LLiJPprIP9AAmP?= =?us-ascii?Q?TCEu9q+g6huhR0B2Wuhvwoac1oTMtUZxs/l5W9hgTnS+ahnoXEOjxZuLnNO3?= =?us-ascii?Q?sqdNw+pEklUIvz++y2CiSx6W0pbByX2bsgsZ6Ku8dOwtAxjxtjM1PlXtX6EC?= =?us-ascii?Q?k0JC4LET+zpy91yPCHg/usvgmEevJXGl5j0IbJr1Hez8d0wiS7o9fN6sOIrn?= =?us-ascii?Q?LJ3jhvY3+meRrwStjOx40wS79Xnb0bzbY/fSII3QrFXBtM/K9ytaQX+gSCRI?= =?us-ascii?Q?kzgL+YBjec8h31MpElIXIqdGNtTrFR1kLoifXOdk7blBvYztmuGcQuMn3nFb?= =?us-ascii?Q?OSR7DF8yXFzgyaGJuNgpkx/fOWmnfwvOzko3OMLNSGOP3JxoloNlEth1sSm0?= =?us-ascii?Q?pI3bfx3Y1gOABXitEb+vuhfdgcNtGBZlnbKFA+px5SK58kjxQ5Zm0b8K2Tb1?= =?us-ascii?Q?EiD30ZrJQ/VGTpChA4BCM/UAKTYlFKhtYplxgxMckYNeZPQ1mbvrH5QzedXy?= =?us-ascii?Q?7xj97Cv6KlpK+aeaAmyVGBpR8OnhgLAAzVW0nXAIcbTMhIn/IvUutOnjR6XR?= =?us-ascii?Q?SM14Rfqvf0zeej1+rcX9KUEWhBsyhQ7kDSggO+vgl2g4G8aNN27va3cHy3eD?= =?us-ascii?Q?RKnRexhq4lRoou4Lz803TT7gSiWe9kuYs0Bwbkgj+vIVG5u/8ChSEgOL1Eo0?= =?us-ascii?Q?hnod/kYXEasqzKC+LB/V9E3b?= X-MS-Exchange-CrossTenant-Network-Message-Id: 428e7650-7e66-4828-2e17-08d8debca1c6 X-MS-Exchange-CrossTenant-AuthSource: DF4PR8401MB0444.NAMPRD84.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Mar 2021 03:21:42.6260 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 105b2061-b669-4b31-92ac-24d304d195dc X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: MCtc2WmLm0Njgitp1srylLrSaWRifHRranVN897JK59Kn1iIvYlLmm/tBmj5q3hVIEP4FHURgOCXOkvt2RA0rQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DF4PR8401MB0506 X-OriginatorOrg: hpe.com X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-HPE-SCL: -1 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.369,18.0.761 definitions=2021-03-04_01:2021-03-03,2021-03-04 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 mlxlogscore=999 lowpriorityscore=0 mlxscore=0 clxscore=1015 phishscore=0 adultscore=0 suspectscore=0 impostorscore=0 malwarescore=0 spamscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2103040012 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D3042 Cc: G Edhaya Chandran Cc: Barton Gao Cc: Samer El-Haj-Mahmoud Cc: Eric Jin Cc: Arvin Chen Cc: Leif Lindholm Cc: Heinrich Schuchardt Cc: Abner Chang Signed-off-by: Daniel Schaefer --- uefi-sct/SctPkg/Library/SctLib/Riscv64/SctLibPlat.h = | 3 +- uefi-sct/SctPkg/SCRT/SCRTApp/Riscv64/GoVirtual.S = | 9 ++-- uefi-sct/SctPkg/SCRT/SCRTApp/Riscv64/VirtualMemory.c = | 16 +++---- uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Debug.c = | 22 +++------ uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Io.c = | 7 +-- uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Io.h = | 48 -------------------- uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Riscv= 64/DebugSupportBBTestExceptionCallbackFunction.c | 12 ++--- uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Riscv= 64/PlatformIsa.c | 4 +- uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Riscv64/EntsL= ibPlat.h | 3 +- 9 files changed, 32 insertions(+), 92 deletions(-) diff --git a/uefi-sct/SctPkg/Library/SctLib/Riscv64/SctLibPlat.h b/uefi-sct= /SctPkg/Library/SctLib/Riscv64/SctLibPlat.h index ee7c656b..69e7f904 100644 --- a/uefi-sct/SctPkg/Library/SctLib/Riscv64/SctLibPlat.h +++ b/uefi-sct/SctPkg/Library/SctLib/Riscv64/SctLibPlat.h @@ -2,6 +2,7 @@ =0D Copyright 2006 - 2012 Unified EFI, Inc.
=0D Copyright (c) 2011 - 2012, ARM Ltd. All rights reserved.
=0D + Copyright (c) 2021, Hewlett Packard Enterprise Development LP. All right= s reserved.
=0D =0D This program and the accompanying materials=0D are licensed and made available under the terms and conditions of the BS= D License=0D @@ -20,7 +21,7 @@ Module Name: =0D Abstract:=0D =0D - AArch64 specific defines=0D + RISCV64 specific defines=0D =0D --*/=0D =0D diff --git a/uefi-sct/SctPkg/SCRT/SCRTApp/Riscv64/GoVirtual.S b/uefi-sct/Sc= tPkg/SCRT/SCRTApp/Riscv64/GoVirtual.S index d223b36b..ae33da18 100644 --- a/uefi-sct/SctPkg/SCRT/SCRTApp/Riscv64/GoVirtual.S +++ b/uefi-sct/SctPkg/SCRT/SCRTApp/Riscv64/GoVirtual.S @@ -2,6 +2,7 @@ #=0D # Copyright 2010 - 2012 Unified EFI, Inc.
=0D # Copyright (c) 2012, ARM Ltd. All rights reserved.
=0D +# Copyright (c) 2021, Hewlett Packard Enterprise Development LP.
=0D #=0D # This program and the accompanying materials=0D # are licensed and made available under the terms and conditions of the B= SD License=0D @@ -23,8 +24,6 @@ #--*/=0D #start of the code section=0D .text=0D -/* FIXME: Should alignment be different on Aarch64? */=0D -.align 3=0D =0D .global JumpToTestFunc=0D .type JumpToTestFunc, %function=0D @@ -37,8 +36,8 @@ # )=0D #=0D JumpToTestFunc:=0D - mov x2, x0=0D - mov x0, x1=0D + mv x2, x0=0D + mv x0, x1=0D =0D // Jump to Virtual function=0D - blr x2=0D + jalr x2=0D diff --git a/uefi-sct/SctPkg/SCRT/SCRTApp/Riscv64/VirtualMemory.c b/uefi-sc= t/SctPkg/SCRT/SCRTApp/Riscv64/VirtualMemory.c index 397b3514..00b59594 100644 --- a/uefi-sct/SctPkg/SCRT/SCRTApp/Riscv64/VirtualMemory.c +++ b/uefi-sct/SctPkg/SCRT/SCRTApp/Riscv64/VirtualMemory.c @@ -2,6 +2,7 @@ =0D Copyright 2006 - 2012 Unified EFI, Inc.
=0D Copyright (c) 2012, ARM Ltd. All rights reserved.
=0D + Copyright (c) 2021, Hewlett Packard Enterprise Development LP. All right= s reserved.
=0D =0D This program and the accompanying materials=0D are licensed and made available under the terms and conditions of the BS= D License=0D @@ -22,9 +23,6 @@ Module Name: =0D #include "SCRTApp.h"=0D =0D -#define VIRT_TO_PHYS_OFFSET (0x80000000) //2G=0D -=0D -BOOLEAN HighAddress =3D FALSE;=0D UINTN PageTable =3D 0;=0D =0D =0D @@ -49,11 +47,10 @@ Returns: =0D --*/=0D {=0D - /*Note: It is presumed that on ARM v5, V6 and V7 architectures=0D - * the MMU is configured and enabled in PEI phase. As VirtualFunc=0D - * is already mapped to virtual memory, don't have to do anything here.=0D + /* Note: It is presumed that on RISCV architectures the MMU is configure= d and=0D + * enabled in PEI phase. As VirtualFunc is already mapped to virtual mem= ory,=0D + * don't have to do anything here.=0D */=0D - /* FIXME: Is it the same on ARM v8? */=0D }=0D =0D =0D @@ -174,9 +171,8 @@ Returns: --*/=0D {=0D //=0D - // Note: It is assumed that the MMU and page tables are configured on AR= M platforms=0D - // based on ARM v5 v6 and v7 architecture.=0D + // Note: It is assumed that the MMU and page tables are configured on RI= SC-V=0D + // platforms.=0D //=0D - /* FIXME: Is it the same on ARM v8? */=0D JumpToTestFunc(VirtualFunc, HandOffAddr);=0D }=0D diff --git a/uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Debug.c b/uefi-sct/Sct= Pkg/SCRT/SCRTDriver/Riscv64/Debug.c index 6161d596..2991935a 100644 --- a/uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Debug.c +++ b/uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Debug.c @@ -1,7 +1,8 @@ /** @file=0D =0D Copyright 2006 - 2012 Unified EFI, Inc.
=0D - Copyright (c) 2011 - 2012 ARM Ltd. All rights reserved.
=0D + Copyright (c) 2011 - 2012 ARM Ltd. All rights reserved.
=0D + Copyright (c) 2021 Hewlett Packard Enterprise Development LP. All rights= reserved.
=0D =0D This program and the accompanying materials=0D are licensed and made available under the terms and conditions of the BS= D License=0D @@ -24,7 +25,6 @@ Module Name: #include "SCRTDriver.h"=0D =0D UINTN mHandOffPtr =3D 0;=0D -EFI_PHYSICAL_ADDRESS mIoPortSpaceAddress =3D 0;=0D =0D =0D EFI_STATUS=0D @@ -42,18 +42,10 @@ ConsumeHandOff ( HandOffPtr =3D (RUNTIME_HANDOFF*)mHandOffPtr;=0D *ConfigData =3D HandOffPtr->ConfigureInfo;=0D =0D - if (!HandOffPtr->DebuggerInfo.MmioFlag){=0D - //=0D - // If debug port is I/O mapped, fix IoBase Address.=0D - //=0D - FixAddress(&HandOffPtr->DebuggerInfo.IoBase);=0D - mIoPortSpaceAddress =3D HandOffPtr->DebuggerInfo.IoBase;=0D - } else {=0D - //=0D - // If debug port is MMIO, fix MmioBase Address.=0D - //=0D - FixAddress(&HandOffPtr->DebuggerInfo.MmioBase);=0D - }=0D + //=0D + // Fix MmioBase Address.=0D + //=0D + FixAddress(&HandOffPtr->DebuggerInfo.MmioBase);=0D =0D return EFI_SUCCESS;=0D }=0D @@ -65,7 +57,7 @@ Send2UART ( )=0D {=0D //=0D - // TODO: On ARM platforms use platform specific functions to=0D + // TODO: On RISC-V platforms use platform specific functions to=0D // write the data to UART.=0D //=0D return EFI_SUCCESS;=0D diff --git a/uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Io.c b/uefi-sct/SctPkg= /SCRT/SCRTDriver/Riscv64/Io.c index b925e151..255cb9a6 100644 --- a/uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Io.c +++ b/uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Io.c @@ -2,6 +2,7 @@ =0D Copyright 2006 - 2012 Unified EFI, Inc.
=0D Copyright (c) 2011 - 2012 ARM Ltd. All rights reserved.
=0D + (C) Copyright 2021 Hewlett Packard Enterprise Development LP
=0D =0D This program and the accompanying materials=0D are licensed and made available under the terms and conditions of the BS= D License=0D @@ -21,7 +22,7 @@ Module Name: =0D --*/=0D =0D -#include "Io.h"=0D +#include "SCRTDriver.h"=0D =0D EFI_STATUS=0D EFIAPI=0D @@ -119,11 +120,11 @@ FixAddress ( )=0D {=0D //=0D - //Note: On ARM platforms don't have to do this as all the functions are = virtually mapped.=0D + //Note: On RISC-V platforms don't have to do this as all the functions a= re virtually mapped.=0D //=0D }=0D =0D -// Quick port to ARM=0D +// Quick port to RISC-V. It doesn't have traditional I/O-Port 80h POST Cod= es=0D =0D VOID=0D Port80 (=0D diff --git a/uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Io.h b/uefi-sct/SctPkg= /SCRT/SCRTDriver/Riscv64/Io.h deleted file mode 100644 index 1e78b3e4..00000000 --- a/uefi-sct/SctPkg/SCRT/SCRTDriver/Riscv64/Io.h +++ /dev/null @@ -1,48 +0,0 @@ -/** @file=0D -=0D - Copyright 2006 - 2012 Unified EFI, Inc.
=0D - Copyright (c) 2011 - 2012 ARM Ltd. All rights reserved.
=0D -=0D - This program and the accompanying materials=0D - are licensed and made available under the terms and conditions of the BS= D License=0D - which accompanies this distribution. The full text of the license may b= e found at =0D - http://opensource.org/licenses/bsd-license.php=0D - =0D - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,=0D - WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED.=0D - =0D -**/=0D -=0D -/*++=0D -=0D -Module Name:=0D -=0D - Debug.h=0D -=0D ---*/=0D -=0D -#ifndef _IA32_IO_ACCESS_H=0D -#define _IA32_IO_ACCESS_H=0D -=0D -#include "SCRTDriver.h"=0D -=0D -#define IA32_MAX_IO_ADDRESS 0xFFFF=0D -=0D -#define IA32API=0D -=0D -=0D -typedef union {=0D - UINT8 VOLATILE *buf;=0D - UINT8 VOLATILE *ui8;=0D - UINT16 VOLATILE *ui16;=0D - UINT32 VOLATILE *ui32;=0D - UINT64 VOLATILE *ui64;=0D - UINTN VOLATILE ui;=0D -} PTR;=0D -=0D -// This address is assuming a pure PC architecture. Not required?=0D -#define VIRT_TO_PHYS_OFFSET (0x80000000) //2G=0D -=0D -=0D -=0D -#endif=0D diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackB= oxTest/Riscv64/DebugSupportBBTestExceptionCallbackFunction.c b/uefi-sct/Sct= Pkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Riscv64/DebugSuppo= rtBBTestExceptionCallbackFunction.c index c27c0c0c..c6e72806 100644 --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/= Riscv64/DebugSupportBBTestExceptionCallbackFunction.c +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/= Riscv64/DebugSupportBBTestExceptionCallbackFunction.c @@ -2,6 +2,7 @@ =0D Copyright 2006 - 2016 Unified EFI, Inc.
=0D Copyright (c) 2011 - 2016, ARM Ltd. All rights reserved.
=0D + Copyright (c) 2021, Hewlett Packard Enterprise Development LP. All right= s reserved.
=0D =0D This program and the accompanying materials=0D are licensed and made available under the terms and conditions of the BS= D License=0D @@ -37,7 +38,7 @@ SoftwareBreak ( void=0D )=0D {=0D - // Not ported to ARM yet=0D + // Not ported to RISC-V yet=0D ASSERT (FALSE);=0D }=0D =0D @@ -99,9 +100,7 @@ BBTestRegisterExceptionCallbackFunctionManualTest ( // Invoke RegisterExceptionCallback() to install an interrupt handler fu= nction.=0D //=0D InvokedExceptionCallback =3D FALSE;=0D - // FIXME: Is it normal that we use EXCEPT_IA32_BREAKPOINT here?=0D - // Shouldn't we define proper constants for ARM exceptions in DebugSuppo= rtProtocol.h file?=0D - Status =3D DebugSupport->RegisterExceptionCallback (DebugSupport, 0, Exc= eptionCallback, EXCEPT_IA32_BREAKPOINT);=0D + Status =3D DebugSupport->RegisterExceptionCallback (DebugSupport, 0, Exc= eptionCallback, EXCEPT_RISCV_BREAKPOINT);=0D =0D if ((Status =3D=3D EFI_SUCCESS) || (Status =3D=3D EFI_ALREADY_STARTED)) = {=0D AssertionType =3D EFI_TEST_ASSERTION_PASSED;=0D @@ -205,7 +204,7 @@ BBTestRegisterExceptionCallbackFunctionManualTest ( // Assertion Point 3.4.2.3=0D // Invoke RegisterExceptionCallback() to install another interrupt handl= er function.=0D //=0D - Status =3D DebugSupport->RegisterExceptionCallback (DebugSupport, 0, Exc= eptionCallback1, EXCEPT_IA32_BREAKPOINT);=0D + Status =3D DebugSupport->RegisterExceptionCallback (DebugSupport, 0, Exc= eptionCallback1, EXCEPT_RISCV_BREAKPOINT);=0D =0D if (Status !=3D EFI_ALREADY_STARTED) {=0D AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D @@ -228,7 +227,7 @@ BBTestRegisterExceptionCallbackFunctionManualTest ( // Assertion Point 3.4.2.4=0D // Invoke RegisterExceptionCallback() to unstall the interrupt handler f= unction.=0D //=0D - Status =3D DebugSupport->RegisterExceptionCallback (DebugSupport, 0, NUL= L, EXCEPT_IA32_BREAKPOINT);=0D + Status =3D DebugSupport->RegisterExceptionCallback (DebugSupport, 0, NUL= L, EXCEPT_RISCV_BREAKPOINT);=0D =0D if (EFI_ERROR(Status)) {=0D AssertionType =3D EFI_TEST_ASSERTION_FAILED;=0D @@ -273,4 +272,3 @@ BBTestRegisterExceptionCallbackFunctionManualTest ( =0D return EFI_SUCCESS;=0D }=0D -=0D diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackB= oxTest/Riscv64/PlatformIsa.c b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/D= ebugSupport/BlackBoxTest/Riscv64/PlatformIsa.c index 8334f601..8b23d91b 100644 --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/= Riscv64/PlatformIsa.c +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/= Riscv64/PlatformIsa.c @@ -2,6 +2,7 @@ =0D Copyright 2006 - 2012 Unified EFI, Inc.
=0D Copyright (c) 2011 - 2012, ARM Ltd. All rights reserved.
=0D + Copyright (c) 2021, Hewlett Packard Enterprise Development LP. All right= s reserved.
=0D =0D This program and the accompanying materials=0D are licensed and made available under the terms and conditions of the BS= D License=0D @@ -26,5 +27,4 @@ Abstract: =0D #include "DebugSupportBBTestMain.h"=0D =0D -EFI_INSTRUCTION_SET_ARCHITECTURE PlatformIsa =3D IsaAArch64;=0D -=0D +EFI_INSTRUCTION_SET_ARCHITECTURE PlatformIsa =3D IsaRiscv64;=0D diff --git a/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/R= iscv64/EntsLibPlat.h b/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENT= S/EasLib/Riscv64/EntsLibPlat.h index ff781aee..144f812a 100644 --- a/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Riscv64/= EntsLibPlat.h +++ b/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/Riscv64/= EntsLibPlat.h @@ -2,6 +2,7 @@ =0D Copyright 2006 - 2012 Unified EFI, Inc.
=0D Copyright (c) 2010 - 2012, ARM Ltd. All rights reserved.
=0D + Copyright (c) 2021 Hewlett Packard Enterprise Development LP. All rights= reserved.
=0D =0D This program and the accompanying materials=0D are licensed and made available under the terms and conditions of the BS= D License=0D @@ -20,7 +21,7 @@ Module Name: =0D Abstract:=0D =0D - AArch64 specific defines=0D + RISCV64 specific defines=0D =0D --*/=0D =0D --=20 2.30.0