mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Oleksij Rempel <linux@rempel-privat.de>
To: Lucas Stach <l.stach@pengutronix.de>,
	Oleksij Rempel <o.rempel@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH v1 2/2] serial: ns16550: provide big-endian support
Date: Tue, 1 Aug 2017 12:55:39 +0200	[thread overview]
Message-ID: <19bb648d-0842-75e0-e26b-9d2ace501087@rempel-privat.de> (raw)
In-Reply-To: <1501495425.2431.3.camel@pengutronix.de>


[-- Attachment #1.1.1: Type: text/plain, Size: 1574 bytes --]

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@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


[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

[-- Attachment #2: Type: text/plain, Size: 149 bytes --]

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2017-08-01 10:56 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-27  5:00 [PATCH v1 1/2] of: base: port of_device_is_big_endian from linux Oleksij Rempel
2017-07-27  5:00 ` [PATCH v1 2/2] serial: ns16550: provide big-endian support Oleksij Rempel
2017-07-31 10:03   ` Lucas Stach
2017-08-01 10:55     ` Oleksij Rempel [this message]
2017-07-31 10:02 ` [PATCH v1 1/2] of: base: port of_device_is_big_endian from linux Lucas Stach

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=19bb648d-0842-75e0-e26b-9d2ace501087@rempel-privat.de \
    --to=linux@rempel-privat.de \
    --cc=barebox@lists.infradead.org \
    --cc=l.stach@pengutronix.de \
    --cc=o.rempel@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox