* Re: [platform/devel-riscv-v2 PATCHv5 07/18] U5SeriesPkg/RamFvbServicesRuntimeDxe: Firmware Volume Block service. [not found] ` <1572228122-13265-8-git-send-email-abner.chang@hpe.com> @ 2019-11-26 14:46 ` Leif Lindholm 0 siblings, 0 replies; 5+ messages in thread From: Leif Lindholm @ 2019-11-26 14:46 UTC (permalink / raw) To: Abner Chang Cc: devel, Michael D Kinney, Ard Biesheuvel, Gilbert Chen, Palmer Dabbelt On Mon, Oct 28, 2019 at 10:01:49 +0800, Abner Chang wrote: > RAM based Firmware Volume Block service runtime driver for U5 series > platforms. For this patch, could you please update the commit message to describe what this is and what it is used for? This includes one more item below. > Signed-off-by: Abner Chang <abner.chang@hpe.com> > > Cc: Michael D Kinney <michael.d.kinney@intel.com> > Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> > Cc: Leif Lindholm <leif.lindholm@linaro.org> > Cc: Gilbert Chen <gilbert.chen@hpe.com> > Cc: Palmer Dabbelt <palmer@sifive.com> > --- > .../FvbServicesRuntimeDxe.inf | 80 ++ > .../Dxe/RamFvbServicesRuntimeDxe/FwBlockService.h | 187 ++++ > .../Dxe/RamFvbServicesRuntimeDxe/RamFlash.h | 85 ++ > .../Dxe/RamFvbServicesRuntimeDxe/FvbInfo.c | 127 +++ > .../Dxe/RamFvbServicesRuntimeDxe/FwBlockService.c | 1114 ++++++++++++++++++++ > .../RamFvbServicesRuntimeDxe/FwBlockServiceDxe.c | 150 +++ > .../Dxe/RamFvbServicesRuntimeDxe/RamFlash.c | 145 +++ > .../Dxe/RamFvbServicesRuntimeDxe/RamFlashDxe.c | 20 + > 8 files changed, 1908 insertions(+) > create mode 100644 Platform/SiFive/U5SeriesPkg/Universal/Dxe/RamFvbServicesRuntimeDxe/FvbServicesRuntimeDxe.inf > create mode 100644 Platform/SiFive/U5SeriesPkg/Universal/Dxe/RamFvbServicesRuntimeDxe/FwBlockService.h > create mode 100644 Platform/SiFive/U5SeriesPkg/Universal/Dxe/RamFvbServicesRuntimeDxe/RamFlash.h > create mode 100644 Platform/SiFive/U5SeriesPkg/Universal/Dxe/RamFvbServicesRuntimeDxe/FvbInfo.c > create mode 100644 Platform/SiFive/U5SeriesPkg/Universal/Dxe/RamFvbServicesRuntimeDxe/FwBlockService.c > create mode 100644 Platform/SiFive/U5SeriesPkg/Universal/Dxe/RamFvbServicesRuntimeDxe/FwBlockServiceDxe.c > create mode 100644 Platform/SiFive/U5SeriesPkg/Universal/Dxe/RamFvbServicesRuntimeDxe/RamFlash.c > create mode 100644 Platform/SiFive/U5SeriesPkg/Universal/Dxe/RamFvbServicesRuntimeDxe/RamFlashDxe.c > > diff --git a/Platform/SiFive/U5SeriesPkg/Universal/Dxe/RamFvbServicesRuntimeDxe/FvbServicesRuntimeDxe.inf b/Platform/SiFive/U5SeriesPkg/Universal/Dxe/RamFvbServicesRuntimeDxe/FvbServicesRuntimeDxe.inf > new file mode 100644 > index 0000000..9db112a > --- /dev/null > +++ b/Platform/SiFive/U5SeriesPkg/Universal/Dxe/RamFvbServicesRuntimeDxe/FvbServicesRuntimeDxe.inf > @@ -0,0 +1,80 @@ > +## @file > +# Component description file for RAM Flash Fimware Volume Block DXE driver > +# module. > +# > +# This DXE runtime driver implements and produces the Fimware Volue Block > +# Protocol for a RAM flash device. > +# > +# Copyright (c) 2019, Hewlett Packard Enterprise Development LP. All rights reserved.<BR> > +# > +# SPDX-License-Identifier: BSD-2-Clause-Patent > +# > +## > + > +[Defines] > + INF_VERSION = 0x0001001b > + BASE_NAME = FvbServicesRuntimeDxe > + FILE_GUID = B04036D3-4C60-43D6-9850-0FCC090FF054 > + MODULE_TYPE = DXE_RUNTIME_DRIVER > + VERSION_STRING = 1.0 > + ENTRY_POINT = FvbInitialize > + > +# > +# The following information is for reference only and not required by the build > +# tools. > +# > +# VALID_ARCHITECTURES = RISCV64 > +# > + > +[Sources] > + FvbInfo.c > + FwBlockService.c > + FwBlockServiceDxe.c > + RamFlash.c > + RamFlashDxe.c > + > +[Packages] > + MdePkg/MdePkg.dec > + MdeModulePkg/MdeModulePkg.dec > + RiscVPlatformPkg/RiscVPlatformPkg.dec > + > +[LibraryClasses] > + BaseLib > + BaseMemoryLib > + DebugLib > + DevicePathLib > + DxeServicesTableLib > + MemoryAllocationLib > + PcdLib > + UefiBootServicesTableLib > + UefiDriverEntryPoint > + UefiRuntimeLib > + > +[Guids] > + gEfiEventVirtualAddressChangeGuid # ALWAYS_CONSUMED > + # gEfiEventVirtualAddressChangeGuid # Create Event: EVENT_GROUP_GUID > + > +[Protocols] > + gEfiFirmwareVolumeBlockProtocolGuid # PROTOCOL SOMETIMES_PRODUCED > + gEfiDevicePathProtocolGuid # PROTOCOL SOMETIMES_PRODUCED > + > +[FixedPcd] > + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize > + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize > + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize > + > + gUefiRiscVPlatformPkgTokenSpaceGuid.PcdPlatformFlashNvStorageVariableBase > + gUefiRiscVPlatformPkgTokenSpaceGuid.PcdPlatformFlashNvStorageFtwWorkingBase > + gUefiRiscVPlatformPkgTokenSpaceGuid.PcdPlatformFlashNvStorageFtwSpareBase > + gUefiRiscVPlatformPkgTokenSpaceGuid.PcdVariableFdBaseAddress > + gUefiRiscVPlatformPkgTokenSpaceGuid.PcdVariableFdSize > + gUefiRiscVPlatformPkgTokenSpaceGuid.PcdVariableFdBlockSize > + > +[Pcd] > + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase > + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase > + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase > + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64 > + > +[Depex] > + TRUE > diff --git a/Platform/SiFive/U5SeriesPkg/Universal/Dxe/RamFvbServicesRuntimeDxe/FwBlockService.h b/Platform/SiFive/U5SeriesPkg/Universal/Dxe/RamFvbServicesRuntimeDxe/FwBlockService.h > new file mode 100644 > index 0000000..96d0141 > --- /dev/null > +++ b/Platform/SiFive/U5SeriesPkg/Universal/Dxe/RamFvbServicesRuntimeDxe/FwBlockService.h > @@ -0,0 +1,187 @@ > +/**@file > + > + Copyright (c) 2019, Hewlett Packard Enterprise Development LP. All rights reserved.<BR> > + Copyright (c) 2006, Intel Corporation. All rights reserved.<BR> > + > + SPDX-License-Identifier: BSD-2-Clause-Patent > + > + Module Name: > + > + FwBlockService.h > + > + Abstract: > + > + Firmware volume block driver for Intel Firmware Hub (FWH) device The FWH comment is surely incorrect here? Please describe the thing actually implemented. No need to resubmit - just update in your repo and I will grab it from there when I get to pushing this port to a -devel branch. / Leif ^ permalink raw reply [flat|nested] 5+ messages in thread
[parent not found: <1572228122-13265-10-git-send-email-abner.chang@hpe.com>]
* Re: [platform/devel-riscv-v2 PATCHv5 09/18] U5SeriesPkg/SerialIoLib: Platform Serial Port library [not found] ` <1572228122-13265-10-git-send-email-abner.chang@hpe.com> @ 2019-11-26 14:53 ` Leif Lindholm 0 siblings, 0 replies; 5+ messages in thread From: Leif Lindholm @ 2019-11-26 14:53 UTC (permalink / raw) To: Abner Chang Cc: devel, Michael D Kinney, Ard Biesheuvel, Gilbert Chen, Palmer Dabbelt On Mon, Oct 28, 2019 at 10:01:51 +0800, Abner Chang wrote: > Serial Port library for U5 series platform. > > Signed-off-by: Abner Chang <abner.chang@hpe.com> > > Cc: Michael D Kinney <michael.d.kinney@intel.com> > Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> > Cc: Leif Lindholm <leif.lindholm@linaro.org> > Cc: Gilbert Chen <gilbert.chen@hpe.com> > Cc: Palmer Dabbelt <palmer@sifive.com> > --- > .../Library/SerialIoLib/SerialIoLib.inf | 38 ++++ > .../Library/SerialIoLib/SerialPortLib.c | 253 +++++++++++++++++++++ > .../Library/SerialIoLib/U5SerialPortLib.uni | 16 ++ > 3 files changed, 307 insertions(+) > create mode 100644 Platform/SiFive/U5SeriesPkg/Library/SerialIoLib/SerialIoLib.inf > create mode 100644 Platform/SiFive/U5SeriesPkg/Library/SerialIoLib/SerialPortLib.c > create mode 100644 Platform/SiFive/U5SeriesPkg/Library/SerialIoLib/U5SerialPortLib.uni > > diff --git a/Platform/SiFive/U5SeriesPkg/Library/SerialIoLib/SerialIoLib.inf b/Platform/SiFive/U5SeriesPkg/Library/SerialIoLib/SerialIoLib.inf > new file mode 100644 > index 0000000..0044f84 > --- /dev/null > +++ b/Platform/SiFive/U5SeriesPkg/Library/SerialIoLib/SerialIoLib.inf > @@ -0,0 +1,38 @@ > +## @file > +# Library instance for SerialIo library class > +# > +# Copyright (c) 2019, Hewlett Packard Enterprise Development LP. All rights reserved.<BR> > +# > +# SPDX-License-Identifier: BSD-2-Clause-Patent > +# > +## > + > +[Defines] > + INF_VERSION = 0x0001001b > + BASE_NAME = U5SerialPortLib > + MODULE_UNI_FILE = U5SerialPortLib.uni > + FILE_GUID = FCC4FD2B-2FF6-4FFA-B363-7C1111E5DCE9 > + MODULE_TYPE = BASE > + VERSION_STRING = 1.0 > + LIBRARY_CLASS = SerialPortLib > +# > +# The following information is for reference only and not required by the build tools. > +# > +# VALID_ARCHITECTURES = RISCV64 > +# > +[Packages] > + MdePkg/MdePkg.dec > + RiscVPlatformPkg/RiscVPlatformPkg.dec > + RiscVPkg/RiscVPkg.dec > + Platform/SiFive/U5SeriesPkg/U5SeriesPkg.dec > + > +[LibraryClasses] > + BaseLib > + IoLib > + RiscVOpensbiLib > + > +[FixedPcd] > + gSiFiveU5SeriesPlatformsPkgTokenSpaceGuid.PcdU5UartBase > + > +[Sources] > + SerialPortLib.c > diff --git a/Platform/SiFive/U5SeriesPkg/Library/SerialIoLib/SerialPortLib.c b/Platform/SiFive/U5SeriesPkg/Library/SerialIoLib/SerialPortLib.c > new file mode 100644 > index 0000000..5e06515 > --- /dev/null > +++ b/Platform/SiFive/U5SeriesPkg/Library/SerialIoLib/SerialPortLib.c > @@ -0,0 +1,253 @@ > +/** @file > + UART Serial Port library functions > + > + Copyright (c) 2019, Hewlett Packard Enterprise Development LP. All rights reserved.<BR> > + > + SPDX-License-Identifier: BSD-2-Clause-Patent > + > +**/ > + > +#include <Base.h> > +#include <Library/IoLib.h> > +#include <Library/SerialPortLib.h> > +#include <include/sbi_utils/serial/sifive-uart.h> // Reference to header file in opensbi We need a wrapper header file for this one too (and drop the comment). (Need to wrap also the used macro names Couple of minor style issues below. > + > +//--------------------------------------------- > +// UART Register Offsets > +//--------------------------------------------- > + > +#define UART_REG_IP 5 > +#define UART_IP_RXWM 0x02 > + > +//--------------------------------------------- > +// UART Settings > +//--------------------------------------------- > + > +#define UART_BAUDRATE 115200 > +#define SYS_CLK 100000000 > + > +BOOLEAN Initiated = FALSE; > + > +/** > + Initialize the serial device hardware. > + > + If no initialization is required, then return RETURN_SUCCESS. > + If the serial device was successfuly initialized, then return RETURN_SUCCESS. > + If the serial device could not be initialized, then return RETURN_DEVICE_ERROR. > + > + @retval RETURN_SUCCESS The serial device was initialized. > + @retval RETURN_DEVICE_ERROR The serail device could not be initialized. > + > +**/ > +RETURN_STATUS > +EFIAPI > +SerialPortInitialize ( > + VOID > + ) > +{ > + if (Initiated) { > + return RETURN_SUCCESS; > + } > + if (sifive_uart_init(FixedPcdGet32(PcdU5UartBase), SYS_CLK / 2, UART_BAUDRATE) != 0) { Space before the '(', so: SiFiveUartInit ( > + return EFI_DEVICE_ERROR; > + } > + Initiated = TRUE; > + return RETURN_SUCCESS; > +} > + > +/** > + Write data from buffer to serial device. > + > + Writes NumberOfBytes data bytes from Buffer to the serial device. > + The number of bytes actually written to the serial device is returned. > + If the return value is less than NumberOfBytes, then the write operation failed. > + > + If Buffer is NULL, then ASSERT(). > + > + If NumberOfBytes is zero, then return 0. > + > + @param Buffer Pointer to the data buffer to be written. > + @param NumberOfBytes Number of bytes to written to the serial device. > + > + @retval 0 NumberOfBytes is 0. > + @retval >0 The number of bytes written to the serial device. > + If this value is less than NumberOfBytes, then the write operation failed. > + > +**/ > +UINTN > +EFIAPI > +SerialPortWrite ( > + IN UINT8 *Buffer, > + IN UINTN NumberOfBytes > + ) > +{ > + UINTN Index; > + > + if (Buffer == NULL || Initiated == FALSE) { > + return 0; > + } > + > + for(Index = 0; Index < NumberOfBytes; Index ++) { > + sifive_uart_putc (Buffer [Index]); > + } > + > + return Index; > +} > + > +/** > + Reads data from a serial device into a buffer. > + > + @param Buffer Pointer to the data buffer to store the data read from the serial device. > + @param NumberOfBytes Number of bytes to read from the serial device. > + > + @retval 0 NumberOfBytes is 0. > + @retval >0 The number of bytes read from the serial device. > + If this value is less than NumberOfBytes, then the read operation failed. > + > +**/ > +UINTN > +EFIAPI > +SerialPortRead ( > + OUT UINT8 *Buffer, > + IN UINTN NumberOfBytes > + ) > +{ > + UINTN Index; > + > + if (NULL == Buffer || Initiated == FALSE) { > + return 0; > + } > + > + for(Index = 0; Index < NumberOfBytes; Index ++) { Space before '(; > + Buffer [Index] = (UINT8)sifive_uart_getc (); > + } > + > + return Index; > +} > + > +/** > + Polls a serial device to see if there is any data waiting to be read. > + > + Polls aserial device to see if there is any data waiting to be read. > + If there is data waiting to be read from the serial device, then TRUE is returned. > + If there is no data waiting to be read from the serial device, then FALSE is returned. > + > + @retval TRUE Data is waiting to be read from the serial device. > + @retval FALSE There is no data waiting to be read from the serial device. > + > +**/ > +BOOLEAN > +EFIAPI > +SerialPortPoll ( > + VOID > + ) > +{ > + STATIC volatile UINT32 * const uart = (UINT32 *)FixedPcdGet32(PcdU5UartBase); > + UINT32 IP; > + > + if (Initiated == FALSE) { > + return FALSE; > + } > + IP = MmioRead32 ((UINTN)(uart + UART_REG_IP)); > + if(IP & UART_IP_RXWM) { > + return TRUE; > + } > + else { And else on preceding line. / Leif > + return FALSE; > + } > +} > + > +/** > + Sets the control bits on a serial device. > + > + @param Control Sets the bits of Control that are settable. > + > + @retval RETURN_SUCCESS The new control bits were set on the serial device. > + @retval RETURN_UNSUPPORTED The serial device does not support this operation. > + @retval RETURN_DEVICE_ERROR The serial device is not functioning correctly. > + > +**/ > +RETURN_STATUS > +EFIAPI > +SerialPortSetControl ( > + IN UINT32 Control > + ) > +{ > + if (Initiated == FALSE) { > + return EFI_NOT_READY; > + } > + return RETURN_SUCCESS; > +} > + > +/** > + Retrieve the status of the control bits on a serial device. > + > + @param Control A pointer to return the current control signals from the serial device. > + > + @retval RETURN_SUCCESS The control bits were read from the serial device. > + @retval RETURN_UNSUPPORTED The serial device does not support this operation. > + @retval RETURN_DEVICE_ERROR The serial device is not functioning correctly. > + > +**/ > +RETURN_STATUS > +EFIAPI > +SerialPortGetControl ( > + OUT UINT32 *Control > + ) > +{ > + if (Initiated == FALSE) { > + return EFI_NOT_READY; > + } > + *Control = 0; > + return RETURN_SUCCESS; > +} > + > +/** > + Sets the baud rate, receive FIFO depth, transmit/receice time out, parity, > + data bits, and stop bits on a serial device. > + > + @param BaudRate The requested baud rate. A BaudRate value of 0 will use the > + device's default interface speed. > + On output, the value actually set. > + @param ReveiveFifoDepth The requested depth of the FIFO on the receive side of the > + serial interface. A ReceiveFifoDepth value of 0 will use > + the device's default FIFO depth. > + On output, the value actually set. > + @param Timeout The requested time out for a single character in microseconds. > + This timeout applies to both the transmit and receive side of the > + interface. A Timeout value of 0 will use the device's default time > + out value. > + On output, the value actually set. > + @param Parity The type of parity to use on this serial device. A Parity value of > + DefaultParity will use the device's default parity value. > + On output, the value actually set. > + @param DataBits The number of data bits to use on the serial device. A DataBits > + vaule of 0 will use the device's default data bit setting. > + On output, the value actually set. > + @param StopBits The number of stop bits to use on this serial device. A StopBits > + value of DefaultStopBits will use the device's default number of > + stop bits. > + On output, the value actually set. > + > + @retval RETURN_SUCCESS The new attributes were set on the serial device. > + @retval RETURN_UNSUPPORTED The serial device does not support this operation. > + @retval RETURN_INVALID_PARAMETER One or more of the attributes has an unsupported value. > + @retval RETURN_DEVICE_ERROR The serial device is not functioning correctly. > + > +**/ > +RETURN_STATUS > +EFIAPI > +SerialPortSetAttributes ( > + IN OUT UINT64 *BaudRate, > + IN OUT UINT32 *ReceiveFifoDepth, > + IN OUT UINT32 *Timeout, > + IN OUT EFI_PARITY_TYPE *Parity, > + IN OUT UINT8 *DataBits, > + IN OUT EFI_STOP_BITS_TYPE *StopBits > + ) > +{ > + if (Initiated == FALSE) { > + return EFI_NOT_READY; > + } > + return RETURN_SUCCESS; > +} > diff --git a/Platform/SiFive/U5SeriesPkg/Library/SerialIoLib/U5SerialPortLib.uni b/Platform/SiFive/U5SeriesPkg/Library/SerialIoLib/U5SerialPortLib.uni > new file mode 100644 > index 0000000..49163bd > --- /dev/null > +++ b/Platform/SiFive/U5SeriesPkg/Library/SerialIoLib/U5SerialPortLib.uni > @@ -0,0 +1,16 @@ > +// /** @file > +// Library instance for SerialIo library class > +// > +// Library instance for SerialIO library class. > +// > +// Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR> > +// > +// SPDX-License-Identifier: BSD-2-Clause-Patent > +// > +// **/ > + > + > +#string STR_MODULE_ABSTRACT #language en-US "Library instance for SerialIO library class" > + > +#string STR_MODULE_DESCRIPTION #language en-US "Library instance for SerialIO library class." > + > -- > 2.7.4 > ^ permalink raw reply [flat|nested] 5+ messages in thread
[parent not found: <1572228122-13265-15-git-send-email-abner.chang@hpe.com>]
* Re: [platform/devel-riscv-v2 PATCHv5 12/18] U5SeriesPkg/FreedomU540HiFiveUnleashedBoard: Add SiFive U540 platform. [not found] ` <1572228122-13265-15-git-send-email-abner.chang@hpe.com> @ 2019-11-26 15:02 ` Leif Lindholm 0 siblings, 0 replies; 5+ messages in thread From: Leif Lindholm @ 2019-11-26 15:02 UTC (permalink / raw) To: Abner Chang Cc: devel, Michael D Kinney, Ard Biesheuvel, Gilbert Chen, Palmer Dabbelt On Mon, Oct 28, 2019 at 10:01:56 +0800, Abner Chang wrote: > Add SiFive U540 platform build metafiles. There are a few commented-out modules left in the description files, could you delete those (flagged below) please? > Signed-off-by: Abner Chang <abner.chang@hpe.com> > > Cc: Michael D Kinney <michael.d.kinney@intel.com> > Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> > Cc: Leif Lindholm <leif.lindholm@linaro.org> > Cc: Gilbert Chen <gilbert.chen@hpe.com> > Cc: Palmer Dabbelt <palmer@sifive.com> > --- > .../FreedomU540HiFiveUnleashedBoard/U540.dec | 25 + > .../FreedomU540HiFiveUnleashedBoard/U540.dsc | 543 +++++++++++++++++++++ > .../FreedomU540HiFiveUnleashedBoard/U540.fdf | 336 +++++++++++++ > .../FreedomU540HiFiveUnleashedBoard/U540.fdf.inc | 54 ++ > .../VarStore.fdf.inc | 78 +++ > .../FreedomU540HiFiveUnleashedBoard/U540.uni | 13 + > .../U540PkgExtra.uni | 12 + > 7 files changed, 1061 insertions(+) > create mode 100644 Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dec > create mode 100644 Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc > create mode 100644 Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf > create mode 100644 Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf.inc > create mode 100644 Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/VarStore.fdf.inc > create mode 100644 Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.uni > create mode 100644 Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540PkgExtra.uni > > diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dec b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dec > new file mode 100644 > index 0000000..8ad80a1 > --- /dev/null > +++ b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dec > @@ -0,0 +1,25 @@ > +## @file U540.dec > +# This Package provides SiFive U540 modules and libraries. > +# > +# Copyright (c) 2019, Hewlett Packard Enterprise Development LP. All rights reserved.<BR> > +# > +# SPDX-License-Identifier: BSD-2-Clause-Patent > +# > +## > + > +[Defines] > + DEC_SPECIFICATION = 0x0001001b > + PACKAGE_NAME = U540 > + PACKAGE_UNI_FILE = U540.uni > + PACKAGE_GUID = B6569821-3FC0-4FE8-B98A-67CE1517C747 > + PACKAGE_VERSION = 1.0 > + > +[Includes] > + > +[LibraryClasses] > + > +[Guids] > + gUefiRiscVPlatformU540PkgTokenSpaceGuid = {0xDFD87009, 0x27A1, 0x41DD, { 0x84, 0xB1, 0x35, 0xB4, 0xB9, 0x0D, 0x17, 0x63 }} > + > +[UserExtensions.TianoCore."ExtraFiles"] > + U540PkgExtra.uni > diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc > new file mode 100644 > index 0000000..55ea52a > --- /dev/null > +++ b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc > @@ -0,0 +1,543 @@ > +## @file > +# RISC-V EFI on SiFive Freedom U540 HiFive Unleashed RISC-V platform > +# > +# Copyright (c) 2019, Hewlett Packard Enterprise Development LP. All rights reserved.<BR> > +# > +# SPDX-License-Identifier: BSD-2-Clause-Patent > +# > +## > + > +################################################################################ > +# > +# Defines Section - statements that will be processed to create a Makefile. > +# > +################################################################################ > +[Defines] > + PLATFORM_NAME = FreedomU540HiFiveUnleashed > + PLATFORM_GUID = 8317E90F-428B-403F-9057-112B0C19008E > + PLATFORM_VERSION = 0.1 > + DSC_SPECIFICATION = 0x0001001c > + OUTPUT_DIRECTORY = Build/$(PLATFORM_NAME) > + SUPPORTED_ARCHITECTURES = RISCV64 > + BUILD_TARGETS = DEBUG|RELEASE|NOOPT > + SKUID_IDENTIFIER = DEFAULT > + FLASH_DEFINITION = Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf > + > + # > + # Enable below options may cause build error or may not work on > + # the initial version of RISC-V package > + # Defines for default states. These can be changed on the command line. > + # -D FLAG=VALUE > + # > + DEFINE SECURE_BOOT_ENABLE = FALSE > + DEFINE DEBUG_ON_SERIAL_PORT = TRUE > + > + # > + # Network definition > + # > + DEFINE NETWORK_SNP_ENABLE = FALSE > + DEFINE NETWORK_IP6_ENABLE = FALSE > + DEFINE NETWORK_TLS_ENABLE = FALSE > + DEFINE NETWORK_HTTP_BOOT_ENABLE = FALSE > + DEFINE NETWORK_ISCSI_ENABLE = FALSE > + > +[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 > + > +################################################################################ > +# > +# Library Class section - list of all Library Classes needed by this Platform. > +# > +################################################################################ > +[LibraryClasses] > + PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf > + PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf > + BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf > + BaseLib|MdePkg/Library/BaseLib/BaseLib.inf > + SynchronizationLib|MdePkg/Library/BaseSynchronizationLib/BaseSynchronizationLib.inf > + CpuLib|MdePkg/Library/BaseCpuLib/BaseCpuLib.inf > + PerformanceLib|MdePkg/Library/BasePerformanceLibNull/BasePerformanceLibNull.inf > + PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf > + CacheMaintenanceLib|MdePkg/Library/BaseCacheMaintenanceLib/BaseCacheMaintenanceLib.inf > + UefiDecompressLib|MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.inf > + UefiHiiServicesLib|MdeModulePkg/Library/UefiHiiServicesLib/UefiHiiServicesLib.inf > + HiiLib|MdeModulePkg/Library/UefiHiiLib/UefiHiiLib.inf > + CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf > + DxeServicesLib|MdePkg/Library/DxeServicesLib/DxeServicesLib.inf > + DxeServicesTableLib|MdePkg/Library/DxeServicesTableLib/DxeServicesTableLib.inf > + PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf > + PciCf8Lib|MdePkg/Library/BasePciCf8Lib/BasePciCf8Lib.inf > + PciLib|MdePkg/Library/BasePciLibCf8/BasePciLibCf8.inf > + IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf > + OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.inf > + SerialPortLib|Platform/SiFive/U5SeriesPkg/Library/SerialIoLib/SerialIoLib.inf > + UefiLib|MdePkg/Library/UefiLib/UefiLib.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 > + DevicePathLib|MdePkg/Library/UefiDevicePathLibDevicePathProtocol/UefiDevicePathLibDevicePathProtocol.inf > + FileHandleLib|MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.inf > + SecurityManagementLib|MdeModulePkg/Library/DxeSecurityManagementLib/DxeSecurityManagementLib.inf > + UefiUsbLib|MdePkg/Library/UefiUsbLib/UefiUsbLib.inf > + CustomizedDisplayLib|MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.inf > + SortLib|MdeModulePkg/Library/BaseSortLib/BaseSortLib.inf > + UefiBootManagerLib|MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf > + FdtLib|EmbeddedPkg/Library/FdtLib/FdtLib.inf > + > +# RISC-V Platform Library > + TimeBaseLib|EmbeddedPkg//Library/TimeBaseLib/TimeBaseLib.inf > + RealTimeClockLib|EmbeddedPkg//Library/VirtualRealTimeClockLib/VirtualRealTimeClockLib.inf > + > +# RISC-V Core Library > + RiscVOpensbiLib|RiscVPkg/Library/RiscVOpensbiLib/RiscVOpensbiLib.inf > + > +!ifdef $(SOURCE_DEBUG_ENABLE) > + PeCoffExtraActionLib|SourceLevelDebugPkg/Library/PeCoffExtraActionLibDebug/PeCoffExtraActionLibDebug.inf > + DebugCommunicationLib|SourceLevelDebugPkg/Library/DebugCommunicationLibSerialPort/DebugCommunicationLibSerialPort.inf > +!else > + PeCoffExtraActionLib|MdePkg/Library/BasePeCoffExtraActionLibNull/BasePeCoffExtraActionLibNull.inf > + DebugAgentLib|MdeModulePkg/Library/DebugAgentLibNull/DebugAgentLibNull.inf > +!endif > + > + DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf > + > +!if $(SECURE_BOOT_ENABLE) == TRUE > + IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf > + OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf > + TpmMeasurementLib|SecurityPkg/Library/DxeTpmMeasurementLib/DxeTpmMeasurementLib.inf > + AuthVariableLib|SecurityPkg/Library/AuthVariableLib/AuthVariableLib.inf > +!else > + TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.inf > + AuthVariableLib|MdeModulePkg/Library/AuthVariableLibNull/AuthVariableLibNull.inf > +!endif > + VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf > + > +!if $(HTTP_BOOT_ENABLE) == TRUE > + HttpLib|MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.inf > +!endif > + > +# ACPI not supported yet. > + #S3BootScriptLib|MdeModulePkg/Library/PiDxeS3BootScriptLib/DxeS3BootScriptLib.inf > + SmbusLib|MdePkg/Library/BaseSmbusLibNull/BaseSmbusLibNull.inf > + OrderedCollectionLib|MdePkg/Library/BaseOrderedCollectionRedBlackTreeLib/BaseOrderedCollectionRedBlackTreeLib.inf > + > +[LibraryClasses.common] > +!if $(SECURE_BOOT_ENABLE) == TRUE > + BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf > +!endif > + RiscVCpuLib|RiscVPkg/Library/RiscVCpuLib/RiscVCpuLib.inf > + RiscVPlatformTimerLib|Platform/SiFive/U5SeriesPkg/Library/RiscVPlatformTimerLib/RiscVPlatformTimerLib.inf > + CpuExceptionHandlerLib|RiscVPkg/Library/RiscVExceptionLib/CpuExceptionHandlerDxeLib.inf > + > +[LibraryClasses.common.SEC] > +!ifdef $(DEBUG_ON_SERIAL_PORT) > + DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf > +!else > + DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf > +!endif > + > + ReportStatusCodeLib|MdeModulePkg/Library/PeiReportStatusCodeLib/PeiReportStatusCodeLib.inf > + ExtractGuidedSectionLib|MdePkg/Library/BaseExtractGuidedSectionLib/BaseExtractGuidedSectionLib.inf > + > +!ifdef $(SOURCE_DEBUG_ENABLE) > + DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/SecPeiDebugAgentLib.inf > +!endif > + > + MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf > + > +# > +# OpenSBi Platform Library > +# > + RiscVOpensbiPlatformLib|Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Library/OpensbiPlatformLib/OpensbiPlatformLib.inf > + > +[LibraryClasses.common.PEI_CORE] > + HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf > + PeiServicesTablePointerLib|RiscVPkg/Library/PeiServicesTablePointerLibOpenSbi/PeiServicesTablePointerLibOpenSbi.inf > + PeiServicesLib|MdePkg/Library/PeiServicesLib/PeiServicesLib.inf > + MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf > + PeiCoreEntryPoint|MdePkg/Library/PeiCoreEntryPoint/PeiCoreEntryPoint.inf > + ReportStatusCodeLib|MdeModulePkg/Library/PeiReportStatusCodeLib/PeiReportStatusCodeLib.inf > + OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.inf > + PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf > +!ifdef $(DEBUG_ON_SERIAL_PORT) > + DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf > +!else > + DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf > +!endif > + PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf > + > +[LibraryClasses.common.PEIM] > + HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf > + PeiServicesTablePointerLib|RiscVPkg/Library/PeiServicesTablePointerLibOpenSbi/PeiServicesTablePointerLibOpenSbi.inf > + PeiServicesLib|MdePkg/Library/PeiServicesLib/PeiServicesLib.inf > + MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf > + PeimEntryPoint|MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf > + ReportStatusCodeLib|MdeModulePkg/Library/PeiReportStatusCodeLib/PeiReportStatusCodeLib.inf > + OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.inf > + PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf > +!ifdef $(DEBUG_ON_SERIAL_PORT) > + DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf > +!else > + DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf > +!endif > + PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf > + PeiResourcePublicationLib|MdePkg/Library/PeiResourcePublicationLib/PeiResourcePublicationLib.inf > + ExtractGuidedSectionLib|MdePkg/Library/PeiExtractGuidedSectionLib/PeiExtractGuidedSectionLib.inf > +!ifdef $(SOURCE_DEBUG_ENABLE) > + DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/SecPeiDebugAgentLib.inf > +!endif > + FirmwareContextProcessorSpecificLib|RiscVPlatformPkg/Library/FirmwareContextProcessorSpecificLib/FirmwareContextProcessorSpecificLib.inf > + RiscVPlatformDxeIplLib|RiscVPkg/Library/RiscVDxeIplHandoffOpenSbiLib/RiscVDxeIplHandoffOpenSbiLib.inf > + > +# > +# RISC-V core libraries > +# > + SiliconSiFiveE51CoreInfoLib|Silicon/SiFive/E51/Library/PeiCoreInfoHobLib/PeiCoreInfoHobLib.inf > + SiliconSiFiveU54CoreInfoLib|Silicon/SiFive/U54/Library/PeiCoreInfoHobLib/PeiCoreInfoHobLib.inf > + SiliconSiFiveU5MCCoreplexInfoLib|Platform/SiFive/U5SeriesPkg/Library/PeiCoreInfoHobLib/PeiCoreInfoHobLib.inf > + > +[LibraryClasses.common.DXE_CORE] > + TimerLib|RiscVPkg/Library/RiscVTimerLib/BaseRiscVTimerLib.inf > + HobLib|MdePkg/Library/DxeCoreHobLib/DxeCoreHobLib.inf > + DxeCoreEntryPoint|MdePkg/Library/DxeCoreEntryPoint/DxeCoreEntryPoint.inf > + MemoryAllocationLib|MdeModulePkg/Library/DxeCoreMemoryAllocationLib/DxeCoreMemoryAllocationLib.inf > + ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf > +!ifdef $(DEBUG_ON_SERIAL_PORT) > + DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf > +!else > + DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf > +!endif > + ExtractGuidedSectionLib|MdePkg/Library/DxeExtractGuidedSectionLib/DxeExtractGuidedSectionLib.inf > +!ifdef $(SOURCE_DEBUG_ENABLE) > + DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgentLib.inf > +!endif > + #CpuExceptionHandlerLib|UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuExceptionHandlerLib.inf Like here. > + > +[LibraryClasses.common.DXE_RUNTIME_DRIVER] > + PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf > + TimerLib|RiscVPkg/Library/RiscVTimerLib/BaseRiscVTimerLib.inf > + HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf > + DxeCoreEntryPoint|MdePkg/Library/DxeCoreEntryPoint/DxeCoreEntryPoint.inf > + MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf > + ReportStatusCodeLib|MdeModulePkg/Library/RuntimeDxeReportStatusCodeLib/RuntimeDxeReportStatusCodeLib.inf > +!ifdef $(DEBUG_ON_SERIAL_PORT) > + DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf > +!else > + DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf > +!endif > + UefiRuntimeLib|MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf > +!if $(SECURE_BOOT_ENABLE) == TRUE > + BaseCryptLib|CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf > +!endif > + UefiBootManagerLib|MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf > + > +[LibraryClasses.common.UEFI_DRIVER] > + PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf > + TimerLib|RiscVPkg/Library/RiscVTimerLib/BaseRiscVTimerLib.inf > + HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf > + DxeCoreEntryPoint|MdePkg/Library/DxeCoreEntryPoint/DxeCoreEntryPoint.inf > + MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf > + ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf > +!ifdef $(DEBUG_ON_SERIAL_PORT) > + DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf > +!else > + DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf > +!endif > + UefiScsiLib|MdePkg/Library/UefiScsiLib/UefiScsiLib.inf > + > +[LibraryClasses.common.DXE_DRIVER] > + PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf > + TimerLib|RiscVPkg/Library/RiscVTimerLib/BaseRiscVTimerLib.inf > + HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf > + MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf > + ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf > + UefiScsiLib|MdePkg/Library/UefiScsiLib/UefiScsiLib.inf > +!ifdef $(DEBUG_ON_SERIAL_PORT) > + DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf > +!else > + DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf > +!endif > +!ifdef $(SOURCE_DEBUG_ENABLE) > + DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgentLib.inf > +!endif > + UefiBootManagerLib|MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf > + PlatformBootManagerLib|RiscVPlatformPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf > + PlatformMemoryTestLib|RiscVPlatformPkg/Library/PlatformMemoryTestLibNull/PlatformMemoryTestLibNull.inf > + PlatformUpdateProgressLib|RiscVPlatformPkg/Library/PlatformUpdateProgressLibNull/PlatformUpdateProgressLibNull.inf > + > +[LibraryClasses.common.UEFI_APPLICATION] > + PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf > + TimerLib|RiscVPkg/Library/RiscVTimerLib/BaseRiscVTimerLib.inf > + HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf > + MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf > +!ifdef $(DEBUG_ON_SERIAL_PORT) > + DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf > +!else > + DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf > +!endif > + ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf > + > +################################################################################ > +# > +# Pcd Section - list of all EDK II PCD Entries defined by this Platform. > +# > +################################################################################ > +[PcdsFeatureFlag] > + gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeUseSerial|TRUE > + gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeUseMemory|FALSE > + gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSupportUefiDecompress|FALSE > + gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE > + gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport|FALSE > + > +[PcdsFixedAtBuild] > + gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeMemorySize|1 > + gEfiMdeModulePkgTokenSpaceGuid.PcdResetOnMemoryTypeInformationChange|FALSE > + gEfiMdePkgTokenSpaceGuid.PcdMaximumGuidedExtractHandler|0x10 > + gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVariableSize|0x2000 > + gEfiMdeModulePkgTokenSpaceGuid.PcdMaxHardwareErrorVariableSize|0x8000 > + gEfiMdeModulePkgTokenSpaceGuid.PcdVariableStoreSize|0xe000 > + > + gEfiMdeModulePkgTokenSpaceGuid.PcdVpdBaseAddress|0x0 > + > + gEfiMdePkgTokenSpaceGuid.PcdReportStatusCodePropertyMask|0x07 > + gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x8000004F > +!ifdef $(SOURCE_DEBUG_ENABLE) > + gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0x17 > +!else > + gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0x2F > +!endif > + > +!ifdef $(SOURCE_DEBUG_ENABLE) > + gEfiSourceLevelDebugPkgTokenSpaceGuid.PcdDebugLoadImageMethod|0x2 > +!endif > + > + #gUefiPayloadPkgTokenSpaceGuid.PcdShellFile|{ 0x83, 0xA5, 0x04, 0x7C, 0x3E, 0x9E, 0x1C, 0x4F, 0xAD, 0x65, 0xE0, 0x52, 0x68, 0xD0, 0xB4, 0xD1 } > + > +!if $(SECURE_BOOT_ENABLE) == TRUE > + # override the default values from SecurityPkg to ensure images from all sources are verified in secure boot > + gEfiSecurityPkgTokenSpaceGuid.PcdOptionRomImageVerificationPolicy|0x04 > + gEfiSecurityPkgTokenSpaceGuid.PcdFixedMediaImageVerificationPolicy|0x04 > + gEfiSecurityPkgTokenSpaceGuid.PcdRemovableMediaImageVerificationPolicy|0x04 > +!endif > + > + # > + # F2 for UI APP > + # > + gEfiMdeModulePkgTokenSpaceGuid.PcdBootManagerMenuFile|{ 0x21, 0xaa, 0x2c, 0x46, 0x14, 0x76, 0x03, 0x45, 0x83, 0x6e, 0x8a, 0xb6, 0xf4, 0x66, 0x23, 0x31 } > + > +################################################################################ > +# > +# Pcd Dynamic Section - list of all EDK II PCD Entries defined by this Platform > +# > +################################################################################ > + > +[PcdsDynamicDefault] > + gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvStoreReserved|0 > + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64|0 > + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase|0 > + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase|0 > + gEfiMdeModulePkgTokenSpaceGuid.PcdPciDisableBusEnumeration|FALSE > + gEfiMdeModulePkgTokenSpaceGuid.PcdVideoHorizontalResolution|800 > + gEfiMdeModulePkgTokenSpaceGuid.PcdVideoVerticalResolution|600 > + > + gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut|0 > + > + # Set video resolution for text setup. > + gEfiMdeModulePkgTokenSpaceGuid.PcdSetupVideoHorizontalResolution|640 > + gEfiMdeModulePkgTokenSpaceGuid.PcdSetupVideoVerticalResolution|480 > + > + gEfiMdeModulePkgTokenSpaceGuid.PcdSmbiosVersion|0x0208 > + gEfiMdeModulePkgTokenSpaceGuid.PcdSmbiosDocRev|0x0 > + > +################################################################################ > +# > +# Components Section - list of all EDK II Modules needed by this Platform. > +# > +################################################################################ > +[Components] > + > + # > + # SEC Phase modules > + # > + RiscVPlatformPkg/Universal/Sec/SecMain.inf > + > + # > + # PEI Phase modules > + # > + MdeModulePkg/Core/Pei/PeiMain.inf > + MdeModulePkg/Universal/PCD/Pei/Pcd.inf { > + <LibraryClasses> > + PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf > + } > + MdeModulePkg/Universal/ReportStatusCodeRouter/Pei/ReportStatusCodeRouterPei.inf > + MdeModulePkg/Universal/StatusCodeHandler/Pei/StatusCodeHandlerPei.inf > + MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf { > + <LibraryClasses> > + NULL|MdeModulePkg/Library/LzmaCustomDecompressLib/LzmaCustomDecompressLib.inf > + } > + > + Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Universal/Pei/PlatformPei/PlatformPei.inf { > + <LibraryClasses> > + PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf > + } > + > + # > + # DXE Phase modules > + # > + MdeModulePkg/Core/Dxe/DxeMain.inf { > + <LibraryClasses> > + NULL|MdeModulePkg//Library/LzmaCustomDecompressLib/LzmaCustomDecompressLib.inf > + DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf > + } > + > + MdeModulePkg/Universal/ReportStatusCodeRouter/RuntimeDxe/ReportStatusCodeRouterRuntimeDxe.inf > + MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/StatusCodeHandlerRuntimeDxe.inf > + > + MdeModulePkg/Universal/PCD/Dxe/Pcd.inf { > + <LibraryClasses> > + PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf > + } > + > + MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf > + > +!if $(SECURE_BOOT_ENABLE) == TRUE > + MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf { > + <LibraryClasses> > + NULL|SecurityPkg/Library/DxeImageVerificationLib/DxeImageVerificationLib.inf > + } > +!else > + MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf > +!endif > + > + # > + # EBC not supported on RISC-V yet > + # > + #MdeModulePkg/Universal/EbcDxe/EbcDxe.inf > + > + UefiCpuPkg/CpuIo2Dxe/CpuIo2Dxe.inf > + MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf { > + <LibraryClasses> > + PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf > + } > + MdeModulePkg/Universal/Metronome/Metronome.inf > + MdeModulePkg/Universal/BdsDxe/BdsDxe.inf > + MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.inf { > + <LibraryClasses> > + ResetSystemLib|MdeModulePkg/Library/BaseResetSystemLibNull/BaseResetSystemLibNull.inf > + } > + EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.inf > + > + # > + # RISC-V Platform module > + # > + Platform/SiFive/U5SeriesPkg/Universal/Dxe/TimerDxe/TimerDxe.inf > + Platform/SiFive/U5SeriesPkg/Universal/Dxe/RamFvbServicesRuntimeDxe/FvbServicesRuntimeDxe.inf > + > + # > + # RISC-V Core module > + # > + RiscVPkg/Universal/CpuDxe/CpuDxe.inf > + RiscVPkg/Universal/SmbiosDxe/RiscVSmbiosDxe.inf > + > + MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf > + MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf { > + <LibraryClasses> > + NULL|MdeModulePkg/Library/VarCheckUefiLib/VarCheckUefiLib.inf > + } > + MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf > + MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf > + MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf > + MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatformDxe.inf > + MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf > + > +# No graphic console supported yet. > +# MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.inf { > +# <LibraryClasses> > +# PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf > +# } And here. > + MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf > + MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf { > + <LibraryClasses> > + DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf > + PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf > + } > + MdeModulePkg/Universal/PrintDxe/PrintDxe.inf > + MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf > + MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf > + MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf > + MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBusDxe.inf > + MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDiskDxe.inf > + MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf > + MdeModulePkg/Universal/SetupBrowserDxe/SetupBrowserDxe.inf > + MdeModulePkg/Universal/DisplayEngineDxe/DisplayEngineDxe.inf > + MdeModulePkg/Universal/MemoryTest/NullMemoryTestDxe/NullMemoryTestDxe.inf > + MdeModulePkg/Universal/SerialDxe/SerialDxe.inf > + > + # > + # SMBIOS Support > + # > + MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf > + > + # > + # ACPI Support > + # Not support on RISC-V yet > + # > + #MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf > + #MdeModulePkg/Universal/Acpi/S3SaveStateDxe/S3SaveStateDxe.inf > + > + # > + # Network Support > + # > + !include NetworkPkg/Network.dsc.inc > + > + # > + # Usb Support > + # > + MdeModulePkg/Bus/Pci/UhciDxe/UhciDxe.inf > + MdeModulePkg/Bus/Pci/EhciDxe/EhciDxe.inf > + MdeModulePkg/Bus/Pci/XhciDxe/XhciDxe.inf > + MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBusDxe.inf > + MdeModulePkg/Bus/Usb/UsbKbDxe/UsbKbDxe.inf > + MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassStorageDxe.inf > + > + > + ShellPkg/Application/Shell/Shell.inf { > + <LibraryClasses> > + ShellCommandLib|ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.inf > + NULL|ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.inf > + NULL|ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.inf > + NULL|ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.inf > + NULL|ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.inf > + NULL|ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.inf > + NULL|ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1CommandsLib.inf > + NULL|ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.inf > + HandleParsingLib|ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf > + ShellLib|ShellPkg/Library/UefiShellLib/UefiShellLib.inf > + FileHandleLib|MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.inf > + SortLib|MdeModulePkg/Library/UefiSortLib/UefiSortLib.inf > + PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf > + BcfgCommandLib|ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.inf > + > + <PcdsFixedAtBuild> > + gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0xFF > + gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE > + gEfiMdePkgTokenSpaceGuid.PcdUefiLibMaxPrintBufferSize|8000 > + } > + > +!if $(SECURE_BOOT_ENABLE) == TRUE > + SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigDxe.inf > +!endif > + > + MdeModulePkg/Application/UiApp/UiApp.inf > diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf > new file mode 100644 > index 0000000..0707ad9 > --- /dev/null > +++ b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf > @@ -0,0 +1,336 @@ > +# @file > +# Flash definition file on SiFive Freedom U540 HiFive Unleashed RISC-V platform > +# > +# Copyright (c) 2019, Hewlett Packard Enterprise Development LP. All rights reserved.<BR> > +# > +# SPDX-License-Identifier: BSD-2-Clause-Patent > +# > +## > +# > +# Platform definitions > +# > +!include U540.fdf.inc > + > +# > +# Build the variable store and the firmware code as one unified flash device > +# image. > +# > +[FD.U540] > +BaseAddress = $(FW_BASE_ADDRESS) > +Size = $(FW_SIZE) > +ErasePolarity = 1 > +BlockSize = $(BLOCK_SIZE) > +NumBlocks = $(FW_BLOCKS) > + > +$(SECFV_OFFSET)|$(SECFV_SIZE) > +gUefiRiscVPlatformPkgTokenSpaceGuid.PcdRiscVSecFvBase|gUefiRiscVPlatformPkgTokenSpaceGuid.PcdRiscVSecFvSize > +FV = SECFV > + > +$(PEIFV_OFFSET)|$(PEIFV_SIZE) > +gUefiRiscVPlatformPkgTokenSpaceGuid.PcdRiscVPeiFvBase|gUefiRiscVPlatformPkgTokenSpaceGuid.PcdRiscVPeiFvSize > +FV = PEIFV > + > +$(FVMAIN_OFFSET)|$(FVMAIN_SIZE) > +gUefiRiscVPlatformPkgTokenSpaceGuid.PcdRiscVDxeFvBase|gUefiRiscVPlatformPkgTokenSpaceGuid.PcdRiscVDxeFvSize > +FV = FVMAIN_COMPACT > + > +!include VarStore.fdf.inc > + > +################################################################################ > + > +[FV.SECFV] > +BlockSize = 0x1000 > +FvAlignment = 16 > +ERASE_POLARITY = 1 > +MEMORY_MAPPED = TRUE > +STICKY_WRITE = TRUE > +LOCK_CAP = TRUE > +LOCK_STATUS = TRUE > +WRITE_DISABLED_CAP = TRUE > +WRITE_ENABLED_CAP = TRUE > +WRITE_STATUS = TRUE > +WRITE_LOCK_CAP = TRUE > +WRITE_LOCK_STATUS = TRUE > +READ_DISABLED_CAP = TRUE > +READ_ENABLED_CAP = TRUE > +READ_STATUS = TRUE > +READ_LOCK_CAP = TRUE > +READ_LOCK_STATUS = TRUE > + > +# > +# SEC Phase modules > +# > +# The code in this FV handles the initial firmware startup, and > +# decompresses the PEI and DXE FVs which handles the rest of the boot sequence. > +# > +INF RiscVPlatformPkg/Universal/Sec/SecMain.inf > + > +################################################################################ > +[FV.PEIFV] > +BlockSize = 0x10000 > +FvAlignment = 16 > +ERASE_POLARITY = 1 > +MEMORY_MAPPED = TRUE > +STICKY_WRITE = TRUE > +LOCK_CAP = TRUE > +LOCK_STATUS = TRUE > +WRITE_DISABLED_CAP = TRUE > +WRITE_ENABLED_CAP = TRUE > +WRITE_STATUS = TRUE > +WRITE_LOCK_CAP = TRUE > +WRITE_LOCK_STATUS = TRUE > +READ_DISABLED_CAP = TRUE > +READ_ENABLED_CAP = TRUE > +READ_STATUS = TRUE > +READ_LOCK_CAP = TRUE > +READ_LOCK_STATUS = TRUE > + > +APRIORI PEI { > + INF MdeModulePkg/Universal/ReportStatusCodeRouter/Pei/ReportStatusCodeRouterPei.inf > + INF MdeModulePkg/Universal/StatusCodeHandler/Pei/StatusCodeHandlerPei.inf > + INF MdeModulePkg/Universal/PCD/Pei/Pcd.inf > +} > + > +# > +# PEI Phase modules > +# > +INF MdeModulePkg/Core/Pei/PeiMain.inf > +INF MdeModulePkg/Universal/PCD/Pei/Pcd.inf > +INF MdeModulePkg/Universal/ReportStatusCodeRouter/Pei/ReportStatusCodeRouterPei.inf > +INF MdeModulePkg/Universal/StatusCodeHandler/Pei/StatusCodeHandlerPei.inf > +INF MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf > + > +# RISC-V Platform PEI Driver > +INF Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Universal/Pei/PlatformPei/PlatformPei.inf > + > +################################################################################ > + > +[FV.DXEFV] > +BlockSize = 0x10000 > +FvAlignment = 16 > +ERASE_POLARITY = 1 > +MEMORY_MAPPED = TRUE > +STICKY_WRITE = TRUE > +LOCK_CAP = TRUE > +LOCK_STATUS = TRUE > +WRITE_DISABLED_CAP = TRUE > +WRITE_ENABLED_CAP = TRUE > +WRITE_STATUS = TRUE > +WRITE_LOCK_CAP = TRUE > +WRITE_LOCK_STATUS = TRUE > +READ_DISABLED_CAP = TRUE > +READ_ENABLED_CAP = TRUE > +READ_STATUS = TRUE > +READ_LOCK_CAP = TRUE > +READ_LOCK_STATUS = TRUE > + > +APRIORI DXE { > + INF MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf > + INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf > + INF Platform/SiFive/U5SeriesPkg/Universal/Dxe/RamFvbServicesRuntimeDxe/FvbServicesRuntimeDxe.inf > +} > + > +# > +# DXE Phase modules > +# > +INF MdeModulePkg/Core/Dxe/DxeMain.inf > + > +INF MdeModulePkg/Universal/ReportStatusCodeRouter/RuntimeDxe/ReportStatusCodeRouterRuntimeDxe.inf > +INF MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/StatusCodeHandlerRuntimeDxe.inf > +INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf > + > +INF MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf > +INF MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf > +INF UefiCpuPkg/CpuIo2Dxe/CpuIo2Dxe.inf > +INF MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf > +INF MdeModulePkg/Universal/Metronome/Metronome.inf > +INF EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.inf > + > +# RISC-V Platform Drivers > +INF Platform/SiFive/U5SeriesPkg/Universal/Dxe/RamFvbServicesRuntimeDxe/FvbServicesRuntimeDxe.inf > + > +# RISC-V Core Drivers > +INF Platform/SiFive/U5SeriesPkg/Universal/Dxe/TimerDxe/TimerDxe.inf > +INF RiscVPkg/Universal/CpuDxe/CpuDxe.inf > +INF RiscVPkg/Universal/SmbiosDxe/RiscVSmbiosDxe.inf > + > +INF MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf > + > +INF MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf > +!if $(SECURE_BOOT_ENABLE) == TRUE > + INF SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigDxe.inf > +!endif > + > +INF MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.inf > +INF MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf > +INF MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf > +INF MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf > +INF MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatformDxe.inf > +INF MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf > +#INF MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.inf And here. > +INF MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf > +INF MdeModulePkg/Universal/BdsDxe/BdsDxe.inf > +INF MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf > +INF MdeModulePkg/Universal/PrintDxe/PrintDxe.inf > +INF MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf > +INF MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf > +INF MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf > +INF MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBusDxe.inf > +INF MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDiskDxe.inf > +INF MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf > +INF MdeModulePkg/Universal/SetupBrowserDxe/SetupBrowserDxe.inf > +INF MdeModulePkg/Universal/DisplayEngineDxe/DisplayEngineDxe.inf > +INF MdeModulePkg/Universal/MemoryTest/NullMemoryTestDxe/NullMemoryTestDxe.inf > + > +!ifndef $(SOURCE_DEBUG_ENABLE) > +INF MdeModulePkg/Universal/SerialDxe/SerialDxe.inf > +!endif > + > +INF MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf > + > +# > +# ACPI is not supported yet on RISC-V package. > +# > +#INF MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf > +#INF MdeModulePkg/Universal/Acpi/S3SaveStateDxe/S3SaveStateDxe.inf > +#INF PcAtChipsetPkg/IsaAcpiDxe/IsaAcpi.inf > + > +#INF RuleOverride = BINARY FatBinPkg/EnhancedFatDxe/Fat.inf And here. > + > +INF ShellPkg/Application/Shell/Shell.inf > + > +# > +# Network modules > +# > +!if $(E1000_ENABLE) > + FILE DRIVER = 5D695E11-9B3F-4b83-B25F-4A8D5D69BE07 { > + SECTION PE32 = Intel3.5/EFIX64/E3507X2.EFI > + } > +!endif > + > +!include NetworkPkg/Network.fdf.inc > + > +# > +# Usb Support > +# > +INF MdeModulePkg/Bus/Pci/UhciDxe/UhciDxe.inf > +INF MdeModulePkg/Bus/Pci/EhciDxe/EhciDxe.inf > +INF MdeModulePkg/Bus/Pci/XhciDxe/XhciDxe.inf > +INF MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBusDxe.inf > +INF MdeModulePkg/Bus/Usb/UsbKbDxe/UsbKbDxe.inf > +INF MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassStorageDxe.inf > + > +INF MdeModulePkg/Application/UiApp/UiApp.inf > + > +################################################################################ > + > +[FV.FVMAIN_COMPACT] > +FvAlignment = 16 > +ERASE_POLARITY = 1 > +MEMORY_MAPPED = TRUE > +STICKY_WRITE = TRUE > +LOCK_CAP = TRUE > +LOCK_STATUS = TRUE > +WRITE_DISABLED_CAP = TRUE > +WRITE_ENABLED_CAP = TRUE > +WRITE_STATUS = TRUE > +WRITE_LOCK_CAP = TRUE > +WRITE_LOCK_STATUS = TRUE > +READ_DISABLED_CAP = TRUE > +READ_ENABLED_CAP = TRUE > +READ_STATUS = TRUE > +READ_LOCK_CAP = TRUE > +READ_LOCK_STATUS = TRUE > +FvNameGuid = 27A72E80-3118-4c0c-8673-AA5B4EFA9613 > + > +FILE FV_IMAGE = 9E21FD93-9C72-4c15-8C4B-E77F1DB2D792 { > + SECTION GUIDED EE4E5898-3914-4259-9D6E-DC7BD79403CF PROCESSING_REQUIRED = TRUE { > + # > + # These firmware volumes will have files placed in them uncompressed, > + # and then both firmware volumes will be compressed in a single > + # compression operation in order to achieve better overall compression. > + # > + SECTION FV_IMAGE = DXEFV > + } > + } > + > +[Rule.Common.SEC] > + FILE SEC = $(NAMED_GUID) RELOCS_STRIPPED { > + PE32 PE32 Align=4K $(INF_OUTPUT)/$(MODULE_NAME).efi > + UI STRING ="$(MODULE_NAME)" Optional > + VERSION STRING ="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER) > + } > + > +[Rule.Common.PEI_CORE] > + FILE PEI_CORE = $(NAMED_GUID) { > + PE32 PE32 Align=4K $(INF_OUTPUT)/$(MODULE_NAME).efi > + UI STRING ="$(MODULE_NAME)" Optional > + VERSION STRING ="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER) > + } > + > +[Rule.Common.PEIM] > + FILE PEIM = $(NAMED_GUID) { > + PEI_DEPEX PEI_DEPEX Optional $(INF_OUTPUT)/$(MODULE_NAME).depex > + PE32 PE32 Align=4K $(INF_OUTPUT)/$(MODULE_NAME).efi > + UI STRING="$(MODULE_NAME)" Optional > + VERSION STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER) > + } > + > +[Rule.Common.DXE_CORE] > + FILE DXE_CORE = $(NAMED_GUID) { > + PE32 PE32 Align=4K $(INF_OUTPUT)/$(MODULE_NAME).efi > + UI STRING="$(MODULE_NAME)" Optional > + VERSION STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER) > + } > + > +[Rule.Common.DXE_DRIVER] > + FILE DRIVER = $(NAMED_GUID) { > + DXE_DEPEX DXE_DEPEX Optional $(INF_OUTPUT)/$(MODULE_NAME).depex > + PE32 PE32 Align=4K $(INF_OUTPUT)/$(MODULE_NAME).efi > + UI STRING="$(MODULE_NAME)" Optional > + VERSION STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER) > + } > + > +[Rule.Common.DXE_RUNTIME_DRIVER] > + FILE DRIVER = $(NAMED_GUID) { > + DXE_DEPEX DXE_DEPEX Optional $(INF_OUTPUT)/$(MODULE_NAME).depex > + PE32 PE32 Align = 4K $(INF_OUTPUT)/$(MODULE_NAME).efi > + UI STRING="$(MODULE_NAME)" Optional > + VERSION STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER) > + } > + > +[Rule.Common.UEFI_DRIVER] > + FILE DRIVER = $(NAMED_GUID) { > + DXE_DEPEX DXE_DEPEX Optional $(INF_OUTPUT)/$(MODULE_NAME).depex > + PE32 PE32 Align=4K $(INF_OUTPUT)/$(MODULE_NAME).efi > + UI STRING="$(MODULE_NAME)" Optional > + VERSION STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER) > + } > + > +[Rule.Common.UEFI_DRIVER.BINARY] > + FILE DRIVER = $(NAMED_GUID) { > + DXE_DEPEX DXE_DEPEX Optional |.depex > + PE32 PE32 Align=4K |.efi > + UI STRING="$(MODULE_NAME)" Optional > + VERSION STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER) > + } > + > +[Rule.Common.UEFI_APPLICATION] > + FILE APPLICATION = $(NAMED_GUID) { > + PE32 PE32 Align=4K $(INF_OUTPUT)/$(MODULE_NAME).efi > + UI STRING="$(MODULE_NAME)" Optional > + VERSION STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER) > + } > + > +[Rule.Common.UEFI_APPLICATION.BINARY] > + FILE APPLICATION = $(NAMED_GUID) { > + PE32 PE32 Align=4K |.efi > + UI STRING="$(MODULE_NAME)" Optional > + VERSION STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER) > + } > + > +[Rule.Common.USER_DEFINED.ACPITABLE] > + FILE FREEFORM = $(NAMED_GUID) { > + RAW ACPI |.acpi > + RAW ASL |.aml > + } > diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf.inc b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf.inc > new file mode 100644 > index 0000000..00a2315 > --- /dev/null > +++ b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf.inc > @@ -0,0 +1,54 @@ > +## @file > +# Definitions of Flash definition file on SiFive Freedom U540 HiFive Unleashed RISC-V platform > +# > +# Copyright (c) 2019, Hewlett Packard Enterprise Development LP. All rights reserved.<BR> > +# > +# SPDX-License-Identifier: BSD-2-Clause-Patent > +# > +## > +[Defines] > +DEFINE BLOCK_SIZE = 0x1000 > + > +DEFINE FW_BASE_ADDRESS = 0x80000000 > +DEFINE FW_SIZE = 0x00800000 > +DEFINE FW_BLOCKS = 0x800 > + > +# > +# 0x000000-0x7DFFFF code > +# 0x7E0000-0x800000 variables > +# > +DEFINE CODE_BASE_ADDRESS = 0x80000000 > +DEFINE CODE_SIZE = 0x007E0000 > +DEFINE CODE_BLOCKS = 0x7E0 > +DEFINE VARS_BLOCKS = 0x20 > + > +DEFINE SECFV_OFFSET = 0x00000000 > +DEFINE SECFV_SIZE = 0x00020000 > +DEFINE PEIFV_OFFSET = 0x00020000 > +DEFINE PEIFV_SIZE = 0x00080000 > +DEFINE SCRATCH_OFFSET = 0x000a0000 > +DEFINE SCRATCH_SIZE = 0x00010000 > +DEFINE FVMAIN_OFFSET = 0x00100000 # Must be power of 2 for PMP setting > +DEFINE FVMAIN_SIZE = 0x0018C000 > +DEFINE VARS_OFFSET = 0x007E0000 > +DEFINE VARS_SIZE = 0x00020000 > + > +SET gUefiRiscVPlatformPkgTokenSpaceGuid.PcdVariableFdBaseAddress = $(FW_BASE_ADDRESS) + $(VARS_OFFSET) > +SET gUefiRiscVPlatformPkgTokenSpaceGuid.PcdVariableFdSize = $(VARS_SIZE) > +SET gUefiRiscVPlatformPkgTokenSpaceGuid.PcdVariableFdBlockSize = $(BLOCK_SIZE) > + > +SET gUefiRiscVPlatformPkgTokenSpaceGuid.PcdFwStartAddress = $(CODE_BASE_ADDRESS) > +SET gUefiRiscVPlatformPkgTokenSpaceGuid.PcdFwEndAddress = $(CODE_BASE_ADDRESS) + $(SECFV_SIZE) + $(PEIFV_SIZE) + $(SCRATCH_SIZE) > +SET gUefiRiscVPlatformPkgTokenSpaceGuid.PcdOpenSbiStackSize = 8192 > +SET gUefiRiscVPlatformPkgTokenSpaceGuid.PcdScratchRamBase = $(CODE_BASE_ADDRESS) + $(SCRATCH_OFFSET) > +SET gUefiRiscVPlatformPkgTokenSpaceGuid.PcdScratchRamSize = $(SCRATCH_SIZE) > +SET gUefiRiscVPlatformPkgTokenSpaceGuid.PcdTemporaryRamBase = $(CODE_BASE_ADDRESS) + $(FW_SIZE) > +SET gUefiRiscVPlatformPkgTokenSpaceGuid.PcdTemporaryRamSize = 0x10000 > + > + > +SET gUefiRiscVPkgTokenSpaceGuid.PcdRiscVMachineTimerFrequencyInHerz = 1000000 > +SET gUefiRiscVPlatformPkgTokenSpaceGuid.PcdHartCount = 5 # Total cores on U540 platform > +SET gUefiRiscVPlatformPkgTokenSpaceGuid.PcdBootHartId = 1 # Boot hart ID > +SET gSiFiveU5SeriesPlatformsPkgTokenSpaceGuid.PcdNumberofU5Cores = 4 # Total U5 cores enabled on U540 platform > +SET gSiFiveU5SeriesPlatformsPkgTokenSpaceGuid.PcdE5MCSupported = True # E51 MC exists. > +SET gSiFiveU5SeriesPlatformsPkgTokenSpaceGuid.PcdU5UartBase = 0x10010000 # Serial port base address > diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/VarStore.fdf.inc b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/VarStore.fdf.inc > new file mode 100644 > index 0000000..c287bb4 > --- /dev/null > +++ b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/VarStore.fdf.inc > @@ -0,0 +1,78 @@ > +## @file > +# FDF include file with Layout Regions that define an empty variable store. > +# > +# Copyright (c) 2019, Hewlett Packard Enterprise Development LP. All rights reserved.<BR> > +# Copyright (C) 2014, Red Hat, Inc. > +# Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR> > +# > +# SPDX-License-Identifier: BSD-2-Clause-Patent > +# > +## > + > +$(VARS_OFFSET)|0x00007000 > +gUefiRiscVPlatformPkgTokenSpaceGuid.PcdPlatformFlashNvStorageVariableBase|gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize > +# > +# NV_VARIABLE_STORE > +# > +DATA = { > + ## This is the EFI_FIRMWARE_VOLUME_HEADER > + # ZeroVector [] > + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, > + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, > + # FileSystemGuid: gEfiSystemNvDataFvGuid = > + # { 0xFFF12B8D, 0x7696, 0x4C8B, > + # { 0xA9, 0x85, 0x27, 0x47, 0x07, 0x5B, 0x4F, 0x50 }} > + 0x8D, 0x2B, 0xF1, 0xFF, 0x96, 0x76, 0x8B, 0x4C, > + 0xA9, 0x85, 0x27, 0x47, 0x07, 0x5B, 0x4F, 0x50, > + # FvLength: 0x20000 > + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, > + # Signature "_FVH" # Attributes > + 0x5f, 0x46, 0x56, 0x48, 0xff, 0xfe, 0x04, 0x00, > + # HeaderLength # CheckSum # ExtHeaderOffset #Reserved #Revision > + 0x48, 0x00, 0x39, 0xF1, 0x00, 0x00, 0x00, 0x02, > + # Blockmap[0]: 0x20 Blocks * 0x1000 Bytes / Block > + 0x00, 0x08, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, > + # Blockmap[1]: End > + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, > + ## This is the VARIABLE_STORE_HEADER > +!if $(SECURE_BOOT_ENABLE) == TRUE > + # Signature: gEfiAuthenticatedVariableGuid = > + # { 0xaaf32c78, 0x947b, 0x439a, > + # { 0xa1, 0x80, 0x2e, 0x14, 0x4e, 0xc3, 0x77, 0x92 }} > + 0x78, 0x2c, 0xf3, 0xaa, 0x7b, 0x94, 0x9a, 0x43, > + 0xa1, 0x80, 0x2e, 0x14, 0x4e, 0xc3, 0x77, 0x92, > +!else > + # Signature: gEfiVariableGuid = > + # { 0xddcf3616, 0x3275, 0x4164, > + # { 0x98, 0xb6, 0xfe, 0x85, 0x70, 0x7f, 0xfe, 0x7d }} > + 0x16, 0x36, 0xcf, 0xdd, 0x75, 0x32, 0x64, 0x41, > + 0x98, 0xb6, 0xfe, 0x85, 0x70, 0x7f, 0xfe, 0x7d, > +!endif > + # Size: 0x7000 (gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize) - > + # 0x48 (size of EFI_FIRMWARE_VOLUME_HEADER) = 0x6fb8 > + # This can speed up the Variable Dispatch a bit. > + 0xB8, 0x6F, 0x00, 0x00, > + # FORMATTED: 0x5A #HEALTHY: 0xFE #Reserved: UINT16 #Reserved1: UINT32 > + 0x5A, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 > +} > + > +0x007e7000|0x00001000 > +gUefiRiscVPlatformPkgTokenSpaceGuid.PcdPlatformFlashNvStorageFtwWorkingBase|gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize > +# > +#NV_FTW_WROK > +# > +DATA = { > + # EFI_FAULT_TOLERANT_WORKING_BLOCK_HEADER->Signature = gEdkiiWorkingBlockSignatureGuid = > + # { 0x9e58292b, 0x7c68, 0x497d, { 0xa0, 0xce, 0x65, 0x0, 0xfd, 0x9f, 0x1b, 0x95 }} > + 0x2b, 0x29, 0x58, 0x9e, 0x68, 0x7c, 0x7d, 0x49, > + 0xa0, 0xce, 0x65, 0x0, 0xfd, 0x9f, 0x1b, 0x95, > + # Crc:UINT32 #WorkingBlockValid:1, WorkingBlockInvalid:1, Reserved > + 0x2c, 0xaf, 0x2c, 0x64, 0xFE, 0xFF, 0xFF, 0xFF, > + # WriteQueueSize: UINT64 > + 0xE0, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 > +} > + > +0x007e8000|0x00018000 > +gUefiRiscVPlatformPkgTokenSpaceGuid.PcdPlatformFlashNvStorageFtwSpareBase|gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize > +# > +#NV_FTW_SPARE > diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.uni b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.uni > new file mode 100644 > index 0000000..49e527b > --- /dev/null > +++ b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.uni > @@ -0,0 +1,13 @@ > +// /** @file > +// SiFive U540 HiFive Unleashed Package Localized Strings and Content. > +// > +// Copyright (c) 2019, Hewlett Packard Enterprise Development LP. All rights reserved.<BR> > +// > +// SPDX-License-Identifier: BSD-2-Clause-Patent > +// > +// **/ > + > + > +#string STR_PACKAGE_ABSTRACT #language en-US "Provides SiFIve Freedom U540 HiFive Unleashed platform modules and libraries" > + > +#string STR_PACKAGE_DESCRIPTION #language en-US "This Package SiFIve Freedom U540 HiFive Unleashed platform modules and libraries." > diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540PkgExtra.uni b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540PkgExtra.uni > new file mode 100644 > index 0000000..dc18f91 > --- /dev/null > +++ b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540PkgExtra.uni > @@ -0,0 +1,12 @@ > +// /** @file > +// SiFive U540 Package Localized Strings and Content. > +// > +// Copyright (c) 2019, Hewlett Packard Enterprise Development LP. All rights reserved.<BR> > +// > +// SPDX-License-Identifier: BSD-2-Clause-Patent > +// > +// **/ > + > +#string STR_PROPERTIES_PACKAGE_NAME > +#language en-US > +"SiFive Freedom U540 HiFive Unleashed board package" > -- > 2.7.4 > ^ permalink raw reply [flat|nested] 5+ messages in thread
[parent not found: <1572228122-13265-18-git-send-email-abner.chang@hpe.com>]
* Re: [platform/devel-riscv-v2 PATCHv5 15/18] U5SeriesPkg/FreedomU500VC707Board: Add SiFive U500 platform. [not found] ` <1572228122-13265-18-git-send-email-abner.chang@hpe.com> @ 2019-11-26 15:07 ` Leif Lindholm 0 siblings, 0 replies; 5+ messages in thread From: Leif Lindholm @ 2019-11-26 15:07 UTC (permalink / raw) To: Abner Chang Cc: devel, Michael D Kinney, Ard Biesheuvel, Gilbert Chen, Palmer Dabbelt On Mon, Oct 28, 2019 at 10:01:59 +0800, Abner Chang wrote: > Initial version of SiFive U500 VC707 platform. Same again - please delete flagged commented-out components. / Leif > Signed-off-by: Abner Chang <abner.chang@hpe.com> > > Cc: Michael D Kinney <michael.d.kinney@intel.com> > Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> > Cc: Leif Lindholm <leif.lindholm@linaro.org> > Cc: Gilbert Chen <gilbert.chen@hpe.com> > Cc: Palmer Dabbelt <palmer@sifive.com> > --- > .../U5SeriesPkg/FreedomU500VC707Board/U500.dec | 25 + > .../U5SeriesPkg/FreedomU500VC707Board/U500.dsc | 543 +++++++++++++++++++++ > .../U5SeriesPkg/FreedomU500VC707Board/U500.fdf | 336 +++++++++++++ > .../U5SeriesPkg/FreedomU500VC707Board/U500.fdf.inc | 55 +++ > .../FreedomU500VC707Board/VarStore.fdf.inc | 78 +++ > .../U5SeriesPkg/FreedomU500VC707Board/U500.uni | 13 + > .../FreedomU500VC707Board/U500PkgExtra.uni | 12 + > 7 files changed, 1062 insertions(+) > create mode 100644 Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dec > create mode 100644 Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc > create mode 100644 Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf > create mode 100644 Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf.inc > create mode 100644 Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/VarStore.fdf.inc > create mode 100644 Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.uni > create mode 100644 Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500PkgExtra.uni > > diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dec b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dec > new file mode 100644 > index 0000000..706e086 > --- /dev/null > +++ b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dec > @@ -0,0 +1,25 @@ > +## @file U500.dec > +# This Package provides SiFive U500 modules and libraries. > +# > +# Copyright (c) 2019, Hewlett Packard Enterprise Development LP. All rights reserved.<BR> > +# > +# SPDX-License-Identifier: BSD-2-Clause-Patent > +# > +## > + > +[Defines] > + DEC_SPECIFICATION = 0x0001001b > + PACKAGE_NAME = U500 > + PACKAGE_UNI_FILE = U500.uni > + PACKAGE_GUID = D11E9DB9-5940-4642-979D-2114342140D2 > + PACKAGE_VERSION = 1.0 > + > +[Includes] > + > +[LibraryClasses] > + > +[Guids] > + gUefiRiscVPlatformU500PkgTokenSpaceGuid = {0xDFD87009, 0x27A1, 0x41DD, { 0x84, 0xB1, 0x35, 0xB4, 0xB9, 0x0D, 0x17, 0x63 }} > + > +[UserExtensions.TianoCore."ExtraFiles"] > + U500PkgExtra.uni > diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc > new file mode 100644 > index 0000000..231e15a > --- /dev/null > +++ b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc > @@ -0,0 +1,543 @@ > +## @file > +# RISC-V EFI on SiFive VC707 (U500) RISC-V platform > +# > +# Copyright (c) 2019, Hewlett Packard Enterprise Development LP. All rights reserved.<BR> > +# > +# SPDX-License-Identifier: BSD-2-Clause-Patent > +# > +## > + > +################################################################################ > +# > +# Defines Section - statements that will be processed to create a Makefile. > +# > +################################################################################ > +[Defines] > + PLATFORM_NAME = FreedomU500VC707 > + PLATFORM_GUID = 0955581C-2A6A-48F7-8690-9D275AE884F8 > + PLATFORM_VERSION = 0.1 > + DSC_SPECIFICATION = 0x0001001c > + OUTPUT_DIRECTORY = Build/$(PLATFORM_NAME) > + SUPPORTED_ARCHITECTURES = RISCV64 > + BUILD_TARGETS = DEBUG|RELEASE|NOOPT > + SKUID_IDENTIFIER = DEFAULT > + FLASH_DEFINITION = Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf > + > + # > + # Enable below options may cause build error or may not work on > + # the initial version of RISC-V package > + # Defines for default states. These can be changed on the command line. > + # -D FLAG=VALUE > + # > + DEFINE SECURE_BOOT_ENABLE = FALSE > + DEFINE DEBUG_ON_SERIAL_PORT = TRUE > + > + # > + # Network definition > + # > + DEFINE NETWORK_SNP_ENABLE = FALSE > + DEFINE NETWORK_IP6_ENABLE = FALSE > + DEFINE NETWORK_TLS_ENABLE = FALSE > + DEFINE NETWORK_HTTP_BOOT_ENABLE = FALSE > + DEFINE NETWORK_ISCSI_ENABLE = FALSE > + > +[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 > + > +################################################################################ > +# > +# Library Class section - list of all Library Classes needed by this Platform. > +# > +################################################################################ > +[LibraryClasses] > + PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf > + PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf > + BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf > + BaseLib|MdePkg/Library/BaseLib/BaseLib.inf > + SynchronizationLib|MdePkg/Library/BaseSynchronizationLib/BaseSynchronizationLib.inf > + CpuLib|MdePkg/Library/BaseCpuLib/BaseCpuLib.inf > + PerformanceLib|MdePkg/Library/BasePerformanceLibNull/BasePerformanceLibNull.inf > + PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf > + CacheMaintenanceLib|MdePkg/Library/BaseCacheMaintenanceLib/BaseCacheMaintenanceLib.inf > + UefiDecompressLib|MdePkg/Library/BaseUefiDecompressLib/BaseUefiDecompressLib.inf > + UefiHiiServicesLib|MdeModulePkg/Library/UefiHiiServicesLib/UefiHiiServicesLib.inf > + HiiLib|MdeModulePkg/Library/UefiHiiLib/UefiHiiLib.inf > + CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf > + DxeServicesLib|MdePkg/Library/DxeServicesLib/DxeServicesLib.inf > + DxeServicesTableLib|MdePkg/Library/DxeServicesTableLib/DxeServicesTableLib.inf > + PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf > + PciCf8Lib|MdePkg/Library/BasePciCf8Lib/BasePciCf8Lib.inf > + PciLib|MdePkg/Library/BasePciLibCf8/BasePciLibCf8.inf > + IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf > + OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.inf > + SerialPortLib|Platform/SiFive/U5SeriesPkg/Library/SerialIoLib/SerialIoLib.inf > + UefiLib|MdePkg/Library/UefiLib/UefiLib.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 > + DevicePathLib|MdePkg/Library/UefiDevicePathLibDevicePathProtocol/UefiDevicePathLibDevicePathProtocol.inf > + FileHandleLib|MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.inf > + SecurityManagementLib|MdeModulePkg/Library/DxeSecurityManagementLib/DxeSecurityManagementLib.inf > + UefiUsbLib|MdePkg/Library/UefiUsbLib/UefiUsbLib.inf > + CustomizedDisplayLib|MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.inf > + SortLib|MdeModulePkg/Library/BaseSortLib/BaseSortLib.inf > + UefiBootManagerLib|MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf > + FdtLib|EmbeddedPkg/Library/FdtLib/FdtLib.inf > + > +# RISC-V Platform Library > + TimeBaseLib|EmbeddedPkg//Library/TimeBaseLib/TimeBaseLib.inf > + RealTimeClockLib|EmbeddedPkg//Library/VirtualRealTimeClockLib/VirtualRealTimeClockLib.inf > + > +# RISC-V Core Library > + RiscVOpensbiLib|RiscVPkg/Library/RiscVOpensbiLib/RiscVOpensbiLib.inf > + > +!ifdef $(SOURCE_DEBUG_ENABLE) > + PeCoffExtraActionLib|SourceLevelDebugPkg/Library/PeCoffExtraActionLibDebug/PeCoffExtraActionLibDebug.inf > + DebugCommunicationLib|SourceLevelDebugPkg/Library/DebugCommunicationLibSerialPort/DebugCommunicationLibSerialPort.inf > +!else > + PeCoffExtraActionLib|MdePkg/Library/BasePeCoffExtraActionLibNull/BasePeCoffExtraActionLibNull.inf > + DebugAgentLib|MdeModulePkg/Library/DebugAgentLibNull/DebugAgentLibNull.inf > +!endif > + > + DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf > + > +!if $(SECURE_BOOT_ENABLE) == TRUE > + IntrinsicLib|CryptoPkg/Library/IntrinsicLib/IntrinsicLib.inf > + OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf > + TpmMeasurementLib|SecurityPkg/Library/DxeTpmMeasurementLib/DxeTpmMeasurementLib.inf > + AuthVariableLib|SecurityPkg/Library/AuthVariableLib/AuthVariableLib.inf > +!else > + TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.inf > + AuthVariableLib|MdeModulePkg/Library/AuthVariableLibNull/AuthVariableLibNull.inf > +!endif > + VarCheckLib|MdeModulePkg/Library/VarCheckLib/VarCheckLib.inf > + > +!if $(HTTP_BOOT_ENABLE) == TRUE > + HttpLib|MdeModulePkg/Library/DxeHttpLib/DxeHttpLib.inf > +!endif > + > +# ACPI not supported yet. > + #S3BootScriptLib|MdeModulePkg/Library/PiDxeS3BootScriptLib/DxeS3BootScriptLib.inf Here. > + SmbusLib|MdePkg/Library/BaseSmbusLibNull/BaseSmbusLibNull.inf > + OrderedCollectionLib|MdePkg/Library/BaseOrderedCollectionRedBlackTreeLib/BaseOrderedCollectionRedBlackTreeLib.inf > + > +[LibraryClasses.common] > +!if $(SECURE_BOOT_ENABLE) == TRUE > + BaseCryptLib|CryptoPkg/Library/BaseCryptLib/BaseCryptLib.inf > +!endif > + RiscVCpuLib|RiscVPkg/Library/RiscVCpuLib/RiscVCpuLib.inf > + RiscVPlatformTimerLib|Platform/SiFive/U5SeriesPkg/Library/RiscVPlatformTimerLib/RiscVPlatformTimerLib.inf > + CpuExceptionHandlerLib|RiscVPkg/Library/RiscVExceptionLib/CpuExceptionHandlerDxeLib.inf > + > +[LibraryClasses.common.SEC] > +!ifdef $(DEBUG_ON_SERIAL_PORT) > + DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf > +!else > + DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf > +!endif > + > + ReportStatusCodeLib|MdeModulePkg/Library/PeiReportStatusCodeLib/PeiReportStatusCodeLib.inf > + ExtractGuidedSectionLib|MdePkg/Library/BaseExtractGuidedSectionLib/BaseExtractGuidedSectionLib.inf > + > +!ifdef $(SOURCE_DEBUG_ENABLE) > + DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/SecPeiDebugAgentLib.inf > +!endif > + > + MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf > + > +# > +# OpenSBi Platform Library > +# > + RiscVOpensbiPlatformLib|Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/Library/OpensbiPlatformLib/OpensbiPlatformLib.inf > + > +[LibraryClasses.common.PEI_CORE] > + HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf > + PeiServicesTablePointerLib|RiscVPkg/Library/PeiServicesTablePointerLibOpenSbi/PeiServicesTablePointerLibOpenSbi.inf > + PeiServicesLib|MdePkg/Library/PeiServicesLib/PeiServicesLib.inf > + MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf > + PeiCoreEntryPoint|MdePkg/Library/PeiCoreEntryPoint/PeiCoreEntryPoint.inf > + ReportStatusCodeLib|MdeModulePkg/Library/PeiReportStatusCodeLib/PeiReportStatusCodeLib.inf > + OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.inf > + PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf > +!ifdef $(DEBUG_ON_SERIAL_PORT) > + DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf > +!else > + DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf > +!endif > + PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf > + > +[LibraryClasses.common.PEIM] > + HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf > + PeiServicesTablePointerLib|RiscVPkg/Library/PeiServicesTablePointerLibOpenSbi/PeiServicesTablePointerLibOpenSbi.inf > + PeiServicesLib|MdePkg/Library/PeiServicesLib/PeiServicesLib.inf > + MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf > + PeimEntryPoint|MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf > + ReportStatusCodeLib|MdeModulePkg/Library/PeiReportStatusCodeLib/PeiReportStatusCodeLib.inf > + OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.inf > + PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf > +!ifdef $(DEBUG_ON_SERIAL_PORT) > + DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf > +!else > + DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf > +!endif > + PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf > + PeiResourcePublicationLib|MdePkg/Library/PeiResourcePublicationLib/PeiResourcePublicationLib.inf > + ExtractGuidedSectionLib|MdePkg/Library/PeiExtractGuidedSectionLib/PeiExtractGuidedSectionLib.inf > +!ifdef $(SOURCE_DEBUG_ENABLE) > + DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/SecPeiDebugAgentLib.inf > +!endif > + FirmwareContextProcessorSpecificLib|RiscVPlatformPkg/Library/FirmwareContextProcessorSpecificLib/FirmwareContextProcessorSpecificLib.inf > + RiscVPlatformDxeIplLib|RiscVPkg/Library/RiscVDxeIplHandoffOpenSbiLib/RiscVDxeIplHandoffOpenSbiLib.inf > + > +# > +# RISC-V core libraries > +# > + SiliconSiFiveE51CoreInfoLib|Silicon/SiFive/E51/Library/PeiCoreInfoHobLib/PeiCoreInfoHobLib.inf > + SiliconSiFiveU54CoreInfoLib|Silicon/SiFive/U54/Library/PeiCoreInfoHobLib/PeiCoreInfoHobLib.inf > + SiliconSiFiveU5MCCoreplexInfoLib|Platform/SiFive/U5SeriesPkg/Library/PeiCoreInfoHobLib/PeiCoreInfoHobLib.inf > + > +[LibraryClasses.common.DXE_CORE] > + TimerLib|RiscVPkg/Library/RiscVTimerLib/BaseRiscVTimerLib.inf > + HobLib|MdePkg/Library/DxeCoreHobLib/DxeCoreHobLib.inf > + DxeCoreEntryPoint|MdePkg/Library/DxeCoreEntryPoint/DxeCoreEntryPoint.inf > + MemoryAllocationLib|MdeModulePkg/Library/DxeCoreMemoryAllocationLib/DxeCoreMemoryAllocationLib.inf > + ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf > +!ifdef $(DEBUG_ON_SERIAL_PORT) > + DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf > +!else > + DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf > +!endif > + ExtractGuidedSectionLib|MdePkg/Library/DxeExtractGuidedSectionLib/DxeExtractGuidedSectionLib.inf > +!ifdef $(SOURCE_DEBUG_ENABLE) > + DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgentLib.inf > +!endif > + #CpuExceptionHandlerLib|UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuExceptionHandlerLib.inf Here. > + > +[LibraryClasses.common.DXE_RUNTIME_DRIVER] > + PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf > + TimerLib|RiscVPkg/Library/RiscVTimerLib/BaseRiscVTimerLib.inf > + HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf > + DxeCoreEntryPoint|MdePkg/Library/DxeCoreEntryPoint/DxeCoreEntryPoint.inf > + MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf > + ReportStatusCodeLib|MdeModulePkg/Library/RuntimeDxeReportStatusCodeLib/RuntimeDxeReportStatusCodeLib.inf > +!ifdef $(DEBUG_ON_SERIAL_PORT) > + DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf > +!else > + DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf > +!endif > + UefiRuntimeLib|MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf > +!if $(SECURE_BOOT_ENABLE) == TRUE > + BaseCryptLib|CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf > +!endif > + UefiBootManagerLib|MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf > + > +[LibraryClasses.common.UEFI_DRIVER] > + PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf > + TimerLib|RiscVPkg/Library/RiscVTimerLib/BaseRiscVTimerLib.inf > + HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf > + DxeCoreEntryPoint|MdePkg/Library/DxeCoreEntryPoint/DxeCoreEntryPoint.inf > + MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf > + ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf > +!ifdef $(DEBUG_ON_SERIAL_PORT) > + DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf > +!else > + DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf > +!endif > + UefiScsiLib|MdePkg/Library/UefiScsiLib/UefiScsiLib.inf > + > +[LibraryClasses.common.DXE_DRIVER] > + PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf > + TimerLib|RiscVPkg/Library/RiscVTimerLib/BaseRiscVTimerLib.inf > + HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf > + MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf > + ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf > + UefiScsiLib|MdePkg/Library/UefiScsiLib/UefiScsiLib.inf > +!ifdef $(DEBUG_ON_SERIAL_PORT) > + DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf > +!else > + DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf > +!endif > +!ifdef $(SOURCE_DEBUG_ENABLE) > + DebugAgentLib|SourceLevelDebugPkg/Library/DebugAgent/DxeDebugAgentLib.inf > +!endif > + UefiBootManagerLib|MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf > + PlatformBootManagerLib|RiscVPlatformPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf > + PlatformMemoryTestLib|RiscVPlatformPkg/Library/PlatformMemoryTestLibNull/PlatformMemoryTestLibNull.inf > + PlatformUpdateProgressLib|RiscVPlatformPkg/Library/PlatformUpdateProgressLibNull/PlatformUpdateProgressLibNull.inf > + > +[LibraryClasses.common.UEFI_APPLICATION] > + PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf > + TimerLib|RiscVPkg/Library/RiscVTimerLib/BaseRiscVTimerLib.inf > + HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf > + MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf > +!ifdef $(DEBUG_ON_SERIAL_PORT) > + DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf > +!else > + DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf > +!endif > + ReportStatusCodeLib|MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf > + > +################################################################################ > +# > +# Pcd Section - list of all EDK II PCD Entries defined by this Platform. > +# > +################################################################################ > +[PcdsFeatureFlag] > + gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeUseSerial|TRUE > + gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeUseMemory|FALSE > + gEfiMdeModulePkgTokenSpaceGuid.PcdDxeIplSupportUefiDecompress|FALSE > + gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE > + gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport|FALSE > + > +[PcdsFixedAtBuild] > + gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeMemorySize|1 > + gEfiMdeModulePkgTokenSpaceGuid.PcdResetOnMemoryTypeInformationChange|FALSE > + gEfiMdePkgTokenSpaceGuid.PcdMaximumGuidedExtractHandler|0x10 > + gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVariableSize|0x2000 > + gEfiMdeModulePkgTokenSpaceGuid.PcdMaxHardwareErrorVariableSize|0x8000 > + gEfiMdeModulePkgTokenSpaceGuid.PcdVariableStoreSize|0xe000 > + > + gEfiMdeModulePkgTokenSpaceGuid.PcdVpdBaseAddress|0x0 > + > + gEfiMdePkgTokenSpaceGuid.PcdReportStatusCodePropertyMask|0x07 > + gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x8000004F > +!ifdef $(SOURCE_DEBUG_ENABLE) > + gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0x17 > +!else > + gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0x2F > +!endif > + > +!ifdef $(SOURCE_DEBUG_ENABLE) > + gEfiSourceLevelDebugPkgTokenSpaceGuid.PcdDebugLoadImageMethod|0x2 > +!endif > + > + #gUefiPayloadPkgTokenSpaceGuid.PcdShellFile|{ 0x83, 0xA5, 0x04, 0x7C, 0x3E, 0x9E, 0x1C, 0x4F, 0xAD, 0x65, 0xE0, 0x52, 0x68, 0xD0, 0xB4, 0xD1 } > + > +!if $(SECURE_BOOT_ENABLE) == TRUE > + # override the default values from SecurityPkg to ensure images from all sources are verified in secure boot > + gEfiSecurityPkgTokenSpaceGuid.PcdOptionRomImageVerificationPolicy|0x04 > + gEfiSecurityPkgTokenSpaceGuid.PcdFixedMediaImageVerificationPolicy|0x04 > + gEfiSecurityPkgTokenSpaceGuid.PcdRemovableMediaImageVerificationPolicy|0x04 > +!endif > + > + # > + # F2 for UI APP > + # > + gEfiMdeModulePkgTokenSpaceGuid.PcdBootManagerMenuFile|{ 0x21, 0xaa, 0x2c, 0x46, 0x14, 0x76, 0x03, 0x45, 0x83, 0x6e, 0x8a, 0xb6, 0xf4, 0x66, 0x23, 0x31 } > + > +################################################################################ > +# > +# Pcd Dynamic Section - list of all EDK II PCD Entries defined by this Platform > +# > +################################################################################ > + > +[PcdsDynamicDefault] > + gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvStoreReserved|0 > + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase64|0 > + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase|0 > + gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase|0 > + gEfiMdeModulePkgTokenSpaceGuid.PcdPciDisableBusEnumeration|FALSE > + gEfiMdeModulePkgTokenSpaceGuid.PcdVideoHorizontalResolution|800 > + gEfiMdeModulePkgTokenSpaceGuid.PcdVideoVerticalResolution|600 > + > + gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut|0 > + > + # Set video resolution for text setup. > + gEfiMdeModulePkgTokenSpaceGuid.PcdSetupVideoHorizontalResolution|640 > + gEfiMdeModulePkgTokenSpaceGuid.PcdSetupVideoVerticalResolution|480 > + > + gEfiMdeModulePkgTokenSpaceGuid.PcdSmbiosVersion|0x0208 > + gEfiMdeModulePkgTokenSpaceGuid.PcdSmbiosDocRev|0x0 > + > +################################################################################ > +# > +# Components Section - list of all EDK II Modules needed by this Platform. > +# > +################################################################################ > +[Components] > + > + # > + # SEC Phase modules > + # > + RiscVPlatformPkg/Universal/Sec/SecMain.inf > + > + # > + # PEI Phase modules > + # > + MdeModulePkg/Core/Pei/PeiMain.inf > + MdeModulePkg/Universal/PCD/Pei/Pcd.inf { > + <LibraryClasses> > + PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf > + } > + MdeModulePkg/Universal/ReportStatusCodeRouter/Pei/ReportStatusCodeRouterPei.inf > + MdeModulePkg/Universal/StatusCodeHandler/Pei/StatusCodeHandlerPei.inf > + MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf { > + <LibraryClasses> > + NULL|MdeModulePkg/Library/LzmaCustomDecompressLib/LzmaCustomDecompressLib.inf > + } > + > + Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/Universal/Pei/PlatformPei/PlatformPei.inf { > + <LibraryClasses> > + PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf > + } > + > + # > + # DXE Phase modules > + # > + MdeModulePkg/Core/Dxe/DxeMain.inf { > + <LibraryClasses> > + NULL|MdeModulePkg//Library/LzmaCustomDecompressLib/LzmaCustomDecompressLib.inf > + DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf > + } > + > + MdeModulePkg/Universal/ReportStatusCodeRouter/RuntimeDxe/ReportStatusCodeRouterRuntimeDxe.inf > + MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/StatusCodeHandlerRuntimeDxe.inf > + > + MdeModulePkg/Universal/PCD/Dxe/Pcd.inf { > + <LibraryClasses> > + PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf > + } > + > + MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf > + > +!if $(SECURE_BOOT_ENABLE) == TRUE > + MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf { > + <LibraryClasses> > + NULL|SecurityPkg/Library/DxeImageVerificationLib/DxeImageVerificationLib.inf > + } > +!else > + MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf > +!endif > + > + # > + # EBC not supported on RISC-V yet > + # > + #MdeModulePkg/Universal/EbcDxe/EbcDxe.inf > + > + UefiCpuPkg/CpuIo2Dxe/CpuIo2Dxe.inf > + MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf { > + <LibraryClasses> > + PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf > + } > + MdeModulePkg/Universal/Metronome/Metronome.inf > + MdeModulePkg/Universal/BdsDxe/BdsDxe.inf > + MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.inf { > + <LibraryClasses> > + ResetSystemLib|MdeModulePkg/Library/BaseResetSystemLibNull/BaseResetSystemLibNull.inf > + } > + EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.inf > + > + # > + # RISC-V Platform module > + # > + Platform/SiFive/U5SeriesPkg/Universal/Dxe/TimerDxe/TimerDxe.inf > + Platform/SiFive/U5SeriesPkg/Universal/Dxe/RamFvbServicesRuntimeDxe/FvbServicesRuntimeDxe.inf > + > + # > + # RISC-V Core module > + # > + RiscVPkg/Universal/CpuDxe/CpuDxe.inf > + RiscVPkg/Universal/SmbiosDxe/RiscVSmbiosDxe.inf > + > + MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf > + MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf { > + <LibraryClasses> > + NULL|MdeModulePkg/Library/VarCheckUefiLib/VarCheckUefiLib.inf > + } > + MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf > + MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf > + MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf > + MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatformDxe.inf > + MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf > + > +# No graphic console supported yet. > +# MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.inf { > +# <LibraryClasses> > +# PcdLib|MdePkg/Library/DxePcdLib/DxePcdLib.inf > +# } Here. > + MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf > + MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf { > + <LibraryClasses> > + DevicePathLib|MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf > + PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf > + } > + MdeModulePkg/Universal/PrintDxe/PrintDxe.inf > + MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf > + MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf > + MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf > + MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBusDxe.inf > + MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDiskDxe.inf > + MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf > + MdeModulePkg/Universal/SetupBrowserDxe/SetupBrowserDxe.inf > + MdeModulePkg/Universal/DisplayEngineDxe/DisplayEngineDxe.inf > + MdeModulePkg/Universal/MemoryTest/NullMemoryTestDxe/NullMemoryTestDxe.inf > + MdeModulePkg/Universal/SerialDxe/SerialDxe.inf > + > + # > + # SMBIOS Support > + # > + MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf > + > + # > + # ACPI Support > + # Not support on RISC-V yet > + # > + #MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf > + #MdeModulePkg/Universal/Acpi/S3SaveStateDxe/S3SaveStateDxe.inf > + > + # > + # Network Support > + # > + !include NetworkPkg/Network.dsc.inc > + > + # > + # Usb Support > + # > + MdeModulePkg/Bus/Pci/UhciDxe/UhciDxe.inf > + MdeModulePkg/Bus/Pci/EhciDxe/EhciDxe.inf > + MdeModulePkg/Bus/Pci/XhciDxe/XhciDxe.inf > + MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBusDxe.inf > + MdeModulePkg/Bus/Usb/UsbKbDxe/UsbKbDxe.inf > + MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassStorageDxe.inf > + > + > + ShellPkg/Application/Shell/Shell.inf { > + <LibraryClasses> > + ShellCommandLib|ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.inf > + NULL|ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.inf > + NULL|ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.inf > + NULL|ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.inf > + NULL|ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.inf > + NULL|ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.inf > + NULL|ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1CommandsLib.inf > + NULL|ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.inf > + HandleParsingLib|ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf > + ShellLib|ShellPkg/Library/UefiShellLib/UefiShellLib.inf > + FileHandleLib|MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.inf > + SortLib|MdeModulePkg/Library/UefiSortLib/UefiSortLib.inf > + PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf > + BcfgCommandLib|ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.inf > + > + <PcdsFixedAtBuild> > + gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0xFF > + gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE > + gEfiMdePkgTokenSpaceGuid.PcdUefiLibMaxPrintBufferSize|8000 > + } > + > +!if $(SECURE_BOOT_ENABLE) == TRUE > + SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigDxe.inf > +!endif > + > + MdeModulePkg/Application/UiApp/UiApp.inf > diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf > new file mode 100644 > index 0000000..5f52c03 > --- /dev/null > +++ b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf > @@ -0,0 +1,336 @@ > +# @file > +# Flash definition file on SiFive VC707 (U500) RISC-V platform > +# > +# Copyright (c) 2019, Hewlett Packard Enterprise Development LP. All rights reserved.<BR> > +# > +# SPDX-License-Identifier: BSD-2-Clause-Patent > +# > +## > +# > +# Platform definitions > +# > +!include U500.fdf.inc > + > +# > +# Build the variable store and the firmware code as one unified flash device > +# image. > +# > +[FD.U500] > +BaseAddress = $(FW_BASE_ADDRESS) > +Size = $(FW_SIZE) > +ErasePolarity = 1 > +BlockSize = $(BLOCK_SIZE) > +NumBlocks = $(FW_BLOCKS) > + > +$(SECFV_OFFSET)|$(SECFV_SIZE) > +gUefiRiscVPlatformPkgTokenSpaceGuid.PcdRiscVSecFvBase|gUefiRiscVPlatformPkgTokenSpaceGuid.PcdRiscVSecFvSize > +FV = SECFV > + > +$(PEIFV_OFFSET)|$(PEIFV_SIZE) > +gUefiRiscVPlatformPkgTokenSpaceGuid.PcdRiscVPeiFvBase|gUefiRiscVPlatformPkgTokenSpaceGuid.PcdRiscVPeiFvSize > +FV = PEIFV > + > +$(FVMAIN_OFFSET)|$(FVMAIN_SIZE) > +gUefiRiscVPlatformPkgTokenSpaceGuid.PcdRiscVDxeFvBase|gUefiRiscVPlatformPkgTokenSpaceGuid.PcdRiscVDxeFvSize > +FV = FVMAIN_COMPACT > + > +!include VarStore.fdf.inc > + > +################################################################################ > + > +[FV.SECFV] > +BlockSize = 0x1000 > +FvAlignment = 16 > +ERASE_POLARITY = 1 > +MEMORY_MAPPED = TRUE > +STICKY_WRITE = TRUE > +LOCK_CAP = TRUE > +LOCK_STATUS = TRUE > +WRITE_DISABLED_CAP = TRUE > +WRITE_ENABLED_CAP = TRUE > +WRITE_STATUS = TRUE > +WRITE_LOCK_CAP = TRUE > +WRITE_LOCK_STATUS = TRUE > +READ_DISABLED_CAP = TRUE > +READ_ENABLED_CAP = TRUE > +READ_STATUS = TRUE > +READ_LOCK_CAP = TRUE > +READ_LOCK_STATUS = TRUE > + > +# > +# SEC Phase modules > +# > +# The code in this FV handles the initial firmware startup, and > +# decompresses the PEI and DXE FVs which handles the rest of the boot sequence. > +# > +INF RiscVPlatformPkg/Universal/Sec/SecMain.inf > + > +################################################################################ > +[FV.PEIFV] > +BlockSize = 0x10000 > +FvAlignment = 16 > +ERASE_POLARITY = 1 > +MEMORY_MAPPED = TRUE > +STICKY_WRITE = TRUE > +LOCK_CAP = TRUE > +LOCK_STATUS = TRUE > +WRITE_DISABLED_CAP = TRUE > +WRITE_ENABLED_CAP = TRUE > +WRITE_STATUS = TRUE > +WRITE_LOCK_CAP = TRUE > +WRITE_LOCK_STATUS = TRUE > +READ_DISABLED_CAP = TRUE > +READ_ENABLED_CAP = TRUE > +READ_STATUS = TRUE > +READ_LOCK_CAP = TRUE > +READ_LOCK_STATUS = TRUE > + > +APRIORI PEI { > + INF MdeModulePkg/Universal/ReportStatusCodeRouter/Pei/ReportStatusCodeRouterPei.inf > + INF MdeModulePkg/Universal/StatusCodeHandler/Pei/StatusCodeHandlerPei.inf > + INF MdeModulePkg/Universal/PCD/Pei/Pcd.inf > +} > + > +# > +# PEI Phase modules > +# > +INF MdeModulePkg/Core/Pei/PeiMain.inf > +INF MdeModulePkg/Universal/PCD/Pei/Pcd.inf > +INF MdeModulePkg/Universal/ReportStatusCodeRouter/Pei/ReportStatusCodeRouterPei.inf > +INF MdeModulePkg/Universal/StatusCodeHandler/Pei/StatusCodeHandlerPei.inf > +INF MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf > + > +# RISC-V Platform PEI Driver > +INF Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/Universal/Pei/PlatformPei/PlatformPei.inf > + > +################################################################################ > + > +[FV.DXEFV] > +BlockSize = 0x10000 > +FvAlignment = 16 > +ERASE_POLARITY = 1 > +MEMORY_MAPPED = TRUE > +STICKY_WRITE = TRUE > +LOCK_CAP = TRUE > +LOCK_STATUS = TRUE > +WRITE_DISABLED_CAP = TRUE > +WRITE_ENABLED_CAP = TRUE > +WRITE_STATUS = TRUE > +WRITE_LOCK_CAP = TRUE > +WRITE_LOCK_STATUS = TRUE > +READ_DISABLED_CAP = TRUE > +READ_ENABLED_CAP = TRUE > +READ_STATUS = TRUE > +READ_LOCK_CAP = TRUE > +READ_LOCK_STATUS = TRUE > + > +APRIORI DXE { > + INF MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf > + INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf > + INF Platform/SiFive/U5SeriesPkg/Universal/Dxe/RamFvbServicesRuntimeDxe/FvbServicesRuntimeDxe.inf > +} > + > +# > +# DXE Phase modules > +# > +INF MdeModulePkg/Core/Dxe/DxeMain.inf > + > +INF MdeModulePkg/Universal/ReportStatusCodeRouter/RuntimeDxe/ReportStatusCodeRouterRuntimeDxe.inf > +INF MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/StatusCodeHandlerRuntimeDxe.inf > +INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf > + > +INF MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf > +INF MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf > +INF UefiCpuPkg/CpuIo2Dxe/CpuIo2Dxe.inf > +INF MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf > +INF MdeModulePkg/Universal/Metronome/Metronome.inf > +INF EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.inf > + > +# RISC-V Platform Drivers > +INF Platform/SiFive/U5SeriesPkg/Universal/Dxe/RamFvbServicesRuntimeDxe/FvbServicesRuntimeDxe.inf > + > +# RISC-V Core Drivers > +INF Platform/SiFive/U5SeriesPkg/Universal/Dxe/TimerDxe/TimerDxe.inf > +INF RiscVPkg/Universal/CpuDxe/CpuDxe.inf > +INF RiscVPkg/Universal/SmbiosDxe/RiscVSmbiosDxe.inf > + > +INF MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf > + > +INF MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf > +!if $(SECURE_BOOT_ENABLE) == TRUE > + INF SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigDxe.inf > +!endif > + > +INF MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.inf > +INF MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf > +INF MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf > +INF MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf > +INF MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatformDxe.inf > +INF MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf > +#INF MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.inf Here. > +INF MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf > +INF MdeModulePkg/Universal/BdsDxe/BdsDxe.inf > +INF MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf > +INF MdeModulePkg/Universal/PrintDxe/PrintDxe.inf > +INF MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf > +INF MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf > +INF MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf > +INF MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBusDxe.inf > +INF MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDiskDxe.inf > +INF MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf > +INF MdeModulePkg/Universal/SetupBrowserDxe/SetupBrowserDxe.inf > +INF MdeModulePkg/Universal/DisplayEngineDxe/DisplayEngineDxe.inf > +INF MdeModulePkg/Universal/MemoryTest/NullMemoryTestDxe/NullMemoryTestDxe.inf > + > +!ifndef $(SOURCE_DEBUG_ENABLE) > +INF MdeModulePkg/Universal/SerialDxe/SerialDxe.inf > +!endif > + > +INF MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf > + > +# > +# ACPI is not supported yet on RISC-V package. > +# > +#INF MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf > +#INF MdeModulePkg/Universal/Acpi/S3SaveStateDxe/S3SaveStateDxe.inf Here. > +#INF PcAtChipsetPkg/IsaAcpiDxe/IsaAcpi.inf > + > +#INF RuleOverride = BINARY FatBinPkg/EnhancedFatDxe/Fat.inf And these two won't even make a comeback in the future. > + > +INF ShellPkg/Application/Shell/Shell.inf > + > +# > +# Network modules > +# > +!if $(E1000_ENABLE) > + FILE DRIVER = 5D695E11-9B3F-4b83-B25F-4A8D5D69BE07 { > + SECTION PE32 = Intel3.5/EFIX64/E3507X2.EFI > + } > +!endif > + > +!include NetworkPkg/Network.fdf.inc > + > +# > +# Usb Support > +# > +INF MdeModulePkg/Bus/Pci/UhciDxe/UhciDxe.inf > +INF MdeModulePkg/Bus/Pci/EhciDxe/EhciDxe.inf > +INF MdeModulePkg/Bus/Pci/XhciDxe/XhciDxe.inf > +INF MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBusDxe.inf > +INF MdeModulePkg/Bus/Usb/UsbKbDxe/UsbKbDxe.inf > +INF MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassStorageDxe.inf > + > +INF MdeModulePkg/Application/UiApp/UiApp.inf > + > +################################################################################ > + > +[FV.FVMAIN_COMPACT] > +FvAlignment = 16 > +ERASE_POLARITY = 1 > +MEMORY_MAPPED = TRUE > +STICKY_WRITE = TRUE > +LOCK_CAP = TRUE > +LOCK_STATUS = TRUE > +WRITE_DISABLED_CAP = TRUE > +WRITE_ENABLED_CAP = TRUE > +WRITE_STATUS = TRUE > +WRITE_LOCK_CAP = TRUE > +WRITE_LOCK_STATUS = TRUE > +READ_DISABLED_CAP = TRUE > +READ_ENABLED_CAP = TRUE > +READ_STATUS = TRUE > +READ_LOCK_CAP = TRUE > +READ_LOCK_STATUS = TRUE > +FvNameGuid = 27A72E80-3118-4c0c-8673-AA5B4EFA9613 > + > +FILE FV_IMAGE = 9E21FD93-9C72-4c15-8C4B-E77F1DB2D792 { > + SECTION GUIDED EE4E5898-3914-4259-9D6E-DC7BD79403CF PROCESSING_REQUIRED = TRUE { > + # > + # These firmware volumes will have files placed in them uncompressed, > + # and then both firmware volumes will be compressed in a single > + # compression operation in order to achieve better overall compression. > + # > + SECTION FV_IMAGE = DXEFV > + } > + } > + > +[Rule.Common.SEC] > + FILE SEC = $(NAMED_GUID) RELOCS_STRIPPED { > + PE32 PE32 Align=4K $(INF_OUTPUT)/$(MODULE_NAME).efi > + UI STRING ="$(MODULE_NAME)" Optional > + VERSION STRING ="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER) > + } > + > +[Rule.Common.PEI_CORE] > + FILE PEI_CORE = $(NAMED_GUID) { > + PE32 PE32 Align=4K $(INF_OUTPUT)/$(MODULE_NAME).efi > + UI STRING ="$(MODULE_NAME)" Optional > + VERSION STRING ="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER) > + } > + > +[Rule.Common.PEIM] > + FILE PEIM = $(NAMED_GUID) { > + PEI_DEPEX PEI_DEPEX Optional $(INF_OUTPUT)/$(MODULE_NAME).depex > + PE32 PE32 Align=4K $(INF_OUTPUT)/$(MODULE_NAME).efi > + UI STRING="$(MODULE_NAME)" Optional > + VERSION STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER) > + } > + > +[Rule.Common.DXE_CORE] > + FILE DXE_CORE = $(NAMED_GUID) { > + PE32 PE32 Align=4K $(INF_OUTPUT)/$(MODULE_NAME).efi > + UI STRING="$(MODULE_NAME)" Optional > + VERSION STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER) > + } > + > +[Rule.Common.DXE_DRIVER] > + FILE DRIVER = $(NAMED_GUID) { > + DXE_DEPEX DXE_DEPEX Optional $(INF_OUTPUT)/$(MODULE_NAME).depex > + PE32 PE32 Align=4K $(INF_OUTPUT)/$(MODULE_NAME).efi > + UI STRING="$(MODULE_NAME)" Optional > + VERSION STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER) > + } > + > +[Rule.Common.DXE_RUNTIME_DRIVER] > + FILE DRIVER = $(NAMED_GUID) { > + DXE_DEPEX DXE_DEPEX Optional $(INF_OUTPUT)/$(MODULE_NAME).depex > + PE32 PE32 Align = 4K $(INF_OUTPUT)/$(MODULE_NAME).efi > + UI STRING="$(MODULE_NAME)" Optional > + VERSION STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER) > + } > + > +[Rule.Common.UEFI_DRIVER] > + FILE DRIVER = $(NAMED_GUID) { > + DXE_DEPEX DXE_DEPEX Optional $(INF_OUTPUT)/$(MODULE_NAME).depex > + PE32 PE32 Align=4K $(INF_OUTPUT)/$(MODULE_NAME).efi > + UI STRING="$(MODULE_NAME)" Optional > + VERSION STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER) > + } > + > +[Rule.Common.UEFI_DRIVER.BINARY] > + FILE DRIVER = $(NAMED_GUID) { > + DXE_DEPEX DXE_DEPEX Optional |.depex > + PE32 PE32 Align=4K |.efi > + UI STRING="$(MODULE_NAME)" Optional > + VERSION STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER) > + } > + > +[Rule.Common.UEFI_APPLICATION] > + FILE APPLICATION = $(NAMED_GUID) { > + PE32 PE32 Align=4K $(INF_OUTPUT)/$(MODULE_NAME).efi > + UI STRING="$(MODULE_NAME)" Optional > + VERSION STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER) > + } > + > +[Rule.Common.UEFI_APPLICATION.BINARY] > + FILE APPLICATION = $(NAMED_GUID) { > + PE32 PE32 Align=4K |.efi > + UI STRING="$(MODULE_NAME)" Optional > + VERSION STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER) > + } > + > +[Rule.Common.USER_DEFINED.ACPITABLE] > + FILE FREEFORM = $(NAMED_GUID) { > + RAW ACPI |.acpi > + RAW ASL |.aml > + } > diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf.inc b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf.inc > new file mode 100644 > index 0000000..936ff22 > --- /dev/null > +++ b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf.inc > @@ -0,0 +1,55 @@ > +## @file > +# Definitions of Flash definition file on SiFive VC707 (U500) RISC-V platform > +# > +# Copyright (c) 2019, Hewlett Packard Enterprise Development LP. All rights reserved.<BR> > +# > +# SPDX-License-Identifier: BSD-2-Clause-Patent > +# > +## > +[Defines] > +DEFINE BLOCK_SIZE = 0x1000 > + > +DEFINE FW_BASE_ADDRESS = 0x80000000 > +DEFINE FW_SIZE = 0x00800000 > +DEFINE FW_BLOCKS = 0x800 > + > +# > +# 0x000000-0x7DFFFF code > +# 0x7E0000-0x800000 variables > +# > +DEFINE CODE_BASE_ADDRESS = 0x80000000 > +DEFINE CODE_SIZE = 0x007E0000 > +DEFINE CODE_BLOCKS = 0x7E0 > +DEFINE VARS_BLOCKS = 0x20 > + > +DEFINE SECFV_OFFSET = 0x00000000 > +DEFINE SECFV_SIZE = 0x00020000 > +DEFINE PEIFV_OFFSET = 0x00020000 > +DEFINE PEIFV_SIZE = 0x00080000 > +DEFINE SCRATCH_OFFSET = 0x000a0000 > +DEFINE SCRATCH_SIZE = 0x00010000 > +DEFINE FVMAIN_OFFSET = 0x00100000 # Must be power of 2 for PMP setting > +DEFINE FVMAIN_SIZE = 0x0018C000 > +DEFINE VARS_OFFSET = 0x007E0000 > +DEFINE VARS_SIZE = 0x00020000 > + > +SET gUefiRiscVPlatformPkgTokenSpaceGuid.PcdVariableFdBaseAddress = $(FW_BASE_ADDRESS) + $(VARS_OFFSET) > +SET gUefiRiscVPlatformPkgTokenSpaceGuid.PcdVariableFdSize = $(VARS_SIZE) > +SET gUefiRiscVPlatformPkgTokenSpaceGuid.PcdVariableFdBlockSize = $(BLOCK_SIZE) > + > +SET gUefiRiscVPlatformPkgTokenSpaceGuid.PcdFwStartAddress = $(CODE_BASE_ADDRESS) > +SET gUefiRiscVPlatformPkgTokenSpaceGuid.PcdFwEndAddress = $(CODE_BASE_ADDRESS) + $(SECFV_SIZE) + $(PEIFV_SIZE) + $(SCRATCH_SIZE) > +SET gUefiRiscVPlatformPkgTokenSpaceGuid.PcdOpenSbiStackSize = 8192 > +SET gUefiRiscVPlatformPkgTokenSpaceGuid.PcdScratchRamBase = $(CODE_BASE_ADDRESS) + $(SCRATCH_OFFSET) > +SET gUefiRiscVPlatformPkgTokenSpaceGuid.PcdScratchRamSize = $(SCRATCH_SIZE) > +SET gUefiRiscVPlatformPkgTokenSpaceGuid.PcdTemporaryRamBase = $(CODE_BASE_ADDRESS) + $(FW_SIZE) > +SET gUefiRiscVPlatformPkgTokenSpaceGuid.PcdTemporaryRamSize = 0x10000 > + > + > +SET gUefiRiscVPkgTokenSpaceGuid.PcdRiscVMachineTimerFrequencyInHerz = 1000000 > +SET gUefiRiscVPlatformPkgTokenSpaceGuid.PcdHartCount = 4 # Total cores on U500 platform > +SET gSiFiveU5SeriesPlatformsPkgTokenSpaceGuid.PcdNumberofU5Cores = 4 # Total U5 cores enabled on U500 platform > +SET gSiFiveU5SeriesPlatformsPkgTokenSpaceGuid.PcdE5MCSupported = False # Enable optional E51 MC core? > +SET gUefiRiscVPlatformPkgTokenSpaceGuid.PcdBootHartId = 0 # Boot hart ID > + > +SET gSiFiveU5SeriesPlatformsPkgTokenSpaceGuid.PcdU5UartBase = 0x54000000 > diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/VarStore.fdf.inc b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/VarStore.fdf.inc > new file mode 100644 > index 0000000..c287bb4 > --- /dev/null > +++ b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/VarStore.fdf.inc > @@ -0,0 +1,78 @@ > +## @file > +# FDF include file with Layout Regions that define an empty variable store. > +# > +# Copyright (c) 2019, Hewlett Packard Enterprise Development LP. All rights reserved.<BR> > +# Copyright (C) 2014, Red Hat, Inc. > +# Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR> > +# > +# SPDX-License-Identifier: BSD-2-Clause-Patent > +# > +## > + > +$(VARS_OFFSET)|0x00007000 > +gUefiRiscVPlatformPkgTokenSpaceGuid.PcdPlatformFlashNvStorageVariableBase|gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize > +# > +# NV_VARIABLE_STORE > +# > +DATA = { > + ## This is the EFI_FIRMWARE_VOLUME_HEADER > + # ZeroVector [] > + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, > + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, > + # FileSystemGuid: gEfiSystemNvDataFvGuid = > + # { 0xFFF12B8D, 0x7696, 0x4C8B, > + # { 0xA9, 0x85, 0x27, 0x47, 0x07, 0x5B, 0x4F, 0x50 }} > + 0x8D, 0x2B, 0xF1, 0xFF, 0x96, 0x76, 0x8B, 0x4C, > + 0xA9, 0x85, 0x27, 0x47, 0x07, 0x5B, 0x4F, 0x50, > + # FvLength: 0x20000 > + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, > + # Signature "_FVH" # Attributes > + 0x5f, 0x46, 0x56, 0x48, 0xff, 0xfe, 0x04, 0x00, > + # HeaderLength # CheckSum # ExtHeaderOffset #Reserved #Revision > + 0x48, 0x00, 0x39, 0xF1, 0x00, 0x00, 0x00, 0x02, > + # Blockmap[0]: 0x20 Blocks * 0x1000 Bytes / Block > + 0x00, 0x08, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, > + # Blockmap[1]: End > + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, > + ## This is the VARIABLE_STORE_HEADER > +!if $(SECURE_BOOT_ENABLE) == TRUE > + # Signature: gEfiAuthenticatedVariableGuid = > + # { 0xaaf32c78, 0x947b, 0x439a, > + # { 0xa1, 0x80, 0x2e, 0x14, 0x4e, 0xc3, 0x77, 0x92 }} > + 0x78, 0x2c, 0xf3, 0xaa, 0x7b, 0x94, 0x9a, 0x43, > + 0xa1, 0x80, 0x2e, 0x14, 0x4e, 0xc3, 0x77, 0x92, > +!else > + # Signature: gEfiVariableGuid = > + # { 0xddcf3616, 0x3275, 0x4164, > + # { 0x98, 0xb6, 0xfe, 0x85, 0x70, 0x7f, 0xfe, 0x7d }} > + 0x16, 0x36, 0xcf, 0xdd, 0x75, 0x32, 0x64, 0x41, > + 0x98, 0xb6, 0xfe, 0x85, 0x70, 0x7f, 0xfe, 0x7d, > +!endif > + # Size: 0x7000 (gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize) - > + # 0x48 (size of EFI_FIRMWARE_VOLUME_HEADER) = 0x6fb8 > + # This can speed up the Variable Dispatch a bit. > + 0xB8, 0x6F, 0x00, 0x00, > + # FORMATTED: 0x5A #HEALTHY: 0xFE #Reserved: UINT16 #Reserved1: UINT32 > + 0x5A, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 > +} > + > +0x007e7000|0x00001000 > +gUefiRiscVPlatformPkgTokenSpaceGuid.PcdPlatformFlashNvStorageFtwWorkingBase|gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize > +# > +#NV_FTW_WROK > +# > +DATA = { > + # EFI_FAULT_TOLERANT_WORKING_BLOCK_HEADER->Signature = gEdkiiWorkingBlockSignatureGuid = > + # { 0x9e58292b, 0x7c68, 0x497d, { 0xa0, 0xce, 0x65, 0x0, 0xfd, 0x9f, 0x1b, 0x95 }} > + 0x2b, 0x29, 0x58, 0x9e, 0x68, 0x7c, 0x7d, 0x49, > + 0xa0, 0xce, 0x65, 0x0, 0xfd, 0x9f, 0x1b, 0x95, > + # Crc:UINT32 #WorkingBlockValid:1, WorkingBlockInvalid:1, Reserved > + 0x2c, 0xaf, 0x2c, 0x64, 0xFE, 0xFF, 0xFF, 0xFF, > + # WriteQueueSize: UINT64 > + 0xE0, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 > +} > + > +0x007e8000|0x00018000 > +gUefiRiscVPlatformPkgTokenSpaceGuid.PcdPlatformFlashNvStorageFtwSpareBase|gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize > +# > +#NV_FTW_SPARE > diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.uni b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.uni > new file mode 100644 > index 0000000..7ac1096 > --- /dev/null > +++ b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.uni > @@ -0,0 +1,13 @@ > +// /** @file > +// SiFive U500 Package Localized Strings and Content. > +// > +// Copyright (c) 2019, Hewlett Packard Enterprise Development LP. All rights reserved.<BR> > +// > +// SPDX-License-Identifier: BSD-2-Clause-Patent > +// > +// **/ > + > + > +#string STR_PACKAGE_ABSTRACT #language en-US "Provides SiFIve RISC-V U500 platform modules and libraries" > + > +#string STR_PACKAGE_DESCRIPTION #language en-US "This Package SiFIve RISC-V U500 platform modules and libraries." > diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500PkgExtra.uni b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500PkgExtra.uni > new file mode 100644 > index 0000000..6b68fb4 > --- /dev/null > +++ b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500PkgExtra.uni > @@ -0,0 +1,12 @@ > +// /** @file > +// SiFive U500 Package Localized Strings and Content. > +// > +// Copyright (c) 2019, Hewlett Packard Enterprise Development LP. All rights reserved.<BR> > +// > +// SPDX-License-Identifier: BSD-2-Clause-Patent > +// > +// **/ > + > +#string STR_PROPERTIES_PACKAGE_NAME > +#language en-US > +"SiFive U500 package" > -- > 2.7.4 > ^ permalink raw reply [flat|nested] 5+ messages in thread
* [platform/devel-riscv-v2 PATCHv5 00/18] Initial version of RISC-V @ 2019-10-28 4:20 Abner Chang 2019-10-28 4:20 ` [platform/devel-riscv-v2 PATCHv5 09/18] U5SeriesPkg/SerialIoLib: Platform Serial Port library Abner Chang 0 siblings, 1 reply; 5+ messages in thread From: Abner Chang @ 2019-10-28 4:20 UTC (permalink / raw) To: devel; +Cc: abner.chang The is the set of patches for belwo two platforms, - SiFive Freedom U500 VC707 FPGA Dev Kit - SiFive Freedom U540 HiFive Unleashed development board Refer to Readme.md under platforms/SiFive/U5SeriesPkg. These patches have to be incorporated with RISC-V-V2 pacth v3 of edk2-staging. Besides of patches, you can also get code from belwo git repository. - edk2-platforms for RISC-V platform, https://github.com/gilbert225/edk2-platforms/tree/devel-riscv-v2-PATCHv5 - edk2-staging for RISC-V, https://github.com/changab/edk2-staging-riscv/tree/RISC-V-V2-v3 Abner Chang (18): Silicon/SiFive: Initial version of SiFive silicon package. SiFive/E51: Initial version of SiFive E51 core library. SiFive/U54: Initial version of SiFive U54 core library. SiFive/U54MC: Initial version of SiFive U54MC Coreplex library. U5SeriesPkg/PeiCoreInfoHobLib: Library to create core information. U5SeriesPkg/TimerDxe: U5 Series Platform Timer DXE driver. U5SeriesPkg/RamFvbServicesRuntimeDxe: Firmware Volume Block service. U5SeriesPkg/RiscVPlatformTimerLib: Platform Timer library U5SeriesPkg/SerialIoLib: Platform Serial Port library FreedomU540HiFiveUnleashedBoard/PlatformPei: Platform PEI for U540 platform. FreedomU540HiFiveUnleashedBoard/OpensbiPlatformLib: OpenSBI platform library for U540 platform. U5SeriesPkg/FreedomU540HiFiveUnleashedBoard: Add SiFive U540 platform. FreedomU500VC707Board/PlatformPei: Platform initialization PEI module. FreedomU500VC707Board/OpensbiPlatformLib: OpenSBI platform interface. U5SeriesPkg/FreedomU500VC707Board: Add SiFive U500 platform. SiFive/U5SeriesPkg Add U5SeriesPkg. edk2-platforms: Update Readme.md for RISC-V platform. edk2-platforms: Update Maintainers file. .../U5SeriesPkg/FreedomU500VC707Board/U500.dec | 25 + .../FreedomU540HiFiveUnleashedBoard/U540.dec | 25 + Platform/SiFive/U5SeriesPkg/U5SeriesPkg.dec | 33 + Silicon/SiFive/SiFive.dec | 39 + .../U5SeriesPkg/FreedomU500VC707Board/U500.dsc | 543 ++++++++++ .../FreedomU540HiFiveUnleashedBoard/U540.dsc | 543 ++++++++++ .../U5SeriesPkg/FreedomU500VC707Board/U500.fdf | 336 ++++++ .../FreedomU540HiFiveUnleashedBoard/U540.fdf | 336 ++++++ .../U5SeriesPkg/FreedomU500VC707Board/U500.fdf.inc | 55 + .../FreedomU500VC707Board/VarStore.fdf.inc | 78 ++ .../FreedomU540HiFiveUnleashedBoard/U540.fdf.inc | 54 + .../VarStore.fdf.inc | 78 ++ .../OpensbiPlatformLib/OpensbiPlatformLib.inf | 52 + .../Universal/Pei/PlatformPei/PlatformPei.inf | 73 ++ .../OpensbiPlatformLib/OpensbiPlatformLib.inf | 52 + .../Universal/Pei/PlatformPei/PlatformPei.inf | 72 ++ .../PeiCoreInfoHobLib/PeiCoreInfoHobLib.inf | 58 + .../RiscVPlatformTimerLib.inf | 36 + .../Library/SerialIoLib/SerialIoLib.inf | 38 + .../FvbServicesRuntimeDxe.inf | 80 ++ .../Universal/Dxe/TimerDxe/TimerDxe.inf | 53 + .../PeiCoreInfoHobLib/PeiCoreInfoHobLib.inf | 47 + .../PeiCoreInfoHobLib/PeiCoreInfoHobLib.inf | 48 + .../PeiCoreInfoHobLib/PeiCoreInfoHobLib.inf | 46 + .../Universal/Pei/PlatformPei/Platform.h | 86 ++ .../Universal/Pei/PlatformPei/Platform.h | 86 ++ .../U5SeriesPkg/Include/SiFiveU5MCCoreplex.h | 51 + Platform/SiFive/U5SeriesPkg/Include/U5Clint.h | 20 + .../Dxe/RamFvbServicesRuntimeDxe/FwBlockService.h | 187 ++++ .../Dxe/RamFvbServicesRuntimeDxe/RamFlash.h | 85 ++ .../U5SeriesPkg/Universal/Dxe/TimerDxe/Timer.h | 174 +++ Silicon/SiFive/Include/Library/SiFiveE51.h | 60 ++ Silicon/SiFive/Include/Library/SiFiveU54.h | 60 ++ .../SiFive/Include/Library/SiFiveU54MCCoreplex.h | 55 + .../Library/OpensbiPlatformLib/Platform.c | 213 ++++ .../Universal/Pei/PlatformPei/Fv.c | 51 + .../Universal/Pei/PlatformPei/MemDetect.c | 74 ++ .../Universal/Pei/PlatformPei/Platform.c | 310 ++++++ .../Library/OpensbiPlatformLib/Platform.c | 213 ++++ .../Universal/Pei/PlatformPei/Fv.c | 51 + .../Universal/Pei/PlatformPei/MemDetect.c | 74 ++ .../Universal/Pei/PlatformPei/Platform.c | 310 ++++++ .../Library/PeiCoreInfoHobLib/CoreInfoHob.c | 195 ++++ .../Library/SerialIoLib/SerialPortLib.c | 253 +++++ .../Dxe/RamFvbServicesRuntimeDxe/FvbInfo.c | 127 +++ .../Dxe/RamFvbServicesRuntimeDxe/FwBlockService.c | 1114 ++++++++++++++++++++ .../RamFvbServicesRuntimeDxe/FwBlockServiceDxe.c | 150 +++ .../Dxe/RamFvbServicesRuntimeDxe/RamFlash.c | 145 +++ .../Dxe/RamFvbServicesRuntimeDxe/RamFlashDxe.c | 20 + .../U5SeriesPkg/Universal/Dxe/TimerDxe/Timer.c | 304 ++++++ .../E51/Library/PeiCoreInfoHobLib/CoreInfoHob.c | 242 +++++ .../U54/Library/PeiCoreInfoHobLib/CoreInfoHob.c | 290 +++++ .../Library/PeiCoreInfoHobLib/CoreInfoHob.c | 184 ++++ Platform/SiFive/U5SeriesPkg/Readme.md | 110 ++ Readme.md | 13 + Maintainers.txt | 16 + .../U5SeriesPkg/FreedomU500VC707Board/U500.uni | 13 + .../FreedomU500VC707Board/U500PkgExtra.uni | 12 + .../FreedomU540HiFiveUnleashedBoard/U540.uni | 13 + .../U540PkgExtra.uni | 12 + .../RiscVPlatformTimerLib/RiscVPlatformTimerLib.S | 48 + .../Library/SerialIoLib/U5SerialPortLib.uni | 16 + Platform/SiFive/U5SeriesPkg/U5SeriesPkg.uni | 13 + Platform/SiFive/U5SeriesPkg/U5SeriesPkgExtra.uni | 12 + .../U5SeriesPkg/Universal/Dxe/TimerDxe/Timer.uni | 14 + .../Universal/Dxe/TimerDxe/TimerExtra.uni | 12 + 66 files changed, 8288 insertions(+) create mode 100644 Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dec create mode 100644 Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dec create mode 100644 Platform/SiFive/U5SeriesPkg/U5SeriesPkg.dec create mode 100644 Silicon/SiFive/SiFive.dec create mode 100644 Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc create mode 100644 Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc create mode 100644 Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf create mode 100644 Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf create mode 100644 Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf.inc create mode 100644 Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/VarStore.fdf.inc create mode 100644 Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf.inc create mode 100644 Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/VarStore.fdf.inc create mode 100644 Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/Library/OpensbiPlatformLib/OpensbiPlatformLib.inf create mode 100644 Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/Universal/Pei/PlatformPei/PlatformPei.inf create mode 100644 Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Library/OpensbiPlatformLib/OpensbiPlatformLib.inf create mode 100644 Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Universal/Pei/PlatformPei/PlatformPei.inf create mode 100644 Platform/SiFive/U5SeriesPkg/Library/PeiCoreInfoHobLib/PeiCoreInfoHobLib.inf create mode 100644 Platform/SiFive/U5SeriesPkg/Library/RiscVPlatformTimerLib/RiscVPlatformTimerLib.inf create mode 100644 Platform/SiFive/U5SeriesPkg/Library/SerialIoLib/SerialIoLib.inf create mode 100644 Platform/SiFive/U5SeriesPkg/Universal/Dxe/RamFvbServicesRuntimeDxe/FvbServicesRuntimeDxe.inf create mode 100644 Platform/SiFive/U5SeriesPkg/Universal/Dxe/TimerDxe/TimerDxe.inf create mode 100644 Silicon/SiFive/E51/Library/PeiCoreInfoHobLib/PeiCoreInfoHobLib.inf create mode 100644 Silicon/SiFive/U54/Library/PeiCoreInfoHobLib/PeiCoreInfoHobLib.inf create mode 100644 Silicon/SiFive/U54MCCoreplex/Library/PeiCoreInfoHobLib/PeiCoreInfoHobLib.inf create mode 100644 Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/Universal/Pei/PlatformPei/Platform.h create mode 100644 Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Universal/Pei/PlatformPei/Platform.h create mode 100644 Platform/SiFive/U5SeriesPkg/Include/SiFiveU5MCCoreplex.h create mode 100644 Platform/SiFive/U5SeriesPkg/Include/U5Clint.h create mode 100644 Platform/SiFive/U5SeriesPkg/Universal/Dxe/RamFvbServicesRuntimeDxe/FwBlockService.h create mode 100644 Platform/SiFive/U5SeriesPkg/Universal/Dxe/RamFvbServicesRuntimeDxe/RamFlash.h create mode 100644 Platform/SiFive/U5SeriesPkg/Universal/Dxe/TimerDxe/Timer.h create mode 100644 Silicon/SiFive/Include/Library/SiFiveE51.h create mode 100644 Silicon/SiFive/Include/Library/SiFiveU54.h create mode 100644 Silicon/SiFive/Include/Library/SiFiveU54MCCoreplex.h create mode 100644 Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/Library/OpensbiPlatformLib/Platform.c create mode 100644 Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/Universal/Pei/PlatformPei/Fv.c create mode 100644 Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/Universal/Pei/PlatformPei/MemDetect.c create mode 100644 Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/Universal/Pei/PlatformPei/Platform.c create mode 100644 Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Library/OpensbiPlatformLib/Platform.c create mode 100644 Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Universal/Pei/PlatformPei/Fv.c create mode 100644 Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Universal/Pei/PlatformPei/MemDetect.c create mode 100644 Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Universal/Pei/PlatformPei/Platform.c create mode 100644 Platform/SiFive/U5SeriesPkg/Library/PeiCoreInfoHobLib/CoreInfoHob.c create mode 100644 Platform/SiFive/U5SeriesPkg/Library/SerialIoLib/SerialPortLib.c create mode 100644 Platform/SiFive/U5SeriesPkg/Universal/Dxe/RamFvbServicesRuntimeDxe/FvbInfo.c create mode 100644 Platform/SiFive/U5SeriesPkg/Universal/Dxe/RamFvbServicesRuntimeDxe/FwBlockService.c create mode 100644 Platform/SiFive/U5SeriesPkg/Universal/Dxe/RamFvbServicesRuntimeDxe/FwBlockServiceDxe.c create mode 100644 Platform/SiFive/U5SeriesPkg/Universal/Dxe/RamFvbServicesRuntimeDxe/RamFlash.c create mode 100644 Platform/SiFive/U5SeriesPkg/Universal/Dxe/RamFvbServicesRuntimeDxe/RamFlashDxe.c create mode 100644 Platform/SiFive/U5SeriesPkg/Universal/Dxe/TimerDxe/Timer.c create mode 100644 Silicon/SiFive/E51/Library/PeiCoreInfoHobLib/CoreInfoHob.c create mode 100644 Silicon/SiFive/U54/Library/PeiCoreInfoHobLib/CoreInfoHob.c create mode 100644 Silicon/SiFive/U54MCCoreplex/Library/PeiCoreInfoHobLib/CoreInfoHob.c create mode 100644 Platform/SiFive/U5SeriesPkg/Readme.md create mode 100644 Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.uni create mode 100644 Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500PkgExtra.uni create mode 100644 Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.uni create mode 100644 Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540PkgExtra.uni create mode 100644 Platform/SiFive/U5SeriesPkg/Library/RiscVPlatformTimerLib/RiscVPlatformTimerLib.S create mode 100644 Platform/SiFive/U5SeriesPkg/Library/SerialIoLib/U5SerialPortLib.uni create mode 100644 Platform/SiFive/U5SeriesPkg/U5SeriesPkg.uni create mode 100644 Platform/SiFive/U5SeriesPkg/U5SeriesPkgExtra.uni create mode 100644 Platform/SiFive/U5SeriesPkg/Universal/Dxe/TimerDxe/Timer.uni create mode 100644 Platform/SiFive/U5SeriesPkg/Universal/Dxe/TimerDxe/TimerExtra.uni -- 2.7.4 ^ permalink raw reply [flat|nested] 5+ messages in thread
* [platform/devel-riscv-v2 PATCHv5 09/18] U5SeriesPkg/SerialIoLib: Platform Serial Port library 2019-10-28 4:20 [platform/devel-riscv-v2 PATCHv5 00/18] Initial version of RISC-V Abner Chang @ 2019-10-28 4:20 ` Abner Chang 0 siblings, 0 replies; 5+ messages in thread From: Abner Chang @ 2019-10-28 4:20 UTC (permalink / raw) To: devel Cc: abner.chang, Michael D Kinney, Ard Biesheuvel, Leif Lindholm, Gilbert Chen, Palmer Dabbelt Serial Port library for U5 series platform. Signed-off-by: Abner Chang <abner.chang@hpe.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Leif Lindholm <leif.lindholm@linaro.org> Cc: Gilbert Chen <gilbert.chen@hpe.com> Cc: Palmer Dabbelt <palmer@sifive.com> Signed-off-by: Abner Chang <abner.chang@hpe.com> --- .../Library/SerialIoLib/SerialIoLib.inf | 38 ++++ .../Library/SerialIoLib/SerialPortLib.c | 253 +++++++++++++++++++++ .../Library/SerialIoLib/U5SerialPortLib.uni | 16 ++ 3 files changed, 307 insertions(+) create mode 100644 Platform/SiFive/U5SeriesPkg/Library/SerialIoLib/SerialIoLib.inf create mode 100644 Platform/SiFive/U5SeriesPkg/Library/SerialIoLib/SerialPortLib.c create mode 100644 Platform/SiFive/U5SeriesPkg/Library/SerialIoLib/U5SerialPortLib.uni diff --git a/Platform/SiFive/U5SeriesPkg/Library/SerialIoLib/SerialIoLib.inf b/Platform/SiFive/U5SeriesPkg/Library/SerialIoLib/SerialIoLib.inf new file mode 100644 index 0000000..0044f84 --- /dev/null +++ b/Platform/SiFive/U5SeriesPkg/Library/SerialIoLib/SerialIoLib.inf @@ -0,0 +1,38 @@ +## @file +# Library instance for SerialIo library class +# +# Copyright (c) 2019, Hewlett Packard Enterprise Development LP. All rights reserved.<BR> +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +[Defines] + INF_VERSION = 0x0001001b + BASE_NAME = U5SerialPortLib + MODULE_UNI_FILE = U5SerialPortLib.uni + FILE_GUID = FCC4FD2B-2FF6-4FFA-B363-7C1111E5DCE9 + MODULE_TYPE = BASE + VERSION_STRING = 1.0 + LIBRARY_CLASS = SerialPortLib +# +# The following information is for reference only and not required by the build tools. +# +# VALID_ARCHITECTURES = RISCV64 +# +[Packages] + MdePkg/MdePkg.dec + RiscVPlatformPkg/RiscVPlatformPkg.dec + RiscVPkg/RiscVPkg.dec + Platform/SiFive/U5SeriesPkg/U5SeriesPkg.dec + +[LibraryClasses] + BaseLib + IoLib + RiscVOpensbiLib + +[FixedPcd] + gSiFiveU5SeriesPlatformsPkgTokenSpaceGuid.PcdU5UartBase + +[Sources] + SerialPortLib.c diff --git a/Platform/SiFive/U5SeriesPkg/Library/SerialIoLib/SerialPortLib.c b/Platform/SiFive/U5SeriesPkg/Library/SerialIoLib/SerialPortLib.c new file mode 100644 index 0000000..5e06515 --- /dev/null +++ b/Platform/SiFive/U5SeriesPkg/Library/SerialIoLib/SerialPortLib.c @@ -0,0 +1,253 @@ +/** @file + UART Serial Port library functions + + Copyright (c) 2019, Hewlett Packard Enterprise Development LP. All rights reserved.<BR> + + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include <Base.h> +#include <Library/IoLib.h> +#include <Library/SerialPortLib.h> +#include <include/sbi_utils/serial/sifive-uart.h> // Reference to header file in opensbi + +//--------------------------------------------- +// UART Register Offsets +//--------------------------------------------- + +#define UART_REG_IP 5 +#define UART_IP_RXWM 0x02 + +//--------------------------------------------- +// UART Settings +//--------------------------------------------- + +#define UART_BAUDRATE 115200 +#define SYS_CLK 100000000 + +BOOLEAN Initiated = FALSE; + +/** + Initialize the serial device hardware. + + If no initialization is required, then return RETURN_SUCCESS. + If the serial device was successfuly initialized, then return RETURN_SUCCESS. + If the serial device could not be initialized, then return RETURN_DEVICE_ERROR. + + @retval RETURN_SUCCESS The serial device was initialized. + @retval RETURN_DEVICE_ERROR The serail device could not be initialized. + +**/ +RETURN_STATUS +EFIAPI +SerialPortInitialize ( + VOID + ) +{ + if (Initiated) { + return RETURN_SUCCESS; + } + if (sifive_uart_init(FixedPcdGet32(PcdU5UartBase), SYS_CLK / 2, UART_BAUDRATE) != 0) { + return EFI_DEVICE_ERROR; + } + Initiated = TRUE; + return RETURN_SUCCESS; +} + +/** + Write data from buffer to serial device. + + Writes NumberOfBytes data bytes from Buffer to the serial device. + The number of bytes actually written to the serial device is returned. + If the return value is less than NumberOfBytes, then the write operation failed. + + If Buffer is NULL, then ASSERT(). + + If NumberOfBytes is zero, then return 0. + + @param Buffer Pointer to the data buffer to be written. + @param NumberOfBytes Number of bytes to written to the serial device. + + @retval 0 NumberOfBytes is 0. + @retval >0 The number of bytes written to the serial device. + If this value is less than NumberOfBytes, then the write operation failed. + +**/ +UINTN +EFIAPI +SerialPortWrite ( + IN UINT8 *Buffer, + IN UINTN NumberOfBytes + ) +{ + UINTN Index; + + if (Buffer == NULL || Initiated == FALSE) { + return 0; + } + + for(Index = 0; Index < NumberOfBytes; Index ++) { + sifive_uart_putc (Buffer [Index]); + } + + return Index; +} + +/** + Reads data from a serial device into a buffer. + + @param Buffer Pointer to the data buffer to store the data read from the serial device. + @param NumberOfBytes Number of bytes to read from the serial device. + + @retval 0 NumberOfBytes is 0. + @retval >0 The number of bytes read from the serial device. + If this value is less than NumberOfBytes, then the read operation failed. + +**/ +UINTN +EFIAPI +SerialPortRead ( + OUT UINT8 *Buffer, + IN UINTN NumberOfBytes + ) +{ + UINTN Index; + + if (NULL == Buffer || Initiated == FALSE) { + return 0; + } + + for(Index = 0; Index < NumberOfBytes; Index ++) { + Buffer [Index] = (UINT8)sifive_uart_getc (); + } + + return Index; +} + +/** + Polls a serial device to see if there is any data waiting to be read. + + Polls aserial device to see if there is any data waiting to be read. + If there is data waiting to be read from the serial device, then TRUE is returned. + If there is no data waiting to be read from the serial device, then FALSE is returned. + + @retval TRUE Data is waiting to be read from the serial device. + @retval FALSE There is no data waiting to be read from the serial device. + +**/ +BOOLEAN +EFIAPI +SerialPortPoll ( + VOID + ) +{ + STATIC volatile UINT32 * const uart = (UINT32 *)FixedPcdGet32(PcdU5UartBase); + UINT32 IP; + + if (Initiated == FALSE) { + return FALSE; + } + IP = MmioRead32 ((UINTN)(uart + UART_REG_IP)); + if(IP & UART_IP_RXWM) { + return TRUE; + } + else { + return FALSE; + } +} + +/** + Sets the control bits on a serial device. + + @param Control Sets the bits of Control that are settable. + + @retval RETURN_SUCCESS The new control bits were set on the serial device. + @retval RETURN_UNSUPPORTED The serial device does not support this operation. + @retval RETURN_DEVICE_ERROR The serial device is not functioning correctly. + +**/ +RETURN_STATUS +EFIAPI +SerialPortSetControl ( + IN UINT32 Control + ) +{ + if (Initiated == FALSE) { + return EFI_NOT_READY; + } + return RETURN_SUCCESS; +} + +/** + Retrieve the status of the control bits on a serial device. + + @param Control A pointer to return the current control signals from the serial device. + + @retval RETURN_SUCCESS The control bits were read from the serial device. + @retval RETURN_UNSUPPORTED The serial device does not support this operation. + @retval RETURN_DEVICE_ERROR The serial device is not functioning correctly. + +**/ +RETURN_STATUS +EFIAPI +SerialPortGetControl ( + OUT UINT32 *Control + ) +{ + if (Initiated == FALSE) { + return EFI_NOT_READY; + } + *Control = 0; + return RETURN_SUCCESS; +} + +/** + Sets the baud rate, receive FIFO depth, transmit/receice time out, parity, + data bits, and stop bits on a serial device. + + @param BaudRate The requested baud rate. A BaudRate value of 0 will use the + device's default interface speed. + On output, the value actually set. + @param ReveiveFifoDepth The requested depth of the FIFO on the receive side of the + serial interface. A ReceiveFifoDepth value of 0 will use + the device's default FIFO depth. + On output, the value actually set. + @param Timeout The requested time out for a single character in microseconds. + This timeout applies to both the transmit and receive side of the + interface. A Timeout value of 0 will use the device's default time + out value. + On output, the value actually set. + @param Parity The type of parity to use on this serial device. A Parity value of + DefaultParity will use the device's default parity value. + On output, the value actually set. + @param DataBits The number of data bits to use on the serial device. A DataBits + vaule of 0 will use the device's default data bit setting. + On output, the value actually set. + @param StopBits The number of stop bits to use on this serial device. A StopBits + value of DefaultStopBits will use the device's default number of + stop bits. + On output, the value actually set. + + @retval RETURN_SUCCESS The new attributes were set on the serial device. + @retval RETURN_UNSUPPORTED The serial device does not support this operation. + @retval RETURN_INVALID_PARAMETER One or more of the attributes has an unsupported value. + @retval RETURN_DEVICE_ERROR The serial device is not functioning correctly. + +**/ +RETURN_STATUS +EFIAPI +SerialPortSetAttributes ( + IN OUT UINT64 *BaudRate, + IN OUT UINT32 *ReceiveFifoDepth, + IN OUT UINT32 *Timeout, + IN OUT EFI_PARITY_TYPE *Parity, + IN OUT UINT8 *DataBits, + IN OUT EFI_STOP_BITS_TYPE *StopBits + ) +{ + if (Initiated == FALSE) { + return EFI_NOT_READY; + } + return RETURN_SUCCESS; +} diff --git a/Platform/SiFive/U5SeriesPkg/Library/SerialIoLib/U5SerialPortLib.uni b/Platform/SiFive/U5SeriesPkg/Library/SerialIoLib/U5SerialPortLib.uni new file mode 100644 index 0000000..49163bd --- /dev/null +++ b/Platform/SiFive/U5SeriesPkg/Library/SerialIoLib/U5SerialPortLib.uni @@ -0,0 +1,16 @@ +// /** @file +// Library instance for SerialIo library class +// +// Library instance for SerialIO library class. +// +// Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR> +// +// SPDX-License-Identifier: BSD-2-Clause-Patent +// +// **/ + + +#string STR_MODULE_ABSTRACT #language en-US "Library instance for SerialIO library class" + +#string STR_MODULE_DESCRIPTION #language en-US "Library instance for SerialIO library class." + -- 2.7.4 ^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2019-11-26 15:07 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- [not found] <1572228122-13265-1-git-send-email-abner.chang@hpe.com> [not found] ` <1572228122-13265-8-git-send-email-abner.chang@hpe.com> 2019-11-26 14:46 ` [platform/devel-riscv-v2 PATCHv5 07/18] U5SeriesPkg/RamFvbServicesRuntimeDxe: Firmware Volume Block service Leif Lindholm [not found] ` <1572228122-13265-10-git-send-email-abner.chang@hpe.com> 2019-11-26 14:53 ` [platform/devel-riscv-v2 PATCHv5 09/18] U5SeriesPkg/SerialIoLib: Platform Serial Port library Leif Lindholm [not found] ` <1572228122-13265-15-git-send-email-abner.chang@hpe.com> 2019-11-26 15:02 ` [platform/devel-riscv-v2 PATCHv5 12/18] U5SeriesPkg/FreedomU540HiFiveUnleashedBoard: Add SiFive U540 platform Leif Lindholm [not found] ` <1572228122-13265-18-git-send-email-abner.chang@hpe.com> 2019-11-26 15:07 ` [platform/devel-riscv-v2 PATCHv5 15/18] U5SeriesPkg/FreedomU500VC707Board: Add SiFive U500 platform Leif Lindholm 2019-10-28 4:20 [platform/devel-riscv-v2 PATCHv5 00/18] Initial version of RISC-V Abner Chang 2019-10-28 4:20 ` [platform/devel-riscv-v2 PATCHv5 09/18] U5SeriesPkg/SerialIoLib: Platform Serial Port library Abner Chang
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox