From nobody Tue Feb 10 20:48:03 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+97358+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+97358+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1671007038; cv=none; d=zohomail.com; s=zohoarc; b=F2LpafdafTxnFpB3ESz4gRclCatOfmMva+OCCwHNt5gci8bZsJZamWSCzPERyE7uyHwO2Y3KF0eveVgPp6tq1OW0Xa+x5LZOM1K1abZDGJMUJ9cBKErI+VovOPdlG5fv8avVsZoEzu6XKq4UJS3o0j2APcBx86iEo++oNC2sCAo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1671007038; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=IVTNdhF7Gwa+fBM7b06lyNeDUIsGb+6GOAKJA7Y/oCo=; b=Hi/jWp4zQ5CAqxipdhiIdSkGymv+5GjZUEcqJML2o7Jm273H8KChjFEEroeWifP6aoGBk3HKRlmp3xWrMKXlOadYoXffSTLBuAHECP3xwiSLHbUpJp1dKNuw+m1mlwt1h9c6IvRC81cr5x+0g/yE/OpQgS210hH9GKd361c/828= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+97358+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1671007038537265.34381766804086; Wed, 14 Dec 2022 00:37:18 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id AehYYY1788612xgqRPrhlIp1; Wed, 14 Dec 2022 00:37:18 -0800 X-Received: from loongson.cn (loongson.cn [114.242.206.163]) by mx.groups.io with SMTP id smtpd.web10.97831.1671007036899537631 for ; Wed, 14 Dec 2022 00:37:17 -0800 X-Received: from loongson.cn (unknown [10.2.9.245]) by gateway (Coremail) with SMTP id _____8Axz+s6i5ljmHsFAA--.12667S3; Wed, 14 Dec 2022 16:37:14 +0800 (CST) X-Received: from code-server.gen (unknown [10.2.9.245]) by localhost.localdomain (Coremail) with SMTP id AQAAf8BxoOI3i5lj3fMuAA--.48256S3; Wed, 14 Dec 2022 16:37:13 +0800 (CST) From: "Chao Li" To: devel@edk2.groups.io Cc: G Edhaya Chandran , Barton Gao , Carolyn Gjertsen , Samer El-Haj-Mahmoud , Eric Jin , Supreeth Venkatesh Subject: [edk2-devel] [PATCH v1 1/2] uefi-sct/SctPkg: Add LoongArch64 platform support Date: Wed, 14 Dec 2022 16:36:57 +0800 Message-Id: <20221214083658.432422-2-lichao@loongson.cn> In-Reply-To: <20221214083658.432422-1-lichao@loongson.cn> References: <20221214083658.432422-1-lichao@loongson.cn> MIME-Version: 1.0 X-CM-TRANSID: AQAAf8BxoOI3i5lj3fMuAA--.48256S3 X-CM-SenderInfo: xolfxt3r6o00pqjv00gofq/1tbiAQAACGOYa2g3EgADsX X-Coremail-Antispam: 1Uk129KBjvAXoWfXr4UZr4rCw47Xr1UXFW3Awb_yoW5Kw13uo ZF9a95uw4rJ34rArykA3Z3Gw47XFs5WrW3Xrs8WFZ8W3W5X3WrGa4Utw15Jw13JFWxXan8 G347Xas3Jr4agF4rn29KB7ZKAUJUUUUr529EdanIXcx71UUUUU7KY7ZEXasCq-sGcSsGvf J3Ic02F40EFcxC0VAKzVAqx4xG6I80ebIjqfuFe4nvWSU5nxnvy29KBjDU0xBIdaVrnRJU UUkm1xkIjI8I6I8E6xAIw20EY4v20xvaj40_Wr0E3s1l8cAvFVAK0II2c7xJM28CjxkF64 kEwVA0rcxSw2x7M28EF7xvwVC0I7IYx2IY67AKxVW8JVW5JwA2z4x0Y4vE2Ix0cI8IcVCY 1x0267AKxVW8JVWxJwA2z4x0Y4vEx4A2jsIE14v26r4UJVWxJr1l84ACjcxK6I8E87Iv6x kF7I0E14v26r4UJVWxJr1ln4kS14v26r1Y6r17M2AIxVAIcxkEcVAq07x20xvEncxIr21l 57IF6xkI12xvs2x26I8E6xACxx1l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6x8ErcxFaV Av8VWrMcvjeVCFs4IE7xkEbVWUJVW8JwACjcxG0xvY0x0EwIxGrwCY1x0262kKe7AKxVWU AVWUtwCF04k20xvY0x0EwIxGrwCF04k20xvE74AGY7Cv6cx26rWl4I8I3I0E4IkC6x0Yz7 v_Jr0_Gr1l4IxYO2xFxVAFwI0_Jrv_JF1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s026x8G jcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r126r1DMIIYrxkI7VAKI48JMIIF0xvE2I x0cI8IcVAFwI0_JFI_Gr1lIxAIcVC0I7IYx2IY6xkF7I0E14v26r4j6F4UMIIF0xvE42xK 8VAvwI8IcIk0rVWUJVWUCwCI42IY6I8E87Iv67AKxVW8JVWxJwCI42IY6I8E87Iv6xkF7I 0E14v26r4j6r4UJbIYCTnIWIevJa73UjIFyTuYvj4R_gAwDUUUU Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,lichao@loongson.cn X-Gm-Message-State: qRDKsZG6kUrHlHkjbgDpYxjcx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1671007038; bh=x+wU1zW6IxDuxmpeO69O48vUdW/I/HhTkPMQegSNu1o=; h=Cc:Date:From:Reply-To:Subject:To; b=BdaRAsChBhpfTmqbgljyw1nR6Rlv1KAKIswL6DAASCDzYDjwYuH14d1YB6hRzjcHlBJ X0AbsvcDR42549FI8BHPiR11i5T1KKyejBvOTFTXR4NljvorzaBKiKXkXaz4Euq39dIkr MzBipFzhKXPgPHw3k6dlgRvuyNGMvSMswFM= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1671007039391100006 Content-Type: text/plain; charset="utf-8" Code referenced from Aarch64 and Risc-V. Added three test case for LoongArch64. BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4192 Cc: G Edhaya Chandran Cc: Barton Gao Cc: Carolyn Gjertsen Cc: Samer El-Haj-Mahmoud Cc: Eric Jin Cc: Supreeth Venkatesh Signed-off-by: Chao Li Reviewed-by: G Edhaya Chandran --- .../Library/SctLib/LoongArch64/SctLibPlat.h | 32 ++ .../Library/SctLib/LoongArch64/initplat.c | 45 +++ .../SCRT/SCRTApp/LoongArch64/GoVirtual.S | 41 +++ .../SCRT/SCRTApp/LoongArch64/VirtualMemory.c | 177 ++++++++++++ .../SCRT/SCRTDriver/LoongArch64/Debug.c | 81 ++++++ .../SctPkg/SCRT/SCRTDriver/LoongArch64/Dump.c | 68 +++++ .../SctPkg/SCRT/SCRTDriver/LoongArch64/Io.c | 136 +++++++++ .../DebugSupportBBTestCacheFunction.c | 136 +++++++++ ...ugSupportBBTestExceptionCallbackFunction.c | 273 ++++++++++++++++++ .../BlackBoxTest/LoongArch64/PlatformIsa.c | 29 ++ .../BlackBoxTest/LoongArch64/TimerInterrupt.c | 38 +++ .../ENTS/EasLib/LoongArch64/EntsLibPlat.h | 56 ++++ .../ENTS/EasLib/LoongArch64/InitPlat.c | 55 ++++ 13 files changed, 1167 insertions(+) create mode 100644 uefi-sct/SctPkg/Library/SctLib/LoongArch64/SctLibPlat.h create mode 100644 uefi-sct/SctPkg/Library/SctLib/LoongArch64/initplat.c create mode 100644 uefi-sct/SctPkg/SCRT/SCRTApp/LoongArch64/GoVirtual.S create mode 100644 uefi-sct/SctPkg/SCRT/SCRTApp/LoongArch64/VirtualMemory.c create mode 100644 uefi-sct/SctPkg/SCRT/SCRTDriver/LoongArch64/Debug.c create mode 100644 uefi-sct/SctPkg/SCRT/SCRTDriver/LoongArch64/Dump.c create mode 100644 uefi-sct/SctPkg/SCRT/SCRTDriver/LoongArch64/Io.c create mode 100644 uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport= /BlackBoxTest/LoongArch64/DebugSupportBBTestCacheFunction.c create mode 100644 uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport= /BlackBoxTest/LoongArch64/DebugSupportBBTestExceptionCallbackFunction.c create mode 100644 uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport= /BlackBoxTest/LoongArch64/PlatformIsa.c create mode 100644 uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/UsbHc/BlackB= oxTest/LoongArch64/TimerInterrupt.c create mode 100644 uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/E= asLib/LoongArch64/EntsLibPlat.h create mode 100644 uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/E= asLib/LoongArch64/InitPlat.c diff --git a/uefi-sct/SctPkg/Library/SctLib/LoongArch64/SctLibPlat.h b/uefi= -sct/SctPkg/Library/SctLib/LoongArch64/SctLibPlat.h new file mode 100644 index 00000000..553767df --- /dev/null +++ b/uefi-sct/SctPkg/Library/SctLib/LoongArch64/SctLibPlat.h @@ -0,0 +1,32 @@ +/** @file + + Copyright 2006 - 2012 Unified EFI, Inc.
+ Copyright (c) 2022, Loongson Technology Corporation Limited. All rights = reserved.
+ + This program and the accompanying materials + are licensed and made available under the terms and conditions of the BS= D License + which accompanies this distribution. The full text of the license may b= e found at + http://opensource.org/licenses/bsd-license.php + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. + +**/ +/*++ + +Module Name: + + SctLibPlat.h + +Abstract: + + LoongArch64 specific defines + +--*/ + +#ifndef _EFI_LIB_PLAT_H_ +#define _EFI_LIB_PLAT_H_ + +#define MIN_ALIGNMENT_SIZE 8 + +#endif diff --git a/uefi-sct/SctPkg/Library/SctLib/LoongArch64/initplat.c b/uefi-s= ct/SctPkg/Library/SctLib/LoongArch64/initplat.c new file mode 100644 index 00000000..2cfff099 --- /dev/null +++ b/uefi-sct/SctPkg/Library/SctLib/LoongArch64/initplat.c @@ -0,0 +1,45 @@ +/** @file + + Copyright 2006 - 2012 Unified EFI, Inc.
+ Copyright (c) 2022, Loongson Technology Corporation Limited. All rights = reserved.
+ + This program and the accompanying materials + are licensed and made available under the terms and conditions of the BS= D License + which accompanies this distribution. The full text of the license may b= e found at + http://opensource.org/licenses/bsd-license.php + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. + +**/ +/*++ + +Module Name: + + initplat.c + +Abstract: + + Math routines for compatibility with native EFI library routines. + +--*/ + +#include "SctLibInternal.h" + +VOID +InitializeLibPlatform ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) + +{ + // No platform-specific initializations +} + +UINT64 +SctReadTsc ( + VOID + ) +{ + return 0; +} diff --git a/uefi-sct/SctPkg/SCRT/SCRTApp/LoongArch64/GoVirtual.S b/uefi-sc= t/SctPkg/SCRT/SCRTApp/LoongArch64/GoVirtual.S new file mode 100644 index 00000000..b6455024 --- /dev/null +++ b/uefi-sct/SctPkg/SCRT/SCRTApp/LoongArch64/GoVirtual.S @@ -0,0 +1,41 @@ +## @file +# +# Copyright 2010 - 2012 Unified EFI, Inc.
+# Copyright (c) 2022, Loongson Technology Corporation Limited. All rights= reserved.
+# +# This program and the accompanying materials +# are licensed and made available under the terms and conditions of the B= SD License +# which accompanies this distribution. The full text of the license may = be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IM= PLIED. +# +## +# +# +#/*++ +# +# Module Name: +# +# GoVirtual.S +# +#--*/ +#start of the code section + +ASM_GLOBAL ASM_PFX(JumpToTestFunc) + +#-------------------------------------------------------------------------= ----- +# VOID +# JumpToTestFunc ( +# IN UINTN FuncPointer, +# IN UNITN ConfigInfo +# ) +# +ASM_PFX(JumpToTestFunc): + move $ra, $a0 + move $a0, $a1 + + // Jump to Virtual function + jirl $zero, $ra, 0 + .end diff --git a/uefi-sct/SctPkg/SCRT/SCRTApp/LoongArch64/VirtualMemory.c b/uef= i-sct/SctPkg/SCRT/SCRTApp/LoongArch64/VirtualMemory.c new file mode 100644 index 00000000..6ae41a85 --- /dev/null +++ b/uefi-sct/SctPkg/SCRT/SCRTApp/LoongArch64/VirtualMemory.c @@ -0,0 +1,177 @@ +/** @file + + Copyright 2006 - 2012 Unified EFI, Inc.
+ Copyright (c) 2022, Loongson Technology Corporation Limited. All rights = reserved.
+ + This program and the accompanying materials + are licensed and made available under the terms and conditions of the BS= D License + which accompanies this distribution. The full text of the license may b= e found at + http://opensource.org/licenses/bsd-license.php + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. + +**/ +/*++ + +Module Name: + + VirtualMemory.c + +--*/ + +#include "SCRTApp.h" + +UINTN PageTable =3D 0; + + +VOID +ConvertRuntimeFuncPtr ( + IN OUT UINTN *VirtualFunc + ) +/*++ + +Routine Description: + + Change RuntimeTestFunc physical address to virtual address + +Arguments: + + VirtualFunc - On input, RuntimeTestFunc physical address. + On output, RuntimeTest virtual address. + +Returns: + + NONE + +--*/ +{ + /*Note: It is presumed that on LoongArch architecture the MMU is + * configured and enabled in PEI phase. As VirtualFunc is already + * mapped to virtual memory, don't have to do anything here. + */ +} + + +EFI_STATUS +DoMemoryAllocation ( + IN UINTN PhysicalFunc + ) +/*++ + +Routine Description: + + Allocate memory and create the PageTable to set up physical-virtual map. + +Arguments: + + PhysicalFunc - Physical address where RuntimeTestFunc locates. + +Returns: + + EFI_STATUS + +--*/ +{ + EFI_STATUS Status; + EFI_PHYSICAL_ADDRESS AllocateMemory; + + //create new page tables or use existing page tables. + // + // Allocate PageTable memory close to this Application image location in + // the system memory. In this way, it is safe for page table memory. + // + AllocateMemory =3D PhysicalFunc; + + Status =3D tBS->AllocatePages ( + AllocateMaxAddress, + EfiRuntimeServicesData, + 1, + &AllocateMemory + ); + + if (EFI_ERROR(Status)) { + return Status; + } + + PageTable =3D (UINTN)AllocateMemory; + return EFI_SUCCESS; +} + + +VOID +PrepareVirtualAddressMap ( + IN UINTN MemoryMapSize, + IN UINTN DescriptorSize, + IN EFI_MEMORY_DESCRIPTOR *MemoryMap, + IN EFI_MEMORY_DESCRIPTOR *VirtualMemoryMap, + IN OUT UINTN *VirtualMapSize + ) +/*++ + +Routine Description: + + Construct VirtualAddressMap from physical address to virtual address + +Arguments: + + MemoryMapSize - The size, in bytes, of the MemoryMap buffer + DescriptorSize - The size, in bytes, of an individual EFI_MEMORY_DESC= RIPTOR + MemoryMap - A pointer to the current memory map + VirtualMemoryMap - A pointer to the modified virtual memory map + VirtualMapSize - A pointer to the size, in bytes, of the VirtualMemor= yMap buffer + +Returns: + + NONE + +--*/ +{ + UINTN Index; + *VirtualMapSize =3D 0; + + // + // Copy entries that need runtime mapping to construct virtualMemoryMap + // + for (Index =3D 0; Index < (MemoryMapSize / DescriptorSize); Index++) { + if ((MemoryMap->Attribute & EFI_MEMORY_RUNTIME) =3D=3D EFI_MEMORY_RUNT= IME) { + SctCopyMem ((VOID *) VirtualMemoryMap, (VOID *) MemoryMap, Descripto= rSize); + VirtualMemoryMap->VirtualStart =3D VirtualMemoryMap->PhysicalStart; + *VirtualMapSize +=3D DescriptorSize; + VirtualMemoryMap =3D NextMemoryDescriptor (VirtualMemoryMap, Descrip= torSize); + } + + MemoryMap =3D NextMemoryDescriptor (MemoryMap, DescriptorSize); + } +} + + + +VOID +JumpVirtualMode( + IN UINTN VirtualFunc, + IN UINTN HandOffAddr + ) +/*++ + +Routine Description: + + Enable virtual addressing mode, and jump to RuntimeTestFunc in virtual a= ddress + +Arguments: + + VirtualFunc - RuntimeTestFunc virtual address + HandOffAddr - Configuration Data Address + +Returns: + + NONE + +--*/ +{ + // + // Note: It is assumed that the MMU and page tables are configured on Lo= ongArch + // platforms. + // + JumpToTestFunc(VirtualFunc, HandOffAddr); +} diff --git a/uefi-sct/SctPkg/SCRT/SCRTDriver/LoongArch64/Debug.c b/uefi-sct= /SctPkg/SCRT/SCRTDriver/LoongArch64/Debug.c new file mode 100644 index 00000000..b117c456 --- /dev/null +++ b/uefi-sct/SctPkg/SCRT/SCRTDriver/LoongArch64/Debug.c @@ -0,0 +1,81 @@ +/** @file + + Copyright 2006 - 2012 Unified EFI, Inc.
+ Copyright (c) 2011 - 2012 ARM Ltd. All rights reserved.
+ Copyright (c) 2021 Hewlett Packard Enterprise Development LP. All rights= reserved.
+ Copyright (c) 2022, Loongson Technology Corporation Limited. All rights = reserved.
+ + This program and the accompanying materials + are licensed and made available under the terms and conditions of the BS= D License + which accompanies this distribution. The full text of the license may b= e found at + http://opensource.org/licenses/bsd-license.php + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. + +**/ + +/*++ + +Module Name: + + Debug.c + +--*/ + +#include "SCRTDriver.h" + +UINTN mHandOffPtr =3D 0; + + +EFI_STATUS +ConsumeHandOff ( + IN UINTN HandOffAddr, + OUT CONF_INFO *ConfigData + ) +{ + RUNTIME_HANDOFF *HandOffPtr; + // + // First fix the memory address of hand off data. + // + FixAddress(&HandOffAddr); + mHandOffPtr =3D HandOffAddr; + HandOffPtr =3D (RUNTIME_HANDOFF*)mHandOffPtr; + *ConfigData =3D HandOffPtr->ConfigureInfo; + + // + // Fix MmioBase Address. + // + FixAddress(&HandOffPtr->DebuggerInfo.MmioBase); + + return EFI_SUCCESS; +} + + +EFI_STATUS +Send2UART ( + CHAR8 *String + ) +{ + // + // TODO: On LoongArch platforms use platform specific functions to + // write the data to UART. + // + return EFI_SUCCESS; +} + + + +EFI_STATUS +DebugWorker ( + IN CHAR8 *String + ) +{ + EFI_STATUS Status; + + // + // Send text message to registered UART. + // + Status =3D Send2UART(String); + return Status; +} diff --git a/uefi-sct/SctPkg/SCRT/SCRTDriver/LoongArch64/Dump.c b/uefi-sct/= SctPkg/SCRT/SCRTDriver/LoongArch64/Dump.c new file mode 100644 index 00000000..cec73e37 --- /dev/null +++ b/uefi-sct/SctPkg/SCRT/SCRTDriver/LoongArch64/Dump.c @@ -0,0 +1,68 @@ +/** @file + + Copyright 2006 - 2012 Unified EFI, Inc.
+ Copyright (c) 2011 - 2012 ARM Ltd. All rights reserved.
+ + This program and the accompanying materials + are licensed and made available under the terms and conditions of the BS= D License + which accompanies this distribution. The full text of the license may b= e found at + http://opensource.org/licenses/bsd-license.php + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. + +**/ + +/*++ + +Module Name: + + Dump.c + +--*/ + +#include "SCRTDriver.h" + +VOID +DumpRuntimeTable() +{ + Printf ("\n=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3DDump Runtime = Table=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D\n"); + Printf ("Header Signature =3D 0x%x\n", VRT->Hdr.Signature); + + Printf ("\n=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3DGetTime Servi= ce=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D\n"); + Printf ("GetTime @ 0x%x\n", VRT->GetTime); + + Printf ("\n=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3DSetTime Servi= ce=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D\n"); + Printf ("SetTime @ 0x%x\n", VRT->SetTime); + + Printf ("\n=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3DGetWakeupTime= Service=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D\n"); + Printf ("GetWakeupTime @ 0x%x\n", VRT->GetWakeupTime); + + Printf ("\n=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3DSetWakeupTime= Service=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D\n"); + Printf ("SetWakeupTime @ 0x%x\n", VRT->SetWakeupTime); + + Printf ("\n=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3DGetVariable S= ervice=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D\n"); + Printf ("GetVariable @ 0x%x\n", VRT->GetVariable); + + Printf ("\n=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3DGetNextVariab= leName Service=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D\n"); + Printf ("GetNextVariableName @ 0x%x\n", VRT->GetNextVariableName); + + Printf ("\n=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3DSetVariable S= ervice=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D\n"); + Printf ("SetVariable @ 0x%x\n", VRT->SetVariable); + + Printf ("\n=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3DGetNextHighMo= notonicCount Service=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D\n"); + Printf ("GetNextHighMonotonicCount @ 0x%x\n", VRT->GetNextHighMonotonicC= ount); + + Printf ("\n=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3DResetSystem S= ervice=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D\n"); + Printf ("ResetSystem @ 0x%x\n", VRT->ResetSystem); +#if 0 + Printf ("\n=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3DUpdateCapsule= Service=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D\n"); + Printf ("UpdateCapsule @ 0x%x\n", VRT->UpdateCapsule); + + Printf ("\n=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3DQueryCapsuleC= apabilities Service=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D\n"); + Printf ("QueryCapsuleCapabilities @ 0x%x\n", VRT->QueryCapsuleCapabiliti= es); + + Printf ("\n=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3DQueryVariable= Info Service=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D\n"); + Printf ("QueryVariableInfo @ 0x%x\n", VRT->QueryVariableInfo); +#endif +} diff --git a/uefi-sct/SctPkg/SCRT/SCRTDriver/LoongArch64/Io.c b/uefi-sct/Sc= tPkg/SCRT/SCRTDriver/LoongArch64/Io.c new file mode 100644 index 00000000..ce7c271f --- /dev/null +++ b/uefi-sct/SctPkg/SCRT/SCRTDriver/LoongArch64/Io.c @@ -0,0 +1,136 @@ +/** @file + + Copyright 2006 - 2012 Unified EFI, Inc.
+ Copyright (c) 2011 - 2012 ARM Ltd. All rights reserved.
+ (C) Copyright 2021 Hewlett Packard Enterprise Development LP
+ Copyright (c) 2022, Loongson Technology Corporation Limited. All rights = reserved.
+ + This program and the accompanying materials + are licensed and made available under the terms and conditions of the BS= D License + which accompanies this distribution. The full text of the license may b= e found at + http://opensource.org/licenses/bsd-license.php + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. + +**/ + +/*++ + +Module Name: + + Io.c + +--*/ + +#include "SCRTDriver.h" + +EFI_STATUS +EFIAPI +CpuIoServiceWrite ( + IN EFI_PEI_CPU_IO_PPI_WIDTH Width, + IN UINT64 UserAddress, + IN UINTN Count, + IN VOID *UserBuffer + ) +/*++ + +Routine Description: + + Perform the port I/O write service + +Arguments: + + Width - Width of the port I/O operation + Address - Base address of the port I/O operation + Count - Count of the number of accesses to perform + Buffer - Pointer to the source buffer from which to write data + +Returns: + + EFI_SUCCESS - The data was written. + EFI_INVALID_PARAMETER - Width is invalid. + EFI_INVALID_PARAMETER - Buffer is NULL. + EFI_UNSUPPORTED - The Buffer is not aligned for the given Width. + EFI_UNSUPPORTED - The address range specified by Address, Width, + and Count is not valid. + +--*/ +{ + return EFI_UNSUPPORTED; +} + + +EFI_STATUS +EfiIoWrite ( + IN EFI_PEI_CPU_IO_PPI_WIDTH Width, + IN UINT64 Address, + IN UINTN Count, + IN OUT VOID *Buffer + ) +/*++ + +Routine Description: + Perform an IO write into Buffer. + +Arguments: + Width - Width of write transaction, and repeat operation to use + Address - IO address to write + Count - Number of times to write the IO address. + Buffer - Buffer to write data from. size is Width * Count + +Returns: + Status code + +--*/ +{ + return CpuIoServiceWrite(Width, Address, Count, Buffer); +} + + +EFI_STATUS +EfiIoRead ( + IN EFI_PEI_CPU_IO_PPI_WIDTH Width, + IN UINT64 Address, + IN UINTN Count, + IN OUT VOID *Buffer + ) +/*++ + +Routine Description: + Perform an IO read into Buffer. + +Arguments: + Width - Width of read transaction, and repeat operation to use + Address - IO address to read + Count - Number of times to read the IO address. + Buffer - Buffer to read data into. size is Width * Count + +Returns: + Status code + +--*/ +{ + return EFI_UNSUPPORTED; +} + + +VOID +FixAddress ( + IN UINTN *PhyAddress + ) +{ + // + //Note: On LoongArch platforms don't have to do this as all the function= s are virtually mapped. + // +} + +// Quick port to LoongArch. It doesn't have traditional I/O-Port 80h POST = Codes + +VOID +Port80 ( + UINT8 Number + ) +{ + //EFI_SCT_DEBUG ((EFI_SCT_D_ERROR, L"Port80 %02x", Number)); +} diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackB= oxTest/LoongArch64/DebugSupportBBTestCacheFunction.c b/uefi-sct/SctPkg/Test= Case/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/LoongArch64/DebugSupportBB= TestCacheFunction.c new file mode 100644 index 00000000..f2e3e3dc --- /dev/null +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/= LoongArch64/DebugSupportBBTestCacheFunction.c @@ -0,0 +1,136 @@ +/** @file + + Copyright 2006 - 2016 Unified EFI, Inc.
+ Copyright (c) 2011 - 2016, ARM Ltd. All rights reserved.
+ + This program and the accompanying materials + are licensed and made available under the terms and conditions of the BS= D License + which accompanies this distribution. The full text of the license may b= e found at + http://opensource.org/licenses/bsd-license.php + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. + +**/ +/*++ + +Module Name: + + DebugSupportBBTestCacheFunction.c + +Abstract: + + Interface Function Test Cases of Debug Support Protocol + +--*/ + + +#include "DebugSupportBBTestMain.h" + +/** + * Entrypoint for EFI_DEBUG_SUPPORT_PROTOCOL.InvalidateInstructionCache()= Function Test. + * @param This a pointer of EFI_BB_TEST_PROTOCOL. + * @param ClientInterface a pointer to the interface to be tested. + * @param TestLevel test "thoroughness" control. + * @param SupportHandle a handle containing protocols required. + * @return EFI_SUCCESS Finish the test successfully. + */ +// +// TDS 3.5 +// +EFI_STATUS +BBTestInvalidateInstructionCacheFunctionAutoTest ( + IN EFI_BB_TEST_PROTOCOL *This, + IN VOID *ClientInterface, + IN EFI_TEST_LEVEL TestLevel, + IN EFI_HANDLE SupportHandle + ) +{ + EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib; + EFI_STATUS Status; + EFI_DEBUG_SUPPORT_PROTOCOL *DebugSupport; + EFI_TEST_ASSERTION AssertionType; + UINT64 Start; + UINT64 Length; + UINTN MaxProcessorIndex; + UINTN ProcessorIndex; + + // + // Get the Standard Library Interface + // + Status =3D gtBS->HandleProtocol ( + SupportHandle, + &gEfiStandardTestLibraryGuid, + (VOID **) &StandardLib + ); + + if (EFI_ERROR(Status)) { + StandardLib->RecordAssertion ( + StandardLib, + EFI_TEST_ASSERTION_FAILED, + gTestGenericFailureGuid, + L"BS.HandleProtocol - Handle standard test library", + L"%a:%d:Status - %r", + __FILE__, + (UINTN)__LINE__, + Status + ); + return Status; + } + + DebugSupport =3D (EFI_DEBUG_SUPPORT_PROTOCOL *)ClientInterface; + + if (DebugSupport->Isa !=3D PlatformIsa) { + return EFI_SUCCESS; + } + + Status =3D DebugSupport->GetMaximumProcessorIndex (DebugSupport, &MaxPro= cessorIndex); + if (EFI_ERROR(Status)) { + StandardLib->RecordAssertion ( + StandardLib, + EFI_TEST_ASSERTION_FAILED, + gTestGenericFailureGuid, + L"EFI_DEBUG_SUPPORT_PROTOCOL.GetMaximumProcessorIndex", + L"%a:%d:Status - %r", + __FILE__, + (UINTN)__LINE__, + Status + ); + return Status; + } + + for (ProcessorIndex =3D 0; ProcessorIndex <=3D MaxProcessorIndex; Proces= sorIndex++) { + + // + // Assertion Point 3.5.2.1 + // Invoke InvalidateInstructionCache and verify interface correctness. + // + + // The Physical base of the memory range to be invalidated. + Start =3D 0x0; + + // The minimum number of bytes in the processor's instruction cache to= be invalidated. + Length =3D 0x0; + + Status =3D DebugSupport->InvalidateInstructionCache (DebugSupport, Pro= cessorIndex, (VOID*)&Start, Length); + + if (EFI_ERROR(Status)) { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } else { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } + + StandardLib->RecordAssertion ( + StandardLib, + AssertionType, + gDebugSupportBBTestFunctionAssertionGuid015, + L"EFI_DEBUG_SUPPORT_PROTOCOL.InvalidateInstructionCache -= Invoke this function and verify interface correctness", + L"%a:%d:Status - %r", + __FILE__, + (UINTN)__LINE__, + Status + ); + } + + return EFI_SUCCESS; +} diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackB= oxTest/LoongArch64/DebugSupportBBTestExceptionCallbackFunction.c b/uefi-sct= /SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/LoongArch64/De= bugSupportBBTestExceptionCallbackFunction.c new file mode 100644 index 00000000..add7941a --- /dev/null +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/= LoongArch64/DebugSupportBBTestExceptionCallbackFunction.c @@ -0,0 +1,273 @@ +/** @file + + Copyright 2006 - 2016 Unified EFI, Inc.
+ Copyright (c) 2022, Loongson Technology Corporation Limited. All rights = reserved.
+ + This program and the accompanying materials + are licensed and made available under the terms and conditions of the BS= D License + which accompanies this distribution. The full text of the license may b= e found at + http://opensource.org/licenses/bsd-license.php + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. + +**/ +/*++ + +Module Name: + + DebugSupportBBExceptionCallbackFunction.c + +Abstract: + + Interface Function Test Cases of Debug Support Protocol + +--*/ + + +#include "DebugSupportBBTestMain.h" + +extern volatile UINTN InvokedExceptionCallback; +extern volatile UINTN InvokedPeriodicCallback; + +extern EFI_INSTRUCTION_SET_ARCHITECTURE PlatformIsa; + +void +SoftwareBreak ( + void + ) +{ + // Not ported to LoongArch yet + ASSERT (FALSE); +} + +/** + * Entrypoint for EFI_DEBUG_SUPPORT_PROTOCOL.RegisterExceptionCallback() = Function Test. + * @param This a pointer of EFI_BB_TEST_PROTOCOL. + * @param ClientInterface a pointer to the interface to be tested. + * @param TestLevel test "thoroughness" control. + * @param SupportHandle a handle containing protocols required. + * @return EFI_SUCCESS Finish the test successfully. + */ +// +// TDS 3.4 +// +EFI_STATUS +BBTestRegisterExceptionCallbackFunctionManualTest ( + IN EFI_BB_TEST_PROTOCOL *This, + IN VOID *ClientInterface, + IN EFI_TEST_LEVEL TestLevel, + IN EFI_HANDLE SupportHandle + ) +{ + EFI_STANDARD_TEST_LIBRARY_PROTOCOL *StandardLib; + EFI_STATUS Status; + EFI_DEBUG_SUPPORT_PROTOCOL *DebugSupport; + EFI_TEST_ASSERTION AssertionType; + + DebugSupport =3D (EFI_DEBUG_SUPPORT_PROTOCOL *)ClientInterface; + + if (DebugSupport->Isa !=3D PlatformIsa) { + return EFI_SUCCESS; + } + + // + // Get the Standard Library Interface + // + Status =3D gtBS->HandleProtocol ( + SupportHandle, + &gEfiStandardTestLibraryGuid, + (VOID **) &StandardLib + ); + + if (EFI_ERROR(Status)) { + StandardLib->RecordAssertion ( + StandardLib, + EFI_TEST_ASSERTION_FAILED, + gTestGenericFailureGuid, + L"BS.HandleProtocol - Handle standard test library", + L"%a:%d:Status - %r", + __FILE__, + (UINTN)__LINE__, + Status + ); + return Status; + } + + // + // Assertion Point 3.4.2.1 + // Invoke RegisterExceptionCallback() to install an interrupt handler fu= nction. + // + InvokedExceptionCallback =3D FALSE; + Status =3D DebugSupport->RegisterExceptionCallback (DebugSupport, 0, Exc= eptionCallback, EXCEPT_LOONGARCH_BRK); + + if ((Status =3D=3D EFI_SUCCESS) || (Status =3D=3D EFI_ALREADY_STARTED)) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } else { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } + + StandardLib->RecordAssertion ( + StandardLib, + AssertionType, + gDebugSupportBBTestFunctionAssertionGuid009, + L"EFI_DEBUG_SUPPORT_PROTOCOL.RegisterExceptionCallback - = Invoke this function and verify interface correctness", + L"%a:%d:Status - %r", + __FILE__, + (UINTN)__LINE__, + Status + ); + + // + // If the callback function is already registed, return + // + if (EFI_ERROR(Status)) { + return EFI_SUCCESS; + } + + // + // Test the callback function registed. + // + + // + // Call SoftwareBreak to invoke the interrupt handler function. + // + SoftwareBreak (); + + if (InvokedExceptionCallback =3D=3D FALSE) { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } else { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } + + StandardLib->RecordAssertion ( + StandardLib, + AssertionType, + gDebugSupportBBTestFunctionAssertionGuid010, + L"EFI_DEBUG_SUPPORT_PROTOCOL.RegisterExceptionCallback - = Verify the callback function was invoked.", + L"%a:%d:Status - %r", + __FILE__, + (UINTN)__LINE__, + Status + ); + + // + // Assertion Point 3.4.2.2 + // Invoke RegisterPeriodicCallback() to install the Periodic interrupt h= andler function. + // Verify the two callback functions can be both invoked. + // + InvokedExceptionCallback =3D FALSE; + InvokedPeriodicCallback =3D FALSE; + + Status =3D DebugSupport->RegisterPeriodicCallback (DebugSupport, 0, Peri= odicCallback); + if (EFI_ERROR(Status)) { + return Status; + } + + // + // Wait the PeriodicCallback to be invoked. + // + gtBS->Stall (500000); + + // + // Call SoftwareBreak to invoke the interrupt handler function. + // + SoftwareBreak (); + + if ((InvokedExceptionCallback =3D=3D TRUE) && (InvokedPeriodicCallback = =3D=3D TRUE)) { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } else { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } + + StandardLib->RecordAssertion ( + StandardLib, + AssertionType, + gDebugSupportBBTestFunctionAssertionGuid011, + L"EFI_DEBUG_SUPPORT_PROTOCOL.RegisterExceptionCallback - = Verify the two callback functions can be both invoked.", + L"%a:%d:Status - %r", + __FILE__, + (UINTN)__LINE__, + Status + ); + + // + // Uninstall the Periodic callback function. + // + Status =3D DebugSupport->RegisterPeriodicCallback (DebugSupport, 0, NULL= ); + if (EFI_ERROR(Status)) { + return Status; + } + + // + // Assertion Point 3.4.2.3 + // Invoke RegisterExceptionCallback() to install another interrupt handl= er function. + // + Status =3D DebugSupport->RegisterExceptionCallback (DebugSupport, 0, Exc= eptionCallback1, EXCEPT_LOONGARCH_BRK); + + if (Status !=3D EFI_ALREADY_STARTED) { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } else { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } + + StandardLib->RecordAssertion ( + StandardLib, + AssertionType, + gDebugSupportBBTestFunctionAssertionGuid012, + L"EFI_DEBUG_SUPPORT_PROTOCOL.RegisterExceptionCallback - = Register another callback function.", + L"%a:%d:Status - %r", + __FILE__, + (UINTN)__LINE__, + Status + ); + + // + // Assertion Point 3.4.2.4 + // Invoke RegisterExceptionCallback() to unstall the interrupt handler f= unction. + // + Status =3D DebugSupport->RegisterExceptionCallback (DebugSupport, 0, NUL= L, EXCEPT_LOONGARCH_BRK); + + if (EFI_ERROR(Status)) { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } else { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } + + StandardLib->RecordAssertion ( + StandardLib, + AssertionType, + gDebugSupportBBTestFunctionAssertionGuid013, + L"EFI_DEBUG_SUPPORT_PROTOCOL.RegisterExceptionCallback - = Invoke this function to uninstall the interrupt handler function", + L"%a:%d:Status - %r", + __FILE__, + (UINTN)__LINE__, + Status + ); + + InvokedExceptionCallback =3D FALSE; + + // + // Call SoftwareBreak to invoke the interrupt handler function. + // + SoftwareBreak (); + + if (InvokedExceptionCallback !=3D FALSE) { + AssertionType =3D EFI_TEST_ASSERTION_FAILED; + } else { + AssertionType =3D EFI_TEST_ASSERTION_PASSED; + } + + StandardLib->RecordAssertion ( + StandardLib, + AssertionType, + gDebugSupportBBTestFunctionAssertionGuid014, + L"EFI_DEBUG_SUPPORT_PROTOCOL.RegisterExceptionCallback - = Verify the callback function wasn't invoked", + L"%a:%d:Status - %r", + __FILE__, + (UINTN)__LINE__, + Status + ); + + return EFI_SUCCESS; +} diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackB= oxTest/LoongArch64/PlatformIsa.c b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protoc= ol/DebugSupport/BlackBoxTest/LoongArch64/PlatformIsa.c new file mode 100644 index 00000000..ca61cbe4 --- /dev/null +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/= LoongArch64/PlatformIsa.c @@ -0,0 +1,29 @@ +/** @file + + Copyright 2006 - 2012 Unified EFI, Inc.
+ Copyright (c) 2022, Loongson Technology Corporation Limited. All rights = reserved.
+ + This program and the accompanying materials + are licensed and made available under the terms and conditions of the BS= D License + which accompanies this distribution. The full text of the license may b= e found at + http://opensource.org/licenses/bsd-license.php + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. + +**/ +/*++ + +Module Name: + + PlatformIsa.c + +Abstract: + + Platform related Isa definition. + +--*/ + +#include "DebugSupportBBTestMain.h" + +EFI_INSTRUCTION_SET_ARCHITECTURE PlatformIsa =3D IsaLoongArch64; diff --git a/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/UsbHc/BlackBoxTest/= LoongArch64/TimerInterrupt.c b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/U= sbHc/BlackBoxTest/LoongArch64/TimerInterrupt.c new file mode 100644 index 00000000..39701257 --- /dev/null +++ b/uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/UsbHc/BlackBoxTest/LoongAr= ch64/TimerInterrupt.c @@ -0,0 +1,38 @@ +/** @file + + Copyright 2006 - 2010 Unified EFI, Inc.
+ Copyright (c) 2010, Intel Corporation. All rights reserved.
+ Copyright (c) 2022, Loongson Technology Corporation Limited. All rights = reserved.
+ + This program and the accompanying materials + are licensed and made available under the terms and conditions of the BS= D License + which accompanies this distribution. The full text of the license may b= e found at + http://opensource.org/licenses/bsd-license.php + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. + +**/ +/*++ + +Module Name: + TimerInterrupt.c + +Abstract: + Ipf Source file for Mask/Unmask TimerInterrupt. + +--*/ + +#include "UsbHcTest.h" + +VOID MaskTimerInterrupt() +{ + // TBD + return; +} + +VOID UnmaskTimerInterrupt() +{ + // TBD + return; +} diff --git a/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/L= oongArch64/EntsLibPlat.h b/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework= /ENTS/EasLib/LoongArch64/EntsLibPlat.h new file mode 100644 index 00000000..3762eb15 --- /dev/null +++ b/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/LoongArc= h64/EntsLibPlat.h @@ -0,0 +1,56 @@ +/** @file + + Copyright 2006 - 2012 Unified EFI, Inc.
+ Copyright (c) 2010 - 2012, ARM Ltd. All rights reserved.
+ Copyright (c) 2021 Hewlett Packard Enterprise Development LP. All rights= reserved.
+ + This program and the accompanying materials + are licensed and made available under the terms and conditions of the BS= D License + which accompanies this distribution. The full text of the license may b= e found at + http://opensource.org/licenses/bsd-license.php + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. + +**/ +/*++ + +Module Name: + + EntsLibPlat.h + +Abstract: + + LoongArch64 specific defines + +--*/ + +#ifndef _EFI_LIB_PLAT_H_ +#define _EFI_LIB_PLAT_H_ + +#define MIN_ALIGNMENT_SIZE 8 + +VOID +EntsInitializeLibPlatform ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +/*++ + +Routine Description: + + Initialize platform. + +Arguments: + + ImageHandle - The image handle. + SystemTable - The system table. + +Returns: + + None. + +--*/ +; + +#endif diff --git a/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/L= oongArch64/InitPlat.c b/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/EN= TS/EasLib/LoongArch64/InitPlat.c new file mode 100644 index 00000000..360e3296 --- /dev/null +++ b/uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/LoongArc= h64/InitPlat.c @@ -0,0 +1,55 @@ +/** @file + + Copyright 2006 - 2012 Unified EFI, Inc.
+ Copyright (c) 2010 - 2012, ARM Ltd. All rights reserved.
+ + This program and the accompanying materials + are licensed and made available under the terms and conditions of the BS= D License + which accompanies this distribution. The full text of the license may b= e found at + http://opensource.org/licenses/bsd-license.php + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, + WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMP= LIED. + +**/ +/*++ + +Module Name: + + InitPlat.c + +Abstract: + + Math routines for compatibility with native EFI library routines. + +--*/ + +#include "Efi.h" +#include "EntsLibPlat.h" + +VOID +EntsInitializeLibPlatform ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +/*++ + +Routine Description: + + Initialize platform. + +Arguments: + + ImageHandle - The image handle. + SystemTable - The system table. + +Returns: + + None. + +--*/ +{ + // + // No platform-specific initializations + // +} --=20 2.27.0 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#97358): https://edk2.groups.io/g/devel/message/97358 Mute This Topic: https://groups.io/mt/95662761/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-