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.36740.1612797003472719050 for ; Mon, 08 Feb 2021 07:10:03 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@hpe.com header.s=pps0720 header.b=phApZiDV; spf=pass (domain: hpe.com, ip: 148.163.143.35, mailfrom: prvs=0673351e1b=daniel.schaefer@hpe.com) Received: from pps.filterd (m0134425.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 118F8Rak002018; Mon, 8 Feb 2021 15:09:37 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hpe.com; h=subject : to : cc : references : from : message-id : date : in-reply-to : content-type : content-transfer-encoding : mime-version; s=pps0720; bh=z4lAdOWdGZ1klEl+VyVRRN3SGxGRS2/QWRiZ0QZN2Jk=; b=phApZiDVa84+HDBV9ZVnqREubvW/I+dFJKBjP3KAhRN2ni660dxrCA8MHmfoCDw1AOzQ 7fiLjgfHppcfWdN0N3JPl7Jw5rXz3MM2kDDb2ZnsQ7+qwWM63EpR/N5kt8iuZrTWj5DA Aqi4gWsOqcug8y1saB6Bn49L51P6j6gpqPR9Ln8EsyXpfwwyGkmROEOm/SuVKLJh0B8l sTaG75ZyNPfiH+tbsQ7y8wtyzBf8xnZgul4KLo+jgAXnU+ckKUjvSSI1CYUhQZpMND2/ 40G1dY2qJBaUIoq5civ86i7qH3NrZIp8+ZlJRYLyOPUnsXsxTz5+OM4PgZUiweeXHbBJ YA== Received: from g4t3427.houston.hpe.com (g4t3427.houston.hpe.com [15.241.140.73]) by mx0b-002e3701.pphosted.com with ESMTP id 36k6uk8k8r-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 08 Feb 2021 15:09:37 +0000 Received: from G2W6311.americas.hpqcorp.net (g2w6311.austin.hp.com [16.197.64.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by g4t3427.houston.hpe.com (Postfix) with ESMTPS id 55F6657; Mon, 8 Feb 2021 15:09:35 +0000 (UTC) Received: from G4W9331.americas.hpqcorp.net (16.208.32.117) by G2W6311.americas.hpqcorp.net (16.197.64.53) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 8 Feb 2021 15:09:34 +0000 Received: from G9W9210.americas.hpqcorp.net (2002:10dc:429b::10dc:429b) by G4W9331.americas.hpqcorp.net (2002:10d0:2075::10d0:2075) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 8 Feb 2021 15:09:33 +0000 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (15.241.52.13) by G9W9210.americas.hpqcorp.net (16.220.66.155) with Microsoft SMTP Server (TLS) id 15.0.1497.2 via Frontend Transport; Mon, 8 Feb 2021 15:09:32 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=e0/1cjzTXIrLTNRWm+8r/UbtobDukfX6dSv8+d5aF+tYAe99/7ZNkfvTETbQP8CPVVLjl7x94dJidZpHdEUi/0SkOFSrlGhKzeF7yVP1o6eqLPoFdZAx8pMRHuZ2bo4xpFenlOWefyCq0wp7JzGWqpL9NRpgNs0BRop5/sLQLK9FqMYX8PhJ7P0Zbf3POV85bAHhUP5t5+l4n6DoM6cS852pzeQ5hrfJhluFnBSdRk2JcvD8WB+Pn5mU95cCiOHmEJy83MYIT1kfh1bEay9UUY3N0fh39/mbxdl75XRbaAYGdNDYQ0VM6KgRr8cJjBK9fKEE/QcZVW/XZBqaLBDNag== 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=AJOcNhYT2iFrqt4YsAlfuYbVewQWaL+m1NyhLjm6G30=; b=ctRLBXZNBGtVqhqezlANkXR5vk6Njwh5Gv28vqpe9fLNsUYO1TaVCGCEw6OyRPpu5JcKbcJ2tufcMnzCNwWLZX2MATxzVh/CcEmx0x+4i27C9AhEgZnLxqVfOXF1tHpAD1m3E9LX9QZw1J8/BujxGwNdHZacoOFwXkn/NFm75dkyYNm/9+rllFCpacJp2qfEURBKq13wd0/8DCyL97nF9BxaPyr8ZiVJ+6KHCq1yIAgcaGjW/cnOLuR6/qrXKEV65Jf2rxRSQUaFA5F8/fkBN4fel65OLbwFkZ+H8o1X5BlXDHThvgxr4IGffYnSr1jP3Xqk5YOXE7t6l/4v4DAYSg== 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: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=hpe.com; Received: from DF4PR8401MB0444.NAMPRD84.PROD.OUTLOOK.COM (2a01:111:e400:760d::23) by DF4PR8401MB0953.NAMPRD84.PROD.OUTLOOK.COM (2a01:111:e400:760d::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3825.17; Mon, 8 Feb 2021 15:09:31 +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; Mon, 8 Feb 2021 15:09:31 +0000 Subject: Re: [edk2-devel] [edk2-test PATCH v1 1/2] SctPkg: Add RISCV64 support To: , CC: Heinrich Schuchardt , Abner Chang , Gilbert Chen , Eric Jin , G Edhaya Chandran , Barton Gao , Samer El-Haj-Mahmoud References: <20201201161752.23734-1-daniel.schaefer@hpe.com> <20201201161752.23734-2-daniel.schaefer@hpe.com> <20201202114435.GD1664@vanye> From: "Daniel Schaefer" Message-ID: <3e440f3f-83d7-6278-88f7-7d1cbdfc6a7c@hpe.com> Date: Mon, 8 Feb 2021 23:09:21 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.1 In-Reply-To: <20201202114435.GD1664@vanye> X-Originating-IP: [123.193.51.23] X-ClientProxiedBy: HK2PR02CA0201.apcprd02.prod.outlook.com (2603:1096:201:20::13) To DF4PR8401MB0444.NAMPRD84.PROD.OUTLOOK.COM (2a01:111:e400:760d::23) X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [192.168.0.21] (123.193.51.23) by HK2PR02CA0201.apcprd02.prod.outlook.com (2603:1096:201:20::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3825.19 via Frontend Transport; Mon, 8 Feb 2021 15:09:28 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: e6c5931b-86de-456e-acab-08d8cc43893e X-MS-TrafficTypeDiagnostic: DF4PR8401MB0953: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3383; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +Qa1CrQ+L2Ro83OmVNP7yVZ4cEiN63sTRZP6hZAlyq0W1uMNIT8bS0gqliF23vEr5iveK/mnSIlJg8wVQda+VaMsb7cSo04AACmFdaKun/HHViySult0sQdLpwz1KMvu90r8A9uH1cXOG81rcjk4BWrO6ISleVapkK9JDXvev8E46tz1OyNoZRz9Ok71Y962TqIxHVxVGvEtPm2r5cMAQ4Mu9W18iLnM9cTFzO/gmX57JEaJxF/lxeQhroUKxIH82VHxX5kS3+wjZIdHFfGbSa9JhLA+Eh8/mX7n4NPfX8fGGIa13uYj3/v3p9XChPig4g5EDFtSyv9gwgmJHenmbbV/XX/ApOlpKCwtXReqXHe21XLXFyBG7qDl5xX8lWeKrF8gRMDmt1qxynsX1jRNqYDPe0Mz+6DE20mafCVPONYwR75LFesw8Hth4qG0O/AOcGagkv3wXZpwhr+X5quGLlcAdWVb3fkgTd80RBTvuRk/rzrEnPDVTOGFWMnC/fQoocSpR4RcLIoCRs0GoJ1rmSGd28zJ+WoYigTZiKjHAK52A81K2V736sb/sliOwjrlQDYSM+3pr66r+QITItgR3E4geFkIoQAVOBBRTWDKPsxH+BjzUd7uNkZnROJkOLoJTG5LVEei9swIOL9lOyGrq8umtLuWSgPedbOAMoMkEymEubCS5u6yWD8JINQr0Lpa 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:(366004)(396003)(346002)(39860400002)(136003)(376002)(36756003)(8936002)(6486002)(52116002)(31686004)(19627235002)(31696002)(53546011)(4326008)(16526019)(186003)(6666004)(8676002)(30864003)(83380400001)(66476007)(316002)(26005)(16576012)(44832011)(2906002)(478600001)(66946007)(966005)(956004)(54906003)(2616005)(66556008)(5660300002)(86362001)(43740500002)(45980500001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData: =?utf-8?B?Ym5Lc3YwbUxyaDZHTjJOVTJFa2R3ZkU2dENVNjVHanBtdEJMWWRxZnNwNjVL?= =?utf-8?B?Qjlnc1JmTjZxRnBZWWpCcWFkd0dtL0xBWkdMZWNmL3N4Zy9HZFdJcDlOdVps?= =?utf-8?B?V1pEL0x6enQ0WGtLb00wbnpQT0ZQZVdieTlkczNVS3ppQkJKTzNGdW1SbHp3?= =?utf-8?B?Umw4S0ppR21tTlFEQ2lIR0phV2Ivb1NLYllNbWRQcS9IdGxWL0VsTHhlU0xq?= =?utf-8?B?UXhpY3BMVXgza2NLNFVOaGtGQ2RSY3NnZTJkVHBjakJWaXNsNFk2cXNaUS9I?= =?utf-8?B?dVZqQUM2a2pObFkzeTJZalBRekV4Y1Nhd0p6SUgyNGMyampmcTJRMXRHQW1Z?= =?utf-8?B?U01yMkthUFNaL1JwaHMvdGFVRDhJdlJ4cXBnay9aNmQwY0daMzhyOElmTDE3?= =?utf-8?B?VkVrUTUwbVNQUzlvUk1Nc2VLV0phRy9meEx6S1VNOThpWnpBRVNEcnN3bDNL?= =?utf-8?B?eXhJbkYxZStybytaSCt2Z1RVeEdaeFdrWGVaTWE5VmkxU2x3TThwaXlrdWk0?= =?utf-8?B?cUF1Ujlxdk5TWUdyNE5ZcFRmbW1XME5jUEtSTDlhQjhvQzhZMktCc05Iempl?= =?utf-8?B?bTdlN0JYV3NnRFJJNERaOXlLN0RiN3NWaldCc01RbkoxUDkrY0RhOEI5RGJk?= =?utf-8?B?RTgyUTRJZFhRd2hKU2hrRzVCVWozZ1FMajU2YVFiSXNBSlRleFUza2JuZjhk?= =?utf-8?B?eGRIT2YrdTNKbHAra01zV1gzMkVuTXNwQ2IwdCtJbW5UTE8ydVNmMEI1TGpw?= =?utf-8?B?UXU1bi9lVCtSbk0zVGxPUDd3eitNd3hENHZOYmJDeDc1Y0ZSRzZYODd2aTF3?= =?utf-8?B?TTd2NGxGRmE3c201Qlg0Y1FJckgvZjVMZEQzKzdVYUkxVVY5bmxLemhrZDRI?= =?utf-8?B?Nlh1VjFEU2JwSXJ0VFhPWHowWGVCc3o2RTBIOUYxTnBkOCtmSkpYNjVzdW1B?= =?utf-8?B?ZEZqREVMRVF5cXk4cmo0K2V4bnQrMUdHSElRZWNiVlhlU1U2WExCRld3YjRN?= =?utf-8?B?OTVkNFlaRjlKMmVUdnVSR2VUbHp6MzVoRkZYU1l1NDJFMGtNeDgrUklFSlE3?= =?utf-8?B?VlNhaDVia2Q0a0MrRHJaUVo1MmF3K1BkMk5PV3FWVHpzdllVRGdCN0hYTjVR?= =?utf-8?B?Wm9rT1A2SlRrNEh0cUhlQ1preU8wMHFsWEFHdldydTQrMGgvSkdGWDMrT3NL?= =?utf-8?B?RWFqRnF2N3JKTndZaHBkM2tLL3lHbGg1RldlbmxPdGZNa1M3c3lOUVRIenlS?= =?utf-8?B?K29oakJuM3NzZzBmYU5DdEpwUXdTYXhWS1AxR0ZsK0dkQzIrT09sWCswbFJ4?= =?utf-8?B?OExBNFhIYUxzMnNseS96Z3g3bG1GQXJ5NjRQanpHSzdVa3RETldvMnIveGFD?= =?utf-8?B?bDB6YllpRU0zTS9odGJ5bzF2ek9IK3FCY0lYU1NKeGZ5QTZXcDdCN2lxZlRh?= =?utf-8?B?NjNOTWxmY0NHS1pCSlcxRzd1OFJNSEZza1NKV0F6V2JuK3NJbW1ESWVrRVli?= =?utf-8?B?R0RSREoxQkJpR0FWQnhsTmVMMjBEZnl0czhwazM2bm5vQkJKaXZZUWdSQW9j?= =?utf-8?B?MFhXWjVYM2lBMldxUnlaek53b1c4NXNsdWg0RE8zTDZNWUtjL0NzcHBoY3Ft?= =?utf-8?B?VExNQTE3YWNWVnNkZE01dzRiZEVFT1E5YVM4V2lLOXJnMllJVGtDMVhHSGRk?= =?utf-8?B?MU1tZ0oxRlprU3ZMVk9yemh0MWdSRWJSZlpWSHU5d1FQZWFqaEFoQ0RhSHU5?= =?utf-8?Q?5mEULgNwsSSZ0Mwwz2mXYe9kLqxz4PscxftuIz6?= X-MS-Exchange-CrossTenant-Network-Message-Id: e6c5931b-86de-456e-acab-08d8cc43893e X-MS-Exchange-CrossTenant-AuthSource: DF4PR8401MB0444.NAMPRD84.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Feb 2021 15:09:31.4114 (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: pBEq6OffKGZHaVi94uFwoUvxTar2ZI+a8WyZiPCONapjb9R9MtPDIDYVKUQC6qZwJSqeZgKc1FssyKu12EE3lw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DF4PR8401MB0953 X-OriginatorOrg: hpe.com X-Proofpoint-UnRewURL: 4 URL's were 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-08_09:2021-02-08,2021-02-08 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 lowpriorityscore=0 bulkscore=0 suspectscore=0 phishscore=0 priorityscore=1501 malwarescore=0 spamscore=0 clxscore=1015 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2102080104 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit On 12/2/20 7:44 PM, Leif Lindholm wrote: > On Wed, Dec 02, 2020 at 00:17:51 +0800, Daniel Schaefer wrote: >> REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3042 >> >> 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/DebugSupportBBTest.inf | 6 ++ >> uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/Usb2Hc/BlackBoxTest/Usb2HcTest.inf | 4 ++ >> uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/UsbHc/BlackBoxTest/UsbHcTest.inf | 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) >> #define INSTALL_SCT_PLATFORM_SHORT_NAME L"aarch64" >> #define INSTALL_SCT_PLATFORM_NAME L"AARCH64" >> +#elif defined(EFIRISCV64) >> + #define INSTALL_SCT_PLATFORM_SHORT_NAME L"riscv64" >> + #define INSTALL_SCT_PLATFORM_NAME L"RISCV64" >> #else >> #error "Architecture not supported" >> #endif >> diff --git a/uefi-sct/SctPkg/Library/SctLib/SctLib.inf b/uefi-sct/SctPkg/Library/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 >> Math.c >> >> +# TODO: Copied source from AARCH64, need to check if they need to be adjusted > > TODOs need to go, throughout. All resolved in the next patch series. >> +[sources.RISCV64] >> + Riscv64/SctLibPlat.h >> + Riscv64/initplat.c >> + Math.c >> + >> [sources.ia32] >> ia32/SctLibPlat.h >> ia32/initplat.c >> diff --git a/uefi-sct/SctPkg/SCRT/SCRTApp/SCRTApp.inf b/uefi-sct/SctPkg/SCRT/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 >> Aarch64/GoVirtual.S | GCC >> >> +# TODO: Copied source from AARCH64, need to check if they need to be adjusted >> +# ASM is adjusted but not sure if it is correct >> +[sources.RISCV64] >> + Riscv64/VirtualMemory.c >> + Riscv64/GoVirtual.S | GCC >> + >> [sources.ia32] >> ia32/VirtualMemory.c >> ia32/GoVirtual.asm | MSFT >> diff --git a/uefi-sct/SctPkg/SCRT/SCRTDriver/SCRTDriver.inf b/uefi-sct/SctPkg/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 >> Aarch64/Debug.c >> >> +# TODO: Copied source from AARCH64, need to check if they need to be adjusted >> +[sources.RISCV64] >> + Riscv64/Io.c >> + Riscv64/Io.h >> + Riscv64/Dump.c >> + Riscv64/Debug.c >> + >> [sources.common] >> Guid.h >> Guid.c >> diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/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 >> Aarch64/DebugSupportBBTestCacheFunction.c >> >> +# TODO: Copied source from AARCH64, need to check if they need to be adjusted >> +[sources.RISCV64] >> + Riscv64/PlatformIsa.c >> + Riscv64/DebugSupportBBTestExceptionCallbackFunction.c >> + Riscv64/DebugSupportBBTestCacheFunction.c >> + >> [Packages] >> SctPkg/SctPkg.dec >> SctPkg/UEFI/UEFI.dec >> diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/Usb2Hc/BlackBoxTest/Usb2HcTest.inf b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/Usb2Hc/BlackBoxTest/Usb2HcTest.inf >> index e8118739..e42acd29 100644 >> --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/Usb2Hc/BlackBoxTest/Usb2HcTest.inf >> +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/Usb2Hc/BlackBoxTest/Usb2HcTest.inf >> @@ -55,6 +55,10 @@ >> #[sources.Aarch64] >> # IPF/TimerInterrupt.c >> >> +# TODO: Seems like almost all archs can use the IPF code, need to check >> +[sources.Riscv64] >> + IPF/TimerInterrupt.c >> + >> [Packages] >> MdePkg/MdePkg.dec >> SctPkg/SctPkg.dec >> diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/UsbHc/BlackBoxTest/UsbHcTest.inf b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/UsbHc/BlackBoxTest/UsbHcTest.inf >> index efc438c1..0d47536f 100644 >> --- a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/UsbHc/BlackBoxTest/UsbHcTest.inf >> +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/UsbHc/BlackBoxTest/UsbHcTest.inf >> @@ -55,6 +55,10 @@ >> [sources.Aarch64] >> Aarch64/TimerInterrupt.c >> >> +# TODO: Copied source from AARCH64, need to check if they need to be adjusted >> +[sources.RISCV64] >> + Riscv64/TimerInterrupt.c >> + >> [Packages] >> MdePkg/MdePkg.dec >> SctPkg/SctPkg.dec >> diff --git a/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/EntsLib.inf b/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/EntsLib.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 >> Aarch64/InitPlat.c >> >> +# TODO: Copied source from AARCH64, need to check if they need to be adjusted >> +[sources.RISCV64] >> + Riscv64/EntsLibPlat.h >> + Riscv64/InitPlat.c >> + >> [Packages] >> MdePkg/MdePkg.dec >> SctPkg/SctPkg.dec >> diff --git a/uefi-sct/SctPkg/Tools/Source/GenBin/GNUmakefile b/uefi-sct/SctPkg/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))) >> ARCH=ARM >> endif >> + ifneq (,$(findstring riscv64,$(uname_m))) >> + ARCH=RISCV64 >> + endif >> ifndef ARCH >> $(info Could not detected ARCH from uname results) >> $(error ARCH is not defined!) >> diff --git a/uefi-sct/SctPkg/UEFI/IHV_SCT.dsc b/uefi-sct/SctPkg/UEFI/IHV_SCT.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 = 0.1 >> DSC_SPECIFICATION = 0x00010005 >> OUTPUT_DIRECTORY = Build/IhvSct >> - SUPPORTED_ARCHITECTURES = IA32|X64|ARM|AARCH64 >> + SUPPORTED_ARCHITECTURES = IA32|X64|ARM|AARCH64|RISCV64 >> BUILD_TARGETS = DEBUG|RELEASE >> SKUID_IDENTIFIER = DEFAULT >> >> @@ -109,6 +109,12 @@ >> *_*_AARCH64_PP_FLAGS = -D EFIAARCH64 $(GCC_VER_MACRO) >> RVCT:*_*_AARCH64_DLINK_FLAGS = --muldefweak >> >> + *_*_RISCV64_CC_FLAGS = -D EFIRISCV64 $(GCC_VER_MACRO) >> + GCC:*_*_RISCV64_CC_FLAGS = -D EFIRISCV64 $(GCC_VER_MACRO) -ffreestanding -nostdinc -nostdlib -Wno-error=unused-function -Wno-error=unused-but-set-variable -Wno-error > > These flags do not look RISCV64-specific. > If there are bugs to be fixed in common code, they should be fixed. > If there are too many to usefully test, then the flags should be set > for > GCC:*_*_*_CC_FLAGS Okay sure, I'll clean it up for all architectures. >> + *_*_RISCV64_VFRPP_FLAGS = -D EFIRISCV64 $(GCC_VER_MACRO) >> + *_*_RISCV64_APP_FLAGS = -D EFIRISCV64 $(GCC_VER_MACRO) >> + *_*_RISCV64_PP_FLAGS = -D EFIRISCV64 $(GCC_VER_MACRO) >> + >> DEBUG_*_*_CC_FLAGS = -DEFI_DEBUG >> RELEASE_*_*_CC_FLAGS = -DMDEPKG_NDEBUG >> >> @@ -124,6 +130,9 @@ >> [Libraries.AARCH64] >> ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf >> >> +[Libraries.RISCV64] >> + ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf >> + >> [Libraries.IA32,Libraries.X64] >> >> [LibraryClasses.common] >> @@ -146,6 +155,9 @@ >> [LibraryClasses.AARCH64] >> NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf >> >> +[LibraryClasses.RISCV64] >> + NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf >> + >> [LibraryClasses.IA32] >> >> ############################################################################### >> 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 >> } EFI_SYSTEM_CONTEXT_AARCH64; >> >> +/// >> +/// RISC-V processor exception types. >> +/// >> +#define EXCEPT_RISCV_INST_MISALIGNED 0 >> +#define EXCEPT_RISCV_INST_ACCESS_FAULT 1 >> +#define EXCEPT_RISCV_ILLEGAL_INST 2 >> +#define EXCEPT_RISCV_BREAKPOINT 3 >> +#define EXCEPT_RISCV_LOAD_ADDRESS_MISALIGNED 4 >> +#define EXCEPT_RISCV_LOAD_ACCESS_FAULT 5 >> +#define EXCEPT_RISCV_STORE_AMO_ADDRESS_MISALIGNED 6 >> +#define EXCEPT_RISCV_STORE_AMO_ACCESS_FAULT 7 >> +#define EXCEPT_RISCV_ENV_CALL_FROM_UMODE 8 >> +#define EXCEPT_RISCV_ENV_CALL_FROM_SMODE 9 >> +#define EXCEPT_RISCV_ENV_CALL_FROM_HMODE 10 >> +#define EXCEPT_RISCV_ENV_CALL_FROM_MMODE 11 >> + >> +#define EXCEPT_RISCV_SOFTWARE_INT 0x0 >> +#define EXCEPT_RISCV_TIMER_INT 0x1 >> + >> +typedef struct { >> + UINT64 X0; >> + UINT64 X1; >> + UINT64 X2; >> + UINT64 X3; >> + UINT64 X4; >> + UINT64 X5; >> + UINT64 X6; >> + UINT64 X7; >> + UINT64 X8; >> + UINT64 X9; >> + UINT64 X10; >> + UINT64 X11; >> + UINT64 X12; >> + UINT64 X13; >> + UINT64 X14; >> + UINT64 X15; >> + UINT64 X16; >> + UINT64 X17; >> + UINT64 X18; >> + UINT64 X19; >> + UINT64 X20; >> + UINT64 X21; >> + UINT64 X22; >> + UINT64 X23; >> + UINT64 X24; >> + UINT64 X25; >> + UINT64 X26; >> + UINT64 X27; >> + UINT64 X28; >> + UINT64 X29; >> + UINT64 X30; >> + UINT64 X31; >> +} EFI_SYSTEM_CONTEXT_RISCV64; >> + >> // >> // Universal EFI_SYSTEM_CONTEXT definition >> // >> @@ -618,6 +672,7 @@ union { >> EFI_SYSTEM_CONTEXT_IPF *SystemContextIpf; >> EFI_SYSTEM_CONTEXT_ARM *SystemContextArm; >> EFI_SYSTEM_CONTEXT_AARCH64 *SystemContextAArch64; >> + EFI_SYSTEM_CONTEXT_RISCV64 *SystemContextRiscV64; >> } EFI_SYSTEM_CONTEXT; >> >> // >> @@ -645,6 +700,10 @@ VOID >> #define IMAGE_FILE_MACHINE_EBC 0x0EBC >> #define IMAGE_FILE_MACHINE_ARMTHUMB_MIXED 0x01c2 >> #define IMAGE_FILE_MACHINE_ARM64 0xAA64 >> +#define IMAGE_FILE_MACHINE_RISCV32 0x5032 >> +#define IMAGE_FILE_MACHINE_RISCV64 0x5064 >> +#define IMAGE_FILE_MACHINE_RISCV128 0x5128 > > This set is not adding support for RISCV32/RISCV128, so no real point > adding those #defines. Ok, sure. >> + >> >> typedef >> enum { >> @@ -653,7 +712,8 @@ enum { >> IsaIpf = IMAGE_FILE_MACHINE_IA64, >> IsaEbc = IMAGE_FILE_MACHINE_EBC, >> IsaArm = IMAGE_FILE_MACHINE_ARMTHUMB_MIXED, ///< 0x01c2 >> - IsaAArch64 = IMAGE_FILE_MACHINE_ARM64 ///< 0xAA64 >> + IsaAArch64 = IMAGE_FILE_MACHINE_ARM64, ///< 0xAA64 >> + IsaRiscv64 = IMAGE_FILE_MACHINE_RISCV64 > > Add the doxygen comment to match the others. > >> } EFI_INSTRUCTION_SET_ARCHITECTURE; >> >> typedef struct _EFI_DEBUG_SUPPORT_PROTOCOL EFI_DEBUG_SUPPORT_PROTOCOL;; >> 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 = 0.1 >> DSC_SPECIFICATION = 0x00010005 >> OUTPUT_DIRECTORY = Build/UefiSct >> - SUPPORTED_ARCHITECTURES = IA32|X64|ARM|AARCH64 >> + SUPPORTED_ARCHITECTURES = IA32|X64|ARM|AARCH64|RISCV64 >> BUILD_TARGETS = DEBUG|RELEASE >> SKUID_IDENTIFIER = DEFAULT >> >> @@ -112,6 +112,12 @@ >> *_*_AARCH64_PP_FLAGS = -D EFIAARCH64 $(GCC_VER_MACRO) >> RVCT:*_*_AARCH64_DLINK_FLAGS = --muldefweak >> >> + *_*_RISCV64_CC_FLAGS = -D EFIRISCV64 $(GCC_VER_MACRO) >> + GCC:*_*_RISCV64_CC_FLAGS = -D EFIRISCV64 $(GCC_VER_MACRO) -ffreestanding -nostdinc -nostdlib -Wno-error=unused-function -Wno-error=unused-but-set-variable -Wno-error > > Same as above. Done. > / > Leif > >> + *_*_RISCV64_VFRPP_FLAGS = -D EFIRISCV64 $(GCC_VER_MACRO) >> + *_*_RISCV64_APP_FLAGS = -D EFIRISCV64 $(GCC_VER_MACRO) >> + *_*_RISCV64_PP_FLAGS = -D EFIRISCV64 $(GCC_VER_MACRO) >> + >> DEBUG_*_*_CC_FLAGS = -DEFI_DEBUG >> RELEASE_*_*_CC_FLAGS = -DMDEPKG_NDEBUG >> >> @@ -129,6 +135,9 @@ >> [Libraries.AARCH64] >> ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf >> >> +[Libraries.RISCV64] >> + ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf >> + >> [LibraryClasses.common] >> UefiApplicationEntryPoint|MdePkg/Library/UefiApplicationEntryPoint/UefiApplicationEntryPoint.inf >> UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf >> @@ -157,6 +166,9 @@ >> [LibraryClasses.AARCH64] >> NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf >> >> +[LibraryClasses.RISCV64] >> + NULL|ArmPkg/Library/CompilerIntrinsicsLib/CompilerIntrinsicsLib.inf >> + >> ############################################################################### >> # >> # These are the components that will be built by the master makefile >> 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=ARM;; >> aarch64*) >> BUILD_ARCH=AARCH64;; >> + riscv64*) >> + BUILD_ARCH=RISCV64;; >> *) >> BUILD_ARCH=other;; >> esac >> @@ -47,6 +49,12 @@ function set_cross_compile >> else >> TEMP_CROSS_COMPILE=arm-linux-gnueabihf- >> fi >> + elif [ "$SCT_TARGET_ARCH" == "RISCV64" ]; then >> + if [ X"$CROSS_COMPILE_64" != X"" ]; then >> + TEMP_CROSS_COMPILE="$CROSS_COMPILE_64" >> + else >> + TEMP_CROSS_COMPILE=riscv64-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)]" >> } >> -- >> 2.28.0 >> >> >> >> >> >> > > > > >