From: Kevin Cernekee Date: Thu, 9 Apr 2015 20:05:18 +0000 (-0700) Subject: serial: of_serial: Support big-endian register accesses X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=ebc5e20082160df384dedbe1c95066c3e545b689;p=openwrt%2Fstaging%2Fblogic.git serial: of_serial: Support big-endian register accesses If the device node has a "big-endian" property and 32-bit registers, tell the serial driver to use UPIO_MEM32BE instead of UPIO_MEM32. Signed-off-by: Kevin Cernekee Acked-by: Greg Kroah-Hartman Signed-off-by: Rob Herring --- diff --git a/drivers/tty/serial/of_serial.c b/drivers/tty/serial/of_serial.c index 33fb94f78967..e15c443b2a3c 100644 --- a/drivers/tty/serial/of_serial.c +++ b/drivers/tty/serial/of_serial.c @@ -115,7 +115,8 @@ static int of_platform_serial_setup(struct platform_device *ofdev, port->iotype = UPIO_MEM; break; case 4: - port->iotype = UPIO_MEM32; + port->iotype = of_device_is_big_endian(np) ? + UPIO_MEM32BE : UPIO_MEM32; break; default: dev_warn(&ofdev->dev, "unsupported reg-io-width (%d)\n",