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.web12.12200.1612885466965344570 for ; Tue, 09 Feb 2021 07:44:27 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@hpe.com header.s=pps0720 header.b=HIJcUuw+; spf=pass (domain: hpe.com, ip: 148.163.147.86, mailfrom: prvs=0674d93a3b=daniel.schaefer@hpe.com) Received: from pps.filterd (m0134420.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 119FdIK2032708; Tue, 9 Feb 2021 15:44:19 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=6OlcG+U99k6cTKErFqHZOJ9nRiTzGuLpNTXqOILUtiQ=; b=HIJcUuw+TM9JKGYO69hHnbwBI+mYnuZZMhyX7sybitql4dG41gCnXnpM5XzrunsCIdJL kR6Xl73TvUnS0VxpLzi7xvc6Hx/1z/WNeBkerm9IWxlkTXSwb/N0BPgFxvnxKHf2H9CD aWeYRPI5MDdXeieWDmXJkDJ6zcnDXJ+gaW7gwMxWt3m+40UV9yGyRrN2cEtIiAlQ3gP9 oEmdKFiqZSzCk5WlfGmsv26V+Wsy93jvWyUQKi5f7Fii6dSxxMig9IVqNNAQYQyAU+1N qPUgLBQfbt1n44Jeds8KRa+U3fy2t7GRIe7RnbPw13s94ozHQ22LlM6RPQuOYQji4kwS HA== Received: from g4t3426.houston.hpe.com (g4t3426.houston.hpe.com [15.241.140.75]) by mx0b-002e3701.pphosted.com with ESMTP id 36k6wt2hx5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 09 Feb 2021 15:44:19 +0000 Received: from G1W8107.americas.hpqcorp.net (g1w8107.austin.hp.com [16.193.72.59]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by g4t3426.houston.hpe.com (Postfix) with ESMTPS id 9878459; Tue, 9 Feb 2021 15:44:18 +0000 (UTC) Received: from G4W9120.americas.hpqcorp.net (2002:10d2:150f::10d2:150f) by G1W8107.americas.hpqcorp.net (2002:10c1:483b::10c1:483b) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 9 Feb 2021 15:44:18 +0000 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (15.241.52.13) by G4W9120.americas.hpqcorp.net (16.210.21.15) with Microsoft SMTP Server (TLS) id 15.0.1497.2 via Frontend Transport; Tue, 9 Feb 2021 15:44:18 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fVS0V7hta1QGHAlV6mMpm8g+C3WqcXE9qUz83B0yqPBpFy1ld/9oZtWZLJqLT0o6NSf3n48QZGtzqZDoQ0lxvlIZE8KKFSbnEJ2NfCkSWNooQKp/Jlc7JYre4iVM6b+8EqTWJButpeGabiYVY7hUnt6TV8SG9yoMpIElx5bl8Gsyya5QSiZaMQcHuygoU3XHxGbbaEaoZl22B93fOErIg84/EYY/h9QSvCgIEJZQpMXI7hE+S1RgLFhlAtJVRC8bAMLzM15pifdSqC2gJ5jjLP35fZ5Kl+4gKuKH55rHbFOo9nhbNqycK/SIni6gqT2CVQUKCjfcAP0DItabQ6wg4Q== 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=6OlcG+U99k6cTKErFqHZOJ9nRiTzGuLpNTXqOILUtiQ=; b=NLUJKGsEQETJIgypYKgSiaTC1TMvflYhhtDwxMvbd7PAU4gb/aAKspg6R60MmiJjpUvG2NmWchz7S8VOAvkDNAIhNWygp6ju+aJfz6xgkltTfF3Zpj38uvDjS7kBFHQwzPjWPDp+/0kwCsRDkKOixnvHGcpywCo8+DRIZeHHjCzUrE94C70yngvEnm6pqTSRyVYD1QxNYo5C3WQ1AT2Rnw7gwCvjOEPJmhHmR8srRDzFIhPnO/5FjBxhacsHSA8NR7KodrMIaa8WehR+ziBc18e6dQ2ZzmdwCd0FUP377mgMg2d3mpPowYpk3210a8zUFxwixHTOpH5hsiTYhPvQiQ== 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 DF4PR8401MB0508.NAMPRD84.PROD.OUTLOOK.COM (2a01:111:e400:760b::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3825.20; Tue, 9 Feb 2021 15:44:16 +0000 Received: from DF4PR8401MB0444.NAMPRD84.PROD.OUTLOOK.COM ([fe80::45f0:20e7:1e33:e2a0]) by DF4PR8401MB0444.NAMPRD84.PROD.OUTLOOK.COM ([fe80::45f0:20e7:1e33:e2a0%9]) with mapi id 15.20.3825.030; Tue, 9 Feb 2021 15:44:16 +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 PATCHv2 2/5] SctPkg: Adapt Aarch64 sources for Riscv64 Date: Tue, 9 Feb 2021 23:43:51 +0800 Message-ID: <20210209154354.30234-3-daniel.schaefer@hpe.com> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210209154354.30234-1-daniel.schaefer@hpe.com> References: <20210209154354.30234-1-daniel.schaefer@hpe.com> X-Originating-IP: [123.193.51.23] X-ClientProxiedBy: HK0PR03CA0116.apcprd03.prod.outlook.com (2603:1096:203:b0::32) To DF4PR8401MB0444.NAMPRD84.PROD.OUTLOOK.COM (2a01:111:e400:760d::23) X-MS-Exchange-MessageSentRepresentingType: 1 Received: from x360-nix.hitronhub.home (123.193.51.23) by HK0PR03CA0116.apcprd03.prod.outlook.com (2603:1096:203:b0::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3825.23 via Frontend Transport; Tue, 9 Feb 2021 15:44:14 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 51ea6aad-fa9a-4a33-539c-08d8cd118e9c X-MS-TrafficTypeDiagnostic: DF4PR8401MB0508: 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: JP+yd77Z4LBOlcqpTw8XblledNgFnCCvwVbXQH9NQI+kjdpJg29W2s7R6FwXVle1Xamyys5xxLE0bal6PjYgGws6THu9LRJXQm+iOH7bevzwpCPCrud6qibCvFVQWE9YuxwaLmwmTKpcM1sn43sTxUpljCHVgmtVbcR9qAL2Nbwk+jCkS8ti1799b7Qv3xB5Me/5OKntG4qBiNft7mt6KbonVHq3+3QCTew3l0i23fCuo11h3xZj4TIrJT7Nzih04MKlCGOx/tzS+ZwUniC0w9AfU+B2S77HmxlGbfkoNZy3K4NCPqL04gPYtC1gKVNyWtf2gFfKCIUu/2O+I9slwQgz+bd64fNCwmSTKEaL76PUVKUhk0CK9bclwcvIDbaFyirqsakT/gy1PB0VC+OyAJ5Vo+czHagv3ng4OkakOBON6rvfPD1c0HqPqfcUWBXp/uhM4/rt5gUcZLDwc/7U210KRFQ8BFXG+/dj8B1PIuUiQwIPz0wAcUUXDEsROVCpdx0Nmaq3BcSNmC9Mx9noPYmTfznxBQqh+UzbZT9gCynpMVfTdMuWfxtlzCt4/+ppZI2beOc6PGkNVdoPGvOfgHFYsfnsT2f8Hi0OMsAr0ks= 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:(396003)(136003)(366004)(346002)(376002)(39860400002)(6512007)(1076003)(66556008)(26005)(6506007)(66946007)(8936002)(30864003)(86362001)(16526019)(2906002)(4326008)(966005)(15188155005)(5660300002)(66476007)(8676002)(19627235002)(478600001)(6666004)(6916009)(44832011)(6486002)(186003)(16799955002)(2616005)(316002)(54906003)(52116002)(956004)(36756003)(83380400001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?kacvWCfbbWBpXtEVw66f/M+WFtBG7PkEW41W+u4gi/5p4XEdxI0N7uJQWUz/?= =?us-ascii?Q?pR93cmJ8dFOldeebH1xgKB9TbVOmaldJb23G17e3LudSZ1HZshD6MwsLYfIx?= =?us-ascii?Q?sqpnlZBWCcKJNY8+HjuP+ai5zhf8530m7l3RouFcY66pS7CUoeA9gm+HRFdF?= =?us-ascii?Q?e3NzWMdmWWXehHnWQuYSMzHMzE8hY+9uuvgFlzgHUsz0KmKjdAW4sL6S31bc?= =?us-ascii?Q?Z9Z1cLR0cR0JslL7v6vTSx/kCjAT4ShHzPsoK4Dj2JD97BqEMVS3TD8u/bws?= =?us-ascii?Q?8EgIPXQ0lc35+/sn5gVQmFF96g3mEKAOKl1epMcW2xuJ71GT4MdMNR0wfsjJ?= =?us-ascii?Q?FKCqTgfOq4VsSr3Ir3iGVAlP7iAx7e9rQMz5QJ5EWmBNNIfk+tKEI6O2Wl9M?= =?us-ascii?Q?4QdMHSOfIlaV7e8q/DLZDK7IdEdbOM6HuWRnh/qCHXIblDMMnPY7wVLlSwTi?= =?us-ascii?Q?MJJOJd5JCtQtSm0SY85nGa8BfFZGuMTO4Nu+T/HwBu+vhkLHWcLHrjMo1SXQ?= =?us-ascii?Q?ayevBYkNWDZlREUZSRhHb4BI/ILHYeCwv0yWjjZmupWARpDf99NTi4vKh5Ui?= =?us-ascii?Q?ODhES/QG3tPm8skgzca6eHFOHneJBQiJznva1ybIXbdDRu9rQYjco164RH1i?= =?us-ascii?Q?O+7xJu6LEJ2u1zqTCgWIcL0QNRBtwj1wmJgdD6HG7NEQWwkm2VfEBtoyCS5u?= =?us-ascii?Q?u05rHRTgtJ5TgTQ4kOzWpnXVGP7BYCXpPPZtK7Dcq1h3Fth8BOUVeDOs4/0I?= =?us-ascii?Q?at0eGZYG2VizXUDMOd5RKm2gxqCs5/kLD/EpTqesdrJyYJ9HS4hrBOaXwxBy?= =?us-ascii?Q?0miqa3C8887UFoWfbMVplx2tsXi7lZpOL64Yy4plrFq5fqzpoxfd92nYg6LQ?= =?us-ascii?Q?vMrqhOPbYgdGXI+ZEsd2PJjNUI0WpV50fkKle8CGb8QNN5KAtEn3ViGYU3aC?= =?us-ascii?Q?vjIFWcF+lhLCGJcNh9fa4FFB8wHm1k2iGBuiqEEj8S6tbjSqKgNZ7pn72Gt9?= =?us-ascii?Q?TiTPyOqWYzwdqrNDdiWn2pkrSSnE1KcfwL6/nt8AjjGKkWDk5AYSy9+i5jUz?= =?us-ascii?Q?TbSFb6AVAABTqmgDs5Sfb46sxr4r46BTfNlPsVJgIBsxAKBbgzlMKFVaUHIv?= =?us-ascii?Q?MbXHti2lOXOvk/lavCHih7eBAehpGFFDa17M9JY9m4wqjasaERkH0GhwTy7g?= =?us-ascii?Q?QHAZ4lh8kC0Ag7OAxRREd97scR7Sx+icVSoN15fZxELDtwx6YzPMnInuUwzY?= =?us-ascii?Q?0PfTXuLZF+Y422XPOct0vN33LK/9DYSUfcs76B9eLB5tYGgLpCK26j+oces7?= =?us-ascii?Q?WVUq05eSILtFW8X78d3lJwVW?= X-MS-Exchange-CrossTenant-Network-Message-Id: 51ea6aad-fa9a-4a33-539c-08d8cd118e9c X-MS-Exchange-CrossTenant-AuthSource: DF4PR8401MB0444.NAMPRD84.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Feb 2021 15:44:16.7601 (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: CCXqyiaiSzuVZT2R3RuVBe8GeIJNtLD15iIflFJucLUgM7v8LpwmPb3Ibtd0dxum5jc3hg40qDV3/EneGAQxdg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DF4PR8401MB0508 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.737 definitions=2021-02-09_03:2021-02-09,2021-02-09 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 malwarescore=0 priorityscore=1501 impostorscore=0 phishscore=0 lowpriorityscore=0 mlxlogscore=999 mlxscore=0 suspectscore=0 spamscore=0 clxscore=1015 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2102090081 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 | 2 +- 9 files changed, 31 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..7f7835e4 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 @@ -20,7 +20,7 @@ Module Name: =0D Abstract:=0D =0D - AArch64 specific defines=0D + RISCV64 specific defines=0D =0D --*/=0D =0D --=20 2.30.0