Re: [edk2] [PATCH] MdePkg: add big-endian MMIO BaseBeIoLib

2018-04-17 Thread Kinney, Michael D
sts.01.org > Subject: Re: [edk2] [PATCH] MdePkg: add big-endian MMIO > BaseBeIoLib > > On Mon, Apr 16, 2018 at 10:42:26PM +0200, Laszlo Ersek > wrote: > > On 04/16/18 16:34, Michael Brown wrote: > > > On 16/04/18 15:10, Kinney, Michael D wrote: > > >

Re: [edk2] [PATCH] MdePkg: add big-endian MMIO BaseBeIoLib

2018-04-17 Thread Leif Lindholm
On Mon, Apr 16, 2018 at 10:42:26PM +0200, Laszlo Ersek wrote: > On 04/16/18 16:34, Michael Brown wrote: > > On 16/04/18 15:10, Kinney, Michael D wrote: > >> I agree that the opposite use case is a BE CPU > >> needing a LE operation. > >> > >> I think we only need a single lib class and lib > >>

Re: [edk2] [PATCH] MdePkg: add big-endian MMIO BaseBeIoLib

2018-04-17 Thread Udit Kumar
>; edk2-devel@lists.01.org; > Gao, Liming <liming....@intel.com> > Subject: Re: [edk2] [PATCH] MdePkg: add big-endian MMIO BaseBeIoLib > > On 04/17/18 10:15, Udit Kumar wrote: > > Hi Laszlo, > > > > Considering all possible option is best to have in code  >

Re: [edk2] [PATCH] MdePkg: add big-endian MMIO BaseBeIoLib

2018-04-17 Thread Laszlo Ersek
On 04/17/18 10:24, Michael Brown wrote: > On 17/04/18 09:01, Laszlo Ersek wrote: >> The thing is, the BeIoLib and LeIoLib classes are already good for this >> -- they can be implemented as you suggest. So no need to call the >> function SwapIfNeededForBigEndianDeviceMmioRead16(), just call it >>

Re: [edk2] [PATCH] MdePkg: add big-endian MMIO BaseBeIoLib

2018-04-17 Thread Laszlo Ersek
On 04/17/18 10:15, Udit Kumar wrote: > Hi Laszlo, > > Considering all possible option is best to have in code  > But IMO, We are running UEFI on LE CPU only, Not sure someone is running on > BE. AFAIK even specs says LE. > >> (c) assuming we introduce a CPU with BE byte order, the same

Re: [edk2] [PATCH] MdePkg: add big-endian MMIO BaseBeIoLib

2018-04-17 Thread Michael Brown
On 17/04/18 09:01, Laszlo Ersek wrote: The thing is, the BeIoLib and LeIoLib classes are already good for this -- they can be implemented as you suggest. So no need to call the function SwapIfNeededForBigEndianDeviceMmioRead16(), just call it BeMmioRead16(). I know. I thought that suggesting

Re: [edk2] [PATCH] MdePkg: add big-endian MMIO BaseBeIoLib

2018-04-17 Thread Udit Kumar
uesday, April 17, 2018 1:03 AM > To: Leif Lindholm <leif.lindh...@linaro.org> > Cc: Kinney, Michael D <michael.d.kin...@intel.com>; edk2-devel@lists.01.org; > Gao, Liming <liming....@intel.com> > Subject: Re: [edk2] [PATCH] MdePkg: add big-endian MMIO BaseBeIoLib > > On 0

Re: [edk2] [PATCH] MdePkg: add big-endian MMIO BaseBeIoLib

2018-04-17 Thread Laszlo Ersek
On 04/17/18 00:14, Michael Brown wrote: > On 16/04/18 21:42, Laszlo Ersek wrote: >> On 04/16/18 16:34, Michael Brown wrote: >>> On 16/04/18 15:10, Kinney, Michael D wrote: I think we only need a single lib class and lib Instance that does the byte swap and we should not use Le or Be

Re: [edk2] [PATCH] MdePkg: add big-endian MMIO BaseBeIoLib

2018-04-17 Thread Udit Kumar
D > Sent: Monday, April 16, 2018 7:41 PM > To: Leif Lindholm <leif.lindh...@linaro.org>; Kinney, Michael D > <michael.d.kin...@intel.com> > Cc: edk2-devel@lists.01.org; Laszlo Ersek <ler...@redhat.com>; Gao, Liming > <liming....@intel.com> > Subject: Re: [ed

Re: [edk2] [PATCH] MdePkg: add big-endian MMIO BaseBeIoLib

2018-04-16 Thread Michael Brown
On 16/04/18 21:42, Laszlo Ersek wrote: On 04/16/18 16:34, Michael Brown wrote: On 16/04/18 15:10, Kinney, Michael D wrote: I think we only need a single lib class and lib Instance that does the byte swap and we should not use Le or Be in any of the names of the class, instance, or APIs.  Just

Re: [edk2] [PATCH] MdePkg: add big-endian MMIO BaseBeIoLib

2018-04-16 Thread Laszlo Ersek
On 04/16/18 16:34, Michael Brown wrote: > On 16/04/18 15:10, Kinney, Michael D wrote: >> I agree that the opposite use case is a BE CPU >> needing a LE operation. >> >> I think we only need a single lib class and lib >> Instance that does the byte swap and we should >> not use Le or Be in any of

Re: [edk2] [PATCH] MdePkg: add big-endian MMIO BaseBeIoLib

2018-04-16 Thread Laszlo Ersek
On 04/16/18 12:07, Leif Lindholm wrote: > On Fri, Apr 13, 2018 at 11:32:35PM +, Kinney, Michael D wrote: >> Leif, >> >> I am curious why a Swap class/instances is not sufficient. >> >> Currently EDK II follows the UEFI/PI specs, which for all supported >> CPU architectures use little endian

Re: [edk2] [PATCH] MdePkg: add big-endian MMIO BaseBeIoLib

2018-04-16 Thread Michael Brown
On 16/04/18 15:10, Kinney, Michael D wrote: I agree that the opposite use case is a BE CPU needing a LE operation. I think we only need a single lib class and lib Instance that does the byte swap and we should not use Le or Be in any of the names of the class, instance, or APIs. Just "Swap".

Re: [edk2] [PATCH] MdePkg: add big-endian MMIO BaseBeIoLib

2018-04-16 Thread Kinney, Michael D
ichael.d.kin...@intel.com> > Cc: edk2-devel@lists.01.org; Laszlo Ersek > <ler...@redhat.com>; Gao, Liming <liming....@intel.com> > Subject: Re: [edk2] [PATCH] MdePkg: add big-endian MMIO > BaseBeIoLib > > On Fri, Apr 13, 2018 at 11:32:35PM +, Kinney, > Mic

Re: [edk2] [PATCH] MdePkg: add big-endian MMIO BaseBeIoLib

2018-04-16 Thread Leif Lindholm
M > > To: Kinney, Michael D <michael.d.kin...@intel.com> > > Cc: edk2-devel@lists.01.org; Laszlo Ersek > > <ler...@redhat.com>; Gao, Liming <liming@intel.com> > > Subject: Re: [edk2] [PATCH] MdePkg: add big-endian MMIO > > BaseBeIoLib > > &g

Re: [edk2] [PATCH] MdePkg: add big-endian MMIO BaseBeIoLib

2018-04-15 Thread Udit Kumar
Thanks Leif This is really useful, We will re-spin our patches based on this Regards Udit > -Original Message- > From: Leif Lindholm [mailto:leif.lindh...@linaro.org] > Sent: Friday, April 13, 2018 11:12 PM > To: edk2-devel@lists.01.org > Cc: Michael D Kinney

Re: [edk2] [PATCH] MdePkg: add big-endian MMIO BaseBeIoLib

2018-04-13 Thread Kinney, Michael D
<michael.d.kin...@intel.com> > Cc: edk2-devel@lists.01.org; Laszlo Ersek > <ler...@redhat.com>; Gao, Liming <liming....@intel.com> > Subject: Re: [edk2] [PATCH] MdePkg: add big-endian MMIO > BaseBeIoLib > > On Fri, Apr 13, 2018 at 07:24:06PM +, Kinney, > Michael

Re: [edk2] [PATCH] MdePkg: add big-endian MMIO BaseBeIoLib

2018-04-13 Thread Leif Lindholm
On Fri, Apr 13, 2018 at 07:24:06PM +, Kinney, Michael D wrote: > Hi Leif, > > I think we need to look at the names. I see a mix of > "Be" and "Swap". We should pick one and use it > consistently. This was what I meant by the comments: --- This modified version introduces a single BeIoLib

Re: [edk2] [PATCH] MdePkg: add big-endian MMIO BaseBeIoLib

2018-04-13 Thread Kinney, Michael D
Hi Leif, I think we need to look at the names. I see a mix of "Be" and "Swap". We should pick one and use it consistently. Mike > -Original Message- > From: Leif Lindholm [mailto:leif.lindh...@linaro.org] > Sent: Friday, April 13, 2018 10:42 AM > To: edk2-devel@lists.01.org > Cc:

[edk2] [PATCH] MdePkg: add big-endian MMIO BaseBeIoLib

2018-04-13 Thread Leif Lindholm
When performing MMIO to a destination of the opposite endianness to the executing processor, this library provides automatic byte order reversal on inputs and outputs. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Leif Lindholm --- Udit, many