On 17 October 2016 at 05:10, Kinney, Michael D
> 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
> 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
> to MMIO accesses. So there is already an example of an arch specific PCD in
> 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
edk2-devel mailing list