Re: [edk2-devel] [PATCH v4 19/37] UefiCpuPkg: Add MMIO method in CpuIo2Dxe

2023-12-22 Thread Chao Li
Biesheuvel; Sami Mujawar Subject: Re: [edk2-devel] [PATCH v4 19/37] UefiCpuPkg: Add MMIO method in CpuIo2Dxe Thanks, Chao On 2023/12/21 21:59, Ard Biesheuvel wrote: On Thu, 21 Dec 2023 at 13:41, Chao Li wrote: ... A given platform will either be able to use port IO, or it will need

Re: [edk2-devel] [PATCH v4 19/37] UefiCpuPkg: Add MMIO method in CpuIo2Dxe

2023-12-22 Thread Ard Biesheuvel
indholm ; Ard > Biesheuvel ; Sami Mujawar > Subject: Re: [edk2-devel] [PATCH v4 19/37] UefiCpuPkg: Add MMIO method in > CpuIo2Dxe > > > > > > > > Thanks, > Chao > > On 2023/12/21 21:59, Ard Biesheuvel wrote: > > On Thu, 21 Dec 2023 at 13:41, Chao Li w

Re: [edk2-devel] [PATCH v4 19/37] UefiCpuPkg: Add MMIO method in CpuIo2Dxe

2023-12-21 Thread Ni, Ray
Good to me. Thanks, Ray From: Chao Li Sent: Friday, December 22, 2023 9:15 AM To: devel@edk2.groups.io; a...@kernel.org; Ni, Ray Cc: Kumar, Rahul R ; Gerd Hoffmann ; Leif Lindholm ; Ard Biesheuvel ; Sami Mujawar Subject: Re: [edk2-devel] [PATCH v4 19/37] UefiCpuPkg: Add MMIO method

Re: [edk2-devel] [PATCH v4 19/37] UefiCpuPkg: Add MMIO method in CpuIo2Dxe

2023-12-21 Thread Chao Li
Thanks, Chao On 2023/12/21 21:59, Ard Biesheuvel wrote: On Thu, 21 Dec 2023 at 13:41, Chao Li wrote: ... A given platform will either be able to use port IO, or it will need to use MMIO translation. So a driver that can do both based on a PCD is not very useful, it makes more sense to have

Re: [edk2-devel] [PATCH v4 19/37] UefiCpuPkg: Add MMIO method in CpuIo2Dxe

2023-12-21 Thread Ard Biesheuvel
On Thu, 21 Dec 2023 at 13:41, Chao Li wrote: > ... > A given platform will either be able to use port IO, or it will need > to use MMIO translation. So a driver that can do both based on a PCD > is not very useful, it makes more sense to have two different drivers, > and the platform incorporates

Re: [edk2-devel] [PATCH v4 19/37] UefiCpuPkg: Add MMIO method in CpuIo2Dxe

2023-12-21 Thread Chao Li
Thanks, Chao On 2023/12/21 20:31, Ard Biesheuvel wrote: On Thu, 21 Dec 2023 at 13:11, Chao Li wrote: Hi Ard, Thanks, Chao On 2023/12/21 15:31, Ard Biesheuvel wrote: On Thu, 21 Dec 2023 at 04:48, Chao Li wrote: ... Ard, PcdPciIoTranslationIsEnabled is only use for whether to trigger

Re: [edk2-devel] [PATCH v4 19/37] UefiCpuPkg: Add MMIO method in CpuIo2Dxe

2023-12-21 Thread Ard Biesheuvel
On Thu, 21 Dec 2023 at 13:11, Chao Li wrote: > > Hi Ard, > > > Thanks, > Chao > On 2023/12/21 15:31, Ard Biesheuvel wrote: > > On Thu, 21 Dec 2023 at 04:48, Chao Li wrote: > > ... > > Ard, > > PcdPciIoTranslationIsEnabled is only use for whether to trigger the Ffio read > or write, it seem that

Re: [edk2-devel] [PATCH v4 19/37] UefiCpuPkg: Add MMIO method in CpuIo2Dxe

2023-12-21 Thread Chao Li
Hi Ard, Thanks, Chao On 2023/12/21 15:31, Ard Biesheuvel wrote: On Thu, 21 Dec 2023 at 04:48, Chao Li wrote: ... Ard, PcdPciIoTranslationIsEnabled is only use for whether to trigger the Ffio read or write, it seem that only x86 or x64 need them, not others. When I was submitted the patch

Re: [edk2-devel] [PATCH v4 19/37] UefiCpuPkg: Add MMIO method in CpuIo2Dxe

2023-12-20 Thread Ard Biesheuvel
On Thu, 21 Dec 2023 at 04:48, Chao Li wrote: > ... > Ard, > > PcdPciIoTranslationIsEnabled is only use for whether to trigger the Ffio read > or write, it seem that only x86 or x64 need them, not others. > > When I was submitted the patch V2, CpuIo2Dxe was private to LoongArch, just > like Arm

Re: [edk2-devel] [PATCH v4 19/37] UefiCpuPkg: Add MMIO method in CpuIo2Dxe

2023-12-20 Thread Chao Li
to accommodate the MMIO methods, so I merged them togeter in this change. From: Chao Li Sent: Tuesday, December 19, 2023 9:04 PM To:devel@edk2.groups.io; Ni, Ray Cc: Kumar, Rahul R; Gerd Hoffmann; Leif Lindholm; Ard Biesheuvel; Sami Mujawar Subject: Re: [edk2-devel] [PATCH v4 19/37] UefiCpuPkg

Re: [edk2-devel] [PATCH v4 19/37] UefiCpuPkg: Add MMIO method in CpuIo2Dxe

2023-12-20 Thread Ard Biesheuvel
On Wed, 20 Dec 2023 at 13:28, Ni, Ray wrote: > > Thanks for pointing it out. > I found it in ACPI spec that tells how to use "Resource Type Specific Flags" > to describe a MEM resource while maps to IO, > and an IO resource while maps to MEM. > > I assume that the IO port accesses are all from

Re: [edk2-devel] [PATCH v4 19/37] UefiCpuPkg: Add MMIO method in CpuIo2Dxe

2023-12-20 Thread Ni, Ray
gt; Sent: Wednesday, December 20, 2023 5:54 PM > To: Ni, Ray > Cc: devel@edk2.groups.io; lic...@loongson.cn; Kumar, Rahul R > ; Gerd Hoffmann ; Leif > Lindholm ; Ard Biesheuvel > ; Sami Mujawar > Subject: Re: [edk2-devel] [PATCH v4 19/37] UefiCpuPkg: Add MMIO method > in CpuIo2D

Re: [edk2-devel] [PATCH v4 19/37] UefiCpuPkg: Add MMIO method in CpuIo2Dxe

2023-12-20 Thread Ard Biesheuvel
On Wed, 20 Dec 2023 at 10:44, Ni, Ray wrote: > > Ard, > Let me try to understand: > > 1. CPU does not support IO instructions to access IO ports. > 2. PCI devices contain IO space. > 3. A special PCI host bridge can be configured to map a range of MMIO space > from CPU side to another range of

Re: [edk2-devel] [PATCH v4 19/37] UefiCpuPkg: Add MMIO method in CpuIo2Dxe

2023-12-20 Thread Ni, Ray
; From: Chao Li > > Sent: Tuesday, December 19, 2023 9:04 PM > > To: devel@edk2.groups.io; Ni, Ray > > Cc: Kumar, Rahul R ; Gerd Hoffmann > ; Leif Lindholm ; Ard > Biesheuvel ; Sami Mujawar > > > Subject: Re: [edk2-devel] [PATCH v4 19/37] UefiCpuPkg: Add MMIO meth

Re: [edk2-devel] [PATCH v4 19/37] UefiCpuPkg: Add MMIO method in CpuIo2Dxe

2023-12-19 Thread Ard Biesheuvel
his seems unnecessary to me. But perhaps I missed something? > > From: Chao Li > Sent: Tuesday, December 19, 2023 9:04 PM > To: devel@edk2.groups.io; Ni, Ray > Cc: Kumar, Rahul R ; Gerd Hoffmann > ; Leif Lindholm ; Ard > Biesheuvel ; Sami Mujawar > Subject: Re: [edk2-

Re: [edk2-devel] [PATCH v4 19/37] UefiCpuPkg: Add MMIO method in CpuIo2Dxe

2023-12-19 Thread Ni, Ray
? Thanks, Ray From: Chao Li Sent: Tuesday, December 19, 2023 9:04 PM To: devel@edk2.groups.io; Ni, Ray Cc: Kumar, Rahul R ; Gerd Hoffmann ; Leif Lindholm ; Ard Biesheuvel ; Sami Mujawar Subject: Re: [edk2-devel] [PATCH v4 19/37] UefiCpuPkg: Add MMIO method in CpuIo2Dxe Hi Ray, Can you

Re: [edk2-devel] [PATCH v4 19/37] UefiCpuPkg: Add MMIO method in CpuIo2Dxe

2023-12-19 Thread Chao Li
Hi Ray, Can you please review this patch? Thank you! Thanks, Chao On 2023/12/12 21:12, Chao Li wrote: CpuIo2Dxe only supports IO to access PCI IO. Some ARCH requires MMIO to access PCI IO, add the MMIO access method in CpuIo2Dxe. The MMIO methods depend on PcdPciIoTranslationIsEnabled and

[edk2-devel] [PATCH v4 19/37] UefiCpuPkg: Add MMIO method in CpuIo2Dxe

2023-12-12 Thread Chao Li
CpuIo2Dxe only supports IO to access PCI IO. Some ARCH requires MMIO to access PCI IO, add the MMIO access method in CpuIo2Dxe. The MMIO methods depend on PcdPciIoTranslationIsEnabled and PcdPciIoTransLation. The code is referenced from ArmPkg. Build-tested only (with "OvmfPkgX64.dsc"). BZ: