Re: [edk2-devel] [PATCH v4 3/4] UefiCpuPkg: RISC-V: MMU: Support Svpbmt extension

2024-04-02 Thread Tuan Phan
On Tue, Mar 19, 2024 at 9:45 AM Tuan Phan via groups.io wrote: > Hi Sunil, > > On Mon, Mar 18, 2024 at 6:00 AM Sunil V L > wrote: > >> Hi Tuan, >> >> On Thu, Mar 14, 2024 at 01:19:16PM -0700, Tuan Phan wrote: >> > The GCD EFI_MEMORY_UC and EFI_MEMORY_W

Re: [edk2-devel] [PATCH v4 3/4] UefiCpuPkg: RISC-V: MMU: Support Svpbmt extension

2024-03-19 Thread Tuan Phan
Hi Sunil, On Mon, Mar 18, 2024 at 6:00 AM Sunil V L wrote: > Hi Tuan, > > On Thu, Mar 14, 2024 at 01:19:16PM -0700, Tuan Phan wrote: > > The GCD EFI_MEMORY_UC and EFI_MEMORY_WC memory attributes will be > > supported when Svpbmt extension available. > > > >

[edk2-devel] [PATCH v4 3/4] UefiCpuPkg: RISC-V: MMU: Support Svpbmt extension

2024-03-14 Thread Tuan Phan
The GCD EFI_MEMORY_UC and EFI_MEMORY_WC memory attributes will be supported when Svpbmt extension available. Cc: Gerd Hoffmann Cc: Laszlo Ersek Cc: Rahul Kumar Cc: Ray Ni Signed-off-by: Tuan Phan --- .../Library/BaseRiscVMmuLib/BaseRiscVMmuLib.c | 106 ++ .../BaseRiscVMmuLib

[edk2-devel] [PATCH v4 1/4] MdePkg.dec: RISC-V: Define override bit for Svpbmt extension

2024-03-14 Thread Tuan Phan
Define the BIT 2 as the override bit for Svpbmt extension. This will be used by RISC-V MMU library to support EFI_MEMORY_UC and EFI_MEMORY_WC. Cc: Liming Gao Cc: Michael D Kinney Cc: Zhiguang Liu Reviewed-by: Laszlo Ersek Signed-off-by: Tuan Phan --- MdePkg/MdePkg.dec | 2 ++ 1 file changed

[edk2-devel] [PATCH v4 2/4] UefiCpuPkg: RISC-V: MMU: Explictly use UINT64 instead of UINTN

2024-03-14 Thread Tuan Phan
While UINTN defined for RISC-V 64 bits is UINT64, explictly using UINT64 for those variables that clearly are UINT64. Cc: Gerd Hoffmann Cc: Laszlo Ersek Cc: Rahul Kumar Cc: Ray Ni Signed-off-by: Tuan Phan --- .../Library/BaseRiscVMmuLib/BaseRiscVMmuLib.c | 158 +- 1 file

[edk2-devel] [PATCH v4 4/4] OvmfPkg/RiscVVirt: Disable Svpbmt extension

2024-03-14 Thread Tuan Phan
Disable Svpbmt extension as QEMU not enables it in default config. Cc: Andrei Warkentin Cc: Ard Biesheuvel Cc: Gerd Hoffmann Cc: Jiewen Yao Cc: Sunil V L Reviewed-by: Laszlo Ersek Signed-off-by: Tuan Phan --- OvmfPkg/RiscVVirt/RiscVVirt.dsc.inc | 2 +- 1 file changed, 1 insertion(+), 1

[edk2-devel] [PATCH v4 0/4] RISC-V: Support Svpbmt extension

2024-03-14 Thread Tuan Phan
: - Generated patch for each package. Tuan Phan (4): MdePkg.dec: RISC-V: Define override bit for Svpbmt extension UefiCpuPkg: RISC-V: MMU: Explictly use UINT64 instead of UINTN UefiCpuPkg: RISC-V: MMU: Support Svpbmt extension OvmfPkg/RiscVVirt: Disable Svpbmt extension MdePkg/MdePkg.dec

Re: [edk2-devel] [PATCH v3 2/3] UefiCpuPkg: RISC-V: MMU: Support Svpbmt extension

2024-03-07 Thread Tuan Phan
On Mon, Mar 4, 2024 at 10:01 AM Laszlo Ersek wrote: > On 3/2/24 00:20, Tuan Phan wrote: > > Thanks for the detailed review. Please see my comments below. > > > > On Fri, Mar 1, 2024 at 4:14 AM Laszlo Ersek > <mailto:ler...@redhat.com>> wrote: > > &

Re: [edk2-devel] [PATCH v3 2/3] UefiCpuPkg: RISC-V: MMU: Support Svpbmt extension

2024-03-01 Thread Tuan Phan
Thanks for the detailed review. Please see my comments below. On Fri, Mar 1, 2024 at 4:14 AM Laszlo Ersek wrote: > On 3/1/24 02:29, Tuan Phan wrote: > > The GCD EFI_MEMORY_UC and EFI_MEMORY_WC memory attributes will be > > supported when Svpbmt extension available. > >

[edk2-devel] [PATCH v3 3/3] OvmfPkg/RiscVVirt: Disable Svpbmt extension

2024-02-29 Thread Tuan Phan
Disable Svpbmt extension as QEMU not enables it in default config. Cc: Andrei Warkentin Cc: Ard Biesheuvel Cc: Gerd Hoffmann Cc: Jiewen Yao Cc: Sunil V L Reviewed-by: Laszlo Ersek Signed-off-by: Tuan Phan --- OvmfPkg/RiscVVirt/RiscVVirt.dsc.inc | 2 +- 1 file changed, 1 insertion(+), 1

[edk2-devel] [PATCH v3 2/3] UefiCpuPkg: RISC-V: MMU: Support Svpbmt extension

2024-02-29 Thread Tuan Phan
The GCD EFI_MEMORY_UC and EFI_MEMORY_WC memory attributes will be supported when Svpbmt extension available. Cc: Gerd Hoffmann Cc: Laszlo Ersek Cc: Rahul Kumar Cc: Ray Ni Signed-off-by: Tuan Phan --- .../Library/BaseRiscVMmuLib/BaseRiscVMmuLib.c | 101 +++--- .../BaseRiscVMmuLib

[edk2-devel] [PATCH v3 1/3] MdePkg.dec: RISC-V: Define override bit for Svpbmt extension

2024-02-29 Thread Tuan Phan
Define the BIT 2 as the override bit for Svpbmt extension. This will be used by RISC-V MMU library to support EFI_MEMORY_UC and EFI_MEMORY_WC. Cc: Liming Gao Cc: Michael D Kinney Cc: Zhiguang Liu Reviewed-by: Laszlo Ersek Signed-off-by: Tuan Phan --- MdePkg/MdePkg.dec | 2 ++ 1 file changed

[edk2-devel] [PATCH v3 0/3] RISC-V: Support Svpbmt extension

2024-02-29 Thread Tuan Phan
This series adds support for RISC-V Svpbmt extension. The GCD EFI_MEMORY_UC and EFI_MEMORY_WC attributes will be mapped to IO and NC mode defined in PBMT field. v3: - Addressed Laszlo's comments. v2: - Generated patch for each package. Tuan Phan (3): MdePkg.dec: RISC-V: Define override

Re: [edk2-devel] [PATCH v2 2/3] UefiCpuPkg: RISC-V: MMU: Support Svpbmt extension

2024-02-28 Thread Tuan Phan
On Wed, Feb 7, 2024 at 10:15 AM Laszlo Ersek wrote: > On 2/7/24 02:29, Tuan Phan wrote: > > The GCD EFI_MEMORY_UC and EFI_MEMORY_WC attributes will be > > supported when Svpbmt extension available. > > > > Signed-off-by: Tuan Phan > > --- > > .../Library

Re: [edk2-devel] [PATCH v2 0/3] RISC-V: Support Svpbmt extension

2024-02-28 Thread Tuan Phan
On Tue, Feb 27, 2024 at 8:42 PM Sunil V L wrote: > Hi Tuan, > > On Mon, Feb 26, 2024 at 08:34:22PM -0800, Tuan Phan wrote: > > Hi Sunil/ Andrei, > > Any comments on this series? > > > Did I miss your response to Laszlo's feedback on PATCH 2 - [1]? Apart > f

Re: [edk2-devel] [PATCH v2 0/3] RISC-V: Support Svpbmt extension

2024-02-26 Thread Tuan Phan
Hi Sunil/ Andrei, Any comments on this series? Regards, On Wed, Feb 14, 2024 at 10:16 PM Tuan Phan via groups.io wrote: > > > On Wed, Feb 14, 2024 at 9:43 PM Warkentin, Andrei < > andrei.warken...@intel.com> wrote: > >> Do you mind sharing a GH branch wit

[edk2-devel] [PATCH v2] OvmfPkg: RiscVVirt: Fix network drivers not be built

2024-01-12 Thread Tuan Phan
Only need to include Network.dsc.inc to have all network drivers/components be built. Otherwise, there were missing definition that prevent them from be built for RiscVVirt platform. Signed-off-by: Tuan Phan --- v2: - Rebase OvmfPkg/RiscVVirt/RiscVVirtQemu.dsc | 15 +-- 1 file

Re: [edk2-devel] [PATCH v3 7/7] OvmfPkg/RiscVVirt: SEC: Add IO memory resource hob for platform devices

2023-12-14 Thread Tuan Phan
as MMIO are specifically non-memory mappings that need to be present during > OS use of RT services. It’s probably a good idea to avoid using MMIO > regions for all I/O used by Boot Services. > > > Agree. Will post a patch to fix it. > A > > > > > > *From:* Tuan

Re: [edk2-devel] [PATCH v3 2/2] StandaloneMmPkg: Arm: Update to use the new StandaloneMmCpu driver

2023-10-18 Thread Tuan Phan
Hi Sami, Not sure if you can merge this series or let me know who can do it. Thanks, From: Sami Mujawar Date: Thursday, October 5, 2023 at 4:12 AM To: Tuan Phan , devel@edk2.groups.io Cc: ardb+tianoc...@kernel.org , ray...@intel.com , huangm...@linux.alibaba.com , suni...@ventanamicro.com

Re: [edk2-devel] [PATCH] UefiCpuPkg: RISC-V: MMU: Introduce a PCD for SATP mode

2023-10-04 Thread Tuan Phan
https://github.com/pttuan/edk2.git branch: tphan/riscv_mmu_new_pcd From: devel@edk2.groups.io on behalf of Andrei Warkentin Date: Wednesday, October 4, 2023 at 11:42 AM To: Tuan Phan , devel@edk2.groups.io Cc: Kinney, Michael D , Gao, Liming , Liu, Zhiguang , suni...@ventanamicro.com , g

[edk2-devel] [PATCH v2] UefiCpuPkg: RISC-V: MMU: Introduce a PCD for SATP mode

2023-10-04 Thread Tuan Phan
Introduce a PCD to control the maximum SATP mode that MMU allowed to use. This PCD helps RISC-V platform set bare or minimum SATP mode during bring up to debug memory map issue. Signed-off-by: Tuan Phan Reviewed-by: Dhaval Sharma --- Changes: V2 - Changed default mode to SV57 UefiCpuPkg

Re: [edk2-devel] [PATCH] UefiCpuPkg: RISC-V: MMU: Introduce a PCD for SATP mode

2023-10-04 Thread Tuan Phan
If we agree that default should be 10 then i will change it in the next version. On Wed, Oct 4, 2023 at 4:36 AM Sunil V L wrote: > Hi Tuan, > > Thanks for the patch!. Adding UefiCpuPkg maintainers. > > On Tue, Oct 03, 2023 at 02:00:21PM -0700, Tuan Phan wrote: > > Intro

[edk2-devel] [PATCH] UefiCpuPkg: RISC-V: MMU: Introduce a PCD for SATP mode

2023-10-03 Thread Tuan Phan
Introduce a PCD to control the maximum SATP mode that MMU allowed to use. This PCD helps RISC-V platform set bare or minimum SATA mode during bring up to debug memory map issue. Signed-off-by: Tuan Phan --- UefiCpuPkg/Library/BaseRiscVMmuLib/BaseRiscVMmuLib.c | 6 +- UefiCpuPkg/Library

Re: [edk2-devel] [PATCH v2 2/2] StandaloneMmPkg: Arm: Update to use the new StandaloneMmCpu driver

2023-09-28 Thread Tuan Phan
Hi Sami, I just sent the V3 series to address your comments. Regards, On Thu, Sep 28, 2023 at 11:16 AM Tuan Phan via groups.io wrote: > Hi Sami, > Please see my comments below. > > On Thu, Sep 28, 2023 at 9:16 AM Sami Mujawar wrote: > >> Hi Tuan, >> >> Thank

[edk2-devel] [PATCH v3 2/2] StandaloneMmPkg: Arm: Update to use the new StandaloneMmCpu driver

2023-09-28 Thread Tuan Phan
Update entry point library for Arm to use the new architecture independent StandaloneMmCpu driver. Signed-off-by: Tuan Phan Reviewed-by: levi.yun --- .../Library/Arm/StandaloneMmCoreEntryPoint.h | 17 + .../Arm/CreateHobList.c | 43 ++-- .../Arm

[edk2-devel] [PATCH v3 1/2] StandaloneMmPkg: Make StandaloneMmCpu driver architecture independent

2023-09-28 Thread Tuan Phan
StandaloneMmCpu now can supports more architectures like RISC-V besides ARM/AARCH64. Signed-off-by: Tuan Phan Reviewed-by: levi.yun Reviewed-by: Sami Mujawar --- .../Drivers/StandaloneMmCpu/EventHandle.c | 25 +++ .../Drivers/StandaloneMmCpu/StandaloneMmCpu.c | 42

[edk2-devel] [PATCH v3 0/2] Make StandaloneMmCpu architecture independent

2023-09-28 Thread Tuan Phan
Sami's comments. V2: - Seperated changes between CPU driver and Arm entry point library. Tuan Phan (2): StandaloneMmPkg: Make StandaloneMmCpu driver architecture independent StandaloneMmPkg: Arm: Update to use the new StandaloneMmCpu driver .../Drivers/StandaloneMmCpu/EventHandle.c | 25

Re: [edk2-devel] [PATCH v2 2/2] StandaloneMmPkg: Arm: Update to use the new StandaloneMmCpu driver

2023-09-28 Thread Tuan Phan
Hi Sami, Please see my comments below. On Thu, Sep 28, 2023 at 9:16 AM Sami Mujawar wrote: > Hi Tuan, > > Thank you for this patch. > > Please see my response inline marked [SAMI]. > > Regards, > > Sami Mujawar > > On 15/09/2023 12:10 am, Tuan Phan wrote: >

Re: [edk2-devel] [PATCH v2 0/2] StandaloneMmPkg: Make StandaloneMmCpu platform

2023-09-26 Thread Tuan Phan
Hi Sami/Yeo Do you have any comments on this series? Regards, On Thu, Sep 14, 2023 at 4:10 PM Tuan Phan wrote: > This series makes StandaloneMmCpu platform independent so that > other platforms besides ARM/AARCH64 can use it without creating > new driver. > > There are two parts

[edk2-devel] [PATCH v2 0/2] StandaloneMmPkg: Make StandaloneMmCpu platform

2023-09-14 Thread Tuan Phan
This series makes StandaloneMmCpu platform independent so that other platforms besides ARM/AARCH64 can use it without creating new driver. There are two parts in this series: 1. Remove ARM/AARCH64 code from StandaloneMmCpu. 2. Update ARM/AARCH64 entry point library code. Tuan Phan (2

[edk2-devel] [PATCH v2 2/2] StandaloneMmPkg: Arm: Update to use the new StandaloneMmCpu driver

2023-09-14 Thread Tuan Phan
Update entry point library for Arm to use the new platform independent StandaloneMmCpu driver. Signed-off-by: Tuan Phan --- .../Library/Arm/StandaloneMmCoreEntryPoint.h | 17 ++-- .../Arm/CreateHobList.c | 43 ++- .../Arm/StandaloneMmCoreEntryPoint.c

[edk2-devel] [PATCH v2 1/2] StandaloneMmPkg: Make StandaloneMmCpu driver platform independent

2023-09-14 Thread Tuan Phan
StandaloneMmCpu now can supports more platforms like RISC-V besides ARM/AARCH64. Signed-off-by: Tuan Phan --- .../Drivers/StandaloneMmCpu/EventHandle.c | 25 +++ .../Drivers/StandaloneMmCpu/StandaloneMmCpu.c | 42 +-- .../StandaloneMmCpu/StandaloneMmCpu.inf

Re: [edk2-devel] [PATCH] StandaloneMmPkg: Make StandaloneMmCpu driver platform independent

2023-09-08 Thread Tuan Phan
On Fri, Sep 8, 2023 at 12:12 AM Yeo Reum Yun wrote: > > Signed-off-by: Tuan Phan > > --- > > .../Drivers/StandaloneMmCpu/EventHandle.c | 25 +++ > > .../Drivers/StandaloneMmCpu/StandaloneMmCpu.c | 42 +- > > .../StandaloneMmCpu/

[edk2-devel] [PATCH] StandaloneMmPkg: Make StandaloneMmCpu driver platform independent

2023-09-06 Thread Tuan Phan
StandaloneMmCpu now can supports more platforms like RISC-V besides ARM/AARCH64. Signed-off-by: Tuan Phan --- .../Drivers/StandaloneMmCpu/EventHandle.c | 25 +++ .../Drivers/StandaloneMmCpu/StandaloneMmCpu.c | 42 +- .../StandaloneMmCpu/StandaloneMmCpu.inf | 9

Re: [edk2-devel] [PATCH v4 7/7] UefiCpuPkg: RISC-V: Support MMU with SV39/48/57 mode

2023-07-14 Thread Tuan Phan
On Fri, Jul 14, 2023 at 3:24 AM Sunil V L wrote: > On Fri, Jun 23, 2023 at 11:39:34AM -0700, Tuan Phan wrote: > > During CpuDxe initialization, MMU will be setup with the highest > > mode that HW supports. > > > > Reviewed-by: Andrei Warkentin > > Signed-off

[edk2-devel] [PATCH v5 7/7] UefiCpuPkg: RISC-V: Support MMU with SV39/48/57 mode

2023-07-14 Thread Tuan Phan
During CpuDxe initialization, MMU will be setup with the highest mode that HW supports. Signed-off-by: Tuan Phan Reviewed-by: Andrei Warkentin --- OvmfPkg/RiscVVirt/RiscVVirt.dsc.inc | 1 + UefiCpuPkg/CpuDxeRiscV64/CpuDxe.c | 9 +- UefiCpuPkg/CpuDxeRiscV64/CpuDxe.h

[edk2-devel] [PATCH v5 6/7] OvmfPkg: RiscVVirt: Remove satp bare mode setting

2023-07-14 Thread Tuan Phan
There is no point to set satp to bare mode as that should be the default mode when booting edk2. Signed-off-by: Tuan Phan Reviewed-by: Andrei Warkentin Reviewed-by: Sunil V L --- OvmfPkg/RiscVVirt/Sec/Memory.c | 18 ++ 1 file changed, 2 insertions(+), 16 deletions(-) diff

[edk2-devel] [PATCH v5 5/7] OvmfPkg/RiscVVirt: Add VirtNorFlashDxe to APRIORI list

2023-07-14 Thread Tuan Phan
Make sure VirtNorFlashDxe loaded before VariableRuntimeDxe as it is the backend flash driver. Signed-off-by: Tuan Phan --- OvmfPkg/RiscVVirt/RiscVVirtQemu.fdf | 10 ++ 1 file changed, 10 insertions(+) diff --git a/OvmfPkg/RiscVVirt/RiscVVirtQemu.fdf b/OvmfPkg/RiscVVirt

[edk2-devel] [PATCH v5 4/7] OvmfPkg/RiscVVirt: SEC: Add IO memory resource hob for platform devices

2023-07-14 Thread Tuan Phan
Normally, DXE driver would add device resource to GCD before start using. But some key resources such as uart used for printing info at very early stage. Those resources should be populated to HOB in SEC phase so they are added to GCD before MMU enabled. Signed-off-by: Tuan Phan Reviewed

[edk2-devel] [PATCH v5 3/7] OvmfPkg/RiscVVirt: VirtNorFlashPlatformLib: Fix wrong flash size

2023-07-14 Thread Tuan Phan
The size should be for single region, not the whole firmware FD. Signed-off-by: Tuan Phan Reviewed-by: Andrei Warkentin Reviewed-by: Sunil V L --- .../Library/VirtNorFlashPlatformLib/VirtNorFlashStaticLib.c| 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/OvmfPkg

[edk2-devel] [PATCH v5 2/7] MdePkg/Register: RISC-V: Add satp mode bits shift definition

2023-07-14 Thread Tuan Phan
The satp mode bits shift is used cross modules. It should be defined in one place. Signed-off-by: Tuan Phan Reviewed-by: Andrei Warkentin Reviewed-by: Sunil V L Reviewed-by: Michael D Kinney --- MdePkg/Include/Register/RiscV64/RiscVEncoding.h | 7 --- 1 file changed, 4 insertions(+), 3

[edk2-devel] [PATCH v5 1/7] MdePkg/BaseLib: RISC-V: Support getting satp register value

2023-07-14 Thread Tuan Phan
Add an API to retrieve satp register value. Signed-off-by: Tuan Phan Reviewed-by: Andrei Warkentin Reviewed-by: Sunil V L --- MdePkg/Include/Library/BaseLib.h | 5 + MdePkg/Library/BaseLib/RiscV64/RiscVMmu.S | 8 2 files changed, 13 insertions(+) diff --git a/MdePkg

[edk2-devel] [PATCH v5 0/7] Add RISC-V MMU support

2023-07-14 Thread Tuan Phan
master. - Added VirtNorFlashDxe to APRIORI DXE list. Changes in v3: - Move MMU library to UefiCpuPkg. - Add Andrei reviewed-by. Changes in v2: - Move MMU core to a library. - Setup SATP mode as highest possible that HW supports. Tuan Phan (7): MdePkg/BaseLib: RISC-V: Support getting satp

Re: [edk2-devel] [PATCH v4 5/7] OvmfPkg/RiscVVirt: Add VirtNorFlashDxe to APRIORI list

2023-07-13 Thread Tuan Phan
On Tue, Jul 4, 2023 at 12:01 AM Sunil V L wrote: > On Mon, Jul 03, 2023 at 11:45:45PM -0700, Tuan Phan wrote: > > As i said, VirtNorFlashDxe needed to be loaded before VariableRuntimeDxe > so > > your suggestion will not work. > > > Okay, at least for me, by removi

Re: [edk2-devel] [PATCH v4 5/7] OvmfPkg/RiscVVirt: Add VirtNorFlashDxe to APRIORI list

2023-07-04 Thread Tuan Phan
As i said, VirtNorFlashDxe needed to be loaded before VariableRuntimeDxe so your suggestion will not work. On Mon, Jul 3, 2023 at 10:07 PM Sunil V L wrote: > On Wed, Jun 28, 2023 at 02:27:10PM -0700, Tuan Phan wrote: > > On Wed, Jun 28, 2023 at 9:47 AM Sunil V L > wrote: > >

Re: [edk2-devel] [PATCH v4 5/7] OvmfPkg/RiscVVirt: Add VirtNorFlashDxe to APRIORI list

2023-06-28 Thread Tuan Phan
On Wed, Jun 28, 2023 at 9:47 AM Sunil V L wrote: > On Fri, Jun 23, 2023 at 11:39:32AM -0700, Tuan Phan wrote: > > Make sure VirtNorFlashDxe loaded before VariableRuntimeDxe as it > > is the backend flash driver. > > > > Signed-off-by: Tuan Phan > > --- > &g

Re: [edk2-devel] [PATCH] UefiCpuPkg: CpuTimerDxeRiscV64: Fix timer event not working correctly

2023-06-28 Thread Tuan Phan
Thanks Sunil, Updated pull request: https://github.com/tianocore/edk2/pull/4585 Please help merge it if no objection. Thanks, From: Sunil V L Date: Wednesday, June 28, 2023 at 7:43 AM To: Tuan Phan Cc: devel@edk2.groups.io , andrei.warken...@intel.com Subject: Re: [PATCH] UefiCpuPkg

[edk2-devel] [PATCH] UefiCpuPkg: CpuTimerDxeRiscV64: Fix timer event not working correctly

2023-06-27 Thread Tuan Phan
The timer notify function should be called with timer period, not the value read from timer register. Signed-off-by: Tuan Phan --- UefiCpuPkg/CpuTimerDxeRiscV64/Timer.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/UefiCpuPkg/CpuTimerDxeRiscV64/Timer.c b/UefiCpuPkg

[edk2-devel] [PATCH v4 7/7] UefiCpuPkg: RISC-V: Support MMU with SV39/48/57 mode

2023-06-23 Thread Tuan Phan
During CpuDxe initialization, MMU will be setup with the highest mode that HW supports. Reviewed-by: Andrei Warkentin Signed-off-by: Tuan Phan --- OvmfPkg/RiscVVirt/RiscVVirt.dsc.inc | 1 + UefiCpuPkg/CpuDxeRiscV64/CpuDxe.c | 9 +- UefiCpuPkg/CpuDxeRiscV64/CpuDxe.h

[edk2-devel] [PATCH v4 6/7] OvmfPkg: RiscVVirt: Remove satp bare mode setting

2023-06-23 Thread Tuan Phan
There is no point to set satp to bare mode as that should be the default mode when booting edk2. Signed-off-by: Tuan Phan Reviewed-by: Andrei Warkentin Reviewed-by: Sunil V L --- OvmfPkg/RiscVVirt/Sec/Memory.c | 18 ++ 1 file changed, 2 insertions(+), 16 deletions(-) diff

[edk2-devel] [PATCH v4 5/7] OvmfPkg/RiscVVirt: Add VirtNorFlashDxe to APRIORI list

2023-06-23 Thread Tuan Phan
Make sure VirtNorFlashDxe loaded before VariableRuntimeDxe as it is the backend flash driver. Signed-off-by: Tuan Phan --- OvmfPkg/RiscVVirt/RiscVVirtQemu.fdf | 10 ++ 1 file changed, 10 insertions(+) diff --git a/OvmfPkg/RiscVVirt/RiscVVirtQemu.fdf b/OvmfPkg/RiscVVirt

[edk2-devel] [PATCH v4 4/7] OvmfPkg/RiscVVirt: SEC: Add IO memory resource hob for platform devices

2023-06-23 Thread Tuan Phan
Normally, DXE driver would add device resource to GCD before start using. But some key resources such as uart used for printing info at very early stage. Those resources should be populated to HOB in SEC phase so they are added to GCD before MMU enabled. Signed-off-by: Tuan Phan Reviewed

[edk2-devel] [PATCH v4 3/7] OvmfPkg/RiscVVirt: VirtNorFlashPlatformLib: Fix wrong flash size

2023-06-23 Thread Tuan Phan
The size should be for single region, not the whole firmware FD. Signed-off-by: Tuan Phan Reviewed-by: Andrei Warkentin Reviewed-by: Sunil V L --- .../Library/VirtNorFlashPlatformLib/VirtNorFlashStaticLib.c| 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/OvmfPkg

[edk2-devel] [PATCH v4 2/7] MdePkg/Register: RISC-V: Add satp mode bits shift definition

2023-06-23 Thread Tuan Phan
The satp mode bits shift is used cross modules. It should be defined in one place. Signed-off-by: Tuan Phan Reviewed-by: Andrei Warkentin Reviewed-by: Sunil V L --- MdePkg/Include/Register/RiscV64/RiscVEncoding.h | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git

[edk2-devel] [PATCH v4 0/7] RISC-V: Add MMU support

2023-06-23 Thread Tuan Phan
. Changes in v3: - Move MMU library to UefiCpuPkg. - Add Andrei reviewed-by. Changes in v2: - Move MMU core to a library. - Setup SATP mode as highest possible that HW supports. Tuan Phan (7): MdePkg/BaseLib: RISC-V: Support getting satp register value MdePkg/Register: RISC-V: Add satp

[edk2-devel] [PATCH v4 1/7] MdePkg/BaseLib: RISC-V: Support getting satp register value

2023-06-23 Thread Tuan Phan
Add an API to retrieve satp register value. Signed-off-by: Tuan Phan Reviewed-by: Andrei Warkentin Reviewed-by: Sunil V L --- MdePkg/Include/Library/BaseLib.h | 5 + MdePkg/Library/BaseLib/RiscV64/RiscVMmu.S | 8 2 files changed, 13 insertions(+) diff --git a/MdePkg

Re: [edk2-devel] [PATCH v3 7/7] OvmfPkg/RiscVVirt: SEC: Add IO memory resource hob for platform devices

2023-06-22 Thread Tuan Phan
On Thu, Jun 22, 2023 at 11:41 AM Tuan Phan wrote: > > > On Tue, May 30, 2023 at 10:38 AM Tuan Phan via groups.io ventanamicro@groups.io> wrote: > >> >> >> On Mon, May 29, 2023 at 7:07 AM Ard Biesheuvel wrote: >> >>> On Sat, 27 May 2023 at 01

Re: [edk2-devel] [PATCH v3 7/7] OvmfPkg/RiscVVirt: SEC: Add IO memory resource hob for platform devices

2023-06-22 Thread Tuan Phan
On Tue, May 30, 2023 at 10:38 AM Tuan Phan via groups.io wrote: > > > On Mon, May 29, 2023 at 7:07 AM Ard Biesheuvel wrote: > >> On Sat, 27 May 2023 at 01:18, Tuan Phan wrote: >> > >> > Normally, DXE driver would add device resource to GCD before start &

[edk2-devel] [PATCH v2 2/2] UefiCpuPkg: RISC-V: TimerLib: Fix delay function to use 64-bit

2023-06-07 Thread Tuan Phan
The timer compare register is 64-bit so simplifying the delay function. Cc: Andrei Warkentin Signed-off-by: Tuan Phan Reviewed-by: Sunil V L --- V2: Fix format issue with uncrustify. MdePkg/Include/Register/RiscV64/RiscVImpl.h | 1 - .../BaseRiscV64CpuTimerLib/CpuTimerLib.c | 53

[edk2-devel] [PATCH v2 1/2] UefiCpuPkg: CpuTimerDxeRiscV64: Fix incorrect value sent to SbiSetTimer

2023-06-07 Thread Tuan Phan
SbiSetTimer expects core tick value. Cc: Andrei Warkentin Signed-off-by: Tuan Phan Reviewed-by: Sunil V L --- V2: Fixed format issue with uncrustify. .../CpuTimerDxeRiscV64/CpuTimerDxeRiscV64.inf | 3 +++ UefiCpuPkg/CpuTimerDxeRiscV64/Timer.c | 26 --- UefiCpuPkg

[edk2-devel] [PATCH] OvmfPkg: RiscVVirt: Fix wrong checking Pci IO access

2023-06-07 Thread Tuan Phan
RiscV uses memory access for IO and MMIO resources, the address limit is MAX_ADDRESS for both of them. Signed-off-by: Tuan Phan --- OvmfPkg/RiscVVirt/PciCpuIo2Dxe/PciCpuIo2Dxe.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/OvmfPkg/RiscVVirt/PciCpuIo2Dxe

[edk2-devel] [PATCH] OvmfPkg: RiscVVirt: Fix network drivers not be built

2023-06-06 Thread Tuan Phan
Only need to include Network.dsc.inc to have all network drivers/components be built. Otherwise, there were missing definition that prevent them from be built for RiscVVirt platform. Signed-off-by: Tuan Phan --- OvmfPkg/RiscVVirt/RiscVVirtQemu.dsc | 15 +-- 1 file changed, 1

Re: [edk2-devel] [PATCH 2/2] UefiCpuPkg: RISC-V: TimerLib: Fix delay function to use 64-bit

2023-06-06 Thread Tuan Phan
On Tue, Jun 6, 2023 at 10:10 AM Sunil V L wrote: > On Tue, Jun 06, 2023 at 10:02:08AM -0700, Tuan Phan wrote: > > On Tue, Jun 6, 2023 at 3:27 AM Sunil V L > wrote: > > > > > On Fri, May 26, 2023 at 04:25:18PM -0700, Tuan Phan wrote: > > > > The timer co

Re: [edk2-devel] [PATCH 2/2] UefiCpuPkg: RISC-V: TimerLib: Fix delay function to use 64-bit

2023-06-06 Thread Tuan Phan
On Tue, Jun 6, 2023 at 3:27 AM Sunil V L wrote: > On Fri, May 26, 2023 at 04:25:18PM -0700, Tuan Phan wrote: > > The timer compare register is 64-bit so simplifying the delay > > function. > > > > Signed-off-by: Tuan Phan > > --- > > MdePkg/Incl

Re: [edk2-devel] [PATCH v3 7/7] OvmfPkg/RiscVVirt: SEC: Add IO memory resource hob for platform devices

2023-05-30 Thread Tuan Phan
On Mon, May 29, 2023 at 7:07 AM Ard Biesheuvel wrote: > On Sat, 27 May 2023 at 01:18, Tuan Phan wrote: > > > > Normally, DXE driver would add device resource to GCD before start using. > > But some key resources such as uart, flash base address are being > accessing &

[edk2-devel] [PATCH 2/2] UefiCpuPkg: RISC-V: TimerLib: Fix delay function to use 64-bit

2023-05-26 Thread Tuan Phan
The timer compare register is 64-bit so simplifying the delay function. Signed-off-by: Tuan Phan --- MdePkg/Include/Register/RiscV64/RiscVImpl.h | 1 - .../BaseRiscV64CpuTimerLib/CpuTimerLib.c | 62 +-- 2 files changed, 28 insertions(+), 35 deletions(-) diff --git

[edk2-devel] [PATCH 1/2] UefiCpuPkg: CpuTimerDxeRiscV64: Fix incorrect value sent to SbiSetTimer

2023-05-26 Thread Tuan Phan
SbiSetTimer expects core tick value. Signed-off-by: Tuan Phan --- .../CpuTimerDxeRiscV64/CpuTimerDxeRiscV64.inf | 3 +++ UefiCpuPkg/CpuTimerDxeRiscV64/Timer.c | 26 --- UefiCpuPkg/CpuTimerDxeRiscV64/Timer.h | 2 +- 3 files changed, 26 insertions(+), 5 deletions

[edk2-devel] [PATCH v3 7/7] OvmfPkg/RiscVVirt: SEC: Add IO memory resource hob for platform devices

2023-05-26 Thread Tuan Phan
. Signed-off-by: Tuan Phan Reviewed-by: Andrei Warkentin --- OvmfPkg/RiscVVirt/Sec/Platform.c | 62 +++ OvmfPkg/RiscVVirt/Sec/SecMain.inf | 1 + 2 files changed, 63 insertions(+) diff --git a/OvmfPkg/RiscVVirt/Sec/Platform.c b/OvmfPkg/RiscVVirt/Sec/Platform.c index

[edk2-devel] [PATCH v3 6/7] OvmfPkg/VirtNorFlashDxe: Not add memory space if it exists

2023-05-26 Thread Tuan Phan
The flash base address can be added to GCD before this driver run. So only add it if it has not been done. Signed-off-by: Tuan Phan Reviewed-by: Andrei Warkentin --- OvmfPkg/VirtNorFlashDxe/VirtNorFlashDxe.c | 25 +++ 1 file changed, 16 insertions(+), 9 deletions(-) diff

[edk2-devel] [PATCH v3 5/7] OvmfPkg/RiscVVirt: VirtNorFlashPlatformLib: Fix wrong flash size

2023-05-26 Thread Tuan Phan
The size should be for single region, not the whole firmware FD. Signed-off-by: Tuan Phan Reviewed-by: Andrei Warkentin --- .../Library/VirtNorFlashPlatformLib/VirtNorFlashStaticLib.c| 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/OvmfPkg/RiscVVirt/Library

[edk2-devel] [PATCH v3 3/7] UefiCpuPkg: RISC-V: Support MMU with SV39/48/57 mode

2023-05-26 Thread Tuan Phan
During CpuDxe initialization, MMU will be setup with the highest mode that HW supports. Signed-off-by: Tuan Phan Reviewed-by: Andrei Warkentin --- UefiCpuPkg/CpuDxeRiscV64/CpuDxe.c | 9 +- UefiCpuPkg/CpuDxeRiscV64/CpuDxe.h | 2 + UefiCpuPkg/CpuDxeRiscV64

[edk2-devel] [PATCH v3 4/7] OvmfPkg/RiscVVirt: Remove satp bare mode setting

2023-05-26 Thread Tuan Phan
MMU now is initialized in CpuDxe. There is no point to set satp to bare mode as that should be the default mode when booting edk2. Signed-off-by: Tuan Phan Reviewed-by: Andrei Warkentin --- OvmfPkg/RiscVVirt/RiscVVirt.dsc.inc | 1 + OvmfPkg/RiscVVirt/Sec/Memory.c | 18

[edk2-devel] [PATCH v3 2/7] MdePkg/Register: RISC-V: Add satp mode bits shift definition

2023-05-26 Thread Tuan Phan
The satp mode bits shift is used cross modules. It should be defined in one place. Signed-off-by: Tuan Phan Reviewed-by: Andrei Warkentin --- MdePkg/Include/Register/RiscV64/RiscVEncoding.h | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/MdePkg/Include/Register

[edk2-devel] [PATCH v3 1/7] MdePkg/BaseLib: RISC-V: Support getting satp register value

2023-05-26 Thread Tuan Phan
Add an API to retrieve satp register value. Signed-off-by: Tuan Phan Reviewed-by: Andrei Warkentin --- MdePkg/Include/Library/BaseLib.h | 5 + MdePkg/Library/BaseLib/RiscV64/RiscVMmu.S | 8 2 files changed, 13 insertions(+) diff --git a/MdePkg/Include/Library/BaseLib.h b

[edk2-devel] [PATCH v3 0/7] RISC-V: MMU support

2023-05-26 Thread Tuan Phan
at: https://github.com/pttuan/edk2.git Changes in v3: - Move MMU library to UefiCpuPkg. - Add Andrei reviewed-by. Changes in v2: - Move MMU core to a library. - Setup SATP mode as highest possible that HW supports. Tuan Phan (7): MdePkg/BaseLib: RISC-V: Support getting satp register value

Re: [edk2-devel] [PATCH 5/7] OvmfPkg/VirtNorFlashDxe: Not add memory space if it exists

2023-05-25 Thread Tuan Phan
On Thu, May 25, 2023 at 7:27 AM Ard Biesheuvel wrote: > On Wed, 24 May 2023 at 20:13, Tuan Phan wrote: > > > > > > > > On Mon, Mar 6, 2023 at 9:53 AM Ard Biesheuvel wrote: > >> > >> On Mon, 6 Mar 2023 at 18:33, Tuan Phan wrote: > >> >

Re: [edk2-devel] [PATCH v2 3/6] UefiCpuPkg: RISC-V: Support MMU with SV39/48/57 mode

2023-05-24 Thread Tuan Phan
should the MMU library be in the MdePkg or UefiCpuPkg? Thanks, Chao 在 2023/4/15 02:58, Tuan Phan 写道: During CpuDxe initialization, MMU will be setup with the highest mode that HW supports. Signed-off-by: Tuan Phan <mailto:tp...@ventanamicro.com> --- MdePkg/Include/Library/BaseR

Re: [edk2-devel] [PATCH 5/7] OvmfPkg/VirtNorFlashDxe: Not add memory space if it exists

2023-05-24 Thread Tuan Phan
On Mon, Mar 6, 2023 at 9:53 AM Ard Biesheuvel wrote: > On Mon, 6 Mar 2023 at 18:33, Tuan Phan wrote: > > > > The flash base address can be added to GCD before this driver run. > > So only add it if it has not been done. > > > > How do you end up in th

Re: [edk2-devel] [PATCH v2 0/6] RISC-V MMU support

2023-05-23 Thread Tuan Phan
ted. > > > > Reviewed-by: Andrei Warkentin > > > > *From:* devel@edk2.groups.io *On Behalf Of *Tuan > Phan > *Sent:* Wednesday, April 19, 2023 5:37 PM > *To:* devel@edk2.groups.io; Warkentin, Andrei > *Cc:* Kinney, Michael D ; Gao, Liming < > gaolim...

Re: [edk2-devel] [PATCH v2 0/6] RISC-V MMU support

2023-04-19 Thread Tuan Phan
Hi Andrei, Here you go: https://github.com/pttuan/edk2/tree/tphan/riscv_mmu Will put the link in the cover letter next round. From: devel@edk2.groups.io on behalf of Andrei Warkentin Date: Tuesday, April 18, 2023 at 9:04 AM To: Tuan Phan , devel@edk2.groups.io Cc: Kinney, Michael D , Gao

[edk2-devel] [PATCH v2 5/6] OvmfPkg/VirtNorFlashDxe: Not add memory space if it exists

2023-04-14 Thread Tuan Phan
The flash base address can be added to GCD before this driver run. So only add it if it has not been done. Signed-off-by: Tuan Phan --- OvmfPkg/VirtNorFlashDxe/VirtNorFlashDxe.c | 25 +++ 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/OvmfPkg/VirtNorFlashDxe

[edk2-devel] [PATCH v2 6/6] OvmfPkg/RiscVVirt: SEC: Add IO memory resource hob for platform devices

2023-04-14 Thread Tuan Phan
. Signed-off-by: Tuan Phan --- OvmfPkg/RiscVVirt/Sec/Platform.c | 62 +++ OvmfPkg/RiscVVirt/Sec/SecMain.inf | 1 + 2 files changed, 63 insertions(+) diff --git a/OvmfPkg/RiscVVirt/Sec/Platform.c b/OvmfPkg/RiscVVirt/Sec/Platform.c index 3645c27b0b12..944b82c84a6e 100644

[edk2-devel] [PATCH v2 4/6] OvmfPkg/RiscVVirt: VirtNorFlashPlatformLib: Fix wrong flash size

2023-04-14 Thread Tuan Phan
The size should be for single region, not the whole firmware FD. Signed-off-by: Tuan Phan --- .../Library/VirtNorFlashPlatformLib/VirtNorFlashStaticLib.c| 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/OvmfPkg/RiscVVirt/Library/VirtNorFlashPlatformLib

[edk2-devel] [PATCH v2 3/6] UefiCpuPkg: RISC-V: Support MMU with SV39/48/57 mode

2023-04-14 Thread Tuan Phan
During CpuDxe initialization, MMU will be setup with the highest mode that HW supports. Signed-off-by: Tuan Phan --- MdePkg/Include/Library/BaseRiscVMmuLib.h | 39 ++ .../Library/BaseRiscVMmuLib/BaseRiscVMmuLib.c | 569 ++ .../BaseRiscVMmuLib/BaseRiscVMmuLib.inf

[edk2-devel] [PATCH v2 2/6] MdePkg/Register: RISC-V: Add satp mode bits shift definition

2023-04-14 Thread Tuan Phan
The satp mode bits shift is used cross modules. It should be defined in one place. Signed-off-by: Tuan Phan --- MdePkg/Include/Register/RiscV64/RiscVEncoding.h | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/MdePkg/Include/Register/RiscV64/RiscVEncoding.h b/MdePkg

[edk2-devel] [PATCH v2 1/6] MdePkg/BaseLib: RISC-V: Support getting satp register value

2023-04-14 Thread Tuan Phan
Add an API to retrieve satp register value. Signed-off-by: Tuan Phan --- MdePkg/Include/Library/BaseLib.h | 5 + MdePkg/Library/BaseLib/RiscV64/RiscVMmu.S | 8 2 files changed, 13 insertions(+) diff --git a/MdePkg/Include/Library/BaseLib.h b/MdePkg/Include/Library

[edk2-devel] [PATCH v2 0/6] RISC-V MMU support

2023-04-14 Thread Tuan Phan
SATP mode as highest possible that HW supports. Tuan Phan (6): MdePkg/BaseLib: RISC-V: Support getting satp register value MdePkg/Register: RISC-V: Add satp mode bits shift definition UefiCpuPkg: RISC-V: Support MMU with SV39/48/57 mode OvmfPkg/RiscVVirt: VirtNorFlashPlatformLib: Fix wrong

Re: [edk2-devel] [PATCH 0/7] RISC-V: Add MMU support

2023-03-10 Thread Tuan Phan
it’s all one giant line > of code. > > > > A > > > > *From:* Tuan Phan > *Sent:* Thursday, March 9, 2023 1:20 PM > *To:* devel@edk2.groups.io > *Cc:* Kinney, Michael D ; Gao, Liming < > gaolim...@byosoft.com.cn>; Liu, Zhiguang ; > suni...@ventanamicr

[edk2-devel] [PATCH v2] MdePkg/BaseCacheMaintenanceLib: RISC-V: Fix instruction cache not been invalidated

2023-03-10 Thread Tuan Phan
When the range instruction cache invalidating not supported, the whole instruction cache should be invalidated instead. Signed-off-by: Tuan Phan --- V2: - Format with uncrustify. MdePkg/Library/BaseCacheMaintenanceLib/RiscVCache.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion

Re: [edk2-devel] [PATCH 0/7] RISC-V: Add MMU support

2023-03-09 Thread Tuan Phan
accessing them when MMU enabled. Tuan Phan (7):  MdePkg/BaseLib: RISC-V: Support getting satp register value  MdePkg/Register: RISC-V: Add satp mode bits shift definition  UefiCpuPkg: RISC-V: Support MMU with SV39/48/57 mode  OvmfPkg/RiscVVirt: VirtNorFlashPlatformLib: Fix wrong flash size  OvmfPkg

Re: [edk2-devel] [PATCH] MdePkg/BaseCacheMaintenanceLib: RISC-V: Fix instruction cache not been invalidated

2023-03-09 Thread Tuan Phan
Hi All,Any updates on this patch? Thanks, From: Tuan Phan via groups.ioSent: Monday, March 6, 2023 9:11 AMTo: devel@edk2.groups.ioCc: michael.d.kin...@intel.com; gaolim...@byosoft.com.cn; zhiguang@intel.com; suni...@ventanamicro.com; g...@danielschaefer.me; Tuan PhanSubject: [edk2-devel

[edk2-devel] [PATCH 7/7] OvmfPkg/RiscVVirt: Enable MMU with SV39 mode

2023-03-06 Thread Tuan Phan
As MMU will be enabled in CpuDxe, remove the code that set up satp mode in SEC phase. Enable SV39 as default mode. Signed-off-by: Tuan Phan --- OvmfPkg/RiscVVirt/RiscVVirt.dsc.inc | 1 + OvmfPkg/RiscVVirt/Sec/Memory.c | 17 - 2 files changed, 1 insertion(+), 17 deletions

[edk2-devel] [PATCH 6/7] OvmfPkg/RiscVVirt: SEC: Add IO memory resource hob for platform devices

2023-03-06 Thread Tuan Phan
. Signed-off-by: Tuan Phan --- OvmfPkg/RiscVVirt/Sec/Platform.c | 62 +++ OvmfPkg/RiscVVirt/Sec/SecMain.inf | 1 + 2 files changed, 63 insertions(+) diff --git a/OvmfPkg/RiscVVirt/Sec/Platform.c b/OvmfPkg/RiscVVirt/Sec/Platform.c index e8fd126cf800..63bc21eb3f60 100644

[edk2-devel] [PATCH 5/7] OvmfPkg/VirtNorFlashDxe: Not add memory space if it exists

2023-03-06 Thread Tuan Phan
The flash base address can be added to GCD before this driver run. So only add it if it has not been done. Signed-off-by: Tuan Phan --- OvmfPkg/VirtNorFlashDxe/VirtNorFlashDxe.c | 25 +++ 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/OvmfPkg/VirtNorFlashDxe

[edk2-devel] [PATCH 4/7] OvmfPkg/RiscVVirt: VirtNorFlashPlatformLib: Fix wrong flash size

2023-03-06 Thread Tuan Phan
The size should be for single region, not the whole firmware FD. Signed-off-by: Tuan Phan --- .../Library/VirtNorFlashPlatformLib/VirtNorFlashStaticLib.c| 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/OvmfPkg/RiscVVirt/Library/VirtNorFlashPlatformLib

[edk2-devel] [PATCH 3/7] UefiCpuPkg: RISC-V: Support MMU with SV39/48/57 mode

2023-03-06 Thread Tuan Phan
During CpuDxe initialization, MMU will be setup based on the value get from the PCD satp mode. Default is bare mode. Signed-off-by: Tuan Phan --- UefiCpuPkg/CpuDxeRiscV64/CpuDxe.c | 10 +- UefiCpuPkg/CpuDxeRiscV64/CpuDxe.h | 1 + UefiCpuPkg/CpuDxeRiscV64/CpuDxeRiscV64.inf

[edk2-devel] [PATCH 2/7] MdePkg/Register: RISC-V: Add satp mode bits shift definition

2023-03-06 Thread Tuan Phan
The satp mode bits shift is used cross modules. It should be defined in one place. Signed-off-by: Tuan Phan --- MdePkg/Include/Register/RiscV64/RiscVEncoding.h | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/MdePkg/Include/Register/RiscV64/RiscVEncoding.h b/MdePkg

[edk2-devel] [PATCH 1/7] MdePkg/BaseLib: RISC-V: Support getting satp register value

2023-03-06 Thread Tuan Phan
Add an API to retrieve satp register value. Signed-off-by: Tuan Phan --- MdePkg/Include/Library/BaseLib.h | 5 + MdePkg/Library/BaseLib/RiscV64/RiscVMmu.S | 8 2 files changed, 13 insertions(+) diff --git a/MdePkg/Include/Library/BaseLib.h b/MdePkg/Include/Library

[edk2-devel] [PATCH 0/7] RISC-V: Add MMU support

2023-03-06 Thread Tuan Phan
enabled. Tuan Phan (7): MdePkg/BaseLib: RISC-V: Support getting satp register value MdePkg/Register: RISC-V: Add satp mode bits shift definition UefiCpuPkg: RISC-V: Support MMU with SV39/48/57 mode OvmfPkg/RiscVVirt: VirtNorFlashPlatformLib: Fix wrong flash size OvmfPkg/VirtNorFlashDxe

[edk2-devel] [PATCH] MdePkg/BaseCacheMaintenanceLib: RISC-V: Fix instruction cache not been invalidated

2023-03-06 Thread Tuan Phan
When the range instruction cache invalidating not supported, the whole instruction cache should be invalidated instead. Signed-off-by: Tuan Phan --- MdePkg/Library/BaseCacheMaintenanceLib/RiscVCache.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/MdePkg/Library

  1   2   >