From nobody Mon Feb 9 21:19:58 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+102593+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+102593+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1680758808; cv=none; d=zohomail.com; s=zohoarc; b=mu/9WiTVequYCHg1rH7sQfwvxEaVFzuoM9ugF8rFNwZokL9gzT5uhXGM5T+sS15zK7nldNfD1cM7Nh4GnRBZSo8qdMUrTpUvUMPqonaRdZvTE8KVOE5MsnWf9l9uBFRd6M1WxwcF1/0iZQScIXj/psykJ3sgOLyYogONim9gJV4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1680758808; 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=4CefYAzgTe9oRoisUImxiTniBzF3E9ZZr7PV3l3+oTw=; b=hi/7BE5BHGfgrvWnRm1ZJlCMazEuP9/OI9y7QEADcRg3GDRp1HtylXCEfTFFkPLvpmHV3RH6WFJsGXpbDufAxeGp30NlrbuvR/2jdreo324OaiYHMwF40dpYCBKsm+dPJW9P/Cbs/hmQRYaUItowp2i+ty8ityoRIX6hps48Zxw= 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+102593+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1680758807994328.02729885168014; Wed, 5 Apr 2023 22:26:47 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id x5DMYY1788612xGGchKMKswJ; Wed, 05 Apr 2023 22:26:47 -0700 X-Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mx.groups.io with SMTP id smtpd.web11.151668.1680758805559034414 for ; Wed, 05 Apr 2023 22:26:46 -0700 X-IronPort-AV: E=McAfee;i="6600,9927,10671"; a="323020607" X-IronPort-AV: E=Sophos;i="5.98,322,1673942400"; d="scan'208";a="323020607" X-Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Apr 2023 22:26:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10671"; a="776324949" X-IronPort-AV: E=Sophos;i="5.98,322,1673942400"; d="scan'208";a="776324949" X-Received: from evancy.sh.intel.com ([10.239.158.113]) by FMSMGA003.fm.intel.com with ESMTP; 05 Apr 2023 22:26:37 -0700 From: "Chai, Evan" To: devel@edk2.groups.io Cc: Daniel Schaefer , Sunil V L , Andrei Warkentin Subject: [edk2-devel] [edk2-platforms][PATCH 1/5] Silicon/RISC-V/ProcessorPkg: remove redundant CpuDxe driver Date: Thu, 6 Apr 2023 13:24:19 +0800 Message-Id: <20230406052423.378702-2-evan.chai@intel.com> In-Reply-To: <20230406052423.378702-1-evan.chai@intel.com> References: <20230406052423.378702-1-evan.chai@intel.com> MIME-Version: 1.0 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,evan.chai@intel.com X-Gm-Message-State: 1Sh7p5rqnDVpXVhTJTOpV1VIx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1680758807; bh=XTKq/1BOyxFCMBrk132Eq/7NGkIpcB97tgt2zswyRHI=; h=Cc:Date:From:Reply-To:Subject:To; b=BAvcIHQqIh5AeP8KdoRKaWVqJ96xmHTV/avN1Uxb/lJ8UPr272wo/SXCB+cZeNyELLn 4pinDcMUwIt/+TyGTMZzKNq3VtUPOP7QxAF0a8Wn2uIA5N6RHl/km8OrOUv8+q4mx7uGn bD6LXsfJu5GfMhs2qYctGdEWCbLJ2J+UXV8= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1680758809743100013 Content-Type: text/plain; charset="utf-8" UefiCpuPkg/CpuDxeRiscV64 will replace it later. Cc: Daniel Schaefer Cc: Sunil V L Cc: Andrei Warkentin Signed-off-by: Evan Chai --- Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc | 2= +- Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf | 2= +- Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc | 2= +- Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf | 2= +- Silicon/RISC-V/ProcessorPkg/Universal/CpuDxe/CpuDxe.c | 310= --------------------------------------------------------------------------= ---------------------------------------------------------------------------= ---------------------------------------------------------------------------= ---------------------------------------------------------------------------= ----------- Silicon/RISC-V/ProcessorPkg/Universal/CpuDxe/CpuDxe.h | 198= --------------------------------------------------------------------------= ---------------------------------------------------------------------------= ------------------------------------------------- Silicon/RISC-V/ProcessorPkg/Universal/CpuDxe/CpuDxe.inf | 49= ------------------------------------------------- Silicon/RISC-V/ProcessorPkg/Universal/CpuDxe/CpuDxe.uni | 13= ------------- Silicon/RISC-V/ProcessorPkg/Universal/CpuDxe/CpuDxeExtra.uni | 14= -------------- 9 files changed, 4 insertions(+), 588 deletions(-) diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc b/P= latform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc index fc1ed012..efcfdd35 100644 --- a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc +++ b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc @@ -466,7 +466,7 @@ # # RISC-V Core module # - Silicon/RISC-V/ProcessorPkg/Universal/CpuDxe/CpuDxe.inf + UefiCpuPkg/CpuDxeRiscV64/CpuDxeRiscV64.inf Silicon/RISC-V/ProcessorPkg/Universal/SmbiosDxe/RiscVSmbiosDxe.inf MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.inf =20 diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf b/P= latform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf index 4ce19279..da4d3379 100644 --- a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf +++ b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf @@ -151,7 +151,7 @@ INF Platform/SiFive/U5SeriesPkg/Universal/Dxe/RamFvbSe= rvicesRuntimeDxe/FvbServi =20 # RISC-V Core Drivers INF Platform/SiFive/U5SeriesPkg/Universal/Dxe/TimerDxe/TimerDxe.inf -INF Silicon/RISC-V/ProcessorPkg/Universal/CpuDxe/CpuDxe.inf +INF UefiCpuPkg/CpuDxeRiscV64/CpuDxeRiscV64.inf INF Silicon/RISC-V/ProcessorPkg/Universal/SmbiosDxe/RiscVSmbiosDxe.inf =20 INF MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U5= 40.dsc b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.d= sc index e59955d0..d92f8166 100644 --- a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc +++ b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc @@ -465,7 +465,7 @@ # # RISC-V Core module # - Silicon/RISC-V/ProcessorPkg/Universal/CpuDxe/CpuDxe.inf + UefiCpuPkg/CpuDxeRiscV64/CpuDxeRiscV64.inf Silicon/RISC-V/ProcessorPkg/Universal/SmbiosDxe/RiscVSmbiosDxe.inf MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.inf =20 diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U5= 40.fdf b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.f= df index c58fa635..237ed74a 100644 --- a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf +++ b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf @@ -151,7 +151,7 @@ INF Platform/SiFive/U5SeriesPkg/Universal/Dxe/RamFvbSe= rvicesRuntimeDxe/FvbServi =20 # RISC-V Core Drivers INF Platform/SiFive/U5SeriesPkg/Universal/Dxe/TimerDxe/TimerDxe.inf -INF Silicon/RISC-V/ProcessorPkg/Universal/CpuDxe/CpuDxe.inf +INF UefiCpuPkg/CpuDxeRiscV64/CpuDxeRiscV64.inf INF Silicon/RISC-V/ProcessorPkg/Universal/SmbiosDxe/RiscVSmbiosDxe.inf =20 INF MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf diff --git a/Silicon/RISC-V/ProcessorPkg/Universal/CpuDxe/CpuDxe.c b/Silico= n/RISC-V/ProcessorPkg/Universal/CpuDxe/CpuDxe.c deleted file mode 100644 index 8d4d406e..00000000 --- a/Silicon/RISC-V/ProcessorPkg/Universal/CpuDxe/CpuDxe.c +++ /dev/null @@ -1,310 +0,0 @@ -/** @file - RISC-V CPU DXE driver. - - Copyright (c) 2016 - 2022, Hewlett Packard Enterprise Development LP. Al= l rights reserved.
- - SPDX-License-Identifier: BSD-2-Clause-Patent - -**/ - -#include "CpuDxe.h" - -// -// Global Variables -// -STATIC BOOLEAN mInterruptState =3D FALSE; -STATIC EFI_HANDLE mCpuHandle =3D NULL; - -EFI_CPU_ARCH_PROTOCOL gCpu =3D { - CpuFlushCpuDataCache, - CpuEnableInterrupt, - CpuDisableInterrupt, - CpuGetInterruptState, - CpuInit, - CpuRegisterInterruptHandler, - CpuGetTimerValue, - CpuSetMemoryAttributes, - 1, // NumberOfTimers - 4 // DmaBufferAlignment -}; - -// -// CPU Arch Protocol Functions -// - -/** - Flush CPU data cache. If the instruction cache is fully coherent - with all DMA operations then function can just return EFI_SUCCESS. - - @param This Protocol instance structure - @param Start Physical address to start flushing from. - @param Length Number of bytes to flush. Round up to chipset - granularity. - @param FlushType Specifies the type of flush operation to perfo= rm. - - @retval EFI_SUCCESS If cache was flushed - @retval EFI_UNSUPPORTED If flush type is not supported. - @retval EFI_DEVICE_ERROR If requested range could not be flushed. - -**/ -EFI_STATUS -EFIAPI -CpuFlushCpuDataCache ( - IN EFI_CPU_ARCH_PROTOCOL *This, - IN EFI_PHYSICAL_ADDRESS Start, - IN UINT64 Length, - IN EFI_CPU_FLUSH_TYPE FlushType - ) -{ - return EFI_SUCCESS; -} - -/** - Enables CPU interrupts. - - @param This Protocol instance structure - - @retval EFI_SUCCESS If interrupts were enabled in the CPU - @retval EFI_DEVICE_ERROR If interrupts could not be enabled on the CPU. - -**/ -EFI_STATUS -EFIAPI -CpuEnableInterrupt ( - IN EFI_CPU_ARCH_PROTOCOL *This - ) -{ - EnableInterrupts (); - mInterruptState =3D TRUE; - return EFI_SUCCESS; -} - -/** - Disables CPU interrupts. - - @param This Protocol instance structure - - @retval EFI_SUCCESS If interrupts were disabled in the CPU. - @retval EFI_DEVICE_ERROR If interrupts could not be disabled on the CPU. - -**/ -EFI_STATUS -EFIAPI -CpuDisableInterrupt ( - IN EFI_CPU_ARCH_PROTOCOL *This - ) -{ - DisableInterrupts (); - mInterruptState =3D FALSE; - return EFI_SUCCESS; -} - -/** - Return the state of interrupts. - - @param This Protocol instance structure - @param State Pointer to the CPU's current interrupt st= ate - - @retval EFI_SUCCESS If interrupts were disabled in the CPU. - @retval EFI_INVALID_PARAMETER State is NULL. - -**/ -EFI_STATUS -EFIAPI -CpuGetInterruptState ( - IN EFI_CPU_ARCH_PROTOCOL *This, - OUT BOOLEAN *State - ) -{ - if (State =3D=3D NULL) { - return EFI_INVALID_PARAMETER; - } - - *State =3D mInterruptState; - return EFI_SUCCESS; -} - -/** - Generates an INIT to the CPU. - - @param This Protocol instance structure - @param InitType Type of CPU INIT to perform - - @retval EFI_SUCCESS If CPU INIT occurred. This value should never = be - seen. - @retval EFI_DEVICE_ERROR If CPU INIT failed. - @retval EFI_UNSUPPORTED Requested type of CPU INIT not supported. - -**/ -EFI_STATUS -EFIAPI -CpuInit ( - IN EFI_CPU_ARCH_PROTOCOL *This, - IN EFI_CPU_INIT_TYPE InitType - ) -{ - return EFI_UNSUPPORTED; -} - -/** - Registers a function to be called from the CPU interrupt handler. - - @param This Protocol instance structure - @param InterruptType Defines which interrupt to hook. IA-32 - valid range is 0x00 through 0xFF - @param InterruptHandler A pointer to a function of type - EFI_CPU_INTERRUPT_HANDLER that is called - when a processor interrupt occurs. A null - pointer is an error condition. - - @retval EFI_SUCCESS If handler installed or uninstalled. - @retval EFI_ALREADY_STARTED InterruptHandler is not NULL, and a handl= er - for InterruptType was previously installe= d. - @retval EFI_INVALID_PARAMETER InterruptHandler is NULL, and a handler f= or - InterruptType was not previously installe= d. - @retval EFI_UNSUPPORTED The interrupt specified by InterruptType - is not supported. - -**/ -EFI_STATUS -EFIAPI -CpuRegisterInterruptHandler ( - IN EFI_CPU_ARCH_PROTOCOL *This, - IN EFI_EXCEPTION_TYPE InterruptType, - IN EFI_CPU_INTERRUPT_HANDLER InterruptHandler - ) -{ - return RegisterCpuInterruptHandler (InterruptType, InterruptHandler); -} - -/** - Returns a timer value from one of the CPU's internal timers. There is no - inherent time interval between ticks but is a function of the CPU freque= ncy. - - @param This - Protocol instance structure. - @param TimerIndex - Specifies which CPU timer is requested. - @param TimerValue - Pointer to the returned timer value. - @param TimerPeriod - A pointer to the amount of time that passes - in femtoseconds (10-15) for each increment - of TimerValue. If TimerValue does not - increment at a predictable rate, then 0 is - returned. The amount of time that has - passed between two calls to GetTimerValue() - can be calculated with the formula - (TimerValue2 - TimerValue1) * TimerPeriod. - This parameter is optional and may be NULL. - - @retval EFI_SUCCESS - If the CPU timer count was returned. - @retval EFI_UNSUPPORTED - If the CPU does not have any readable ti= mers. - @retval EFI_DEVICE_ERROR - If an error occurred while reading the t= imer. - @retval EFI_INVALID_PARAMETER - TimerIndex is not valid or TimerValue is= NULL. - -**/ -EFI_STATUS -EFIAPI -CpuGetTimerValue ( - IN EFI_CPU_ARCH_PROTOCOL *This, - IN UINT32 TimerIndex, - OUT UINT64 *TimerValue, - OUT UINT64 *TimerPeriod OPTIONAL - ) -{ - if (TimerValue =3D=3D NULL) { - return EFI_INVALID_PARAMETER; - } - - if (TimerIndex !=3D 0) { - return EFI_INVALID_PARAMETER; - } - - *TimerValue =3D (UINT64)RiscVReadMachineTimerInterface (); - if (TimerPeriod !=3D NULL) { - *TimerPeriod =3D DivU64x32 ( - 1000000000000000u, - PcdGet64 (PcdRiscVMachineTimerFrequencyInHerz) - ); - } - - return EFI_SUCCESS; -} - -/** - Implementation of SetMemoryAttributes() service of CPU Architecture Prot= ocol. - - This function modifies the attributes for the memory region specified by= BaseAddress and - Length from their current attributes to the attributes specified by Attr= ibutes. - - @param This The EFI_CPU_ARCH_PROTOCOL instance. - @param BaseAddress The physical address that is the start address = of a memory region. - @param Length The size in bytes of the memory region. - @param Attributes The bit mask of attributes to set for the memor= y region. - - @retval EFI_SUCCESS The attributes were set for the memory reg= ion. - @retval EFI_ACCESS_DENIED The attributes for the memory resource ran= ge specified by - BaseAddress and Length cannot be modified. - @retval EFI_INVALID_PARAMETER Length is zero. - Attributes specified an illegal combinatio= n of attributes that - cannot be set together. - @retval EFI_OUT_OF_RESOURCES There are not enough system resources to m= odify the attributes of - the memory resource range. - @retval EFI_UNSUPPORTED The processor does not support one or more= bytes of the memory - resource range specified by BaseAddress an= d Length. - The bit mask of attributes is not support = for the memory resource - range specified by BaseAddress and Length. - -**/ -EFI_STATUS -EFIAPI -CpuSetMemoryAttributes ( - IN EFI_CPU_ARCH_PROTOCOL *This, - IN EFI_PHYSICAL_ADDRESS BaseAddress, - IN UINT64 Length, - IN UINT64 Attributes - ) -{ - DEBUG ((DEBUG_INFO, "%a: Set memory attributes not supported yet\n", __F= UNCTION__)); - return EFI_SUCCESS; -} - -/** - Initialize the state information for the CPU Architectural Protocol. - - @param ImageHandle Image handle this driver. - @param SystemTable Pointer to the System Table. - - @retval EFI_SUCCESS Thread can be successfully created - @retval EFI_OUT_OF_RESOURCES Cannot allocate protocol data structure - @retval EFI_DEVICE_ERROR Cannot create the thread - -**/ -EFI_STATUS -EFIAPI -InitializeCpu ( - IN EFI_HANDLE ImageHandle, - IN EFI_SYSTEM_TABLE *SystemTable - ) -{ - EFI_STATUS Status; - - // - // Machine mode handler is initiated in CpuExceptionHandlerLibConstructo= r in - // CpuExecptionHandlerLib. - // - - // - // Make sure interrupts are disabled - // - DisableInterrupts (); - - // - // Install CPU Architectural Protocol - // - Status =3D gBS->InstallMultipleProtocolInterfaces ( - &mCpuHandle, - &gEfiCpuArchProtocolGuid, - &gCpu, - NULL - ); - ASSERT_EFI_ERROR (Status); - return Status; -} diff --git a/Silicon/RISC-V/ProcessorPkg/Universal/CpuDxe/CpuDxe.h b/Silico= n/RISC-V/ProcessorPkg/Universal/CpuDxe/CpuDxe.h deleted file mode 100644 index 9d70d7b6..00000000 --- a/Silicon/RISC-V/ProcessorPkg/Universal/CpuDxe/CpuDxe.h +++ /dev/null @@ -1,198 +0,0 @@ -/** @file - RISC-V CPU DXE module header file. - - Copyright (c) 2016 - 2022, Hewlett Packard Enterprise Development LP. Al= l rights reserved.
- - SPDX-License-Identifier: BSD-2-Clause-Patent - -**/ - -#ifndef CPU_DXE_H_ -#define CPU_DXE_H_ - -#include - -#include -#include -#include -#include -#include -#include -#include - -/** - Flush CPU data cache. If the instruction cache is fully coherent - with all DMA operations then function can just return EFI_SUCCESS. - - @param This Protocol instance structure - @param Start Physical address to start flushing from. - @param Length Number of bytes to flush. Round up to chipset - granularity. - @param FlushType Specifies the type of flush operation to perfo= rm. - - @retval EFI_SUCCESS If cache was flushed - @retval EFI_UNSUPPORTED If flush type is not supported. - @retval EFI_DEVICE_ERROR If requested range could not be flushed. - -**/ -EFI_STATUS -EFIAPI -CpuFlushCpuDataCache ( - IN EFI_CPU_ARCH_PROTOCOL *This, - IN EFI_PHYSICAL_ADDRESS Start, - IN UINT64 Length, - IN EFI_CPU_FLUSH_TYPE FlushType - ); - -/** - Enables CPU interrupts. - - @param This Protocol instance structure - - @retval EFI_SUCCESS If interrupts were enabled in the CPU - @retval EFI_DEVICE_ERROR If interrupts could not be enabled on the CPU. - -**/ -EFI_STATUS -EFIAPI -CpuEnableInterrupt ( - IN EFI_CPU_ARCH_PROTOCOL *This - ); - -/** - Disables CPU interrupts. - - @param This Protocol instance structure - - @retval EFI_SUCCESS If interrupts were disabled in the CPU. - @retval EFI_DEVICE_ERROR If interrupts could not be disabled on the CPU. - -**/ -EFI_STATUS -EFIAPI -CpuDisableInterrupt ( - IN EFI_CPU_ARCH_PROTOCOL *This - ); - -/** - Return the state of interrupts. - - @param This Protocol instance structure - @param State Pointer to the CPU's current interrupt st= ate - - @retval EFI_SUCCESS If interrupts were disabled in the CPU. - @retval EFI_INVALID_PARAMETER State is NULL. - -**/ -EFI_STATUS -EFIAPI -CpuGetInterruptState ( - IN EFI_CPU_ARCH_PROTOCOL *This, - OUT BOOLEAN *State - ); - -/** - Generates an INIT to the CPU. - - @param This Protocol instance structure - @param InitType Type of CPU INIT to perform - - @retval EFI_SUCCESS If CPU INIT occurred. This value should never = be - seen. - @retval EFI_DEVICE_ERROR If CPU INIT failed. - @retval EFI_UNSUPPORTED Requested type of CPU INIT not supported. - -**/ -EFI_STATUS -EFIAPI -CpuInit ( - IN EFI_CPU_ARCH_PROTOCOL *This, - IN EFI_CPU_INIT_TYPE InitType - ); - -/** - Registers a function to be called from the CPU interrupt handler. - - @param This Protocol instance structure - @param InterruptType Defines which interrupt to hook. IA-32 - valid range is 0x00 through 0xFF - @param InterruptHandler A pointer to a function of type - EFI_CPU_INTERRUPT_HANDLER that is called - when a processor interrupt occurs. A null - pointer is an error condition. - - @retval EFI_SUCCESS If handler installed or uninstalled. - @retval EFI_ALREADY_STARTED InterruptHandler is not NULL, and a handl= er - for InterruptType was previously installe= d. - @retval EFI_INVALID_PARAMETER InterruptHandler is NULL, and a handler f= or - InterruptType was not previously installe= d. - @retval EFI_UNSUPPORTED The interrupt specified by InterruptType - is not supported. - -**/ -EFI_STATUS -EFIAPI -CpuRegisterInterruptHandler ( - IN EFI_CPU_ARCH_PROTOCOL *This, - IN EFI_EXCEPTION_TYPE InterruptType, - IN EFI_CPU_INTERRUPT_HANDLER InterruptHandler - ); - -/** - Returns a timer value from one of the CPU's internal timers. There is no - inherent time interval between ticks but is a function of the CPU freque= ncy. - - @param This - Protocol instance structure. - @param TimerIndex - Specifies which CPU timer is requested. - @param TimerValue - Pointer to the returned timer value. - @param TimerPeriod - A pointer to the amount of time that passes - in femtoseconds (10-15) for each increment - of TimerValue. If TimerValue does not - increment at a predictable rate, then 0 is - returned. The amount of time that has - passed between two calls to GetTimerValue() - can be calculated with the formula - (TimerValue2 - TimerValue1) * TimerPeriod. - This parameter is optional and may be NULL. - - @retval EFI_SUCCESS - If the CPU timer count was returned. - @retval EFI_UNSUPPORTED - If the CPU does not have any readable ti= mers. - @retval EFI_DEVICE_ERROR - If an error occurred while reading the t= imer. - @retval EFI_INVALID_PARAMETER - TimerIndex is not valid or TimerValue is= NULL. - -**/ -EFI_STATUS -EFIAPI -CpuGetTimerValue ( - IN EFI_CPU_ARCH_PROTOCOL *This, - IN UINT32 TimerIndex, - OUT UINT64 *TimerValue, - OUT UINT64 *TimerPeriod OPTIONAL - ); - -/** - Set memory cacheability attributes for given range of memeory. - - @param This Protocol instance structure - @param BaseAddress Specifies the start address of the - memory range - @param Length Specifies the length of the memory range - @param Attributes The memory cacheability for the memory ra= nge - - @retval EFI_SUCCESS If the cacheability of that memory range = is - set successfully - @retval EFI_UNSUPPORTED If the desired operation cannot be done - @retval EFI_INVALID_PARAMETER The input parameter is not correct, - such as Length =3D 0 - -**/ -EFI_STATUS -EFIAPI -CpuSetMemoryAttributes ( - IN EFI_CPU_ARCH_PROTOCOL *This, - IN EFI_PHYSICAL_ADDRESS BaseAddress, - IN UINT64 Length, - IN UINT64 Attributes - ); - -#endif diff --git a/Silicon/RISC-V/ProcessorPkg/Universal/CpuDxe/CpuDxe.inf b/Sili= con/RISC-V/ProcessorPkg/Universal/CpuDxe/CpuDxe.inf deleted file mode 100644 index a422c12e..00000000 --- a/Silicon/RISC-V/ProcessorPkg/Universal/CpuDxe/CpuDxe.inf +++ /dev/null @@ -1,49 +0,0 @@ -## @file -# RISC-V CPU DXE module. -# -# Copyright (c) 2016 - 2019, Hewlett Packard Enterprise Development LP. A= ll rights reserved.
-# SPDX-License-Identifier: BSD-2-Clause-Patent -# -## - -[Defines] - INF_VERSION =3D 0x0001001b - BASE_NAME =3D CpuDxe - MODULE_UNI_FILE =3D CpuDxe.uni - FILE_GUID =3D 2AEB1f3E-5B6B-441B-92C1-4A9E6FC85E92 - MODULE_TYPE =3D DXE_DRIVER - VERSION_STRING =3D 1.0 - - ENTRY_POINT =3D InitializeCpu - -[Packages] - MdeModulePkg/MdeModulePkg.dec - MdePkg/MdePkg.dec - Silicon/RISC-V/ProcessorPkg/RiscVProcessorPkg.dec - -[LibraryClasses] - BaseLib - CpuLib - CpuExceptionHandlerLib - DebugLib - MachineModeTimerLib - RiscVCpuLib - TimerLib - UefiBootServicesTableLib - UefiDriverEntryPoint - -[Sources] - CpuDxe.c - CpuDxe.h - -[Protocols] - gEfiCpuArchProtocolGuid ## PRODUCES - -[Pcd] - gUefiRiscVPkgTokenSpaceGuid.PcdRiscVMachineTimerFrequencyInHerz - -[Depex] - TRUE - -[UserExtensions.TianoCore."ExtraFiles"] - CpuDxeExtra.uni diff --git a/Silicon/RISC-V/ProcessorPkg/Universal/CpuDxe/CpuDxe.uni b/Sili= con/RISC-V/ProcessorPkg/Universal/CpuDxe/CpuDxe.uni deleted file mode 100644 index 460141a1..00000000 --- a/Silicon/RISC-V/ProcessorPkg/Universal/CpuDxe/CpuDxe.uni +++ /dev/null @@ -1,13 +0,0 @@ -// /** @file -// -// Copyright (c) 2016 - 2019, Hewlett Packard Enterprise Development LP. A= ll rights reserved.
-// -// SPDX-License-Identifier: BSD-2-Clause-Patent -// -// **/ - - -#string STR_MODULE_ABSTRACT #language en-US "Installs RISC-V C= PU Architecture Protocol" - -#string STR_MODULE_DESCRIPTION #language en-US "RISC-V CPU driver= installs CPU Architecture Protocol." - diff --git a/Silicon/RISC-V/ProcessorPkg/Universal/CpuDxe/CpuDxeExtra.uni b= /Silicon/RISC-V/ProcessorPkg/Universal/CpuDxe/CpuDxeExtra.uni deleted file mode 100644 index 6f819f06..00000000 --- a/Silicon/RISC-V/ProcessorPkg/Universal/CpuDxe/CpuDxeExtra.uni +++ /dev/null @@ -1,14 +0,0 @@ -// /** @file -// CpuDxe Localized Strings and Content -// -// Copyright (c) 2016 - 2019, Hewlett Packard Enterprise Development LP. A= ll rights reserved.
-// -// SPDX-License-Identifier: BSD-2-Clause-Patent -// -// **/ - -#string STR_PROPERTIES_MODULE_NAME -#language en-US -"RISC-V Architectural DXE Driver" - - --=20 2.34.1 -=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 (#102593): https://edk2.groups.io/g/devel/message/102593 Mute This Topic: https://groups.io/mt/98099328/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-