[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75VdL=rGHuupGmgmAVonEQgpyPRgoMQrZK0yQiaM=1Vac-g@mail.gmail.com>
Date: Wed, 17 May 2017 12:55:59 +0300
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Dong Aisheng <dongas86@...il.com>
Cc: Nikita Yushchenko <nikita.yoush@...entembedded.com>,
Dong Aisheng <aisheng.dong@....com>,
"linux-serial@...r.kernel.org" <linux-serial@...r.kernel.org>,
fugang.duan@....com,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
yangbo.lu@....com,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Stefan Agner <stefan@...er.ch>, Mingkai.Hu@....com,
Jiri Slaby <jslaby@...e.com>,
linux-arm Mailing List <linux-arm-kernel@...ts.infradead.org>
Subject: Re: [V2, 2/6] tty: serial: lpuart: add little endian 32 bit register support
On Wed, May 17, 2017 at 8:43 AM, Dong Aisheng <dongas86@...il.com> wrote:
> On Wed, May 17, 2017 at 08:37:41AM +0300, Nikita Yushchenko wrote:
>>
>>
>> 17.05.2017 06:39, Dong Aisheng wrote:
>> > On Tue, May 16, 2017 at 02:15:08PM +0300, Nikita Yushchenko wrote:
>> >>> static u32 lpuart32_read(void __iomem *addr)
>> >>> {
>> >>> - return ioread32be(addr);
>> >>> + return lpuart_is_be ? ioread32be(addr) : readl(addr);
>> >>> }
>> >>>
>> >>> static void lpuart32_write(u32 val, void __iomem *addr)
>> >>> {
>> >>> - iowrite32be(val, addr);
>> >>> + if (lpuart_is_be)
>> >>> + iowrite32be(val, addr);
>> >>> + else
>> >>> + writel(val, addr);
>> >>> }
>> >>
>> >> What if this is ever executed on big endian system?
>> >>
>> >
>> > Sorry, not catching the point...
>> >
>> > What issues will meet?
>>
>> Isn't writel() in host endian?
>
> On big endian systems, it is supposed to run iowrite32be.
It looks like you substituting *bus* side with CPU *side* of communication.
If you are talking about CPU side
__raw_readl() / __raw_writel() will do the trick.
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists