(This is migrated from edk2-platforms:Silicon/RISC-V) - Add RISC-V ProcessorPkg package which provides RISC-V processor related drivers and libraries. - Support RISC-V OpenSBI and RISC-V platforms
Signed-off-by: Abner Chang <abner.ch...@hpe.com> Co-authored-by: Daniel Schaefer <daniel.schae...@hpe.com> Co-authored-by: Gilbert Chen <gilbert.c...@hpe.com> Reviewed-by: Leif Lindholm <leif.lindh...@linaro.org> Cc: Leif Lindholm <leif.lindh...@linaro.org> Cc: Gilbert Chen <gilbert.c...@hpe.com> --- .../RISC-V/ProcessorPkg/RiscVProcessorPkg.dec | 47 ++++++++ .../RISC-V/ProcessorPkg/RiscVProcessorPkg.dsc | 100 ++++++++++++++++++ .../RISC-V/ProcessorPkg/RiscVProcessorPkg.uni | 13 +++ .../ProcessorPkg/RiscVProcessorPkgExtra.uni | 13 +++ 4 files changed, 173 insertions(+) create mode 100644 Silicon/RISC-V/ProcessorPkg/RiscVProcessorPkg.dec create mode 100644 Silicon/RISC-V/ProcessorPkg/RiscVProcessorPkg.dsc create mode 100644 Silicon/RISC-V/ProcessorPkg/RiscVProcessorPkg.uni create mode 100644 Silicon/RISC-V/ProcessorPkg/RiscVProcessorPkgExtra.uni diff --git a/Silicon/RISC-V/ProcessorPkg/RiscVProcessorPkg.dec b/Silicon/RISC-V/ProcessorPkg/RiscVProcessorPkg.dec new file mode 100644 index 0000000000..0b64b33f0f --- /dev/null +++ b/Silicon/RISC-V/ProcessorPkg/RiscVProcessorPkg.dec @@ -0,0 +1,47 @@ +## @file RiscVProcesssorPkg.dec +# This Package provides UEFI RISC-V processor modules and libraries. +# +# Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved.<BR> +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +[Defines] + DEC_SPECIFICATION = 0x0001001b + PACKAGE_NAME = RiscVProcessorPkg + PACKAGE_UNI_FILE = RiscVProcessorPkg.uni + PACKAGE_GUID = 993C7CAC-C87C-4F08-A2CF-AD3AABA859D1 + PACKAGE_VERSION = 1.0 + +[Includes] + Include + Include/Library + Library/RiscVOpensbiLib/opensbi # OpenSBI header file reference ("include/sbi/...") + Library/RiscVOpensbiLib/opensbi/include # Header file reference from opensbi files, ("sbi/...") + +[LibraryClasses] + RiscVPlatformDxeIplLib|Include/Library/RiscVPlatformDxeIpl.h + RiscVCpuLib|Include/Library/RiscVCpuLib.h + RiscVEdk2SbiLib|Include/Library/RiscVEdk2SbiLib.h + +[Guids] + gUefiRiscVPkgTokenSpaceGuid = { 0x4261e9c8, 0x52c0, 0x4b34, { 0x85, 0x3d, 0x48, 0x46, 0xea, 0xd3, 0xb7, 0x2c}} + +[PcdsFixedAtBuild] + # Processor Specific Data GUID HOB GUID + gUefiRiscVPkgTokenSpaceGuid.PcdProcessorSpecificDataGuidHobGuid|{0x20, 0x72, 0xD5, 0x2F, 0xCF, 0x3C, 0x4C, 0xBC, 0xB1, 0x65, 0x94, 0x90, 0xDC, 0xF2, 0xFA, 0x93}|VOID*|0x00001000 + gUefiRiscVPkgTokenSpaceGuid.PcdProcessorSmbiosGuidHobGuid|{0x0F, 0x34, 0x00, 0x92, 0x04, 0x12, 0x45, 0x4A, 0x9C, 0x11, 0xB8, 0x8B, 0xDF, 0xC6, 0xFA, 0x6F}|VOID*|0x00001001 + gUefiRiscVPkgTokenSpaceGuid.PcdProcessorSmbiosType4GuidHobGuid|{0x5B, 0x36, 0xEA, 0x23, 0x79, 0x6D, 0x4F, 0xCF, 0x9C, 0x22, 0x25, 0xC0, 0x89, 0x8C, 0x25, 0xB9}|VOID*|0x00001002 + gUefiRiscVPkgTokenSpaceGuid.PcdProcessorSmbiosType7GuidHobGuid|{0xBF, 0xB4, 0x6D, 0x1B, 0x7E, 0x10, 0x47, 0x44, 0xB8, 0xBD, 0xFF, 0x1E, 0xDD, 0xDF, 0x71, 0x65}|VOID*|0x00001003 + + # + # 1000000000 + # PcdRiscVMachineTimerTickInNanoSecond = --------------------------------------- + # PcdRiscVMachineTimerFrequencyInHerz + # + gUefiRiscVPkgTokenSpaceGuid.PcdRiscVMachineTimerTickInNanoSecond|100|UINT64|0x00001010 + gUefiRiscVPkgTokenSpaceGuid.PcdRiscVMachineTimerFrequencyInHerz|10000000|UINT64|0x00001011 + +[UserExtensions.TianoCore."ExtraFiles"] + RiscVProcessorPkgExtra.uni diff --git a/Silicon/RISC-V/ProcessorPkg/RiscVProcessorPkg.dsc b/Silicon/RISC-V/ProcessorPkg/RiscVProcessorPkg.dsc new file mode 100644 index 0000000000..5f88f5e89f --- /dev/null +++ b/Silicon/RISC-V/ProcessorPkg/RiscVProcessorPkg.dsc @@ -0,0 +1,100 @@ +#/** @file +# RISC-V processor package. +# +# Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved.<BR> +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +#**/ + +################################################################################ +# +# Defines Section +# +################################################################################ +[Defines] + PLATFORM_NAME = RiscVProcessor + PLATFORM_GUID = 55D77916-B270-41B4-9325-2CE9DCE0926E + PLATFORM_VERSION = 0.1 + DSC_SPECIFICATION = 0x0001001c + OUTPUT_DIRECTORY = Build/$(PLATFORM_NAME) + SUPPORTED_ARCHITECTURES = RISCV64 + BUILD_TARGETS = DEBUG|RELEASE|NOOPT + SKUID_IDENTIFIER = DEFAULT + +[BuildOptions] + GCC:RELEASE_*_*_CC_FLAGS = -DMDEPKG_NDEBUG +!ifdef $(SOURCE_DEBUG_ENABLE) + GCC:*_*_RISCV64_GENFW_FLAGS = --keepexceptiontable +!endif + +################################################################################ +# +# SKU Identification section - list of all SKU IDs supported by this Platform. +# +################################################################################ +[SkuIds] + 0|DEFAULT + +[LibraryClasses.common] + CpuExceptionHandlerLib|Silicon/RISC-V/ProcessorPkg/Library/RiscVExceptionLib/CpuExceptionHandlerDxeLib.inf + RiscVCpuLib|Silicon/RISC-V/ProcessorPkg/Library/RiscVCpuLib/RiscVCpuLib.inf + RiscVEdk2SbiLib|Silicon/RISC-V/ProcessorPkg/Library/RiscVEdk2SbiLib/RiscVEdk2SbiLib.inf + RiscVOpensbiLib|Silicon/RISC-V/ProcessorPkg/Library/RiscVOpensbiLib/RiscVOpensbiLib.inf + TimerLib|Silicon/RISC-V/ProcessorPkg/Library/RiscVTimerLib/BaseRiscVTimerLib.inf + BaseLib|MdePkg/Library/BaseLib/BaseLib.inf + BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf + DebugAgentLib|MdeModulePkg/Library/DebugAgentLibNull/DebugAgentLibNull.inf + DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf + HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf + IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf + MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf + PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf + PeCoffExtraActionLib|MdePkg/Library/BasePeCoffExtraActionLibNull/BasePeCoffExtraActionLibNull.inf + PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf + PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf + SerialPortLib|MdePkg/Library/BaseSerialPortLibNull/BaseSerialPortLibNull.inf + PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf + CpuLib|MdePkg/Library/BaseCpuLib/BaseCpuLib.inf + UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf + UefiRuntimeServicesTableLib|MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf + UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf + UefiApplicationEntryPoint|MdePkg/Library/UefiApplicationEntryPoint/UefiApplicationEntryPoint.inf + UefiLib|MdePkg/Library/UefiLib/UefiLib.inf + DevicePathLib|MdePkg/Library/UefiDevicePathLibDevicePathProtocol/UefiDevicePathLibDevicePathProtocol.inf + RiscVPlatformTimerLib|Silicon/RISC-V/ProcessorPkg/Library/RiscVPlatformTimerLibNull/RiscVPlatformTimerLib.inf + PeiServicesTablePointerLib|Silicon/RISC-V/ProcessorPkg/Library/PeiServicesTablePointerLibOpenSbi/PeiServicesTablePointerLibOpenSbi.inf + +[LibraryClasses.common.PEI_CORE] + PeiServicesTablePointerLib|Silicon/RISC-V/ProcessorPkg/Library/PeiServicesTablePointerLibOpenSbi/PeiServicesTablePointerLibOpenSbi.inf + +[LibraryClasses.common.PEIM] + PeiServicesTablePointerLib|Silicon/RISC-V/ProcessorPkg/Library/PeiServicesTablePointerLibOpenSbi/PeiServicesTablePointerLibOpenSbi.inf + HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf + MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf + PeimEntryPoint|MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf + +[LibraryClasses.common.DXE_CORE] + TimerLib|Silicon/RISC-V/ProcessorPkg/Library/RiscVTimerLib/BaseRiscVTimerLib.inf + +[LibraryClasses.common.DXE_DRIVER] + PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf + PlatformBootManagerLib|Platform/RISC-V/PlatformPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf + +[LibraryClasses.common.DXE_RUNTIME_DRIVER] + TimerLib|Silicon/RISC-V/ProcessorPkg/Library/RiscVTimerLib/BaseRiscVTimerLib.inf + +[LibraryClasses.common.UEFI_DRIVER] + TimerLib|Silicon/RISC-V/ProcessorPkg/Library/RiscVTimerLib/BaseRiscVTimerLib.inf + +[Components] + Silicon/RISC-V/ProcessorPkg/Library/RiscVTimerLib/BaseRiscVTimerLib.inf + Silicon/RISC-V/ProcessorPkg/Library/RiscVExceptionLib/CpuExceptionHandlerDxeLib.inf + Silicon/RISC-V/ProcessorPkg/Library/PeiServicesTablePointerLibOpenSbi/PeiServicesTablePointerLibOpenSbi.inf + Silicon/RISC-V/ProcessorPkg/Library/RiscVOpensbiLib/RiscVOpensbiLib.inf + Silicon/RISC-V/ProcessorPkg/Library/RiscVPlatformTimerLibNull/RiscVPlatformTimerLib.inf + Silicon/RISC-V/ProcessorPkg/Library/RiscVCpuLib/RiscVCpuLib.inf + Silicon/RISC-V/ProcessorPkg/Library/RiscVEdk2SbiLib/RiscVEdk2SbiLib.inf + + Silicon/RISC-V/ProcessorPkg/Universal/CpuDxe/CpuDxe.inf + Silicon/RISC-V/ProcessorPkg/Universal/SmbiosDxe/RiscVSmbiosDxe.inf diff --git a/Silicon/RISC-V/ProcessorPkg/RiscVProcessorPkg.uni b/Silicon/RISC-V/ProcessorPkg/RiscVProcessorPkg.uni new file mode 100644 index 0000000000..83da92fe40 --- /dev/null +++ b/Silicon/RISC-V/ProcessorPkg/RiscVProcessorPkg.uni @@ -0,0 +1,13 @@ +// /** @file +// RISC-V Processor Package Localized Strings and Content. +// +// Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved.<BR> +// +// SPDX-License-Identifier: BSD-2-Clause-Patent +// +// **/ + +#string STR_PACKAGE_ABSTRACT #language en-US "Provides UEFI compatible RISC-V processor modules and libraries" + +#string STR_PACKAGE_DESCRIPTION #language en-US "This Package provides UEFI compatible RISC-V processor modules and libraries." + diff --git a/Silicon/RISC-V/ProcessorPkg/RiscVProcessorPkgExtra.uni b/Silicon/RISC-V/ProcessorPkg/RiscVProcessorPkgExtra.uni new file mode 100644 index 0000000000..207adfb671 --- /dev/null +++ b/Silicon/RISC-V/ProcessorPkg/RiscVProcessorPkgExtra.uni @@ -0,0 +1,13 @@ +// /** @file +// RISC-V Package Localized Strings and Content. +// +// Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved.<BR> +// +// SPDX-License-Identifier: BSD-2-Clause-Patent +// +// **/ + +#string STR_PROPERTIES_PACKAGE_NAME +#language en-US +"RISC-V processor package" + -- 2.31.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#85353): https://edk2.groups.io/g/devel/message/85353 Mute This Topic: https://groups.io/mt/88278526/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-