[V2, 2/6] tty: serial: lpuart: add little endian 32 bit register support
From: Dong Aisheng <hidden>
Date: 2017-05-17 05:43:58
Also in:
linux-serial, lkml
From: Dong Aisheng <hidden>
Date: 2017-05-17 05:43:58
Also in:
linux-serial, lkml
On Wed, May 17, 2017 at 08:37:41AM +0300, Nikita Yushchenko wrote:
17.05.2017 06:39, Dong Aisheng wrote:quoted
On Tue, May 16, 2017 at 02:15:08PM +0300, Nikita Yushchenko wrote:quoted
quoted
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. Regards Dong Aisheng