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.12674.1606839506881244644 for ; Tue, 01 Dec 2020 08:18:27 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@hpe.com header.s=pps0720 header.b=nAin8bDu; spf=pass (domain: hpe.com, ip: 148.163.147.86, mailfrom: prvs=060493cc9a=daniel.schaefer@hpe.com) Received: from pps.filterd (m0134422.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0B1G78WU007165; Tue, 1 Dec 2020 16:18:16 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=8NoLEuaAC1SDE5Xr4OmpabKgx4dMn2Qcs49Z34t/tHo=; b=nAin8bDuubxqYvJ+Rmwye1jhXrbNA/YUKOMTbRwOe/hrBVNRkF7YUP5ekyfr2VMl5yq9 E+fldeK7pSWWz4F4vUk7jew3BI/zoeEPJl6WinJHkg/l0LPmgvvGVOU9G5MtQ1fDQZQ8 bwArEVoC9fgjRvYDhSqHxDf0tYg6W9tq/fxSin/xKKH9LpppZGE5ddmQn4EESkzBwlRr 3DgS/XtRY96gA0fSYEKGJoMqvBsNrupv7zTGriTMuH44u+OwZMDQV9VmmnOIU82ILLUd zA+6q3tLaO5lz/rUMXQ8JaA/sVgg6I5anD/LV/afQifB2NE+P/1PU7G82OjLXuiLyELo ug== Received: from g2t2352.austin.hpe.com (g2t2352.austin.hpe.com [15.233.44.25]) by mx0b-002e3701.pphosted.com with ESMTP id 354096ku54-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 01 Dec 2020 16:18:16 +0000 Received: from G9W8454.americas.hpqcorp.net (g9w8454.houston.hp.com [16.216.161.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by g2t2352.austin.hpe.com (Postfix) with ESMTPS id 9FDD563; Tue, 1 Dec 2020 16:18:15 +0000 (UTC) Received: from G9W8454.americas.hpqcorp.net (2002:10d8:a104::10d8:a104) by G9W8454.americas.hpqcorp.net (2002:10d8:a104::10d8:a104) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 1 Dec 2020 16:18:15 +0000 Received: from NAM04-BN3-obe.outbound.protection.outlook.com (15.241.52.10) by G9W8454.americas.hpqcorp.net (16.216.161.4) with Microsoft SMTP Server (TLS) id 15.0.1497.2 via Frontend Transport; Tue, 1 Dec 2020 16:18:15 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dP2OPSTv/Nx+dlyZRF4biv4mBLcfh4wS0uBdSlD3tNQEf2FyH+vGnwBD9IJIkPXl97CGLnUdjvRBniRG3+2zdpwIioEhIiXHMwJFDJEcpx5/7iOOSQ+Xj+1pDEK7bXkhPxsJbb2vt6bBbrI47mc8GbvqN3ir6EEYDrMh5VQPrwx9PnPOQ9q/AMevMQSmAm1cIFqidzGvzUj2iD5KApecvs4xJQtGrHZ1A6KDcQQqZYov7s6HnpqDjdlvbtekQWHdySbaWenX5e6z8s7EebDZLFU9dOpoU6hlO3BTIAdHmSduLUUDCATa4SG8RIJ+qQp0Tm5N14Li3px2f4icrW/65w== 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=8NoLEuaAC1SDE5Xr4OmpabKgx4dMn2Qcs49Z34t/tHo=; b=JyxAu7np7ENapQsEqwAgR/sXbH0eeXXxrfi9wqqd8hiAlPKTe7DY4ZOj9TFyBm1/d+onyVeHV5Gb54jBOQL6/CHKGtoCMFVtVO8eajYSUHn65aEsygyeJ0m+vh+AF5e7PwBOZxLVIjK3degsx3jxogJCVPRGF21H+Er8JHV6lDCyE5fznhCOSTI7XdGlKCU4H2A6NaX8YZwbhfovbkfdwjhPAHNi9gp46GsnMT42FGmK1+lZrbZiSRIEwOEsGB1etbW3HJ2/WtvlZsSynPei1+KZJONmF9xAxzD67sBgcuY912vQFNUS9DG27SxD/rIYLq9wR447NRWsA2HH+xdv6w== 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 DF4PR8401MB1004.NAMPRD84.PROD.OUTLOOK.COM (2a01:111:e400:760f::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3632.17; Tue, 1 Dec 2020 16:18:14 +0000 Received: from DF4PR8401MB0444.NAMPRD84.PROD.OUTLOOK.COM ([fe80::691c:7962:6e56:c91f]) by DF4PR8401MB0444.NAMPRD84.PROD.OUTLOOK.COM ([fe80::691c:7962:6e56:c91f%8]) with mapi id 15.20.3611.025; Tue, 1 Dec 2020 16:18:13 +0000 From: "Daniel Schaefer" To: CC: Leif Lindholm , Heinrich Schuchardt , Abner Chang , Gilbert Chen , Eric Jin , G Edhaya Chandran , Barton Gao , Samer El-Haj-Mahmoud Subject: [edk2-test PATCH v1 1/2] SctPkg: Add RISCV64 support Date: Wed, 2 Dec 2020 00:17:51 +0800 Message-ID: <20201201161752.23734-2-daniel.schaefer@hpe.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201201161752.23734-1-daniel.schaefer@hpe.com> References: <20201201161752.23734-1-daniel.schaefer@hpe.com> X-Originating-IP: [123.193.51.23] X-ClientProxiedBy: HK2PR02CA0161.apcprd02.prod.outlook.com (2603:1096:201:1f::21) 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 HK2PR02CA0161.apcprd02.prod.outlook.com (2603:1096:201:1f::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3611.20 via Frontend Transport; Tue, 1 Dec 2020 16:18:10 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 160bacb3-8326-43c3-33b0-08d89614b3fb X-MS-TrafficTypeDiagnostic: DF4PR8401MB1004: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6108; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 72JJ0ARRgKa2VnYEcgm9/br0KOwGRzbZ3if4RevXt4UwvXhIVtyGpIGL8qQntQu+0zBfRA8ZK5gQdcPuUVSXLK1s+pMrOlk9Cic/TatXreU7DUSXEx132Rmp/lXPU5P+nxUD3uyXBGP9M7mQFWHgnLLry9GbJ5inH4fCVnkl+ZldpXcY//CoF4R9zdYm+LPoTuuDuuSGB3/NlC9iSjsYWn4mWSITxQNOJP2zSDMTQtBvP+UizaSWjgiqeWtGjYIhD+eAJKGlCLUQ8Cx4S+7G6zPYPiHOX6jiquXRvoPAfyEfUfXvs9bFcYovaP+aFHdgMg42u8MNsFQci1pKAgOf43qM159LC2rsPBPmqFjKHC9UJbBcH7ipsVmXcxpp1yjoC04t8djTrOAEBiFvGu1TQg== 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)(39860400002)(376002)(396003)(2906002)(16526019)(1076003)(30864003)(54906003)(6486002)(8676002)(478600001)(52116002)(4326008)(36756003)(83380400001)(186003)(8936002)(956004)(2616005)(66946007)(66476007)(316002)(66556008)(6512007)(44832011)(6506007)(5660300002)(6666004)(86362001)(26005)(19627235002)(6916009);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?jZ2DZr3PWT6vjMLMO/RWzHW/h4h+XJ1gI4olq9XJvBN7EeOaQ7Mok2pBW10U?= =?us-ascii?Q?qoObD+LbQ6oS+UIyNp8F15H3g7spt/IcRLhYPttu6IDX6YnXgc+K4sPF8/cy?= =?us-ascii?Q?s+zvGsrOBmO1si96R/+I8oedkD2a2qch0+fDUAl4uYl9gHq5WvfB5rQijbGb?= =?us-ascii?Q?SU4VmvV/8/H4pqGgvTKeF4fcxf8sQHzauNAcLypYCuDO/MnYUpV/KX5t88uL?= =?us-ascii?Q?5xAOvpbTHX4Clxvadg7IFI0AKixuJBitqg3ZoRu6BBiqcKy/PGYQXxz/Sig6?= =?us-ascii?Q?mC5a6V0NKmccViuTxcLTTjEFq2WY2YK47YXXMJ+z2nwgWLLDuJGrnEcJc97n?= =?us-ascii?Q?eQ9i39FuS7xO6USI/AtUwb33nMSjg5pbf/dBKPflkHE7YP09g+M4RevVXIgu?= =?us-ascii?Q?fw9btu/ZI82LgFswAXG43ETbEqmZnbMw43FPsJ1eqC0oDf45LJ2IIukAtw2T?= =?us-ascii?Q?Z6TC/DEkejtbPNEWZGcjmjKBiPAJf40uwjnELeqQRrfQ34HfEmKFyvYElF6w?= =?us-ascii?Q?SD5rzqUXlBfE5ofv3/+6R3O1+pn/+6VMSt57x6ju6yNO/1mhSt0gtDQYXKeQ?= =?us-ascii?Q?EGCH/zR5/HU3kxFTV8ZNcTf5xMcthoDS53UU4Er8oC5jREQd5PEomATCMNda?= =?us-ascii?Q?cbXBUXk/aJNye7T3kzj8itARe139Caa+KC9rMD4Yaz05T1tkWsv83GPf0/QN?= =?us-ascii?Q?j92sZUtYZ0g3rPaAA5aYOv/ULFF2ISjpTjBh2AxpYY04lpLxqMsjjk1SxoAy?= =?us-ascii?Q?c4rz0LH2XcIidwEI4ug+NAk7tDQf8mWnHryRGvxetzlbJijVrVa5AzMo8PTu?= =?us-ascii?Q?kecZvMRF96w3DEI2KFxIpfEgIUmZ/Dlv76RxjzxQuuTy82S0jrKhi/uRv7f1?= =?us-ascii?Q?XWic2zexlimAOF1Ek6/VWzqslkOPWJfJXmV9D7boxfrcZ+0oQiwD+LvBduKJ?= =?us-ascii?Q?Tks+ZNHxdVNWCKEVMhpMOj5Tv+MBxKqGNER5KlCYnufAAKu1jIu+50Q3XzzR?= =?us-ascii?Q?hwP6?= X-MS-Exchange-CrossTenant-Network-Message-Id: 160bacb3-8326-43c3-33b0-08d89614b3fb X-MS-Exchange-CrossTenant-AuthSource: DF4PR8401MB0444.NAMPRD84.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Dec 2020 16:18:13.8051 (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: l6Pf49BiZ7LnNTQDJbuzZbCyBIszoqBACJTIauOJHbd3GT6OUKawLVWjbCAapeRysvuvZ9mxQ1m/aYnHM0jr5w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DF4PR8401MB1004 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.312,18.0.737 definitions=2020-12-01_07:2020-11-30,2020-12-01 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 adultscore=0 mlxlogscore=999 impostorscore=0 suspectscore=1 bulkscore=0 phishscore=0 priorityscore=1501 mlxscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2012010101 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D3042 TODO: Need to check whether we can avoid copying Aarch64 sources. Cc: Leif Lindholm Cc: Heinrich Schuchardt Cc: Abner Chang Cc: Gilbert Chen Cc: Eric Jin Cc: G Edhaya Chandran Cc: Barton Gao Cc: Samer El-Haj-Mahmoud Signed-off-by: Daniel Schaefer --- uefi-sct/SctPkg/Application/InstallSct/InstallSctDef.h = | 3 + uefi-sct/SctPkg/Library/SctLib/SctLib.inf = | 6 ++ uefi-sct/SctPkg/SCRT/SCRTApp/SCRTApp.inf = | 6 ++ uefi-sct/SctPkg/SCRT/SCRTDriver/SCRTDriver.inf = | 7 +++ uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Debug= SupportBBTest.inf | 6 ++ uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/Usb2Hc/BlackBoxTest/Usb2HcTest.= inf | 4 ++ uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/UsbHc/BlackBoxTest/UsbHcTest.in= f | 4 ++ uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/EntsLib.inf = | 5 ++ uefi-sct/SctPkg/Tools/Source/GenBin/GNUmakefile = | 3 + uefi-sct/SctPkg/UEFI/IHV_SCT.dsc = | 14 ++++- uefi-sct/SctPkg/UEFI/Protocol/DebugSupport.h = | 62 +++++++++++++++++++- uefi-sct/SctPkg/UEFI/UEFI_SCT.dsc = | 14 ++++- uefi-sct/SctPkg/build.sh = | 10 +++- 13 files changed, 140 insertions(+), 4 deletions(-) diff --git a/uefi-sct/SctPkg/Application/InstallSct/InstallSctDef.h b/uefi-= sct/SctPkg/Application/InstallSct/InstallSctDef.h index a7815580..3a7c8f31 100644 --- a/uefi-sct/SctPkg/Application/InstallSct/InstallSctDef.h +++ b/uefi-sct/SctPkg/Application/InstallSct/InstallSctDef.h @@ -32,6 +32,9 @@ #elif defined(EFIAARCH64)=0D #define INSTALL_SCT_PLATFORM_SHORT_NAME L"aarch64"=0D #define INSTALL_SCT_PLATFORM_NAME L"AARCH64"=0D +#elif defined(EFIRISCV64)=0D + #define INSTALL_SCT_PLATFORM_SHORT_NAME L"riscv64"=0D + #define INSTALL_SCT_PLATFORM_NAME L"RISCV64"=0D #else=0D #error "Architecture not supported"=0D #endif=0D diff --git a/uefi-sct/SctPkg/Library/SctLib/SctLib.inf b/uefi-sct/SctPkg/Li= brary/SctLib/SctLib.inf index 23cb77fb..6f59d974 100644 --- a/uefi-sct/SctPkg/Library/SctLib/SctLib.inf +++ b/uefi-sct/SctPkg/Library/SctLib/SctLib.inf @@ -62,6 +62,12 @@ Aarch64/initplat.c=0D Math.c=0D =0D +# TODO: Copied source from AARCH64, need to check if they need to be adjus= ted=0D +[sources.RISCV64]=0D + Riscv64/SctLibPlat.h=0D + Riscv64/initplat.c=0D + Math.c=0D +=0D [sources.ia32]=0D ia32/SctLibPlat.h=0D ia32/initplat.c=0D diff --git a/uefi-sct/SctPkg/SCRT/SCRTApp/SCRTApp.inf b/uefi-sct/SctPkg/SCR= T/SCRTApp/SCRTApp.inf index 7aca6e30..66de4cac 100644 --- a/uefi-sct/SctPkg/SCRT/SCRTApp/SCRTApp.inf +++ b/uefi-sct/SctPkg/SCRT/SCRTApp/SCRTApp.inf @@ -39,6 +39,12 @@ Aarch64/GoVirtual.asm | RVCT=0D Aarch64/GoVirtual.S | GCC=0D =0D +# TODO: Copied source from AARCH64, need to check if they need to be adjus= ted=0D +# ASM is adjusted but not sure if it is correct=0D +[sources.RISCV64]=0D + Riscv64/VirtualMemory.c=0D + Riscv64/GoVirtual.S | GCC=0D +=0D [sources.ia32]=0D ia32/VirtualMemory.c=0D ia32/GoVirtual.asm | MSFT=0D diff --git a/uefi-sct/SctPkg/SCRT/SCRTDriver/SCRTDriver.inf b/uefi-sct/SctP= kg/SCRT/SCRTDriver/SCRTDriver.inf index ad0eb0f8..bc0ade5b 100644 --- a/uefi-sct/SctPkg/SCRT/SCRTDriver/SCRTDriver.inf +++ b/uefi-sct/SctPkg/SCRT/SCRTDriver/SCRTDriver.inf @@ -69,6 +69,13 @@ Aarch64/Dump.c=0D Aarch64/Debug.c=0D =0D +# TODO: Copied source from AARCH64, need to check if they need to be adjus= ted=0D +[sources.RISCV64]=0D + Riscv64/Io.c=0D + Riscv64/Io.h=0D + Riscv64/Dump.c=0D + Riscv64/Debug.c=0D +=0D [sources.common]=0D Guid.h=0D Guid.c=0D diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackB= oxTest/DebugSupportBBTest.inf b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/= DebugSupport/BlackBoxTest/DebugSupportBBTest.inf index 799f86fd..7010c7f1 100644 --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/= DebugSupportBBTest.inf +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/= DebugSupportBBTest.inf @@ -67,6 +67,12 @@ Aarch64/DebugSupportBBTestExceptionCallbackFunction.c=0D Aarch64/DebugSupportBBTestCacheFunction.c=0D =0D +# TODO: Copied source from AARCH64, need to check if they need to be adjus= ted=0D +[sources.RISCV64]=0D + Riscv64/PlatformIsa.c=0D + Riscv64/DebugSupportBBTestExceptionCallbackFunction.c=0D + Riscv64/DebugSupportBBTestCacheFunction.c=0D +=0D [Packages]=0D SctPkg/SctPkg.dec=0D SctPkg/UEFI/UEFI.dec=0D diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/Usb2Hc/BlackBoxTest= /Usb2HcTest.inf b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/Usb2Hc/BlackBo= xTest/Usb2HcTest.inf index e8118739..e42acd29 100644 --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/Usb2Hc/BlackBoxTest/Usb2Hc= Test.inf +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/Usb2Hc/BlackBoxTest/Usb2Hc= Test.inf @@ -55,6 +55,10 @@ #[sources.Aarch64]=0D # IPF/TimerInterrupt.c=0D =0D +# TODO: Seems like almost all archs can use the IPF code, need to check +[sources.Riscv64]=0D + IPF/TimerInterrupt.c=0D +=0D [Packages]=0D MdePkg/MdePkg.dec=0D SctPkg/SctPkg.dec=0D diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/UsbHc/BlackBoxTest/= UsbHcTest.inf b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/UsbHc/BlackBoxTe= st/UsbHcTest.inf index efc438c1..0d47536f 100644 --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/UsbHc/BlackBoxTest/UsbHcTe= st.inf +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/UsbHc/BlackBoxTest/UsbHcTe= st.inf @@ -55,6 +55,10 @@ [sources.Aarch64]=0D Aarch64/TimerInterrupt.c=0D =0D +# TODO: Copied source from AARCH64, need to check if they need to be adjus= ted +[sources.RISCV64]=0D + Riscv64/TimerInterrupt.c=0D +=0D [Packages]=0D MdePkg/MdePkg.dec=0D SctPkg/SctPkg.dec=0D diff --git a/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/E= ntsLib.inf b/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/E= ntsLib.inf index 23f12d1a..1b2a92f2 100644 --- a/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/EntsLib.= inf +++ b/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/EntsLib.= inf @@ -66,6 +66,11 @@ Aarch64/EntsLibPlat.h=0D Aarch64/InitPlat.c=0D =0D +# TODO: Copied source from AARCH64, need to check if they need to be adjus= ted=0D +[sources.RISCV64]=0D + Riscv64/EntsLibPlat.h=0D + Riscv64/InitPlat.c=0D +=0D [Packages]=0D MdePkg/MdePkg.dec=0D SctPkg/SctPkg.dec=0D diff --git a/uefi-sct/SctPkg/Tools/Source/GenBin/GNUmakefile b/uefi-sct/Sct= Pkg/Tools/Source/GenBin/GNUmakefile index c235f313..e49284e7 100644 --- a/uefi-sct/SctPkg/Tools/Source/GenBin/GNUmakefile +++ b/uefi-sct/SctPkg/Tools/Source/GenBin/GNUmakefile @@ -31,6 +31,9 @@ ifndef ARCH ifneq (,$(findstring arm,$(uname_m)))=0D ARCH=3DARM=0D endif=0D + ifneq (,$(findstring riscv64,$(uname_m)))=0D + ARCH=3DRISCV64=0D + endif=0D ifndef ARCH=0D $(info Could not detected ARCH from uname results)=0D $(error ARCH is not defined!)=0D diff --git a/uefi-sct/SctPkg/UEFI/IHV_SCT.dsc b/uefi-sct/SctPkg/UEFI/IHV_SC= T.dsc index f9e86264..2f373c5f 100644 --- a/uefi-sct/SctPkg/UEFI/IHV_SCT.dsc +++ b/uefi-sct/SctPkg/UEFI/IHV_SCT.dsc @@ -42,7 +42,7 @@ PLATFORM_VERSION =3D 0.1=0D DSC_SPECIFICATION =3D 0x00010005=0D OUTPUT_DIRECTORY =3D Build/IhvSct=0D - SUPPORTED_ARCHITECTURES =3D IA32|X64|ARM|AARCH64=0D + SUPPORTED_ARCHITECTURES =3D IA32|X64|ARM|AARCH64|RISCV64=0D BUILD_TARGETS =3D DEBUG|RELEASE=0D SKUID_IDENTIFIER =3D DEFAULT=0D =0D @@ -109,6 +109,12 @@ *_*_AARCH64_PP_FLAGS =3D -D EFIAARCH64 $(GCC_VER_MACRO)=0D RVCT:*_*_AARCH64_DLINK_FLAGS =3D --muldefweak=0D =0D + *_*_RISCV64_CC_FLAGS =3D -D EFIRISCV64 $(GCC_VER_MACRO)=0D + GCC:*_*_RISCV64_CC_FLAGS =3D -D EFIRISCV64 $(GCC_VER_MACRO) -ffreestand= ing -nostdinc -nostdlib -Wno-error=3Dunused-function -Wno-error=3Dunused-bu= t-set-variable -Wno-error=0D + *_*_RISCV64_VFRPP_FLAGS =3D -D EFIRISCV64 $(GCC_VER_MACRO)=0D + *_*_RISCV64_APP_FLAGS =3D -D EFIRISCV64 $(GCC_VER_MACRO)=0D + *_*_RISCV64_PP_FLAGS =3D -D EFIRISCV64 $(GCC_VER_MACRO)=0D +=0D DEBUG_*_*_CC_FLAGS =3D -DEFI_DEBUG=0D RELEASE_*_*_CC_FLAGS =3D -DMDEPKG_NDEBUG=0D =0D @@ -124,6 +130,9 @@ [Libraries.AARCH64]=0D ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf=0D =0D +[Libraries.RISCV64]=0D + ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf=0D +=0D [Libraries.IA32,Libraries.X64]=0D =0D [LibraryClasses.common]=0D @@ -146,6 +155,9 @@ [LibraryClasses.AARCH64]=0D NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf=0D =0D +[LibraryClasses.RISCV64]=0D + NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf=0D +=0D [LibraryClasses.IA32]=0D =0D ##########################################################################= #####=0D diff --git a/uefi-sct/SctPkg/UEFI/Protocol/DebugSupport.h b/uefi-sct/SctPkg= /UEFI/Protocol/DebugSupport.h index 7fba87ae..fb11bda4 100644 --- a/uefi-sct/SctPkg/UEFI/Protocol/DebugSupport.h +++ b/uefi-sct/SctPkg/UEFI/Protocol/DebugSupport.h @@ -607,6 +607,60 @@ typedef struct { UINT64 FAR; // Fault Address Register=0D } EFI_SYSTEM_CONTEXT_AARCH64;=0D =0D +///=0D +/// RISC-V processor exception types.=0D +///=0D +#define EXCEPT_RISCV_INST_MISALIGNED 0=0D +#define EXCEPT_RISCV_INST_ACCESS_FAULT 1=0D +#define EXCEPT_RISCV_ILLEGAL_INST 2=0D +#define EXCEPT_RISCV_BREAKPOINT 3=0D +#define EXCEPT_RISCV_LOAD_ADDRESS_MISALIGNED 4=0D +#define EXCEPT_RISCV_LOAD_ACCESS_FAULT 5=0D +#define EXCEPT_RISCV_STORE_AMO_ADDRESS_MISALIGNED 6=0D +#define EXCEPT_RISCV_STORE_AMO_ACCESS_FAULT 7=0D +#define EXCEPT_RISCV_ENV_CALL_FROM_UMODE 8=0D +#define EXCEPT_RISCV_ENV_CALL_FROM_SMODE 9=0D +#define EXCEPT_RISCV_ENV_CALL_FROM_HMODE 10=0D +#define EXCEPT_RISCV_ENV_CALL_FROM_MMODE 11=0D +=0D +#define EXCEPT_RISCV_SOFTWARE_INT 0x0=0D +#define EXCEPT_RISCV_TIMER_INT 0x1=0D +=0D +typedef struct {=0D + UINT64 X0;=0D + UINT64 X1;=0D + UINT64 X2;=0D + UINT64 X3;=0D + UINT64 X4;=0D + UINT64 X5;=0D + UINT64 X6;=0D + UINT64 X7;=0D + UINT64 X8;=0D + UINT64 X9;=0D + UINT64 X10;=0D + UINT64 X11;=0D + UINT64 X12;=0D + UINT64 X13;=0D + UINT64 X14;=0D + UINT64 X15;=0D + UINT64 X16;=0D + UINT64 X17;=0D + UINT64 X18;=0D + UINT64 X19;=0D + UINT64 X20;=0D + UINT64 X21;=0D + UINT64 X22;=0D + UINT64 X23;=0D + UINT64 X24;=0D + UINT64 X25;=0D + UINT64 X26;=0D + UINT64 X27;=0D + UINT64 X28;=0D + UINT64 X29;=0D + UINT64 X30;=0D + UINT64 X31;=0D +} EFI_SYSTEM_CONTEXT_RISCV64;=0D +=0D //=0D // Universal EFI_SYSTEM_CONTEXT definition=0D //=0D @@ -618,6 +672,7 @@ union { EFI_SYSTEM_CONTEXT_IPF *SystemContextIpf;=0D EFI_SYSTEM_CONTEXT_ARM *SystemContextArm;=0D EFI_SYSTEM_CONTEXT_AARCH64 *SystemContextAArch64;=0D + EFI_SYSTEM_CONTEXT_RISCV64 *SystemContextRiscV64;=0D } EFI_SYSTEM_CONTEXT;=0D =0D //=0D @@ -645,6 +700,10 @@ VOID #define IMAGE_FILE_MACHINE_EBC 0x0EBC=0D #define IMAGE_FILE_MACHINE_ARMTHUMB_MIXED 0x01c2=0D #define IMAGE_FILE_MACHINE_ARM64 0xAA64=0D +#define IMAGE_FILE_MACHINE_RISCV32 0x5032=0D +#define IMAGE_FILE_MACHINE_RISCV64 0x5064=0D +#define IMAGE_FILE_MACHINE_RISCV128 0x5128=0D +=0D =0D typedef=0D enum {=0D @@ -653,7 +712,8 @@ enum { IsaIpf =3D IMAGE_FILE_MACHINE_IA64,=0D IsaEbc =3D IMAGE_FILE_MACHINE_EBC,=0D IsaArm =3D IMAGE_FILE_MACHINE_ARMTHUMB_MIXED, ///< 0x01c2=0D - IsaAArch64 =3D IMAGE_FILE_MACHINE_ARM64 ///< 0xAA64=0D + IsaAArch64 =3D IMAGE_FILE_MACHINE_ARM64, ///< 0xAA64=0D + IsaRiscv64 =3D IMAGE_FILE_MACHINE_RISCV64=0D } EFI_INSTRUCTION_SET_ARCHITECTURE;=0D =0D typedef struct _EFI_DEBUG_SUPPORT_PROTOCOL EFI_DEBUG_SUPPORT_PROTOCOL;;=0D diff --git a/uefi-sct/SctPkg/UEFI/UEFI_SCT.dsc b/uefi-sct/SctPkg/UEFI/UEFI_= SCT.dsc index 2e97687b..666f06dd 100644 --- a/uefi-sct/SctPkg/UEFI/UEFI_SCT.dsc +++ b/uefi-sct/SctPkg/UEFI/UEFI_SCT.dsc @@ -42,7 +42,7 @@ PLATFORM_VERSION =3D 0.1=0D DSC_SPECIFICATION =3D 0x00010005=0D OUTPUT_DIRECTORY =3D Build/UefiSct=0D - SUPPORTED_ARCHITECTURES =3D IA32|X64|ARM|AARCH64=0D + SUPPORTED_ARCHITECTURES =3D IA32|X64|ARM|AARCH64|RISCV64=0D BUILD_TARGETS =3D DEBUG|RELEASE=0D SKUID_IDENTIFIER =3D DEFAULT=0D =0D @@ -112,6 +112,12 @@ *_*_AARCH64_PP_FLAGS =3D -D EFIAARCH64 $(GCC_VER_MACRO)=0D RVCT:*_*_AARCH64_DLINK_FLAGS =3D --muldefweak=0D =0D + *_*_RISCV64_CC_FLAGS =3D -D EFIRISCV64 $(GCC_VER_MACRO)=0D + GCC:*_*_RISCV64_CC_FLAGS =3D -D EFIRISCV64 $(GCC_VER_MACRO) -ffreest= anding -nostdinc -nostdlib -Wno-error=3Dunused-function -Wno-error=3Dunused= -but-set-variable -Wno-error=0D + *_*_RISCV64_VFRPP_FLAGS =3D -D EFIRISCV64 $(GCC_VER_MACRO)=0D + *_*_RISCV64_APP_FLAGS =3D -D EFIRISCV64 $(GCC_VER_MACRO)=0D + *_*_RISCV64_PP_FLAGS =3D -D EFIRISCV64 $(GCC_VER_MACRO)=0D +=0D DEBUG_*_*_CC_FLAGS =3D -DEFI_DEBUG=0D RELEASE_*_*_CC_FLAGS =3D -DMDEPKG_NDEBUG=0D =0D @@ -129,6 +135,9 @@ [Libraries.AARCH64]=0D ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf=0D =0D +[Libraries.RISCV64]=0D + ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf=0D +=0D [LibraryClasses.common]=0D UefiApplicationEntryPoint|MdePkg/Library/UefiApplicationEntryPoint/UefiA= pplicationEntryPoint.inf=0D UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntry= Point.inf=0D @@ -157,6 +166,9 @@ [LibraryClasses.AARCH64]=0D NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf=0D =0D +[LibraryClasses.RISCV64]=0D + NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf=0D +=0D ##########################################################################= #####=0D #=0D # These are the components that will be built by the master makefile=0D diff --git a/uefi-sct/SctPkg/build.sh b/uefi-sct/SctPkg/build.sh index cad17ccd..3d61daed 100755 --- a/uefi-sct/SctPkg/build.sh +++ b/uefi-sct/SctPkg/build.sh @@ -22,6 +22,8 @@ function get_build_arch BUILD_ARCH=3DARM;; aarch64*) BUILD_ARCH=3DAARCH64;; + riscv64*) + BUILD_ARCH=3DRISCV64;; *) BUILD_ARCH=3Dother;; esac @@ -47,6 +49,12 @@ function set_cross_compile else TEMP_CROSS_COMPILE=3Darm-linux-gnueabihf- fi + elif [ "$SCT_TARGET_ARCH" =3D=3D "RISCV64" ]; then + if [ X"$CROSS_COMPILE_64" !=3D X"" ]; then + TEMP_CROSS_COMPILE=3D"$CROSS_COMPILE_64" + else + TEMP_CROSS_COMPILE=3Driscv64-unknown-elf- + fi else echo "Unsupported target architecture '$SCT_TARGET_ARCH'!" >&2 fi @@ -110,7 +118,7 @@ PrintUsage() { #Print Help # echo "Usage:" - echo " $0 \ + echo " $0 \ \ [build type (RELEASE OR DEBUG, DEFAULT: DEBUG)]" } --=20 2.28.0