[PATCH v1 2/2] serial: ns16550: provide big-endian support
Oleksij Rempel
linux at rempel-privat.de
Tue Aug 1 03:55:39 PDT 2017
Am 31.07.2017 um 12:03 schrieb Lucas Stach:
> Am Donnerstag, den 27.07.2017, 07:00 +0200 schrieb Oleksij Rempel:
>> we need it at least for QCA AR9344
>>
>> Signed-off-by: Oleksij Rempel <o.rempel at pengutronix.de>
>> ---
>> drivers/serial/serial_ns16550.c | 19 +++++++++++++++++--
>> 1 file changed, 17 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/serial/serial_ns16550.c b/drivers/serial/serial_ns16550.c
>> index a8953cd99d..4d73ea8b87 100644
>> --- a/drivers/serial/serial_ns16550.c
>> +++ b/drivers/serial/serial_ns16550.c
>> @@ -94,6 +94,16 @@ static void ns16550_write_reg_mmio_32(struct ns16550_priv *priv, uint8_t val, un
>> writel(val, priv->mmiobase + offset);
>> }
>>
>> +static uint8_t ns16550_read_reg_mmio_32be(struct ns16550_priv *priv, unsigned offset)
>> +{
>> + return ioread32be(priv->mmiobase + offset);
>> +}
>> +
>> +static void ns16550_write_reg_mmio_32be(struct ns16550_priv *priv, uint8_t val, unsigned offset)
>> +{
>> + iowrite32be(val, priv->mmiobase + offset);
>> +}
>
> This doesn't work on PPC and x86, as those 2 architectures are missing
> the "be" variants of the iowrite/ioread functions.
hmm....
include/asm-generic/io.h:#define ioread32be(addr)
__be32_to_cpu(__raw_readl(addr))
include/linux/byteorder/little_endian.h:#define __be32_to_cpu(x)
__swab32((__force __u32)(__be32)(x))
include/linux/byteorder/big_endian.h:#define __be32_to_cpu(x) ((__force
__u32)(__be32)(x))
i assume it should be available on all platforms. Or do i miss something?
--
Regards,
Oleksij
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: OpenPGP digital signature
URL: <http://lists.infradead.org/pipermail/barebox/attachments/20170801/46951e9d/attachment.sig>
More information about the barebox
mailing list