[edk2-devel] [PATCH v1 19/34] .azurepipelines: Add LoongArch64 architecture on LoongArch64 EDK2 CI.

2022-09-07 Thread Chao Li
Add LoongArch64 architecture on LoongArch64 EDK2 CI. Cc: Michael D Kinney Cc: Liming Gao Signed-off-by: Chao Li --- .azurepipelines/Ubuntu-GCC5.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.azurepipelines/Ubuntu-GCC5.yml b/.azurepipelines/Ubuntu-GCC5.yml index 376

[edk2-devel] [PATCH v1 20/34] .pytool: Add LoongArch64 architecture on LoongArch64 EDK2 CI.

2022-09-07 Thread Chao Li
Add LoongArch64 architecture on LoongArch64 EDK2 CI testing. Cc: Michael D Kinney Cc: Liming Gao Signed-off-by: Chao Li --- .pytool/CISettings.py | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.pytool/CISettings.py b/.pytool/CISettings.py index cf9e0d77b1..7ebec0ba0a

[edk2-devel] [PATCH v1 21/34] MdePkg: Add LoongArch LOONGARCH64 binding

2022-09-07 Thread Chao Li
Add LOONGARCH64 sections in MdePkg.dec and LOONGARCH64 ProcessorBind.h Cc: Michael D Kinney Cc: Liming Gao Cc: Zhiguang Liu Signed-off-by: Chao Li Co-authored-by: Baoqi Zhang Co-authored-by: Dongyan Qian --- MdePkg/Include/LoongArch64/ProcessorBind.h | 120 + MdePkg/Mde

[edk2-devel] [PATCH v1 22/34] MdePkg/Include: LoongArch definitions.

2022-09-07 Thread Chao Li
Add LoongArch processor related definitions. Cc: Michael D Kinney Cc: Liming Gao Cc: Zhiguang Liu Signed-off-by: Chao Li --- MdePkg/Include/IndustryStandard/PeImage.h | 9 ++ MdePkg/Include/Protocol/DebugSupport.h| 107 -- MdePkg/Include/Protocol/PxeBaseCode.h |

[edk2-devel] [PATCH v1 23/34] MdePkg/BaseLib: BaseLib for LOONGARCH64 architecture.

2022-09-07 Thread Chao Li
Add LoongArch LOONGARCH64 BaseLib functions. Cc: Michael D Kinney Cc: Liming Gao Cc: Zhiguang Liu Signed-off-by: Chao Li Co-authored-by: Baoqi Zhang --- MdePkg/Include/Library/BaseLib.h | 24 ++ MdePkg/Library/BaseLib/BaseLib.inf| 13 + .../BaseLib/LoongArch64/Cpu

[edk2-devel] [PATCH v1 24/34] MdePkg/BaseCacheMaintenanceLib: LoongArch cache maintenance implementation.

2022-09-07 Thread Chao Li
Implement LoongArch cache maintenance functions in BaseCacheMaintenanceLib. Cc: Michael D Kinney Cc: Liming Gao Cc: Zhiguang Liu Signed-off-by: Chao Li --- .../BaseCacheMaintenanceLib.inf | 4 + .../BaseCacheMaintenanceLib/LoongArchCache.c | 252 ++ 2 files c

[edk2-devel] [PATCH v1 25/34] MdePkg/BaseIoLibIntrinsic: IoLibNoIo for LoongArch architecture.

2022-09-07 Thread Chao Li
LoongArch MMIO library instance, use the IoLibNoIo. Cc: Michael D Kinney Cc: Liming Gao Cc: Zhiguang Liu Signed-off-by: Chao Li --- .../Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf | 10 +++--- MdePkg/Library/BaseIoLibIntrinsic/IoLibNoIo.c | 3 ++- 2 files changed, 9 inse

[edk2-devel] [PATCH v1 26/34] MdePkg/BasePeCoff: Add LoongArch PE/Coff related code.

2022-09-07 Thread Chao Li
Add LoongArch image relocation. Cc: Michael D Kinney Cc: Liming Gao Cc: Zhiguang Liu Signed-off-by: Chao Li Co-authored-by: Baoqi Zhang --- MdePkg/Library/BasePeCoffLib/BasePeCoff.c | 3 +- .../Library/BasePeCoffLib/BasePeCoffLib.inf | 5 + .../Library/BasePeCoffLib/BasePeCoffLib.

[edk2-devel] [PATCH v1 27/34] MdePkg/BaseCpuLib: LoongArch Base CPU library implementation.

2022-09-07 Thread Chao Li
Implement LoongArch CPU related functions in BaseCpuLib. Cc: Michael D Kinney Cc: Liming Gao Cc: Zhiguang Liu Signed-off-by: Chao Li --- MdePkg/Library/BaseCpuLib/BaseCpuLib.inf | 7 ++- MdePkg/Library/BaseCpuLib/BaseCpuLib.uni | 5 +++-- MdePkg/Library/BaseCpuLib/Loo

[edk2-devel] [PATCH v1 28/34] MdePkg/BaseSynchronizationLib: LoongArch cache related code.

2022-09-07 Thread Chao Li
Support LoongArch cache related functions. Cc: Michael D Kinney Cc: Liming Gao Cc: Zhiguang Liu Signed-off-by: Chao Li Co-authored-by: Baoqi Zhang --- .../BaseSynchronizationLib.inf| 5 + .../LoongArch64/Synchronization.c | 246 ++ 2 files chang

[edk2-devel] [PATCH v1 29/34] MdePkg/BaseSafeIntLib: Add LoongArch64 architecture for BaseSafeIntLib.

2022-09-07 Thread Chao Li
Add LoongArch64 architecture for BaseSafeIntLib library. Cc: Michael D Kinney Cc: Liming Gao Cc: Zhiguang Liu Signed-off-by: Chao Li --- MdePkg/Library/BaseSafeIntLib/BaseSafeIntLib.inf | 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/MdePkg/Library/BaseSafeIntLib

[edk2-devel] [PATCH v1 30/34] MdeModulePkg/Logo: Add LoongArch64 architecture.

2022-09-07 Thread Chao Li
Add LoongArch64 architecture to the Logo. Cc: Zhichao Gao Cc: Ray Ni Signed-off-by: Chao Li --- MdeModulePkg/Logo/Logo.inf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/MdeModulePkg/Logo/Logo.inf b/MdeModulePkg/Logo/Logo.inf index 70a66cae98..294482ccdc 100644 --- a/Md

[edk2-devel] [PATCH v1 31/34] MdeModulePkg/CapsuleRuntimeDxe: Add LoongArch64 architecture.

2022-09-07 Thread Chao Li
Add LoongArch in INF for building CapsuleRuntimeDxe LoongArch64 image. Cc: Liming Gao Cc: Guomin Jiang Sigend-off-by: Chao Li --- .../Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf| 9 + 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/MdeModulePkg/Universal/Capsul

[edk2-devel] [PATCH v1 32/34] MdeModulePkg/DxeIplPeim : LoongArch DxeIPL implementation.

2022-09-07 Thread Chao Li
Implement LoongArch DxeIPL instance. Cc: Liming Gao Cc: Guomin Jiang Signed-off-by: Chao Li Co-authored-by: Baoqi Zhang --- MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf | 6 +- .../Core/DxeIplPeim/LoongArch64/DxeLoadFunc.c | 63 +++ 2 files changed, 68 insertions(+), 1 dele

[edk2-devel] [PATCH v1 33/34] NetworkPkg: Add LoongArch64 architecture.

2022-09-07 Thread Chao Li
Add LoongArch64 architecture in to NetworkPkg. Cc: Maciej Rabeda Cc: Jiaxin Wu Cc: Siyuan Fu Signed-off-by: Chao Li --- NetworkPkg/Network.dsc.inc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/NetworkPkg/Network.dsc.inc b/NetworkPkg/Network.dsc.inc index 99fad885bf..0

[edk2-devel] [PATCH v1 34/34] BaseTools: Add LoongArch64 binding.

2022-09-07 Thread Chao Li
Add LoongArch64 ProcessorBin.h and add LoongArch to Makefiles. Cc: Bob Feng Cc: Liming Gao Cc: Yuwei Chen Signed-off-by: Chao Li Co-authored-by: Baoqi Zhang --- BaseTools/Source/C/GNUmakefile| 3 + .../C/Include/LoongArch64/ProcessorBind.h | 80 +++ 2 fi

[edk2-devel] [PATCH] MdeModulePkg SmbiosMeasurementDxe: Add Type4 CurrentSpeed to filter table

2022-09-07 Thread Heng Luo
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4051 The Type4 CurrentSpeed field may be various. So this patch adds it into the filter table. Signed-off-by: Heng Luo Cc: Jian J Wang Cc: Liming Gao Cc: Zhiguang Liu Cc: Dandan Bi Cc: Star Zeng Cc: Zhichao Gao --- MdeModulePkg/Universal

Re: [edk2-devel] [PATCH] MdeModulePkg SmbiosMeasurementDxe: Add Type4 CurrentSpeed to filter table

2022-09-07 Thread Yao, Jiewen
Reviewed-by: Jiewen Yao > -Original Message- > From: devel@edk2.groups.io On Behalf Of Heng > Luo > Sent: Thursday, September 8, 2022 1:41 PM > To: devel@edk2.groups.io > Cc: Wang, Jian J ; Gao, Liming > ; Liu, Zhiguang ; Bi, > Dandan ; Zeng, Star ; Gao, > Zhichao > Subject: [edk2-devel

Re: [edk2-devel] [PATCH v2] MdeModulePkg: Use configurable PCD for AHCI command retries

2022-09-07 Thread Wu, Hao A
Reviewed-by: Hao A Wu Best Regards, Hao Wu From: devel@edk2.groups.io On Behalf Of Anbazhagan, Baraneedharan via groups.io Sent: Thursday, September 8, 2022 12:38 PM To: devel@edk2.groups.io Cc: Gao, Liming ; Wu, Hao A ; Ni, Ray Subject: [edk2-devel] [PATCH v2] MdeModulePkg: Use configurable

Re: [edk2-devel] [PATCH] ArmVirtPkg: Fix boot fail on numa system.

2022-09-07 Thread Ard Biesheuvel
On Tue, 5 Jul 2022 at 08:55, Mark-PK Tsai wrote: > > If "numa-node-id" is specified in a memory node, > take node 0 as system memory instead of taking > the first memory node. > > Cc: YJ Chiang Typo in email address > Signed-off-by: Mark-PK Tsai > --- > ArmVirtPkg/PrePi/FdtParser.c | 32 +++

Re: [edk2-devel] [PATCH v2 1/2] ArmPkg: implement EFI_MP_SERVICES_PROTOCOL based on PSCI calls

2022-09-07 Thread Ard Biesheuvel
On Wed, 7 Sept 2022 at 06:35, Rebecca Cran wrote: > > Also, CI is failing in the SpellCheck test because of the > "-mstrict-align" in > ArmPsciMpServicesDxe.inf. > > /home/vsts/work/1/s/ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.inf:55:25 > - Unknown word (mstrict) > > Should I add "

Re: [edk2-devel] [PATCH v1 0/3] EmbeddedPkg: Enable CI

2022-09-07 Thread Ard Biesheuvel
On Wed, 7 Sept 2022 at 04:37, wrote: > > From: Michael Kubacki > > REF:https://bugzilla.tianocore.org/show_bug.cgi?id=4046 > > Adds EmbeddedPkg to edk2 CI. > > Due to a number of build errors (some intentional) such as > 'BUILD_EPOCH' only being defined for GCC in > VirtualRealTimeClockLib.inf, t

Re: [edk2-devel] [PATCH v2 1/1] OvmfPkg/QemuVideoDxe: fix bochs mode init

2022-09-07 Thread Ard Biesheuvel
On Wed, 7 Sept 2022 at 07:17, Gerd Hoffmann wrote: > > Add VgaInb() helper function to read vga registers. With that in place > fix the unblanking. We need to put the ATT_ADDRESS_REGISTER flip flop > into a known state, which is done by reading the > INPUT_STATUS_1_REGISTER. Reading the INPUT_S

Re: [edk2-devel] [PATCH v2 1/2] ArmPkg: implement EFI_MP_SERVICES_PROTOCOL based on PSCI calls

2022-09-07 Thread Ard Biesheuvel
On Wed, 7 Sept 2022 at 06:22, Rebecca Cran wrote: > > Add support for EFI_MP_SERVICES_PROTOCOL during the DXE phase under > AArch64. > > PSCI_CPU_ON is called to power on the core, the supplied procedure is > executed and PSCI_CPU_OFF is called to power off the core. > > Fixes contributed by Ard B

Re: [edk2-devel] [PATCH v1 0/2] MM communicate functionality in variable policy

2022-09-07 Thread Ard Biesheuvel
On Mon, 13 Dec 2021 at 19:23, Kun Qin wrote: > > Hi ArmPkg and MdeModulePkg maintainers, > > Now that the hard freeze is lifted, could you please provide some > feedback on these patches when you have a chance? > My apologies for not responding to these changes. If these patches are still releva

[edk2-devel] [PATCH 0/7] CryptoPkg: Add BigNum and EC support to BaseCryptLib

2022-09-07 Thread yi1 li
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3828 Review PR: https://github.com/tianocore/edk2/pull/3309 This patch sequence is used to add CryptBn and CryptEc library, which are wrapped over OpenSSL. The implementation provides library functions for EFI BaseCrypt protocol and EFI BaseCrypt

[edk2-devel] [PATCH 1/7] CryptoPkg: Add BigNum support

2022-09-07 Thread yi1 li
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3828 This patch is used to add CryptBn library, which is wrapped over OpenSSL. Cc: Jiewen Yao Cc: Jian J Wang Cc: Xiaoyu Lu Cc: Guomin Jiang Signed-off-by: Yi Li --- CryptoPkg/Include/Library/BaseCryptLib.h | 418 + .../Li

[edk2-devel] [PATCH 2/7] CryptoPkg: Add BigNum API to DXE and protocol

2022-09-07 Thread yi1 li
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3828 The implementation provides CryptBn library functions for EFI CryptoDxe and EFI BaseCrypt Protocol. Cc: Jiewen Yao Cc: Jian J Wang Cc: Xiaoyu Lu Cc: Guomin Jiang Signed-off-by: Yi Li --- CryptoPkg/CryptoPkg.dsc

[edk2-devel] [PATCH 3/7] CryptoPkg: Add EC support

2022-09-07 Thread yi1 li
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3828 This patch is used to add CryptEc library, which is wrapped over OpenSSL. Cc: Jiewen Yao Cc: Jian J Wang Cc: Xiaoyu Lu Cc: Guomin Jiang Signed-off-by: Yi Li --- CryptoPkg/Include/Library/BaseCryptLib.h | 424 ++ .../Libr

[edk2-devel] [PATCH 4/7] CryptoPkg: Add EC APIs to DXE and protocol

2022-09-07 Thread yi1 li
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3828 The implementation provides CryptEc library functions for EFI Driveer and EFI BaseCrypt Protocol. Cc: Jiewen Yao Cc: Jian J Wang Cc: Xiaoyu Lu Cc: Guomin Jiang Signed-off-by: Yi Li --- CryptoPkg/CryptoPkg.dsc |

[edk2-devel] [PATCH 5/7] CryptoPkg/Test: Add unit test for CryptoBn

2022-09-07 Thread yi1 li
Add unit test for CryptoBn. Cc: Jiewen Yao Cc: Jian J Wang Cc: Xiaoyu Lu Cc: Guomin Jiang Signed-off-by: Yi Li --- .../BaseCryptLib/UnitTestHostBaseCryptLib.inf | 1 + .../BaseCryptLib/BaseCryptLibUnitTests.c | 1 + .../UnitTest/Library/BaseCryptLib/BnTests.c | 257 +++

[edk2-devel] [PATCH 6/7] CryptoPkg/Test: Add unit test for CryptoEc

2022-09-07 Thread yi1 li
Add unit test for CryptoEc. Cc: Jiewen Yao Cc: Jian J Wang Cc: Xiaoyu Lu Cc: Guomin Jiang Signed-off-by: Yi Li --- .../BaseCryptLib/UnitTestHostBaseCryptLib.inf | 2 + CryptoPkg/Test/CryptoPkgHostUnitTest.dsc | 3 + .../BaseCryptLib/BaseCryptLibUnitTests.c | 1 + .../UnitTest

[edk2-devel] [PATCH 7/7] CryptoPkg: Run uncrustify tools on EC and BN change

2022-09-07 Thread yi1 li
Run uncrustify tools on EC and BN change to meet UEFI code style. Cc: Jiewen Yao Cc: Jian J Wang Cc: Xiaoyu Lu Cc: Guomin Jiang Signed-off-by: Yi Li --- CryptoPkg/Driver/Crypto.c | 2 +- CryptoPkg/Include/Library/BaseCryptLib.h | 8 +- CryptoPkg/Library/BaseCryp

Re: [edk2-devel] [PATCH] EmbeddedPkg/PrePiMemoryAllocationLib: Add check for space on offset allocation

2022-09-07 Thread Ard Biesheuvel
On Thu, 30 Jun 2022 at 21:06, Jeff Brasen wrote: > > Update check for enough space to occur prior to alignment offset. > This prevents cases where EfiFreeMemoryTop < EfiFreeMemoryBottom. > So prior to this patch, we would - check for enough space - apply the alignment - potentially exceed the ava

[edk2-devel] [PATCH v3 1/1] OvmfPkg/QemuVideoDxe: fix bochs mode init

2022-09-07 Thread Gerd Hoffmann
Add VgaInb() helper function to read vga registers. With that in place fix the unblanking. We need to put the ATT_ADDRESS_REGISTER flip flop into a known state, which is done by reading the INPUT_STATUS_1_REGISTER. Reading the INPUT_STATUS_1_REGISTER only works when the device is in color mode,

Re: [edk2-devel] [RFC PATCH 16/17] UefiCpuPkg/CpuDxe: Add RISC-V support in CpuDxe module

2022-09-07 Thread Chang, Abner via groups.io
[AMD Official Use Only - General] Hi Sunil and UefiCpuPkg maintainers, For CpuDxe case, I think we should abstract CpuDxe to accommodate all processor architectures instead of having copy for each archs. CpuDxeCommon.c can have the generic protocol structure and the installation functions, and

Re: [edk2-devel] [PATCH v3 1/1] OvmfPkg/QemuVideoDxe: fix bochs mode init

2022-09-07 Thread Ard Biesheuvel
On Wed, 7 Sept 2022 at 11:15, Gerd Hoffmann wrote: > > Add VgaInb() helper function to read vga registers. With that in place > fix the unblanking. We need to put the ATT_ADDRESS_REGISTER flip flop > into a known state, which is done by reading the > INPUT_STATUS_1_REGISTER. Reading the INPUT_S

Re: [edk2-devel] [PATCH v3 1/1] OvmfPkg/QemuVideoDxe: fix bochs mode init

2022-09-07 Thread Gerd Hoffmann
On Wed, Sep 07, 2022 at 11:15:04AM +0200, Gerd Hoffmann wrote: > Add VgaInb() helper function to read vga registers. With that in place > fix the unblanking. We need to put the ATT_ADDRESS_REGISTER flip flop > into a known state, which is done by reading the > INPUT_STATUS_1_REGISTER. Reading th

Re: [edk2-devel] [PATCH v2 0/6] ArmPkg/SMBIOS fixes and improvements

2022-09-07 Thread Sami Mujawar
Hi Nhi, I was building this patch series and realised that merging this patch series will break the SbsaQemu platform builds. Would you be submitting a patch to update SbsaQemu platform to match this series, please? Also, can you check if this patch breaks any other platform. Regards, Sami Mu

[edk2-devel] [RFC PATCH V2 00/19] Refactor and add RISC-V support in edk2 repo

2022-09-07 Thread Sunil V L
RISC-V ProcessorPkg and PlatformPkg were added in edk2-platforms repo. But the recommendation was they should be added in edk2 repo itself leveraging common packages as much as possible. This series tries to create RISC-V specific modules and libraries under standard packages. The approach taken h

[edk2-devel] [RFC PATCH V2 01/19] MdePkg/Register: Add register definition header files for RISC-V

2022-09-07 Thread Sunil V L
Add register definitions and access routines for RISC-V. These headers are leveraged from opensbi repo. Signed-off-by: Sunil V L --- MdePkg/Include/Register/RiscV64/RiscVAsm.h | 104 MdePkg/Include/Register/RiscV64/RiscVConst.h| 46 +++ MdePkg/Include/Register/Risc

[edk2-devel] [RFC PATCH V2 02/19] MdePkg/MdePkg.dec: Add RISCV_EFI_BOOT_PROTOCOL GUID

2022-09-07 Thread Sunil V L
RISC-V UEFI based platforms need to support RISCV_EFI_BOOT_PROTOCOL. Add this protocol GUID definition. Signed-off-by: Sunil V L --- MdePkg/MdePkg.dec | 6 ++ 1 file changed, 6 insertions(+) diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec index f1ebf9e251c1..8f1bcfdc3e97 100644 --- a/Mde

[edk2-devel] [RFC PATCH V2 03/19] MdePkg/Protocol: Add RiscVBootProtocol.h

2022-09-07 Thread Sunil V L
RISC-V UEFI platforms need to implement RISCV_EFI_BOOT_PROTOCOL. Add header file with the definitions of this protocol. Signed-off-by: Sunil V L --- MdePkg/Include/Protocol/RiscVBootProtocol.h | 35 1 file changed, 35 insertions(+) diff --git a/MdePkg/Include/Protocol/RiscV

[edk2-devel] [RFC PATCH V2 04/19] MdeModulePkg/MdeModulePkg.dec: Add PCD variables for RISC-V

2022-09-07 Thread Sunil V L
Add few PCD variables for RISC-V platforms to indicate the memory locations of the firmware volumes, temporary RAM etc. Signed-off-by: Sunil V L --- MdeModulePkg/MdeModulePkg.dec | 13 + 1 file changed, 13 insertions(+) diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeMo

[edk2-devel] [RFC PATCH V2 05/19] UefiCpuPkg.dec: Add PCD variable for RISC-V

2022-09-07 Thread Sunil V L
RISC-V platforms need PCD variable to indicate the mtimer frequency which will be consumed by CpuDxe and TimerLib. Signed-off-by: Sunil V L --- UefiCpuPkg/UefiCpuPkg.dec | 3 +++ 1 file changed, 3 insertions(+) diff --git a/UefiCpuPkg/UefiCpuPkg.dec b/UefiCpuPkg/UefiCpuPkg.dec index 718323d9042

[edk2-devel] [RFC PATCH V2 06/19] MdePkg/BaseLib: RISC-V: Add generic CPU related functions

2022-09-07 Thread Sunil V L
EDK2 in S-mode needs to use SSCRATCH register. Implement functions to set/get the SSCRATCH register. Signed-off-by: Sunil V L --- MdePkg/Library/BaseLib/BaseLib.inf | 1 + MdePkg/Include/Library/BaseLib.h| 10 ++ MdePkg/Library/BaseLib/RiscV64/CpuGen.S | 33

[edk2-devel] [RFC PATCH V2 07/19] MdePkg: Add ArchTimerLib library

2022-09-07 Thread Sunil V L
This library implements the TimerLib.h functionality. This library is similar to CpuTimerLib but needs the library constructor. Signed-off-by: Sunil V L --- MdePkg/Library/ArchTimerLib/ArchTimerLib.inf | 40 +++ MdePkg/Library/ArchTimerLib/RiscV64/CpuTimerLib.c | 299

[edk2-devel] [RFC PATCH V2 08/19] MdePkg: Add RiscVSbiLib Library for RISC-V

2022-09-07 Thread Sunil V L
This library is required to make SBI ecalls from the S-mode EDK2. Signed-off-by: Sunil V L --- MdePkg/Library/RiscVSbiLib/RiscVSbiLib.inf | 27 +++ MdePkg/Include/Library/RiscVSbiLib.h | 129 +++ MdePkg/Library/RiscVSbiLib/RiscVSbiLib.c | 228 3 files change

[edk2-devel] [RFC PATCH V2 09/19] UefiCpuPkg: Update Sources in DxeCpuExceptionHandlerLib.inf

2022-09-07 Thread Sunil V L
Currently the common sources mean x86 only in this library. To add support for other architectures like RISC-V, we need to build these files only for x86. Signed-off-by: Sunil V L --- UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuExceptionHandlerLib.inf | 6 -- 1 file changed, 4 insertion

[edk2-devel] [RFC PATCH V2 10/19] UefiCpuPkg: Add RISC-V support in DxeCpuExceptionHandlerLib

2022-09-07 Thread Sunil V L
Add low level interfaces to register exception and interrupt handlers for RISC-V. Signed-off-by: Sunil V L --- UefiCpuPkg/Library/CpuExceptionHandlerLib/DxeCpuExceptionHandlerLib.inf| 7 +- UefiCpuPkg/Library/CpuExceptionHandlerLib/RiscV64/CpuExceptionHandlerLib.h | 112

[edk2-devel] [RFC PATCH V2 11/19] MdePkg/Library: Add ResetSystemLib library

2022-09-07 Thread Sunil V L
This library implements system reset interfaces like cold reboot, warm reboot etc. On RISC-V platforms, these are implemented using SBI calls. Signed-off-by: Sunil V L --- MdePkg/Library/ResetSystemLib/ResetSystemLib.inf | 35 ++ MdePkg/Library/ResetSystemLib/RiscV64/ResetSystemLib.c

[edk2-devel] [RFC PATCH V2 12/19] UefiCpuPkg/SecCore: Add SEC startup code for RISC-V

2022-09-07 Thread Sunil V L
Generic RISC-V platforms will start in S-mode directly. Previous M-mode firmware like opensbi will branch to the entry point in this module. This module initializes the firmware context pointer and branches to the PEI phase. Signed-off-by: Sunil V L --- UefiCpuPkg/SecCore/SecCoreRiscV.inf | 5

[edk2-devel] [RFC PATCH V2 13/19] MdePkg: Add PlatformPeiLib library

2022-09-07 Thread Sunil V L
This library is required in RISC-V to build the FDT Hob. The library can be leveraged by other architectures like ARM if required. Signed-off-by: Sunil V L --- MdePkg/Library/PlatformPeiLib/PlatformPeiLib.inf | 40 MdePkg/Include/Library/PlatformPeiLib.h| 15 ++

[edk2-devel] [RFC PATCH V2 14/19] MdeModulePkg/Universal: Add PlatformPei module for RISC-V

2022-09-07 Thread Sunil V L
Thie PEIM is required to do platform specific initialization like detecting the permanent memory and install memory HOB, install the FDT Hob etc. Signed-off-by: Sunil V L --- MdeModulePkg/Universal/PlatformPei/PlatformPei.inf | 65 MdeModulePkg/Universal/PlatformPei/RiscV64/Platform.h

[edk2-devel] [RFC PATCH V2 15/19] UefiCpuPkg/CpuDxe: Refactor to allow other CPU architectures

2022-09-07 Thread Sunil V L
Currently, CpuDxe driver is mostly x86 specific. Refactor the INF to allow other architectures like RISC-V. Signed-off-by: Sunil V L --- UefiCpuPkg/CpuDxe/CpuDxe.inf | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/UefiCpuPkg/CpuDxe/CpuDxe.inf b/UefiCpuPkg/CpuDxe/

[edk2-devel] [RFC PATCH V2 16/19] UefiCpuPkg/CpuDxe: Add RISC-V support in CpuDxe module

2022-09-07 Thread Sunil V L
This DXE module initializes the RISC-V CPU by installing the CPU specific ARCH protocol handlers. This also initializes the RISCV_EFI_BOOT_PROTOCOL which is required on RISC-V platforms. Signed-off-by: Sunil V L --- UefiCpuPkg/CpuDxe/CpuDxe.inf | 16 +- UefiCpuPkg/CpuDxe/RiscV64/CpuDxe.h

[edk2-devel] [RFC PATCH V2 17/19] MdeModulePkg/Universal: Add TimerDxe module

2022-09-07 Thread Sunil V L
This DXE module initializes the timer interrupt handler and installs the Arch Timer protocol. Signed-off-by: Sunil V L --- MdeModulePkg/Universal/TimerDxe/TimerDxe.inf| 52 MdeModulePkg/Universal/TimerDxe/RiscV64/Timer.h | 174 MdeModulePkg/Universal/TimerDxe/RiscV64/Timer

[edk2-devel] [RFC PATCH V2 18/19] RISC-V: Add Qemu Virt platform support

2022-09-07 Thread Sunil V L
Add build infrastructure files to boot qemu virt machine. EDK2 will boot as S-mode payload of opensbi. There is no integrated opensbi (M-mode firmware) within EDK2 for virt machine. It relies on the RISC-V calling convention that M-mode firmware like opensbi will pass the BootHartId and the DTB t

[edk2-devel] [RFC PATCH V2 19/19] Maintainers.txt: Add entry for new OvmfPkg/RiscVVirt

2022-09-07 Thread Sunil V L
Signed-off-by: Sunil V L --- Maintainers.txt | 4 1 file changed, 4 insertions(+) diff --git a/Maintainers.txt b/Maintainers.txt index 73ce13126b37..60610e83bbf1 100644 --- a/Maintainers.txt +++ b/Maintainers.txt @@ -528,6 +528,10 @@ F: OvmfPkg/XenResetVector/ R: Anthony Perard [sheep] R

Re: [edk2-devel] [RFC PATCH 16/17] UefiCpuPkg/CpuDxe: Add RISC-V support in CpuDxe module

2022-09-07 Thread Sunil V L
On Wed, Sep 07, 2022 at 09:32:12AM +, Chang, Abner wrote: > [AMD Official Use Only - General] > > Hi Sunil and UefiCpuPkg maintainers, > For CpuDxe case, I think we should abstract CpuDxe to accommodate all > processor architectures instead of having copy for each archs. CpuDxeCommon.c > can

Re: [edk2-devel] [PATCH v2 0/6] ArmPkg/SMBIOS fixes and improvements

2022-09-07 Thread Nhi Pham via groups.io
Thanks, Sami. I will check and submit the patch for edk2-platforms to fix it. Nhi On 9/7/2022 5:49 PM, Sami Mujawar wrote: Hi Nhi, I was building this patch series and realised that merging this patch series will break the SbsaQemu platform builds. Would you be submitting a patch to update S

[edk2-devel] [RFC PATCH V2 00/19] Refactor and add RISC-V support in edk2 repo

2022-09-07 Thread Sunil V L
RISC-V ProcessorPkg and PlatformPkg were added in edk2-platforms repo. But the recommendation was they should be added in edk2 repo itself leveraging common packages as much as possible. This series tries to create RISC-V specific modules and libraries under standard packages. The approach taken h

[edk2-devel] [RFC PATCH V2 01/19] MdePkg/Register: Add register definition header files for RISC-V

2022-09-07 Thread Sunil V L
Add register definitions and access routines for RISC-V. These headers are leveraged from opensbi repo. Signed-off-by: Sunil V L --- MdePkg/Include/Register/RiscV64/RiscVAsm.h | 104 MdePkg/Include/Register/RiscV64/RiscVConst.h| 46 +++ MdePkg/Include/Register/Risc

<    1   2