summaryrefslogtreecommitdiffstats
path: root/drivers/serial
diff options
context:
space:
mode:
authorMarcin Niestroj <m.niestroj@grinn-global.com>2019-06-28 17:56:43 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2019-07-02 08:16:37 +0200
commit7184fcfac6a4940fb29908a3b0133e710f78e6df (patch)
tree8e0e281ad4652edb4e58e55ceb2fa0cc398122a4 /drivers/serial
parent6e465b62125af759c9e90f86ece45f136242e72d (diff)
downloadbarebox-7184fcfac6a4940fb29908a3b0133e710f78e6df.tar.gz
serial: ns16550: support reg-offset device-tree property
Some SoC have serial registers with a fixed offset to the map base. Support them by respecting 'reg-offset' device-tree property. Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/serial')
-rw-r--r--drivers/serial/serial_ns16550.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/serial/serial_ns16550.c b/drivers/serial/serial_ns16550.c
index 4c84d27..3edeb0d 100644
--- a/drivers/serial/serial_ns16550.c
+++ b/drivers/serial/serial_ns16550.c
@@ -314,12 +314,15 @@ static int ns16550_tstc(struct console_device *cdev)
static void ns16550_probe_dt(struct device_d *dev, struct ns16550_priv *priv)
{
struct device_node *np = dev->device_node;
+ u32 offset;
u32 width = 1;
if (!IS_ENABLED(CONFIG_OFDEVICE))
return;
of_property_read_u32(np, "clock-frequency", &priv->plat.clock);
+ if (of_property_read_u32(np, "reg-offset", &offset) == 0)
+ priv->mmiobase += offset;
of_property_read_u32(np, "reg-shift", &priv->plat.shift);
of_property_read_u32(np, "reg-io-width", &width);
switch (width) {