Hi Ard,

> -----Original Message-----
> From: Ard Biesheuvel [mailto:ard.biesheu...@linaro.org]
> Sent: Monday, October 17, 2016 1:12 PM
> To: Kinney, Michael D <michael.d.kin...@intel.com>
> Cc: Gao, Liming <liming....@intel.com>; Bhupesh Sharma
> <bhupesh.sha...@nxp.com>; edk2-de...@ml01.01.org
> Subject: Re: [edk2] [PATCH 1/1] MdePkg/IoLib: Add support for big-
> endian MMIO
> 
> On 17 October 2016 at 05:10, Kinney, Michael D
> <michael.d.kin...@intel.com> wrote:
> > Bhupesh,
> >
> > It is also possible to add an ARM specific PCD to select endianness
> > and update MdePkg/Library/BaseIoLibIntrinsic/IoLibArm.c to use that
> > PCD in MmioRead/Write() APIs in that file to support both endian
> > types.  You can use the SwapBytesxx() functions from BaseLib(as
> Laszlo
> > suggested) based on the setting of this ARM specific PCD.
> >
> > Modules that link against this lib can select endianness by setting
> > PCD in the scope of that module.
> >
> > The IPF version of IoLib uses an IPF specific PCD to translate I/O
> > port accesses to MMIO accesses.  So there is already an example of an
> > arch specific PCD in this lib instance.
> >
> 
> This is not a platform wide thing, it is a per-device property whether
> the MMIO occurs in big endian or little endian manner.
> 
> So I think Liming's suggestion makes sense: create an IoLib
> implementation that performs the byte swapping, and selectively
> incorporate it into drivers that require it using
> 
> BeMmioDeviceDxe.inf {
>   <LibraryClasses>
>     IoLib|SomePkg/Library/BigEndianIoLib.inf
> }

That's correct. I think creating a separate IoLib for byte-swapping makes sense.

We will rework the patch accordingly.

Regards,
Bhupesh
_______________________________________________
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to