From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mx.groups.io with SMTP id smtpd.web10.46697.1680448687554603681 for ; Sun, 02 Apr 2023 08:18:07 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=eBVdR4xJ; spf=pass (domain: intel.com, ip: 134.134.136.20, mailfrom: evan.chai@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1680448687; x=1711984687; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=sYI7jIw6qda3X5sqIJ6L4iiNIPEbv2Ta+/Z7Gqyfmhc=; b=eBVdR4xJiYMyE4XGtZbcNlYP471acZmL18FWriFnIhRfErJElm0bItFB 5WKf9GlZLMWHRnowK0V+MQ96egGsBcvql6U8ZS/6tjHJW4gqFOfx50oOy dfO3njr9olygGwXi2q4s3XA2T1RvL6tRA4kG5r4OuaSlupJ0+80AIrCu6 6rTf0ib1WBl1W6h0yAxm4Wz69qRohq5zINiImd9B5yRtTYbIwxdonwaQH ClXxuHCDd2G4AUJCp2JQz+KFz1IrZLCFnRs8HwK0sxwlM8mmE50SWM1iM wF+QfAoBzB5dUphz1hwc9F8Vec8l9mKvrajE+FtK5K2GSAZyqVIcN3nef w==; X-IronPort-AV: E=McAfee;i="6600,9927,10668"; a="330310565" X-IronPort-AV: E=Sophos;i="5.98,312,1673942400"; d="scan'208";a="330310565" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Apr 2023 08:18:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10668"; a="679188136" X-IronPort-AV: E=Sophos;i="5.98,312,1673942400"; d="scan'208";a="679188136" Received: from evancy.sh.intel.com ([10.239.158.113]) by orsmga007.jf.intel.com with ESMTP; 02 Apr 2023 08:18:04 -0700 From: "Chai, Evan" To: devel@edk2.groups.io Cc: Daniel Schaefer , Sunil V L , Andrei Warkentin Subject: [PATCH 1/5] Silicon/RISC-V/ProcessorPkg: remove redundant CpuDxe driver Date: Sun, 2 Apr 2023 23:15:38 +0800 Message-Id: <20230402151542.325929-2-evan.chai@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230402151542.325929-1-evan.chai@intel.com> References: <20230402151542.325929-1-evan.chai@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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 @@ #=0D # RISC-V Core module=0D #=0D - Silicon/RISC-V/ProcessorPkg/Universal/CpuDxe/CpuDxe.inf=0D + UefiCpuPkg/CpuDxeRiscV64/CpuDxeRiscV64.inf=0D Silicon/RISC-V/ProcessorPkg/Universal/SmbiosDxe/RiscVSmbiosDxe.inf=0D MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.inf=0D =0D 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 =0D # RISC-V Core Drivers=0D INF Platform/SiFive/U5SeriesPkg/Universal/Dxe/TimerDxe/TimerDxe.inf=0D -INF Silicon/RISC-V/ProcessorPkg/Universal/CpuDxe/CpuDxe.inf=0D +INF UefiCpuPkg/CpuDxeRiscV64/CpuDxeRiscV64.inf=0D INF Silicon/RISC-V/ProcessorPkg/Universal/SmbiosDxe/RiscVSmbiosDxe.inf=0D =0D INF MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.in= f=0D 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 @@ #=0D # RISC-V Core module=0D #=0D - Silicon/RISC-V/ProcessorPkg/Universal/CpuDxe/CpuDxe.inf=0D + UefiCpuPkg/CpuDxeRiscV64/CpuDxeRiscV64.inf=0D Silicon/RISC-V/ProcessorPkg/Universal/SmbiosDxe/RiscVSmbiosDxe.inf=0D MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.inf=0D =0D 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 =0D # RISC-V Core Drivers=0D INF Platform/SiFive/U5SeriesPkg/Universal/Dxe/TimerDxe/TimerDxe.inf=0D -INF Silicon/RISC-V/ProcessorPkg/Universal/CpuDxe/CpuDxe.inf=0D +INF UefiCpuPkg/CpuDxeRiscV64/CpuDxeRiscV64.inf=0D INF Silicon/RISC-V/ProcessorPkg/Universal/SmbiosDxe/RiscVSmbiosDxe.inf=0D =0D INF MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.in= f=0D 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=0D - RISC-V CPU DXE driver.=0D -=0D - Copyright (c) 2016 - 2022, Hewlett Packard Enterprise Development LP. Al= l rights reserved.
=0D -=0D - SPDX-License-Identifier: BSD-2-Clause-Patent=0D -=0D -**/=0D -=0D -#include "CpuDxe.h"=0D -=0D -//=0D -// Global Variables=0D -//=0D -STATIC BOOLEAN mInterruptState =3D FALSE;=0D -STATIC EFI_HANDLE mCpuHandle =3D NULL;=0D -=0D -EFI_CPU_ARCH_PROTOCOL gCpu =3D {=0D - CpuFlushCpuDataCache,=0D - CpuEnableInterrupt,=0D - CpuDisableInterrupt,=0D - CpuGetInterruptState,=0D - CpuInit,=0D - CpuRegisterInterruptHandler,=0D - CpuGetTimerValue,=0D - CpuSetMemoryAttributes,=0D - 1, // NumberOfTimers=0D - 4 // DmaBufferAlignment=0D -};=0D -=0D -//=0D -// CPU Arch Protocol Functions=0D -//=0D -=0D -/**=0D - Flush CPU data cache. If the instruction cache is fully coherent=0D - with all DMA operations then function can just return EFI_SUCCESS.=0D -=0D - @param This Protocol instance structure=0D - @param Start Physical address to start flushing from.=0D - @param Length Number of bytes to flush. Round up to chipset= =0D - granularity.=0D - @param FlushType Specifies the type of flush operation to perfo= rm.=0D -=0D - @retval EFI_SUCCESS If cache was flushed=0D - @retval EFI_UNSUPPORTED If flush type is not supported.=0D - @retval EFI_DEVICE_ERROR If requested range could not be flushed.=0D -=0D -**/=0D -EFI_STATUS=0D -EFIAPI=0D -CpuFlushCpuDataCache (=0D - IN EFI_CPU_ARCH_PROTOCOL *This,=0D - IN EFI_PHYSICAL_ADDRESS Start,=0D - IN UINT64 Length,=0D - IN EFI_CPU_FLUSH_TYPE FlushType=0D - )=0D -{=0D - return EFI_SUCCESS;=0D -}=0D -=0D -/**=0D - Enables CPU interrupts.=0D -=0D - @param This Protocol instance structure=0D -=0D - @retval EFI_SUCCESS If interrupts were enabled in the CPU=0D - @retval EFI_DEVICE_ERROR If interrupts could not be enabled on the CPU.= =0D -=0D -**/=0D -EFI_STATUS=0D -EFIAPI=0D -CpuEnableInterrupt (=0D - IN EFI_CPU_ARCH_PROTOCOL *This=0D - )=0D -{=0D - EnableInterrupts ();=0D - mInterruptState =3D TRUE;=0D - return EFI_SUCCESS;=0D -}=0D -=0D -/**=0D - Disables CPU interrupts.=0D -=0D - @param This Protocol instance structure=0D -=0D - @retval EFI_SUCCESS If interrupts were disabled in the CPU.=0D - @retval EFI_DEVICE_ERROR If interrupts could not be disabled on the CPU= .=0D -=0D -**/=0D -EFI_STATUS=0D -EFIAPI=0D -CpuDisableInterrupt (=0D - IN EFI_CPU_ARCH_PROTOCOL *This=0D - )=0D -{=0D - DisableInterrupts ();=0D - mInterruptState =3D FALSE;=0D - return EFI_SUCCESS;=0D -}=0D -=0D -/**=0D - Return the state of interrupts.=0D -=0D - @param This Protocol instance structure=0D - @param State Pointer to the CPU's current interrupt st= ate=0D -=0D - @retval EFI_SUCCESS If interrupts were disabled in the CPU.=0D - @retval EFI_INVALID_PARAMETER State is NULL.=0D -=0D -**/=0D -EFI_STATUS=0D -EFIAPI=0D -CpuGetInterruptState (=0D - IN EFI_CPU_ARCH_PROTOCOL *This,=0D - OUT BOOLEAN *State=0D - )=0D -{=0D - if (State =3D=3D NULL) {=0D - return EFI_INVALID_PARAMETER;=0D - }=0D -=0D - *State =3D mInterruptState;=0D - return EFI_SUCCESS;=0D -}=0D -=0D -/**=0D - Generates an INIT to the CPU.=0D -=0D - @param This Protocol instance structure=0D - @param InitType Type of CPU INIT to perform=0D -=0D - @retval EFI_SUCCESS If CPU INIT occurred. This value should never = be=0D - seen.=0D - @retval EFI_DEVICE_ERROR If CPU INIT failed.=0D - @retval EFI_UNSUPPORTED Requested type of CPU INIT not supported.=0D -=0D -**/=0D -EFI_STATUS=0D -EFIAPI=0D -CpuInit (=0D - IN EFI_CPU_ARCH_PROTOCOL *This,=0D - IN EFI_CPU_INIT_TYPE InitType=0D - )=0D -{=0D - return EFI_UNSUPPORTED;=0D -}=0D -=0D -/**=0D - Registers a function to be called from the CPU interrupt handler.=0D -=0D - @param This Protocol instance structure=0D - @param InterruptType Defines which interrupt to hook. IA-32=0D - valid range is 0x00 through 0xFF=0D - @param InterruptHandler A pointer to a function of type=0D - EFI_CPU_INTERRUPT_HANDLER that is called= =0D - when a processor interrupt occurs. A nul= l=0D - pointer is an error condition.=0D -=0D - @retval EFI_SUCCESS If handler installed or uninstalled.=0D - @retval EFI_ALREADY_STARTED InterruptHandler is not NULL, and a handl= er=0D - for InterruptType was previously installe= d.=0D - @retval EFI_INVALID_PARAMETER InterruptHandler is NULL, and a handler f= or=0D - InterruptType was not previously installe= d.=0D - @retval EFI_UNSUPPORTED The interrupt specified by InterruptType= =0D - is not supported.=0D -=0D -**/=0D -EFI_STATUS=0D -EFIAPI=0D -CpuRegisterInterruptHandler (=0D - IN EFI_CPU_ARCH_PROTOCOL *This,=0D - IN EFI_EXCEPTION_TYPE InterruptType,=0D - IN EFI_CPU_INTERRUPT_HANDLER InterruptHandler=0D - )=0D -{=0D - return RegisterCpuInterruptHandler (InterruptType, InterruptHandler);=0D -}=0D -=0D -/**=0D - Returns a timer value from one of the CPU's internal timers. There is no= =0D - inherent time interval between ticks but is a function of the CPU freque= ncy.=0D -=0D - @param This - Protocol instance structure.=0D - @param TimerIndex - Specifies which CPU timer is requested.=0D - @param TimerValue - Pointer to the returned timer value.=0D - @param TimerPeriod - A pointer to the amount of time that passe= s=0D - in femtoseconds (10-15) for each increment= =0D - of TimerValue. If TimerValue does not=0D - increment at a predictable rate, then 0 is= =0D - returned. The amount of time that has=0D - passed between two calls to GetTimerValue(= )=0D - can be calculated with the formula=0D - (TimerValue2 - TimerValue1) * TimerPeriod.= =0D - This parameter is optional and may be NULL= .=0D -=0D - @retval EFI_SUCCESS - If the CPU timer count was returned.=0D - @retval EFI_UNSUPPORTED - If the CPU does not have any readable ti= mers.=0D - @retval EFI_DEVICE_ERROR - If an error occurred while reading the t= imer.=0D - @retval EFI_INVALID_PARAMETER - TimerIndex is not valid or TimerValue is= NULL.=0D -=0D -**/=0D -EFI_STATUS=0D -EFIAPI=0D -CpuGetTimerValue (=0D - IN EFI_CPU_ARCH_PROTOCOL *This,=0D - IN UINT32 TimerIndex,=0D - OUT UINT64 *TimerValue,=0D - OUT UINT64 *TimerPeriod OPTIONAL=0D - )=0D -{=0D - if (TimerValue =3D=3D NULL) {=0D - return EFI_INVALID_PARAMETER;=0D - }=0D -=0D - if (TimerIndex !=3D 0) {=0D - return EFI_INVALID_PARAMETER;=0D - }=0D -=0D - *TimerValue =3D (UINT64)RiscVReadMachineTimerInterface ();=0D - if (TimerPeriod !=3D NULL) {=0D - *TimerPeriod =3D DivU64x32 (=0D - 1000000000000000u,=0D - PcdGet64 (PcdRiscVMachineTimerFrequencyInHerz)=0D - );=0D - }=0D -=0D - return EFI_SUCCESS;=0D -}=0D -=0D -/**=0D - Implementation of SetMemoryAttributes() service of CPU Architecture Prot= ocol.=0D -=0D - This function modifies the attributes for the memory region specified by= BaseAddress and=0D - Length from their current attributes to the attributes specified by Attr= ibutes.=0D -=0D - @param This The EFI_CPU_ARCH_PROTOCOL instance.=0D - @param BaseAddress The physical address that is the start address = of a memory region.=0D - @param Length The size in bytes of the memory region.=0D - @param Attributes The bit mask of attributes to set for the memor= y region.=0D -=0D - @retval EFI_SUCCESS The attributes were set for the memory reg= ion.=0D - @retval EFI_ACCESS_DENIED The attributes for the memory resource ran= ge specified by=0D - BaseAddress and Length cannot be modified.= =0D - @retval EFI_INVALID_PARAMETER Length is zero.=0D - Attributes specified an illegal combinatio= n of attributes that=0D - cannot be set together.=0D - @retval EFI_OUT_OF_RESOURCES There are not enough system resources to m= odify the attributes of=0D - the memory resource range.=0D - @retval EFI_UNSUPPORTED The processor does not support one or more= bytes of the memory=0D - resource range specified by BaseAddress an= d Length.=0D - The bit mask of attributes is not support = for the memory resource=0D - range specified by BaseAddress and Length.= =0D -=0D -**/=0D -EFI_STATUS=0D -EFIAPI=0D -CpuSetMemoryAttributes (=0D - IN EFI_CPU_ARCH_PROTOCOL *This,=0D - IN EFI_PHYSICAL_ADDRESS BaseAddress,=0D - IN UINT64 Length,=0D - IN UINT64 Attributes=0D - )=0D -{=0D - DEBUG ((DEBUG_INFO, "%a: Set memory attributes not supported yet\n", __F= UNCTION__));=0D - return EFI_SUCCESS;=0D -}=0D -=0D -/**=0D - Initialize the state information for the CPU Architectural Protocol.=0D -=0D - @param ImageHandle Image handle this driver.=0D - @param SystemTable Pointer to the System Table.=0D -=0D - @retval EFI_SUCCESS Thread can be successfully created=0D - @retval EFI_OUT_OF_RESOURCES Cannot allocate protocol data structure=0D - @retval EFI_DEVICE_ERROR Cannot create the thread=0D -=0D -**/=0D -EFI_STATUS=0D -EFIAPI=0D -InitializeCpu (=0D - IN EFI_HANDLE ImageHandle,=0D - IN EFI_SYSTEM_TABLE *SystemTable=0D - )=0D -{=0D - EFI_STATUS Status;=0D -=0D - //=0D - // Machine mode handler is initiated in CpuExceptionHandlerLibConstructo= r in=0D - // CpuExecptionHandlerLib.=0D - //=0D -=0D - //=0D - // Make sure interrupts are disabled=0D - //=0D - DisableInterrupts ();=0D -=0D - //=0D - // Install CPU Architectural Protocol=0D - //=0D - Status =3D gBS->InstallMultipleProtocolInterfaces (=0D - &mCpuHandle,=0D - &gEfiCpuArchProtocolGuid,=0D - &gCpu,=0D - NULL=0D - );=0D - ASSERT_EFI_ERROR (Status);=0D - return Status;=0D -}=0D 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=0D - RISC-V CPU DXE module header file.=0D -=0D - Copyright (c) 2016 - 2022, Hewlett Packard Enterprise Development LP. Al= l rights reserved.
=0D -=0D - SPDX-License-Identifier: BSD-2-Clause-Patent=0D -=0D -**/=0D -=0D -#ifndef CPU_DXE_H_=0D -#define CPU_DXE_H_=0D -=0D -#include =0D -=0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -#include =0D -=0D -/**=0D - Flush CPU data cache. If the instruction cache is fully coherent=0D - with all DMA operations then function can just return EFI_SUCCESS.=0D -=0D - @param This Protocol instance structure=0D - @param Start Physical address to start flushing from.=0D - @param Length Number of bytes to flush. Round up to chipset= =0D - granularity.=0D - @param FlushType Specifies the type of flush operation to perfo= rm.=0D -=0D - @retval EFI_SUCCESS If cache was flushed=0D - @retval EFI_UNSUPPORTED If flush type is not supported.=0D - @retval EFI_DEVICE_ERROR If requested range could not be flushed.=0D -=0D -**/=0D -EFI_STATUS=0D -EFIAPI=0D -CpuFlushCpuDataCache (=0D - IN EFI_CPU_ARCH_PROTOCOL *This,=0D - IN EFI_PHYSICAL_ADDRESS Start,=0D - IN UINT64 Length,=0D - IN EFI_CPU_FLUSH_TYPE FlushType=0D - );=0D -=0D -/**=0D - Enables CPU interrupts.=0D -=0D - @param This Protocol instance structure=0D -=0D - @retval EFI_SUCCESS If interrupts were enabled in the CPU=0D - @retval EFI_DEVICE_ERROR If interrupts could not be enabled on the CPU.= =0D -=0D -**/=0D -EFI_STATUS=0D -EFIAPI=0D -CpuEnableInterrupt (=0D - IN EFI_CPU_ARCH_PROTOCOL *This=0D - );=0D -=0D -/**=0D - Disables CPU interrupts.=0D -=0D - @param This Protocol instance structure=0D -=0D - @retval EFI_SUCCESS If interrupts were disabled in the CPU.=0D - @retval EFI_DEVICE_ERROR If interrupts could not be disabled on the CPU= .=0D -=0D -**/=0D -EFI_STATUS=0D -EFIAPI=0D -CpuDisableInterrupt (=0D - IN EFI_CPU_ARCH_PROTOCOL *This=0D - );=0D -=0D -/**=0D - Return the state of interrupts.=0D -=0D - @param This Protocol instance structure=0D - @param State Pointer to the CPU's current interrupt st= ate=0D -=0D - @retval EFI_SUCCESS If interrupts were disabled in the CPU.=0D - @retval EFI_INVALID_PARAMETER State is NULL.=0D -=0D -**/=0D -EFI_STATUS=0D -EFIAPI=0D -CpuGetInterruptState (=0D - IN EFI_CPU_ARCH_PROTOCOL *This,=0D - OUT BOOLEAN *State=0D - );=0D -=0D -/**=0D - Generates an INIT to the CPU.=0D -=0D - @param This Protocol instance structure=0D - @param InitType Type of CPU INIT to perform=0D -=0D - @retval EFI_SUCCESS If CPU INIT occurred. This value should never = be=0D - seen.=0D - @retval EFI_DEVICE_ERROR If CPU INIT failed.=0D - @retval EFI_UNSUPPORTED Requested type of CPU INIT not supported.=0D -=0D -**/=0D -EFI_STATUS=0D -EFIAPI=0D -CpuInit (=0D - IN EFI_CPU_ARCH_PROTOCOL *This,=0D - IN EFI_CPU_INIT_TYPE InitType=0D - );=0D -=0D -/**=0D - Registers a function to be called from the CPU interrupt handler.=0D -=0D - @param This Protocol instance structure=0D - @param InterruptType Defines which interrupt to hook. IA-32=0D - valid range is 0x00 through 0xFF=0D - @param InterruptHandler A pointer to a function of type=0D - EFI_CPU_INTERRUPT_HANDLER that is called= =0D - when a processor interrupt occurs. A nul= l=0D - pointer is an error condition.=0D -=0D - @retval EFI_SUCCESS If handler installed or uninstalled.=0D - @retval EFI_ALREADY_STARTED InterruptHandler is not NULL, and a handl= er=0D - for InterruptType was previously installe= d.=0D - @retval EFI_INVALID_PARAMETER InterruptHandler is NULL, and a handler f= or=0D - InterruptType was not previously installe= d.=0D - @retval EFI_UNSUPPORTED The interrupt specified by InterruptType= =0D - is not supported.=0D -=0D -**/=0D -EFI_STATUS=0D -EFIAPI=0D -CpuRegisterInterruptHandler (=0D - IN EFI_CPU_ARCH_PROTOCOL *This,=0D - IN EFI_EXCEPTION_TYPE InterruptType,=0D - IN EFI_CPU_INTERRUPT_HANDLER InterruptHandler=0D - );=0D -=0D -/**=0D - Returns a timer value from one of the CPU's internal timers. There is no= =0D - inherent time interval between ticks but is a function of the CPU freque= ncy.=0D -=0D - @param This - Protocol instance structure.=0D - @param TimerIndex - Specifies which CPU timer is requested.=0D - @param TimerValue - Pointer to the returned timer value.=0D - @param TimerPeriod - A pointer to the amount of time that passe= s=0D - in femtoseconds (10-15) for each increment= =0D - of TimerValue. If TimerValue does not=0D - increment at a predictable rate, then 0 is= =0D - returned. The amount of time that has=0D - passed between two calls to GetTimerValue(= )=0D - can be calculated with the formula=0D - (TimerValue2 - TimerValue1) * TimerPeriod.= =0D - This parameter is optional and may be NULL= .=0D -=0D - @retval EFI_SUCCESS - If the CPU timer count was returned.=0D - @retval EFI_UNSUPPORTED - If the CPU does not have any readable ti= mers.=0D - @retval EFI_DEVICE_ERROR - If an error occurred while reading the t= imer.=0D - @retval EFI_INVALID_PARAMETER - TimerIndex is not valid or TimerValue is= NULL.=0D -=0D -**/=0D -EFI_STATUS=0D -EFIAPI=0D -CpuGetTimerValue (=0D - IN EFI_CPU_ARCH_PROTOCOL *This,=0D - IN UINT32 TimerIndex,=0D - OUT UINT64 *TimerValue,=0D - OUT UINT64 *TimerPeriod OPTIONAL=0D - );=0D -=0D -/**=0D - Set memory cacheability attributes for given range of memeory.=0D -=0D - @param This Protocol instance structure=0D - @param BaseAddress Specifies the start address of the=0D - memory range=0D - @param Length Specifies the length of the memory range= =0D - @param Attributes The memory cacheability for the memory ra= nge=0D -=0D - @retval EFI_SUCCESS If the cacheability of that memory range = is=0D - set successfully=0D - @retval EFI_UNSUPPORTED If the desired operation cannot be done=0D - @retval EFI_INVALID_PARAMETER The input parameter is not correct,=0D - such as Length =3D 0=0D -=0D -**/=0D -EFI_STATUS=0D -EFIAPI=0D -CpuSetMemoryAttributes (=0D - IN EFI_CPU_ARCH_PROTOCOL *This,=0D - IN EFI_PHYSICAL_ADDRESS BaseAddress,=0D - IN UINT64 Length,=0D - IN UINT64 Attributes=0D - );=0D -=0D -#endif=0D 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=0D -# RISC-V CPU DXE module.=0D -#=0D -# Copyright (c) 2016 - 2019, Hewlett Packard Enterprise Development LP. A= ll rights reserved.
=0D -# SPDX-License-Identifier: BSD-2-Clause-Patent=0D -#=0D -##=0D -=0D -[Defines]=0D - INF_VERSION =3D 0x0001001b=0D - BASE_NAME =3D CpuDxe=0D - MODULE_UNI_FILE =3D CpuDxe.uni=0D - FILE_GUID =3D 2AEB1f3E-5B6B-441B-92C1-4A9E6FC85E92= =0D - MODULE_TYPE =3D DXE_DRIVER=0D - VERSION_STRING =3D 1.0=0D -=0D - ENTRY_POINT =3D InitializeCpu=0D -=0D -[Packages]=0D - MdeModulePkg/MdeModulePkg.dec=0D - MdePkg/MdePkg.dec=0D - Silicon/RISC-V/ProcessorPkg/RiscVProcessorPkg.dec=0D -=0D -[LibraryClasses]=0D - BaseLib=0D - CpuLib=0D - CpuExceptionHandlerLib=0D - DebugLib=0D - MachineModeTimerLib=0D - RiscVCpuLib=0D - TimerLib=0D - UefiBootServicesTableLib=0D - UefiDriverEntryPoint=0D -=0D -[Sources]=0D - CpuDxe.c=0D - CpuDxe.h=0D -=0D -[Protocols]=0D - gEfiCpuArchProtocolGuid ## PRODUCES=0D -=0D -[Pcd]=0D - gUefiRiscVPkgTokenSpaceGuid.PcdRiscVMachineTimerFrequencyInHerz=0D -=0D -[Depex]=0D - TRUE=0D -=0D -[UserExtensions.TianoCore."ExtraFiles"]=0D - CpuDxeExtra.uni=0D 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=0D -//=0D -// Copyright (c) 2016 - 2019, Hewlett Packard Enterprise Development LP. A= ll rights reserved.
=0D -//=0D -// SPDX-License-Identifier: BSD-2-Clause-Patent=0D -//=0D -// **/=0D -=0D -=0D -#string STR_MODULE_ABSTRACT #language en-US "Installs RISC-V C= PU Architecture Protocol"=0D -=0D -#string STR_MODULE_DESCRIPTION #language en-US "RISC-V CPU driver= installs CPU Architecture Protocol."=0D -=0D 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=0D -// CpuDxe Localized Strings and Content=0D -//=0D -// Copyright (c) 2016 - 2019, Hewlett Packard Enterprise Development LP. A= ll rights reserved.
=0D -//=0D -// SPDX-License-Identifier: BSD-2-Clause-Patent=0D -//=0D -// **/=0D -=0D -#string STR_PROPERTIES_MODULE_NAME=0D -#language en-US=0D -"RISC-V Architectural DXE Driver"=0D -=0D -=0D --=20 2.34.1