Re: [edk2-devel] [edk2-platforms][PATCH] Maintainers.txt: Update maintainers list for edk2-platforms
Reviewed-by: Daniel Schaefer From: devel@edk2.groups.io on behalf of Chang, Abner via groups.io Sent: Tuesday, August 23, 2022 13:57 To: devel@edk2.groups.io Cc: Leif Lindholm ; Michael D Kinney ; Daniel Schaefer ; Sunil V L Subject: [edk2-devel] [edk2-platforms][PATCH] Maintainers.txt: Update maintainers list for edk2-platforms From: Abner Chang Update package maintainers for below folders, 1. Platform/RISC-V/PlatformPkg and Silicon/RISC-V/ProcessorPkg Abner is stepping out from RISC-V stuff for now and hand over edk2 RISC-V responsibilities to Sunil. 2. Platform/SiFive/U5Series and Silicon/SiFive: Daniel agrees to take the responsibility of SiFive edk2-platforms stuff for the time being. Sunil will look for the SiFive people to take this over. 3. Daniel Schaefer is no longer with HPE. Update his email address so he can keep helping on RISC-V stuff with his personal email. 4. Remove Gilbert Chen because he is no longer with HPE and not be able to work on RISC-V stuff. Cc: Leif Lindholm Cc: Michael D Kinney Cc: Daniel Schaefer Cc: Sunil V L Signed-off-by: Abner Chang --- Maintainers.txt | 18 ++ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/Maintainers.txt b/Maintainers.txt index 5e403ce851..a4a0e4b907 100644 --- a/Maintainers.txt +++ b/Maintainers.txt @@ -256,15 +256,12 @@ R: Yuwei Chen Platform/RISC-V/PlatformPkg F: Platform/RISC-V/PlatformPkg/ -M: Abner Chang -R: Daniel Schaefer -R: Gilbert Chen +M: Sunil V L +R: Daniel Schaefer Platform/SiFive/U5Series F:Platform/SiFive/U5Series/ -M: Abner Chang -R: Gilbert Chen -R: Daniel Schaefer +M: Daniel Schaefer Silicon/Intel F: Silicon/Intel/ @@ -381,15 +378,12 @@ R: Masami Hiramatsu Silicon/RISC-V/ProcessorPkg F: Silicon/RISC-V/ProcessorPkg/ -M: Abner Chang -M: Daniel Schaefer -R: Gilbert Chen +M: Sunil V L +R: Daniel Schaefer Silicon/SiFive F: Silicon/SiFive/ -M: Abner Chang -M: Gilbert Chen -R: Daniel Schaefer +M: Daniel Schaefer Phytium platforms and silicon F: Platform/Phytium/ -- 2.37.1.windows.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#92774): https://edk2.groups.io/g/devel/message/92774 Mute This Topic: https://groups.io/mt/93198880/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH] Maintainers.txt: Update maintainers list
Reviewed-by: Daniel Schaefer From: devel@edk2.groups.io on behalf of NickleLa Sent: Tuesday, August 23, 2022 15:56 To: Sunil V L Cc: abner.ch...@amd.com ; devel@edk2.groups.io ; Andrew Fish ; Leif Lindholm ; Michael D Kinney ; Daniel Schaefer Subject: Re: [edk2-devel] [PATCH] Maintainers.txt: Update maintainers list Reviewed-by: Nickle Wangmailto:nic...@csie.io>> Thanks, Nickle Sunil V L mailto:suni...@ventanamicro.com>> 於 2022年8月23日 週二 中午12:21寫道: On Mon, Aug 22, 2022 at 11:13:00AM +0800, abner.ch...@amd.com<mailto:abner.ch...@amd.com> wrote: > From: Abner Chang mailto:abner.ch...@amd.com>> > > Update package maintainers for below package/arch, > > 1. RISCV64 Architecture: >Abner is stepping out from RISC-V stuff for now and hand over edk2 RISC-V >responsibilities to Sunil. >Daniel Schaefer is no longer with HPE. Update his email address for >RISCV64 arch. He will keep helping on RISC-V stuff with his personal >email. > > 2. EmbeddedPkg: >Daniel Schaefer is no longer with HPE. Update his email address for >EmbeddedPkg. > > 3. EmulatorPkg and RedfishPkg: >Nickle Wang is no longer with HPE. Update his email address for >EmulatorPkg and RedfishPkg packages. He will use the personal email for >the time being until he gets ready with his next journey. > > Cc: Andrew Fish mailto:af...@apple.com>> > Cc: Leif Lindholm > mailto:quic_llind...@quicinc.com>> > Cc: Michael D Kinney > mailto:michael.d.kin...@intel.com>> > Cc: Daniel Schaefer mailto:g...@danielschaefer.me>> > Cc: Sunil V L mailto:suni...@ventanamicro.com>> > Cc: Nickle Wang mailto:nic...@csie.io>> > Signed-off-by: Abner Chang mailto:abner.ch...@amd.com>> > --- > Maintainers.txt | 10 +- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/Maintainers.txt b/Maintainers.txt > index a0d8b696850..23f775c0eae 100644 > --- a/Maintainers.txt > +++ b/Maintainers.txt > @@ -99,8 +99,8 @@ M: Ard Biesheuvel > mailto:ardb%2btianoc...@kernel.org>> > [ardbiesheuvel] > > RISCV64 > F: */RiscV64/ > -M: Abner Chang mailto:abner.ch...@hpe.com>> [changab] > -R: Daniel Schaefer mailto:daniel.schae...@hpe.com>> > [JohnAZoidberg] > +M: Sunil V L mailto:suni...@ventanamicro.com>> > [vlsunil] > +R: Daniel Schaefer mailto:g...@danielschaefer.me>> > [JohnAZoidberg] > > EDK II Continuous Integration: > -- > @@ -185,7 +185,7 @@ W: > https://github.com/tianocore/tianocore.github.io/wiki/EmbeddedPkg > M: Leif Lindholm > mailto:quic_llind...@quicinc.com>> [leiflindholm] > M: Ard Biesheuvel > mailto:ardb%2btianoc...@kernel.org>> > [ardbiesheuvel] > M: Abner Chang mailto:abner.ch...@amd.com>> [changab] > -R: Daniel Schaefer mailto:daniel.schae...@hpe.com>> > [JohnAZoidberg] > +R: Daniel Schaefer mailto:g...@danielschaefer.me>> > [JohnAZoidberg] > > EmulatorPkg > F: EmulatorPkg/ > @@ -197,7 +197,7 @@ S: Maintained > EmulatorPkg: Redfish-related modules > F: EmulatorPkg/*Redfish* > M: Abner Chang mailto:abner.ch...@amd.com>> [changab] > -R: Nickle Wang mailto:nickle.w...@hpe.com>> [nicklela] > +R: Nickle Wang mailto:nic...@csie.io>> [nicklela] > > FatPkg > F: FatPkg/ > @@ -543,7 +543,7 @@ R: Ankit Sinha > mailto:ankit.si...@intel.com>> [ankit13s] > RedfishPkg: Redfish related modules > F: RedfishPkg/ > M: Abner Chang mailto:abner.ch...@amd.com>> [changab] > -R: Nickle Wang mailto:nickle.w...@hpe.com>> [nicklela] > +R: Nickle Wang mailto:nic...@csie.io>> [nicklela] > > SecurityPkg > F: SecurityPkg/ Reviewed-by: Sunil V L mailto:suni...@ventanamicro.com>> Thanks Sunil > -- > 2.37.1.windows.1 > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#92773): https://edk2.groups.io/g/devel/message/92773 Mute This Topic: https://groups.io/mt/93174490/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH v4 4/4] BaseTools: Remove ext. gcc dependencies (Linux only)
Thanks! ghcr.io/tianocore/containers/fedora-35-test:cea91ec is the container it uses, right? I used this to build the RISC-V U540 platform in edk2-platforms and can confirm it can still build and boot to shell fine. Tested-by: Daniel Schaefer On 8/11/22 18:49, Oliver Steffen wrote: > Hi Daniel, > > The CI still runs through all jobs successfully. > This includes builds for RiscV64. See the PR: > https://github.com/tianocore/edk2/pull/2935 > <https://github.com/tianocore/edk2/pull/2935> > > Thanks, > Oliver > > On Thu, Aug 11, 2022 at 5:34 AM Daniel Schaefer <mailto:daniel.schae...@hpe.com>> wrote: > > Hi Oliver, > > I assume you made sure that the build still works on at least one > platform per arch? > For example did you build a RISCV64 platform? > > Thanks, > Daniel > > On 8/10/22 20:03, Oliver Steffen wrote: > > Remove BaseTools/Bin/gcc*_linux_ext_dep.yaml to stop > > downloading gcc from external locations; use the > > toolchains provided by the container image instead. > > > > The image needs to set the GCC5_*_PREFIX accordingly. > > > > Signed-off-by: Oliver Steffen <mailto:ostef...@redhat.com>> > > --- > > BaseTools/Bin/gcc_aarch64_linux_ext_dep.yaml | 21 -- > > BaseTools/Bin/gcc_arm_linux_ext_dep.yaml | 21 -- > > .../Bin/gcc_riscv64_unknown_ext_dep.yaml | 22 --- > > 3 files changed, 64 deletions(-) > > delete mode 100644 BaseTools/Bin/gcc_aarch64_linux_ext_dep.yaml > > delete mode 100644 BaseTools/Bin/gcc_arm_linux_ext_dep.yaml > > delete mode 100644 BaseTools/Bin/gcc_riscv64_unknown_ext_dep.yaml > > > > diff --git a/BaseTools/Bin/gcc_aarch64_linux_ext_dep.yaml > b/BaseTools/Bin/gcc_aarch64_linux_ext_dep.yaml > > deleted file mode 100644 > > index ff8a9e868100.. > > --- a/BaseTools/Bin/gcc_aarch64_linux_ext_dep.yaml > > +++ /dev/null > > @@ -1,21 +0,0 @@ > > -## @file > > -# Download GCC AARCH64 compiler from Arm's release site > > -# Set shell variable GCC5_AARCH64_INSTALL to this folder > > -# > > -# This is only downloaded when a build activates scope > gcc_aarch64_linux > > -# > > -# Copyright (c) Microsoft Corporation. > > -# SPDX-License-Identifier: BSD-2-Clause-Patent > > -## > > -{ > > - "scope": "gcc_aarch64_linux", > > - "type": "web", > > - "name": "gcc_aarch64_linux", > > - "source": > "https://developer.arm.com/-/media/Files/downloads/gnu/11.2-2022.02/binrel/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu.tar.xz > > <https://developer.arm.com/-/media/Files/downloads/gnu/11.2-2022.02/binrel/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu.tar.xz>", > > - "version": "11.2-2022.02", > > - "sha256": > "52dbac3eb71dbe0916f60a8c5ab9b7dc9b66b3ce513047baa09fae56234e53f3", > > - "compression_type": "tar", > > - "internal_path": > "/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/", > > - "flags": ["set_shell_var", ], > > - "var_name": "GCC5_AARCH64_INSTALL" > > -} > > diff --git a/BaseTools/Bin/gcc_arm_linux_ext_dep.yaml > b/BaseTools/Bin/gcc_arm_linux_ext_dep.yaml > > deleted file mode 100644 > > index 151cbfa4b532.. > > --- a/BaseTools/Bin/gcc_arm_linux_ext_dep.yaml > > +++ /dev/null > > @@ -1,21 +0,0 @@ > > -## @file > > -# Download GCC ARM compiler from Arm's release site > > -# Set shell variable GCC5_ARM_INSTALL to this folder > > -# > > -# This is only downloaded when a build activates scope gcc_arm_linux > > -# > > -# Copyright (c) Microsoft Corporation. > > -# SPDX-License-Identifier: BSD-2-Clause-Patent > > -## > > -{ > > - "scope": "gcc_arm_linux", > > - "type": "web", > > - "name": "gcc_arm_linux", > > - "source": > "https://developer.arm.com/-/media/Files/downloads/gnu/11.2-2022.02/binrel/gcc-arm-11.2-2022.02-x86_64-arm-none-linux-gnueabihf.tar.xz > > <https://developer.arm.com/-/media/Files/downloads/gnu/11.2-2022.02/binrel/gcc-arm-11.2-2022.02-x86_64-arm-none-linux-gnueabihf.tar.xz>", >
[edk2-devel] [edk2-platforms PATCH v1 1/1] RISC-V/RiscVExceptionLib: Follow new CpuExceptionHandlerLib APIs
CpuExceptionHandlerLib (in EDK2) has been refactored with following changes 1. Removed InitializeCpuInterruptHandlers in 2a09527ebcb459b40 2. Removed InitializeCpuExceptionHandlersEx and added InitializeSeparateExceptionStacks in e7abb94d1fb8a0e7 The patch updates RISC-V version of CpuExceptionHandlerLib to follow the API changes, based on the ARM changes in e2ae0bed29ca0900bd35. The functionality to RISC-V platforms should be none. Signed-off-by: Daniel Schaefer Cc: Sunil V L --- Silicon/RISC-V/ProcessorPkg/Library/RiscVExceptionLib/CpuExceptionHandlerLib.c | 82 ++-- 1 file changed, 24 insertions(+), 58 deletions(-) diff --git a/Silicon/RISC-V/ProcessorPkg/Library/RiscVExceptionLib/CpuExceptionHandlerLib.c b/Silicon/RISC-V/ProcessorPkg/Library/RiscVExceptionLib/CpuExceptionHandlerLib.c index 93fbde619f..c3ced4a4c2 100644 --- a/Silicon/RISC-V/ProcessorPkg/Library/RiscVExceptionLib/CpuExceptionHandlerLib.c +++ b/Silicon/RISC-V/ProcessorPkg/Library/RiscVExceptionLib/CpuExceptionHandlerLib.c @@ -44,31 +44,6 @@ InitializeCpuExceptionHandlers ( return EFI_SUCCESS; } -/** - Initializes all CPU interrupt/exceptions entries and provides the default interrupt/exception handlers. - - Caller should try to get an array of interrupt and/or exception vectors that are in use and need to - persist by EFI_VECTOR_HANDOFF_INFO defined in PI 1.3 specification. - If caller cannot get reserved vector list or it does not exists, set VectorInfo to NULL. - If VectorInfo is not NULL, the exception vectors will be initialized per vector attribute accordingly. - - @param[in] VectorInfoPointer to reserved vector list. - - @retval EFI_SUCCESS All CPU interrupt/exception entries have been successfully initialized -with default interrupt/exception handlers. - @retval EFI_INVALID_PARAMETER VectorInfo includes the invalid content if VectorInfo is not NULL. - @retval EFI_UNSUPPORTED This function is not supported. - -**/ -EFI_STATUS -EFIAPI -InitializeCpuInterruptHandlers ( - IN EFI_VECTOR_HANDOFF_INFO *VectorInfo OPTIONAL - ) -{ - return EFI_SUCCESS; -} - /** Registers a function to be called from the processor interrupt handler. @@ -134,39 +109,6 @@ RiscVSupervisorModeTrapHandler ( } } -/** - Initializes all CPU exceptions entries with optional extra initializations. - - By default, this method should include all functionalities implemented by - InitializeCpuExceptionHandlers(), plus extra initialization works, if any. - This could be done by calling InitializeCpuExceptionHandlers() directly - in this method besides the extra works. - - InitData is optional and its use and content are processor arch dependent. - The typical usage of it is to convey resources which have to be reserved - elsewhere and are necessary for the extra initializations of exception. - - @param[in] VectorInfoPointer to reserved vector list. - @param[in] InitData Pointer to data optional for extra initializations -of exception. - - @retval EFI_SUCCESS The exceptions have been successfully - initialized. - @retval EFI_INVALID_PARAMETER VectorInfo or InitData contains invalid - content. - @retval EFI_UNSUPPORTED This function is not supported. - -**/ -EFI_STATUS -EFIAPI -InitializeCpuExceptionHandlersEx ( - IN EFI_VECTOR_HANDOFF_INFO *VectorInfo OPTIONAL, - IN CPU_EXCEPTION_INIT_DATA *InitData OPTIONAL - ) -{ - return InitializeCpuExceptionHandlers (VectorInfo); -} - /** The constructor function to initial interrupt handlers in RISCV_MACHINE_MODE_CONTEXT. @@ -192,3 +134,27 @@ CpuExceptionHandlerLibConstructor ( return EFI_SUCCESS; } + +/** + Setup separate stacks for certain exception handlers. + If the input Buffer and BufferSize are both NULL, use global variable if possible. + + @param[in] BufferPoint to buffer used to separate exception stack. + @param[in, out] BufferSizeOn input, it indicates the byte size of Buffer. + If the size is not enough, the return status will + be EFI_BUFFER_TOO_SMALL, and output BufferSize + will be the size it needs. + + @retval EFI_SUCCESS The stacks are assigned successfully. + @retval EFI_UNSUPPORTED This function is not supported. + @retval EFI_BUFFER_TOO_SMALLThis BufferSize is too small. +**/ +EFI_STATUS +EFIAPI +InitializeSeparateExceptionStacks ( + IN VOID *Buffer, + IN OUT UINTN *BufferSize + ) +{ + return EFI_SUCCESS; +} -- 2.36.0 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#92342): https://edk2.groups.io/g/devel/message/92342 Mute
Re: [edk2-devel] [PATCH v4 4/4] BaseTools: Remove ext. gcc dependencies (Linux only)
Hi Oliver, I assume you made sure that the build still works on at least one platform per arch? For example did you build a RISCV64 platform? Thanks, Daniel On 8/10/22 20:03, Oliver Steffen wrote: > Remove BaseTools/Bin/gcc*_linux_ext_dep.yaml to stop > downloading gcc from external locations; use the > toolchains provided by the container image instead. > > The image needs to set the GCC5_*_PREFIX accordingly. > > Signed-off-by: Oliver Steffen > --- > BaseTools/Bin/gcc_aarch64_linux_ext_dep.yaml | 21 -- > BaseTools/Bin/gcc_arm_linux_ext_dep.yaml | 21 -- > .../Bin/gcc_riscv64_unknown_ext_dep.yaml | 22 --- > 3 files changed, 64 deletions(-) > delete mode 100644 BaseTools/Bin/gcc_aarch64_linux_ext_dep.yaml > delete mode 100644 BaseTools/Bin/gcc_arm_linux_ext_dep.yaml > delete mode 100644 BaseTools/Bin/gcc_riscv64_unknown_ext_dep.yaml > > diff --git a/BaseTools/Bin/gcc_aarch64_linux_ext_dep.yaml > b/BaseTools/Bin/gcc_aarch64_linux_ext_dep.yaml > deleted file mode 100644 > index ff8a9e868100.. > --- a/BaseTools/Bin/gcc_aarch64_linux_ext_dep.yaml > +++ /dev/null > @@ -1,21 +0,0 @@ > -## @file > -# Download GCC AARCH64 compiler from Arm's release site > -# Set shell variable GCC5_AARCH64_INSTALL to this folder > -# > -# This is only downloaded when a build activates scope gcc_aarch64_linux > -# > -# Copyright (c) Microsoft Corporation. > -# SPDX-License-Identifier: BSD-2-Clause-Patent > -## > -{ > - "scope": "gcc_aarch64_linux", > - "type": "web", > - "name": "gcc_aarch64_linux", > - "source": > "https://developer.arm.com/-/media/Files/downloads/gnu/11.2-2022.02/binrel/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu.tar.xz;, > - "version": "11.2-2022.02", > - "sha256": > "52dbac3eb71dbe0916f60a8c5ab9b7dc9b66b3ce513047baa09fae56234e53f3", > - "compression_type": "tar", > - "internal_path": "/gcc-arm-11.2-2022.02-x86_64-aarch64-none-linux-gnu/", > - "flags": ["set_shell_var", ], > - "var_name": "GCC5_AARCH64_INSTALL" > -} > diff --git a/BaseTools/Bin/gcc_arm_linux_ext_dep.yaml > b/BaseTools/Bin/gcc_arm_linux_ext_dep.yaml > deleted file mode 100644 > index 151cbfa4b532.. > --- a/BaseTools/Bin/gcc_arm_linux_ext_dep.yaml > +++ /dev/null > @@ -1,21 +0,0 @@ > -## @file > -# Download GCC ARM compiler from Arm's release site > -# Set shell variable GCC5_ARM_INSTALL to this folder > -# > -# This is only downloaded when a build activates scope gcc_arm_linux > -# > -# Copyright (c) Microsoft Corporation. > -# SPDX-License-Identifier: BSD-2-Clause-Patent > -## > -{ > - "scope": "gcc_arm_linux", > - "type": "web", > - "name": "gcc_arm_linux", > - "source": > "https://developer.arm.com/-/media/Files/downloads/gnu/11.2-2022.02/binrel/gcc-arm-11.2-2022.02-x86_64-arm-none-linux-gnueabihf.tar.xz;, > - "version": "11.2-2022.02", > - "sha256": > "c254f7199261fe76c32ef42187502839bda7efad0a66646cf739d074eff45fad", > - "compression_type": "tar", > - "internal_path": "/gcc-arm-11.2-2022.02-x86_64-arm-none-linux-gnueabihf/", > - "flags": ["set_shell_var", ], > - "var_name": "GCC5_ARM_INSTALL" > -} > diff --git a/BaseTools/Bin/gcc_riscv64_unknown_ext_dep.yaml > b/BaseTools/Bin/gcc_riscv64_unknown_ext_dep.yaml > deleted file mode 100644 > index 8abbcd7ba040.. > --- a/BaseTools/Bin/gcc_riscv64_unknown_ext_dep.yaml > +++ /dev/null > @@ -1,22 +0,0 @@ > -## @file > -# Download GCC RISCV64 compiler from RISC-V Organization release site > -# Set shell variable GCC5_RISCV64_INSTALL to this folder > -# > -# This is only downloaded when a build activates scope gcc_riscv64_unknown > -# > -# Copyright (c) Microsoft Corporation. > -# Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights > reserved. > -# SPDX-License-Identifier: BSD-2-Clause-Patent > -## > -{ > - "scope": "gcc_riscv64_unknown", > - "type": "web", > - "name": "gcc_riscv64_unknown", > - "source": > "https://raw.githubusercontent.com/riscv/riscv-uefi-edk2-docs/master/gcc-riscv-edk2-ci-toolchain/gcc-riscv-9.2.0-2020.04-x86_64_riscv64-unknown-gnu.tar.xz > ", > - "version": "9.2.0", > - "compression_type": "tar", > - "sha256": > "28373643b69f0ce008273c3dc63f172aa1121952f1b9ae94d7485ac94af7f344", > - "internal_path": "/gcc-riscv-9.2.0-2020.04-x86_64_riscv64-unknown-gnu", > - "flags": ["set_shell_var", ], > - "var_name": "GCC5_RISCV64_INSTALL" > -} -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#92335): https://edk2.groups.io/g/devel/message/92335 Mute This Topic: https://groups.io/mt/92934464/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [edk2-platforms][PATCH v4 2/6] U5SeriesPkg: Platform Build: Resolving newly introduced dependency
Hi Kun, sorry for the late reply. The change is okay - thanks for making sure to change this platform, too! Reviewed-by: Daniel Schaefer Thanks, Daniel On 8/11/22 06:52, Kun Qin wrote: > Hi U5SeriesPkg maintainers, > > Can you please review the patch below and let me know if any feedback? > Platform build could be broken without this change. > > Any input is appreciated. > > Regards, > Kun > > On 8/4/2022 5:35 PM, Kun Qin via groups.io wrote: >> The new changes in SecureBootVariableLib brought in a new dependency >> of PlatformPKProtectionLib. >> >> This change added the new library instance from SecurityPkg to resolve >> U5SeriesPkg platforms build. >> >> Cc: Abner Chang >> Cc: Gilbert Chen >> Cc: Daniel Schaefer >> >> Signed-off-by: Kun Qin >> --- >> >> Notes: >> v2: >> - No review, no change >> v4: >> - Updated commit title. >> >> Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc | 1 + >> Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc | 1 + >> 2 files changed, 2 insertions(+) >> >> diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc >> b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc >> index 7b36b2c885e0..fc1ed012a541 100644 >> --- a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc >> +++ b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc >> @@ -127,6 +127,7 @@ [LibraryClasses] >> AuthVariableLib|SecurityPkg/Library/AuthVariableLib/AuthVariableLib.inf >> >> >> SecureBootVariableLib|SecurityPkg/Library/SecureBootVariableLib/SecureBootVariableLib.inf >> >> >> SecureBootVariableProvisionLib|SecurityPkg/Library/SecureBootVariableProvisionLib/SecureBootVariableProvisionLib.inf >> >> + >> PlatformPKProtectionLib|SecurityPkg/Library/PlatformPKProtectionLibVarPolicy/PlatformPKProtectionLibVarPolicy.inf >> >> !else >> >> >> TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.inf >> >> >> AuthVariableLib|MdeModulePkg/Library/AuthVariableLibNull/AuthVariableLibNull.inf >> >> diff --git >> a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc >> b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc >> index 26895a75ec2f..e59955d09452 100644 >> --- a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc >> +++ b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc >> @@ -127,6 +127,7 @@ [LibraryClasses] >> AuthVariableLib|SecurityPkg/Library/AuthVariableLib/AuthVariableLib.inf >> >> >> SecureBootVariableLib|SecurityPkg/Library/SecureBootVariableLib/SecureBootVariableLib.inf >> >> >> SecureBootVariableProvisionLib|SecurityPkg/Library/SecureBootVariableProvisionLib/SecureBootVariableProvisionLib.inf >> >> + >> PlatformPKProtectionLib|SecurityPkg/Library/PlatformPKProtectionLibVarPolicy/PlatformPKProtectionLibVarPolicy.inf >> >> !else >> >> >> TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.inf >> >> >> AuthVariableLib|MdeModulePkg/Library/AuthVariableLibNull/AuthVariableLibNull.inf >> -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#92331): https://edk2.groups.io/g/devel/message/92331 Mute This Topic: https://groups.io/mt/92947607/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [Patch v2 2/3] Maintainers.txt: Add missing github ids
Yes, that's my GitHub ID. Can add reviewed-by or acked-by. Whatever makes sense here. Thanks, Daniel On 7/21/22 11:14, Michael D Kinney wrote: > Cc: Andrew Fish > Cc: Leif Lindholm > Cc: Daniel Schaefer > Cc: Sean Rhodes > Cc: Debkumar De > Cc: Erdem Aktas > Cc: Gary Lin > Signed-off-by: Michael D Kinney > --- > Maintainers.txt | 12 ++-- > 1 file changed, 6 insertions(+), 6 deletions(-) > > diff --git a/Maintainers.txt b/Maintainers.txt > index 3ddb6805dbce..608cdf749c3c 100644 > --- a/Maintainers.txt > +++ b/Maintainers.txt > @@ -100,7 +100,7 @@ M: Ard Biesheuvel > [ardbiesheuvel] > RISCV64 > F: */RiscV64/ > M: Abner Chang [changab] > -R: Daniel Schaefer > +R: Daniel Schaefer [JohnAZoidberg] > > EDK II Continuous Integration: > -- > @@ -371,7 +371,7 @@ MdeModulePkg: Pei Core > F: MdeModulePkg/Core/Pei/ > R: Dandan Bi [dandanbi] > R: Liming Gao [lgao4] > -R: Debkumar De > +R: Debkumar De [dde01] > R: Harry Han > R: Catharine West [catharine-intl] > > @@ -474,7 +474,7 @@ F: OvmfPkg/PlatformPei/AmdSev.c > F: OvmfPkg/ResetVector/ > F: OvmfPkg/Sec/ > R: Brijesh Singh [codomania] > -R: Erdem Aktas > +R: Erdem Aktas [ruleof2] > R: James Bottomley [jejb] > R: Jiewen Yao [jyao1] > R: Min Xu [mxu9] > @@ -488,7 +488,7 @@ R: Abner Chang [changab] > > OvmfPkg: LsiScsi driver > F: OvmfPkg/LsiScsiDxe/ > -R: Gary Lin > +R: Gary Lin [lcp] > > OvmfPkg: MptScsi and PVSCSI driver > F: OvmfPkg/MptScsiDxe/ > @@ -602,7 +602,7 @@ R: Rahul Kumar [rahul1-kumar] > UefiCpuPkg: Sec related modules > F: UefiCpuPkg/SecCore/ > F: UefiCpuPkg/ResetVector/ > -R: Debkumar De > +R: Debkumar De [dde01] > R: Harry Han > R: Catharine West [catharine-intl] > > @@ -611,7 +611,7 @@ F: UefiPayloadPkg/ > W: https://github.com/tianocore/tianocore.github.io/wiki/UefiPayloadPkg > M: Guo Dong [gdong1] > M: Ray Ni [niruiyu] > -M: Sean Rhodes > +M: Sean Rhodes [Sean-StarLabs] > S: Maintained > > UnitTestFrameworkPkg -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#91622): https://edk2.groups.io/g/devel/message/91622 Mute This Topic: https://groups.io/mt/92520018/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] gcc 12, RiscV64 fence.i instruction missing
Hi Steffen, No, I don't think we've tried GCC12 yet. Hm, I don't quite understand the bug report but it sounds like something that'll be fixed by GCC? Thanks, Daniel From: devel@edk2.groups.io on behalf of Oliver Steffen Sent: Thursday, June 2, 2022 21:50 To: devel@edk2.groups.io Cc: Chang, Abner (HPS SW/FW Technologist) Subject: [edk2-devel] gcc 12, RiscV64 fence.i instruction missing Hi, has anyone tied building EDK2 (e.g. MdePkg) for RiscV64 with gcc 12? I get: /edk2/Build/Mde/DEBUG_GCC5/RISCV64/MdePkg/Library/BaseLib/BaseLib/OUTPUT/RiscV64/FlushCache.:16: Error: unrecognized opcode `fence.i' I found this gcc bug: Bug 104853 - [RISC-V] -march=rv64g not including extension Zifencei https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104853 I was working on getting gcc 12 into the CI. Thanks, Oliver -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#90163): https://edk2.groups.io/g/devel/message/90163 Mute This Topic: https://groups.io/mt/91499438/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [edk2-platforms][PATCH 00/14] Revise U500 for the latest RISC-V packages.
Great! U500 confirmed working again and cleanup through generic code. Reviewed-by: Daniel Schaefer From: Chang, Abner (HPS SW/FW Technologist) Sent: Monday, November 15, 2021 10:56 To: devel@edk2.groups.io Cc: Chang, Abner (HPS SW/FW Technologist) ; Schaefer, Daniel (ROM Janitor) ; Sunil V L Subject: [edk2-platforms][PATCH 00/14] Revise U500 for the latest RISC-V packages. Incorporate U500 platform with the latest RISC-V ProcessPkg and PlatformPkg. Signed-off-by: Abner Chang Cc: Daniel Schaefer Cc: Sunil V L Abner Chang (14): RiscVPlatformPkg/U500: Pass DTB from PEI to DXE RiscVPlatformPkg/U500: Fix up FDT and install into config table RiscVPlatformPkg/U500: Use FirmwareContext library RiscVPlatformPkg/U500: Use generic platform library RiscVPlatformPkg/U500: Creates opensbi firmware domains RiscVPlatformPkg/U500: Uses RISC-V PeiCoreEntryPoint library RiscVPlatformPkg/U500: Use PlatormSecPpiLib RiscVPlatformPkg/U500: U500 uses mtime CSR library RiscVPlatformPkg/U500: Determines hart number from DTB RiscVPlatformPkg/U500: Use NULL instance of RiscVSpecialPlatformLib RiscVPlatformPkg/U500: Add device tree for U500 platform RiscVPlatformPkg/U500: Add device tree to build Platform/RISC-V: Add debug message to SecMain.c Platform/RISC-V: Initialize variable to zero .../FreedomU500VC707Board/U500.dsc| 18 +- .../FreedomU500VC707Board/U500.fdf| 8 + .../FreedomU500VC707Board/DeviceTree.fdf.inc | 33 +++ .../FreedomU500VC707Board/U500.fdf.inc| 84 -- .../FreedomU500VC707Board/VarStore.fdf.inc| 6 +- .../DeviceTree/U500DeviceTree.inf | 25 ++ .../OpensbiPlatformLib/OpensbiPlatformLib.inf | 54 .../FreedomU500VC707Board/DeviceTree/gpio.h | 45 +++ .../DeviceTree/sifive-fu500-prci.h| 19 ++ .../RiscVSpecialPlatformLib.c | 2 +- .../PlatformPkg/Universal/Sec/SecMain.c | 14 +- .../Library/OpensbiPlatformLib/Platform.c | 206 - .../DeviceTree/fu500-c000.dtsi| 276 ++ .../DeviceTree/hifive-unleashed-a00.dts | 108 +++ 14 files changed, 611 insertions(+), 287 deletions(-) create mode 100644 Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/DeviceTree.fdf.inc create mode 100644 Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/DeviceTree/U500DeviceTree.inf delete mode 100644 Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/Library/OpensbiPlatformLib/OpensbiPlatformLib.inf create mode 100644 Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/DeviceTree/gpio.h create mode 100644 Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/DeviceTree/sifive-fu500-prci.h delete mode 100644 Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/Library/OpensbiPlatformLib/Platform.c create mode 100644 Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/DeviceTree/fu500-c000.dtsi create mode 100644 Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/DeviceTree/hifive-unleashed-a00.dts -- 2.31.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#83912): https://edk2.groups.io/g/devel/message/83912 Mute This Topic: https://groups.io/mt/87062615/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [edk2-platforms][PATCH 00/30] EDK2 RISC-V port with opensbi v0.9
Reviewed-by: Daniel Schaefer From: Chang, Abner (HPS SW/FW Technologist) Sent: Tuesday, October 19, 2021 16:09 To: devel@edk2.groups.io Cc: Chang, Abner (HPS SW/FW Technologist) ; Sunil V L ; Schaefer, Daniel Subject: [edk2-platforms][PATCH 00/30] EDK2 RISC-V port with opensbi v0.9 This is the patch set to incorporate opensbi v0.9 with edk2 RISC-V port. There are many architecture changes to compliant with the RISC-V SBI implementation (opensbi) and also provide the flexibility to OEM platform. Below is the summary of major changes. You can also refer to patch (1/31) to understand the architecture design. - Flexibly support privilege modes for edk2 execution phases using PCD. - M-mode SEC then S-mode all the way to boot OS. - M-mode SEC and PEI, then S-mode for DXE to boot OS. - M-mode firmware all the way to S-mode OS. Default is M-mode SEC then S-mode all the way to boot OS. Still have to implemente priviledge mode switching for PEI to DXE and BDSto Boot OS. - Apply opensbi firmware domain solution to protect firmware regions using FDF/PCD. - Provide Platform SEC PPI library that can be executed in either M-mode or S-mode PEI phases according to OEM platform definition. - Determine boot hart using Device Tree or PCD. This allows OEM to flexibly select the desired HARTs for booting system. Non-boot HARTs can be used for other applications/purposes. - Provide an edk2 library wrapper of opensbi platform functions. This allows OEM to have procedures that hooks before or after the certain opensbi platform functions. - Other patches to adopt opensbi v0.9. Cc: Sunil V L Cc: Daniel Schaefer Signed-off-by: Abner Chang Abner Chang (30): RISC-V/PlatformPkg: Update document RISC-V: Add RISC-V PeiCoreEntryPoint library RISC-V: Create opensbi firmware domains RISC-V: Use RISC-V PeiCoreEntryPoint library Platform/RISC-V: Add library to get PPI descriptor Platform/U540: Provide PlatormSecPpiLib Platform/RISC-V: Use PlatformSecPpiLib Platform/SiFive: CoreInfoHob uses RiscVFirmwareContextLib SiFive/U5SeriesPkg: Add CLINT to Device Tree Platform/RISC-V: Add NULL library instance of RiscVSpecialPlatformLib SiFive/U540: RiscVSpecialPlatformLib instance of U540 Platform/RISC-V: Remove platform dependency from this library Platform/RISC-V: Remove Null instance of OpensbilatformLibNull RiscVPlatformPkg/Sec: Initial hart_index2Id array RiscVPlatformPkg/OpensbiPlatformLib: Remove platform code RiscVPlatformPkg/U540: Only use four harts on U540 U5SeriesPkg/PeiCoreInfoHob: Remove hart count check RiscVPlatformPkg/RiscVSpecialPlatformLib: Rename module name RiscVPlatformPkg/U540: Add SortLib ProcessorPkg/opensbi: Update opensbi library RiscVPlatformPkg/Sec: Check Cold/Warm hart RiscVPlatformPkg/Sec: Add more comments to Secmain.c RiscV/ProcessorPkg: Create read mtime CSR library instances RiscV/ProcessorPkg: Use mtime CSR library Silicon/SiFive: Use mtime CSR library SiFive/SerialPortLib: Remove global variable RISC-V/PlatformPkg: Updates for the latest OpenSBI RiscVPlatformPkg/Sec: Separate EDK2 Opensbi platform hook. RISC-V/PlatformPkg: Determine hart number from DTB Silicon/RISC-V: Add PciCpuIoDxe driver .../RISC-V/PlatformPkg/RiscVPlatformPkg.dec | 52 +- .../RISC-V/ProcessorPkg/RiscVProcessorPkg.dec |1 + .../RISC-V/PlatformPkg/RiscVPlatformPkg.dsc | 20 +- .../FreedomU500VC707Board/U500.dsc|1 + .../FreedomU540HiFiveUnleashedBoard/U540.dsc | 11 +- .../RISC-V/ProcessorPkg/RiscVProcessorPkg.dsc |3 + .../U540.fdf.inc | 94 +- .../VarStore.fdf.inc |8 +- .../Edk2OpensbiPlatformWrapperLib.inf | 44 + .../OpensbiPlatformLib/OpensbiPlatformLib.inf | 11 +- .../OpensbiPlatformLibNull.inf| 38 - .../PeiCoreEntryPoint/PeiCoreEntryPoint.inf | 37 + .../PlatformSecPpiLibNull.inf | 36 + .../RiscVSpecialPlatformLibNull.inf | 36 + .../PlatformPkg/Universal/Sec/SecMain.inf | 15 +- .../RiscVSpecialPlatformLib.inf | 36 + .../PeiCoreInfoHobLib/PeiCoreInfoHobLib.inf |3 +- .../PlatformSecPpiLib/PlatformSecPpiLib.inf | 43 + .../Universal/Dxe/TimerDxe/TimerDxe.inf |1 + .../EmulatedMachineModeTimerLib.inf | 34 + .../MachineModeTimerLib.inf | 38 + .../RiscVTimerLib/BaseRiscVTimerLib.inf |3 +- .../ProcessorPkg/Universal/CpuDxe/CpuDxe.inf |1 + .../Universal/PciCpuIo2Dxe/PciCpuIo2Dxe.inf | 47 + .../Library/Edk2OpensbiPlatformWrapperLib.h | 16 + .../Include/Library/PlatformSecPpiLib.h | 24 + .../Include/Library/RiscVSpecialPlatformLib.h | 20 + .../OpensbiPlatformLib/PlatformOverride.h | 30 - .../PlatformPkg/Universal/Sec/SecMain.h | 28 +- .../SiFive/U5SeriesPkg/Include/SifiveU5Uart.h |1 + .../Include/IndustryStandard
Re: [edk2-devel] [Patch 4/6] SignedCapsulePkg/SignedCapsulePkg.dsc: Add RngLib mapping
Reviewed-by: Daniel Schaefer On 11/3/21 11:05, Michael D Kinney wrote: > Fix build breaks for all architectures by adding RngLib mapping. > > Cc: Jian J Wang > Cc: Ard Biesheuvel > Cc: Abner Chang > Cc: Daniel Schaefer > Signed-off-by: Michael D Kinney > --- > SignedCapsulePkg/SignedCapsulePkg.dsc | 7 +++ > 1 file changed, 7 insertions(+) > > diff --git a/SignedCapsulePkg/SignedCapsulePkg.dsc > b/SignedCapsulePkg/SignedCapsulePkg.dsc > index 2152d3d15668..8a27207a6f20 100644 > --- a/SignedCapsulePkg/SignedCapsulePkg.dsc > +++ b/SignedCapsulePkg/SignedCapsulePkg.dsc > @@ -93,6 +93,7 @@ [LibraryClasses] > > EdkiiSystemCapsuleLib|SignedCapsulePkg/Library/EdkiiSystemCapsuleLib/EdkiiSystemCapsuleLib.inf >IniParsingLib|SignedCapsulePkg/Library/IniParsingLib/IniParsingLib.inf > > PlatformFlashAccessLib|SignedCapsulePkg/Library/PlatformFlashAccessLibNull/PlatformFlashAccessLibNull.inf > + RngLib|MdePkg/Library/BaseRngLib/BaseRngLib.inf > > [LibraryClasses.ARM] >ArmSoftFloatLib|ArmPkg/Library/ArmSoftFloatLib/ArmSoftFloatLib.inf > @@ -108,6 +109,12 @@ [LibraryClasses.AARCH64, LibraryClasses.ARM] ># Add support for GCC stack protector >NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf > > +[LibraryClasses.ARM] > + RngLib|MdePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf > + > +[LibraryClasses.RISCV64] > + RngLib|MdePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf > + > [LibraryClasses.common.PEI_CORE] >HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf > > MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#83215): https://edk2.groups.io/g/devel/message/83215 Mute This Topic: https://groups.io/mt/86783674/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [Patch 3/6] SecurityPkg/SecurityPkg.dsc: Add missing RngLib for ARM and RISCV64
Reviewed-by: Daniel Schaefer On 11/3/21 13:28, Yao, Jiewen wrote: > Acked-by: Jiewen Yao > > Need ARM/RISC-V owner to confirm. > >> -Original Message- >> From: Kinney, Michael D >> Sent: Wednesday, November 3, 2021 11:06 AM >> To: devel@edk2.groups.io >> Cc: Yao, Jiewen ; Wang, Jian J ; >> Ard Biesheuvel ; Chang, Abner >> ; Schaefer, Daniel >> Subject: [Patch 3/6] SecurityPkg/SecurityPkg.dsc: Add missing RngLib for ARM >> and RISCV64 >> >> Fix SecurityPkg build breaks for ARM and RISCV64 by adding RngLib >> mapping. >> >> Cc: Jiewen Yao >> Cc: Jian J Wang >> Cc: Ard Biesheuvel >> Cc: Abner Chang >> Cc: Daniel Schaefer >> Signed-off-by: Michael D Kinney >> --- >> SecurityPkg/SecurityPkg.dsc | 9 - >> 1 file changed, 8 insertions(+), 1 deletion(-) >> >> diff --git a/SecurityPkg/SecurityPkg.dsc b/SecurityPkg/SecurityPkg.dsc >> index 37318c64c59f..73a93c2285b1 100644 >> --- a/SecurityPkg/SecurityPkg.dsc >> +++ b/SecurityPkg/SecurityPkg.dsc >> @@ -84,6 +84,14 @@ [LibraryClasses.ARM, LibraryClasses.AARCH64] >># Add support for GCC stack protector >>NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf >> >> + ArmSoftFloatLib|ArmPkg/Library/ArmSoftFloatLib/ArmSoftFloatLib.inf >> + >> +[LibraryClasses.ARM] >> + RngLib|MdePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf >> + >> +[LibraryClasses.RISCV64] >> + RngLib|MdePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf >> + >> [LibraryClasses.common.PEIM] >>PeimEntryPoint|MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf >>PeiServicesLib|MdePkg/Library/PeiServicesLib/PeiServicesLib.inf >> @@ -381,4 +389,3 @@ [BuildOptions] >> MSFT:*_*_IA32_DLINK_FLAGS = /ALIGN:256 >>INTEL:*_*_IA32_DLINK_FLAGS = /ALIGN:256 >> *_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES >> - >> -- >> 2.32.0.windows.1 > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#83214): https://edk2.groups.io/g/devel/message/83214 Mute This Topic: https://groups.io/mt/86783675/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [Patch 2/6] NetworkPkg/NetworkPkg.dsc: Add RngLib mapping for ARM and RISCV64
Perfect, thanks. I think BaseRngLib has an implementation for ARM or perhaps only AARCH64. I'm working one for RISCV64: https://bugzilla.tianocore.org/show_bug.cgi?id=3676 But until then this is good. Reviewed-by: Daniel Schaefer On 11/3/21 11:05, Michael D Kinney wrote: > Fix NetworkPkg build breaks for ARM and RISCV64 by adding RngLib > mapping. > > Cc: Maciej Rabeda > Cc: Jiaxin Wu > Cc: Siyuan Fu > Cc: Ard Biesheuvel > Cc: Abner Chang > Cc: Daniel Schaefer > Signed-off-by: Michael D Kinney > --- > NetworkPkg/NetworkPkg.dsc | 6 ++ > 1 file changed, 6 insertions(+) > > diff --git a/NetworkPkg/NetworkPkg.dsc b/NetworkPkg/NetworkPkg.dsc > index cf2164aefe25..8691a0f5d07a 100644 > --- a/NetworkPkg/NetworkPkg.dsc > +++ b/NetworkPkg/NetworkPkg.dsc > @@ -79,6 +79,12 @@ [LibraryClasses.ARM, LibraryClasses.AARCH64] >NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf >ArmSoftFloatLib|ArmPkg/Library/ArmSoftFloatLib/ArmSoftFloatLib.inf > > +[LibraryClasses.ARM] > + RngLib|MdePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf > + > +[LibraryClasses.RISCV64] > + RngLib|MdePkg/Library/BaseRngLibTimerLib/BaseRngLibTimerLib.inf > + > [PcdsFeatureFlag] >gEfiMdePkgTokenSpaceGuid.PcdComponentName2Disable|TRUE >gEfiMdePkgTokenSpaceGuid.PcdDriverDiagnostics2Disable|TRUE > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#83213): https://edk2.groups.io/g/devel/message/83213 Mute This Topic: https://groups.io/mt/86783673/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [edk2-platforms] [PATCH v3 09/14] RISC-V/PlatformPkg: Add FdtPeim to pass DTB from PEI to DXE via HOB
From: Abner Chang Cc: Daniel Schaefer Cc: Abner Chang Cc: Sunil V L Reviewed-by: Abner Chang Signed-off-by: Daniel Schaefer --- Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc | 5 ++ Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf | 1 + Platform/RISC-V/PlatformPkg/Universal/FdtPeim/FdtPeim.inf| 49 ++ Platform/RISC-V/PlatformPkg/Universal/FdtPeim/FdtPeim.c | 70 Silicon/RISC-V/ProcessorPkg/Library/RiscVOpensbiLib/opensbi | 2 +- 5 files changed, 126 insertions(+), 1 deletion(-) diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc index e971993b7b00..4fab3c4bdcbb 100644 --- a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc +++ b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc @@ -150,6 +150,10 @@ RiscVPlatformTimerLib|Platform/SiFive/U5SeriesPkg/Library/RiscVPlatformTimerLib/RiscVPlatformTimerLib.inf CpuExceptionHandlerLib|Silicon/RISC-V/ProcessorPkg/Library/RiscVExceptionLib/CpuExceptionHandlerDxeLib.inf + + # Flattened Device Tree (FDT) access library + FdtLib|EmbeddedPkg/Library/FdtLib/FdtLib.inf + [LibraryClasses.common.SEC] !ifdef $(DEBUG_ON_SERIAL_PORT) DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf @@ -400,6 +404,7 @@ PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf } + Platform/RISC-V/PlatformPkg/Universal/FdtPeim/FdtPeim.inf # # DXE Phase modules diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf index 820e19d11334..f0bd65fad648 100644 --- a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf +++ b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf @@ -101,6 +101,7 @@ INF MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf # RISC-V Platform PEI Driver INF Platform/RISC-V/PlatformPkg/Universal/Pei/PlatformPei/PlatformPei.inf +INF Platform/RISC-V/PlatformPkg/Universal/FdtPeim/FdtPeim.inf diff --git a/Platform/RISC-V/PlatformPkg/Universal/FdtPeim/FdtPeim.inf b/Platform/RISC-V/PlatformPkg/Universal/FdtPeim/FdtPeim.inf new file mode 100644 index ..8dc58f0a8bf4 --- /dev/null +++ b/Platform/RISC-V/PlatformPkg/Universal/FdtPeim/FdtPeim.inf @@ -0,0 +1,49 @@ +## @file +# The FDT Peim driver is used to pass the device tree to DXE phase. +# +# Copyright (c) 2021, Hewlett Packard Enterprise Developmente LP. All rights reserved. +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +[Defines] + INF_VERSION= 0x00010005 + BASE_NAME = FdtPei + MODULE_UNI_FILE= FdtPei.uni + FILE_GUID = 724FD5E9-F35E-4386-B1E1-2ADA6103C4F9 + MODULE_TYPE= PEIM + VERSION_STRING = 1.0 + + ENTRY_POINT= PeimPassFdt + +# +# The following information is for reference only and not required by the build tools. +# +# VALID_ARCHITECTURES = RISCV64 +# + +[Sources] + FdtPeim.c + +[Packages] + EmbeddedPkg/EmbeddedPkg.dec + MdePkg/MdePkg.dec + MdeModulePkg/MdeModulePkg.dec + Silicon/RISC-V/ProcessorPkg/RiscVProcessorPkg.dec + +[LibraryClasses] + DebugLib + DebugLib + HobLib + FdtLib + PcdLib + PeiServicesLib + PeimEntryPoint + RiscVFirmwareContextLib + +[Guids] + gFdtHobGuid ## PRODUCES + +[Depex] + TRUE diff --git a/Platform/RISC-V/PlatformPkg/Universal/FdtPeim/FdtPeim.c b/Platform/RISC-V/PlatformPkg/Universal/FdtPeim/FdtPeim.c new file mode 100644 index ..2cd94f291c7d --- /dev/null +++ b/Platform/RISC-V/PlatformPkg/Universal/FdtPeim/FdtPeim.c @@ -0,0 +1,70 @@ +/** @file +The module to pass the device tree to DXE via HOB. + +Copyright (c) 2021, Hewlett Packard Enterprise Development LP. All rights reserved. + +SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include +#include +#include +#include + +#include + +#include + +/** + The entrypoint of the module, it will pass the FDT via a HOB. + + @param FileHandle Handle of the file being invoked. + @param PeiServicesDescribes the list of possible PEI Services. + + @retval TODO +**/ +EFI_STATUS +EFIAPI +PeimPassFdt ( + IN EFI_PEI_FILE_HANDLEFileHandle, + IN CONST EFI_PEI_SERVICES **PeiServices + ) +{ + VOID *FdtPointer; + VOID *Base; + VOID *NewBase; + UINTN FdtSize; + UINTN FdtPages; + UINT64 *FdtHobData; + EFI_RISCV_OPENSBI_FIRMWARE_CONTEXT *FirmwareContext; + + FirmwareContext = NULL; + GetFirmwareContextPointer (); + + if (FirmwareContext == NULL) { +DEBUG
[edk2-devel] [edk2-platforms] [PATCH v3 13/14] RISC-V: Implement ResetSystem RT call
Cc: Daniel Schaefer Cc: Abner Chang Cc: Sunil V L Reviewed-by: Abner Chang Signed-off-by: Daniel Schaefer --- Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc| 12 +- Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc | 12 +- Platform/RISC-V/PlatformPkg/Library/ResetSystemLib/ResetSystemLib.inf | 33 + Silicon/RISC-V/ProcessorPkg/Include/Library/RiscVEdk2SbiLib.h | 38 +- Platform/RISC-V/PlatformPkg/Library/ResetSystemLib/ResetSystemLib.c | 128 Silicon/RISC-V/ProcessorPkg/Library/RiscVEdk2SbiLib/RiscVEdk2SbiLib.c | 44 ++- Silicon/RISC-V/ProcessorPkg/Library/RiscVOpensbiLib/opensbi | 2 +- 7 files changed, 256 insertions(+), 13 deletions(-) diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc index 1dc6405a20f0..f14511120e89 100644 --- a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc +++ b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc @@ -237,12 +237,13 @@ 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 + ResetSystemLib|Platform/RISC-V/PlatformPkg/Library/ResetSystemLib/ResetSystemLib.inf UefiRuntimeLib|MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf +!ifdef $(DEBUG_ON_SERIAL_PORT) + DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf +!else + DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf +!endif !if $(SECURE_BOOT_ENABLE) == TRUE BaseCryptLib|CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf !endif @@ -452,6 +453,7 @@ # Silicon/RISC-V/ProcessorPkg/Universal/CpuDxe/CpuDxe.inf Silicon/RISC-V/ProcessorPkg/Universal/SmbiosDxe/RiscVSmbiosDxe.inf + MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.inf MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf { diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc index cc62ad05212a..18a482aba611 100644 --- a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc +++ b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc @@ -244,12 +244,13 @@ 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 + ResetSystemLib|Platform/RISC-V/PlatformPkg/Library/ResetSystemLib/ResetSystemLib.inf UefiRuntimeLib|MdePkg/Library/UefiRuntimeLib/UefiRuntimeLib.inf +!ifdef $(DEBUG_ON_SERIAL_PORT) + DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf +!else + DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf +!endif !if $(SECURE_BOOT_ENABLE) == TRUE BaseCryptLib|CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf !endif @@ -458,6 +459,7 @@ # Silicon/RISC-V/ProcessorPkg/Universal/CpuDxe/CpuDxe.inf Silicon/RISC-V/ProcessorPkg/Universal/SmbiosDxe/RiscVSmbiosDxe.inf + MdeModulePkg/Universal/ResetSystemRuntimeDxe/ResetSystemRuntimeDxe.inf MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf { diff --git a/Platform/RISC-V/PlatformPkg/Library/ResetSystemLib/ResetSystemLib.inf b/Platform/RISC-V/PlatformPkg/Library/ResetSystemLib/ResetSystemLib.inf new file mode 100644 index ..f876ae20560b --- /dev/null +++ b/Platform/RISC-V/PlatformPkg/Library/ResetSystemLib/ResetSystemLib.inf @@ -0,0 +1,33 @@ +## @file +# Library instance for ResetSystem library class for RISC-V using SBI ecalls +# +# Copyright (c) 2021, Hewlett Packard Enterprise Development LP. All rights reserved. +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +[Defines] + INF_VERSION= 0x00010005 + BASE_NAME = ResetSystemLib + FILE_GUID = 3eff6057-1116-4dcb-837e-c0ef1a120ab1 + MODULE_TYPE= BASE + VERSION_STRING = 1.0 + LIBRARY_CLASS = ResetSystemLib
[edk2-devel] [edk2-platforms] [PATCH v3 10/14] RISC-V/PlatformPkg: Fixup FDT from HOB and install into config table
The Linux EFISTUB reads the FDT from the EFI system configuration table. Before installing the FDT needs to be patched with the booting hartid, because the kernel in S-Mode cannot determine it. Cc: Daniel Schaefer Cc: Abner Chang Cc: Sunil V L Reviewed-by: Abner Chang Signed-off-by: Daniel Schaefer --- Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc | 2 + Silicon/RISC-V/ProcessorPkg/RiscVProcessorPkg.dsc| 3 +- Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf | 1 + Silicon/RISC-V/ProcessorPkg/Universal/FdtDxe/FdtDxe.inf | 53 + Silicon/RISC-V/ProcessorPkg/Universal/FdtDxe/FdtDxe.c| 116 5 files changed, 174 insertions(+), 1 deletion(-) diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc index 4fab3c4bdcbb..cc62ad05212a 100644 --- a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc +++ b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc @@ -516,6 +516,8 @@ MdeModulePkg/Bus/Usb/UsbKbDxe/UsbKbDxe.inf MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassStorageDxe.inf + Silicon/RISC-V/ProcessorPkg/Universal/FdtDxe/FdtDxe.inf + # # FAT filesystem + GPT/MBR partitioning + UDF filesystem # diff --git a/Silicon/RISC-V/ProcessorPkg/RiscVProcessorPkg.dsc b/Silicon/RISC-V/ProcessorPkg/RiscVProcessorPkg.dsc index 1292ba1beab7..531319322c62 100644 --- a/Silicon/RISC-V/ProcessorPkg/RiscVProcessorPkg.dsc +++ b/Silicon/RISC-V/ProcessorPkg/RiscVProcessorPkg.dsc @@ -1,7 +1,7 @@ #/** @file # RISC-V processor package. # -# Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved. +# Copyright (c) 2021, Hewlett Packard Enterprise Development LP. All rights reserved. # # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -102,3 +102,4 @@ Silicon/RISC-V/ProcessorPkg/Universal/CpuDxe/CpuDxe.inf Silicon/RISC-V/ProcessorPkg/Universal/SmbiosDxe/RiscVSmbiosDxe.inf + Silicon/RISC-V/ProcessorPkg/Universal/FdtDxe/FdtDxe.inf diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf index f0bd65fad648..c58fa6357451 100644 --- a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf +++ b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf @@ -182,6 +182,7 @@ INF MdeModulePkg/Universal/DisplayEngineDxe/DisplayEngineDxe.inf INF MdeModulePkg/Universal/MemoryTest/NullMemoryTestDxe/NullMemoryTestDxe.inf INF FatPkg/EnhancedFatDxe/Fat.inf INF MdeModulePkg/Universal/Disk/UdfDxe/UdfDxe.inf +INF Silicon/RISC-V/ProcessorPkg/Universal/FdtDxe/FdtDxe.inf !ifndef $(SOURCE_DEBUG_ENABLE) INF MdeModulePkg/Universal/SerialDxe/SerialDxe.inf diff --git a/Silicon/RISC-V/ProcessorPkg/Universal/FdtDxe/FdtDxe.inf b/Silicon/RISC-V/ProcessorPkg/Universal/FdtDxe/FdtDxe.inf new file mode 100644 index ..ae6468f9f55f --- /dev/null +++ b/Silicon/RISC-V/ProcessorPkg/Universal/FdtDxe/FdtDxe.inf @@ -0,0 +1,53 @@ +## @file +# RISC-V Flattened Device Tree DXE module. +# +# Copyright (c) 2021, Hewlett Packard Enterprise Development LP. All rights reserved. +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +[Defines] + INF_VERSION = 0x0001001b + BASE_NAME = FdtDxe + FILE_GUID = a7d8f3f7-d8a7-47df-b3ec-9E5A693C380C + MODULE_TYPE = DXE_DRIVER + VERSION_STRING= 1.0 + ENTRY_POINT = InstallFdt + +# +# The following information is for reference only and not required by the build tools. +# +# VALID_ARCHITECTURES = RISCV64 +# + + +[Packages] + EmbeddedPkg/EmbeddedPkg.dec + MdeModulePkg/MdeModulePkg.dec + MdePkg/MdePkg.dec + Platform/RISC-V/PlatformPkg/RiscVPlatformPkg.dec + EmbeddedPkg/EmbeddedPkg.dec + +[LibraryClasses] + BaseLib + BaseMemoryLib + DebugLib + FdtLib + HobLib + MemoryAllocationLib + RiscVCpuLib + UefiBootServicesTableLib + UefiDriverEntryPoint + +[Sources] + FdtDxe.c + +[Guids] + gFdtHobGuid + gFdtTableGuid + +[Pcd] + gUefiRiscVPlatformPkgTokenSpaceGuid.PcdBootHartId ## CONSUMES + +[Depex] + TRUE diff --git a/Silicon/RISC-V/ProcessorPkg/Universal/FdtDxe/FdtDxe.c b/Silicon/RISC-V/ProcessorPkg/Universal/FdtDxe/FdtDxe.c new file mode 100644 index ..22b12027d334 --- /dev/null +++ b/Silicon/RISC-V/ProcessorPkg/Universal/FdtDxe/FdtDxe.c @@ -0,0 +1,116 @@ +/** @file + RISC-V Flattened Device Tree DXE module + + The Linux booting protocol on RISC-V requires the id of the booting hart to + be passed as a0. Therefore the EFISTUB needs to get this information. Because + it runs in S-Mode, it cannot get this information from mhartid. Instead we + insert the id
[edk2-devel] [edk2-platforms] [PATCH v3 14/14] Move OpenSbiPlatformLib to RISC-V/PlatformPkg
It's a generic platform file. Only the device tree decides what happens. Cc: Daniel Schaefer Cc: Abner Chang Cc: Sunil V L Reviewed-by: Abner Chang Signed-off-by: Daniel Schaefer --- Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc | 2 +- Platform/{SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard => RISC-V/PlatformPkg}/Library/OpensbiPlatformLib/OpensbiPlatformLib.inf | 0 Platform/{SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard => RISC-V/PlatformPkg}/Library/OpensbiPlatformLib/PlatformOverride.h | 0 Platform/{SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard => RISC-V/PlatformPkg}/Library/OpensbiPlatformLib/Platform.c | 13 - Platform/{SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard => RISC-V/PlatformPkg}/Library/OpensbiPlatformLib/SifiveFu540.c | 0 5 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc index 18a482aba611..5d2ccafacaf3 100644 --- a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc +++ b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc @@ -173,7 +173,7 @@ # # OpenSBi Platform Library # - RiscVOpensbiPlatformLib|Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Library/OpensbiPlatformLib/OpensbiPlatformLib.inf + RiscVOpensbiPlatformLib|Platform/RISC-V/PlatformPkg/Library/OpensbiPlatformLib/OpensbiPlatformLib.inf [LibraryClasses.common.PEI_CORE] HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Library/OpensbiPlatformLib/OpensbiPlatformLib.inf b/Platform/RISC-V/PlatformPkg/Library/OpensbiPlatformLib/OpensbiPlatformLib.inf similarity index 100% rename from Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Library/OpensbiPlatformLib/OpensbiPlatformLib.inf rename to Platform/RISC-V/PlatformPkg/Library/OpensbiPlatformLib/OpensbiPlatformLib.inf diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Library/OpensbiPlatformLib/PlatformOverride.h b/Platform/RISC-V/PlatformPkg/Library/OpensbiPlatformLib/PlatformOverride.h similarity index 100% rename from Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Library/OpensbiPlatformLib/PlatformOverride.h rename to Platform/RISC-V/PlatformPkg/Library/OpensbiPlatformLib/PlatformOverride.h diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Library/OpensbiPlatformLib/Platform.c b/Platform/RISC-V/PlatformPkg/Library/OpensbiPlatformLib/Platform.c similarity index 88% rename from Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Library/OpensbiPlatformLib/Platform.c rename to Platform/RISC-V/PlatformPkg/Library/OpensbiPlatformLib/Platform.c index ac76f073ab53..c4cf6782bd1f 100644 --- a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Library/OpensbiPlatformLib/Platform.c +++ b/Platform/RISC-V/PlatformPkg/Library/OpensbiPlatformLib/Platform.c @@ -201,13 +201,24 @@ const struct sbi_platform_operations platform_ops = { .timer_exit= fdt_timer_exit, }; +#if FixedPcdGet32(PcdBootableHartNumber) == 4 +#define U540_BOOTABLE_HART_COUNT FixedPcdGet32(PcdBootableHartNumber) +static u32 U540_hart_index2id[U540_BOOTABLE_HART_COUNT] = {1, 2, 3, 4}; +#endif + struct sbi_platform platform = { .opensbi_version = OPENSBI_VERSION, .platform_version = SBI_PLATFORM_VERSION(0x0, 0x01), .name = "Generic", .features= SBI_PLATFORM_DEFAULT_FEATURES, .hart_count= SBI_HARTMASK_MAX_BITS, +// TODO: Workaround for U540. Not sure why we need this. OpenSBI doesn't need it. +#if FixedPcdGet32(PcdBootableHartNumber) == 4 + .hart_index2id= U540_hart_index2id, +#else .hart_index2id= generic_hart_index2id, - .hart_stack_size = SBI_PLATFORM_DEFAULT_HART_STACK_SIZE, +#endif + // TODO: Any reason why it shouldn't just be SBI_PLATFORM_DEFAULT_HART_STACK_SIZE? + .hart_stack_size = FixedPcdGet32(PcdOpenSbiStackSize), .platform_ops_addr = (unsigned long)_ops }; diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Library/OpensbiPlatformLib/SifiveFu540.c b/Platform/RISC-V/PlatformPkg/Library/OpensbiPlatformLib/SifiveFu540.c similarity index 100% rename from Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Library/OpensbiPlatformLib/SifiveFu540.c rename to Platform/RISC-V/PlatformPkg/Library/OpensbiPlatformLib/SifiveFu540.c -- 2.31.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#82280): https://edk2.groups.io/g/devel/message/82280 Mute This Topic: https://groups.io/mt/86432332/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [edk2-platforms] [PATCH v3 07/14] U540: Add and build device tree
Cc: Daniel Schaefer Cc: Abner Chang Cc: Sunil V L Reviewed-by: Abner Chang Signed-off-by: Daniel Schaefer --- Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc | 2 + Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf | 6 + Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/DeviceTree/U540DeviceTree.inf | 25 ++ Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/DeviceTree/gpio.h | 42 +++ Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/DeviceTree/sifive-fu540-prci.h | 18 ++ Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/DeviceTree.fdf.inc | 35 +++ Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/DeviceTree/fu540-c000.dtsi | 287 Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/DeviceTree/hifive-unleashed-a00.dts | 106 Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf.inc | 8 +- 9 files changed, 526 insertions(+), 3 deletions(-) diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc index 2b00176c27a0..e971993b7b00 100644 --- a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc +++ b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc @@ -489,6 +489,8 @@ MdeModulePkg/Universal/MemoryTest/NullMemoryTestDxe/NullMemoryTestDxe.inf MdeModulePkg/Universal/SerialDxe/SerialDxe.inf + Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/DeviceTree/U540DeviceTree.inf + # # SMBIOS Support # diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf index 74717377287b..820e19d11334 100644 --- a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf +++ b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf @@ -33,6 +33,7 @@ gUefiRiscVPlatformPkgTokenSpaceGuid.PcdRiscVDxeFvBase|gUefiRiscVPlatformPkgToken FV = FVMAIN_COMPACT !include VarStore.fdf.inc +!include DeviceTree.fdf.inc @@ -325,3 +326,8 @@ FILE FV_IMAGE = 9E21FD93-9C72-4c15-8C4B-E77F1DB2D792 { RAW ACPI |.acpi RAW ASL|.aml } + +[Rule.Common.USER_DEFINED.DTB] + FILE FREEFORM = $(NAMED_GUID) { +RAW BIN|.dtb + } diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/DeviceTree/U540DeviceTree.inf b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/DeviceTree/U540DeviceTree.inf new file mode 100644 index ..ebf0881c68bd --- /dev/null +++ b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/DeviceTree/U540DeviceTree.inf @@ -0,0 +1,25 @@ +## @file +# +# Device tree description of the Hifive Unleashed platform +# +# Copyright (c) 2021, Hewlett Packard Enterprise Development LP. All rights reserved. +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +[Defines] + INF_VERSION= 0x0001001A + BASE_NAME = U540DeviceTree + FILE_GUID = 25462CDA-221F-47DF-AC1D-259CFAA4E326 # gDtPlatformDefaultDtbFileGuid + MODULE_TYPE= USER_DEFINED + VERSION_STRING = 1.0 + +[Sources] + gpio.h + hifive-unleashed-a00.dts + fu540-c000.dtsi + sifive-fu540-prci.h + +[Packages] + MdePkg/MdePkg.dec diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/DeviceTree/gpio.h b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/DeviceTree/gpio.h new file mode 100644 index ..c029467e828b --- /dev/null +++ b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/DeviceTree/gpio.h @@ -0,0 +1,42 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * This header provides constants for most GPIO bindings. + * + * Most GPIO bindings include a flags cell as part of the GPIO specifier. + * In most cases, the format of the flags cell uses the standard values + * defined in this header. + */ + +#ifndef _DT_BINDINGS_GPIO_GPIO_H +#define _DT_BINDINGS_GPIO_GPIO_H + +/* Bit 0 express polarity */ +#define GPIO_ACTIVE_HIGH 0 +#define GPIO_ACTIVE_LOW 1 + +/* Bit 1 express single-endedness */ +#define GPIO_PUSH_PULL 0 +#define GPIO_SINGLE_ENDED 2 + +/* Bit 2 express Open drain or open source */ +#define GPIO_LINE_OPEN_SOURCE 0 +#define GPIO_LINE_OPEN_DRAIN 4 + +/* + * Open Drain/Collector is the combination of single-ended open drain interface. + * Open Source/Emitter is the combination of single-ended open source interface. + */ +#define GPIO_OPEN_DRAIN (GPIO_SINGLE_ENDED | GPIO_LINE_OPEN_DRAIN) +#define GPIO_OPEN_SOURCE (GPIO_SINGLE_ENDED | GPIO_LINE_OPEN_SOURCE) + +/* Bit 3 express GPIO
[edk2-devel] [edk2-platforms] [PATCH v3 12/14] RISC-V: Switch to latest OpenSBI
Cc: Daniel Schaefer Cc: Abner Chang Cc: Sunil V L Reviewed-by: Abner Chang Signed-off-by: Daniel Schaefer --- Silicon/RISC-V/ProcessorPkg/Library/RiscVOpensbiLib/RiscVOpensbiLib.inf | 13 +++- Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Library/OpensbiPlatformLib/PlatformOverride.h | 57 +++--- Silicon/RISC-V/ProcessorPkg/Include/Library/RiscVEdk2SbiLib.h | 1 + Silicon/RISC-V/ProcessorPkg/Include/OpensbiTypes.h | 1 + Platform/RISC-V/PlatformPkg/Library/OpensbiPlatformLibNull/Platform.c | 27 --- Platform/RISC-V/PlatformPkg/Universal/Sec/SecMain.c | 5 +- Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/Library/OpensbiPlatformLib/Platform.c | 29 +-- Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Library/OpensbiPlatformLib/Platform.c | 31 +++- Platform/SiFive/U5SeriesPkg/Library/SerialIoLib/SerialPortLib.c | 81 +++- Platform/RISC-V/PlatformPkg/Universal/Sec/Riscv64/SecEntry.S | 2 + 10 files changed, 154 insertions(+), 93 deletions(-) diff --git a/Silicon/RISC-V/ProcessorPkg/Library/RiscVOpensbiLib/RiscVOpensbiLib.inf b/Silicon/RISC-V/ProcessorPkg/Library/RiscVOpensbiLib/RiscVOpensbiLib.inf index 71cc76444eef..e40a797896be 100644 --- a/Silicon/RISC-V/ProcessorPkg/Library/RiscVOpensbiLib/RiscVOpensbiLib.inf +++ b/Silicon/RISC-V/ProcessorPkg/Library/RiscVOpensbiLib/RiscVOpensbiLib.inf @@ -23,6 +23,7 @@ opensbi/lib/sbi/sbi_bitmap.c opensbi/lib/sbi/sbi_bitops.c opensbi/lib/sbi/sbi_console.c + opensbi/lib/sbi/sbi_domain.c opensbi/lib/sbi/sbi_ecall.c opensbi/lib/sbi/sbi_ecall_base.c opensbi/lib/sbi/sbi_ecall_hsm.c @@ -51,27 +52,33 @@ opensbi/lib/utils/fdt/fdt_helper.c opensbi/lib/utils/fdt/fdt_fixup.c + opensbi/lib/utils/fdt/fdt_domain.c opensbi/lib/utils/ipi/fdt_ipi.c - opensbi/lib/utils/ipi/fdt_ipi_clint.c + opensbi/lib/utils/ipi/aclint_mswi.c + opensbi/lib/utils/ipi/fdt_ipi_mswi.c opensbi/lib/utils/irqchip/fdt_irqchip.c opensbi/lib/utils/irqchip/fdt_irqchip_plic.c opensbi/lib/utils/irqchip/plic.c opensbi/lib/utils/reset/fdt_reset.c opensbi/lib/utils/reset/fdt_reset_htif.c opensbi/lib/utils/reset/fdt_reset_sifive.c + opensbi/lib/utils/reset/fdt_reset_thead.c + opensbi/lib/utils/reset/fdt_reset_thead_asm.S opensbi/lib/utils/serial/fdt_serial.c opensbi/lib/utils/serial/fdt_serial_htif.c opensbi/lib/utils/serial/fdt_serial_shakti.c opensbi/lib/utils/serial/fdt_serial_sifive.c opensbi/lib/utils/serial/fdt_serial_uart8250.c + opensbi/lib/utils/serial/fdt_serial_gaisler.c + opensbi/lib/utils/serial/gaisler-uart.c opensbi/lib/utils/serial/shakti-uart.c opensbi/lib/utils/serial/sifive-uart.c opensbi/lib/utils/serial/uart8250.c - opensbi/lib/utils/sys/clint.c opensbi/lib/utils/sys/htif.c opensbi/lib/utils/sys/sifive_test.c opensbi/lib/utils/timer/fdt_timer.c - opensbi/lib/utils/timer/fdt_timer_clint.c + opensbi/lib/utils/timer/aclint_mtimer.c + opensbi/lib/utils/timer/fdt_timer_mtimer.c [Packages] EmbeddedPkg/EmbeddedPkg.dec # For libfdt. diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Library/OpensbiPlatformLib/PlatformOverride.h b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Library/OpensbiPlatformLib/PlatformOverride.h index 9b6fcdc15f45..467ebbd4b889 100644 --- a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Library/OpensbiPlatformLib/PlatformOverride.h +++ b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Library/OpensbiPlatformLib/PlatformOverride.h @@ -1,27 +1,30 @@ -/* - * SPDX-License-Identifier: BSD-2-Clause - * - * Copyright (c) 2020 Western Digital Corporation or its affiliates. - * - * Authors: - * Anup Patel - */ - -#ifndef __PLATFORM_OVERRIDE_H__ -#define __PLATFORM_OVERRIDE_H__ - -#include - -struct platform_override { - const struct fdt_match *match_table; - u64 (*features)(const struct fdt_match *match); - u64 (*tlbr_flush_limit)(const struct fdt_match *match); - int (*early_init)(bool cold_boot, const struct fdt_match *match); - int (*final_init)(bool cold_boot, const struct fdt_match *match); - void (*early_exit)(const struct fdt_match *match); - void (*final_exit)(const struct fdt_match *match); - int (*system_reset)(u32 reset_type, const struct fdt_match *match); - int (*fdt_fixup)(void *fdt, const struct fdt_match *match); -}; - -#endif +/* + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2020 Western Digital Corporation or its affiliates. + * + * Authors: + * Anup Patel + */ + +#ifndef
[edk2-devel] [edk2-platforms] [PATCH v3 11/14] U5SeriesPkg: Switch to generic OpenSBI platform
New platform files require more space in SEC. Behavior is determined not by source code but by device tree. Cc: Daniel Schaefer Cc: Abner Chang Cc: Sunil V L Reviewed-by: Abner Chang Signed-off-by: Daniel Schaefer --- Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Library/OpensbiPlatformLib/OpensbiPlatformLib.inf | 2 + Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Library/OpensbiPlatformLib/PlatformOverride.h | 27 ++ Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Library/OpensbiPlatformLib/Platform.c | 390 ++-- Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Library/OpensbiPlatformLib/SifiveFu540.c | 47 +++ Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf.inc | 6 +- Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf.inc | 6 +- 6 files changed, 281 insertions(+), 197 deletions(-) diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Library/OpensbiPlatformLib/OpensbiPlatformLib.inf b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Library/OpensbiPlatformLib/OpensbiPlatformLib.inf index 317aaceb2519..f9f2073a5ba4 100644 --- a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Library/OpensbiPlatformLib/OpensbiPlatformLib.inf +++ b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Library/OpensbiPlatformLib/OpensbiPlatformLib.inf @@ -25,6 +25,8 @@ [Sources] Platform.c + SifiveFu540.c + PlatformOverride.h [Packages] EmbeddedPkg/EmbeddedPkg.dec diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Library/OpensbiPlatformLib/PlatformOverride.h b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Library/OpensbiPlatformLib/PlatformOverride.h new file mode 100644 index ..9b6fcdc15f45 --- /dev/null +++ b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Library/OpensbiPlatformLib/PlatformOverride.h @@ -0,0 +1,27 @@ +/* + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2020 Western Digital Corporation or its affiliates. + * + * Authors: + * Anup Patel + */ + +#ifndef __PLATFORM_OVERRIDE_H__ +#define __PLATFORM_OVERRIDE_H__ + +#include + +struct platform_override { + const struct fdt_match *match_table; + u64 (*features)(const struct fdt_match *match); + u64 (*tlbr_flush_limit)(const struct fdt_match *match); + int (*early_init)(bool cold_boot, const struct fdt_match *match); + int (*final_init)(bool cold_boot, const struct fdt_match *match); + void (*early_exit)(const struct fdt_match *match); + void (*final_exit)(const struct fdt_match *match); + int (*system_reset)(u32 reset_type, const struct fdt_match *match); + int (*fdt_fixup)(void *fdt, const struct fdt_match *match); +}; + +#endif diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Library/OpensbiPlatformLib/Platform.c b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Library/OpensbiPlatformLib/Platform.c index aa6274be965b..fe6e2a8c943a 100644 --- a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Library/OpensbiPlatformLib/Platform.c +++ b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Library/OpensbiPlatformLib/Platform.c @@ -1,216 +1,224 @@ /* - * - * Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved. - * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2019 Western Digital Corporation or its affiliates. + * Copyright (c) 2020 Western Digital Corporation or its affiliates. * * Authors: - * Atish Patra + * Anup Patel */ #include +#include #include -#include -#include -#include -#include +#include #include +#include #include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include -#define U540_HART_COUNT FixedPcdGet32(PcdHartCount) -#define U540_BOOTABLE_HART_COUNT FixedPcdGet32(PcdBootableHartNumber) -#define U540_HART_STACK_SIZE FixedPcdGet32(PcdOpenSbiStackSize) -#define U540_BOOT_HART_IDFixedPcdGet32(PcdBootHartId) +extern const struct platform_override sifive_fu540; -#define U540_SYS_CLK FixedPcdGet32(PcdU5PlatformSystemClock) - -#define U540_PLIC_ADDR0xc00 -#define U540_PLIC_NUM_SOURCES 0x35 -#define U540_PLIC_NUM_PRIORITIES 7 - -#define U540_UART_ADDRFixedPcdGet32(PcdU5UartBase) - -#define U540_UART_BAUDRATE115200 - -/* PRCI clock related macros */ -//TODO: Do we need a separate driver for this ? -#define U540_PRCI_BASE_ADDR 0x1000 -#define U540_PRCI_CLKMUXSTATUSREG 0x002C -#define U540_PRCI_CLKMUX_STATUS_TLCLKSEL(0x1 << 1) - -/* Full tlb flush always */ -#
[edk2-devel] [edk2-platforms] [PATCH v3 08/14] RISC-V/PlatformPkg: Build DeviceTree and use that in SEC
OpenSBI uses the device tree for platform specific initialization, so we need to have it already in SEC. Cc: Daniel Schaefer Cc: Abner Chang Cc: Sunil V L Reviewed-by: Abner Chang Signed-off-by: Daniel Schaefer --- Platform/RISC-V/PlatformPkg/RiscVPlatformPkg.dec| 4 ++ Platform/RISC-V/PlatformPkg/Universal/Sec/SecMain.inf | 2 + Silicon/RISC-V/ProcessorPkg/Include/IndustryStandard/RiscVOpensbi.h | 1 + Platform/RISC-V/PlatformPkg/Universal/Sec/SecMain.c | 49 Platform/RISC-V/PlatformPkg/Universal/Sec/Riscv64/SecEntry.S| 22 - 5 files changed, 56 insertions(+), 22 deletions(-) diff --git a/Platform/RISC-V/PlatformPkg/RiscVPlatformPkg.dec b/Platform/RISC-V/PlatformPkg/RiscVPlatformPkg.dec index 48aeb97431d7..ad15a155fe31 100644 --- a/Platform/RISC-V/PlatformPkg/RiscVPlatformPkg.dec +++ b/Platform/RISC-V/PlatformPkg/RiscVPlatformPkg.dec @@ -31,6 +31,8 @@ gUefiRiscVPlatformPkgTokenSpaceGuid.PcdRiscVPeiFvSize|0x0|UINT32|0x1003 gUefiRiscVPlatformPkgTokenSpaceGuid.PcdRiscVDxeFvBase|0x0|UINT32|0x1004 gUefiRiscVPlatformPkgTokenSpaceGuid.PcdRiscVDxeFvSize|0x0|UINT32|0x1005 + gUefiRiscVPlatformPkgTokenSpaceGuid.PcdRiscVDtbFvBase|0x0|UINT32|0x1016 + gUefiRiscVPlatformPkgTokenSpaceGuid.PcdRiscVDtbFvSize|0x0|UINT32|0x1017 # # Definition of EFI Variable region @@ -66,6 +68,8 @@ gUefiRiscVPlatformPkgTokenSpaceGuid.PcdTemporaryRamSize|0|UINT32|0x1104 gUefiRiscVPlatformPkgTokenSpaceGuid.PcdPeiCorePrivilegeMode|0|UINT32|0x1105 + gUefiRiscVPlatformPkgTokenSpaceGuid.PcdDeviceTreeAddress|0|UINT32|0x1106 + [PcdsPatchableInModule] [PcdsFeatureFlag] diff --git a/Platform/RISC-V/PlatformPkg/Universal/Sec/SecMain.inf b/Platform/RISC-V/PlatformPkg/Universal/Sec/SecMain.inf index 89bcb039a6ab..78bd75e3ac11 100644 --- a/Platform/RISC-V/PlatformPkg/Universal/Sec/SecMain.inf +++ b/Platform/RISC-V/PlatformPkg/Universal/Sec/SecMain.inf @@ -57,6 +57,8 @@ [FixedPcd] gUefiRiscVPlatformPkgTokenSpaceGuid.PcdRiscVPeiFvBase gUefiRiscVPlatformPkgTokenSpaceGuid.PcdRiscVPeiFvSize + gUefiRiscVPlatformPkgTokenSpaceGuid.PcdRiscVDtbFvBase + gUefiRiscVPlatformPkgTokenSpaceGuid.PcdDeviceTreeAddress [Pcd] gUefiRiscVPlatformPkgTokenSpaceGuid.PcdBootHartId diff --git a/Silicon/RISC-V/ProcessorPkg/Include/IndustryStandard/RiscVOpensbi.h b/Silicon/RISC-V/ProcessorPkg/Include/IndustryStandard/RiscVOpensbi.h index 2dab696af84d..e7ac6d26ee85 100644 --- a/Silicon/RISC-V/ProcessorPkg/Include/IndustryStandard/RiscVOpensbi.h +++ b/Silicon/RISC-V/ProcessorPkg/Include/IndustryStandard/RiscVOpensbi.h @@ -47,6 +47,7 @@ typedef struct { typedef struct { VOID*PeiServiceTable; // PEI Service table + UINT64 FlattenedDeviceTree; // Pointer to Flattened Device tree EFI_RISCV_FIRMWARE_CONTEXT_HART_SPECIFIC *HartSpecific[RISC_V_MAX_HART_SUPPORTED]; } EFI_RISCV_OPENSBI_FIRMWARE_CONTEXT; diff --git a/Platform/RISC-V/PlatformPkg/Universal/Sec/SecMain.c b/Platform/RISC-V/PlatformPkg/Universal/Sec/SecMain.c index fa9ecd789a57..0af0b4bac831 100644 --- a/Platform/RISC-V/PlatformPkg/Universal/Sec/SecMain.c +++ b/Platform/RISC-V/PlatformPkg/Universal/Sec/SecMain.c @@ -557,6 +557,12 @@ VOID EFIAPI PeiCore ( )); ThisSbiPlatform->firmware_context = (unsigned long) + + // + // Save Flattened Device tree in firmware context + // + FirmwareContext.FlattenedDeviceTree = FuncArg1; + // // Set firmware context Hart-specific pointer // @@ -647,6 +653,42 @@ RiscVOpenSbiHartSwitchMode ( sbi_hart_switch_mode(FuncArg0, FuncArg1, NextAddr, NextMode, NextVirt); } +/** + Get device tree address + + @retval The address of Device Tree binary. +**/ +VOID * +EFIAPI +GetDeviceTreeAddress ( + VOID + ) +{ + EFI_STATUS Status; + EFI_COMMON_SECTION_HEADER *FoundSection; + + if (FixedPcdGet32 (PcdDeviceTreeAddress)) { + return (VOID *)*((unsigned long *)FixedPcdGet32 (PcdDeviceTreeAddress)); + } else if (FixedPcdGet32 (PcdRiscVDtbFvBase)) { + Status = FindFfsFileAndSection ( + (EFI_FIRMWARE_VOLUME_HEADER *)FixedPcdGet32 (PcdRiscVDtbFvBase), + EFI_FV_FILETYPE_FREEFORM, + EFI_SECTION_RAW, + + ); + if (EFI_ERROR(Status)) { +DEBUG ((DEBUG_ERROR, "Platform Device Tree is not found from FV.\n")); +return NULL; + } + FoundSection ++; + return (VOID *)FoundSection; + } else { + DEBUG ((DEBUG_ERROR, "Must use DTB either from memory or compiled in FW. PCDs configured incorrectly.\n")); + ASSERT (FALSE); + } + return NULL; +} + /** This function initilizes hart specific information and SBI. For the boot hart, it boots system through PEI core and initial SBI in the DXE IPL. @@ -686,6
[edk2-devel] [edk2-platforms] [PATCH v3 04/14] Silicon/RISC-V: Introduce FirmwareContext library
From: Abner Chang Add RISC-V FirmwareContext library for different FirmwareContext implementations. This instance uses SBI firmware extension to get the pointer to FirmwareContext. Cc: Sunil V L Cc: Daniel Schaefer Reviewed-by: Abner Chang Reviewed-by: Daniel Schaefer Signed-off-by: Abner Chang --- Silicon/RISC-V/ProcessorPkg/RiscVProcessorPkg.dec | 1 + Silicon/RISC-V/ProcessorPkg/RiscVProcessorPkg.dsc | 4 +- Silicon/RISC-V/ProcessorPkg/Library/RiscVFirmwareContextSbiLib/RiscVFirmwareContextSbiLib.inf | 34 + Silicon/RISC-V/ProcessorPkg/Library/RiscVFirmwareContextSscratchLib/RiscVFirmwareContextSscratchLib.inf | 33 + Silicon/RISC-V/ProcessorPkg/Library/RiscVFirmwareContextStvecLib/RiscVFirmwareContextStvecLib.inf | 34 + Silicon/RISC-V/ProcessorPkg/Include/IndustryStandard/RiscV.h | 3 +- Silicon/RISC-V/ProcessorPkg/Include/Library/RiscVCpuLib.h | 14 +- Silicon/RISC-V/ProcessorPkg/Include/Library/RiscVFirmwareContextLib.h | 43 Silicon/RISC-V/ProcessorPkg/Library/RiscVFirmwareContextSbiLib/RiscVFirmwareContextSbiLib.c | 52 Silicon/RISC-V/ProcessorPkg/Library/RiscVFirmwareContextSscratchLib/RiscVFirmwareContextSscratchLib.c | 48 ++ Silicon/RISC-V/ProcessorPkg/Library/RiscVFirmwareContextStvecLib/RiscVFirmwareContextStvecLib.c | 48 ++ Silicon/RISC-V/ProcessorPkg/Library/RiscVCpuLib/Cpu.S | 34 - 12 files changed, 344 insertions(+), 4 deletions(-) diff --git a/Silicon/RISC-V/ProcessorPkg/RiscVProcessorPkg.dec b/Silicon/RISC-V/ProcessorPkg/RiscVProcessorPkg.dec index 0b64b33f0fba..08279a97b1c5 100644 --- a/Silicon/RISC-V/ProcessorPkg/RiscVProcessorPkg.dec +++ b/Silicon/RISC-V/ProcessorPkg/RiscVProcessorPkg.dec @@ -24,6 +24,7 @@ RiscVPlatformDxeIplLib|Include/Library/RiscVPlatformDxeIpl.h RiscVCpuLib|Include/Library/RiscVCpuLib.h RiscVEdk2SbiLib|Include/Library/RiscVEdk2SbiLib.h + RiscVFirmwareContextLib|Include/Library/RiscVFirmwareContextLib.h [Guids] gUefiRiscVPkgTokenSpaceGuid = { 0x4261e9c8, 0x52c0, 0x4b34, { 0x85, 0x3d, 0x48, 0x46, 0xea, 0xd3, 0xb7, 0x2c}} diff --git a/Silicon/RISC-V/ProcessorPkg/RiscVProcessorPkg.dsc b/Silicon/RISC-V/ProcessorPkg/RiscVProcessorPkg.dsc index 5c5cfcb525ca..1292ba1beab7 100644 --- a/Silicon/RISC-V/ProcessorPkg/RiscVProcessorPkg.dsc +++ b/Silicon/RISC-V/ProcessorPkg/RiscVProcessorPkg.dsc @@ -65,13 +65,14 @@ UefiLib|MdePkg/Library/UefiLib/UefiLib.inf DevicePathLib|MdePkg/Library/UefiDevicePathLibDevicePathProtocol/UefiDevicePathLibDevicePathProtocol.inf RiscVPlatformTimerLib|Silicon/RISC-V/ProcessorPkg/Library/RiscVPlatformTimerLibNull/RiscVPlatformTimerLib.inf - PeiServicesTablePointerLib|Silicon/RISC-V/ProcessorPkg/Library/PeiServicesTablePointerLibOpenSbi/PeiServicesTablePointerLibOpenSbi.inf [LibraryClasses.common.PEI_CORE] PeiServicesTablePointerLib|Silicon/RISC-V/ProcessorPkg/Library/PeiServicesTablePointerLibOpenSbi/PeiServicesTablePointerLibOpenSbi.inf + RiscVFirmwareContextLib|Silicon/RISC-V/ProcessorPkg/Library/RiscVFirmwareContextSbiLib/RiscVFirmwareContextSbiLib.inf [LibraryClasses.common.PEIM] PeiServicesTablePointerLib|Silicon/RISC-V/ProcessorPkg/Library/PeiServicesTablePointerLibOpenSbi/PeiServicesTablePointerLibOpenSbi.inf + RiscVFirmwareContextLib|Silicon/RISC-V/ProcessorPkg/Library/RiscVFirmwareContextSbiLib/RiscVFirmwareContextSbiLib.inf HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf PeimEntryPoint|MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf @@ -92,6 +93,7 @@ [Components] Silicon/RISC-V/ProcessorPkg/Library/RiscVTimerLib/BaseRiscVTimerLib.inf Silicon/RISC-V/ProcessorPkg/Library/RiscVExceptionLib/CpuExceptionHandlerDxeLib.inf + Silicon/RISC-V/ProcessorPkg/Library/RiscVFirmwareContextSbiLib/RiscVFirmwareContextSbiLib.inf Silicon/RISC-V/ProcessorPkg/Library/PeiServicesTablePointerLibOpenSbi/PeiServicesTablePointerLibOpenSbi.inf Silicon/RISC-V/ProcessorPkg/Library/RiscVOpensbiLib/RiscVOpensbiLib.inf Silicon/RISC-V/ProcessorPkg/Library/RiscVPlatformTimerLibNull/RiscVPlatformTimerLib.inf diff --git a/Silicon/RISC-V/ProcessorPkg/Library/RiscVFirmwareContextSbiLib/RiscVFirmwareContextSbiLib.inf b/Silicon/RISC-V/ProcessorPkg/Library/RiscVFirmwareContextSbiLib/RiscVFirmwareContextSbiLib.inf new file mode 100644 index ..168b70545390 --- /dev/null +++ b/Silicon/RISC-V/ProcessorPkg/Library/RiscVFirmwareContextSbiLib/RiscVFirmwareContextSbiLib.inf @@ -0,0 +1,34 @@ +## @file +# Instance
[edk2-devel] [edk2-platforms] [PATCH v3 06/14] SiFive/U5SeriesPkg: Use FirmwareContext library
From: Abner Chang Use RISC-V FirmwareContext library to set and get the pointer of PeiService on SiFive U5 series platforms. Cc: Sunil V L Cc: Daniel Schaefer Reviewed-by: Daniel Schaefer Signed-off-by: Abner Chang --- Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc index 18a99b86d849..2b00176c27a0 100644 --- a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc +++ b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc @@ -174,6 +174,7 @@ [LibraryClasses.common.PEI_CORE] HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf PeiServicesTablePointerLib|Silicon/RISC-V/ProcessorPkg/Library/PeiServicesTablePointerLibOpenSbi/PeiServicesTablePointerLibOpenSbi.inf + RiscVFirmwareContextLib|Silicon/RISC-V/ProcessorPkg/Library/RiscVFirmwareContextSscratchLib/RiscVFirmwareContextSscratchLib.inf PeiServicesLib|MdePkg/Library/PeiServicesLib/PeiServicesLib.inf MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf PeiCoreEntryPoint|MdePkg/Library/PeiCoreEntryPoint/PeiCoreEntryPoint.inf @@ -190,6 +191,7 @@ [LibraryClasses.common.PEIM] HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf PeiServicesTablePointerLib|Silicon/RISC-V/ProcessorPkg/Library/PeiServicesTablePointerLibOpenSbi/PeiServicesTablePointerLibOpenSbi.inf + RiscVFirmwareContextLib|Silicon/RISC-V/ProcessorPkg/Library/RiscVFirmwareContextSscratchLib/RiscVFirmwareContextSscratchLib.inf PeiServicesLib|MdePkg/Library/PeiServicesLib/PeiServicesLib.inf MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf PeimEntryPoint|MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf -- 2.31.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#82274): https://edk2.groups.io/g/devel/message/82274 Mute This Topic: https://groups.io/mt/86432318/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [edk2-platforms] [PATCH v3 05/14] Silicon/RISC-V: PeiServiceTableLib uses RiscVFirmwareContextLib
From: Abner Chang Use RISC-V FirmwareContext library to set and get the pointer of PeiService. Cc: Sunil V L Cc: Daniel Schaefer Reviewed-by: Daniel Schaefer Signed-off-by: Abner Chang --- Silicon/RISC-V/ProcessorPkg/Library/PeiServicesTablePointerLibOpenSbi/PeiServicesTablePointerLibOpenSbi.inf | 4 ++-- Silicon/RISC-V/ProcessorPkg/Library/PeiServicesTablePointerLibOpenSbi/PeiServicesTablePointerOpenSbi.c | 8 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Silicon/RISC-V/ProcessorPkg/Library/PeiServicesTablePointerLibOpenSbi/PeiServicesTablePointerLibOpenSbi.inf b/Silicon/RISC-V/ProcessorPkg/Library/PeiServicesTablePointerLibOpenSbi/PeiServicesTablePointerLibOpenSbi.inf index f23272016b72..fa9fe7851864 100644 --- a/Silicon/RISC-V/ProcessorPkg/Library/PeiServicesTablePointerLibOpenSbi/PeiServicesTablePointerLibOpenSbi.inf +++ b/Silicon/RISC-V/ProcessorPkg/Library/PeiServicesTablePointerLibOpenSbi/PeiServicesTablePointerLibOpenSbi.inf @@ -4,7 +4,7 @@ # PEI Services Table Pointer Library implementation that retrieves a pointer to the # PEI Services Table from a RISC-V OpenSBI sbi_platform firmware context structure. # -# Copyright (c) 2019, Hewlett Packard Enterprise Development LP. All rights reserved. +# Copyright (c) 2021, Hewlett Packard Enterprise Development LP. All rights reserved. # # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -35,5 +35,5 @@ [LibraryClasses] DebugLib RiscVCpuLib - RiscVEdk2SbiLib + RiscVFirmwareContextLib diff --git a/Silicon/RISC-V/ProcessorPkg/Library/PeiServicesTablePointerLibOpenSbi/PeiServicesTablePointerOpenSbi.c b/Silicon/RISC-V/ProcessorPkg/Library/PeiServicesTablePointerLibOpenSbi/PeiServicesTablePointerOpenSbi.c index 0c1473e93288..9aa74b4f9fbf 100644 --- a/Silicon/RISC-V/ProcessorPkg/Library/PeiServicesTablePointerLibOpenSbi/PeiServicesTablePointerOpenSbi.c +++ b/Silicon/RISC-V/ProcessorPkg/Library/PeiServicesTablePointerLibOpenSbi/PeiServicesTablePointerOpenSbi.c @@ -1,7 +1,7 @@ /** @file PEI Services Table Pointer Library. - Copyright (c) 2019 - 2020, Hewlett Packard Enterprise Development LP. All rights reserved. + Copyright (c) 2019 - 2021, Hewlett Packard Enterprise Development LP. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include #include #include @@ -32,8 +32,8 @@ SetPeiServicesTablePointer ( ) { EFI_RISCV_OPENSBI_FIRMWARE_CONTEXT *FirmwareContext; - SbiGetFirmwareContext (); + GetFirmwareContextPointer (); FirmwareContext->PeiServiceTable = (VOID *)(UINTN)PeiServicesTablePointer; DEBUG ((DEBUG_INFO, "Set PEI Service 0x%x at OpenSBI Firmware Context at 0x%x\n", @@ -61,8 +61,8 @@ GetPeiServicesTablePointer ( ) { EFI_RISCV_OPENSBI_FIRMWARE_CONTEXT *FirmwareContext; - SbiGetFirmwareContext (); + GetFirmwareContextPointer (); return (CONST EFI_PEI_SERVICES **)FirmwareContext->PeiServiceTable; } -- 2.31.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#82273): https://edk2.groups.io/g/devel/message/82273 Mute This Topic: https://groups.io/mt/86432317/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [edk2-platforms] [PATCH v3 03/14] RISC-V: Use U5 SMBIOS library only for those platforms
Cc: Abner Chang Cc: Sunil V L Reviewed-by: Abner Chang Signed-off-by: Daniel Schaefer --- Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc | 2 +- Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc | 2 +- Platform/RISC-V/PlatformPkg/Library/PeiCoreInfoHobLibNull/PeiCoreInfoHobLib.inf | 43 Platform/RISC-V/PlatformPkg/Universal/Pei/PlatformPei/PlatformPei.inf | 2 +- Platform/SiFive/U5SeriesPkg/Library/PeiCoreInfoHobLib/PeiCoreInfoHobLib.inf | 4 +- Platform/RISC-V/PlatformPkg/Library/PeiCoreInfoHobLibNull/CoreInfoHob.c | 37 + 6 files changed, 85 insertions(+), 5 deletions(-) diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc index fce1c5057879..1dc6405a20f0 100644 --- a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc +++ b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc @@ -212,7 +212,7 @@ # RISC-V core libraries # SiliconSiFiveU54CoreInfoLib|Silicon/SiFive/U54/Library/PeiCoreInfoHobLib/PeiCoreInfoHobLib.inf - SiliconSiFiveU5MCCoreplexInfoLib|Platform/SiFive/U5SeriesPkg/Library/PeiCoreInfoHobLib/PeiCoreInfoHobLib.inf + RiscVCoreplexInfoLib|Platform/SiFive/U5SeriesPkg/Library/PeiCoreInfoHobLib/PeiCoreInfoHobLib.inf [LibraryClasses.common.DXE_CORE] TimerLib|Silicon/RISC-V/ProcessorPkg/Library/RiscVTimerLib/BaseRiscVTimerLib.inf diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc index 14d83fb25a9f..18a99b86d849 100644 --- a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc +++ b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc @@ -213,7 +213,7 @@ # RISC-V core libraries # SiliconSiFiveU54CoreInfoLib|Silicon/SiFive/U54/Library/PeiCoreInfoHobLib/PeiCoreInfoHobLib.inf - SiliconSiFiveU5MCCoreplexInfoLib|Platform/SiFive/U5SeriesPkg/Library/PeiCoreInfoHobLib/PeiCoreInfoHobLib.inf + RiscVCoreplexInfoLib|Platform/SiFive/U5SeriesPkg/Library/PeiCoreInfoHobLib/PeiCoreInfoHobLib.inf [LibraryClasses.common.DXE_CORE] TimerLib|Silicon/RISC-V/ProcessorPkg/Library/RiscVTimerLib/BaseRiscVTimerLib.inf diff --git a/Platform/RISC-V/PlatformPkg/Library/PeiCoreInfoHobLibNull/PeiCoreInfoHobLib.inf b/Platform/RISC-V/PlatformPkg/Library/PeiCoreInfoHobLibNull/PeiCoreInfoHobLib.inf new file mode 100644 index ..5a8db5071f40 --- /dev/null +++ b/Platform/RISC-V/PlatformPkg/Library/PeiCoreInfoHobLibNull/PeiCoreInfoHobLib.inf @@ -0,0 +1,43 @@ +## @file +# Library instance to create core information HOB +# +# Copyright (c) 2021, Hewlett Packard Enterprise Development LP. All rights reserved. +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +[Defines] + INF_VERSION= 0x0001001b + BASE_NAME = RiscVCoreplexInfoLibNull + FILE_GUID = E5783AF0-B7C5-4FAA-BAB4-D52C06B98BBE + MODULE_TYPE= PEIM + VERSION_STRING = 1.0 + LIBRARY_CLASS = RiscVCoreplexInfoLib + +# +# The following information is for reference only and not required by the build tools. +# +# VALID_ARCHITECTURES = RISCV64 +# + +[Sources] + CoreInfoHob.c + +[Packages] + MdePkg/MdePkg.dec + MdeModulePkg/MdeModulePkg.dec + Platform/RISC-V/PlatformPkg/RiscVPlatformPkg.dec + Silicon/RISC-V/ProcessorPkg/RiscVProcessorPkg.dec + +[LibraryClasses] + BaseLib + PcdLib + MemoryAllocationLib + PrintLib + +[Guids] + +[Ppis] + +[FixedPcd] diff --git a/Platform/RISC-V/PlatformPkg/Universal/Pei/PlatformPei/PlatformPei.inf b/Platform/RISC-V/PlatformPkg/Universal/Pei/PlatformPei/PlatformPei.inf index e7f5eef6300f..0db88abba420 100644 --- a/Platform/RISC-V/PlatformPkg/Universal/Pei/PlatformPei/PlatformPei.inf +++ b/Platform/RISC-V/PlatformPkg/Universal/Pei/PlatformPei/PlatformPei.inf @@ -51,7 +51,7 @@ PeiServicesTablePointerLib PeimEntryPoint PcdLib - SiliconSiFiveU5MCCoreplexInfoLib + RiscVCoreplexInfoLib [Pcd] gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvStoreReserved diff --git a/Platform/SiFive/U5SeriesPkg/Library/PeiCoreInfoHobLib/PeiCoreInfoHobLib.inf b/Platform/SiFive/U5SeriesPkg/Library/PeiCoreInfoHobLib/PeiCoreInfoHobLib.inf index b3124a6daf77..d741f0474769 100644 --- a/Platform/SiFive/U5SeriesPkg/Library/PeiCoreInfoHobLib/PeiCoreInfoHobLib.inf +++ b/Platform/SiFive/U5SeriesPkg/Library/PeiCoreInfoHobLib/PeiCoreInfoHobLib.inf @@ -1,7 +1,7 @@ ## @file # Library instance to create core information HOB # -# Copyright (c) 2019, Hewlett Packard Enterprise Development LP. All rights reserved. +# Copyright (c) 2021, Hewlett Packard Enterprise Development LP. All rights reserved. # # SPDX-License-Identifier: BSD-2-Clause
[edk2-devel] [edk2-platforms] [PATCH v3 01/14] U5SeriesPkg: Deduplicate PlatformPei
The current (and future) RISC-V platforms share a lot of PlatformPei code that does not need to be duplicated. If we see that they need to have different behavior in the future, we can add platform specific libraires for that specific code. The upcoming RiscvVirt is only 1205 lines with this patch. Still way too much. Hopefully MinPlatform will help. 26 ./RiscvVirt.dec 13 ./RiscvVirt.uni 12 ./RiscvVirtPkgExtra.uni 78 ./VarStore.fdf.inc 66 ./RiscvVirt.fdf.inc 654 ./RiscvVirt.dsc 356 ./RiscvVirt.fdf 1205 total Cc: Abner Chang Cc: Sunil V L Reviewed-by: Abner Chang Signed-off-by: Daniel Schaefer --- Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc | 2 +- Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc | 2 +- Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf | 2 +- Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf | 2 +- Platform/{SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard => RISC-V/PlatformPkg}/Universal/Pei/PlatformPei/PlatformPei.inf | 4 +- Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/Universal/Pei/PlatformPei/PlatformPei.inf | 73 - Platform/{SiFive/U5SeriesPkg/FreedomU500VC707Board => RISC-V/PlatformPkg}/Universal/Pei/PlatformPei/Platform.h| 0 Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Universal/Pei/PlatformPei/Platform.h | 86 -- Platform/{SiFive/U5SeriesPkg/FreedomU500VC707Board => RISC-V/PlatformPkg}/Universal/Pei/PlatformPei/Fv.c | 0 Platform/{SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard => RISC-V/PlatformPkg}/Universal/Pei/PlatformPei/MemDetect.c | 11 +- Platform/{SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard => RISC-V/PlatformPkg}/Universal/Pei/PlatformPei/Platform.c | 6 +- Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/Universal/Pei/PlatformPei/MemDetect.c | 74 - Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/Universal/Pei/PlatformPei/Platform.c | 310 Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Universal/Pei/PlatformPei/Fv.c | 51 14 files changed, 21 insertions(+), 602 deletions(-) diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc index 9f0a25f8a6af..fce1c5057879 100644 --- a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc +++ b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc @@ -395,7 +395,7 @@ NULL|MdeModulePkg/Library/LzmaCustomDecompressLib/LzmaCustomDecompressLib.inf } - Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/Universal/Pei/PlatformPei/PlatformPei.inf { + Platform/RISC-V/PlatformPkg/Universal/Pei/PlatformPei/PlatformPei.inf { PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf } diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc index afe63c80ba28..14d83fb25a9f 100644 --- a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc +++ b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc @@ -394,7 +394,7 @@ NULL|MdeModulePkg/Library/LzmaCustomDecompressLib/LzmaCustomDecompressLib.inf } - Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Universal/Pei/PlatformPei/PlatformPei.inf { + Platform/RISC-V/PlatformPkg/Universal/Pei/PlatformPei/PlatformPei.inf { PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf } diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf index 5f3ac8e0b70f..7db3a02bcb8e 100644 --- a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf +++ b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf @@ -99,7 +99,7 @@ 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 +INF Platform/RISC-V/PlatformPkg/Universal/Pei/PlatformPei/PlatformPei.inf diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf index a1a4b342e329..74717377287b 100644 --- a/Platform/SiF
[edk2-devel] [edk2-platforms] [PATCH v3 02/14] RISC-V: Split SMBIOS out of PlatformPei
Cc: Abner Chang Cc: Sunil V L Reviewed-by: Abner Chang Signed-off-by: Daniel Schaefer --- Platform/SiFive/U5SeriesPkg/Include/SiFiveU5MCCoreplex.h| 33 Platform/RISC-V/PlatformPkg/Universal/Pei/PlatformPei/Platform.c| 17 +- Platform/SiFive/U5SeriesPkg/Library/PeiCoreInfoHobLib/CoreInfoHob.c | 32 ++- 3 files changed, 38 insertions(+), 44 deletions(-) diff --git a/Platform/SiFive/U5SeriesPkg/Include/SiFiveU5MCCoreplex.h b/Platform/SiFive/U5SeriesPkg/Include/SiFiveU5MCCoreplex.h index 5d70e26f8359..363b34a8f1ac 100644 --- a/Platform/SiFive/U5SeriesPkg/Include/SiFiveU5MCCoreplex.h +++ b/Platform/SiFive/U5SeriesPkg/Include/SiFiveU5MCCoreplex.h @@ -1,7 +1,7 @@ /** @file SiFive U54 Coreplex library definitions. - Copyright (c) 2019, Hewlett Packard Enterprise Development LP. All rights reserved. + Copyright (c) 2021, Hewlett Packard Enterprise Development LP. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent @@ -17,35 +17,14 @@ #define SIFIVE_U5MC_COREPLEX_MC_HART_ID 0 /** - Build up U5MC coreplex processor core-specific information. + Build processor and platform information for the U5 platform - @param UniqueId U5MC unique ID. - - @return EFI_STATUS + @return EFI_SUCCESS Status. **/ EFI_STATUS -EFIAPI -CreateU5MCCoreplexProcessorSpecificDataHob ( - IN UINTN UniqueId - ); - -/** - Function to build processor related SMBIOS information. RISC-V SMBIOS DXE driver collect - this information and build SMBIOS Type4 and Type7 record. - - @param ProcessorUidUnique ID of pysical processor which owns this core. - @param SmbiosDataHobPtrPointer to receive RISC_V_PROCESSOR_SMBIOS_DATA_HOB. The pointers - maintained in this structure is only valid before memory is discovered. - Access to those pointers after memory is installed will cause unexpected issues. +BuildRiscVSmbiosHobs ( + VOID +); - @return EFI_SUCCESS The PEIM initialized successfully. - -**/ -EFI_STATUS -EFIAPI -CreateU5MCProcessorSmbiosDataHob ( - IN UINTN ProcessorUid, - OUT RISC_V_PROCESSOR_SMBIOS_HOB_DATA **SmbiosDataHobPtr - ); #endif diff --git a/Platform/RISC-V/PlatformPkg/Universal/Pei/PlatformPei/Platform.c b/Platform/RISC-V/PlatformPkg/Universal/Pei/PlatformPei/Platform.c index 24192c692ba7..8586a94b6285 100644 --- a/Platform/RISC-V/PlatformPkg/Universal/Pei/PlatformPei/Platform.c +++ b/Platform/RISC-V/PlatformPkg/Universal/Pei/PlatformPei/Platform.c @@ -254,22 +254,7 @@ BuildCoreInformationHob ( VOID ) { - EFI_STATUS Status; - RISC_V_PROCESSOR_SMBIOS_HOB_DATA *SmbiosHobPtr; - - // TODO: Create SMBIOS libs for non-U540 platforms - Status = CreateU5MCCoreplexProcessorSpecificDataHob (0); - if (EFI_ERROR (Status)) { -ASSERT(FALSE); - } - Status = CreateU5MCProcessorSmbiosDataHob (0, ); - if (EFI_ERROR (Status)) { -ASSERT(FALSE); - } - - DEBUG ((DEBUG_INFO, "U5 MC Coreplex SMBIOS DATA HOB at address 0x%x\n", SmbiosHobPtr)); - - return EFI_SUCCESS; + return BuildRiscVSmbiosHobs (); } /** diff --git a/Platform/SiFive/U5SeriesPkg/Library/PeiCoreInfoHobLib/CoreInfoHob.c b/Platform/SiFive/U5SeriesPkg/Library/PeiCoreInfoHobLib/CoreInfoHob.c index b2f74c2a743b..bc1b252946d9 100644 --- a/Platform/SiFive/U5SeriesPkg/Library/PeiCoreInfoHobLib/CoreInfoHob.c +++ b/Platform/SiFive/U5SeriesPkg/Library/PeiCoreInfoHobLib/CoreInfoHob.c @@ -1,7 +1,7 @@ /**@file Build up platform processor information. - Copyright (c) 2019, Hewlett Packard Enterprise Development LP. All rights reserved. + Copyright (c) 2021, Hewlett Packard Enterprise Development LP. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent @@ -32,6 +32,7 @@ @return EFI_SUCCESS The PEIM initialized successfully. **/ +STATIC EFI_STATUS EFIAPI CreateU5MCCoreplexProcessorSpecificDataHob ( @@ -96,6 +97,7 @@ CreateU5MCCoreplexProcessorSpecificDataHob ( @return EFI_SUCCESS The SMBIOS Hobs were created successfully. **/ +STATIC EFI_STATUS EFIAPI CreateU5MCProcessorSmbiosDataHob ( @@ -163,3 +165,31 @@ CreateU5MCProcessorSmbiosDataHob ( return EFI_SUCCESS; } + +/** + Build processor and platform information for the U5 platform + + @return EFI_SUCCESS Status. + +**/ +EFI_STATUS +BuildRiscVSmbiosHobs ( + VOID +) +{ + EFI_STATUS Status; + RISC_V_PROCESSOR_SMBIOS_HOB_DATA *SmbiosHobPtr; + + Status = CreateU5MCCoreplexProcessorSpecificDataHob (0); + if (EFI_ERROR (Status)) { +ASSERT(FALSE); + } + Status = CreateU5MCProcessorSmbiosDataHob (0, ); + if (EFI_ERROR (Status)) { +ASSERT(FALSE); + } + + DEBUG ((DEBUG_INFO, "U5 MC Coreplex SMBIOS DATA HOB at address 0x%x\n", SmbiosHobPtr)); + + return EFI_SUCC
[edk2-devel] [edk2-platforms] [PATCH v3 00/14] Use generic OpenSBI platform
Just fixed up the patches to conform with PatchCheck.py from edk2. Reviewed by Abner, good to merge. Cc: Abner Chang Cc: Sunil V L Abner Chang (4): Silicon/RISC-V: Introduce FirmwareContext library Silicon/RISC-V: PeiServiceTableLib uses RiscVFirmwareContextLib SiFive/U5SeriesPkg: Use FirmwareContext library RISC-V/PlatformPkg: Add FdtPeim to pass DTB from PEI to DXE via HOB Daniel Schaefer (10): U5SeriesPkg: Deduplicate PlatformPei RISC-V: Split SMBIOS out of PlatformPei RISC-V: Use U5 SMBIOS library only for those platforms U540: Add and build device tree RISC-V/PlatformPkg: Build DeviceTree and use that in SEC RISC-V/PlatformPkg: Fixup FDT from HOB and install into config table U5SeriesPkg: Switch to generic OpenSBI platform RISC-V: Switch to latest OpenSBI RISC-V: Implement ResetSystem RT call Move OpenSbiPlatformLib to RISC-V/PlatformPkg Platform/RISC-V/PlatformPkg/RiscVPlatformPkg.dec | 4 + Silicon/RISC-V/ProcessorPkg/RiscVProcessorPkg.dec | 1 + Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc | 16 +- Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc | 29 +- Silicon/RISC-V/ProcessorPkg/RiscVProcessorPkg.dsc | 7 +- Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf | 2 +- Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf | 10 +- Platform/{SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard => RISC-V/PlatformPkg}/Library/OpensbiPlatformLib/OpensbiPlatformLib.inf | 2 + Platform/RISC-V/PlatformPkg/Library/PeiCoreInfoHobLibNull/PeiCoreInfoHobLib.inf | 43 +++ Platform/RISC-V/PlatformPkg/Library/ResetSystemLib/ResetSystemLib.inf | 33 +++ Platform/RISC-V/PlatformPkg/Universal/FdtPeim/FdtPeim.inf | 49 Platform/{SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard => RISC-V/PlatformPkg}/Universal/Pei/PlatformPei/PlatformPei.inf | 6 +- Platform/RISC-V/PlatformPkg/Universal/Sec/SecMain.inf | 2 + Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/Universal/Pei/PlatformPei/PlatformPei.inf | 73 - Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/DeviceTree/U540DeviceTree.inf | 25 ++ Platform/SiFive/U5SeriesPkg/Library/PeiCoreInfoHobLib/PeiCoreInfoHobLib.inf | 4 +- Silicon/RISC-V/ProcessorPkg/Library/PeiServicesTablePointerLibOpenSbi/PeiServicesTablePointerLibOpenSbi.inf | 4 +- Silicon/RISC-V/ProcessorPkg/Library/RiscVFirmwareContextSbiLib/RiscVFirmwareContextSbiLib.inf | 34 +++ Silicon/RISC-V/ProcessorPkg/Library/RiscVFirmwareContextSscratchLib/RiscVFirmwareContextSscratchLib.inf | 33 +++ Silicon/RISC-V/ProcessorPkg/Library/RiscVFirmwareContextStvecLib/RiscVFirmwareContextStvecLib.inf | 34 +++ Silicon/RISC-V/ProcessorPkg/Library/RiscVOpensbiLib/RiscVOpensbiLib.inf | 13 +- Silicon/RISC-V/ProcessorPkg/Universal/FdtDxe/FdtDxe.inf | 53 Platform/RISC-V/PlatformPkg/Library/OpensbiPlatformLib/PlatformOverride.h | 30 ++ Platform/{SiFive/U5SeriesPkg/FreedomU500VC707Board => RISC-V/PlatformPkg}/Universal/Pei/PlatformPei/Platform.h | 0 Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/DeviceTree/gpio.h | 42 +++ Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/DeviceTree/sifive-fu540-prci.h | 18 ++ Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Universal/Pei/PlatformPei/Platform.h | 86 -- Platform/SiFive/U5SeriesPkg/Include/SiFiveU5MCCoreplex.h | 33 +-- Silic
Re: [edk2-devel] [edk2-platforms][PATCH v2 00/14] Use generic OpenSBI platform
Title says v2 but this is the first time I sent it. Sorry. If there's a next one, it'll be v3, just to be consistent. On 10/6/21 19:56, Daniel Schaefer wrote: > OpenSBI can now use a generic platform implementation. The platform > specific behavior is derived from the device tree. > > This patchset updates OpenSBI, adds and builds the device tree and does > a lot of deduplication as a result. > Because OpenSBI has done quite a few other changes, Abner will send out > another patchset to adapt the rest of EDK2 RISC-V code for that. > > This generic implementation not only works for the current U540 and U500 > implementations but also upcoming QEMU virt platform and possibly others > like BeagleV or Allwinner Nezha board. > > Abner Chang (4): > Silicon/RISC-V: Introduce FirmwareContext library > Silicon/RISC-V: PeiServiceTableLib uses RiscVFirmwareContextLib > SiFive/U5SeriesPkg: Use FirmwareContext library > RISC-V/PlatformPkg: Add FdtPeim to pass DTB from PEI to DXE via HOB > > Daniel Schaefer (10): > U5SeriesPkg: Deduplicate PlatformPei > RISC-V: Split SMBIOS out of PlatformPei > RISC-V: Use U5 SMBIOS library only for those platforms > U540: Add and build device tree > RISC-V/PlatformPkg: Build DeviceTree and use that in SEC > RISC-V/PlatformPkg: Fixup FDT from HOB and install into config table > U5SeriesPkg: Switch to generic OpenSBI platform > RISC-V: Switch to latest OpenSBI > RISC-V: Implement ResetSystem RT call > Move OpenSbiPlatformLib to RISC-V/PlatformPkg > > Platform/{SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard => > RISC-V/PlatformPkg}/Library/OpensbiPlatformLib/OpensbiPlatformLib.inf | 2 + > Platform/RISC-V/PlatformPkg/Library/OpensbiPlatformLib/Platform.c > | 224 ++ > Platform/RISC-V/PlatformPkg/Library/OpensbiPlatformLib/PlatformOverride.h > | 30 ++ > Platform/RISC-V/PlatformPkg/Library/OpensbiPlatformLib/SifiveFu540.c > | 47 +++ > Platform/RISC-V/PlatformPkg/Library/OpensbiPlatformLibNull/Platform.c > | 27 +- > Platform/RISC-V/PlatformPkg/Library/PeiCoreInfoHobLibNull/CoreInfoHob.c > | 37 +++ > > Platform/RISC-V/PlatformPkg/Library/PeiCoreInfoHobLibNull/PeiCoreInfoHobLib.inf >| 43 +++ > Platform/RISC-V/PlatformPkg/Library/ResetSystemLib/ResetSystemLib.c > | 128 > Platform/RISC-V/PlatformPkg/Library/ResetSystemLib/ResetSystemLib.inf > | 33 +++ > Platform/RISC-V/PlatformPkg/RiscVPlatformPkg.dec > | 4 + > Platform/RISC-V/PlatformPkg/Universal/FdtPeim/FdtPeim.c > | 70 + > Platform/RISC-V/PlatformPkg/Universal/FdtPeim/FdtPeim.inf > | 49 > Platform/{SiFive/U5SeriesPkg/FreedomU500VC707Board => > RISC-V/PlatformPkg}/Universal/Pei/PlatformPei/Fv.c > | 0 > Platform/{SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard => > RISC-V/PlatformPkg}/Universal/Pei/PlatformPei/MemDetect.c | 11 +- > Platform/{SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard => > RISC-V/PlatformPkg}/Universal/Pei/PlatformPei/Platform.c | 21 +- > Platform/{SiFive/U5SeriesPkg/FreedomU500VC707Board => > RISC-V/PlatformPkg}/Universal/Pei/PlatformPei/Platform.h > | 0 > Platform/{SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard => > RISC-V/PlatformPkg}/Universal/Pei/PlatformPei/PlatformPei.inf | 6 +- > Platform/RISC-V/PlatformPkg/Universal/Sec/Riscv64/SecEntry.S > | 24 +- > Platform/RISC-V/PlatformPkg/Universal/Sec/SecMain.c > | 54 +++- > Platform/RISC-V/PlatformPkg/Universal/Sec/SecMain.inf > | 2 + > > Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/Library/OpensbiPlatformLib/Platform.c >| 29 +- > Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.ds
[edk2-devel] [edk2-platforms][PATCH v2 14/14] Move OpenSbiPlatformLib to RISC-V/PlatformPkg
It's a generic platform file. Only the device tree decides what happens. Cc: Daniel Schaefer Cc: Abner Chang Cc: Sunil V L Signed-off-by: Daniel Schaefer --- Platform/{SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard => RISC-V/PlatformPkg}/Library/OpensbiPlatformLib/OpensbiPlatformLib.inf | 0 Platform/{SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard => RISC-V/PlatformPkg}/Library/OpensbiPlatformLib/Platform.c | 13 - Platform/{SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard => RISC-V/PlatformPkg}/Library/OpensbiPlatformLib/PlatformOverride.h | 0 Platform/{SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard => RISC-V/PlatformPkg}/Library/OpensbiPlatformLib/SifiveFu540.c | 0 Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc | 2 +- 5 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Library/OpensbiPlatformLib/OpensbiPlatformLib.inf b/Platform/RISC-V/PlatformPkg/Library/OpensbiPlatformLib/OpensbiPlatformLib.inf similarity index 100% rename from Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Library/OpensbiPlatformLib/OpensbiPlatformLib.inf rename to Platform/RISC-V/PlatformPkg/Library/OpensbiPlatformLib/OpensbiPlatformLib.inf diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Library/OpensbiPlatformLib/Platform.c b/Platform/RISC-V/PlatformPkg/Library/OpensbiPlatformLib/Platform.c similarity index 87% rename from Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Library/OpensbiPlatformLib/Platform.c rename to Platform/RISC-V/PlatformPkg/Library/OpensbiPlatformLib/Platform.c index 2f51e45d58..db0c19915f 100644 --- a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Library/OpensbiPlatformLib/Platform.c +++ b/Platform/RISC-V/PlatformPkg/Library/OpensbiPlatformLib/Platform.c @@ -201,13 +201,24 @@ const struct sbi_platform_operations platform_ops = { .timer_exit = fdt_timer_exit, }; +#if FixedPcdGet32(PcdBootableHartNumber) == 4 +#define U540_BOOTABLE_HART_COUNT FixedPcdGet32(PcdBootableHartNumber) +static u32 U540_hart_index2id[U540_BOOTABLE_HART_COUNT] = {1, 2, 3, 4}; +#endif + struct sbi_platform platform = { .opensbi_version= OPENSBI_VERSION, .platform_version = SBI_PLATFORM_VERSION(0x0, 0x01), .name = "Generic", .features = SBI_PLATFORM_DEFAULT_FEATURES, .hart_count = SBI_HARTMASK_MAX_BITS, +// TODO: Workaround for U540. Not sure why we need this. OpenSBI doesn't need it. +#if FixedPcdGet32(PcdBootableHartNumber) == 4 + .hart_index2id = U540_hart_index2id, +#else .hart_index2id = generic_hart_index2id, - .hart_stack_size= SBI_PLATFORM_DEFAULT_HART_STACK_SIZE, +#endif + // TODO: Any reason why it shouldn't just be SBI_PLATFORM_DEFAULT_HART_STACK_SIZE? + .hart_stack_size= FixedPcdGet32(PcdOpenSbiStackSize), .platform_ops_addr = (unsigned long)_ops }; diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Library/OpensbiPlatformLib/PlatformOverride.h b/Platform/RISC-V/PlatformPkg/Library/OpensbiPlatformLib/PlatformOverride.h similarity index 100% rename from Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Library/OpensbiPlatformLib/PlatformOverride.h rename to Platform/RISC-V/PlatformPkg/Library/OpensbiPlatformLib/PlatformOverride.h diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Library/OpensbiPlatformLib/SifiveFu540.c b/Platform/RISC-V/PlatformPkg/Library/OpensbiPlatformLib/SifiveFu540.c similarity index 100% rename from Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Library/OpensbiPlatformLib/SifiveFu540.c rename to Platform/RISC-V/PlatformPkg/Library/OpensbiPlatformLib/SifiveFu540.c diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc index 18a482aba6..5d2ccafaca 100644 --- a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc +++ b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc @@ -173,7 +173,7 @@ # # OpenSBi Platform Library # - RiscVOpensbiPlatformLib|Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Library/OpensbiPlatformLib/OpensbiPlatformLib.inf + RiscVOpensbiPlatformLib|Platform/RISC-V/PlatformPkg/Library/OpensbiPlatformLib/OpensbiPlatformLib.inf [LibraryClasses.common.PEI_CORE] HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf -- 2.33.0 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#81550): https://edk2.groups.io/g/devel/message/81550 Mute This Topic: https://groups.io/m
[edk2-devel] [[edk2-platforms] PATCH v2 12/14] RISC-V: Switch to latest OpenSBI
Cc: Daniel Schaefer Cc: Abner Chang Cc: Sunil V L Signed-off-by: Daniel Schaefer --- Platform/RISC-V/PlatformPkg/Library/OpensbiPlatformLibNull/Platform.c | 27 --- Platform/RISC-V/PlatformPkg/Universal/Sec/Riscv64/SecEntry.S | 2 + Platform/RISC-V/PlatformPkg/Universal/Sec/SecMain.c | 5 +- Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/Library/OpensbiPlatformLib/Platform.c | 29 +-- Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Library/OpensbiPlatformLib/Platform.c | 31 +++- Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Library/OpensbiPlatformLib/PlatformOverride.h | 5 +- Platform/SiFive/U5SeriesPkg/Library/SerialIoLib/SerialPortLib.c | 81 +++- Silicon/RISC-V/ProcessorPkg/Include/Library/RiscVEdk2SbiLib.h | 1 + Silicon/RISC-V/ProcessorPkg/Include/OpensbiTypes.h | 1 + Silicon/RISC-V/ProcessorPkg/Library/RiscVOpensbiLib/RiscVOpensbiLib.inf | 13 +++- 10 files changed, 128 insertions(+), 67 deletions(-) diff --git a/Platform/RISC-V/PlatformPkg/Library/OpensbiPlatformLibNull/Platform.c b/Platform/RISC-V/PlatformPkg/Library/OpensbiPlatformLibNull/Platform.c index e78d811f4c..b7e39d19c1 100644 --- a/Platform/RISC-V/PlatformPkg/Library/OpensbiPlatformLibNull/Platform.c +++ b/Platform/RISC-V/PlatformPkg/Library/OpensbiPlatformLibNull/Platform.c @@ -14,31 +14,38 @@ #include const struct sbi_platform_operations platform_ops = { -.pmp_region_count = NULL, -.pmp_region_info= NULL, +.early_init = NULL, .final_init = NULL, +.early_exit = NULL, +.final_exit = NULL, +.domains_root_regions = NULL, +.domains_init = NULL, .console_putc = NULL, .console_getc = NULL, .console_init = NULL, .irqchip_init = NULL, +.irqchip_exit = NULL, .ipi_send = NULL, .ipi_clear = NULL, .ipi_init = NULL, +.ipi_exit = NULL, +.get_tlbr_flush_limit = NULL, .timer_value= NULL, .timer_event_stop = NULL, .timer_event_start = NULL, .timer_init = NULL, -.system_reboot = NULL, -.system_shutdown= NULL +.timer_exit = NULL, +.system_reset_check = NULL, +.system_reset = NULL, }; -const struct sbi_platform platform = { -.opensbi_version= OPENSBI_VERSION, // The OpenSBI version this platform table is built bassed on. -.platform_version = SBI_PLATFORM_VERSION(0x, 0x), // SBI Platform version 1.0 -.name = "NULL platform", +struct sbi_platform platform = { +.opensbi_version= OPENSBI_VERSION, +.platform_version = SBI_PLATFORM_VERSION(0x0, 0x01), +.name = "NULL Platform", .features = 0, .hart_count = 0, +.hart_index2id = 0, .hart_stack_size= 0, -.disabled_hart_mask = 0, -.platform_ops_addr = 0 +.platform_ops_addr = 0, }; diff --git a/Platform/RISC-V/PlatformPkg/Universal/Sec/Riscv64/SecEntry.S b/Platform/RISC-V/PlatformPkg/Universal/Sec/Riscv64/SecEntry.S index 0e3940180d..a8157c896e 100644 --- a/Platform/RISC-V/PlatformPkg/Universal/Sec/Riscv64/SecEntry.S +++ b/Platform/RISC-V/PlatformPkg/Universal/Sec/Riscv64/SecEntry.S @@ -21,6 +21,8 @@ .text .align 3 +.globl _start_warm + ASM_FUNC (_ModuleEntryPoint) /* * Jump to warm-boot if this is not the selected core booting, diff --git a/Platform/RISC-V/PlatformPkg/Universal/Sec/SecMain.c b/Platform/RISC-V/PlatformPkg/Universal/Sec/SecMain.c index 0af0b4bac8..e9f030f352 100644 --- a/Platform/RISC-V/PlatformPkg/Universal/Sec/SecMain.c +++ b/Platform/RISC-V/PlatformPkg/Universal/Sec/SecMain.c @@ -21,6 +21,7 @@ #include // Reference to header file in opensbi #include // Reference to header file in opensbi #include // Reference to header file in opensbi +#include // Reference to header file in opensbi // // Indicates the boot hart (PcdBootHartId) OpenSBI initialization is done. @@ -434,7 +435,7 @@ EFI_STATUS EFIAPI TemporaryRamDone ( STATIC int SbiEcallFirmwareHandler ( IN unsigned long ExtId, IN unsigned long FuncId, - IN unsigned long*Args, + IN CONST struct sbi_trap_regs *TrapRegs, OUT unsigned long*OutVal, OUT struct sbi_trap_info *OutTrap ) @@ -446,7 +447,7 @@ STATIC int SbiEcallFirmwareHandler ( *OutVal = (unsigned long) sbi_scratch_thishart_ptr();
[edk2-devel] [edk2-platforms][PATCH v2 10/14] RISC-V/PlatformPkg: Fixup FDT from HOB and install into config table
The Linux EFISTUB reads the FDT from the EFI system configuration table. Before installing the FDT needs to be patched with the booting hartid, because the kernel in S-Mode cannot determine it. Cc: Daniel Schaefer Cc: Abner Chang Cc: Sunil V L Signed-off-by: Daniel Schaefer --- Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc | 2 + Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf | 1 + Silicon/RISC-V/ProcessorPkg/RiscVProcessorPkg.dsc| 3 +- Silicon/RISC-V/ProcessorPkg/Universal/FdtDxe/FdtDxe.c| 116 Silicon/RISC-V/ProcessorPkg/Universal/FdtDxe/FdtDxe.inf | 53 + 5 files changed, 174 insertions(+), 1 deletion(-) diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc index 4fab3c4bdc..cc62ad0521 100644 --- a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc +++ b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc @@ -516,6 +516,8 @@ MdeModulePkg/Bus/Usb/UsbKbDxe/UsbKbDxe.inf MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassStorageDxe.inf + Silicon/RISC-V/ProcessorPkg/Universal/FdtDxe/FdtDxe.inf + # # FAT filesystem + GPT/MBR partitioning + UDF filesystem # diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf index f0bd65fad6..c58fa63574 100644 --- a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf +++ b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf @@ -182,6 +182,7 @@ INF MdeModulePkg/Universal/DisplayEngineDxe/DisplayEngineDxe.inf INF MdeModulePkg/Universal/MemoryTest/NullMemoryTestDxe/NullMemoryTestDxe.inf INF FatPkg/EnhancedFatDxe/Fat.inf INF MdeModulePkg/Universal/Disk/UdfDxe/UdfDxe.inf +INF Silicon/RISC-V/ProcessorPkg/Universal/FdtDxe/FdtDxe.inf !ifndef $(SOURCE_DEBUG_ENABLE) INF MdeModulePkg/Universal/SerialDxe/SerialDxe.inf diff --git a/Silicon/RISC-V/ProcessorPkg/RiscVProcessorPkg.dsc b/Silicon/RISC-V/ProcessorPkg/RiscVProcessorPkg.dsc index 1292ba1bea..531319322c 100644 --- a/Silicon/RISC-V/ProcessorPkg/RiscVProcessorPkg.dsc +++ b/Silicon/RISC-V/ProcessorPkg/RiscVProcessorPkg.dsc @@ -1,7 +1,7 @@ #/** @file # RISC-V processor package. # -# Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved. +# Copyright (c) 2021, Hewlett Packard Enterprise Development LP. All rights reserved. # # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -102,3 +102,4 @@ Silicon/RISC-V/ProcessorPkg/Universal/CpuDxe/CpuDxe.inf Silicon/RISC-V/ProcessorPkg/Universal/SmbiosDxe/RiscVSmbiosDxe.inf + Silicon/RISC-V/ProcessorPkg/Universal/FdtDxe/FdtDxe.inf diff --git a/Silicon/RISC-V/ProcessorPkg/Universal/FdtDxe/FdtDxe.c b/Silicon/RISC-V/ProcessorPkg/Universal/FdtDxe/FdtDxe.c new file mode 100644 index 00..22b12027d3 --- /dev/null +++ b/Silicon/RISC-V/ProcessorPkg/Universal/FdtDxe/FdtDxe.c @@ -0,0 +1,116 @@ +/** @file + RISC-V Flattened Device Tree DXE module + + The Linux booting protocol on RISC-V requires the id of the booting hart to + be passed as a0. Therefore the EFISTUB needs to get this information. Because + it runs in S-Mode, it cannot get this information from mhartid. Instead we + insert the id into the device tree, that the EFIFSTUB can read from the config table. + + Copyright (c) 2021, Hewlett Packard Enterprise Development LP. All rights reserved. + + SPDX-License-Identifier: BSD-2-Clause-Patent +**/ + +#include +#include +#include +#include +#include +#include + +/** + Fix up the device tree with booting hartid for the kernel + + @param DtbBlob The device tree. Is extended to fit the hart id. + + @retval EFI_SUCCESS The device tree was success fixed up with the hart id. + @retval EFI_OUT_OF_RESOURCES There is not enough memory available to complete the operation. +**/ +EFI_STATUS +EFIAPI +FixDtb ( + IN OUT VOID *DtbBlob, + IN UINTN BootingHartId + ) +{ + fdt32_t Size; + UINT32 ChosenOffset, Err; + + DEBUG ((DEBUG_INFO, "Fixing up device tree with boot hart id: %d\n", +BootingHartId)); + + Size = fdt_totalsize(DtbBlob); + Err = fdt_open_into(DtbBlob, DtbBlob, Size + 32); + if (Err < 0) { +DEBUG ((DEBUG_ERROR, + "Device Tree can't be expanded to accommodate new node\n", __FUNCTION__)); +return EFI_OUT_OF_RESOURCES; + } + ChosenOffset = fdt_path_offset(DtbBlob, "/chosen"); + fdt_setprop_u32(DtbBlob, ChosenOffset, "boot-hartid", BootingHartId); + + return EFI_SUCCESS; +} + +/** + Install the FDT passed in HOB into EFI system configuration table. + + @retval EFI_SUCCESS Successfully installed fixed up FDT in config
[edk2-devel] [edk2-platforms][PATCH v2 13/14] RISC-V: Implement ResetSystem RT call
Cc: Daniel Schaefer Cc: Abner Chang Cc: Sunil V L Signed-off-by: Daniel Schaefer --- Platform/RISC-V/PlatformPkg/Library/ResetSystemLib/ResetSystemLib.c | 128 Platform/RISC-V/PlatformPkg/Library/ResetSystemLib/ResetSystemLib.inf | 33 + Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc| 12 +- Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc | 12 +- Silicon/RISC-V/ProcessorPkg/Include/Library/RiscVEdk2SbiLib.h | 38 +- Silicon/RISC-V/ProcessorPkg/Library/RiscVEdk2SbiLib/RiscVEdk2SbiLib.c | 44 ++- Silicon/RISC-V/ProcessorPkg/Library/RiscVOpensbiLib/opensbi | 2 +- 7 files changed, 256 insertions(+), 13 deletions(-) diff --git a/Platform/RISC-V/PlatformPkg/Library/ResetSystemLib/ResetSystemLib.c b/Platform/RISC-V/PlatformPkg/Library/ResetSystemLib/ResetSystemLib.c new file mode 100644 index 00..646073c106 --- /dev/null +++ b/Platform/RISC-V/PlatformPkg/Library/ResetSystemLib/ResetSystemLib.c @@ -0,0 +1,128 @@ +/** @file + Reset System Library functions for RISC-V + + Copyright (c) 2021, Hewlett Packard Development LP. All rights reserved. + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include +#include +#include + +/** + This function causes a system-wide reset (cold reset), in which + all circuitry within the system returns to its initial state. This type of reset + is asynchronous to system operation and operates without regard to + cycle boundaries. + + If this function returns, it means that the system does not support cold reset. +**/ +VOID +EFIAPI +ResetCold ( + VOID + ) +{ + // Warm Reset via SBI ecall + SbiSystemReset (SBI_SRST_RESET_TYPE_COLD_REBOOT, SBI_SRST_RESET_REASON_NONE); +} + +/** + This function causes a system-wide initialization (warm reset), in which all processors + are set to their initial state. Pending cycles are not corrupted. + + If this function returns, it means that the system does not support warm reset. +**/ +VOID +EFIAPI +ResetWarm ( + VOID + ) +{ + // Warm Reset via SBI ecall + SbiSystemReset (SBI_SRST_RESET_TYPE_WARM_REBOOT, SBI_SRST_RESET_REASON_NONE); +} + +/** + This function causes the system to enter a power state equivalent + to the ACPI G2/S5 or G3 states. + + If this function returns, it means that the system does not support shutdown reset. +**/ +VOID +EFIAPI +ResetShutdown ( + VOID + ) +{ + // Shut down via SBI ecall + SbiSystemReset (SBI_SRST_RESET_TYPE_SHUTDOWN, SBI_SRST_RESET_REASON_NONE); +} + +/** + This function causes a systemwide reset. The exact type of the reset is + defined by the EFI_GUID that follows the Null-terminated Unicode string passed + into ResetData. If the platform does not recognize the EFI_GUID in ResetData + the platform must pick a supported reset type to perform. The platform may + optionally log the parameters from any non-normal reset that occurs. + + @param[in] DataSize The size, in bytes, of ResetData. + @param[in] ResetData The data buffer starts with a Null-terminated string, + followed by the EFI_GUID. +**/ +VOID +EFIAPI +ResetPlatformSpecific ( + IN UINTN DataSize, + IN VOID*ResetData + ) +{ + // + // Can map to OpenSBI vendor or platform specific reset type. + // + return; +} + +/** + The ResetSystem function resets the entire platform. + + @param[in] ResetType The type of reset to perform. + @param[in] ResetStatusThe status code for the reset. + @param[in] DataSize The size, in bytes, of ResetData. + @param[in] ResetData For a ResetType of EfiResetCold, EfiResetWarm, or EfiResetShutdown +the data buffer starts with a Null-terminated string, optionally +followed by additional binary data. The string is a description +that the caller may use to further indicate the reason for the +system reset. +**/ +VOID +EFIAPI +ResetSystem ( + IN EFI_RESET_TYPE ResetType, + IN EFI_STATUS ResetStatus, + IN UINTNDataSize, + IN VOID *ResetData OPTIONAL + ) +{ + switch (ResetType) { + case EfiResetWarm: +ResetWarm (); +break; + + case EfiResetCold: +ResetCold (); +break; + + case EfiResetShutdown: +ResetShutdown (); +return; + + case EfiResetPlatformSpecific: +ResetPlatformSpecific (DataSize, ResetData); +return; + + default: +return; + } +} diff --git a/Platform/RISC-V/PlatformPkg/Library/ResetSystemLib/ResetSystemLib.inf b/Platform/RISC-V/PlatformPkg/Library/ResetSystemLib/ResetSystemLib.inf new file mode 100644 index 00..33db9fb6d8 --- /dev/null +++ b/Platform/RISC-V/PlatformPkg/Library/ResetSystemLib/ResetSystemLib.inf @@ -0,0 +1,33 @@ +## @file +# Library instance for ResetSystem library class for RISC-V using SBI ecalls +# +# Copyright (c) 2021
[edk2-devel] [edk2-platforms][PATCH v2 11/14] U5SeriesPkg: Switch to generic OpenSBI platform
New platform files require more space in SEC. Behavior is determined not by source code but by device tree. Cc: Daniel Schaefer Cc: Abner Chang Cc: Sunil V L Signed-off-by: Daniel Schaefer --- Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf.inc | 6 +- Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Library/OpensbiPlatformLib/OpensbiPlatformLib.inf | 2 + Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Library/OpensbiPlatformLib/Platform.c | 350 ++-- Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Library/OpensbiPlatformLib/PlatformOverride.h | 27 ++ Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Library/OpensbiPlatformLib/SifiveFu540.c | 47 +++ Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf.inc | 6 +- 6 files changed, 261 insertions(+), 177 deletions(-) diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf.inc b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf.inc index 13c14a4a2c..e88aee8c02 100644 --- a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf.inc +++ b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf.inc @@ -23,10 +23,10 @@ DEFINE CODE_BLOCKS = 0x7E0 DEFINE VARS_BLOCKS = 0x20 DEFINE SECFV_OFFSET = 0x -DEFINE SECFV_SIZE= 0x0002 -DEFINE PEIFV_OFFSET = 0x0002 +DEFINE SECFV_SIZE= 0x0003 +DEFINE PEIFV_OFFSET = 0x0003 DEFINE PEIFV_SIZE= 0x0008 -DEFINE SCRATCH_OFFSET= 0x000a +DEFINE SCRATCH_OFFSET= 0x000b DEFINE SCRATCH_SIZE = 0x0001 DEFINE FVMAIN_OFFSET = 0x0010 # Must be power of 2 for PMP setting DEFINE FVMAIN_SIZE = 0x0018C000 diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Library/OpensbiPlatformLib/OpensbiPlatformLib.inf b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Library/OpensbiPlatformLib/OpensbiPlatformLib.inf index 317aaceb25..f9f2073a5b 100644 --- a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Library/OpensbiPlatformLib/OpensbiPlatformLib.inf +++ b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Library/OpensbiPlatformLib/OpensbiPlatformLib.inf @@ -25,6 +25,8 @@ [Sources] Platform.c + SifiveFu540.c + PlatformOverride.h [Packages] EmbeddedPkg/EmbeddedPkg.dec diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Library/OpensbiPlatformLib/Platform.c b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Library/OpensbiPlatformLib/Platform.c index aa6274be96..4deb048566 100644 --- a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Library/OpensbiPlatformLib/Platform.c +++ b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Library/OpensbiPlatformLib/Platform.c @@ -1,216 +1,224 @@ /* - * - * Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved. - * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2019 Western Digital Corporation or its affiliates. + * Copyright (c) 2020 Western Digital Corporation or its affiliates. * * Authors: - * Atish Patra + * Anup Patel */ #include +#include #include -#include -#include -#include -#include +#include #include +#include #include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include -#define U540_HART_COUNT FixedPcdGet32(PcdHartCount) -#define U540_BOOTABLE_HART_COUNT FixedPcdGet32(PcdBootableHartNumber) -#define U540_HART_STACK_SIZE FixedPcdGet32(PcdOpenSbiStackSize) -#define U540_BOOT_HART_IDFixedPcdGet32(PcdBootHartId) +extern const struct platform_override sifive_fu540; -#define U540_SYS_CLK FixedPcdGet32(PcdU5PlatformSystemClock) +static const struct platform_override *special_platforms[] = { + _fu540, +}; -#define U540_PLIC_ADDR0xc00 -#define U540_PLIC_NUM_SOURCES 0x35 -#define U540_PLIC_NUM_PRIORITIES 7 +static const struct platform_override *generic_plat = NULL; +static const struct fdt_match *generic_plat_match = NULL; -#define U540_UART_ADDRFixedPcdGet32(PcdU5UartBase) +static void fw_platform_lookup_special(void *fdt, int root_offset) +{ + int pos, noff; + const struct platform_override *plat; + const struct fdt_match *match; -#define U540_UART_BAUDRATE115200 + for (pos = 0; pos < array_size(special_platforms); pos++) { + plat = special_platforms[pos]; + if (!plat->match_table) + continue; -/* PRCI clock related macros */ -//TODO: Do we need a separate driver for this ? -#define U540_PRCI_BAS
[edk2-devel] [edk2-platforms][PATCH v2 09/14] RISC-V/PlatformPkg: Add FdtPeim to pass DTB from PEI to DXE via HOB
From: Abner Chang Cc: Daniel Schaefer Cc: Abner Chang Cc: Sunil V L Signed-off-by: Daniel Schaefer --- Platform/RISC-V/PlatformPkg/Universal/FdtPeim/FdtPeim.c | 70 Platform/RISC-V/PlatformPkg/Universal/FdtPeim/FdtPeim.inf| 49 ++ Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc | 5 ++ Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf | 1 + Silicon/RISC-V/ProcessorPkg/Library/RiscVOpensbiLib/opensbi | 2 +- 5 files changed, 126 insertions(+), 1 deletion(-) diff --git a/Platform/RISC-V/PlatformPkg/Universal/FdtPeim/FdtPeim.c b/Platform/RISC-V/PlatformPkg/Universal/FdtPeim/FdtPeim.c new file mode 100644 index 00..7052957003 --- /dev/null +++ b/Platform/RISC-V/PlatformPkg/Universal/FdtPeim/FdtPeim.c @@ -0,0 +1,70 @@ +/** @file +The module to pass the device tree to DXE via HOB. + +Copyright (c) 2021, Hewlett Packard Enterprise Development LP. All rights reserved. + +SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include +#include +#include +#include + +#include + +#include + +/** + The entrypoint of the module, it will pass the FDT via a HOB. + + @param FileHandle Handle of the file being invoked. + @param PeiServicesDescribes the list of possible PEI Services. + + @retval TODO +**/ +EFI_STATUS +EFIAPI +PeimPassFdt ( + IN EFI_PEI_FILE_HANDLEFileHandle, + IN CONST EFI_PEI_SERVICES **PeiServices + ) +{ + VOID *FdtPointer; + VOID *Base; + VOID *NewBase; + UINTN FdtSize; + UINTN FdtPages; + UINT64 *FdtHobData; + EFI_RISCV_OPENSBI_FIRMWARE_CONTEXT *FirmwareContext; + + FirmwareContext = NULL; + GetFirmwareContextPointer (); + + if (FirmwareContext == NULL) { +DEBUG((DEBUG_ERROR, "%a: OpenSBI Firmware Context is NULL\n", __FUNCTION__)); +return EFI_UNSUPPORTED; + } + FdtPointer = (VOID *)FirmwareContext->FlattenedDeviceTree; + if (FdtPointer == NULL) { +DEBUG((DEBUG_ERROR, "%a: Invalid FDT pointer\n", __FUNCTION__)); +return EFI_UNSUPPORTED; + } + DEBUG((DEBUG_ERROR, "%a: Build FDT HOB - FDT at address: 0x%x \n", __FUNCTION__, FdtPointer)); + Base = FdtPointer; + ASSERT (Base != NULL); + ASSERT (fdt_check_header (Base) == 0); + + FdtSize = fdt_totalsize (Base); + FdtPages = EFI_SIZE_TO_PAGES (FdtSize); + NewBase = AllocatePages (FdtPages); + ASSERT (NewBase != NULL); + fdt_open_into (Base, NewBase, EFI_PAGES_TO_SIZE (FdtPages)); + + FdtHobData = BuildGuidHob (, sizeof *FdtHobData); + ASSERT (FdtHobData != NULL); + *FdtHobData = (UINTN)NewBase; + + return EFI_SUCCESS; +} diff --git a/Platform/RISC-V/PlatformPkg/Universal/FdtPeim/FdtPeim.inf b/Platform/RISC-V/PlatformPkg/Universal/FdtPeim/FdtPeim.inf new file mode 100644 index 00..2dbeca70c5 --- /dev/null +++ b/Platform/RISC-V/PlatformPkg/Universal/FdtPeim/FdtPeim.inf @@ -0,0 +1,49 @@ +## @file +# The FDT Peim driver is used to pass the device tree to DXE phase. +# +# Copyright (c) 2021, Hewlett Packard Enterprise Developmente LP. All rights reserved. +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +[Defines] + INF_VERSION= 0x00010005 + BASE_NAME = FdtPei + MODULE_UNI_FILE= FdtPei.uni + FILE_GUID = 724FD5E9-F35E-4386-B1E1-2ADA6103C4F9 + MODULE_TYPE= PEIM + VERSION_STRING = 1.0 + + ENTRY_POINT= PeimPassFdt + +# +# The following information is for reference only and not required by the build tools. +# +# VALID_ARCHITECTURES = RISCV64 +# + +[Sources] + FdtPeim.c + +[Packages] + EmbeddedPkg/EmbeddedPkg.dec + MdePkg/MdePkg.dec + MdeModulePkg/MdeModulePkg.dec + Silicon/RISC-V/ProcessorPkg/RiscVProcessorPkg.dec + +[LibraryClasses] + DebugLib + DebugLib + HobLib + FdtLib + PcdLib + PeiServicesLib + PeimEntryPoint + RiscVFirmwareContextLib + +[Guids] + gFdtHobGuid ## PRODUCES + +[Depex] + TRUE diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc index e971993b7b..4fab3c4bdc 100644 --- a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc +++ b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc @@ -150,6 +150,10 @@ RiscVPlatformTimerLib|Platform/SiFive/U5SeriesPkg/Library/RiscVPlatformTimerLib/RiscVPlatformTimerLib.inf CpuExceptionHandlerLib|Silicon/RISC-V/ProcessorPkg/Library/RiscVExceptionLib/CpuExceptionHandlerDxeLib.inf + + # Flattened Device Tree (FDT) access library + FdtLib|EmbeddedPkg/Library/FdtLib/FdtLib.inf + [LibraryClasses.common.SEC] !ifdef $(DEBUG_ON_SERIAL_PORT) DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.inf @@ -400,6 +404,7 @@ PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf } + Platform/RIS
[edk2-devel] [edk2-platforms][PATCH v2 08/14] RISC-V/PlatformPkg: Build DeviceTree and use that in SEC
OpenSBI uses the device tree for platform specific initialization, so we need to have it already in SEC. Cc: Daniel Schaefer Cc: Abner Chang Cc: Sunil V L Signed-off-by: Daniel Schaefer --- Platform/RISC-V/PlatformPkg/RiscVPlatformPkg.dec| 4 ++ Platform/RISC-V/PlatformPkg/Universal/Sec/Riscv64/SecEntry.S| 22 - Platform/RISC-V/PlatformPkg/Universal/Sec/SecMain.c | 49 Platform/RISC-V/PlatformPkg/Universal/Sec/SecMain.inf | 2 + Silicon/RISC-V/ProcessorPkg/Include/IndustryStandard/RiscVOpensbi.h | 1 + 5 files changed, 56 insertions(+), 22 deletions(-) diff --git a/Platform/RISC-V/PlatformPkg/RiscVPlatformPkg.dec b/Platform/RISC-V/PlatformPkg/RiscVPlatformPkg.dec index 48aeb97431..ad15a155fe 100644 --- a/Platform/RISC-V/PlatformPkg/RiscVPlatformPkg.dec +++ b/Platform/RISC-V/PlatformPkg/RiscVPlatformPkg.dec @@ -31,6 +31,8 @@ gUefiRiscVPlatformPkgTokenSpaceGuid.PcdRiscVPeiFvSize|0x0|UINT32|0x1003 gUefiRiscVPlatformPkgTokenSpaceGuid.PcdRiscVDxeFvBase|0x0|UINT32|0x1004 gUefiRiscVPlatformPkgTokenSpaceGuid.PcdRiscVDxeFvSize|0x0|UINT32|0x1005 + gUefiRiscVPlatformPkgTokenSpaceGuid.PcdRiscVDtbFvBase|0x0|UINT32|0x1016 + gUefiRiscVPlatformPkgTokenSpaceGuid.PcdRiscVDtbFvSize|0x0|UINT32|0x1017 # # Definition of EFI Variable region @@ -66,6 +68,8 @@ gUefiRiscVPlatformPkgTokenSpaceGuid.PcdTemporaryRamSize|0|UINT32|0x1104 gUefiRiscVPlatformPkgTokenSpaceGuid.PcdPeiCorePrivilegeMode|0|UINT32|0x1105 + gUefiRiscVPlatformPkgTokenSpaceGuid.PcdDeviceTreeAddress|0|UINT32|0x1106 + [PcdsPatchableInModule] [PcdsFeatureFlag] diff --git a/Platform/RISC-V/PlatformPkg/Universal/Sec/Riscv64/SecEntry.S b/Platform/RISC-V/PlatformPkg/Universal/Sec/Riscv64/SecEntry.S index 8434d1a4e0..0e3940180d 100644 --- a/Platform/RISC-V/PlatformPkg/Universal/Sec/Riscv64/SecEntry.S +++ b/Platform/RISC-V/PlatformPkg/Universal/Sec/Riscv64/SecEntry.S @@ -75,11 +75,6 @@ _scratch_init: sda4, SBI_SCRATCH_FW_START_OFFSET(tp) sda5, SBI_SCRATCH_FW_SIZE_OFFSET(tp) - /* - * Note: fw_next_arg1() uses a0, a1, and ra - */ - call fw_next_arg1 - sda0, SBI_SCRATCH_NEXT_ARG1_OFFSET(tp) /* Save agr1 in scratch buffer*/ /* Note: fw_next_addr()uses a0, a1, and ra */ @@ -500,23 +495,6 @@ _reset_regs: csrw CSR_MSCRATCH, 0 ret - .align 3 - .section .entry, "ax", %progbits - .global fw_prev_arg1 -fw_prev_arg1: - - /* We return previous arg1 in 'a0' */ - add a0, zero, zero - ret - - .align 3 - .section .entry, "ax", %progbits - .global fw_next_arg1 -fw_next_arg1: - /* We return next arg1 in 'a0' */ - lia0, FixedPcdGet32(PcdRiscVPeiFvBase) - ret - .align 3 .section .entry, "ax", %progbits .global fw_next_addr diff --git a/Platform/RISC-V/PlatformPkg/Universal/Sec/SecMain.c b/Platform/RISC-V/PlatformPkg/Universal/Sec/SecMain.c index fa9ecd789a..0af0b4bac8 100644 --- a/Platform/RISC-V/PlatformPkg/Universal/Sec/SecMain.c +++ b/Platform/RISC-V/PlatformPkg/Universal/Sec/SecMain.c @@ -557,6 +557,12 @@ VOID EFIAPI PeiCore ( )); ThisSbiPlatform->firmware_context = (unsigned long) + + // + // Save Flattened Device tree in firmware context + // + FirmwareContext.FlattenedDeviceTree = FuncArg1; + // // Set firmware context Hart-specific pointer // @@ -647,6 +653,42 @@ RiscVOpenSbiHartSwitchMode ( sbi_hart_switch_mode(FuncArg0, FuncArg1, NextAddr, NextMode, NextVirt); } +/** + Get device tree address + + @retval The address of Device Tree binary. +**/ +VOID * +EFIAPI +GetDeviceTreeAddress ( + VOID + ) +{ + EFI_STATUS Status; + EFI_COMMON_SECTION_HEADER *FoundSection; + + if (FixedPcdGet32 (PcdDeviceTreeAddress)) { + return (VOID *)*((unsigned long *)FixedPcdGet32 (PcdDeviceTreeAddress)); + } else if (FixedPcdGet32 (PcdRiscVDtbFvBase)) { + Status = FindFfsFileAndSection ( + (EFI_FIRMWARE_VOLUME_HEADER *)FixedPcdGet32 (PcdRiscVDtbFvBase), + EFI_FV_FILETYPE_FREEFORM, + EFI_SECTION_RAW, + + ); + if (EFI_ERROR(Status)) { +DEBUG ((DEBUG_ERROR, "Platform Device Tree is not found from FV.\n")); +return NULL; + } + FoundSection ++; + return (VOID *)FoundSection; + } else { + DEBUG ((DEBUG_ERROR, "Must use DTB either from memory or compiled in FW. PCDs configured incorrectly.\n")); + ASSERT (FALSE); + } + return NULL; +} + /** This function initilizes hart specific information and SBI. For the boot hart, it boots system through PEI core and initial SBI in the DXE IPL. @@ -686,6 +728,13 @@ VOID EFIAPI SecCoreStartUpWithStack( UINT64 NonBootHartMessageLockValue; EFI_RISCV_FIRMWARE_CONTEXT_HART_SPE
[edk2-devel] [edk2-platforms][PATCH v2 07/14] U540: Add and build device tree
Device Tree is taken from Uboot. Cc: Daniel Schaefer Cc: Abner Chang Cc: Sunil V L Signed-off-by: Daniel Schaefer --- Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/DeviceTree.fdf.inc | 35 +++ Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/DeviceTree/U540DeviceTree.inf | 25 ++ Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/DeviceTree/fu540-c000.dtsi | 287 Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/DeviceTree/gpio.h | 42 +++ Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/DeviceTree/hifive-unleashed-a00.dts | 106 Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/DeviceTree/sifive-fu540-prci.h | 18 ++ Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc | 2 + Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf | 6 + Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf.inc | 8 +- 9 files changed, 526 insertions(+), 3 deletions(-) diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/DeviceTree.fdf.inc b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/DeviceTree.fdf.inc new file mode 100644 index 00..fb28be2767 --- /dev/null +++ b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/DeviceTree.fdf.inc @@ -0,0 +1,35 @@ +## @file +# FDF include file with Layout Regions that define an empty variable store. +# +# Copyright (c) 2019, Hewlett Packard Enterprise Development LP. All rights reserved. +# Copyright (C) 2014, Red Hat, Inc. +# Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved. +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +$(DTB_OFFSET)|$(DTB_SIZE) +gUefiRiscVPlatformPkgTokenSpaceGuid.PcdRiscVDtbFvBase|gUefiRiscVPlatformPkgTokenSpaceGuid.PcdRiscVDtbFvSize +FV = DTBFV + +[FV.DTBFV] +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 + +INF RuleOverride = DTB Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/DeviceTree/U540DeviceTree.inf diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/DeviceTree/U540DeviceTree.inf b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/DeviceTree/U540DeviceTree.inf new file mode 100644 index 00..92c4211ccd --- /dev/null +++ b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/DeviceTree/U540DeviceTree.inf @@ -0,0 +1,25 @@ +## @file +# +# Device tree description of the Hifive Unleashed platform +# +# Copyright (c) 2021, Hewlett Packard Enterprise Development LP. All rights reserved. +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +[Defines] + INF_VERSION= 0x0001001A + BASE_NAME = U540DeviceTree + FILE_GUID = 25462CDA-221F-47DF-AC1D-259CFAA4E326 # gDtPlatformDefaultDtbFileGuid + MODULE_TYPE= USER_DEFINED + VERSION_STRING = 1.0 + +[Sources] + gpio.h + hifive-unleashed-a00.dts + fu540-c000.dtsi + sifive-fu540-prci.h + +[Packages] + MdePkg/MdePkg.dec diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/DeviceTree/fu540-c000.dtsi b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/DeviceTree/fu540-c000.dtsi new file mode 100644 index 00..e44b6f7c56 --- /dev/null +++ b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/DeviceTree/fu540-c000.dtsi @@ -0,0 +1,287 @@ +// SPDX-License-Identifier: (GPL-2.0 OR MIT) +/* Copyright (c) 2018-2019 SiFive, Inc */ + +/dts-v1/; + +/*#include */ +#include "sifive-fu540-prci.h" + +/ { + #address-cells = <2>; + #size-cells = <2>; + compatible = "sifive,fu540-c000", "sifive,fu540"; + + aliases { + serial0 = + serial1 = + ethernet0 = + }; + + chosen { + }; + + cpus { + #address-cells = <1>; + #size-cells = <0>; + cpu0: cpu@0 { + compatible = "sifive,e51", "sifive,rocket0", "riscv"; + device_type = "cpu"; + i-cache-block-size = <64>; + i-cache-sets = <128>; + i-cache-size = <16384>; + reg = <0>; + riscv,isa = "rv64imac"; + stat
[edk2-devel] [edk2-platforms][PATCH v2 08/14] RISC-V/PlatformPkg: Build DeviceTree and use that in SEC
OpenSBI uses the device tree for platform specific initialization, so we need to have it already in SEC. Cc: Daniel Schaefer Cc: Abner Chang Cc: Sunil V L Signed-off-by: Daniel Schaefer --- Platform/RISC-V/PlatformPkg/RiscVPlatformPkg.dec| 4 ++ Platform/RISC-V/PlatformPkg/Universal/Sec/Riscv64/SecEntry.S| 22 - Platform/RISC-V/PlatformPkg/Universal/Sec/SecMain.c | 49 Platform/RISC-V/PlatformPkg/Universal/Sec/SecMain.inf | 2 + Silicon/RISC-V/ProcessorPkg/Include/IndustryStandard/RiscVOpensbi.h | 1 + 5 files changed, 56 insertions(+), 22 deletions(-) diff --git a/Platform/RISC-V/PlatformPkg/RiscVPlatformPkg.dec b/Platform/RISC-V/PlatformPkg/RiscVPlatformPkg.dec index 48aeb97431..ad15a155fe 100644 --- a/Platform/RISC-V/PlatformPkg/RiscVPlatformPkg.dec +++ b/Platform/RISC-V/PlatformPkg/RiscVPlatformPkg.dec @@ -31,6 +31,8 @@ gUefiRiscVPlatformPkgTokenSpaceGuid.PcdRiscVPeiFvSize|0x0|UINT32|0x1003 gUefiRiscVPlatformPkgTokenSpaceGuid.PcdRiscVDxeFvBase|0x0|UINT32|0x1004 gUefiRiscVPlatformPkgTokenSpaceGuid.PcdRiscVDxeFvSize|0x0|UINT32|0x1005 + gUefiRiscVPlatformPkgTokenSpaceGuid.PcdRiscVDtbFvBase|0x0|UINT32|0x1016 + gUefiRiscVPlatformPkgTokenSpaceGuid.PcdRiscVDtbFvSize|0x0|UINT32|0x1017 # # Definition of EFI Variable region @@ -66,6 +68,8 @@ gUefiRiscVPlatformPkgTokenSpaceGuid.PcdTemporaryRamSize|0|UINT32|0x1104 gUefiRiscVPlatformPkgTokenSpaceGuid.PcdPeiCorePrivilegeMode|0|UINT32|0x1105 + gUefiRiscVPlatformPkgTokenSpaceGuid.PcdDeviceTreeAddress|0|UINT32|0x1106 + [PcdsPatchableInModule] [PcdsFeatureFlag] diff --git a/Platform/RISC-V/PlatformPkg/Universal/Sec/Riscv64/SecEntry.S b/Platform/RISC-V/PlatformPkg/Universal/Sec/Riscv64/SecEntry.S index 8434d1a4e0..0e3940180d 100644 --- a/Platform/RISC-V/PlatformPkg/Universal/Sec/Riscv64/SecEntry.S +++ b/Platform/RISC-V/PlatformPkg/Universal/Sec/Riscv64/SecEntry.S @@ -75,11 +75,6 @@ _scratch_init: sda4, SBI_SCRATCH_FW_START_OFFSET(tp) sda5, SBI_SCRATCH_FW_SIZE_OFFSET(tp) - /* - * Note: fw_next_arg1() uses a0, a1, and ra - */ - call fw_next_arg1 - sda0, SBI_SCRATCH_NEXT_ARG1_OFFSET(tp) /* Save agr1 in scratch buffer*/ /* Note: fw_next_addr()uses a0, a1, and ra */ @@ -500,23 +495,6 @@ _reset_regs: csrw CSR_MSCRATCH, 0 ret - .align 3 - .section .entry, "ax", %progbits - .global fw_prev_arg1 -fw_prev_arg1: - - /* We return previous arg1 in 'a0' */ - add a0, zero, zero - ret - - .align 3 - .section .entry, "ax", %progbits - .global fw_next_arg1 -fw_next_arg1: - /* We return next arg1 in 'a0' */ - lia0, FixedPcdGet32(PcdRiscVPeiFvBase) - ret - .align 3 .section .entry, "ax", %progbits .global fw_next_addr diff --git a/Platform/RISC-V/PlatformPkg/Universal/Sec/SecMain.c b/Platform/RISC-V/PlatformPkg/Universal/Sec/SecMain.c index fa9ecd789a..0af0b4bac8 100644 --- a/Platform/RISC-V/PlatformPkg/Universal/Sec/SecMain.c +++ b/Platform/RISC-V/PlatformPkg/Universal/Sec/SecMain.c @@ -557,6 +557,12 @@ VOID EFIAPI PeiCore ( )); ThisSbiPlatform->firmware_context = (unsigned long) + + // + // Save Flattened Device tree in firmware context + // + FirmwareContext.FlattenedDeviceTree = FuncArg1; + // // Set firmware context Hart-specific pointer // @@ -647,6 +653,42 @@ RiscVOpenSbiHartSwitchMode ( sbi_hart_switch_mode(FuncArg0, FuncArg1, NextAddr, NextMode, NextVirt); } +/** + Get device tree address + + @retval The address of Device Tree binary. +**/ +VOID * +EFIAPI +GetDeviceTreeAddress ( + VOID + ) +{ + EFI_STATUS Status; + EFI_COMMON_SECTION_HEADER *FoundSection; + + if (FixedPcdGet32 (PcdDeviceTreeAddress)) { + return (VOID *)*((unsigned long *)FixedPcdGet32 (PcdDeviceTreeAddress)); + } else if (FixedPcdGet32 (PcdRiscVDtbFvBase)) { + Status = FindFfsFileAndSection ( + (EFI_FIRMWARE_VOLUME_HEADER *)FixedPcdGet32 (PcdRiscVDtbFvBase), + EFI_FV_FILETYPE_FREEFORM, + EFI_SECTION_RAW, + + ); + if (EFI_ERROR(Status)) { +DEBUG ((DEBUG_ERROR, "Platform Device Tree is not found from FV.\n")); +return NULL; + } + FoundSection ++; + return (VOID *)FoundSection; + } else { + DEBUG ((DEBUG_ERROR, "Must use DTB either from memory or compiled in FW. PCDs configured incorrectly.\n")); + ASSERT (FALSE); + } + return NULL; +} + /** This function initilizes hart specific information and SBI. For the boot hart, it boots system through PEI core and initial SBI in the DXE IPL. @@ -686,6 +728,13 @@ VOID EFIAPI SecCoreStartUpWithStack( UINT64 NonBootHartMessageLockValue; EFI_RISCV_FIRMWARE_CONTEXT_HART_SPE
[edk2-devel] [edk2-platforms][PATCH v2 06/14] SiFive/U5SeriesPkg: Use FirmwareContext library
From: Abner Chang Use RISC-V FirmwareContext library to set and get the pointer of PeiService on SiFive U5 series platforms. Cc: Sunil V L Cc: Daniel Schaefer Signed-off-by: Abner Chang --- Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc index 18a99b86d8..2b00176c27 100644 --- a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc +++ b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc @@ -174,6 +174,7 @@ [LibraryClasses.common.PEI_CORE] HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf PeiServicesTablePointerLib|Silicon/RISC-V/ProcessorPkg/Library/PeiServicesTablePointerLibOpenSbi/PeiServicesTablePointerLibOpenSbi.inf + RiscVFirmwareContextLib|Silicon/RISC-V/ProcessorPkg/Library/RiscVFirmwareContextSscratchLib/RiscVFirmwareContextSscratchLib.inf PeiServicesLib|MdePkg/Library/PeiServicesLib/PeiServicesLib.inf MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf PeiCoreEntryPoint|MdePkg/Library/PeiCoreEntryPoint/PeiCoreEntryPoint.inf @@ -190,6 +191,7 @@ [LibraryClasses.common.PEIM] HobLib|MdePkg/Library/PeiHobLib/PeiHobLib.inf PeiServicesTablePointerLib|Silicon/RISC-V/ProcessorPkg/Library/PeiServicesTablePointerLibOpenSbi/PeiServicesTablePointerLibOpenSbi.inf + RiscVFirmwareContextLib|Silicon/RISC-V/ProcessorPkg/Library/RiscVFirmwareContextSscratchLib/RiscVFirmwareContextSscratchLib.inf PeiServicesLib|MdePkg/Library/PeiServicesLib/PeiServicesLib.inf MemoryAllocationLib|MdePkg/Library/PeiMemoryAllocationLib/PeiMemoryAllocationLib.inf PeimEntryPoint|MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf -- 2.33.0 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#81541): https://edk2.groups.io/g/devel/message/81541 Mute This Topic: https://groups.io/mt/86117296/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [edk2-platforms][PATCH v2 01/14] U5SeriesPkg: Deduplicate PlatformPei
The current (and future) RISC-V platforms share a lot of PlatformPei code that does not need to be duplicated. If we see that they need to have different behavior in the future, we can add platform specific libraires for that specific code. The upcoming RiscvVirt is only 1205 lines with this patch. Still way too much. Hopefully MinPlatform will help. 26 ./RiscvVirt.dec 13 ./RiscvVirt.uni 12 ./RiscvVirtPkgExtra.uni 78 ./VarStore.fdf.inc 66 ./RiscvVirt.fdf.inc 654 ./RiscvVirt.dsc 356 ./RiscvVirt.fdf 1205 total Cc: Abner Chang Cc: Sunil V L Signed-off-by: Daniel Schaefer --- Platform/{SiFive/U5SeriesPkg/FreedomU500VC707Board => RISC-V/PlatformPkg}/Universal/Pei/PlatformPei/Fv.c | 0 Platform/{SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard => RISC-V/PlatformPkg}/Universal/Pei/PlatformPei/MemDetect.c | 11 +- Platform/{SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard => RISC-V/PlatformPkg}/Universal/Pei/PlatformPei/Platform.c | 6 +- Platform/{SiFive/U5SeriesPkg/FreedomU500VC707Board => RISC-V/PlatformPkg}/Universal/Pei/PlatformPei/Platform.h| 0 Platform/{SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard => RISC-V/PlatformPkg}/Universal/Pei/PlatformPei/PlatformPei.inf | 4 +- Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc | 2 +- Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf | 2 +- Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/Universal/Pei/PlatformPei/MemDetect.c | 74 - Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/Universal/Pei/PlatformPei/Platform.c | 310 Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/Universal/Pei/PlatformPei/PlatformPei.inf | 73 - Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc | 2 +- Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf | 2 +- Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Universal/Pei/PlatformPei/Fv.c | 51 Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Universal/Pei/PlatformPei/Platform.h | 86 -- 14 files changed, 21 insertions(+), 602 deletions(-) diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/Universal/Pei/PlatformPei/Fv.c b/Platform/RISC-V/PlatformPkg/Universal/Pei/PlatformPei/Fv.c similarity index 100% rename from Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/Universal/Pei/PlatformPei/Fv.c rename to Platform/RISC-V/PlatformPkg/Universal/Pei/PlatformPei/Fv.c diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Universal/Pei/PlatformPei/MemDetect.c b/Platform/RISC-V/PlatformPkg/Universal/Pei/PlatformPei/MemDetect.c similarity index 79% rename from Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Universal/Pei/PlatformPei/MemDetect.c rename to Platform/RISC-V/PlatformPkg/Universal/Pei/PlatformPei/MemDetect.c index 755eae9318..c15d6bb5d4 100644 --- a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Universal/Pei/PlatformPei/MemDetect.c +++ b/Platform/RISC-V/PlatformPkg/Universal/Pei/PlatformPei/MemDetect.c @@ -1,7 +1,7 @@ /**@file Memory Detection for Virtual Machines. - Copyright (c) 2019, Hewlett Packard Enterprise Development LP. All rights reserved. + Copyright (c) 2021, Hewlett Packard Enterprise Development LP. All rights reserved. Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent @@ -46,6 +46,10 @@ PublishPeiMemory ( EFI_PHYSICAL_ADDRESSMemoryBase; UINT64 MemorySize; + // + // TODO: This value should come from platform + // configuration or the memory sizing code. + // MemoryBase = 0x8000UL + 0x100UL; MemorySize = 0x4000UL - 0x100UL; //1GB - 16MB @@ -69,6 +73,9 @@ InitializeRamRegions ( VOID ) { + // + // TODO: This value should come from platform + // configuration or the memory sizing code. + // AddMemoryRangeHob(0x8100UL, 0x8100UL + 0x3F00UL); - } diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Universal/Pei/PlatformPei/Platform.c b/Platform/RISC-V/PlatformPkg/Universal/Pei/PlatformPei/Platform.c similarity index 93% rename from Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Universal/Pei/PlatformPei/Platform.c rename to Platform/RISC-V/PlatformPkg/Universal/Pei/PlatformPei/Platform.c index 9a2cb9413c..24192c692b 100644 --- a/Platform/SiF
[edk2-devel] [edk2-platforms][PATCH v2 04/14] Silicon/RISC-V: Introduce FirmwareContext library
From: Abner Chang Add RISC-V FirmwareContext library for different FirmwareContext implementations. This instance uses SBI firmware extension to get the pointer to FirmwareContext. Cc: Sunil V L Cc: Daniel Schaefer Signed-off-by: Abner Chang --- Silicon/RISC-V/ProcessorPkg/Include/IndustryStandard/RiscV.h | 3 +- Silicon/RISC-V/ProcessorPkg/Include/Library/RiscVCpuLib.h | 14 +- Silicon/RISC-V/ProcessorPkg/Include/Library/RiscVFirmwareContextLib.h | 43 Silicon/RISC-V/ProcessorPkg/Library/RiscVCpuLib/Cpu.S | 34 - Silicon/RISC-V/ProcessorPkg/Library/RiscVFirmwareContextSbiLib/RiscVFirmwareContextSbiLib.c | 52 Silicon/RISC-V/ProcessorPkg/Library/RiscVFirmwareContextSbiLib/RiscVFirmwareContextSbiLib.inf | 34 + Silicon/RISC-V/ProcessorPkg/Library/RiscVFirmwareContextSscratchLib/RiscVFirmwareContextSscratchLib.c | 48 ++ Silicon/RISC-V/ProcessorPkg/Library/RiscVFirmwareContextSscratchLib/RiscVFirmwareContextSscratchLib.inf | 33 + Silicon/RISC-V/ProcessorPkg/Library/RiscVFirmwareContextStvecLib/RiscVFirmwareContextStvecLib.c | 48 ++ Silicon/RISC-V/ProcessorPkg/Library/RiscVFirmwareContextStvecLib/RiscVFirmwareContextStvecLib.inf | 34 + Silicon/RISC-V/ProcessorPkg/RiscVProcessorPkg.dec | 1 + Silicon/RISC-V/ProcessorPkg/RiscVProcessorPkg.dsc | 4 +- 12 files changed, 344 insertions(+), 4 deletions(-) diff --git a/Silicon/RISC-V/ProcessorPkg/Include/IndustryStandard/RiscV.h b/Silicon/RISC-V/ProcessorPkg/Include/IndustryStandard/RiscV.h index 2a992394ed..f6726bda24 100644 --- a/Silicon/RISC-V/ProcessorPkg/Include/IndustryStandard/RiscV.h +++ b/Silicon/RISC-V/ProcessorPkg/Include/IndustryStandard/RiscV.h @@ -1,7 +1,7 @@ /** @file RISC-V package definitions. - Copyright (c) 2019, Hewlett Packard Enterprise Development LP. All rights reserved. + Copyright (c) 2021, Hewlett Packard Enterprise Development LP. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent @@ -96,6 +96,7 @@ #define SSTATUS_SIE_BIT_POSITION 1 #define SSTATUS_SPP_BIT_POSITION 8 #define RISCV_CSR_SUPERVISOR_SIE0x104 +#define RISCV_CSR_SUPERVISOR_STVEC 0x105 #define RISCV_CSR_SUPERVISOR_SSCRATCH 0x140 #define RISCV_CSR_SUPERVISOR_SEPC 0x141 #define RISCV_CSR_SUPERVISOR_SCAUSE 0x142 diff --git a/Silicon/RISC-V/ProcessorPkg/Include/Library/RiscVCpuLib.h b/Silicon/RISC-V/ProcessorPkg/Include/Library/RiscVCpuLib.h index f37d4c20d0..f70723567e 100644 --- a/Silicon/RISC-V/ProcessorPkg/Include/Library/RiscVCpuLib.h +++ b/Silicon/RISC-V/ProcessorPkg/Include/Library/RiscVCpuLib.h @@ -1,7 +1,7 @@ /** @file RISC-V CPU library definitions. - Copyright (c) 2016 - 2019, Hewlett Packard Enterprise Development LP. All rights reserved. + Copyright (c) 2016 - 2021, Hewlett Packard Enterprise Development LP. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -68,4 +68,16 @@ RiscVReadMachineImplementId (VOID); VOID RiscVSetSupervisorAddressTranslationRegister(UINT64); +VOID +RiscVSetSupervisorScratch (UINT64); + +UINT64 +RiscVGetSupervisorScratch (VOID); + +VOID +RiscVSetSupervisorStvec (UINT64); + +UINT64 +RiscVGetSupervisorStvec (VOID); + #endif diff --git a/Silicon/RISC-V/ProcessorPkg/Include/Library/RiscVFirmwareContextLib.h b/Silicon/RISC-V/ProcessorPkg/Include/Library/RiscVFirmwareContextLib.h new file mode 100644 index 00..f35c4e0c51 --- /dev/null +++ b/Silicon/RISC-V/ProcessorPkg/Include/Library/RiscVFirmwareContextLib.h @@ -0,0 +1,43 @@ +/** @file + Library to get/set Firmware Context. + + Copyright (c) 2021, Hewlett Packard Development LP. All rights reserved. + + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#ifndef RISCV_FIRMWARE_CONTEXT_LIB_H_ +#define RISCV_FIRMWARE_CONTEXT_LIB_H_ + +#include +#include + +/** + Get pointer to OpenSBI Firmware Context + + Get the pointer of firmware context. + + @paramFirmwareContextPtr Pointer to retrieve pointer to the + Firmware Context. +**/ +VOID +EFIAPI +GetFirmwareContextPointer ( + IN OUT EFI_RISCV_OPENSBI_FIRMWARE_CONTEXT **FirmwareContextPtr + ); + +/** + Set pointer to OpenSBI Firmware Context + + Set the pointer of firmware context. + + @paramFirmwareContextPtr Pointer to Firmware Context. +**/ +VOID +EFIAPI +SetFirmwareContextPointer ( + IN EFI_RISCV_OPENSBI_FIRMWARE_CONTEXT *FirmwareContextPtr + ); + +#endif diff --git a/Silicon/RISC-V/ProcessorPkg/Library/RiscVCpuLib
[edk2-devel] [edk2-platforms][PATCH v2 05/14] Silicon/RISC-V: PeiServiceTableLib uses RiscVFirmwareContextLib
From: Abner Chang Use RISC-V FirmwareContext library to set and get the pointer of PeiService. Cc: Sunil V L Cc: Daniel Schaefer Signed-off-by: Abner Chang --- Silicon/RISC-V/ProcessorPkg/Library/PeiServicesTablePointerLibOpenSbi/PeiServicesTablePointerLibOpenSbi.inf | 4 ++-- Silicon/RISC-V/ProcessorPkg/Library/PeiServicesTablePointerLibOpenSbi/PeiServicesTablePointerOpenSbi.c | 8 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Silicon/RISC-V/ProcessorPkg/Library/PeiServicesTablePointerLibOpenSbi/PeiServicesTablePointerLibOpenSbi.inf b/Silicon/RISC-V/ProcessorPkg/Library/PeiServicesTablePointerLibOpenSbi/PeiServicesTablePointerLibOpenSbi.inf index f23272016b..fa9fe78518 100644 --- a/Silicon/RISC-V/ProcessorPkg/Library/PeiServicesTablePointerLibOpenSbi/PeiServicesTablePointerLibOpenSbi.inf +++ b/Silicon/RISC-V/ProcessorPkg/Library/PeiServicesTablePointerLibOpenSbi/PeiServicesTablePointerLibOpenSbi.inf @@ -4,7 +4,7 @@ # PEI Services Table Pointer Library implementation that retrieves a pointer to the # PEI Services Table from a RISC-V OpenSBI sbi_platform firmware context structure. # -# Copyright (c) 2019, Hewlett Packard Enterprise Development LP. All rights reserved. +# Copyright (c) 2021, Hewlett Packard Enterprise Development LP. All rights reserved. # # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -35,5 +35,5 @@ [LibraryClasses] DebugLib RiscVCpuLib - RiscVEdk2SbiLib + RiscVFirmwareContextLib diff --git a/Silicon/RISC-V/ProcessorPkg/Library/PeiServicesTablePointerLibOpenSbi/PeiServicesTablePointerOpenSbi.c b/Silicon/RISC-V/ProcessorPkg/Library/PeiServicesTablePointerLibOpenSbi/PeiServicesTablePointerOpenSbi.c index 0c1473e932..9aa74b4f9f 100644 --- a/Silicon/RISC-V/ProcessorPkg/Library/PeiServicesTablePointerLibOpenSbi/PeiServicesTablePointerOpenSbi.c +++ b/Silicon/RISC-V/ProcessorPkg/Library/PeiServicesTablePointerLibOpenSbi/PeiServicesTablePointerOpenSbi.c @@ -1,7 +1,7 @@ /** @file PEI Services Table Pointer Library. - Copyright (c) 2019 - 2020, Hewlett Packard Enterprise Development LP. All rights reserved. + Copyright (c) 2019 - 2021, Hewlett Packard Enterprise Development LP. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include #include #include @@ -32,8 +32,8 @@ SetPeiServicesTablePointer ( ) { EFI_RISCV_OPENSBI_FIRMWARE_CONTEXT *FirmwareContext; - SbiGetFirmwareContext (); + GetFirmwareContextPointer (); FirmwareContext->PeiServiceTable = (VOID *)(UINTN)PeiServicesTablePointer; DEBUG ((DEBUG_INFO, "Set PEI Service 0x%x at OpenSBI Firmware Context at 0x%x\n", @@ -61,8 +61,8 @@ GetPeiServicesTablePointer ( ) { EFI_RISCV_OPENSBI_FIRMWARE_CONTEXT *FirmwareContext; - SbiGetFirmwareContext (); + GetFirmwareContextPointer (); return (CONST EFI_PEI_SERVICES **)FirmwareContext->PeiServiceTable; } -- 2.33.0 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#81537): https://edk2.groups.io/g/devel/message/81537 Mute This Topic: https://groups.io/mt/86117290/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [edk2-platforms][PATCH v2 03/14] RISC-V: Use U5 SMBIOS library only for those platforms
Cc: Abner Chang Cc: Sunil V L Signed-off-by: Daniel Schaefer --- Platform/RISC-V/PlatformPkg/Library/PeiCoreInfoHobLibNull/CoreInfoHob.c | 37 + Platform/RISC-V/PlatformPkg/Library/PeiCoreInfoHobLibNull/PeiCoreInfoHobLib.inf | 43 Platform/RISC-V/PlatformPkg/Universal/Pei/PlatformPei/PlatformPei.inf | 2 +- Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc | 2 +- Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc | 2 +- Platform/SiFive/U5SeriesPkg/Library/PeiCoreInfoHobLib/PeiCoreInfoHobLib.inf | 4 +- 6 files changed, 85 insertions(+), 5 deletions(-) diff --git a/Platform/RISC-V/PlatformPkg/Library/PeiCoreInfoHobLibNull/CoreInfoHob.c b/Platform/RISC-V/PlatformPkg/Library/PeiCoreInfoHobLibNull/CoreInfoHob.c new file mode 100644 index 00..9aad7991bc --- /dev/null +++ b/Platform/RISC-V/PlatformPkg/Library/PeiCoreInfoHobLibNull/CoreInfoHob.c @@ -0,0 +1,37 @@ +/**@file + Build up platform processor information. + + Copyright (c) 2021, Hewlett Packard Enterprise Development LP. All rights reserved. + + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +// +// The package level header files this module uses +// +#include + +// +// The Library classes this module consumes +// +#include +#include +#include + +#include + + +/** + Build processor and platform information for a generic RISC-V + + @return EFI_SUCCESS Status. + +**/ +EFI_STATUS +BuildRiscVSmbiosHobs ( + VOID +) +{ + return EFI_SUCCESS; +} diff --git a/Platform/RISC-V/PlatformPkg/Library/PeiCoreInfoHobLibNull/PeiCoreInfoHobLib.inf b/Platform/RISC-V/PlatformPkg/Library/PeiCoreInfoHobLibNull/PeiCoreInfoHobLib.inf new file mode 100644 index 00..5a8db5071f --- /dev/null +++ b/Platform/RISC-V/PlatformPkg/Library/PeiCoreInfoHobLibNull/PeiCoreInfoHobLib.inf @@ -0,0 +1,43 @@ +## @file +# Library instance to create core information HOB +# +# Copyright (c) 2021, Hewlett Packard Enterprise Development LP. All rights reserved. +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +[Defines] + INF_VERSION= 0x0001001b + BASE_NAME = RiscVCoreplexInfoLibNull + FILE_GUID = E5783AF0-B7C5-4FAA-BAB4-D52C06B98BBE + MODULE_TYPE= PEIM + VERSION_STRING = 1.0 + LIBRARY_CLASS = RiscVCoreplexInfoLib + +# +# The following information is for reference only and not required by the build tools. +# +# VALID_ARCHITECTURES = RISCV64 +# + +[Sources] + CoreInfoHob.c + +[Packages] + MdePkg/MdePkg.dec + MdeModulePkg/MdeModulePkg.dec + Platform/RISC-V/PlatformPkg/RiscVPlatformPkg.dec + Silicon/RISC-V/ProcessorPkg/RiscVProcessorPkg.dec + +[LibraryClasses] + BaseLib + PcdLib + MemoryAllocationLib + PrintLib + +[Guids] + +[Ppis] + +[FixedPcd] diff --git a/Platform/RISC-V/PlatformPkg/Universal/Pei/PlatformPei/PlatformPei.inf b/Platform/RISC-V/PlatformPkg/Universal/Pei/PlatformPei/PlatformPei.inf index e7f5eef630..0db88abba4 100644 --- a/Platform/RISC-V/PlatformPkg/Universal/Pei/PlatformPei/PlatformPei.inf +++ b/Platform/RISC-V/PlatformPkg/Universal/Pei/PlatformPei/PlatformPei.inf @@ -51,7 +51,7 @@ PeiServicesTablePointerLib PeimEntryPoint PcdLib - SiliconSiFiveU5MCCoreplexInfoLib + RiscVCoreplexInfoLib [Pcd] gEfiMdeModulePkgTokenSpaceGuid.PcdEmuVariableNvStoreReserved diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc index fce1c50578..1dc6405a20 100644 --- a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc +++ b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc @@ -212,7 +212,7 @@ # RISC-V core libraries # SiliconSiFiveU54CoreInfoLib|Silicon/SiFive/U54/Library/PeiCoreInfoHobLib/PeiCoreInfoHobLib.inf - SiliconSiFiveU5MCCoreplexInfoLib|Platform/SiFive/U5SeriesPkg/Library/PeiCoreInfoHobLib/PeiCoreInfoHobLib.inf + RiscVCoreplexInfoLib|Platform/SiFive/U5SeriesPkg/Library/PeiCoreInfoHobLib/PeiCoreInfoHobLib.inf [LibraryClasses.common.DXE_CORE] TimerLib|Silicon/RISC-V/ProcessorPkg/Library/RiscVTimerLib/BaseRiscVTimerLib.inf diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc index 14d83fb25a..18a99b86d8 100644 --- a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc +++ b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc @@ -213,7 +213,7 @@ # RISC-V core libraries # SiliconSiFiveU54CoreInfoLib|Silicon/SiFive/U54/Library/PeiCoreInfoHobLib/PeiCoreInfoHobLib.inf - SiliconSiFiveU5MCCoreplexInfoLib|Platform/SiFive/U5SeriesPkg/Library/PeiCoreInfoHobLib/PeiCoreInfoHobLib.inf + RiscVCoreplexInfoLib
[edk2-devel] [edk2-platforms][PATCH v2 02/14] RISC-V: Split SMBIOS out of PlatformPei
Cc: Abner Chang Cc: Sunil V L Signed-off-by: Daniel Schaefer --- Platform/RISC-V/PlatformPkg/Universal/Pei/PlatformPei/Platform.c| 17 +- Platform/SiFive/U5SeriesPkg/Include/SiFiveU5MCCoreplex.h| 33 Platform/SiFive/U5SeriesPkg/Library/PeiCoreInfoHobLib/CoreInfoHob.c | 32 ++- 3 files changed, 38 insertions(+), 44 deletions(-) diff --git a/Platform/RISC-V/PlatformPkg/Universal/Pei/PlatformPei/Platform.c b/Platform/RISC-V/PlatformPkg/Universal/Pei/PlatformPei/Platform.c index 24192c692b..8586a94b62 100644 --- a/Platform/RISC-V/PlatformPkg/Universal/Pei/PlatformPei/Platform.c +++ b/Platform/RISC-V/PlatformPkg/Universal/Pei/PlatformPei/Platform.c @@ -254,22 +254,7 @@ BuildCoreInformationHob ( VOID ) { - EFI_STATUS Status; - RISC_V_PROCESSOR_SMBIOS_HOB_DATA *SmbiosHobPtr; - - // TODO: Create SMBIOS libs for non-U540 platforms - Status = CreateU5MCCoreplexProcessorSpecificDataHob (0); - if (EFI_ERROR (Status)) { -ASSERT(FALSE); - } - Status = CreateU5MCProcessorSmbiosDataHob (0, ); - if (EFI_ERROR (Status)) { -ASSERT(FALSE); - } - - DEBUG ((DEBUG_INFO, "U5 MC Coreplex SMBIOS DATA HOB at address 0x%x\n", SmbiosHobPtr)); - - return EFI_SUCCESS; + return BuildRiscVSmbiosHobs (); } /** diff --git a/Platform/SiFive/U5SeriesPkg/Include/SiFiveU5MCCoreplex.h b/Platform/SiFive/U5SeriesPkg/Include/SiFiveU5MCCoreplex.h index 5d70e26f83..363b34a8f1 100644 --- a/Platform/SiFive/U5SeriesPkg/Include/SiFiveU5MCCoreplex.h +++ b/Platform/SiFive/U5SeriesPkg/Include/SiFiveU5MCCoreplex.h @@ -1,7 +1,7 @@ /** @file SiFive U54 Coreplex library definitions. - Copyright (c) 2019, Hewlett Packard Enterprise Development LP. All rights reserved. + Copyright (c) 2021, Hewlett Packard Enterprise Development LP. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent @@ -17,35 +17,14 @@ #define SIFIVE_U5MC_COREPLEX_MC_HART_ID 0 /** - Build up U5MC coreplex processor core-specific information. + Build processor and platform information for the U5 platform - @param UniqueId U5MC unique ID. - - @return EFI_STATUS + @return EFI_SUCCESS Status. **/ EFI_STATUS -EFIAPI -CreateU5MCCoreplexProcessorSpecificDataHob ( - IN UINTN UniqueId - ); - -/** - Function to build processor related SMBIOS information. RISC-V SMBIOS DXE driver collect - this information and build SMBIOS Type4 and Type7 record. - - @param ProcessorUidUnique ID of pysical processor which owns this core. - @param SmbiosDataHobPtrPointer to receive RISC_V_PROCESSOR_SMBIOS_DATA_HOB. The pointers - maintained in this structure is only valid before memory is discovered. - Access to those pointers after memory is installed will cause unexpected issues. +BuildRiscVSmbiosHobs ( + VOID +); - @return EFI_SUCCESS The PEIM initialized successfully. - -**/ -EFI_STATUS -EFIAPI -CreateU5MCProcessorSmbiosDataHob ( - IN UINTN ProcessorUid, - OUT RISC_V_PROCESSOR_SMBIOS_HOB_DATA **SmbiosDataHobPtr - ); #endif diff --git a/Platform/SiFive/U5SeriesPkg/Library/PeiCoreInfoHobLib/CoreInfoHob.c b/Platform/SiFive/U5SeriesPkg/Library/PeiCoreInfoHobLib/CoreInfoHob.c index b2f74c2a74..bc1b252946 100644 --- a/Platform/SiFive/U5SeriesPkg/Library/PeiCoreInfoHobLib/CoreInfoHob.c +++ b/Platform/SiFive/U5SeriesPkg/Library/PeiCoreInfoHobLib/CoreInfoHob.c @@ -1,7 +1,7 @@ /**@file Build up platform processor information. - Copyright (c) 2019, Hewlett Packard Enterprise Development LP. All rights reserved. + Copyright (c) 2021, Hewlett Packard Enterprise Development LP. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent @@ -32,6 +32,7 @@ @return EFI_SUCCESS The PEIM initialized successfully. **/ +STATIC EFI_STATUS EFIAPI CreateU5MCCoreplexProcessorSpecificDataHob ( @@ -96,6 +97,7 @@ CreateU5MCCoreplexProcessorSpecificDataHob ( @return EFI_SUCCESS The SMBIOS Hobs were created successfully. **/ +STATIC EFI_STATUS EFIAPI CreateU5MCProcessorSmbiosDataHob ( @@ -163,3 +165,31 @@ CreateU5MCProcessorSmbiosDataHob ( return EFI_SUCCESS; } + +/** + Build processor and platform information for the U5 platform + + @return EFI_SUCCESS Status. + +**/ +EFI_STATUS +BuildRiscVSmbiosHobs ( + VOID +) +{ + EFI_STATUS Status; + RISC_V_PROCESSOR_SMBIOS_HOB_DATA *SmbiosHobPtr; + + Status = CreateU5MCCoreplexProcessorSpecificDataHob (0); + if (EFI_ERROR (Status)) { +ASSERT(FALSE); + } + Status = CreateU5MCProcessorSmbiosDataHob (0, ); + if (EFI_ERROR (Status)) { +ASSERT(FALSE); + } + + DEBUG ((DEBUG_INFO, "U5 MC Coreplex SMBIOS DATA HOB at address 0x%x\n", SmbiosHobPtr)); + + return EFI_SUCCESS; +} -- 2.33.0 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You recei
[edk2-devel] [edk2-platforms][PATCH v2 00/14] Use generic OpenSBI platform
OpenSBI can now use a generic platform implementation. The platform specific behavior is derived from the device tree. This patchset updates OpenSBI, adds and builds the device tree and does a lot of deduplication as a result. Because OpenSBI has done quite a few other changes, Abner will send out another patchset to adapt the rest of EDK2 RISC-V code for that. This generic implementation not only works for the current U540 and U500 implementations but also upcoming QEMU virt platform and possibly others like BeagleV or Allwinner Nezha board. Abner Chang (4): Silicon/RISC-V: Introduce FirmwareContext library Silicon/RISC-V: PeiServiceTableLib uses RiscVFirmwareContextLib SiFive/U5SeriesPkg: Use FirmwareContext library RISC-V/PlatformPkg: Add FdtPeim to pass DTB from PEI to DXE via HOB Daniel Schaefer (10): U5SeriesPkg: Deduplicate PlatformPei RISC-V: Split SMBIOS out of PlatformPei RISC-V: Use U5 SMBIOS library only for those platforms U540: Add and build device tree RISC-V/PlatformPkg: Build DeviceTree and use that in SEC RISC-V/PlatformPkg: Fixup FDT from HOB and install into config table U5SeriesPkg: Switch to generic OpenSBI platform RISC-V: Switch to latest OpenSBI RISC-V: Implement ResetSystem RT call Move OpenSbiPlatformLib to RISC-V/PlatformPkg Platform/{SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard => RISC-V/PlatformPkg}/Library/OpensbiPlatformLib/OpensbiPlatformLib.inf | 2 + Platform/RISC-V/PlatformPkg/Library/OpensbiPlatformLib/Platform.c | 224 ++ Platform/RISC-V/PlatformPkg/Library/OpensbiPlatformLib/PlatformOverride.h | 30 ++ Platform/RISC-V/PlatformPkg/Library/OpensbiPlatformLib/SifiveFu540.c | 47 +++ Platform/RISC-V/PlatformPkg/Library/OpensbiPlatformLibNull/Platform.c | 27 +- Platform/RISC-V/PlatformPkg/Library/PeiCoreInfoHobLibNull/CoreInfoHob.c | 37 +++ Platform/RISC-V/PlatformPkg/Library/PeiCoreInfoHobLibNull/PeiCoreInfoHobLib.inf | 43 +++ Platform/RISC-V/PlatformPkg/Library/ResetSystemLib/ResetSystemLib.c | 128 Platform/RISC-V/PlatformPkg/Library/ResetSystemLib/ResetSystemLib.inf | 33 +++ Platform/RISC-V/PlatformPkg/RiscVPlatformPkg.dec | 4 + Platform/RISC-V/PlatformPkg/Universal/FdtPeim/FdtPeim.c | 70 + Platform/RISC-V/PlatformPkg/Universal/FdtPeim/FdtPeim.inf | 49 Platform/{SiFive/U5SeriesPkg/FreedomU500VC707Board => RISC-V/PlatformPkg}/Universal/Pei/PlatformPei/Fv.c | 0 Platform/{SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard => RISC-V/PlatformPkg}/Universal/Pei/PlatformPei/MemDetect.c | 11 +- Platform/{SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard => RISC-V/PlatformPkg}/Universal/Pei/PlatformPei/Platform.c | 21 +- Platform/{SiFive/U5SeriesPkg/FreedomU500VC707Board => RISC-V/PlatformPkg}/Universal/Pei/PlatformPei/Platform.h | 0 Platform/{SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard => RISC-V/PlatformPkg}/Universal/Pei/PlatformPei/PlatformPei.inf | 6 +- Platform/RISC-V/PlatformPkg/Universal/Sec/Riscv64/SecEntry.S | 24 +- Platform/RISC-V/PlatformPkg/Universal/Sec/SecMain.c | 54 +++- Platform/RISC-V/PlatformPkg/Universal/Sec/SecMain.inf | 2 + Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/Library/OpensbiPlatformLib/Platform.c | 29 +- Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc | 16 +- Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf | 2 +- Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf.inc | 6 +- Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/Universal/Pei/PlatformPei/MemDetect.c | 74 - Platform/
[edk2-devel] [edk2-platforms][PATCH v2 5/5] Signal EndOfDxe in boot manager
Otherwise we can't load a 3rd party image because we're still in DXE. MdeModulePkg/Universal/SecurityStubDxe/Defer3rdPartyImageLoad.c prevents that. Cc: Abner Chang Cc: Sunil V L Cc: Leif Lindholm Reviewed-By: Sunil V L Signed-off-by: Daniel Schaefer --- Platform/RISC-V/PlatformPkg/Library/PlatformBootManagerLib/PlatformBootManager.c | 7 ++- Platform/RISC-V/PlatformPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf | 3 ++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Platform/RISC-V/PlatformPkg/Library/PlatformBootManagerLib/PlatformBootManager.c b/Platform/RISC-V/PlatformPkg/Library/PlatformBootManagerLib/PlatformBootManager.c index 82cd311df5..d67f4836fc 100644 --- a/Platform/RISC-V/PlatformPkg/Library/PlatformBootManagerLib/PlatformBootManager.c +++ b/Platform/RISC-V/PlatformPkg/Library/PlatformBootManagerLib/PlatformBootManager.c @@ -1,7 +1,7 @@ /** @file This file include all platform actions -Copyright (c) 2019, Hewlett Packard Enterprise Development LP. All rights reserved. +Copyright (c) 2021, Hewlett Packard Enterprise Development LP. All rights reserved. Copyright (c) 2015, Intel Corporation. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent @@ -155,6 +155,11 @@ PlatformBootManagerBeforeConsole ( EFI_INPUT_KEYF2; EFI_BOOT_MANAGER_LOAD_OPTION BootOption; + // + // Signal EndOfDxe PI Event + // + EfiEventGroupSignal (); + // // Update the console variables. // diff --git a/Platform/RISC-V/PlatformPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf b/Platform/RISC-V/PlatformPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf index afba07573f..2bf89a3c44 100644 --- a/Platform/RISC-V/PlatformPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf +++ b/Platform/RISC-V/PlatformPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf @@ -1,7 +1,7 @@ ## @file # Include all platform action which can be customized by IBV/OEM. # -# Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved. +# Copyright (c) 2021, Hewlett Packard Enterprise Development LP. All rights reserved. # # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -48,6 +48,7 @@ PrintLib [Guids] + gEfiEndOfDxeEventGroupGuid [Protocols] gEfiGenericMemTestProtocolGuid ## CONSUMES -- 2.33.0 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#81442): https://edk2.groups.io/g/devel/message/81442 Mute This Topic: https://groups.io/mt/86063792/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [edk2-platforms][PATCH v2 2/5] RISC-V/CpuDxe: Ignore set memory attributes failure
While enumerating the PCIe devices, the driver tries to set some caching attributes on the memory. Cc: Abner Chang Cc: Sunil V L Cc: Leif Lindholm Reviewed-By: Sunil V L Signed-off-by: Daniel Schaefer --- Silicon/RISC-V/ProcessorPkg/Universal/CpuDxe/CpuDxe.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Silicon/RISC-V/ProcessorPkg/Universal/CpuDxe/CpuDxe.c b/Silicon/RISC-V/ProcessorPkg/Universal/CpuDxe/CpuDxe.c index 27a07b1561..b8b8e91a6c 100644 --- a/Silicon/RISC-V/ProcessorPkg/Universal/CpuDxe/CpuDxe.c +++ b/Silicon/RISC-V/ProcessorPkg/Universal/CpuDxe/CpuDxe.c @@ -1,7 +1,7 @@ /** @file RISC-V CPU DXE driver. - Copyright (c) 2016 - 2019, Hewlett Packard Enterprise Development LP. All rights reserved. + Copyright (c) 2016 - 2021, Hewlett Packard Enterprise Development LP. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent @@ -269,7 +269,7 @@ CpuSetMemoryAttributes ( ) { DEBUG ((DEBUG_INFO, "%a: Set memory attributes not supported yet\n", __FUNCTION__)); - return EFI_UNSUPPORTED; + return EFI_SUCCESS; } /** -- 2.33.0 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#81441): https://edk2.groups.io/g/devel/message/81441 Mute This Topic: https://groups.io/mt/86063791/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [edk2-platforms][PATCH v2 3/5] U540, U500: Add initrd command to boot Linux
Cc: Abner Chang Cc: Sunil V L Cc: Leif Lindholm Signed-off-by: Daniel Schaefer --- Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc | 7 ++- Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf | 1 + Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc | 7 ++- Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf | 1 + 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc index cdc1b9ee8f..9f0a25f8a6 100644 --- a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc +++ b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc @@ -97,6 +97,7 @@ UefiUsbLib|MdePkg/Library/UefiUsbLib/UefiUsbLib.inf CustomizedDisplayLib|MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.inf SortLib|MdeModulePkg/Library/BaseSortLib/BaseSortLib.inf + ShellLib|ShellPkg/Library/UefiShellLib/UefiShellLib.inf UefiBootManagerLib|MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf FdtLib|EmbeddedPkg/Library/FdtLib/FdtLib.inf VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHelperLib/VariablePolicyHelperLib.inf @@ -513,6 +514,11 @@ FatPkg/EnhancedFatDxe/Fat.inf MdeModulePkg/Universal/Disk/UdfDxe/UdfDxe.inf + OvmfPkg/LinuxInitrdDynamicShellCommand/LinuxInitrdDynamicShellCommand.inf { + + gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE + } + ShellPkg/Application/Shell/Shell.inf { ShellCommandLib|ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.inf @@ -524,7 +530,6 @@ 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 diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf index f262e4fe17..5f3ac8e0b7 100644 --- a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf +++ b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf @@ -187,6 +187,7 @@ INF MdeModulePkg/Universal/SerialDxe/SerialDxe.inf INF MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf +INF OvmfPkg/LinuxInitrdDynamicShellCommand/LinuxInitrdDynamicShellCommand.inf INF ShellPkg/Application/Shell/Shell.inf # diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc index be70ef5294..afe63c80ba 100644 --- a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc +++ b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc @@ -97,6 +97,7 @@ UefiUsbLib|MdePkg/Library/UefiUsbLib/UefiUsbLib.inf CustomizedDisplayLib|MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.inf SortLib|MdeModulePkg/Library/BaseSortLib/BaseSortLib.inf + ShellLib|ShellPkg/Library/UefiShellLib/UefiShellLib.inf UefiBootManagerLib|MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf FdtLib|EmbeddedPkg/Library/FdtLib/FdtLib.inf VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHelperLib/VariablePolicyHelperLib.inf @@ -512,6 +513,11 @@ FatPkg/EnhancedFatDxe/Fat.inf MdeModulePkg/Universal/Disk/UdfDxe/UdfDxe.inf + OvmfPkg/LinuxInitrdDynamicShellCommand/LinuxInitrdDynamicShellCommand.inf { + + gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE + } + ShellPkg/Application/Shell/Shell.inf { ShellCommandLib|ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.inf @@ -523,7 +529,6 @@ 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 diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf index c0ce09fcee..a1a4b342e3 100644 --- a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf +++ b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf
[edk2-devel] [edk2-platforms][PATCH v2 4/5] U540: BuildCpuHob with 48 to indicate size memory space
Otherwise it will crash on QEMU 6.0 with: > Loading driver at 0x000BF814000 EntryPoint=0x000BF81428A PciHostBridgeDxe.efi > InstallProtocolInterface: BC62157E-3E33-4FEC-9920-2D3B36D750DF BF351F98 > ProtectUefiImageCommon - 0xBF365BC0 > - 0xBF814000 - 0x000124C0 > PROGRESS CODE: V03040002 I0 > ProcessPciHost: Config[0x3000+0x1000) Bus[0x0..0xFF] > Io[0x0+0x1)@0x300 Mem32[0x4000+0x4000)@0x0 > Mem64[0x4+0x4)@0x0 > CpuSetMemoryAttributes: Set memory attributes not supported yet > CpuSetMemoryAttributes: Set memory attributes not supported yet > RootBridge: PciRoot(0x0) > Support/Attr: 70001 / 70001 > DmaAbove4G: Yes > NoExtConfSpace: No > AllocAttr: 3 (CombineMemPMem Mem64Decode) >Bus: 0 - FF Translation=0 > Io: 0 - Translation=0 >Mem: 4000 - 7FFF Translation=0 > MemAbove4G: 4 - 7 Translation=0 > PMem: - 0 Translation=0 >PMemAbove4G: - 0 Translation=0 > CpuSetMemoryAttributes: Set memory attributes not supported yet > > ASSERT_EFI_ERROR (Status = Not Found) > ASSERT [PciHostBridgeDxe] > /edk2/MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridge.c(332): !EFI_ERROR > (CheckStatus) > QEMU: Terminated Change works on QEMU 5.2 and 6.0. Cc: Abner Chang Cc: Sunil V L Cc: Leif Lindholm Reviewed-By: Sunil V L Signed-off-by: Daniel Schaefer --- Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Universal/Pei/PlatformPei/Platform.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Universal/Pei/PlatformPei/Platform.c b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Universal/Pei/PlatformPei/Platform.c index 6641e10f2e..9a2cb9413c 100644 --- a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Universal/Pei/PlatformPei/Platform.c +++ b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Universal/Pei/PlatformPei/Platform.c @@ -1,7 +1,7 @@ /**@file Platform PEI driver - Copyright (c) 2019, Hewlett Packard Enterprise Development LP. All rights reserved. + Copyright (c) 2019-2021, Hewlett Packard Enterprise Development LP. All rights reserved. Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved. Copyright (c) 2011, Andrei Warkentin @@ -199,7 +199,7 @@ MiscInitialization ( // of IO space. (Side note: unlike other HOBs, the CPU HOB is needed during // S3 resume as well, so we build it unconditionally.) // - BuildCpuHob (32, 32); + BuildCpuHob (48, 32); } /** -- 2.33.0 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#81439): https://edk2.groups.io/g/devel/message/81439 Mute This Topic: https://groups.io/mt/86063789/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [edk2-platforms] PATCH v2 1/5] U540, U500: Add filesystem drivers
Not DiskIoDxe because we don't have a disk, just for loading from Ramdisks. Cc: Abner Chang Cc: Sunil V L Cc: Leif Lindholm Reviewed-By: Sunil V L Signed-off-by: Daniel Schaefer --- Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc | 7 ++- Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf | 4 +++- Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc | 7 ++- Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf | 4 +++- 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc index 124f0d02cc..cdc1b9ee8f 100644 --- a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc +++ b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc @@ -1,7 +1,7 @@ ## @file # RISC-V EFI on SiFive VC707 (U500) RISC-V platform # -# Copyright (c) 2019, Hewlett Packard Enterprise Development LP. All rights reserved. +# Copyright (c) 2019-2021, Hewlett Packard Enterprise Development LP. All rights reserved. # # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -507,6 +507,11 @@ MdeModulePkg/Bus/Usb/UsbKbDxe/UsbKbDxe.inf MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassStorageDxe.inf + # + # FAT filesystem + GPT/MBR partitioning + UDF filesystem + # + FatPkg/EnhancedFatDxe/Fat.inf + MdeModulePkg/Universal/Disk/UdfDxe/UdfDxe.inf ShellPkg/Application/Shell/Shell.inf { diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf index dac6f85272..f262e4fe17 100644 --- a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf +++ b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf @@ -1,7 +1,7 @@ # @file # Flash definition file on SiFive VC707 (U500) RISC-V platform # -# Copyright (c) 2019, Hewlett Packard Enterprise Development LP. All rights reserved. +# Copyright (c) 2019-2021, Hewlett Packard Enterprise Development LP. All rights reserved. # # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -178,6 +178,8 @@ 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 +INF FatPkg/EnhancedFatDxe/Fat.inf +INF MdeModulePkg/Universal/Disk/UdfDxe/UdfDxe.inf !ifndef $(SOURCE_DEBUG_ENABLE) INF MdeModulePkg/Universal/SerialDxe/SerialDxe.inf diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc index db7905774a..be70ef5294 100644 --- a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc +++ b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc @@ -1,7 +1,7 @@ ## @file # RISC-V EFI on SiFive Freedom U540 HiFive Unleashed RISC-V platform # -# Copyright (c) 2019, Hewlett Packard Enterprise Development LP. All rights reserved. +# Copyright (c) 2019-2021, Hewlett Packard Enterprise Development LP. All rights reserved. # # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -506,6 +506,11 @@ MdeModulePkg/Bus/Usb/UsbKbDxe/UsbKbDxe.inf MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassStorageDxe.inf + # + # FAT filesystem + GPT/MBR partitioning + UDF filesystem + # + FatPkg/EnhancedFatDxe/Fat.inf + MdeModulePkg/Universal/Disk/UdfDxe/UdfDxe.inf ShellPkg/Application/Shell/Shell.inf { diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf index 5622e589d6..c0ce09fcee 100644 --- a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf +++ b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf @@ -1,7 +1,7 @@ # @file # Flash definition file on SiFive Freedom U540 HiFive Unleashed RISC-V platform # -# Copyright (c) 2019, Hewlett Packard Enterprise Development LP. All rights reserved. +# Copyright (c) 2019-2021, Hewlett Packard Enterprise Development LP. All rights reserved. # # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -178,6 +178,8 @@ 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 +INF FatPkg/EnhancedFatDxe/Fat.inf +INF MdeModulePkg/Universal/Disk/UdfDxe/UdfDxe.inf !ifndef $(SOURCE_DEBUG_ENABLE) INF MdeModulePkg/Universal/SerialDxe/SerialDxe.inf -- 2.33.0 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#81438): https
[edk2-devel] [edk2-platforms][PATCH v2 0/5] Improvements for booting to Linux on RISC-V
Changes from v1: - Remove ShellLib override in 3/5 Tested on the unpublshed riscvvirt branch and it can still boot to Linux. Cc: Abner Chang Cc: Sunil V L Cc: Leif Lindholm Daniel Schaefer (5): U540, U500: Add filesystem drivers RISC-V/CpuDxe: Ignore set memory attributes failure U540, U500: Add initrd command to boot Linux U540: BuildCpuHob with 48 to indicate size memory space Signal EndOfDxe in boot manager Platform/RISC-V/PlatformPkg/Library/PlatformBootManagerLib/PlatformBootManager.c | 7 ++- Platform/RISC-V/PlatformPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf | 3 ++- Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc | 14 -- Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf | 5 - Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc | 14 -- Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf | 5 - Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Universal/Pei/PlatformPei/Platform.c | 4 ++-- Silicon/RISC-V/ProcessorPkg/Universal/CpuDxe/CpuDxe.c | 4 ++-- 8 files changed, 44 insertions(+), 12 deletions(-) -- 2.33.0 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#81437): https://edk2.groups.io/g/devel/message/81437 Mute This Topic: https://groups.io/mt/86063786/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH v1 0/5] Improvements for booting to Linux on RISC-V
This series is for edk2-platforms of course. Excuse the incorrect subject please. On 10/4/21 01:23, Daniel Schaefer wrote: > Some miscellaneous patches, that each compile and still boot to UEFI > Shell, to allow for booting to Linux on HW and also prepare for Linux on > RiscvVirtPkg (RISC-V OVMF equivalent). > > Available as a branch here: > https://github.com/JohnAZoidberg/edk2-platforms/pull/2 > > Cc: Abner Chang > Cc: Sunil V L > Cc: Leif Lindholm > > Daniel Schaefer (5): > U540, U500: Add filesystem drivers > RISC-V/CpuDxe: Ignore set memory attributes failure > U540, U500: Add initrd command to boot Linux > U540: BuildCpuHob with 48 to indicate size memory space > Signal EndOfDxe in boot manager > > > Platform/RISC-V/PlatformPkg/Library/PlatformBootManagerLib/PlatformBootManager.c > | 7 ++- > > Platform/RISC-V/PlatformPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf > | 3 ++- > Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc > | 14 +- > Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf > | 5 - > Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc > | 14 +- > Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf > | 5 - > > Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Universal/Pei/PlatformPei/Platform.c > | 4 ++-- > Silicon/RISC-V/ProcessorPkg/Universal/CpuDxe/CpuDxe.c > | 4 ++-- > 8 files changed, 46 insertions(+), 10 deletions(-) > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#81400): https://edk2.groups.io/g/devel/message/81400 Mute This Topic: https://groups.io/mt/86046987/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH v1 4/5] U540: BuildCpuHob with 48 to indicate size memory space
Otherwise it will crash on QEMU 6.0 with: > Loading driver at 0x000BF814000 EntryPoint=0x000BF81428A PciHostBridgeDxe.efi > InstallProtocolInterface: BC62157E-3E33-4FEC-9920-2D3B36D750DF BF351F98 > ProtectUefiImageCommon - 0xBF365BC0 > - 0xBF814000 - 0x000124C0 > PROGRESS CODE: V03040002 I0 > ProcessPciHost: Config[0x3000+0x1000) Bus[0x0..0xFF] > Io[0x0+0x1)@0x300 Mem32[0x4000+0x4000)@0x0 > Mem64[0x4+0x4)@0x0 > CpuSetMemoryAttributes: Set memory attributes not supported yet > CpuSetMemoryAttributes: Set memory attributes not supported yet > RootBridge: PciRoot(0x0) > Support/Attr: 70001 / 70001 > DmaAbove4G: Yes > NoExtConfSpace: No > AllocAttr: 3 (CombineMemPMem Mem64Decode) >Bus: 0 - FF Translation=0 > Io: 0 - Translation=0 >Mem: 4000 - 7FFF Translation=0 > MemAbove4G: 4 - 7 Translation=0 > PMem: - 0 Translation=0 >PMemAbove4G: - 0 Translation=0 > CpuSetMemoryAttributes: Set memory attributes not supported yet > > ASSERT_EFI_ERROR (Status = Not Found) > ASSERT [PciHostBridgeDxe] > /edk2/MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridge.c(332): !EFI_ERROR > (CheckStatus) > QEMU: Terminated Change works on QEMU 5.2 and 6.0. Cc: Abner Chang Cc: Sunil V L Cc: Leif Lindholm Signed-off-by: Daniel Schaefer --- Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Universal/Pei/PlatformPei/Platform.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Universal/Pei/PlatformPei/Platform.c b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Universal/Pei/PlatformPei/Platform.c index 6641e10f2e..9a2cb9413c 100644 --- a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Universal/Pei/PlatformPei/Platform.c +++ b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Universal/Pei/PlatformPei/Platform.c @@ -1,7 +1,7 @@ /**@file Platform PEI driver - Copyright (c) 2019, Hewlett Packard Enterprise Development LP. All rights reserved. + Copyright (c) 2019-2021, Hewlett Packard Enterprise Development LP. All rights reserved. Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved. Copyright (c) 2011, Andrei Warkentin @@ -199,7 +199,7 @@ MiscInitialization ( // of IO space. (Side note: unlike other HOBs, the CPU HOB is needed during // S3 resume as well, so we build it unconditionally.) // - BuildCpuHob (32, 32); + BuildCpuHob (48, 32); } /** -- 2.33.0 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#81395): https://edk2.groups.io/g/devel/message/81395 Mute This Topic: https://groups.io/mt/86046992/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH v1 5/5] Signal EndOfDxe in boot manager
Otherwise we can't load a 3rd party image because we're still in DXE. MdeModulePkg/Universal/SecurityStubDxe/Defer3rdPartyImageLoad.c prevents that. Cc: Abner Chang Cc: Sunil V L Cc: Leif Lindholm Signed-off-by: Daniel Schaefer --- Platform/RISC-V/PlatformPkg/Library/PlatformBootManagerLib/PlatformBootManager.c | 7 ++- Platform/RISC-V/PlatformPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf | 3 ++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Platform/RISC-V/PlatformPkg/Library/PlatformBootManagerLib/PlatformBootManager.c b/Platform/RISC-V/PlatformPkg/Library/PlatformBootManagerLib/PlatformBootManager.c index 82cd311df5..d67f4836fc 100644 --- a/Platform/RISC-V/PlatformPkg/Library/PlatformBootManagerLib/PlatformBootManager.c +++ b/Platform/RISC-V/PlatformPkg/Library/PlatformBootManagerLib/PlatformBootManager.c @@ -1,7 +1,7 @@ /** @file This file include all platform actions -Copyright (c) 2019, Hewlett Packard Enterprise Development LP. All rights reserved. +Copyright (c) 2021, Hewlett Packard Enterprise Development LP. All rights reserved. Copyright (c) 2015, Intel Corporation. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent @@ -155,6 +155,11 @@ PlatformBootManagerBeforeConsole ( EFI_INPUT_KEYF2; EFI_BOOT_MANAGER_LOAD_OPTION BootOption; + // + // Signal EndOfDxe PI Event + // + EfiEventGroupSignal (); + // // Update the console variables. // diff --git a/Platform/RISC-V/PlatformPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf b/Platform/RISC-V/PlatformPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf index afba07573f..2bf89a3c44 100644 --- a/Platform/RISC-V/PlatformPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf +++ b/Platform/RISC-V/PlatformPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf @@ -1,7 +1,7 @@ ## @file # Include all platform action which can be customized by IBV/OEM. # -# Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved. +# Copyright (c) 2021, Hewlett Packard Enterprise Development LP. All rights reserved. # # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -48,6 +48,7 @@ PrintLib [Guids] + gEfiEndOfDxeEventGroupGuid [Protocols] gEfiGenericMemTestProtocolGuid ## CONSUMES -- 2.33.0 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#81394): https://edk2.groups.io/g/devel/message/81394 Mute This Topic: https://groups.io/mt/86046988/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH v1 0/5] Improvements for booting to Linux on RISC-V
Some miscellaneous patches, that each compile and still boot to UEFI Shell, to allow for booting to Linux on HW and also prepare for Linux on RiscvVirtPkg (RISC-V OVMF equivalent). Available as a branch here: https://github.com/JohnAZoidberg/edk2-platforms/pull/2 Cc: Abner Chang Cc: Sunil V L Cc: Leif Lindholm Daniel Schaefer (5): U540, U500: Add filesystem drivers RISC-V/CpuDxe: Ignore set memory attributes failure U540, U500: Add initrd command to boot Linux U540: BuildCpuHob with 48 to indicate size memory space Signal EndOfDxe in boot manager Platform/RISC-V/PlatformPkg/Library/PlatformBootManagerLib/PlatformBootManager.c | 7 ++- Platform/RISC-V/PlatformPkg/Library/PlatformBootManagerLib/PlatformBootManagerLib.inf | 3 ++- Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc | 14 +- Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf | 5 - Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc | 14 +- Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf | 5 - Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/Universal/Pei/PlatformPei/Platform.c | 4 ++-- Silicon/RISC-V/ProcessorPkg/Universal/CpuDxe/CpuDxe.c | 4 ++-- 8 files changed, 46 insertions(+), 10 deletions(-) -- 2.33.0 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#81393): https://edk2.groups.io/g/devel/message/81393 Mute This Topic: https://groups.io/mt/86046987/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH v1 2/5] RISC-V/CpuDxe: Ignore set memory attributes failure
While enumerating the PCIe devices, the driver tries to set some caching attributes on the memory. Cc: Abner Chang Cc: Sunil V L Cc: Leif Lindholm Signed-off-by: Daniel Schaefer --- Silicon/RISC-V/ProcessorPkg/Universal/CpuDxe/CpuDxe.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Silicon/RISC-V/ProcessorPkg/Universal/CpuDxe/CpuDxe.c b/Silicon/RISC-V/ProcessorPkg/Universal/CpuDxe/CpuDxe.c index 27a07b1561..b8b8e91a6c 100644 --- a/Silicon/RISC-V/ProcessorPkg/Universal/CpuDxe/CpuDxe.c +++ b/Silicon/RISC-V/ProcessorPkg/Universal/CpuDxe/CpuDxe.c @@ -1,7 +1,7 @@ /** @file RISC-V CPU DXE driver. - Copyright (c) 2016 - 2019, Hewlett Packard Enterprise Development LP. All rights reserved. + Copyright (c) 2016 - 2021, Hewlett Packard Enterprise Development LP. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent @@ -269,7 +269,7 @@ CpuSetMemoryAttributes ( ) { DEBUG ((DEBUG_INFO, "%a: Set memory attributes not supported yet\n", __FUNCTION__)); - return EFI_UNSUPPORTED; + return EFI_SUCCESS; } /** -- 2.33.0 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#81392): https://edk2.groups.io/g/devel/message/81392 Mute This Topic: https://groups.io/mt/86046986/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH v1 1/5] U540, U500: Add filesystem drivers
Not DiskIoDxe because we don't have a disk, just for loading from Ramdisks. Cc: Abner Chang Cc: Sunil V L Cc: Leif Lindholm Signed-off-by: Daniel Schaefer --- Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc | 7 ++- Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf | 4 +++- Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc | 7 ++- Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf | 4 +++- 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc index 124f0d02cc..cdc1b9ee8f 100644 --- a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc +++ b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc @@ -1,7 +1,7 @@ ## @file # RISC-V EFI on SiFive VC707 (U500) RISC-V platform # -# Copyright (c) 2019, Hewlett Packard Enterprise Development LP. All rights reserved. +# Copyright (c) 2019-2021, Hewlett Packard Enterprise Development LP. All rights reserved. # # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -507,6 +507,11 @@ MdeModulePkg/Bus/Usb/UsbKbDxe/UsbKbDxe.inf MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassStorageDxe.inf + # + # FAT filesystem + GPT/MBR partitioning + UDF filesystem + # + FatPkg/EnhancedFatDxe/Fat.inf + MdeModulePkg/Universal/Disk/UdfDxe/UdfDxe.inf ShellPkg/Application/Shell/Shell.inf { diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf index dac6f85272..f262e4fe17 100644 --- a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf +++ b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf @@ -1,7 +1,7 @@ # @file # Flash definition file on SiFive VC707 (U500) RISC-V platform # -# Copyright (c) 2019, Hewlett Packard Enterprise Development LP. All rights reserved. +# Copyright (c) 2019-2021, Hewlett Packard Enterprise Development LP. All rights reserved. # # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -178,6 +178,8 @@ 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 +INF FatPkg/EnhancedFatDxe/Fat.inf +INF MdeModulePkg/Universal/Disk/UdfDxe/UdfDxe.inf !ifndef $(SOURCE_DEBUG_ENABLE) INF MdeModulePkg/Universal/SerialDxe/SerialDxe.inf diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc index db7905774a..be70ef5294 100644 --- a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc +++ b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc @@ -1,7 +1,7 @@ ## @file # RISC-V EFI on SiFive Freedom U540 HiFive Unleashed RISC-V platform # -# Copyright (c) 2019, Hewlett Packard Enterprise Development LP. All rights reserved. +# Copyright (c) 2019-2021, Hewlett Packard Enterprise Development LP. All rights reserved. # # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -506,6 +506,11 @@ MdeModulePkg/Bus/Usb/UsbKbDxe/UsbKbDxe.inf MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassStorageDxe.inf + # + # FAT filesystem + GPT/MBR partitioning + UDF filesystem + # + FatPkg/EnhancedFatDxe/Fat.inf + MdeModulePkg/Universal/Disk/UdfDxe/UdfDxe.inf ShellPkg/Application/Shell/Shell.inf { diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf index 5622e589d6..c0ce09fcee 100644 --- a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf +++ b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf @@ -1,7 +1,7 @@ # @file # Flash definition file on SiFive Freedom U540 HiFive Unleashed RISC-V platform # -# Copyright (c) 2019, Hewlett Packard Enterprise Development LP. All rights reserved. +# Copyright (c) 2019-2021, Hewlett Packard Enterprise Development LP. All rights reserved. # # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -178,6 +178,8 @@ 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 +INF FatPkg/EnhancedFatDxe/Fat.inf +INF MdeModulePkg/Universal/Disk/UdfDxe/UdfDxe.inf !ifndef $(SOURCE_DEBUG_ENABLE) INF MdeModulePkg/Universal/SerialDxe/SerialDxe.inf -- 2.33.0 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#81391): https://edk2.groups.io/g/devel
[edk2-devel] [PATCH v1 3/5] U540, U500: Add initrd command to boot Linux
Cc: Abner Chang Cc: Sunil V L Cc: Leif Lindholm Signed-off-by: Daniel Schaefer --- Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc | 7 +++ Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf | 1 + Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc | 7 +++ Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf | 1 + 4 files changed, 16 insertions(+) diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc index cdc1b9ee8f..23f50ab2c4 100644 --- a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc +++ b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc @@ -513,6 +513,13 @@ FatPkg/EnhancedFatDxe/Fat.inf MdeModulePkg/Universal/Disk/UdfDxe/UdfDxe.inf + OvmfPkg/LinuxInitrdDynamicShellCommand/LinuxInitrdDynamicShellCommand.inf { + + gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE + + ShellLib|ShellPkg/Library/UefiShellLib/UefiShellLib.inf + } + ShellPkg/Application/Shell/Shell.inf { ShellCommandLib|ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.inf diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf index f262e4fe17..5f3ac8e0b7 100644 --- a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf +++ b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.fdf @@ -187,6 +187,7 @@ INF MdeModulePkg/Universal/SerialDxe/SerialDxe.inf INF MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf +INF OvmfPkg/LinuxInitrdDynamicShellCommand/LinuxInitrdDynamicShellCommand.inf INF ShellPkg/Application/Shell/Shell.inf # diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc index be70ef5294..850d60afa2 100644 --- a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc +++ b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc @@ -512,6 +512,13 @@ FatPkg/EnhancedFatDxe/Fat.inf MdeModulePkg/Universal/Disk/UdfDxe/UdfDxe.inf + OvmfPkg/LinuxInitrdDynamicShellCommand/LinuxInitrdDynamicShellCommand.inf { + + gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE + + ShellLib|ShellPkg/Library/UefiShellLib/UefiShellLib.inf + } + ShellPkg/Application/Shell/Shell.inf { ShellCommandLib|ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.inf diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf index c0ce09fcee..a1a4b342e3 100644 --- a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf +++ b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.fdf @@ -187,6 +187,7 @@ INF MdeModulePkg/Universal/SerialDxe/SerialDxe.inf INF MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf +INF OvmfPkg/LinuxInitrdDynamicShellCommand/LinuxInitrdDynamicShellCommand.inf INF ShellPkg/Application/Shell/Shell.inf # -- 2.33.0 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#81390): https://edk2.groups.io/g/devel/message/81390 Mute This Topic: https://groups.io/mt/86046983/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH V3 00/12] Migrate ArmVirtPkg modules to OvmfPkg
I'm happy. For the commits that I hadn't given it: Reviewed-By: Daniel Schaefer Thanks! On 9/30/21 08:45, Abner Chang wrote: > In V3: Address comments on V2. > In V2: Remove HPE license on the files that just moved around or >the changes in the file are just code removal. > > edk2 BZ #: 3665 > edk2 platform corresponding changes will be submitted after > this pactch set is reviewed. > > This pacthes set is to migrate some modules from ArmVirtPkg > to under OvmfPkg for the upcoming RiscVVirtPkg that can leverage > those modules without the dependency with Arm*Pkg. > > The modules moved from ArmVirtPkg to OvmfPkg are, > - FdtClientDxe > - PciPcdProducerLib > - HighMemDxe > - QemuFwCfgLib > - FdtPciHostBridgeLib > - VirtioFdtDxe > > Below PCDs are moved to under MdePkg and leverage by RiscVVirtPkg. > This change also remove the dependency on ArmPkg of OvmfPkg. > - PcdPciIoTranslation > - PcdPciIoTranslation > - PcdPciMmio32(64)Translation > > Signed-off-by: Abner Chang > Cc: Ard Biesheuvel > Cc: Leif Lindholm > Cc: Sami Mujawar > Cc: Jiewen Yao > Cc: Jordan Justen > Cc: Gerd Hoffmann > Cc: Daniel Schaefer > Cc: Sunil V L > Cc: Liming Gao > Cc: Zhiguang Liu > Cc: Michael D Kinney > > Abner Chang (12): > ArmVirtPkg/FdtClintDxe: Move FdtClientDxe to EmbeddedPkg > MdePkg: Add PcdPciIoTranslation PCD > ArmPkg: Use PcdPciIoTranslation PCD from MdePkg > ArmVirtPkg/FdtPciPcdProducerLib: Relocate PciPcdProducerLib to OvmfPkg > ArmVirtPkg/HighMemDxe: Relocate HighMemDxe to OvmfPkg > OvmfPkg/HighMemDxe: Add RISC-V in the supported arch. > ArmVirtPkg/QemuFwCfgLib: Relocate QemuFwCfgLib to OvmfPkg > OvmfPkg/QemuFwCfgLibMMIO: Add RISC-V arch support > MdePkg: Add PcdPciMmio32(64)Translation PCDs > ArmVirtPkg/FdtPciHostBridgeLib: Relocate FdtPciHostBridgeLib to > OvmfPkg/Fdt > OvmfPkg/FdtPciHostBridgeLib: Add RISC-V in the supported arch. > ArmVirtPkg/VirtioFdtDxe: Relocate VirtioFdtDxe to OvmfPkg/Fdt > > ArmPkg/ArmPkg.dec | 15 ++ > ArmVirtPkg/ArmVirtPkg.dec | 3 --- > EmbeddedPkg/EmbeddedPkg.dec | 1 + > MdePkg/MdePkg.dec | 12 +++ > ArmVirtPkg/ArmVirtCloudHv.dsc | 18 - > ArmVirtPkg/ArmVirtKvmTool.dsc | 18 - > ArmVirtPkg/ArmVirtQemu.dsc| 20 +-- > ArmVirtPkg/ArmVirtQemuKernel.dsc | 20 +-- > ArmVirtPkg/ArmVirtXen.dsc | 2 +- > EmbeddedPkg/EmbeddedPkg.dsc | 1 + > ArmVirtPkg/ArmVirtCloudHv.fdf | 6 +++--- > ArmVirtPkg/ArmVirtKvmTool.fdf | 6 +++--- > ArmVirtPkg/ArmVirtXen.fdf | 2 +- > ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc | 6 +++--- > .../ArmPciCpuIo2Dxe/ArmPciCpuIo2Dxe.inf | 2 +- > .../ArmVirtGicArchLib/ArmVirtGicArchLib.inf | 1 + > .../ArmVirtPL031FdtClientLib.inf | 1 + > .../ArmVirtPsciResetSystemLib.inf | 1 + > .../ArmVirtTimerFdtClientLib.inf | 1 + > .../KvmtoolRtcFdtClientLib.inf| 1 + > .../NorFlashKvmtoolLib/NorFlashKvmtoolLib.inf | 1 + > .../NorFlashQemuLib/NorFlashQemuLib.inf | 1 + > .../XenAcpiPlatformDxe/XenAcpiPlatformDxe.inf | 1 + > ArmVirtPkg/XenioFdtDxe/XenioFdtDxe.inf| 1 + > .../Drivers}/FdtClientDxe/FdtClientDxe.inf| 1 - > .../FdtPciHostBridgeLib.inf | 11 +- > .../FdtPciPcdProducerLib.inf | 5 ++--- > .../Fdt}/HighMemDxe/HighMemDxe.inf| 7 --- > .../Fdt}/VirtioFdtDxe/VirtioFdtDxe.inf| 2 +- > .../Library/QemuFwCfgLib/QemuFwCfgLibMmio.inf | 6 +++--- > .../Include/Protocol/FdtClient.h | 0 > .../Drivers}/FdtClientDxe/FdtClientDxe.c | 0 > .../FdtPciHostBridgeLib/FdtPciHostBridgeLib.c | 0 > .../FdtPciPcdProducerLib.c| 0 > .../Fdt}/HighMemDxe/HighMemDxe.c | 3 ++- > .../Fdt}/VirtioFdtDxe/VirtioFdtDxe.c | 0 > .../Library/QemuFwCfgLib/QemuFwCfgLibMmio.c | 7 --- > Maintainers.txt | 6 ++ > 38 files changed, 106 insertions(+), 83 deletions(-) > rename {ArmVirtPkg => EmbeddedPkg/Drivers}/FdtClientDxe/FdtClientDxe.inf > (92%) > rename {ArmVirtPkg/Library => > OvmfPkg/Fdt}/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf (77%) > rename {ArmVirtPkg/Library => > OvmfPkg/Fdt}/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf (87%) > rename {ArmVirtPkg => OvmfPkg/Fdt}/HighMemDxe/HighMemDxe.inf (83%) > rename {ArmVirtPkg =>
Re: [edk2-devel] [PATCH V2 4/9] ArmVirtPkg/FdtPciPcdProducerLib: Relocate PciPcdProducerLib to OvmfPkg
Oh and this also needs to be followed up with a change to edk2-platforms. On 9/29/21 07:16, Daniel Schaefer wrote: > Please fix the issue in the maintainers file. > Looks good otherwise: > > Reviewed-By: Daniel Schaefer > > On 9/28/21 16:31, Abner Chang wrote: >> Relocate PciPcdProducerLib to OvmfPkg/Fdt, this library is >> leverage by both ARM and RISC-V archs. >> >> Add OvmfPkg/Fdt maintainers in Maintainers.txt >> >> Signed-off-by: Abner Chang >> Cc: Ard Biesheuvel >> Cc: Leif Lindholm >> Cc: Sami Mujawar >> Cc: Jiewen Yao >> Cc: Jordan Justen >> Cc: Gerd Hoffmann >> Cc: Daniel Schaefer >> Cc: Sunil V L >> --- >> ArmVirtPkg/ArmVirtCloudHv.dsc | 8 >> ArmVirtPkg/ArmVirtKvmTool.dsc | 8 >> ArmVirtPkg/ArmVirtQemu.dsc| 8 >> ArmVirtPkg/ArmVirtQemuKernel.dsc | 8 >> .../Fdt}/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf| 2 -- >> .../Fdt}/FdtPciPcdProducerLib/FdtPciPcdProducerLib.c | 0 >> Maintainers.txt | 6 ++ >> 7 files changed, 22 insertions(+), 18 deletions(-) >> rename {ArmVirtPkg/Library => >> OvmfPkg/Fdt}/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf (92%) >> rename {ArmVirtPkg/Library => >> OvmfPkg/Fdt}/FdtPciPcdProducerLib/FdtPciPcdProducerLib.c (100%) >> >> diff --git a/ArmVirtPkg/ArmVirtCloudHv.dsc b/ArmVirtPkg/ArmVirtCloudHv.dsc >> index f159754bf4..2928b9adb5 100644 >> --- a/ArmVirtPkg/ArmVirtCloudHv.dsc >> +++ b/ArmVirtPkg/ArmVirtCloudHv.dsc >> @@ -49,7 +49,7 @@ >> >> FrameBufferBltLib|MdeModulePkg/Library/FrameBufferBltLib/FrameBufferBltLib.inf >>QemuBootOrderLib|OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.inf >>FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf >> - >> PciPcdProducerLib|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf >> + >> PciPcdProducerLib|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf >>PciSegmentLib|MdePkg/Library/BasePciSegmentLibPci/BasePciSegmentLibPci.inf >> >> PciHostBridgeLib|ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf >> >> PciHostBridgeUtilityLib|ArmVirtPkg/Library/ArmVirtPciHostBridgeUtilityLib/ArmVirtPciHostBridgeUtilityLib.inf >> @@ -341,12 +341,12 @@ >># >>ArmPkg/Drivers/ArmPciCpuIo2Dxe/ArmPciCpuIo2Dxe.inf { >> >> - NULL|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf >> + NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf >>} >>MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf >>MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf { >> >> - NULL|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf >> + NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf >>} >>OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.inf >>OvmfPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf >> @@ -360,5 +360,5 @@ >> >> MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsResourceTableDxe.inf >>ArmVirtPkg/CloudHvAcpiPlatformDxe/CloudHvAcpiPlatformDxe.inf { >> >> - NULL|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf >> + NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf >>} >> diff --git a/ArmVirtPkg/ArmVirtKvmTool.dsc b/ArmVirtPkg/ArmVirtKvmTool.dsc >> index ff70509542..3cc182545c 100644 >> --- a/ArmVirtPkg/ArmVirtKvmTool.dsc >> +++ b/ArmVirtPkg/ArmVirtKvmTool.dsc >> @@ -57,7 +57,7 @@ >> >>FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf >> >> - >> PciPcdProducerLib|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf >> + >> PciPcdProducerLib|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf >>PciSegmentLib|MdePkg/Library/BasePciSegmentLibPci/BasePciSegmentLibPci.inf >> >> PciHostBridgeLib|ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf >> >> PciHostBridgeUtilityLib|ArmVirtPkg/Library/ArmVirtPciHostBridgeUtilityLib/ArmVirtPciHostBridgeUtilityLib.inf >> @@ -338,17 +338,17 @@ >># >>ArmPkg/Drivers/ArmPciCpuIo2Dxe/ArmPciCpuIo2Dxe.inf { >> >> - NULL|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf >> + NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf >> >
Re: [edk2-devel] [PATCH V2 3/9] ArmPkg: Use PcdPciIoTranslation PCD from MdePkg
Good so far. Reviewed-By: Daniel Schaefer But it needs an update to edk2-platforms, too. Lots of platform use this PCD. On 9/28/21 16:31, Abner Chang wrote: > PcdPciIoTranslation PCD is relocated to MdePkg and leveraged by > both ARM and RISC-V arch. This patch removes the one from ArmPkg > and address the corresponding changes required for other modules > under ArmVirtPkg. > > Signed-off-by: Abner Chang > Cc: Ard Biesheuvel > Cc: Leif Lindholm > Cc: Sami Mujawar > Cc: Gerd Hoffmann > Cc: Daniel Schaefer > Cc: Sunil V L > --- > ArmPkg/ArmPkg.dec| 5 ++--- > ArmVirtPkg/ArmVirtCloudHv.dsc| 2 +- > ArmVirtPkg/ArmVirtKvmTool.dsc| 2 +- > ArmVirtPkg/ArmVirtQemu.dsc | 2 +- > ArmVirtPkg/ArmVirtQemuKernel.dsc | 2 +- > ArmPkg/Drivers/ArmPciCpuIo2Dxe/ArmPciCpuIo2Dxe.inf | 2 +- > .../Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf | 2 +- > .../Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf| 2 +- > 8 files changed, 9 insertions(+), 10 deletions(-) > > diff --git a/ArmPkg/ArmPkg.dec b/ArmPkg/ArmPkg.dec > index 6ed51edd03..12584fb319 100644 > --- a/ArmPkg/ArmPkg.dec > +++ b/ArmPkg/ArmPkg.dec > @@ -337,7 +337,7 @@ ># UINT64 Mmio32CpuBase; // mapping target in 64-bit cpu-physical space ># UINT64 Mmio64CpuBase; // mapping target in 64-bit cpu-physical space ># > - # PcdPciIoTranslation = IoCpuBase - PcdPciIoBase; > + # gEfiMdePkgTokenSpaceGuid.PcdPciIoTranslation = IoCpuBase - > PcdPciIoBase; ># PcdPciMmio32Translation = Mmio32CpuBase - (UINT64)PcdPciMmio32Base; ># PcdPciMmio64Translation = Mmio64CpuBase - PcdPciMmio64Base; ># > @@ -356,7 +356,7 @@ ># UINT64 TranslatedMmio64Address; // output parameter ># ># TranslatedIoAddress = UntranslatedIoAddress + > - # PcdPciIoTranslation; > + # gEfiMdePkgTokenSpaceGuid.PcdPciIoTranslation; ># TranslatedMmio32Address = (UINT64)UntranslatedMmio32Address + ># PcdPciMmio32Translation; ># TranslatedMmio64Address = UntranslatedMmio64Address + > @@ -369,7 +369,6 @@ ># >gArmTokenSpaceGuid.PcdPciIoBase|0x0|UINT64|0x0050 >gArmTokenSpaceGuid.PcdPciIoSize|0x0|UINT64|0x0051 > - gArmTokenSpaceGuid.PcdPciIoTranslation|0x0|UINT64|0x0052 >gArmTokenSpaceGuid.PcdPciMmio32Base|0x0|UINT32|0x0053 >gArmTokenSpaceGuid.PcdPciMmio32Size|0x0|UINT32|0x0054 >gArmTokenSpaceGuid.PcdPciMmio32Translation|0x0|UINT64|0x0055 > diff --git a/ArmVirtPkg/ArmVirtCloudHv.dsc b/ArmVirtPkg/ArmVirtCloudHv.dsc > index 07313e1e67..f159754bf4 100644 > --- a/ArmVirtPkg/ArmVirtCloudHv.dsc > +++ b/ArmVirtPkg/ArmVirtCloudHv.dsc > @@ -192,7 +192,7 @@ ># PCD and PcdPciDisableBusEnumeration above have not been assigned yet >gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress|0x > > - gArmTokenSpaceGuid.PcdPciIoTranslation|0 > + gEfiMdePkgTokenSpaceGuid.PcdPciIoTranslation|0 > >gEfiSecurityPkgTokenSpaceGuid.PcdTpmBaseAddress|0x0 > > diff --git a/ArmVirtPkg/ArmVirtKvmTool.dsc b/ArmVirtPkg/ArmVirtKvmTool.dsc > index 745eae347b..ff70509542 100644 > --- a/ArmVirtPkg/ArmVirtKvmTool.dsc > +++ b/ArmVirtPkg/ArmVirtKvmTool.dsc > @@ -184,7 +184,7 @@ ># PCD and PcdPciDisableBusEnumeration above have not been assigned yet >gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress|0x > > - gArmTokenSpaceGuid.PcdPciIoTranslation|0x0 > + gEfiMdePkgTokenSpaceGuid.PcdPciIoTranslation|0x0 > ># ># Set video resolution for boot options and for text setup. > diff --git a/ArmVirtPkg/ArmVirtQemu.dsc b/ArmVirtPkg/ArmVirtQemu.dsc > index 5030174fe3..f4bb14903f 100644 > --- a/ArmVirtPkg/ArmVirtQemu.dsc > +++ b/ArmVirtPkg/ArmVirtQemu.dsc > @@ -247,7 +247,7 @@ ># PCD and PcdPciDisableBusEnumeration above have not been assigned yet >gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress|0x > > - gArmTokenSpaceGuid.PcdPciIoTranslation|0x0 > + gEfiMdePkgTokenSpaceGuid.PcdPciIoTranslation|0x0 > ># ># Set video resolution for boot options and for text setup. > diff --git a/ArmVirtPkg/ArmVirtQemuKernel.dsc > b/ArmVirtPkg/ArmVirtQemuKernel.dsc > index 5e0a2ee0c6..eecef1a063 100644 > --- a/ArmVirtPkg/ArmVirtQemuKernel.dsc > +++ b/ArmVirtPkg/ArmVirtQemuKernel.dsc > @@ -227,7 +227,7 @@ ># PCD and PcdPciDisableBusEnumeration above have not been assigned yet >gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress|0x > &
Re: [edk2-devel] [PATCH V2 7/9] MdePkg: Add PcdPciMmio32(64)Translation PCDs
Also here. I think this should be combined into patch 8. On 9/28/21 16:31, Abner Chang wrote: > PcdPciMmio32Translation and PcdPciMmio64Translation PCDs are added > to MdePkg as the common PCDs for ARM and RSIC-V archs. > > The one under ArmPkg is removed in the next patch. > > Signed-off-by: Abner Chang > Cc: Michael D Kinney > Cc: Liming Gao > Cc: Zhiguang Liu > Cc: Ard Biesheuvel > Cc: Leif Lindholm > Cc: Sami Mujawar > Cc: Gerd Hoffmann > Cc: Daniel Schaefer > Cc: Sunil V L > --- > MdePkg/MdePkg.dec | 8 > 1 file changed, 8 insertions(+) > > diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec > index 08d259764a..9df95abc50 100644 > --- a/MdePkg/MdePkg.dec > +++ b/MdePkg/MdePkg.dec > @@ -2306,6 +2306,14 @@ ># @Prompt PCI I/O Memory Map Window Base Address. >gEfiMdePkgTokenSpaceGuid.PcdPciIoTranslation|0x0|UINT64|0x0040 > > + ## This value is used for the 32-bit PCI memory map I/O base address > translation. > + # @Prompt 32-bit PCI Memory Map I/O Base Address translation. > + gEfiMdePkgTokenSpaceGuid.PcdPciMmio32Translation|0x0|UINT64|0x0041 > + > + ## This value is used for the 64-bit PCI memory map I/O base address > translation. > + # @Prompt 64-bit PCI Memory Map I/O Base Address translation. > + gEfiMdePkgTokenSpaceGuid.PcdPciMmio64Translation|0x0|UINT64|0x0042 > + >## This value is used to set the size of PCI express hierarchy. The > default is 256 MB. ># @Prompt PCI Express Base Size. >gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseSize|0x1000|UINT64|0x000f > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#81242): https://edk2.groups.io/g/devel/message/81242 Mute This Topic: https://groups.io/mt/85920592/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH V2 9/9] ArmVirtPkg/VirtioFdtDxe: Relocate VirtioFdtDxe to OvmfPkg/Fdt
Reviewed-By: Daniel Schaefer On 9/28/21 16:31, Abner Chang wrote: > Relocate VirtioFdtDxe to OvmfPkg/Fdt, this driver is leverage by > both ARM and RISC-V archs. > > Signed-off-by: Abner Chang > Cc: Ard Biesheuvel > Cc: Leif Lindholm > Cc: Sami Mujawar > Cc: Jiewen Yao > Cc: Jordan Justen > Cc: Gerd Hoffmann > Cc: Daniel Schaefer > Cc: Sunil V L > --- > ArmVirtPkg/ArmVirtCloudHv.dsc | 2 +- > ArmVirtPkg/ArmVirtKvmTool.dsc | 2 +- > ArmVirtPkg/ArmVirtQemu.dsc| 2 +- > ArmVirtPkg/ArmVirtQemuKernel.dsc | 2 +- > ArmVirtPkg/ArmVirtCloudHv.fdf | 2 +- > ArmVirtPkg/ArmVirtKvmTool.fdf | 2 +- > ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc | 2 +- > {ArmVirtPkg => OvmfPkg/Fdt}/VirtioFdtDxe/VirtioFdtDxe.inf | 1 - > {ArmVirtPkg => OvmfPkg/Fdt}/VirtioFdtDxe/VirtioFdtDxe.c | 0 > 9 files changed, 7 insertions(+), 8 deletions(-) > rename {ArmVirtPkg => OvmfPkg/Fdt}/VirtioFdtDxe/VirtioFdtDxe.inf (93%) > rename {ArmVirtPkg => OvmfPkg/Fdt}/VirtioFdtDxe/VirtioFdtDxe.c (100%) > > diff --git a/ArmVirtPkg/ArmVirtCloudHv.dsc b/ArmVirtPkg/ArmVirtCloudHv.dsc > index 0f26c10aab..9ad124522f 100644 > --- a/ArmVirtPkg/ArmVirtCloudHv.dsc > +++ b/ArmVirtPkg/ArmVirtCloudHv.dsc > @@ -292,7 +292,7 @@ ># ># Platform Driver ># > - ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf > + OvmfPkg/Fdt/VirtioFdtDxe/VirtioFdtDxe.inf >EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf >OvmfPkg/Fdt/HighMemDxe/HighMemDxe.inf >OvmfPkg/VirtioBlkDxe/VirtioBlk.inf > diff --git a/ArmVirtPkg/ArmVirtKvmTool.dsc b/ArmVirtPkg/ArmVirtKvmTool.dsc > index 0c5da4427e..9d23072d8f 100644 > --- a/ArmVirtPkg/ArmVirtKvmTool.dsc > +++ b/ArmVirtPkg/ArmVirtKvmTool.dsc > @@ -291,7 +291,7 @@ ># Platform Driver ># >ArmVirtPkg/KvmtoolPlatformDxe/KvmtoolPlatformDxe.inf > - ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf > + OvmfPkg/Fdt/VirtioFdtDxe/VirtioFdtDxe.inf >EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf >OvmfPkg/Fdt/HighMemDxe/HighMemDxe.inf >OvmfPkg/VirtioBlkDxe/VirtioBlk.inf > diff --git a/ArmVirtPkg/ArmVirtQemu.dsc b/ArmVirtPkg/ArmVirtQemu.dsc > index 4624b6ec36..6d41c8ac55 100644 > --- a/ArmVirtPkg/ArmVirtQemu.dsc > +++ b/ArmVirtPkg/ArmVirtQemu.dsc > @@ -403,7 +403,7 @@ ># ># Platform Driver ># > - ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf > + OvmfPkg/Fdt/VirtioFdtDxe/VirtioFdtDxe.inf >EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf >OvmfPkg/Fdt/HighMemDxe/HighMemDxe.inf >OvmfPkg/VirtioBlkDxe/VirtioBlk.inf > diff --git a/ArmVirtPkg/ArmVirtQemuKernel.dsc > b/ArmVirtPkg/ArmVirtQemuKernel.dsc > index 426e0ff1fd..19544ea898 100644 > --- a/ArmVirtPkg/ArmVirtQemuKernel.dsc > +++ b/ArmVirtPkg/ArmVirtQemuKernel.dsc > @@ -339,7 +339,7 @@ ># ># Platform Driver ># > - ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf > + OvmfPkg/Fdt/VirtioFdtDxe/VirtioFdtDxe.inf >EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf >OvmfPkg/Fdt/HighMemDxe/HighMemDxe.inf >OvmfPkg/VirtioBlkDxe/VirtioBlk.inf > diff --git a/ArmVirtPkg/ArmVirtCloudHv.fdf b/ArmVirtPkg/ArmVirtCloudHv.fdf > index 7ecf5ca88d..81c539590a 100644 > --- a/ArmVirtPkg/ArmVirtCloudHv.fdf > +++ b/ArmVirtPkg/ArmVirtCloudHv.fdf > @@ -105,7 +105,7 @@ READ_LOCK_STATUS = TRUE > >INF MdeModulePkg/Core/Dxe/DxeMain.inf >INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf > - INF ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf > + INF OvmfPkg/Fdt/VirtioFdtDxe/VirtioFdtDxe.inf >INF EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf >INF OvmfPkg/Fdt/HighMemDxe/HighMemDxe.inf > > diff --git a/ArmVirtPkg/ArmVirtKvmTool.fdf b/ArmVirtPkg/ArmVirtKvmTool.fdf > index 0535d36b7d..14a5fce43a 100644 > --- a/ArmVirtPkg/ArmVirtKvmTool.fdf > +++ b/ArmVirtPkg/ArmVirtKvmTool.fdf > @@ -119,7 +119,7 @@ READ_LOCK_STATUS = TRUE > >INF MdeModulePkg/Core/Dxe/DxeMain.inf >INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf > - INF ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf > + INF OvmfPkg/Fdt/VirtioFdtDxe/VirtioFdtDxe.inf >INF EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf >INF ArmVirtPkg/KvmtoolPlatformDxe/KvmtoolPlatformDxe.inf >INF OvmfPkg/Fdt/HighMemDxe/HighMemDxe.inf > diff --git a/ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc > b/ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc > index 279b905edd..f6a538df72 100644 > --- a/ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc > +++ b/ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc > @@ -40,7 +40,7 @@ READ_LOCK_STATUS = TRUE > >INF MdeModulePkg/Core/Dxe/DxeMain.inf >INF MdeModulePkg/Univ
Re: [edk2-devel] [PATCH V2 5/9] ArmVirtPkg/HighMemDxe: Relocate HighMemDxe to OvmfPkg
The comments at the top of the files in HighMemDxe.{c,inf} say it's for ARM VMs. We should add RISC-V there, too. On 9/28/21 16:31, Abner Chang wrote: > Relocate HighMemDxe to OvmfPkg/Fdt, this library is leverage by > both ARM and RISC-V archs. > > Signed-off-by: Abner Chang > Cc: Ard Biesheuvel > Cc: Leif Lindholm > Cc: Sami Mujawar > Cc: Jiewen Yao > Cc: Jordan Justen > Cc: Gerd Hoffmann > Cc: Daniel Schaefer > Cc: Sunil V L > --- > ArmVirtPkg/ArmVirtCloudHv.dsc | 2 +- > ArmVirtPkg/ArmVirtKvmTool.dsc | 2 +- > ArmVirtPkg/ArmVirtQemu.dsc| 2 +- > ArmVirtPkg/ArmVirtQemuKernel.dsc | 2 +- > ArmVirtPkg/ArmVirtCloudHv.fdf | 2 +- > ArmVirtPkg/ArmVirtKvmTool.fdf | 2 +- > ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc | 2 +- > {ArmVirtPkg => OvmfPkg/Fdt}/HighMemDxe/HighMemDxe.inf | 3 +-- > {ArmVirtPkg => OvmfPkg/Fdt}/HighMemDxe/HighMemDxe.c | 0 > 9 files changed, 8 insertions(+), 9 deletions(-) > rename {ArmVirtPkg => OvmfPkg/Fdt}/HighMemDxe/HighMemDxe.inf (91%) > rename {ArmVirtPkg => OvmfPkg/Fdt}/HighMemDxe/HighMemDxe.c (100%) > > diff --git a/ArmVirtPkg/ArmVirtCloudHv.dsc b/ArmVirtPkg/ArmVirtCloudHv.dsc > index 2928b9adb5..4470fa3b14 100644 > --- a/ArmVirtPkg/ArmVirtCloudHv.dsc > +++ b/ArmVirtPkg/ArmVirtCloudHv.dsc > @@ -294,7 +294,7 @@ ># >ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf >EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf > - ArmVirtPkg/HighMemDxe/HighMemDxe.inf > + OvmfPkg/Fdt/HighMemDxe/HighMemDxe.inf >OvmfPkg/VirtioBlkDxe/VirtioBlk.inf >OvmfPkg/VirtioScsiDxe/VirtioScsi.inf >OvmfPkg/VirtioNetDxe/VirtioNet.inf > diff --git a/ArmVirtPkg/ArmVirtKvmTool.dsc b/ArmVirtPkg/ArmVirtKvmTool.dsc > index 3cc182545c..97fc98d778 100644 > --- a/ArmVirtPkg/ArmVirtKvmTool.dsc > +++ b/ArmVirtPkg/ArmVirtKvmTool.dsc > @@ -293,7 +293,7 @@ >ArmVirtPkg/KvmtoolPlatformDxe/KvmtoolPlatformDxe.inf >ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf >EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf > - ArmVirtPkg/HighMemDxe/HighMemDxe.inf > + OvmfPkg/Fdt/HighMemDxe/HighMemDxe.inf >OvmfPkg/VirtioBlkDxe/VirtioBlk.inf >OvmfPkg/VirtioScsiDxe/VirtioScsi.inf >OvmfPkg/VirtioNetDxe/VirtioNet.inf > diff --git a/ArmVirtPkg/ArmVirtQemu.dsc b/ArmVirtPkg/ArmVirtQemu.dsc > index 85fcf5f310..07f9699c79 100644 > --- a/ArmVirtPkg/ArmVirtQemu.dsc > +++ b/ArmVirtPkg/ArmVirtQemu.dsc > @@ -405,7 +405,7 @@ ># >ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf >EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf > - ArmVirtPkg/HighMemDxe/HighMemDxe.inf > + OvmfPkg/Fdt/HighMemDxe/HighMemDxe.inf >OvmfPkg/VirtioBlkDxe/VirtioBlk.inf >OvmfPkg/VirtioScsiDxe/VirtioScsi.inf >OvmfPkg/VirtioNetDxe/VirtioNet.inf > diff --git a/ArmVirtPkg/ArmVirtQemuKernel.dsc > b/ArmVirtPkg/ArmVirtQemuKernel.dsc > index 909968d13a..cf7a2b4463 100644 > --- a/ArmVirtPkg/ArmVirtQemuKernel.dsc > +++ b/ArmVirtPkg/ArmVirtQemuKernel.dsc > @@ -341,7 +341,7 @@ ># >ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf >EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf > - ArmVirtPkg/HighMemDxe/HighMemDxe.inf > + OvmfPkg/Fdt/HighMemDxe/HighMemDxe.inf >OvmfPkg/VirtioBlkDxe/VirtioBlk.inf >OvmfPkg/VirtioScsiDxe/VirtioScsi.inf >OvmfPkg/VirtioNetDxe/VirtioNet.inf > diff --git a/ArmVirtPkg/ArmVirtCloudHv.fdf b/ArmVirtPkg/ArmVirtCloudHv.fdf > index 1bb452ebb8..7ecf5ca88d 100644 > --- a/ArmVirtPkg/ArmVirtCloudHv.fdf > +++ b/ArmVirtPkg/ArmVirtCloudHv.fdf > @@ -107,7 +107,7 @@ READ_LOCK_STATUS = TRUE >INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf >INF ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf >INF EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf > - INF ArmVirtPkg/HighMemDxe/HighMemDxe.inf > + INF OvmfPkg/Fdt/HighMemDxe/HighMemDxe.inf > ># ># PI DXE Drivers producing Architectural Protocols (EFI Services) > diff --git a/ArmVirtPkg/ArmVirtKvmTool.fdf b/ArmVirtPkg/ArmVirtKvmTool.fdf > index 1dac8b7880..0535d36b7d 100644 > --- a/ArmVirtPkg/ArmVirtKvmTool.fdf > +++ b/ArmVirtPkg/ArmVirtKvmTool.fdf > @@ -122,7 +122,7 @@ READ_LOCK_STATUS = TRUE >INF ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf >INF EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf >INF ArmVirtPkg/KvmtoolPlatformDxe/KvmtoolPlatformDxe.inf > - INF ArmVirtPkg/HighMemDxe/HighMemDxe.inf > + INF OvmfPkg/Fdt/HighMemDxe/HighMemDxe.inf > ># ># PI DXE Drivers producing Architectural Protocols (EFI Services) > diff --git a/ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc > b/ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc > index e9518dd273..279b9
Re: [edk2-devel] [PATCH V2 8/9] ArmVirtPkg/FdtPciHostBridgeLib: Relocate FdtPciHostBridgeLib to OvmfPkg/Fdt
Looks good. Just one minor typo in the comment. Reviewed-By: Daniel Schaefer On 9/28/21 16:31, Abner Chang wrote: > Relocate FdtPciHostBridgeLib to OvmfPkg/Fdt, this library is > leverage by both ARM and RISC-V archs. Also use > PcdPciMmio32Translation and PcdPciMmio64Translation > PCDs provided by MdePkg instead of ArmPkg. > > Signed-off-by: Abner Chang > Cc: Ard Biesheuvel > Cc: Leif Lindholm > Cc: Sami Mujawar > Cc: Jiewen Yao > Cc: Jordan Justen > Cc: Gerd Hoffmann > Cc: Daniel Schaefer > Cc: Sunil V L > --- > ArmPkg/ArmPkg.dec | 10 -- > ArmVirtPkg/ArmVirtCloudHv.dsc | 2 +- > ArmVirtPkg/ArmVirtKvmTool.dsc | 2 +- > ArmVirtPkg/ArmVirtQemu.dsc | 2 +- > ArmVirtPkg/ArmVirtQemuKernel.dsc | 2 +- > .../Fdt}/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf | 8 +++- > .../Fdt}/FdtPciHostBridgeLib/FdtPciHostBridgeLib.c | 0 > 7 files changed, 11 insertions(+), 15 deletions(-) > rename {ArmVirtPkg/Library => > OvmfPkg/Fdt}/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf (81%) > rename {ArmVirtPkg/Library => > OvmfPkg/Fdt}/FdtPciHostBridgeLib/FdtPciHostBridgeLib.c (100%) > > diff --git a/ArmPkg/ArmPkg.dec b/ArmPkg/ArmPkg.dec > index 12584fb319..8a512b7035 100644 > --- a/ArmPkg/ArmPkg.dec > +++ b/ArmPkg/ArmPkg.dec > @@ -338,8 +338,8 @@ ># UINT64 Mmio64CpuBase; // mapping target in 64-bit cpu-physical space ># ># gEfiMdePkgTokenSpaceGuid.PcdPciIoTranslation = IoCpuBase - > PcdPciIoBase; > - # PcdPciMmio32Translation = Mmio32CpuBase - (UINT64)PcdPciMmio32Base; > - # PcdPciMmio64Translation = Mmio64CpuBase - PcdPciMmio64Base; > + # gEfiMdePkgTokenSpaceGuid.PcdPciMmio32Translation = Mmio32CpuBase - > (UINT64)PcdPciMmio32Base; > + # gEfiMdePkgTokenSpaceGuid.PcdPciMmio64Translation = Mmio64CpuBase - > PcdPciMmio64Base; ># ># because (a) the target address space (ie. the cpu-physical space) is ># 64-bit, and (b) the translation values are meant as offsets for *modular* > @@ -358,9 +358,9 @@ ># TranslatedIoAddress = UntranslatedIoAddress + ># gEfiMdePkgTokenSpaceGuid.PcdPciIoTranslation; ># TranslatedMmio32Address = (UINT64)UntranslatedMmio32Address + > - # PcdPciMmio32Translation; > + # > gEfiMdePkgTokenSpaceGuid..PcdPciMmio32Translation; Should be one period instead of two. ># TranslatedMmio64Address = UntranslatedMmio64Address + > - # PcdPciMmio64Translation; > + # > gEfiMdePkgTokenSpaceGuid.PcdPciMmio64Translation; ># ># The modular arithmetic performed in UINT64 ensures that the translation ># works correctly regardless of the relation between IoCpuBase and > @@ -371,10 +371,8 @@ >gArmTokenSpaceGuid.PcdPciIoSize|0x0|UINT64|0x0051 >gArmTokenSpaceGuid.PcdPciMmio32Base|0x0|UINT32|0x0053 >gArmTokenSpaceGuid.PcdPciMmio32Size|0x0|UINT32|0x0054 > - gArmTokenSpaceGuid.PcdPciMmio32Translation|0x0|UINT64|0x0055 >gArmTokenSpaceGuid.PcdPciMmio64Base|0x0|UINT64|0x0056 >gArmTokenSpaceGuid.PcdPciMmio64Size|0x0|UINT64|0x0057 > - gArmTokenSpaceGuid.PcdPciMmio64Translation|0x0|UINT64|0x0058 > ># ># Inclusive range of allowed PCI buses. > diff --git a/ArmVirtPkg/ArmVirtCloudHv.dsc b/ArmVirtPkg/ArmVirtCloudHv.dsc > index 4470fa3b14..0f26c10aab 100644 > --- a/ArmVirtPkg/ArmVirtCloudHv.dsc > +++ b/ArmVirtPkg/ArmVirtCloudHv.dsc > @@ -51,7 +51,7 @@ >FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf >PciPcdProducerLib|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf >PciSegmentLib|MdePkg/Library/BasePciSegmentLibPci/BasePciSegmentLibPci.inf > - > PciHostBridgeLib|ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf > + PciHostBridgeLib|OvmfPkg/Fdt/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf > > PciHostBridgeUtilityLib|ArmVirtPkg/Library/ArmVirtPciHostBridgeUtilityLib/ArmVirtPciHostBridgeUtilityLib.inf > > > TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/TpmMeasurementLibNull.inf > diff --git a/ArmVirtPkg/ArmVirtKvmTool.dsc b/ArmVirtPkg/ArmVirtKvmTool.dsc > index 97fc98d778..0c5da4427e 100644 > --- a/ArmVirtPkg/ArmVirtKvmTool.dsc > +++ b/ArmVirtPkg/ArmVirtKvmTool.dsc > @@ -59,7 +59,7 @@ > >PciPcdProducerLib|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf >PciSegmentLib|MdePkg/Library/BasePciSegmentLibPci/BasePciSegmentLibPci.inf > - > PciHostBridgeLib|ArmVirtPkg/Library/FdtPciHostBrid
Re: [edk2-devel] [PATCH V2 4/9] ArmVirtPkg/FdtPciPcdProducerLib: Relocate PciPcdProducerLib to OvmfPkg
Please fix the issue in the maintainers file. Looks good otherwise: Reviewed-By: Daniel Schaefer On 9/28/21 16:31, Abner Chang wrote: > Relocate PciPcdProducerLib to OvmfPkg/Fdt, this library is > leverage by both ARM and RISC-V archs. > > Add OvmfPkg/Fdt maintainers in Maintainers.txt > > Signed-off-by: Abner Chang > Cc: Ard Biesheuvel > Cc: Leif Lindholm > Cc: Sami Mujawar > Cc: Jiewen Yao > Cc: Jordan Justen > Cc: Gerd Hoffmann > Cc: Daniel Schaefer > Cc: Sunil V L > --- > ArmVirtPkg/ArmVirtCloudHv.dsc | 8 > ArmVirtPkg/ArmVirtKvmTool.dsc | 8 > ArmVirtPkg/ArmVirtQemu.dsc| 8 > ArmVirtPkg/ArmVirtQemuKernel.dsc | 8 > .../Fdt}/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf| 2 -- > .../Fdt}/FdtPciPcdProducerLib/FdtPciPcdProducerLib.c | 0 > Maintainers.txt | 6 ++ > 7 files changed, 22 insertions(+), 18 deletions(-) > rename {ArmVirtPkg/Library => > OvmfPkg/Fdt}/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf (92%) > rename {ArmVirtPkg/Library => > OvmfPkg/Fdt}/FdtPciPcdProducerLib/FdtPciPcdProducerLib.c (100%) > > diff --git a/ArmVirtPkg/ArmVirtCloudHv.dsc b/ArmVirtPkg/ArmVirtCloudHv.dsc > index f159754bf4..2928b9adb5 100644 > --- a/ArmVirtPkg/ArmVirtCloudHv.dsc > +++ b/ArmVirtPkg/ArmVirtCloudHv.dsc > @@ -49,7 +49,7 @@ > > FrameBufferBltLib|MdeModulePkg/Library/FrameBufferBltLib/FrameBufferBltLib.inf >QemuBootOrderLib|OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.inf >FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf > - > PciPcdProducerLib|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf > + PciPcdProducerLib|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf >PciSegmentLib|MdePkg/Library/BasePciSegmentLibPci/BasePciSegmentLibPci.inf > > PciHostBridgeLib|ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf > > PciHostBridgeUtilityLib|ArmVirtPkg/Library/ArmVirtPciHostBridgeUtilityLib/ArmVirtPciHostBridgeUtilityLib.inf > @@ -341,12 +341,12 @@ ># >ArmPkg/Drivers/ArmPciCpuIo2Dxe/ArmPciCpuIo2Dxe.inf { > > - NULL|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf > + NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf >} >MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf >MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf { > > - NULL|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf > + NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf >} >OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.inf >OvmfPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf > @@ -360,5 +360,5 @@ > > MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsResourceTableDxe.inf >ArmVirtPkg/CloudHvAcpiPlatformDxe/CloudHvAcpiPlatformDxe.inf { > > - NULL|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf > + NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf >} > diff --git a/ArmVirtPkg/ArmVirtKvmTool.dsc b/ArmVirtPkg/ArmVirtKvmTool.dsc > index ff70509542..3cc182545c 100644 > --- a/ArmVirtPkg/ArmVirtKvmTool.dsc > +++ b/ArmVirtPkg/ArmVirtKvmTool.dsc > @@ -57,7 +57,7 @@ > >FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf > > - > PciPcdProducerLib|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf > + PciPcdProducerLib|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf >PciSegmentLib|MdePkg/Library/BasePciSegmentLibPci/BasePciSegmentLibPci.inf > > PciHostBridgeLib|ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf > > PciHostBridgeUtilityLib|ArmVirtPkg/Library/ArmVirtPciHostBridgeUtilityLib/ArmVirtPciHostBridgeUtilityLib.inf > @@ -338,17 +338,17 @@ ># >ArmPkg/Drivers/ArmPciCpuIo2Dxe/ArmPciCpuIo2Dxe.inf { > > - NULL|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf > + NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf > > NULL|ArmVirtPkg/Library/BaseCachingPciExpressLib/BaseCachingPciExpressLib.inf >} >MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf { > > - NULL|ArmVirtPkg/Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf > + NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf > > NULL|ArmVirtPkg/Library/BaseCachingPciExpressLib/BaseCachingPciExpressLib.inf >} >MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf { > > - NULL|ArmVirtPkg/Library/FdtPciPcd
Re: [edk2-devel] [PATCH V2 0/9] Migrate ArmVirtPkg modules to OvmfPkg
Is there CI to check that the ArmVirtPkg platforms still builds with this? I assume you haven't checked, Abner? On 9/28/21 16:30, Abner Chang wrote: > In V2: Remove HPE license on the files that just moved around or >the changes in the file are just code removal. > > This pacthes set is to migrate some modules from ArmVirtPkg > to under OvmfPkg for the upcoming RiscVVirtPkg that can leverage > those modules without the dependency with Arm*Pkg. > > The modules moved from ArmVirtPkg to OvmfPkg are, > - FdtClientDxe > - PciPcdProducerLib > - HighMemDxe > - QemuFwCfgLib > - FdtPciHostBridgeLib > - VirtioFdtDxe > > Below PCDs are moved to under MdePkg and leverage by RiscVVirtPkg. > This change also remove the dependency on ArmPkg of OvmfPkg. > - PcdPciIoTranslation > - PcdPciIoTranslation > - PcdPciMmio32(64)Translation > > Signed-off-by: Abner Chang > Cc: Ard Biesheuvel > Cc: Leif Lindholm > Cc: Sami Mujawar > Cc: Jiewen Yao > Cc: Jordan Justen > Cc: Gerd Hoffmann > Cc: Daniel Schaefer > Cc: Sunil V L > Cc: Liming Gao > Cc: Zhiguang Liu > Cc: Michael D Kinney > > Abner Chang (9): > ArmVirtPkg/FdtClintDxe: Move FdtClientDxe to EmbeddedPkg > MdePkg: Add PcdPciIoTranslation PCD > ArmPkg: Use PcdPciIoTranslation PCD from MdePkg > ArmVirtPkg/FdtPciPcdProducerLib: Relocate PciPcdProducerLib to OvmfPkg > ArmVirtPkg/HighMemDxe: Relocate HighMemDxe to OvmfPkg > ArmVirtPkg/QemuFwCfgLib: Relocate QemuFwCfgLib to OvmfPkg > MdePkg: Add PcdPciMmio32(64)Translation PCDs > ArmVirtPkg/FdtPciHostBridgeLib: Relocate FdtPciHostBridgeLib to > OvmfPkg/Fdt > ArmVirtPkg/VirtioFdtDxe: Relocate VirtioFdtDxe to OvmfPkg/Fdt > > ArmPkg/ArmPkg.dec | 15 ++ > ArmVirtPkg/ArmVirtPkg.dec | 3 --- > EmbeddedPkg/EmbeddedPkg.dec | 1 + > MdePkg/MdePkg.dec | 12 +++ > ArmVirtPkg/ArmVirtCloudHv.dsc | 18 - > ArmVirtPkg/ArmVirtKvmTool.dsc | 18 - > ArmVirtPkg/ArmVirtQemu.dsc| 20 +-- > ArmVirtPkg/ArmVirtQemuKernel.dsc | 20 +-- > ArmVirtPkg/ArmVirtXen.dsc | 2 +- > EmbeddedPkg/EmbeddedPkg.dsc | 1 + > ArmVirtPkg/ArmVirtCloudHv.fdf | 6 +++--- > ArmVirtPkg/ArmVirtKvmTool.fdf | 6 +++--- > ArmVirtPkg/ArmVirtXen.fdf | 2 +- > ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc | 6 +++--- > .../ArmPciCpuIo2Dxe/ArmPciCpuIo2Dxe.inf | 2 +- > .../ArmVirtGicArchLib/ArmVirtGicArchLib.inf | 1 + > .../ArmVirtPL031FdtClientLib.inf | 1 + > .../ArmVirtPsciResetSystemLib.inf | 1 + > .../ArmVirtTimerFdtClientLib.inf | 1 + > .../KvmtoolRtcFdtClientLib.inf| 1 + > .../NorFlashKvmtoolLib/NorFlashKvmtoolLib.inf | 1 + > .../NorFlashQemuLib/NorFlashQemuLib.inf | 1 + > .../XenAcpiPlatformDxe/XenAcpiPlatformDxe.inf | 1 + > ArmVirtPkg/XenioFdtDxe/XenioFdtDxe.inf| 1 + > .../Drivers}/FdtClientDxe/FdtClientDxe.inf| 1 - > .../FdtPciHostBridgeLib.inf | 11 +- > .../FdtPciPcdProducerLib.inf | 5 ++--- > .../Fdt}/HighMemDxe/HighMemDxe.inf| 4 ++-- > .../Fdt}/VirtioFdtDxe/VirtioFdtDxe.inf| 2 +- > .../Library/QemuFwCfgLib/QemuFwCfgLibMMIO.inf | 6 +++--- > .../Include/Protocol/FdtClient.h | 0 > .../Drivers}/FdtClientDxe/FdtClientDxe.c | 0 > .../FdtPciHostBridgeLib/FdtPciHostBridgeLib.c | 0 > .../FdtPciPcdProducerLib.c| 0 > .../Fdt}/HighMemDxe/HighMemDxe.c | 0 > .../Fdt}/VirtioFdtDxe/VirtioFdtDxe.c | 0 > .../Library/QemuFwCfgLib/QemuFwCfgLibMMIO.c | 7 --- > Maintainers.txt | 6 ++ > 38 files changed, 102 insertions(+), 81 deletions(-) > rename {ArmVirtPkg => EmbeddedPkg/Drivers}/FdtClientDxe/FdtClientDxe.inf > (92%) > rename {ArmVirtPkg/Library => > OvmfPkg/Fdt}/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf (77%) > rename {ArmVirtPkg/Library => > OvmfPkg/Fdt}/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf (87%) > rename {ArmVirtPkg => OvmfPkg/Fdt}/HighMemDxe/HighMemDxe.inf (91%) > rename {ArmVirtPkg => OvmfPkg/Fdt}/VirtioFdtDxe/VirtioFdtDxe.inf (92%) > rename ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf => > OvmfPkg/Library/QemuFwCfgLib/QemuFwCfgLibMMIO.inf (86%) > rename {ArmVirtPkg => EmbeddedPkg}/Include/Protocol/FdtClient.h (100%) > rename {ArmVirtPkg => EmbeddedPkg/Drivers}/FdtClientDxe/FdtClientD
Re: [edk2-devel] [PATCH V2 2/9] MdePkg: Add PcdPciIoTranslation PCD
I think it would make sense to combine this patch with 3/9 ArmPkg: Use PcdPciIoTranslation PCD from MdePkg It's pointless by itself. On 9/28/21 16:31, Abner Chang wrote: > This PCD is moved from ArmPkg that is used to set the base address > of PCI MMIO window that provides I/O access. We relocate this PCD > because this PCD is common to ARM and RSIC-V arch. > > Signed-off-by: Abner Chang > Cc: Michael D Kinney > Cc: Liming Gao > Cc: Zhiguang Liu > Cc: Ard Biesheuvel > Cc: Leif Lindholm > Cc: Sami Mujawar > Cc: Gerd Hoffmann > Cc: Daniel Schaefer > Cc: Sunil V L > --- > MdePkg/MdePkg.dec | 4 > 1 file changed, 4 insertions(+) > > diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec > index a28a2daaff..08d259764a 100644 > --- a/MdePkg/MdePkg.dec > +++ b/MdePkg/MdePkg.dec > @@ -2302,6 +2302,10 @@ ># @Prompt PCI Express Base Address. > > gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress|0xE000|UINT64|0x000a > > + ## This value is used to set the base address of PCI MMIO window that > provides I/O access. > + # @Prompt PCI I/O Memory Map Window Base Address. > + gEfiMdePkgTokenSpaceGuid.PcdPciIoTranslation|0x0|UINT64|0x0040 > + >## This value is used to set the size of PCI express hierarchy. The > default is 256 MB. ># @Prompt PCI Express Base Size. >gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseSize|0x1000|UINT64|0x000f > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#81236): https://edk2.groups.io/g/devel/message/81236 Mute This Topic: https://groups.io/mt/85920589/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH V2 1/9] ArmVirtPkg/FdtClintDxe: Move FdtClientDxe to EmbeddedPkg
Looks good. I checked and you got all instances. Reviewed-By: Daniel Schaefer On 9/28/21 16:30, Abner Chang wrote: > This is one of the series patches to restructure the location of modules under > ArmVirtPkg for RiscVVirtPkg. RiscVVirtPkg leverage FDT Client protocol to > parse FDT nodes. > > Signed-off-by: Abner Chang > Cc: Ard Biesheuvel > Cc: Leif Lindholm > Cc: Sami Mujawar > Cc: Gerd Hoffmann > Cc: Daniel Schaefer > Cc: Sunil V L > --- > ArmVirtPkg/ArmVirtPkg.dec | 3 --- > EmbeddedPkg/EmbeddedPkg.dec| 1 + > ArmVirtPkg/ArmVirtCloudHv.dsc | 2 +- > ArmVirtPkg/ArmVirtKvmTool.dsc | 2 +- > ArmVirtPkg/ArmVirtQemu.dsc | 2 +- > ArmVirtPkg/ArmVirtQemuKernel.dsc | 2 +- > ArmVirtPkg/ArmVirtXen.dsc | 2 +- > EmbeddedPkg/EmbeddedPkg.dsc| 1 + > ArmVirtPkg/ArmVirtCloudHv.fdf | 2 +- > ArmVirtPkg/ArmVirtKvmTool.fdf | 2 +- > ArmVirtPkg/ArmVirtXen.fdf | 2 +- > ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc | 2 +- > ArmVirtPkg/HighMemDxe/HighMemDxe.inf | 1 + > ArmVirtPkg/Library/ArmVirtGicArchLib/ArmVirtGicArchLib.inf | 1 + > .../ArmVirtPL031FdtClientLib/ArmVirtPL031FdtClientLib.inf | 1 + > .../ArmVirtPsciResetSystemLib/ArmVirtPsciResetSystemLib.inf| 1 + > .../ArmVirtTimerFdtClientLib/ArmVirtTimerFdtClientLib.inf | 1 + > ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.inf | 1 + > .../Library/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf | 1 + > .../Library/KvmtoolRtcFdtClientLib/KvmtoolRtcFdtClientLib.inf | 1 + > ArmVirtPkg/Library/NorFlashKvmtoolLib/NorFlashKvmtoolLib.inf | 1 + > ArmVirtPkg/Library/NorFlashQemuLib/NorFlashQemuLib.inf | 1 + > ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf | 1 + > ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf | 1 + > ArmVirtPkg/XenAcpiPlatformDxe/XenAcpiPlatformDxe.inf | 1 + > ArmVirtPkg/XenioFdtDxe/XenioFdtDxe.inf | 1 + > .../Drivers}/FdtClientDxe/FdtClientDxe.inf | 1 - > {ArmVirtPkg => EmbeddedPkg}/Include/Protocol/FdtClient.h | 0 > .../Drivers}/FdtClientDxe/FdtClientDxe.c | 0 > 29 files changed, 25 insertions(+), 13 deletions(-) > rename {ArmVirtPkg => EmbeddedPkg/Drivers}/FdtClientDxe/FdtClientDxe.inf > (92%) > rename {ArmVirtPkg => EmbeddedPkg}/Include/Protocol/FdtClient.h (100%) > rename {ArmVirtPkg => EmbeddedPkg/Drivers}/FdtClientDxe/FdtClientDxe.c (100%) > > diff --git a/ArmVirtPkg/ArmVirtPkg.dec b/ArmVirtPkg/ArmVirtPkg.dec > index 4e4d758015..4e165f6cd8 100644 > --- a/ArmVirtPkg/ArmVirtPkg.dec > +++ b/ArmVirtPkg/ArmVirtPkg.dec > @@ -35,9 +35,6 @@ > >gArmVirtVariableGuid = { 0x50bea1e5, 0xa2c5, 0x46e9, { 0x9b, 0x3a, 0x59, > 0x59, 0x65, 0x16, 0xb0, 0x0a } } > > -[Protocols] > - gFdtClientProtocolGuid = { 0xE11FACA0, 0x4710, 0x4C8E, { 0xA7, 0xA2, 0x01, > 0xBA, 0xA2, 0x59, 0x1B, 0x4C } } > - > [PcdsFeatureFlag] ># ># Feature Flag PCD that defines whether TPM2 support is enabled > diff --git a/EmbeddedPkg/EmbeddedPkg.dec b/EmbeddedPkg/EmbeddedPkg.dec > index 7638de..637888e0fd 100644 > --- a/EmbeddedPkg/EmbeddedPkg.dec > +++ b/EmbeddedPkg/EmbeddedPkg.dec > @@ -79,6 +79,7 @@ >gPlatformGpioProtocolGuid = { 0x52ce9845, 0x5af4, 0x43e2, {0xba, 0xfd, > 0x23, 0x08, 0x12, 0x54, 0x7a, 0xc2 }} >gPlatformVirtualKeyboardProtocolGuid = { 0x0e3606d2, 0x1dc3, 0x4e6f, { > 0xbe, 0x65, 0x39, 0x49, 0x82, 0xa2, 0x65, 0x47 }} >gAndroidBootImgProtocolGuid = { 0x9859bb19, 0x407c, 0x4f8b, {0xbc, 0xe1, > 0xf8, 0xda, 0x65, 0x65, 0xf4, 0xa5 }} > + gFdtClientProtocolGuid = { 0xE11FACA0, 0x4710, 0x4C8E, { 0xA7, 0xA2, 0x01, > 0xBA, 0xA2, 0x59, 0x1B, 0x4C } } > > [Ppis] >gEdkiiEmbeddedGpioPpiGuid = { 0x21c3b115, 0x4e0b, 0x470c, { 0x85, 0xc7, > 0xe1, 0x05, 0xa5, 0x75, 0xc9, 0x7b }} > diff --git a/ArmVirtPkg/ArmVirtCloudHv.dsc b/ArmVirtPkg/ArmVirtCloudHv.dsc > index f292ba6079..07313e1e67 100644 > --- a/ArmVirtPkg/ArmVirtCloudHv.dsc > +++ b/ArmVirtPkg/ArmVirtCloudHv.dsc > @@ -293,7 +293,7 @@ ># Platform Driver ># >ArmVirtPkg/VirtioFdtDxe/VirtioFdtDxe.inf > - ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf > + EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.inf >ArmVirtPkg/HighMemDxe/HighMemDxe.inf >OvmfPkg/VirtioBlkDxe/VirtioBlk.inf >
[edk2-devel] Status of autogen skipping
Hi, we, as probably most users of EDK2, have a huge codebase with lots of modules. Autogen takes multiple minutes, which is unnecessary when doing a rebuild. Luckily there is `--skip-autogen` but it only works if no INF, DSC, ... file has been changed. The developer needs to know when they can call that. There seems to be a mechanism to automatically skip autogen for individual modules if they haven't been updated. However this doesn't seem to work anymore. I think the change that reverted this was the fix for: https://bugzilla.tianocore.org/show_bug.cgi?id=2978 by Bob in 3a7a6761143a4840faea0bd84daada3ac0f1bd22 Is there any plan to properly fix this? Because it would be a huge timesaver to have automatic autogen skipping. Thanks, Daniel -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#78406): https://edk2.groups.io/g/devel/message/78406 Mute This Topic: https://groups.io/mt/84546923/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH 0/6] UefiPayloadPkg: LinuxBoot Support in UefiPayload
On 7/22/21 9:44 AM, Ni, Ray wrote: Cheng-Chieh, Thanks for the detailed explanation in doc https://docs.google.com/document/d/1mU6ICHTh0ot8U45uuRENKOGI8cVzizdyWHGYHpEguVg/edit#heading=h.xzptrog8pyxf . My original thought was LinuxBoot is a payload that aims to boot OS. But the idea of chaining UefiPayload producing UEFI services is very brilliant. It can be and it is. The main usage of LinuxBoot is to load/boot another Linux using the kexec mechanism. But in order to be able to boot Windows, ESXI, ... a UEFI interface is required. There have been a few proposals and POCs (like implementing UEFI services in Linux) but UefiPayload is the most practical and easy way to do it, for now. Have you considered to produce the universal payload interfaces (https://universalpayload.github.io/documentation/ ) from LinuxBoot so no LbParseLib is required? I don't think we've looked at it. But we liked it to be a string because it allows easy forward compatibility and not having to recreate the structs in higher-level languages like Go. Thanks, Ray -Original Message- From: devel@edk2.groups.io On Behalf Of Cheng-Chieh Huang via groups.io Sent: Wednesday, July 21, 2021 9:23 PM To: devel@edk2.groups.io Cc: Cheng-Chieh Huang ; Schaefer, Daniel ; Trammell Hudson ; Ma, Maurice ; Dong, Guo ; You, Benjamin Subject: [edk2-devel] [PATCH 0/6] UefiPayloadPkg: LinuxBoot Support in UefiPayload These are necessary patches to Support LinuxBoot in UefiPayload. With these paches, we can boot to ESXi and Windows from a linux in QEMU. LinuxBoot README: https://github.com/linuxboot/edk2/blob/uefipayload/UefiPayloadPkg/README.md PR to tianocore: https://github.com/tianocore/edk2/pull/1820 Cheng-Chieh Huang (5): Add LINUXBOOT payload target Use legacy timer in Linuxboot payload Update maximum logic processor to 256 Reserve Payload config in runtime services data Add DISABLE_MMX_SSE to avoid generating floating points operation Trammell Hudson (1): LinuxBoot: use a text format for the configuration block. UefiPayloadPkg/UefiPayloadPkg.dsc | 29 +- UefiPayloadPkg/UefiPayloadPkg.fdf | 5 + .../Library/LbParseLib/LbParseLib.inf | 39 ++ UefiPayloadPkg/Include/Linuxboot.h| 58 +++ .../Library/LbParseLib/LbParseLib.c | 348 ++ .../PciHostBridgeLib/PciHostBridgeSupport.c | 6 +- .../UefiPayloadEntry/UefiPayloadEntry.c | 2 + CryptoPkg/Library/OpensslLib/openssl | 2 +- 8 files changed, 480 insertions(+), 9 deletions(-) create mode 100644 UefiPayloadPkg/Library/LbParseLib/LbParseLib.inf create mode 100644 UefiPayloadPkg/Include/Linuxboot.h create mode 100644 UefiPayloadPkg/Library/LbParseLib/LbParseLib.c Cc: Cheng-Chieh Huang Cc: Daniel Schaefer Cc: Trammell Hudson Cc: Maurice Ma Cc: Guo Dong Cc: Benjamin You -- 2.32.0.402.g57bb445576-goog -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#78049): https://edk2.groups.io/g/devel/message/78049 Mute This Topic: https://groups.io/mt/84357532/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH 1/1] MdePkg: add definition of LINUX_EFI_INITRD_MEDIA_GUID
On 7/16/21 11:56 PM, Ard Biesheuvel wrote: On Fri, 16 Jul 2021 at 17:00, Kinney, Michael D wrote: Hi Ard, I see you were involved in the OS side changes. Can you explain what is required for the FW <-> OS interface with respect to Load File Protocol and this media device path node. What happens if this media device path node is not present? What breaks? Trying to figure out if this is a required interop feature (MdePkg candidate) or an EDK II specific extension (MdeModulePkg candidate). Let me give some context first: Linux distro boot generally relies on an initial ramdisk (initrd) which is provided by the loader, and which contains additional kernel modules (for storage and netwerk, for instance), and the initial user space startup code, ie., the code which brings up the user space side of the entire OS. Before we introduced this media path, the only way for a EFI pre-OS loader (such as GRUB) to provide this initrd was to copy it into DRAM somewhere, and use a arch-specific method of passing the DRAM address and size to the OS (x86 uses struct bootparam, whereas ARM uses device tree). It also requires knowledge on the part of GRUB regarding which parts of DRAM are suitable for holding an initrd image. For measured boot scenarios, it may be an advantage not to have the initrd linger in DRAM for longer that necessary, and we actually intend to measure the initrd loaded via the new method right after it has been loaded this way. To avoid extending this to other architectures such as RISC-V, I decided to introduce a special vendor media path for Linux initrd images, which GRUB et al can implement, which provides the initrd image when the OS loader that consumes it asks for it. So for Linux on x86 or ARM, this is optional, given that support for the old method is not going away any time soon. For RISC-V, I suggested that only the new method be implemented, but I am not sure what the status is there. It's a good idea. We followed your advice and added your initrd command to our development branch of RISC-V EDK2: https://github.com/riscv/riscv-edk2-platforms/commit/534eeba0ac9b984eedc58ba1e8a2d28e2827ba40 And we're using it in our CI to test whether Linux boots: https://github.com/riscv/riscv-edk2-platforms/blob/riscv-virt-gh-actions/.github/workflows/riscv-edk2.yml#L314 Note that many embedded style systems don't use GRUB, and may not use initrds to begin with. OTOH, U-Boot also implements support for the Linux initrd vendor media path, and work is ongoing to add measured boot support as well. In any case, I don't have a strong preference where this should live, as long as it is in a generic place where all architectures can use it. -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#78011): https://edk2.groups.io/g/devel/message/78011 Mute This Topic: https://groups.io/mt/84231808/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [edk2-platforms PATCH v1 1/1] Platform/SiFive: Add VariablePolicyHelperLib to the dsc files
Thanks! Reviewed-By: Daniel Schaefer On 7/13/21 11:24 PM, Takuto Naito wrote: REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3489 Fix build error of U540 and U500 caused by BdsDxe. The edk2 patch MdeModulePkg/BdsDxe: Update BdsEntry to use Variable Policy requires VariablePolicyHelperLib, but U500.dsc and U540.dsc didn't have it in the LibraryClasses section. Cc: Abner Chang Cc: Gilbert Chen Cc: Daniel Schaefer Signed-off-by: Takuto Naito --- Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc | 1 + .../SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc | 1 + 2 files changed, 2 insertions(+) diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc index b91823ceeb..2031265806 100644 --- a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc +++ b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc @@ -99,6 +99,7 @@ SortLib|MdeModulePkg/Library/BaseSortLib/BaseSortLib.inf UefiBootManagerLib|MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf FdtLib|EmbeddedPkg/Library/FdtLib/FdtLib.inf + VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHelperLib/VariablePolicyHelperLib.inf # RISC-V Platform Library TimeBaseLib|EmbeddedPkg//Library/TimeBaseLib/TimeBaseLib.inf diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc index 0eafe29880..0262b2a909 100644 --- a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc +++ b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc @@ -99,6 +99,7 @@ SortLib|MdeModulePkg/Library/BaseSortLib/BaseSortLib.inf UefiBootManagerLib|MdeModulePkg/Library/UefiBootManagerLib/UefiBootManagerLib.inf FdtLib|EmbeddedPkg/Library/FdtLib/FdtLib.inf + VariablePolicyHelperLib|MdeModulePkg/Library/VariablePolicyHelperLib/VariablePolicyHelperLib.inf # RISC-V Platform Library TimeBaseLib|EmbeddedPkg//Library/TimeBaseLib/TimeBaseLib.inf -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#77761): https://edk2.groups.io/g/devel/message/77761 Mute This Topic: https://groups.io/mt/84180933/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH v2 0/1] MdeModulePkg: Print which PCD was unable to be found
Second version because I forgot to update HPE copyright. Signed-off-by: Daniel Schaefer Cc: Jian J Wang Cc: Hao A Wu Cc: Dandan Bi Cc: Liming Gao Daniel Schaefer (1): MdeModulePkg: Print which PCD was unable to be found MdeModulePkg/Universal/PCD/Dxe/Service.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.31.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#77759): https://edk2.groups.io/g/devel/message/77759 Mute This Topic: https://groups.io/mt/84195552/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH v2 1/1] MdeModulePkg: Print which PCD was unable to be found
When reaching the assert, it can't be debugged because the PCD is unknown. Therefore the PCD's GUID and token number should be printed. Signed-off-by: Daniel Schaefer Cc: Jian J Wang Cc: Hao A Wu Cc: Dandan Bi Cc: Liming Gao --- MdeModulePkg/Universal/PCD/Dxe/Service.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/MdeModulePkg/Universal/PCD/Dxe/Service.c b/MdeModulePkg/Universal/PCD/Dxe/Service.c index ea7edc3cbb1c..badeec8c97f0 100644 --- a/MdeModulePkg/Universal/PCD/Dxe/Service.c +++ b/MdeModulePkg/Universal/PCD/Dxe/Service.c @@ -3,7 +3,7 @@ Copyright (c) 2014, Hewlett-Packard Development Company, L.P. Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved. -(C) Copyright 2016 Hewlett Packard Enterprise Development LP +(C) Copyright 2016-2021 Hewlett Packard Enterprise Development LP SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -1610,6 +1610,7 @@ GetExPcdTokenNumber ( } } + DEBUG ((DEBUG_ERROR, "%a: Failed to find PCD with GUID: %g and token number: %d\n", __FUNCTION__, Guid, ExTokenNumber)); ASSERT (FALSE); return 0; -- 2.31.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#77758): https://edk2.groups.io/g/devel/message/77758 Mute This Topic: https://groups.io/mt/84195540/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH v1 1/1] MdeModulePkg: Print which PCD was unable to be found
When reaching the assert, it can't be debugged because the PCD is unknown. Therefore the PCD's GUID and token number should be printed. Signed-off-by: Daniel Schaefer Cc: Jian J Wang Cc: Hao A Wu Cc: Dandan Bi Cc: Liming Gao --- MdeModulePkg/Universal/PCD/Dxe/Service.c | 1 + 1 file changed, 1 insertion(+) diff --git a/MdeModulePkg/Universal/PCD/Dxe/Service.c b/MdeModulePkg/Universal/PCD/Dxe/Service.c index ea7edc3cbb1c..4e90deab8fb8 100644 --- a/MdeModulePkg/Universal/PCD/Dxe/Service.c +++ b/MdeModulePkg/Universal/PCD/Dxe/Service.c @@ -1610,6 +1610,7 @@ GetExPcdTokenNumber ( } } + DEBUG ((DEBUG_ERROR, "%a: Failed to find PCD with GUID: %g and token number: %d\n", __FUNCTION__, Guid, ExTokenNumber)); ASSERT (FALSE); return 0; -- 2.31.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#77749): https://edk2.groups.io/g/devel/message/77749 Mute This Topic: https://groups.io/mt/84186345/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH v1 1/1] RamDiskDxe: Initialize list head before registering RAM disk protocol
On 7/13/21 11:44 AM, Wu, Hao A wrote: -Original Message- From: devel@edk2.groups.io On Behalf Of Daniel Schaefer Sent: Tuesday, July 13, 2021 9:10 AM To: devel@edk2.groups.io Cc: Trammell Hudson ; Daniel Schaefer ; Wang, Jian J ; Wu, Hao A ; Ni, Ray ; Gao, Zhichao Subject: [edk2-devel] [PATCH v1 1/1] RamDiskDxe: Initialize list head before registering RAM disk protocol From: Trammell Hudson This patch initializes the linked list RegisteredRamDisks in RamDiskDxeEntryPoint before the registration of gEfiRamDiskProtocolGuid with InstallMultipleProtocolInterfaces, allowing ramdisks to be created via a callback installed with RegisterProtocolNotify as soon as the protocol is registered. Without this, calling RamDisk->Register() in the callback causes a crash: ASSERT [RamDiskDxe] MdePkg/Library/BaseLib/LinkedList.c(75): List- ForwardLink != ((void *) 0) Signed-off-by: Trammell Hudson Cc: Daniel Schaefer Cc: Jian J Wang Cc: Hao A Wu Cc: Ray Ni Cc: Zhichao Gao Thanks a lot for the fix. Reviewed-by: Hao A Wu I will modify the subject a little bit when merging: MdeModulePkg/RamDiskDxe: Init list head before registering RamDisk protocol Sure, that's good. Thanks! Best Regards, Hao Wu --- MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDriver.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDriver.c b/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDriver.c index fcbf4f117dc6..13e2aed87cef 100644 --- a/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDriver.c +++ b/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDriver.c @@ -154,6 +154,12 @@ RamDiskDxeEntryPoint ( goto ErrorExit; } + // + // Initialize the list of registered RAM disks maintained by the + driver // before installing the protocol // InitializeListHead + (); + // // Install the EFI_RAM_DISK_PROTOCOL and RAM disk private data onto a // new handle @@ -170,11 +176,6 @@ RamDiskDxeEntryPoint ( goto ErrorExit; } - // - // Initialize the list of registered RAM disks maintained by the driver - // - InitializeListHead (); - Status = EfiCreateEventReadyToBootEx ( TPL_CALLBACK, RamDiskAcpiCheck, -- 2.31.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#77745): https://edk2.groups.io/g/devel/message/77745 Mute This Topic: https://groups.io/mt/84169086/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH] BaseTools GenFw: Add support for R_RISCV_PCREL_LO12_S relocation
Looks good. I compared it with existing R_RISCV_PCREL_LO12_I and looked at the differences. This one doesn't do use mRiscVPass1GotFixup. I assume this is an optimization that's not possible here? Haven't tested that it works but since it works for Pete: Reviewed-by: Daniel Schaefer Thanks! On 7/10/21 2:31 PM, Sunil V L wrote: Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3459 This patch adds support for R_RISCV_PCREL_LO12_S relocation type. The logic is same as existing R_RISCV_PCREL_LO12_I relocation except the difference between load vs store instruction formats. Signed-off-by: Sunil V L Cc: Liming Gao Cc: Bob Feng Cc: Yuwei Chen Cc: Pete Batard Cc: Abner Chang Cc: Daniel Schaefer --- BaseTools/Source/C/GenFw/Elf64Convert.c | 55 + 1 file changed, 55 insertions(+) diff --git a/BaseTools/Source/C/GenFw/Elf64Convert.c b/BaseTools/Source/C/GenFw/Elf64Convert.c index 3d7e20aaff..0bb3ead228 100644 --- a/BaseTools/Source/C/GenFw/Elf64Convert.c +++ b/BaseTools/Source/C/GenFw/Elf64Convert.c @@ -557,6 +557,60 @@ WriteSectionRiscV64 ( Value = (UINT32)(RV_X(*(UINT32 *)mRiscVPass1Targ, 12, 20)); break; + case R_RISCV_PCREL_LO12_S: +if (mRiscVPass1Targ != NULL && mRiscVPass1Sym != NULL && mRiscVPass1SymSecIndex != 0) { + int i; + Value2 = (UINT32)(RV_X(*(UINT32 *)mRiscVPass1Targ, 12, 20)); + + Value = ((UINT32)(RV_X(*(UINT32 *)Targ, 25, 7)) << 5); + Value = (Value | (UINT32)(RV_X(*(UINT32 *)Targ, 7, 5))); + + if(Value & (RISCV_IMM_REACH/2)) { +Value |= ~(RISCV_IMM_REACH-1); + } + Value = Value - (UINT32)mRiscVPass1Sym->sh_addr + mCoffSectionsOffset[mRiscVPass1SymSecIndex]; + + if(-2048 > (INT32)Value) { +i = (((INT32)Value * -1) / 4096); +Value2 -= i; +Value += 4096 * i; +if(-2048 > (INT32)Value) { + Value2 -= 1; + Value += 4096; +} + } + else if( 2047 < (INT32)Value) { +i = (Value / 4096); +Value2 += i; +Value -= 4096 * i; +if(2047 < (INT32)Value) { + Value2 += 1; + Value -= 4096; +} + } + + // Update the IMM of SD instruction + // + // |31 25|24 20|19 15|14 12 |11 7|6 0| + // |---|---| + // |imm[11:5] | rs2 | rs1 | funct3 |imm[4:0] | opcode| + // --- + + // First Zero out current IMM + *(UINT32 *)Targ &= ~0xfe000f80; + + // Update with new IMM + *(UINT32 *)Targ |= (RV_X(Value, 5, 7) << 25); + *(UINT32 *)Targ |= (RV_X(Value, 0, 5) << 7); + + // Update previous instruction + *(UINT32 *)mRiscVPass1Targ = (RV_X(Value2, 0, 20)<<12) | (RV_X(*(UINT32 *)mRiscVPass1Targ, 0, 12)); +} +mRiscVPass1Sym = NULL; +mRiscVPass1Targ = NULL; +mRiscVPass1SymSecIndex = 0; +break; + case R_RISCV_PCREL_LO12_I: if (mRiscVPass1Targ != NULL && mRiscVPass1Sym != NULL && mRiscVPass1SymSecIndex != 0) { int i; @@ -1587,6 +1641,7 @@ WriteRelocations64 ( case R_RISCV_PCREL_HI20: case R_RISCV_GOT_HI20: case R_RISCV_PCREL_LO12_I: +case R_RISCV_PCREL_LO12_S: break; default: -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#77744): https://edk2.groups.io/g/devel/message/77744 Mute This Topic: https://groups.io/mt/84108362/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH v1 1/1] RamDiskDxe: Initialize list head before registering RAM disk protocol
From: Trammell Hudson This patch initializes the linked list RegisteredRamDisks in RamDiskDxeEntryPoint before the registration of gEfiRamDiskProtocolGuid with InstallMultipleProtocolInterfaces, allowing ramdisks to be created via a callback installed with RegisterProtocolNotify as soon as the protocol is registered. Without this, calling RamDisk->Register() in the callback causes a crash: ASSERT [RamDiskDxe] MdePkg/Library/BaseLib/LinkedList.c(75): List->ForwardLink != ((void *) 0) Signed-off-by: Trammell Hudson Cc: Daniel Schaefer Cc: Jian J Wang Cc: Hao A Wu Cc: Ray Ni Cc: Zhichao Gao --- MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDriver.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDriver.c b/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDriver.c index fcbf4f117dc6..13e2aed87cef 100644 --- a/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDriver.c +++ b/MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDriver.c @@ -154,6 +154,12 @@ RamDiskDxeEntryPoint ( goto ErrorExit; } + // + // Initialize the list of registered RAM disks maintained by the driver + // before installing the protocol + // + InitializeListHead (); + // // Install the EFI_RAM_DISK_PROTOCOL and RAM disk private data onto a // new handle @@ -170,11 +176,6 @@ RamDiskDxeEntryPoint ( goto ErrorExit; } - // - // Initialize the list of registered RAM disks maintained by the driver - // - InitializeListHead (); - Status = EfiCreateEventReadyToBootEx ( TPL_CALLBACK, RamDiskAcpiCheck, -- 2.31.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#77723): https://edk2.groups.io/g/devel/message/77723 Mute This Topic: https://groups.io/mt/84169086/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH v1 0/1] RamDiskDxe: Initialize list head before registering RAM disk protocol
Sending this patch on behalf of Trammell, who asked me to do so, so that he doesn't have to set up git-send-email config. See his PR: https://github.com/tianocore/edk2/pull/1810 Trammell Hudson (1): RamDiskDxe: initialize list head before registering ram disk protocol MdeModulePkg/Universal/Disk/RamDiskDxe/RamDiskDriver.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) Cc: Daniel Schaefer Cc: Trammell Hudson Cc: Jian J Wang Cc: Hao A Wu Cc: Ray Ni Cc: Zhichao Gao -- 2.31.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#77722): https://edk2.groups.io/g/devel/message/77722 Mute This Topic: https://groups.io/mt/84169073/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [edk2-platforms PATCH v4 11/12] RISC-V Platforms: add SecureBootVariableLib class resolution
Reviewed-by: Daniel Schaefer From: devel@edk2.groups.io on behalf of Abner Chang Sent: Thursday, July 1, 2021 11:50 To: devel@edk2.groups.io ; g...@semihalf.com Cc: l...@nuviainc.com ; ardb+tianoc...@kernel.org ; samer.el-haj-mahm...@arm.com ; sunny.w...@arm.com ; m...@semihalf.com ; upstr...@semihalf.com ; jiewen@intel.com ; jian.j.w...@intel.com ; min.m...@intel.com ; ler...@redhat.com ; sami.muja...@arm.com ; af...@apple.com ; ray...@intel.com ; jordan.l.jus...@intel.com ; rebe...@bsdio.com ; gre...@freebsd.org ; thomas.abra...@arm.com ; chasel.c...@intel.com ; nathaniel.l.desim...@intel.com ; gaolim...@byosoft.com.cn ; eric.d...@intel.com ; michael.d.kin...@intel.com ; zailiang@intel.com ; yi.q...@intel.com ; gra...@nuviainc.com ; r...@semihalf.com ; p...@akeo.ie Subject: Re: [edk2-devel] [edk2-platforms PATCH v4 11/12] RISC-V Platforms: add SecureBootVariableLib class resolution Reviewed-by: Abner Chang > -Original Message- > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of > Grzegorz Bernacki > Sent: Wednesday, June 30, 2021 8:34 PM > To: devel@edk2.groups.io > Cc: l...@nuviainc.com; ardb+tianoc...@kernel.org; Samer.El-Haj- > mahm...@arm.com; sunny.w...@arm.com; m...@semihalf.com; > upstr...@semihalf.com; jiewen@intel.com; jian.j.w...@intel.com; > min.m...@intel.com; ler...@redhat.com; sami.muja...@arm.com; > af...@apple.com; ray...@intel.com; jordan.l.jus...@intel.com; > rebe...@bsdio.com; gre...@freebsd.org; thomas.abra...@arm.com; > chasel.c...@intel.com; nathaniel.l.desim...@intel.com; > gaolim...@byosoft.com.cn; eric.d...@intel.com; > michael.d.kin...@intel.com; zailiang@intel.com; yi.q...@intel.com; > gra...@nuviainc.com; r...@semihalf.com; p...@akeo.ie; Grzegorz > Bernacki > Subject: [edk2-devel] [edk2-platforms PATCH v4 11/12] RISC-V Platforms: > add SecureBootVariableLib class resolution > > The edk2 patch > SecurityPkg: Create library for setting Secure Boot variables. > > removes generic functions from SecureBootConfigDxe and places > them into SecureBootVariableLib. This patch adds SecureBootVariableLib > mapping for each RICS-V platform which uses SecureBootConfigDxe. > > Signed-off-by: Grzegorz Bernacki > --- > Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc | 1 + > > Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.dsc > | 1 + > 2 files changed, 2 insertions(+) > > diff --git a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc > b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc > index b91823ceeb..fc5ba2a07f 100644 > --- a/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc > +++ b/Platform/SiFive/U5SeriesPkg/FreedomU500VC707Board/U500.dsc > @@ -122,6 +122,7 @@ >OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf > > TpmMeasurementLib|SecurityPkg/Library/DxeTpmMeasurementLib/DxeTp > mMeasurementLib.inf >AuthVariableLib|SecurityPkg/Library/AuthVariableLib/AuthVariableLib.inf > + > SecureBootVariableLib|SecurityPkg/Library/SecureBootVariableLib/SecureB > ootVariableLib.inf > !else > > TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/Tp > mMeasurementLibNull.inf > > AuthVariableLib|MdeModulePkg/Library/AuthVariableLibNull/AuthVariableL > ibNull.inf > diff --git > a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.d > sc > b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540. > dsc > index 0eafe29880..71add8ff9a 100644 > --- > a/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540.d > sc > +++ > b/Platform/SiFive/U5SeriesPkg/FreedomU540HiFiveUnleashedBoard/U540. > dsc > @@ -122,6 +122,7 @@ >OpensslLib|CryptoPkg/Library/OpensslLib/OpensslLib.inf > > TpmMeasurementLib|SecurityPkg/Library/DxeTpmMeasurementLib/DxeTp > mMeasurementLib.inf >AuthVariableLib|SecurityPkg/Library/AuthVariableLib/AuthVariableLib.inf > + > SecureBootVariableLib|SecurityPkg/Library/SecureBootVariableLib/SecureB > ootVariableLib.inf > !else > > TpmMeasurementLib|MdeModulePkg/Library/TpmMeasurementLibNull/Tp > mMeasurementLibNull.inf > > AuthVariableLib|MdeModulePkg/Library/AuthVariableLibNull/AuthVariableL > ibNull.inf > -- > 2.25.1 > > > > > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#77388): https://edk2.groups.io/g/devel/message/77388 Mute This Topic: https://groups.io/mt/83891041/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [RESEND PATCH v2] BaseTools: Add support for RISCV GOT/PLT relocations
Great commit message, thanks Sunil! Maintainers, please take a look and let us know if there's any other concern. This patch lets us build the RISC-V platforms using modern toolchains that are provided directly by the distributions, rather than building your own from source. Thanks, Daniel From: Sunil V L Sent: Friday, June 11, 2021 22:08 To: devel@edk2.groups.io Cc: Chang, Abner (HPS SW/FW Technologist) ; Schaefer, Daniel ; Bob Feng ; Liming Gao ; Yuwei Chen ; Heinrich Schuchardt Subject: Re: [RESEND PATCH v2] BaseTools: Add support for RISCV GOT/PLT relocations Hi, I just edited the commit message to indicate the module and CC the maintainers. Could I get the feedback please? Thanks Sunil On Fri, Jun 11, 2021 at 07:35:03PM +0530, Sunil V L wrote: > Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3096 > > This patch adds support for R_RISCV_CALL_PLT and R_RISCV_GOT_HI20 > relocations generated by PIE enabled compiler. This also needed > changes to R_RISCV_32 and R_RISCV_64 relocations as explained in > https://github.com/riscv/riscv-gnu-toolchain/issues/905#issuecomment-846682710 > > Changes in v2: > - Addressed Daniel's comment on formatting > > Testing: > 1) Debian GCC 8.3.0 and booted sifive_u and QMEU virt models. > 2) Debian 10.2.0 and booted QEMU virt model. > 3) riscv-gnu-tool chain 9.2 and booted QEMU virt model. > > Signed-off-by: Sunil V L > > Acked-by: Abner Chang > Reviewed-by: Daniel Schaefer > Tested-by: > > Cc: Bob Feng > Cc: Liming Gao > Cc: Yuwei Chen > Cc: Heinrich Schuchardt > --- > BaseTools/Source/C/GenFw/Elf64Convert.c | 44 + > 1 file changed, 38 insertions(+), 6 deletions(-) > > diff --git a/BaseTools/Source/C/GenFw/Elf64Convert.c > b/BaseTools/Source/C/GenFw/Elf64Convert.c > index d097db8632..d684318269 100644 > --- a/BaseTools/Source/C/GenFw/Elf64Convert.c > +++ b/BaseTools/Source/C/GenFw/Elf64Convert.c > @@ -129,6 +129,8 @@ STATIC UINT32 mDebugOffset; > STATIC UINT8 *mRiscVPass1Targ = NULL; > STATIC Elf_Shdr*mRiscVPass1Sym = NULL; > STATIC Elf64_Half mRiscVPass1SymSecIndex = 0; > +STATIC INT32 mRiscVPass1Offset; > +STATIC INT32 mRiscVPass1GotFixup; > > // > // Initialization Function > @@ -479,11 +481,11 @@ WriteSectionRiscV64 ( > break; > >case R_RISCV_32: > -*(UINT32 *)Targ = (UINT32)((UINT64)(*(UINT32 *)Targ) - SymShdr->sh_addr > + mCoffSectionsOffset[Sym->st_shndx]); > +*(UINT64 *)Targ = Sym->st_value + Rel->r_addend; > break; > >case R_RISCV_64: > -*(UINT64 *)Targ = *(UINT64 *)Targ - SymShdr->sh_addr + > mCoffSectionsOffset[Sym->st_shndx]; > +*(UINT64 *)Targ = Sym->st_value + Rel->r_addend; > break; > >case R_RISCV_HI20: > @@ -533,6 +535,18 @@ WriteSectionRiscV64 ( > mRiscVPass1SymSecIndex = 0; > break; > > + case R_RISCV_GOT_HI20: > +Value = (Sym->st_value - Rel->r_offset); > +mRiscVPass1Offset = RV_X(Value, 0, 12); > +Value = RV_X(Value, 12, 20); > +*(UINT32 *)Targ = (Value << 12) | (RV_X(*(UINT32*)Targ, 0, 12)); > + > +mRiscVPass1Targ = Targ; > +mRiscVPass1Sym = SymShdr; > +mRiscVPass1SymSecIndex = Sym->st_shndx; > +mRiscVPass1GotFixup = 1; > +break; > + >case R_RISCV_PCREL_HI20: > mRiscVPass1Targ = Targ; > mRiscVPass1Sym = SymShdr; > @@ -545,11 +559,17 @@ WriteSectionRiscV64 ( > if (mRiscVPass1Targ != NULL && mRiscVPass1Sym != NULL && > mRiscVPass1SymSecIndex != 0) { >int i; >Value2 = (UINT32)(RV_X(*(UINT32 *)mRiscVPass1Targ, 12, 20)); > - Value = (UINT32)(RV_X(*(UINT32 *)Targ, 20, 12)); > - if(Value & (RISCV_IMM_REACH/2)) { > -Value |= ~(RISCV_IMM_REACH-1); > + > + if(mRiscVPass1GotFixup) { > +Value = (UINT32)(mRiscVPass1Offset); > + } else { > +Value = (UINT32)(RV_X(*(UINT32 *)Targ, 20, 12)); > +if(Value & (RISCV_IMM_REACH/2)) { > + Value |= ~(RISCV_IMM_REACH-1); > +} >} >Value = Value - (UINT32)mRiscVPass1Sym->sh_addr + > mCoffSectionsOffset[mRiscVPass1SymSecIndex]; > + >if(-2048 > (INT32)Value) { > i = (((INT32)Value * -1) / 4096); > Value2 -= i; > @@ -569,12 +589,21 @@ WriteSectionRiscV64 ( > } >} > > - *(UINT32 *)Targ = (RV_X(Value, 0, 12) << 20) | (RV_X(*(UINT32*)Targ, > 0, 20)); > + if(mRiscVPass1GotFixup) { > +*(UINT32 *)Targ = (RV_X((UINT32)Value, 0, 12) << 20) > +| (RV_X(*(UINT32*)Targ, 0, 20)); > +/* Convert LD instruction
Re: 回复: 回复: 回复: [edk2-devel] [PATCH v1 1/1] Add MemoryFence implementation for RiscV64
an you add customizations. Okay, I understand and agree. We'll think about all of the Arm modules and libraries we're currently using, how to move those and send an RFC soon. We have not encountered any other issues, other than this change, when using the Arm code. Regarding the processor type macros, I believe Mike recently introduced ISA-independent macros, for expressing 64-bit vs. 32-bit. I'm not exactly sure about the details, but I think we now have a macro under MdePkg that says "64-bit processor" without having to state AARCH64 or RISCV64. I found some at CryptoPkg/Library/Include/CrtLibSupport.h and RedfishPkg/PrivateInclude/Library/RedfishCrtLib.h called SIXTY_FOUR_BIT and THIRTY_TWO_BIT. Not sure if they are for general consumption? It seems that Mike suggests those to be defined in the platform's DSC? See d0bf83e1cca Thanks Laszlo Thanks Liming 发件人: devel@edk2.groups.io 代表 Daniel Schaefer 发送时间: 2021年5月21日 20:46 收件人: devel@edk2.groups.io; gaolim...@byosoft.com.cn 抄送: Chang, Abner (HPS SW/FW Technologist) ; 'Michael D Kinney' ; 'Zhiguang Liu' ; 'Leif Lindholm' 主题: Re: 回复: [edk2-devel] [PATCH v1 1/1] Add MemoryFence implementation for RiscV64 It's not required to go into that tag. We need two more patches that we haven't submitted yet to boot on Qemu. Would it be okay if we used a library from ArmVirtPkg for RISCV64? See: https://github.com/riscv/riscv-edk2/commit/8c7960ef860c65f2646912c3dcc bb308a 98e0cc3 Or does it have to be moved to some other place first? _ From: devel@edk2.groups.io <mailto:devel@edk2.groups.io> mailto:devel@edk2.groups.io> > on behalf of gaoliming mailto:gaolim...@byosoft.com.cn> > Sent: Friday, May 21, 2021 14:35 To: devel@edk2.groups.io <mailto:devel@edk2.groups.io> mailto:devel@edk2.groups.io> >; Schaefer, Daniel mailto:daniel.schae...@hpe.com> > Cc: Chang, Abner (HPS SW/FW Technologist) mailto:abner.ch...@hpe.com> >; 'Michael D Kinney' mailto:michael.d.kin...@intel.com> >; 'Zhiguang Liu' mailto:zhiguang@intel.com> >; 'Leif Lindholm' mailto:l...@nuviainc.com> > Subject: 回复: 回复: [edk2-devel] [PATCH v1 1/1] Add MemoryFence implementation for RiscV64 Daniel: Thanks for your information. Acked-by: Liming Gao <mailto:gaolim...@byosoft.com.cn> > And, do you request to merge this patch for edk2 stable tag 202105? Thanks Liming 发件人: devel@edk2.groups.io <mailto:devel@edk2.groups.io> mailto:devel@edk2.groups.io> > 代表 Daniel Schaefer 发送时间: 2021年5月21日 13:27 收件人: devel@edk2.groups.io <mailto:devel@edk2.groups.io> ; gaolim...@byosoft.com.cn <mailto:gaolim...@byosoft.com.cn> 抄送: Chang, Abner (HPS SW/FW Technologist) mailto:abner.ch...@hpe.com> >; 'Michael D Kinney' mailto:michael.d.kin...@intel.com> >; 'Zhiguang Liu' mailto:zhiguang@intel.com> >; 'Leif Lindholm' mailto:l...@nuviainc.com> > 主题: Re: 回复: [edk2-devel] [PATCH v1 1/1] Add MemoryFence implementation for RiscV64 Great! It is verified I can boot Linux from a virtio ESP using this patch on QEMU virt machine. See: https://github.com/riscv/riscv-edk2-platforms/runs/2618819010?check_suite _fo cus=true Thanks, Daniel _ From: devel@edk2.groups.io <mailto:devel@edk2.groups.io> mailto:devel@edk2.groups.io> > on behalf of gaoliming mailto:gaolim...@byosoft.com.cn> > Sent: Friday, May 21, 2021 13:14 To: devel@edk2.groups.io <mailto:devel@edk2.groups.io> mailto:devel@edk2.groups.io> >; Schaefer, Daniel mailto:daniel.schae...@hpe.com> > Cc: Chang, Abner (HPS SW/FW Technologist) mailto:abner.ch...@hpe.com> >; 'Michael D Kinney' mailto:michael.d.kin...@intel.com> >; 'Zhiguang Liu' mailto:zhiguang@intel.com> >; 'Leif Lindholm' mailto:l...@nuviainc.com> > Subject: 回复: 回复: [edk2-devel] [PATCH v1 1/1] Add MemoryFence implementation for RiscV64 Daniel: Now, it is clear to me. So, I suggest to merge this change when it is verified on generic RISC-V QEMU virt machine. Is it OK? Thanks Liming -邮件原件- 发件人: devel@edk2.groups.io <mailto:devel@edk2.groups.io> mailto:devel@edk2.groups.io> > 代表 Daniel Schaefer 发送时间: 2021年5月18日 10:35 收件人: devel@edk2.groups.io <mailto:devel@edk2.groups.io> ; gaolim...@byosoft.com.cn <mailto:gaolim...@byosoft.com.cn> 抄送: 'Abner Chang' <mailto:abner.ch...@hpe.com> >; 'Michael D Kinney' mailto:michael.d.kin...@intel.com> >; 'Zhiguang Liu' mailto:zhiguang@intel.com> >; 'Leif Lindholm' mailto:l...@nuviainc.com> > 主题: Re: 回复: [edk2-devel] [PATCH v1 1/1] Add MemoryFence implementation for RiscV64 On 5/18/21 9:04 AM, gaoliming wrote: Daniel: Seemly, this API is missing in BaseLib for RiscV64 arch. How do you detect this issue? What do you mean it's missing? Yes MemoryFence() for RiscV64 is missing currently, that's why I'm adding it here. Maybe you mea
Re: [edk2-devel] [PATCH] Add support for RISCV GOT/PLT relocations
On 5/28/21 12:42 PM, Heinrich Schuchardt wrote: Am 27. Mai 2021 16:41:13 MESZ schrieb Sunil V L : Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3096 This patch adds support for R_RISCV_CALL_PLT and R_RISCV_GOT_HI20 relocations. gnu-efi tries to avoid GOT based relocations on ARM using #if defined(__GNUC__) && !__STDC_HOSTED__ #pragma GCC visibility push (hidden) #endif Maybe this is something we should additionally explore. That's an interesting idea. I see they put this in the header that's imported by everything. I tried to put it in BaseTools/Source/C/Include/RiscV64/ProcessorBind.h where we define the EDK2 types and I still get errors like this: WriteSections64(): /Build/RiscvVirt/DEBUG_GCC5/RISCV64/MdeModulePkg/Bus/Pci/EhciDxe/EhciDxe/DEBUG/EhciDxe.dll unsupported ELF EM_RISCV64 relocation 0x13. WriteSections64(): /Build/RiscvVirt/DEBUG_GCC5/RISCV64/MdeModulePkg/Bus/Usb/UsbKbDxe/UsbKbDxe/DEBUG/UsbKbDxe.dll unsupported ELF EM_RISCV64 relocation 0x14. GenFw: ERROR 3000: Invalid Perhaps something else, a compiler flag, is needed? This patch isn't just about GOT though. Sunil also found mistakes in some other relocation types that cause issues with newer GCC toolchains. So it's needed either way. More context for the others: Currently we've been using an old toolchain from 2018 and people had to download our precompiled binaries or build it from a specific commit. Now with these patches they can just use their distribution's riscv64 toolchain and compile edk2 with it. At least Debian and Fedora ship them. Best regards Heinrich Signed-off-by: Sunil V L Cc: Abner Chang Cc: Daniel Schaefer Cc: Heinrich Schuchardt --- BaseTools/Source/C/GenFw/Elf64Convert.c | 45 + 1 file changed, 39 insertions(+), 6 deletions(-) diff --git a/BaseTools/Source/C/GenFw/Elf64Convert.c b/BaseTools/Source/C/GenFw/Elf64Convert.c index d097db8632..d05dcf9992 100644 --- a/BaseTools/Source/C/GenFw/Elf64Convert.c +++ b/BaseTools/Source/C/GenFw/Elf64Convert.c @@ -129,6 +129,8 @@ STATIC UINT32 mDebugOffset; STATIC UINT8 *mRiscVPass1Targ = NULL;> STATIC Elf_Shdr*mRiscVPass1Sym = NULL;> STATIC Elf64_Half mRiscVPass1SymSecIndex = 0;> +STATIC INT32 mRiscVPass1Offset;> +STATIC INT32 mRiscVPass1GotFixup;> //> // Initialization Function> @@ -479,11 +481,11 @@ WriteSectionRiscV64 ( break;> case R_RISCV_32:> -*(UINT32 *)Targ = (UINT32)((UINT64)(*(UINT32 *)Targ) - SymShdr->sh_addr + mCoffSectionsOffset[Sym->st_shndx]);> +*(UINT64 *)Targ = Sym->st_value + Rel->r_addend;> break;> case R_RISCV_64:> -*(UINT64 *)Targ = *(UINT64 *)Targ - SymShdr->sh_addr + mCoffSectionsOffset[Sym->st_shndx];> +*(UINT64 *)Targ = Sym->st_value + Rel->r_addend;> break;> case R_RISCV_HI20:> @@ -533,6 +535,18 @@ WriteSectionRiscV64 ( mRiscVPass1SymSecIndex = 0;> break;> + case R_RISCV_GOT_HI20:> +Value = (Sym->st_value - Rel->r_offset);> +mRiscVPass1Offset = RV_X(Value, 0, 12);> +Value = RV_X(Value, 12, 20);> +*(UINT32 *)Targ = (Value << 12) | (RV_X(*(UINT32*)Targ, 0, 12));> +> +mRiscVPass1Targ = Targ;> +mRiscVPass1Sym = SymShdr;> +mRiscVPass1SymSecIndex = Sym->st_shndx;> +mRiscVPass1GotFixup = 1;> +break;> +> case R_RISCV_PCREL_HI20:> mRiscVPass1Targ = Targ;> mRiscVPass1Sym = SymShdr;> @@ -545,11 +559,17 @@ WriteSectionRiscV64 ( if (mRiscVPass1Targ != NULL && mRiscVPass1Sym != NULL && mRiscVPass1SymSecIndex != 0) {> int i;> Value2 = (UINT32)(RV_X(*(UINT32 *)mRiscVPass1Targ, 12, 20));> - Value = (UINT32)(RV_X(*(UINT32 *)Targ, 20, 12));> - if(Value & (RISCV_IMM_REACH/2)) {> -Value |= ~(RISCV_IMM_REACH-1);> +> + if(mRiscVPass1GotFixup) {> +Value = (UINT32)(mRiscVPass1Offset);> + } else {> +Value = (UINT32)(RV_X(*(UINT32 *)Targ, 20, 12));> +if(Value & (RISCV_IMM_REACH/2)) {> + Value |= ~(RISCV_IMM_REACH-1);> +}> }> Value = Value - (UINT32)mRiscVPass1Sym->sh_addr + mCoffSectionsOffset[mRiscVPass1SymSecIndex];> +> if(-2048 > (INT32)Value) {> i = (((INT32)Value * -1) / 4096);> Value2 -= i;> @@ -569,12 +589,22 @@ WriteSectionRiscV64 ( }> }> - *(UINT32 *)Targ = (RV_X(Value, 0, 12) << 20) | (RV_X(*(UINT32*)Targ, 0, 20));> + if(mRiscVPass1GotFixup) {> +*(UINT32 *)Targ = (RV_X((UINT32)Value, 0, 12) << 20)> +| (RV_X(*(UINT32*)Targ, 0, 20));> +/* Convert LD instruction to ADDI */> +*(UINT32 *)Targ = ((*(UINT32 *)Targ & ~0x707f) | 0x13);> + }> + else {> +*(U
Re: [edk2-devel] [PATCH] Add support for RISCV GOT/PLT relocations
+Maintainers and Reviewers of BaseTools See my reply below. On 5/27/21 10:41 PM, Sunil V L wrote: Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=3096 This patch adds support for R_RISCV_CALL_PLT and R_RISCV_GOT_HI20 relocations. Signed-off-by: Sunil V L Cc: Abner Chang Cc: Daniel Schaefer Cc: Heinrich Schuchardt --- BaseTools/Source/C/GenFw/Elf64Convert.c | 45 + 1 file changed, 39 insertions(+), 6 deletions(-) diff --git a/BaseTools/Source/C/GenFw/Elf64Convert.c b/BaseTools/Source/C/GenFw/Elf64Convert.c index d097db8632..d05dcf9992 100644 --- a/BaseTools/Source/C/GenFw/Elf64Convert.c +++ b/BaseTools/Source/C/GenFw/Elf64Convert.c @@ -129,6 +129,8 @@ STATIC UINT32 mDebugOffset; STATIC UINT8 *mRiscVPass1Targ = NULL; STATIC Elf_Shdr*mRiscVPass1Sym = NULL; STATIC Elf64_Half mRiscVPass1SymSecIndex = 0; +STATIC INT32 mRiscVPass1Offset; +STATIC INT32 mRiscVPass1GotFixup; // // Initialization Function @@ -479,11 +481,11 @@ WriteSectionRiscV64 ( break; case R_RISCV_32: -*(UINT32 *)Targ = (UINT32)((UINT64)(*(UINT32 *)Targ) - SymShdr->sh_addr + mCoffSectionsOffset[Sym->st_shndx]); +*(UINT64 *)Targ = Sym->st_value + Rel->r_addend; break; case R_RISCV_64: -*(UINT64 *)Targ = *(UINT64 *)Targ - SymShdr->sh_addr + mCoffSectionsOffset[Sym->st_shndx]; +*(UINT64 *)Targ = Sym->st_value + Rel->r_addend; break; case R_RISCV_HI20: @@ -533,6 +535,18 @@ WriteSectionRiscV64 ( mRiscVPass1SymSecIndex = 0; break; + case R_RISCV_GOT_HI20: +Value = (Sym->st_value - Rel->r_offset); +mRiscVPass1Offset = RV_X(Value, 0, 12); +Value = RV_X(Value, 12, 20); +*(UINT32 *)Targ = (Value << 12) | (RV_X(*(UINT32*)Targ, 0, 12)); + +mRiscVPass1Targ = Targ; +mRiscVPass1Sym = SymShdr; +mRiscVPass1SymSecIndex = Sym->st_shndx; +mRiscVPass1GotFixup = 1; +break; + case R_RISCV_PCREL_HI20: mRiscVPass1Targ = Targ; mRiscVPass1Sym = SymShdr; @@ -545,11 +559,17 @@ WriteSectionRiscV64 ( if (mRiscVPass1Targ != NULL && mRiscVPass1Sym != NULL && mRiscVPass1SymSecIndex != 0) { int i; Value2 = (UINT32)(RV_X(*(UINT32 *)mRiscVPass1Targ, 12, 20)); - Value = (UINT32)(RV_X(*(UINT32 *)Targ, 20, 12)); - if(Value & (RISCV_IMM_REACH/2)) { -Value |= ~(RISCV_IMM_REACH-1); + + if(mRiscVPass1GotFixup) { +Value = (UINT32)(mRiscVPass1Offset); + } else { +Value = (UINT32)(RV_X(*(UINT32 *)Targ, 20, 12)); +if(Value & (RISCV_IMM_REACH/2)) { + Value |= ~(RISCV_IMM_REACH-1); +} } Value = Value - (UINT32)mRiscVPass1Sym->sh_addr + mCoffSectionsOffset[mRiscVPass1SymSecIndex]; + if(-2048 > (INT32)Value) { i = (((INT32)Value * -1) / 4096); Value2 -= i; @@ -569,12 +589,22 @@ WriteSectionRiscV64 ( } } - *(UINT32 *)Targ = (RV_X(Value, 0, 12) << 20) | (RV_X(*(UINT32*)Targ, 0, 20)); + if(mRiscVPass1GotFixup) { +*(UINT32 *)Targ = (RV_X((UINT32)Value, 0, 12) << 20) +| (RV_X(*(UINT32*)Targ, 0, 20)); +/* Convert LD instruction to ADDI */ +*(UINT32 *)Targ = ((*(UINT32 *)Targ & ~0x707f) | 0x13); + } + else { else should be on the line before, like } else { +*(UINT32 *)Targ = (RV_X(Value, 0, 12) << 20) | (RV_X(*(UINT32*)Targ, 0, 20)); + } *(UINT32 *)mRiscVPass1Targ = (RV_X(Value2, 0, 20)<<12) | (RV_X(*(UINT32 *)mRiscVPass1Targ, 0, 12)); } mRiscVPass1Sym = NULL; mRiscVPass1Targ = NULL; mRiscVPass1SymSecIndex = 0; +mRiscVPass1Offset = 0; +mRiscVPass1GotFixup = 0; break; case R_RISCV_ADD64: @@ -586,6 +616,7 @@ WriteSectionRiscV64 ( case R_RISCV_GPREL_I: case R_RISCV_GPREL_S: case R_RISCV_CALL: + case R_RISCV_CALL_PLT: case R_RISCV_RVC_BRANCH: case R_RISCV_RVC_JUMP: case R_RISCV_RELAX: @@ -1528,6 +1559,7 @@ WriteRelocations64 ( case R_RISCV_GPREL_I: case R_RISCV_GPREL_S: case R_RISCV_CALL: +case R_RISCV_CALL_PLT: case R_RISCV_RVC_BRANCH: case R_RISCV_RVC_JUMP: case R_RISCV_RELAX: @@ -1537,6 +1569,7 @@ WriteRelocations64 ( case R_RISCV_SET16: case R_RISCV_SET32: case R_RISCV_PCREL_HI20: +case R_RISCV_GOT_HI20: case R_RISCV_PCREL_LO12_I: break; Just one minor nit-pick on the formatting. Well in my email program the indentation is off, it looks fine on GitHub though. Probably an issue with the displaying on my end. https://github.com/vlsunil/riscv-edk2/commit/a742fab0d73ab568aa2d2578a5ccfc400ffd2fa5 Reviewed-by: Daniel Schaefer Tested with GCC 8.3.0 on Debian Buster. Can boot -machine sifive_u
Re: 回复: [edk2-devel] Generic MinPlatform
I had a closer look at the MinPlatform specification and I made a TODO list: https://github.com/riscv/riscv-edk2-platforms/issues/24 Mostly I just have to: * reorganize and split the FVs to fit the spec * use the include files to ensure that they contain the correct modules * switch to the MinPlatform PCDs instead of the ones that I currently use (for PreMemRamBase for example) * make sure the test functions to validate the stages are included and run The tasks for x86 QEMU/OVMF should be the same. Doesn't look too scary. Since there are these test functions, is there a way to test compliance with the spec? From: devel@edk2.groups.io on behalf of Daniel Schaefer Sent: Tuesday, May 25, 2021 02:59 To: devel@edk2.groups.io ; gaolim...@byosoft.com.cn ; kaaira7...@gmail.com ; Ni, Ray ; mikub...@linux.microsoft.com ; isaac.w.o...@intel.com Cc: Chang, Abner (HPS SW/FW Technologist) Subject: Re: 回复: [edk2-devel] Generic MinPlatform * * Rather than commenting out things you don’t need in the build, our thinking was to allow some unnecessary building in the interest of reducing porting complexity. It doesn’t really matter if you don’t need the PciCf8 library as long as it builds fine. * If you need the PciLib|MdePkg/Library/BasePciLibPciExpress/BasePciLibPciExpress.inf Instead of the PciLib|MdePkg/Library/BasePciLibCf8/BasePciLibCf8.inf, you can just override it in your DSC file after you have included the CoreCommonLib.dsc. This is to reduce the number of includes that a typical board port needs to deal with correctly, but allow fine tuning and optimization later. Hm, you're right. However I added another PCD to exclude things that RISC-V and many other non-x86 platforms don't have: SMM, port-mapped I/O, PC/AT architecture: https://github.com/riscv/riscv-edk2-platforms/commit/cbec8681916fe2f4276118198a6d315fd06c75d3 Then I have two more issues unrelated to RISC-V: https://github.com/riscv/riscv-edk2-platforms/commit/b68f4587fc28588b4474ff15d43918182c33b4b7 And some related to RISC-V: https://github.com/riscv/riscv-edk2-platforms/commit/579705cf46dafc90e4a2bc243e5aa5cd828cb126 And what's most relevant to Kaaira, the commit to make my QEMU platform use MinPlatform include files: https://github.com/riscv/riscv-edk2-platforms/commit/54542812912079d6855e2be4186cb8a6978edac6 Add more MinPlatform Arch defined feature flags for PCI, SMM, etc. Yes, absolutely. As above, for now I created one for common x86 concepts. But there should probably be one for PCI and USB should move to AdvancedFeatures, like you said. The other two RISC-V platforms I'm working on don't have PCI and one of them doesn't have USB. Add “Core System Design” includes. E.G. one for x86, one for QEMU, one for RISKV, etc. I am not sure how many of these we would need. Right, that's a good idea. Kaaira and me can create one for QEMU with all of the virtio drivers. And those for x86 and RISC-V wouldn't actually too big, as you can see in my change. RISC-V needs even less special modules. Thanks, Daniel From: devel@edk2.groups.io on behalf of Oram, Isaac W Sent: Friday, May 21, 2021 11:38 To: Schaefer, Daniel ; devel@edk2.groups.io ; gaolim...@byosoft.com.cn ; kaaira7...@gmail.com ; Ni, Ray ; mikub...@linux.microsoft.com Cc: Chang, Abner (HPS SW/FW Technologist) Subject: Re: 回复: [edk2-devel] GSoC 2021 Qemu OpenBoardPkg Project I think we should patch first and move to a common location later. Looking at some of your changes and comments, I have these comments: * Rather than commenting out things you don’t need in the build, our thinking was to allow some unnecessary building in the interest of reducing porting complexity. It doesn’t really matter if you don’t need the PciCf8 library as long as it builds fine. * If you need the PciLib|MdePkg/Library/BasePciLibPciExpress/BasePciLibPciExpress.inf Instead of the PciLib|MdePkg/Library/BasePciLibCf8/BasePciLibCf8.inf, you can just override it in your DSC file after you have included the CoreCommonLib.dsc. This is to reduce the number of includes that a typical board port needs to deal with correctly, but allow fine tuning and optimization later. * Rather than commenting out or adding !if modifications, you can set the feature PCD to false in your DSC file before including the file. We are allowed to have multiple sections and the tools do a good job of applying them and aggregating them in sensible ways. For example: #!if gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable == TRUE # PerformanceLib|MdeModulePkg/Library/PeiPerformanceLib/PeiPerformanceLib.inf #!endif * If you just have: [PcdsFeatureFlag] # # MinPlatform control flags # gMinPlatformPkgTokenSpaceGuid.PcdStopAfterDebugInit |FALSE gMinPlatformPkgTokenSpaceGuid.PcdStopAfterMemInit |FALSE gMinPlatformPkgTokenSpaceGuid.PcdBootToShellOnly
Re: 回复: [edk2-devel] Generic MinPlatform
W wrote: > Daniel, > > The MinPlatform spec was intended to be architecture and product > independent for a “mainstream” set of products. It is intended to > constrain some of the nearly unlimited extensibility and flexibility of > UEFI specs and edk2 codebase. We took an 80/20 kind of approach. Base > design should work for 80% of designs, but some will need to leverage > full edk2 and UEFI specification flexibility. I think that a basic QEMU > kind of port would fit in 80% target. I would ultimately like to see a > progression of edk2 use that starts with QEMU then moves more seamlessly > to open designs and then proprietary product designs. MinPlatform > consistency is hoped to help that developer ramp into system firmware > productivity. > > We have only seen MinPlatform applied to Intel based products so far. > Which is why we are not rushing to move the spec from a 0.7 “broad > feedback” state to a 1.0 “initially complete” state. Like edk2, > MinPlatformPkg and BoardModulePkg content is intended to support > multiple silicon and product architectures and we will happily promote > content out of “Intel” scope when that is an accurate reflection of use > and not just wishful thinking. While 100% of uses are Intel scope, it > makes sense to land in the Intel part of edk2-platforms repo. Similar > logic applies to Features/Intel content, though more there may have ties > to Intel specific product features. > > The Minimum Platform Arch spec details base requirements for FV layout > (thus enabling more common code to publish FV details), base silicon > policy configuration flow (thus more common PEIM/drivers to gather > config information and reduce board porting to relatively simple > libraries), and such things. By enabling more common PEIM and drivers, > we hope to see benefits to ease of use and consistent quality. Similar > approaches for the other elements of the spec should help to improve > code sharing. > > Anyway, yes, it should be able to help you reduce the copies of “mostly > common” code that you encountered and the code and spec are open to > welcome the additional use and feedback from additional applications. > > Regards, > Isaac > > *From:*devel@edk2.groups.io > mailto:devel@edk2.groups.io>> *On Behalf Of *Daniel > Schaefer > *Sent:* Wednesday, May 19, 2021 8:40 PM > *To:* devel@edk2.groups.io<mailto:devel@edk2.groups.io>; > gaolim...@byosoft.com.cn<mailto:gaolim...@byosoft.com.cn>; > kaaira7...@gmail.com<mailto:kaaira7...@gmail.com>; Ni, Ray > mailto:ray...@intel.com>>; > mikub...@linux.microsoft.com<mailto:mikub...@linux.microsoft.com> > *Subject:* Re: 回复: [edk2-devel] GSoC 2021 Qemu OpenBoardPkg Project > > Hi, > > that sounds like a great project! > > I'm currently trying to create an equivalent of OvmfPkg for the RISCV64 > generic QEMU virt machine. > > I don't like how much of my DSC and FDF file has modules that pretty > much all platforms should have. > > MinPlatform would help reduce that, right? > > Is MinPlatform flexible enough to account for non-X64 platforms? > > If so, then I think Kaaira and I could collaborate. > > Cheers, > Daniel > > > > *From:*devel@edk2.groups.io > <mailto:devel@edk2.groups.io>mailto:devel@edk2.groups.io%20%0b>> <mailto:devel@edk2.groups.io>> on behalf of Michael Kubacki > mailto:mikub...@linux.microsoft.com>> > *Sent:* Thursday, May 20, 2021 02:57 > *To:* devel@edk2.groups.io<mailto:devel@edk2.groups.io> > <mailto:devel@edk2.groups.io>mailto:devel@edk2.groups.io%20%0b>> <mailto:devel@edk2.groups.io>>; gaolim...@byosoft.com.cn<mailto:gaolim...@byosoft.com.cn> > <mailto:gaolim...@byosoft.com.cn>mailto:gaolim...@byosoft.com.cn%20%0b>> <mailto:gaolim...@byosoft.com.cn>>; kaaira7...@gmail.com<mailto:kaaira7...@gmail.com> > <mailto:kaaira7...@gmail.com>mailto:kaaira7...@gmail.com%20%0b>> <mailto:kaaira7...@gmail.com>>; 'Ray Ni' mailto:ray...@intel.com%20%0b>> <mailto:ray...@intel.com>> > *Subject:* Re: 回复: [edk2-devel] GSoC 2021 Qemu OpenBoardPkg Project > > I also wanted to add that I will be setting up weekly video calls > including Ray that we can use to supplement mailing list communication. > > I suggest the primary communication mechanism be the mailing list and we > use those calls for clarification, detailed project planning, and topics > not directly relevant to the list. > > Regards, > Michael > > On 5/19/2021 10:29 AM, Michael Kubacki wrote: >> Thanks Liming. >> >> Hi Kaaira, >> >> Welcome! You can
Re: 回复: [edk2-devel] [PATCH v1 1/1] Add MemoryFence implementation for RiscV64
It's not required to go into that tag. We need two more patches that we haven't submitted yet to boot on Qemu. Would it be okay if we used a library from ArmVirtPkg for RISCV64? See: https://github.com/riscv/riscv-edk2/commit/8c7960ef860c65f2646912c3dccbb308a98e0cc3 Or does it have to be moved to some other place first? From: devel@edk2.groups.io on behalf of gaoliming Sent: Friday, May 21, 2021 14:35 To: devel@edk2.groups.io ; Schaefer, Daniel Cc: Chang, Abner (HPS SW/FW Technologist) ; 'Michael D Kinney' ; 'Zhiguang Liu' ; 'Leif Lindholm' Subject: 回复: 回复: [edk2-devel] [PATCH v1 1/1] Add MemoryFence implementation for RiscV64 Daniel: Thanks for your information. Acked-by: Liming Gao And, do you request to merge this patch for edk2 stable tag 202105? Thanks Liming 发件人: devel@edk2.groups.io 代表 Daniel Schaefer 发送时间: 2021年5月21日 13:27 收件人: devel@edk2.groups.io; gaolim...@byosoft.com.cn 抄送: Chang, Abner (HPS SW/FW Technologist) ; 'Michael D Kinney' ; 'Zhiguang Liu' ; 'Leif Lindholm' 主题: Re: 回复: [edk2-devel] [PATCH v1 1/1] Add MemoryFence implementation for RiscV64 Great! It is verified I can boot Linux from a virtio ESP using this patch on QEMU virt machine. See: https://github.com/riscv/riscv-edk2-platforms/runs/2618819010?check_suite_focus=true Thanks, Daniel From: devel@edk2.groups.io<mailto:devel@edk2.groups.io> mailto:devel@edk2.groups.io>> on behalf of gaoliming mailto:gaolim...@byosoft.com.cn>> Sent: Friday, May 21, 2021 13:14 To: devel@edk2.groups.io<mailto:devel@edk2.groups.io> mailto:devel@edk2.groups.io>>; Schaefer, Daniel mailto:daniel.schae...@hpe.com>> Cc: Chang, Abner (HPS SW/FW Technologist) mailto:abner.ch...@hpe.com>>; 'Michael D Kinney' mailto:michael.d.kin...@intel.com>>; 'Zhiguang Liu' mailto:zhiguang@intel.com>>; 'Leif Lindholm' mailto:l...@nuviainc.com>> Subject: 回复: 回复: [edk2-devel] [PATCH v1 1/1] Add MemoryFence implementation for RiscV64 Daniel: Now, it is clear to me. So, I suggest to merge this change when it is verified on generic RISC-V QEMU virt machine. Is it OK? Thanks Liming > -邮件原件- > 发件人: devel@edk2.groups.io<mailto:devel@edk2.groups.io> > mailto:devel@edk2.groups.io>> 代表 Daniel > Schaefer > 发送时间: 2021年5月18日 10:35 > 收件人: devel@edk2.groups.io<mailto:devel@edk2.groups.io>; > gaolim...@byosoft.com.cn<mailto:gaolim...@byosoft.com.cn> > 抄送: 'Abner Chang' mailto:abner.ch...@hpe.com>>; 'Michael > D Kinney' > mailto:michael.d.kin...@intel.com>>; 'Zhiguang > Liu' mailto:zhiguang@intel.com>>; 'Leif > Lindholm' mailto:l...@nuviainc.com>> > 主题: Re: 回复: [edk2-devel] [PATCH v1 1/1] Add MemoryFence > implementation for RiscV64 > > On 5/18/21 9:04 AM, gaoliming wrote: > > Daniel: > > Seemly, this API is missing in BaseLib for RiscV64 arch. How do you detect > > this issue? > > What do you mean it's missing? > Yes MemoryFence() for RiscV64 is missing currently, that's why I'm adding it > here. > > Maybe you mean that it's not currently used? That's also true. > I'm enabling the generic QEMU virt machine (like OVMF or ArmVirtPkg) for > RISC-V. > At least QemuFwCfgLib and VirtioLib need it. > That's why I have the need to add this implementation now. > > Does that clear it up? > > > Thanks > > Liming > >> -邮件原件- > >> 发件人: devel@edk2.groups.io<mailto:devel@edk2.groups.io> > >> mailto:devel@edk2.groups.io>> 代表 Daniel > >> Schaefer > >> 发送时间: 2021年5月16日 2:13 > >> 收件人: devel@edk2.groups.io<mailto:devel@edk2.groups.io> > >> 抄送: Abner Chang mailto:abner.ch...@hpe.com>>; Michael > >> D Kinney > >> mailto:michael.d.kin...@intel.com>>; Liming > >> Gao mailto:gaolim...@byosoft.com.cn>>; > >> Zhiguang Liu mailto:zhiguang@intel.com>>; Leif > >> Lindholm mailto:l...@nuviainc.com>> > >> 主题: [edk2-devel] [PATCH v1 1/1] Add MemoryFence implementation for > >> RiscV64 > >> > >> Cc: Abner Chang mailto:abner.ch...@hpe.com>> > >> Cc: Michael D Kinney > >> mailto:michael.d.kin...@intel.com>> > >> Cc: Liming Gao mailto:gaolim...@byosoft.com.cn>> > >> Cc: Zhiguang Liu mailto:zhiguang@intel.com>> > >> Cc: Leif Lindholm mailto:l...@nuviainc.com>> > >> Signed-off-by: Daniel Schaefer > >> mailto:daniel.schae...@hpe.com>> > >> --- > >> MdePkg/Library/BaseLib/BaseLib.inf | 1 + > >> MdePkg/Library/BaseLib/RiscV64/MemoryFence.S | 33 > >> > >> 2 files changed, 34 insert
Re: 回复: [edk2-devel] [PATCH v1 1/1] Add MemoryFence implementation for RiscV64
Great! It is verified I can boot Linux from a virtio ESP using this patch on QEMU virt machine. See: https://github.com/riscv/riscv-edk2-platforms/runs/2618819010?check_suite_focus=true Thanks, Daniel From: devel@edk2.groups.io on behalf of gaoliming Sent: Friday, May 21, 2021 13:14 To: devel@edk2.groups.io ; Schaefer, Daniel Cc: Chang, Abner (HPS SW/FW Technologist) ; 'Michael D Kinney' ; 'Zhiguang Liu' ; 'Leif Lindholm' Subject: 回复: 回复: [edk2-devel] [PATCH v1 1/1] Add MemoryFence implementation for RiscV64 Daniel: Now, it is clear to me. So, I suggest to merge this change when it is verified on generic RISC-V QEMU virt machine. Is it OK? Thanks Liming > -邮件原件- > 发件人: devel@edk2.groups.io 代表 Daniel > Schaefer > 发送时间: 2021年5月18日 10:35 > 收件人: devel@edk2.groups.io; gaolim...@byosoft.com.cn > 抄送: 'Abner Chang' ; 'Michael D Kinney' > ; 'Zhiguang Liu' ; 'Leif > Lindholm' > 主题: Re: 回复: [edk2-devel] [PATCH v1 1/1] Add MemoryFence > implementation for RiscV64 > > On 5/18/21 9:04 AM, gaoliming wrote: > > Daniel: > > Seemly, this API is missing in BaseLib for RiscV64 arch. How do you detect > > this issue? > > What do you mean it's missing? > Yes MemoryFence() for RiscV64 is missing currently, that's why I'm adding it > here. > > Maybe you mean that it's not currently used? That's also true. > I'm enabling the generic QEMU virt machine (like OVMF or ArmVirtPkg) for > RISC-V. > At least QemuFwCfgLib and VirtioLib need it. > That's why I have the need to add this implementation now. > > Does that clear it up? > > > Thanks > > Liming > >> -邮件原件- > >> 发件人: devel@edk2.groups.io 代表 Daniel > >> Schaefer > >> 发送时间: 2021年5月16日 2:13 > >> 收件人: devel@edk2.groups.io > >> 抄送: Abner Chang ; Michael D Kinney > >> ; Liming Gao ; > >> Zhiguang Liu ; Leif Lindholm > >> 主题: [edk2-devel] [PATCH v1 1/1] Add MemoryFence implementation for > >> RiscV64 > >> > >> Cc: Abner Chang > >> Cc: Michael D Kinney > >> Cc: Liming Gao > >> Cc: Zhiguang Liu > >> Cc: Leif Lindholm > >> Signed-off-by: Daniel Schaefer > >> --- > >> MdePkg/Library/BaseLib/BaseLib.inf | 1 + > >> MdePkg/Library/BaseLib/RiscV64/MemoryFence.S | 33 > >> > >> 2 files changed, 34 insertions(+) > >> > >> diff --git a/MdePkg/Library/BaseLib/BaseLib.inf > >> b/MdePkg/Library/BaseLib/BaseLib.inf > >> index b76f3af380ea..b7ab5f632366 100644 > >> --- a/MdePkg/Library/BaseLib/BaseLib.inf > >> +++ b/MdePkg/Library/BaseLib/BaseLib.inf > >> @@ -399,6 +399,7 @@ > >>RiscV64/DisableInterrupts.c > >> > >> > >>RiscV64/EnableInterrupts.c > >> > >> > >>RiscV64/CpuPause.c > >> > >> > >> + RiscV64/MemoryFence.S | GCC > >> > >> > >>RiscV64/RiscVSetJumpLongJump.S| GCC > >> > >> > >>RiscV64/RiscVCpuBreakpoint.S | GCC > >> > >> > >>RiscV64/RiscVCpuPause.S | GCC > >> > >> > >> diff --git a/MdePkg/Library/BaseLib/RiscV64/MemoryFence.S > >> b/MdePkg/Library/BaseLib/RiscV64/MemoryFence.S > >> new file mode 100644 > >> index ..283df9356a9a > >> --- /dev/null > >> +++ b/MdePkg/Library/BaseLib/RiscV64/MemoryFence.S > >> @@ -0,0 +1,33 @@ > >> > > +##- > > - > >> > >> > >> +# > >> > >> > >> +# MemoryFence() for RiscV64 > >> > >> > >> + > >> > >> > >> +# Copyright (c) 2021, Hewlett Packard Enterprise Development. All rights > >> reserved. > >> > >> > >> +# > >> > >> > >> +# SPDX-License-Identifier: BSD-2-Clause-Patent > >> > >> > >> +# > >> > >> > >> > > +##- > > - > >> > >> > >> + > >> > >> > >> +.text > >> > >> > >> +.p2align 2 > >> > >> > >> + > >> > >> > >> +ASM_GLOBAL ASM_PFX(MemoryFence) > >> > >> > >> + > >> > >> > >> + > >> > >> > >> +#/** > >> > >> > >> +# Used to serialize load and store operations. > >> > >> > >> +# > >> > >> > >> +# All loads and stores that proceed calls to this function are > > guaranteed to > >> be > >> > >> > >> +# globally visible when this function returns. > >> > >> > >> +# > >> > >> > >> +#**/ > >> > >> > >> +#VOID > >> > >> > >> +#EFIAPI > >> > >> > >> +#MemoryFence ( > >> > >> > >> +# VOID > >> > >> > >> +# ); > >> > >> > >> +# > >> > >> > >> +ASM_PFX(MemoryFence): > >> > >> > >> +// Fence on all memory and I/O > >> > >> > >> +fence > >> > >> > >> +ret > >> > >> > >> -- > >> 2.30.1 > >> > >> > >> > >> > >> > > > > > > > > > > > > > > > > > > > > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#75438): https://edk2.groups.io/g/devel/message/75438 Mute This Topic: https://groups.io/mt/82979816/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: 回复: [edk2-devel] GSoC 2021 Qemu OpenBoardPkg Project
sharing. > > Anyway, yes, it should be able to help you reduce the copies of “mostly > common” code that you encountered and the code and spec are open to > welcome the additional use and feedback from additional applications. > > Regards, > Isaac > > *From:*devel@edk2.groups.io *On Behalf Of *Daniel > Schaefer > *Sent:* Wednesday, May 19, 2021 8:40 PM > *To:* devel@edk2.groups.io; gaolim...@byosoft.com.cn; > kaaira7...@gmail.com; Ni, Ray ; > mikub...@linux.microsoft.com > *Subject:* Re: 回复: [edk2-devel] GSoC 2021 Qemu OpenBoardPkg Project > > Hi, > > that sounds like a great project! > > I'm currently trying to create an equivalent of OvmfPkg for the RISCV64 > generic QEMU virt machine. > > I don't like how much of my DSC and FDF file has modules that pretty > much all platforms should have. > > MinPlatform would help reduce that, right? > > Is MinPlatform flexible enough to account for non-X64 platforms? > > If so, then I think Kaaira and I could collaborate. > > Cheers, > Daniel > > > > *From:*devel@edk2.groups.io > <mailto:devel@edk2.groups.io> <mailto:devel@edk2.groups.io>> on behalf of Michael Kubacki > mailto:mikub...@linux.microsoft.com>> > *Sent:* Thursday, May 20, 2021 02:57 > *To:* devel@edk2.groups.io > <mailto:devel@edk2.groups.io> <mailto:devel@edk2.groups.io>>; gaolim...@byosoft.com.cn > <mailto:gaolim...@byosoft.com.cn> <mailto:gaolim...@byosoft.com.cn>>; kaaira7...@gmail.com > <mailto:kaaira7...@gmail.com> <mailto:kaaira7...@gmail.com>>; 'Ray Ni' <mailto:ray...@intel.com>> > *Subject:* Re: 回复: [edk2-devel] GSoC 2021 Qemu OpenBoardPkg Project > > I also wanted to add that I will be setting up weekly video calls > including Ray that we can use to supplement mailing list communication. > > I suggest the primary communication mechanism be the mailing list and we > use those calls for clarification, detailed project planning, and topics > not directly relevant to the list. > > Regards, > Michael > > On 5/19/2021 10:29 AM, Michael Kubacki wrote: >> Thanks Liming. >> >> Hi Kaaira, >> >> Welcome! You can contact me at mikub...@linux.microsoft.com >> <mailto:mikub...@linux.microsoft.com>. You > will >> sometimes see my email as michael.kuba...@microsoft.com >> <mailto:michael.kuba...@microsoft.com>and > that is fine >> to use for communication though I tend to not use it on the mailing list >> due to way the mail server manipulates plaintext email. >> >> GENERIC RESOURCES >> >> I'm sharing some general resources in case you are not already familiar >> with them: >> >> 1. https://github.com/tianocore-training/Tianocore_Training_Contents/wiki > <https://github.com/tianocore-training/Tianocore_Training_Contents/wiki> >> >> This one is good for topics like UEFI overview, EDK II concepts, and >> Minimum Platform. >> >> In particular for your project, I recommend looking through the >> MinPlatform training - >> https://github.com/tianocore-training/Presentation_FW/blob/master/FW/Presentations/_D_05_EDK_II_Open_Source_MinPlatform_pres_gp.pdf > <https://github.com/tianocore-training/Presentation_FW/blob/master/FW/Presentations/_D_05_EDK_II_Open_Source_MinPlatform_pres_gp.pdf> >> >> >> 2. >> https://software.intel.com/content/www/us/en/develop/articles/unified-extensible-firmware-interface.html > <https://software.intel.com/content/www/us/en/develop/articles/unified-extensible-firmware-interface.html> >> >> >> These whitepapers are useful when you need more in depth detail about a >> particular area (like capsule update or work related to the memory map). >> I recommend bookmarking it and keeping it in mind as a reference. >> >> 3. https://uefi.org/learning_center/presentationsandvideos/ > <https://uefi.org/learning_center/presentationsandvideos/> >> >> Scroll through here if you have some time and see if there's anything >> interesting. To help keep on your project schedule I don't think these >> are as important but there is a lot of interesting material there. >> >> Reading through some of the key concepts in Beyond BIOS can be helpful >> and like the UEFI, ACPI, and PI (Platform Initialization) specs at >> https://uefi.org/specifications <https://uefi.org/specifications>, I > believe they are most useful as >> references when you are solving specific problems. >> >> PROJECT-SPECIFIC RESOURCES >> >> Since your project involves crea
Re: 回复: [edk2-devel] GSoC 2021 Qemu OpenBoardPkg Project
Hi, that sounds like a great project! I'm currently trying to create an equivalent of OvmfPkg for the RISCV64 generic QEMU virt machine. I don't like how much of my DSC and FDF file has modules that pretty much all platforms should have. MinPlatform would help reduce that, right? Is MinPlatform flexible enough to account for non-X64 platforms? If so, then I think Kaaira and I could collaborate. Cheers, Daniel From: devel@edk2.groups.io on behalf of Michael Kubacki Sent: Thursday, May 20, 2021 02:57 To: devel@edk2.groups.io ; gaolim...@byosoft.com.cn ; kaaira7...@gmail.com ; 'Ray Ni' Subject: Re: 回复: [edk2-devel] GSoC 2021 Qemu OpenBoardPkg Project I also wanted to add that I will be setting up weekly video calls including Ray that we can use to supplement mailing list communication. I suggest the primary communication mechanism be the mailing list and we use those calls for clarification, detailed project planning, and topics not directly relevant to the list. Regards, Michael On 5/19/2021 10:29 AM, Michael Kubacki wrote: > Thanks Liming. > > Hi Kaaira, > > Welcome! You can contact me at mikub...@linux.microsoft.com. You will > sometimes see my email as michael.kuba...@microsoft.com and that is fine > to use for communication though I tend to not use it on the mailing list > due to way the mail server manipulates plaintext email. > > GENERIC RESOURCES > > I'm sharing some general resources in case you are not already familiar > with them: > > 1. https://github.com/tianocore-training/Tianocore_Training_Contents/wiki > > This one is good for topics like UEFI overview, EDK II concepts, and > Minimum Platform. > > In particular for your project, I recommend looking through the > MinPlatform training - > https://github.com/tianocore-training/Presentation_FW/blob/master/FW/Presentations/_D_05_EDK_II_Open_Source_MinPlatform_pres_gp.pdf > > > 2. > https://software.intel.com/content/www/us/en/develop/articles/unified-extensible-firmware-interface.html > > > These whitepapers are useful when you need more in depth detail about a > particular area (like capsule update or work related to the memory map). > I recommend bookmarking it and keeping it in mind as a reference. > > 3. https://uefi.org/learning_center/presentationsandvideos/ > > Scroll through here if you have some time and see if there's anything > interesting. To help keep on your project schedule I don't think these > are as important but there is a lot of interesting material there. > > Reading through some of the key concepts in Beyond BIOS can be helpful > and like the UEFI, ACPI, and PI (Platform Initialization) specs at > https://uefi.org/specifications, I believe they are most useful as > references when you are solving specific problems. > > PROJECT-SPECIFIC RESOURCES > > Since your project involves creating QEMU board within the Minimum > Platform architecture, you can start looking into: > > 1. QEMU - An open source machine emulator > 2. Minimum Platform Architecture - A software architecture to create > basic platform firmware that can be extended with advanced functionality. > 3. Intel FSP - Try to understand the high-level goals and how FSP > interfaces with firmware. > > 1. QEMU - https://www.qemu.org/ > > Please set up the QEMU environment. Your QemuOpenBoardPkg will need to > run on qemu-system-x86_64 at a minimum with a 32-bit PEI and a 64-bit > DXE phase. Most real hardware firmwares also use a 32-bit PEI and a > 64-bit DXE. > > I suggest you start with the OvmfPkg README - > https://github.com/tianocore/edk2/blob/master/OvmfPkg/README > > As an initial step you can try to build an OVMF FW with a 32-bit PEI > (IA32) and 64-bit DXE (X64) and boot to the EFI shell. > OvmfPkg/OvmfPkgIa32X64.dsc can be used to build a firmware for these > target architectures. > > Any time you submit patches to edk2, you can check edk2/maintainers.txt > - https://github.com/tianocore/edk2/blob/master/Maintainers.txt for the > appropriate maintainers and reviewers to CC on the patch. As you can > see, Laszlo and Ard are the maintainers for OvmfPkg and Jordan is a > reviewer. If there are any questions that require deep expertise in QEMU > or OVMF, we will reach out to them. The Minimum Platform code is > maintained in the edk2-platforms repository and it has a similar > maintainers.txt file for its packages - > https://github.com/tianocore/edk2-platforms/blob/master/Maintainers.txt. > > I suggest you try sending a very trivial patch for a change in the > edk2-platforms repository - https://github.com/tianocore/edk2-platforms > to make sure that your git environment is set up properly to format edk2 > patches and your email service can send patches correctly. > > We can discuss the details about how to set up your environment and what > to change when you are ready. You can use this page to get started - > https://github.com/tianocore/tianocore.github.io/wiki/How-To-Contribute. > > 2. EDK II Minimum Platform
[edk2-devel] [PATCH v1 1/1] EmbeddedPkg/libfdt: Add strmp and strncpy to libfdt_env.h
OpenSBI has started using those in v0.9. See: https://github.com/riscv/opensbi/blob/v0.9/lib/utils/fdt/fdt_domain.c Cc: Abner Chang Cc: Leif Lindholm Cc: Ard Biesheuvel Cc: Daniel Schaefer Cc: Anup Patel Signed-off-by: Daniel Schaefer --- EmbeddedPkg/Include/libfdt_env.h | 8 1 file changed, 8 insertions(+) diff --git a/EmbeddedPkg/Include/libfdt_env.h b/EmbeddedPkg/Include/libfdt_env.h index 7feff52bc0fb..c35ac739703c 100644 --- a/EmbeddedPkg/Include/libfdt_env.h +++ b/EmbeddedPkg/Include/libfdt_env.h @@ -76,8 +76,16 @@ static inline size_t strnlen (const char* str, size_t strsz ) { return AsciiStrnLenS (str, strsz); } +static inline size_t strcmp (const char* str1, const char* str2) { + return AsciiStrCmp (str1, str2); +} + static inline size_t strncmp (const char* str1, const char* str2, size_t strsz ) { return AsciiStrnCmp (str1, str2, strsz); } +static inline size_t strncpy (char* dest, const char* source, size_t dest_max) { + return AsciiStrCpyS (dest, dest_max, source); +} + #endif /* _LIBFDT_ENV_H */ -- 2.30.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#75383): https://edk2.groups.io/g/devel/message/75383 Mute This Topic: https://groups.io/mt/82938220/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: 回复: [edk2-devel] [PATCH v1 1/1] Add MemoryFence implementation for RiscV64
On 5/18/21 9:04 AM, gaoliming wrote: > Daniel: > Seemly, this API is missing in BaseLib for RiscV64 arch. How do you detect > this issue? What do you mean it's missing? Yes MemoryFence() for RiscV64 is missing currently, that's why I'm adding it here. Maybe you mean that it's not currently used? That's also true. I'm enabling the generic QEMU virt machine (like OVMF or ArmVirtPkg) for RISC-V. At least QemuFwCfgLib and VirtioLib need it. That's why I have the need to add this implementation now. Does that clear it up? > Thanks > Liming >> -邮件原件- >> 发件人: devel@edk2.groups.io 代表 Daniel >> Schaefer >> 发送时间: 2021年5月16日 2:13 >> 收件人: devel@edk2.groups.io >> 抄送: Abner Chang ; Michael D Kinney >> ; Liming Gao ; >> Zhiguang Liu ; Leif Lindholm >> 主题: [edk2-devel] [PATCH v1 1/1] Add MemoryFence implementation for >> RiscV64 >> >> Cc: Abner Chang >> Cc: Michael D Kinney >> Cc: Liming Gao >> Cc: Zhiguang Liu >> Cc: Leif Lindholm >> Signed-off-by: Daniel Schaefer >> --- >> MdePkg/Library/BaseLib/BaseLib.inf | 1 + >> MdePkg/Library/BaseLib/RiscV64/MemoryFence.S | 33 >> >> 2 files changed, 34 insertions(+) >> >> diff --git a/MdePkg/Library/BaseLib/BaseLib.inf >> b/MdePkg/Library/BaseLib/BaseLib.inf >> index b76f3af380ea..b7ab5f632366 100644 >> --- a/MdePkg/Library/BaseLib/BaseLib.inf >> +++ b/MdePkg/Library/BaseLib/BaseLib.inf >> @@ -399,6 +399,7 @@ >>RiscV64/DisableInterrupts.c >> >> >>RiscV64/EnableInterrupts.c >> >> >>RiscV64/CpuPause.c >> >> >> + RiscV64/MemoryFence.S | GCC >> >> >>RiscV64/RiscVSetJumpLongJump.S| GCC >> >> >>RiscV64/RiscVCpuBreakpoint.S | GCC >> >> >>RiscV64/RiscVCpuPause.S | GCC >> >> >> diff --git a/MdePkg/Library/BaseLib/RiscV64/MemoryFence.S >> b/MdePkg/Library/BaseLib/RiscV64/MemoryFence.S >> new file mode 100644 >> index ..283df9356a9a >> --- /dev/null >> +++ b/MdePkg/Library/BaseLib/RiscV64/MemoryFence.S >> @@ -0,0 +1,33 @@ >> > +##- > - >> >> >> +# >> >> >> +# MemoryFence() for RiscV64 >> >> >> + >> >> >> +# Copyright (c) 2021, Hewlett Packard Enterprise Development. All rights >> reserved. >> >> >> +# >> >> >> +# SPDX-License-Identifier: BSD-2-Clause-Patent >> >> >> +# >> >> >> > +##- > - >> >> >> + >> >> >> +.text >> >> >> +.p2align 2 >> >> >> + >> >> >> +ASM_GLOBAL ASM_PFX(MemoryFence) >> >> >> + >> >> >> + >> >> >> +#/** >> >> >> +# Used to serialize load and store operations. >> >> >> +# >> >> >> +# All loads and stores that proceed calls to this function are > guaranteed to >> be >> >> >> +# globally visible when this function returns. >> >> >> +# >> >> >> +#**/ >> >> >> +#VOID >> >> >> +#EFIAPI >> >> >> +#MemoryFence ( >> >> >> +# VOID >> >> >> +# ); >> >> >> +# >> >> >> +ASM_PFX(MemoryFence): >> >> >> +// Fence on all memory and I/O >> >> >> +fence >> >> >> +ret >> >> >> -- >> 2.30.1 >> >> >> >> >> > > > > > > > > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#75236): https://edk2.groups.io/g/devel/message/75236 Mute This Topic: https://groups.io/mt/82902091/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH v1 1/1] Add MemoryFence implementation for RiscV64
Cc: Abner Chang Cc: Michael D Kinney Cc: Liming Gao Cc: Zhiguang Liu Cc: Leif Lindholm Signed-off-by: Daniel Schaefer --- MdePkg/Library/BaseLib/BaseLib.inf | 1 + MdePkg/Library/BaseLib/RiscV64/MemoryFence.S | 33 2 files changed, 34 insertions(+) diff --git a/MdePkg/Library/BaseLib/BaseLib.inf b/MdePkg/Library/BaseLib/BaseLib.inf index b76f3af380ea..b7ab5f632366 100644 --- a/MdePkg/Library/BaseLib/BaseLib.inf +++ b/MdePkg/Library/BaseLib/BaseLib.inf @@ -399,6 +399,7 @@ RiscV64/DisableInterrupts.c RiscV64/EnableInterrupts.c RiscV64/CpuPause.c + RiscV64/MemoryFence.S | GCC RiscV64/RiscVSetJumpLongJump.S| GCC RiscV64/RiscVCpuBreakpoint.S | GCC RiscV64/RiscVCpuPause.S | GCC diff --git a/MdePkg/Library/BaseLib/RiscV64/MemoryFence.S b/MdePkg/Library/BaseLib/RiscV64/MemoryFence.S new file mode 100644 index ..283df9356a9a --- /dev/null +++ b/MdePkg/Library/BaseLib/RiscV64/MemoryFence.S @@ -0,0 +1,33 @@ +##-- +# +# MemoryFence() for RiscV64 + +# Copyright (c) 2021, Hewlett Packard Enterprise Development. All rights reserved. +# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +##-- + +.text +.p2align 2 + +ASM_GLOBAL ASM_PFX(MemoryFence) + + +#/** +# Used to serialize load and store operations. +# +# All loads and stores that proceed calls to this function are guaranteed to be +# globally visible when this function returns. +# +#**/ +#VOID +#EFIAPI +#MemoryFence ( +# VOID +# ); +# +ASM_PFX(MemoryFence): +// Fence on all memory and I/O +fence +ret -- 2.30.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#75139): https://edk2.groups.io/g/devel/message/75139 Mute This Topic: https://groups.io/mt/82851071/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [PATCH v1 1/1] BaseTools: Add DTCPP_FLAGS for GCC5 RISCV64 toolchain
Some/all platforms are going to require EDK2 to build a device tree and use it in the early stages of boot. Cc: Bob Feng Cc: Liming Gao Cc: Yuwei Chen Cc: Abner Chang Signed-off-by: Daniel Schaefer --- BaseTools/Conf/tools_def.template | 1 + 1 file changed, 1 insertion(+) diff --git a/BaseTools/Conf/tools_def.template b/BaseTools/Conf/tools_def.template index 5db3f6119188..498696e583fc 100755 --- a/BaseTools/Conf/tools_def.template +++ b/BaseTools/Conf/tools_def.template @@ -2458,6 +2458,7 @@ RELEASE_GCC5_AARCH64_DLINK_XIPFLAGS = -z common-page-size=0x20 *_GCC5_RISCV64_DLINK2_FLAGS = DEF(GCC5_RISCV64_DLINK2_FLAGS) *_GCC5_RISCV64_RC_FLAGS = DEF(GCC_RISCV64_RC_FLAGS) *_GCC5_RISCV64_OBJCOPY_FLAGS= +*_GCC5_RISCV64_DTCPP_FLAGS = DEF(GCC_DTCPP_FLAGS) # -- 2.30.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#75104): https://edk2.groups.io/g/devel/message/75104 Mute This Topic: https://groups.io/mt/82817969/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH v1 1/2] BaseTools: Make undefined VFR macro an error (GCC)
Ok sure, let's make only undef an error, not all other warnings. Then the behaviour will also be the same as on MSVC. From: devel@edk2.groups.io on behalf of Daniel Schaefer Sent: Monday, March 8, 2021 11:44 To: Feng, Bob C ; devel@edk2.groups.io Cc: Liming Gao ; Chen, Christine ; Lin, Derek (HPS SW) Subject: Re: [edk2-devel] [PATCH v1 1/2] BaseTools: Make undefined VFR macro an error (GCC) It didn't cause any other errors for the huge HPE codebase. Only undefined macros. I don't believe the preprocessor has so many warnings anyways. So -Werror should be fine. From: Feng, Bob C Sent: Monday, March 8, 2021 09:05 To: devel@edk2.groups.io ; Schaefer, Daniel Cc: Liming Gao ; Chen, Christine ; Lin, Derek (HPS SW) Subject: RE: [edk2-devel] [PATCH v1 1/2] BaseTools: Make undefined VFR macro an error (GCC) Hi Derek, -Werror. Make all warnings into errors. Should here be that only treat undef warning as error? Thanks, Bob -Original Message- From: devel@edk2.groups.io On Behalf Of Daniel Schaefer Sent: Tuesday, March 2, 2021 4:22 PM To: devel@edk2.groups.io Cc: Feng, Bob C ; Liming Gao ; Chen, Christine ; Derek Lin Subject: [edk2-devel] [PATCH v1 1/2] BaseTools: Make undefined VFR macro an error (GCC) VFR successfully compiles if we forget to include a header that defines a macro. In that case the HII option was hidden when it shouldn't be just because the macro was used but not defined. The behaviour is totally intended by the C/PP standard. When a macro is undefined it evaluates to 0. GCC, MSVC and Clang have warnings to catch this type of mistake. With this commit we enable this warning and make it a compiler error. Cc: Bob Feng Cc: Liming Gao Cc: Yuwei Chen Cc: Derek Lin --- BaseTools/Conf/tools_def.template | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/BaseTools/Conf/tools_def.template b/BaseTools/Conf/tools_def.template index 933b3160fd2b..728c1d3119e4 100755 --- a/BaseTools/Conf/tools_def.template +++ b/BaseTools/Conf/tools_def.template @@ -3,7 +3,7 @@ # Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved. # Portions copyright (c) 2011 - 2019, ARM Ltd. All rights reserved. # Copyright (c) 2015, Hewlett-Packard Development Company, L.P. -# (C) Copyright 2020, Hewlett Packard Enterprise Development LP +# (C) Copyright 2020-2021, Hewlett Packard Enterprise Development +LP # Copyright (c) Microsoft Corporation # # SPDX-License-Identifier: BSD-2-Clause-Patent @@ -1938,7 +1938,7 @@ DEFINE GCC_AARCH64_ASLDLINK_FLAGS = DEF(GCC_AARCH64_DLINK_FLAGS) -Wl,--entry,Re DEFINE GCC_IA32_X64_DLINK_FLAGS= DEF(GCC_IA32_X64_DLINK_COMMON) --entry _$(IMAGE_ENTRY_POINT) --file-alignment 0x20 --section-alignment 0x20 -Map $(DEST_DIR_DEBUG)/$(BASE_NAME).map DEFINE GCC_ASM_FLAGS = -c -x assembler -imacros AutoGen.h DEFINE GCC_PP_FLAGS= -E -x assembler-with-cpp -include AutoGen.h -DEFINE GCC_VFRPP_FLAGS = -x c -E -P -DVFRCOMPILE --include $(MODULE_NAME)StrDefs.h +DEFINE GCC_VFRPP_FLAGS = -x c -E -P -DVFRCOMPILE --include $(MODULE_NAME)StrDefs.h -Wundef -Werror DEFINE GCC_ASLPP_FLAGS = -x c -E -include AutoGen.h DEFINE GCC_ASLCC_FLAGS = -x c DEFINE GCC_WINDRES_FLAGS = -J rc -O coff -- 2.30.0 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#74385): https://edk2.groups.io/g/devel/message/74385 Mute This Topic: https://groups.io/mt/82306124/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] 回复: [PATCH v1 2/2] BaseTools: Make undefined VFR macro an error (MSVC)
Ok, I'll send a new series without EBC. Can't find anything about it and we don't use it. From: Schaefer, Daniel Sent: Thursday, March 4, 2021 10:46 To: gaoliming ; devel@edk2.groups.io Cc: 'Bob Feng' ; 'Yuwei Chen' ; Lin, Derek (HPS SW) Subject: Re: 回复: [PATCH v1 2/2] BaseTools: Make undefined VFR macro an error (MSVC) Hi Liming, as stated in the coverletter, "I only tested GCC5, CLANPDB and VS2015 toolchains." Clang support is documented here: https://clang.llvm.org/docs/DiagnosticsReference.html#wundef GCC support is documented here: https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html MSVC support is documented here: https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-4-c4668?view=msvc-160 I'm sorry, I'm unable to find documentation for, or even the EBC compiler itself. Can you please help me with this? Thanks, Daniel On 3/4/21 10:12 AM, gaoliming wrote: > Do you check whether EBC compiler supports this warning? > > And, do you evaluate CLANG compiler support for this warning? > > Thanks > Liming >> -邮件原件- >> 发件人: Daniel Schaefer >> 发送时间: 2021年3月2日 16:22 >> 收件人: devel@edk2.groups.io >> 抄送: Bob Feng ; Liming Gao >> ; Yuwei Chen ; Derek >> Lin >> 主题: [PATCH v1 2/2] BaseTools: Make undefined VFR macro an error (MSVC) >> >> VFR successfully compiles if we forget to include a header that defines >> a macro. In that case the HII option was hidden when it shouldn't be >> just because the macro was used but not defined. >> >> The behaviour is totally intended by the C/PP standard. When a macro is >> undefined it evaluates to 0. >> GCC, MSVC and Clang have warnings to catch this type of mistake. With >> this commit we enable this warning and make it a compiler error. >> >> Cc: Bob Feng >> Cc: Liming Gao >> Cc: Yuwei Chen >> Cc: Derek Lin >> --- >> BaseTools/Conf/tools_def.template | 46 ++-- >> 1 file changed, 23 insertions(+), 23 deletions(-) >> >> diff --git a/BaseTools/Conf/tools_def.template >> b/BaseTools/Conf/tools_def.template >> index 728c1d3119e4..56c7bd13f157 100755 >> --- a/BaseTools/Conf/tools_def.template >> +++ b/BaseTools/Conf/tools_def.template >> @@ -422,7 +422,7 @@ DEFINE DTC_BIN = >> ENV(DTC_PREFIX)dtc >> *_VS2008_*_SLINK_FLAGS= /NOLOGO /LTCG >> >> *_VS2008_*_APP_FLAGS = /nologo /E /TC >> >> *_VS2008_*_PP_FLAGS = /nologo /E /TC /FIAutoGen.h >> >> -*_VS2008_*_VFRPP_FLAGS= /nologo /E /TC /DVFRCOMPILE >> /FI$(MODULE_NAME)StrDefs.h >> >> +*_VS2008_*_VFRPP_FLAGS= /nologo /E /TC /DVFRCOMPILE >> /FI$(MODULE_NAME)StrDefs.h /we4668 >> >> *_VS2008_*_DEPS_FLAGS= DEF(MSFT_DEPS_FLAGS) >> >> *_VS2008_*_ASM16_PATH = DEF(VS2008_BIN)\ml.exe >> >> >> >> @@ -518,7 +518,7 @@ NOOPT_VS2008_X64_DLINK_FLAGS = /NOLOGO >> /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT >> *_VS2008_EBC_MAKE_FLAGS = /nologo >> >> *_VS2008_EBC_PP_FLAGS= /nologo /E /TC /FIAutoGen.h >> >> *_VS2008_EBC_CC_FLAGS= /nologo /c /WX /W3 >> /FIAutoGen.h /D$(MODULE_ENTRY_POINT)=$(ARCH_ENTRY_POINT) >> >> -*_VS2008_EBC_VFRPP_FLAGS = /nologo /E /TC /DVFRCOMPILE >> /FI$(MODULE_NAME)StrDefs.h >> >> +*_VS2008_EBC_VFRPP_FLAGS = /nologo /E /TC /DVFRCOMPILE >> /FI$(MODULE_NAME)StrDefs.h /we4668 >> >> *_VS2008_EBC_SLINK_FLAGS = /lib /NOLOGO /MACHINE:EBC >> >> *_VS2008_EBC_DLINK_FLAGS = "C:\Program >> Files\Intel\EBC\Lib\EbcLib.lib" /NOLOGO /NODEFAULTLIB /MACHINE:EBC >> /OPT:REF /ENTRY:$(IMAGE_ENTRY_POINT) >> /SUBSYSTEM:EFI_BOOT_SERVICE_DRIVER /MAP /ALIGN:32 /DRIVER >> >> >> >> @@ -538,7 +538,7 @@ NOOPT_VS2008_X64_DLINK_FLAGS = /NOLOGO >> /NODEFAULTLIB /IGNORE:4001 /OPT:REF /OPT >> *_VS2008x86_*_SLINK_FLAGS = /NOLOGO /LTCG >> >> *_VS2008x86_*_APP_FLAGS = /nologo /E /TC >> >> *_VS2008x86_*_PP_FLAGS= /nologo /E /TC /FIAutoGen.h >> >> -*_VS2008x86_*_VFRPP_FLAGS = /nologo /E /TC /DVFRCOMPILE >> /FI$(MODULE_NAME)StrDefs.h >> >> +*_VS2008x86_*_VFRPP_FLAGS = /nologo /E /TC /DVFRCOMPILE >> /FI$(MODULE_NAME)StrDefs.h /we4668 >> >> *_VS2008x86_*_DEPS_FLAGS = DEF(MSFT_DEPS_FLAGS) >> >> *_VS2008x86_*_ASM16_PATH = DEF(VS2008x86_BIN)\ml.exe >> >> >> >> @@ -633,7 +633,7 @@ NOOPT_VS2008x86_X64_DLINK_FLAGS= >>
Re: [edk2-devel] [edk2-test PATCHv3 0/5] Port SCT to RISCV64
Abner has reviewed and approved everything now. Other people only reviewed v2 5/5. Does anybody else have any comments? From: devel@edk2.groups.io on behalf of Daniel Schaefer Sent: Thursday, March 4, 2021 11:21 To: devel@edk2.groups.io Cc: G Edhaya Chandran ; Barton Gao ; Samer El-Haj-Mahmoud ; Eric Jin ; Arvin Chen ; Leif Lindholm ; Heinrich Schuchardt ; Chang, Abner (HPS SW/FW Technologist) Subject: [edk2-devel] [edk2-test PATCHv3 0/5] Port SCT to RISCV64 Changes to previous series: - Fixed the commit to remove whitespace to *only* remove whitespace. Had some mixup there... - Added missing HPE copyright in one file I was able to run SCT on my EDK2 port to RISCV64 and I don't see any obvious failures related to this. Additionally Heinrich has tested the first series on the U-Boot implementation of UEFI. If you apply these patches or check out my branch [1] you can easily review the changes with `git diff -w master`. It will hide anything that's copied and any whitespace changes. Cheers, Daniel [1] https://github.com/johnazoidberg/edk2-test/tree/riscv64 Cc: G Edhaya Chandran Cc: Barton Gao Cc: Samer El-Haj-Mahmoud Cc: Eric Jin Cc: Arvin Chen Cc: Leif Lindholm Cc: Heinrich Schuchardt Cc: Abner Chang Daniel Schaefer (5): SctPkg: Add RISCV64 support by using Aarch64 sources SctPkg: Adapt Aarch64 sources for Riscv64 SctPkg: Add RISCV64 build support SctPkg: Unify CC_FLAGS for all GCC platforms SctPkg: Remove trailing whitespace uefi-sct/SctPkg/Application/InstallSct/InstallSctDef.h | 4 ++ uefi-sct/SctPkg/Library/SctLib/Aarch64/SctLibPlat.h | 4 +- uefi-sct/SctPkg/Library/SctLib/Aarch64/initplat.c | 6 +- uefi-sct/SctPkg/Library/SctLib/{Aarch64 => Riscv64}/SctLibPlat.h | 7 ++- uefi-sct/SctPkg/Library/SctLib/{Aarch64 => Riscv64}/initplat.c | 6 +- uefi-sct/SctPkg/Library/SctLib/SctLib.inf | 6 ++ uefi-sct/SctPkg/SCRT/SCRTApp/Aarch64/GoVirtual.S | 6 +- uefi-sct/SctPkg/SCRT/SCRTApp/Aarch64/VirtualMemory.c | 6 +- uefi-sct/SctPkg/SCRT/SCRTApp/{Aarch64 => Riscv64}/GoVirtual.S | 15 +++-- uefi-sct/SctPkg/SCRT/SCRTApp/{Aarch64 => Riscv64}/VirtualMemory.c | 22 +++ uefi-sct/SctPkg/SCRT/SCRTApp/SCRTApp.inf | 5 ++ uefi-sct/SctPkg/SCRT/SCRTDriver/Aarch64/Debug.c | 8 +-- uefi-sct/SctPkg/SCRT/SCRTDriver/Aarch64/Dump.c | 8 +-- uefi-sct/SctPkg/SCRT/SCRTDriver/Aarch64/Io.c | 8 +-- uefi-sct/SctPkg/SCRT/SCRTDriver/Aarch64/Io.h | 8 +-- uefi-sct/SctPkg/SCRT/SCRTDriver/{Aarch64 => Riscv64}/Debug.c | 28 - uefi-sct/SctPkg/SCRT/SCRTDriver/{Aarch64 => Riscv64}/Dump.c | 8 +-- uefi-sct/SctPkg/SCRT/SCRTDriver/{Aarch64 => Riscv64}/Io.c | 15 ++--- uefi-sct/SctPkg/SCRT/SCRTDriver/SCRTDriver.inf | 6 ++ uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Aarch64/DebugSupportBBTestCacheFunction.c | 6 +- uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Aarch64/DebugSupportBBTestExceptionCallbackFunction.c | 7 +-- uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/Aarch64/PlatformIsa.c | 6 +- uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/DebugSupportBBTest.inf | 6 ++ uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest
Re: [edk2-devel] [PATCH v1 1/2] BaseTools: Make undefined VFR macro an error (GCC)
It didn't cause any other errors for the huge HPE codebase. Only undefined macros. I don't believe the preprocessor has so many warnings anyways. So -Werror should be fine. From: Feng, Bob C Sent: Monday, March 8, 2021 09:05 To: devel@edk2.groups.io ; Schaefer, Daniel Cc: Liming Gao ; Chen, Christine ; Lin, Derek (HPS SW) Subject: RE: [edk2-devel] [PATCH v1 1/2] BaseTools: Make undefined VFR macro an error (GCC) Hi Derek, -Werror. Make all warnings into errors. Should here be that only treat undef warning as error? Thanks, Bob -Original Message- From: devel@edk2.groups.io On Behalf Of Daniel Schaefer Sent: Tuesday, March 2, 2021 4:22 PM To: devel@edk2.groups.io Cc: Feng, Bob C ; Liming Gao ; Chen, Christine ; Derek Lin Subject: [edk2-devel] [PATCH v1 1/2] BaseTools: Make undefined VFR macro an error (GCC) VFR successfully compiles if we forget to include a header that defines a macro. In that case the HII option was hidden when it shouldn't be just because the macro was used but not defined. The behaviour is totally intended by the C/PP standard. When a macro is undefined it evaluates to 0. GCC, MSVC and Clang have warnings to catch this type of mistake. With this commit we enable this warning and make it a compiler error. Cc: Bob Feng Cc: Liming Gao Cc: Yuwei Chen Cc: Derek Lin --- BaseTools/Conf/tools_def.template | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/BaseTools/Conf/tools_def.template b/BaseTools/Conf/tools_def.template index 933b3160fd2b..728c1d3119e4 100755 --- a/BaseTools/Conf/tools_def.template +++ b/BaseTools/Conf/tools_def.template @@ -3,7 +3,7 @@ # Portions copyright (c) 2008 - 2009, Apple Inc. All rights reserved. # Portions copyright (c) 2011 - 2019, ARM Ltd. All rights reserved. # Copyright (c) 2015, Hewlett-Packard Development Company, L.P. -# (C) Copyright 2020, Hewlett Packard Enterprise Development LP +# (C) Copyright 2020-2021, Hewlett Packard Enterprise Development +LP # Copyright (c) Microsoft Corporation # # SPDX-License-Identifier: BSD-2-Clause-Patent @@ -1938,7 +1938,7 @@ DEFINE GCC_AARCH64_ASLDLINK_FLAGS = DEF(GCC_AARCH64_DLINK_FLAGS) -Wl,--entry,Re DEFINE GCC_IA32_X64_DLINK_FLAGS= DEF(GCC_IA32_X64_DLINK_COMMON) --entry _$(IMAGE_ENTRY_POINT) --file-alignment 0x20 --section-alignment 0x20 -Map $(DEST_DIR_DEBUG)/$(BASE_NAME).map DEFINE GCC_ASM_FLAGS = -c -x assembler -imacros AutoGen.h DEFINE GCC_PP_FLAGS= -E -x assembler-with-cpp -include AutoGen.h -DEFINE GCC_VFRPP_FLAGS = -x c -E -P -DVFRCOMPILE --include $(MODULE_NAME)StrDefs.h +DEFINE GCC_VFRPP_FLAGS = -x c -E -P -DVFRCOMPILE --include $(MODULE_NAME)StrDefs.h -Wundef -Werror DEFINE GCC_ASLPP_FLAGS = -x c -E -include AutoGen.h DEFINE GCC_ASLCC_FLAGS = -x c DEFINE GCC_WINDRES_FLAGS = -J rc -O coff -- 2.30.0 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#72529): https://edk2.groups.io/g/devel/message/72529 Mute This Topic: https://groups.io/mt/81020991/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-
[edk2-devel] [edk2-test PATCHv3 3/5] SctPkg: Add RISCV64 build support
REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3042 Cc: G Edhaya Chandran Cc: Barton Gao Cc: Samer El-Haj-Mahmoud Cc: Eric Jin Cc: Arvin Chen Cc: Leif Lindholm Cc: Heinrich Schuchardt Cc: Abner Chang Signed-off-by: Daniel Schaefer --- uefi-sct/SctPkg/Application/InstallSct/InstallSctDef.h | 4 ++ uefi-sct/SctPkg/Library/SctLib/SctLib.inf | 6 ++ uefi-sct/SctPkg/SCRT/SCRTApp/SCRTApp.inf | 5 ++ uefi-sct/SctPkg/SCRT/SCRTDriver/SCRTDriver.inf | 6 ++ uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/DebugSupport/BlackBoxTest/DebugSupportBBTest.inf | 6 ++ uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/Usb2Hc/BlackBoxTest/Usb2HcTest.inf | 4 ++ uefi-sct/SctPkg/TestCase/UEFI/EFI/Protocol/UsbHc/BlackBoxTest/UsbHcTest.inf | 4 ++ uefi-sct/SctPkg/TestInfrastructure/SCT/Framework/ENTS/EasLib/EntsLib.inf | 5 ++ uefi-sct/SctPkg/Tools/Source/GenBin/GNUmakefile | 4 ++ uefi-sct/SctPkg/UEFI/IHV_SCT.dsc | 17 +- uefi-sct/SctPkg/UEFI/Protocol/DebugSupport.h | 61 +++- uefi-sct/SctPkg/UEFI/UEFI_SCT.dsc | 18 +- uefi-sct/SctPkg/build.sh | 11 +++- 13 files changed, 144 insertions(+), 7 deletions(-) diff --git a/uefi-sct/SctPkg/Application/InstallSct/InstallSctDef.h b/uefi-sct/SctPkg/Application/InstallSct/InstallSctDef.h index a7815580..02f0283e 100644 --- a/uefi-sct/SctPkg/Application/InstallSct/InstallSctDef.h +++ b/uefi-sct/SctPkg/Application/InstallSct/InstallSctDef.h @@ -3,6 +3,7 @@ Copyright 2006 - 2017 Unified EFI, Inc. Copyright (c) 2010 - 2017, Intel Corporation. All rights reserved. Portions copyright (c) 2014, ARM Ltd. All rights reserved. + (C) Copyright 2021 Hewlett Packard Enterprise Development LP This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License @@ -32,6 +33,9 @@ #elif defined(EFIAARCH64) #define INSTALL_SCT_PLATFORM_SHORT_NAME L"aarch64" #define INSTALL_SCT_PLATFORM_NAME L"AARCH64" +#elif defined(EFIRISCV64) + #define INSTALL_SCT_PLATFORM_SHORT_NAME L"riscv64" + #define INSTALL_SCT_PLATFORM_NAME L"RISCV64" #else #error "Architecture not supported" #endif diff --git a/uefi-sct/SctPkg/Library/SctLib/SctLib.inf b/uefi-sct/SctPkg/Library/SctLib/SctLib.inf index 23cb77fb..7527b203 100644 --- a/uefi-sct/SctPkg/Library/SctLib/SctLib.inf +++ b/uefi-sct/SctPkg/Library/SctLib/SctLib.inf @@ -3,6 +3,7 @@ # Copyright 2006 - 2016 Unified EFI, Inc. # Copyright (c) 2013 - 2014, ARM Ltd. All rights reserved. # Copyright (c) 2014 - 2019, Intel Corporation. All rights reserved. +# (C) Copyright 2021 Hewlett Packard Enterprise Development LP # # This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License @@ -62,6 +63,11 @@ Aarch64/initplat.c Math.c +[sources.RISCV64] + Riscv64/SctLibPlat.h + Riscv64/initplat.c + Math.c + [sources.ia32] ia32/SctLibPlat.h ia32/initplat.c diff --git a/uefi-sct/SctPkg/SCRT/SCRTApp/SCRTApp.inf b/uefi-sct/SctPkg/SCRT/SCRTApp/SCRTApp.inf index 7aca6e30..8104a4ef 100644 --- a/uefi-sct/SctPkg/SCRT/SCRTApp/SCRTApp.inf +++ b/uefi-sct/SctPkg/SCRT/SCRTApp/SCRTApp.inf @@ -2,6 +2,7 @@ # # Copyright 2006 - 2016 Unified EFI, Inc. # Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved. +# (C) Copyright 2021 Hewlett Packard Enterprise Development LP # # This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License @@ -39,6 +40,10 @@ Aarch64/GoVirtual.asm | RVCT Aarch64/GoVirtual.S | GCC +[sources.RISCV64] + Riscv64/VirtualMemory.c + Riscv64/GoVirtual.S | GCC + [sources.ia32] ia32/VirtualMemory.c ia32/GoVirtual.asm | MSFT diff --git a/uefi-sct/SctPkg/SCRT/SCRTDriver/SCRTDriver.inf b/uefi-sct/SctPkg/SCRT/SCRTDriver/SCRTDriver.inf index ad0eb0f8..a3ef454e 100644 --- a/uefi-sct/SctPkg/SCRT/SCRTDriver/SCRTDriver.inf +++ b/uefi-sct/SctPkg/SCRT/SCRTDriver/SCRTDriver.inf @@ -2,6 +2,7 @@ # # Copyright 2006 - 2016 Unified EFI, Inc. # Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved. +# (C) Copyright 2021 Hewlett Packard Enterprise Development LP # # This program and the accompanying materials # are licensed and made available under the terms and conditions of the BSD License @@ -69,6 +70,11 @@ Aarch6