summaryrefslogtreecommitdiff
path: root/drivers/serial/ns16550.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2015-05-12 14:55:02 -0600
committerSimon Glass <sjg@chromium.org>2015-06-10 19:26:55 -0600
commit9091400859248e2f1d04f34f37c8a30b15fc4ef7 (patch)
treea3b4aa879c2781fee332f94d619af585f393330b /drivers/serial/ns16550.c
parent8d379f179a18d6e9f3d7af8873c942a6834fb780 (diff)
downloadu-boot-imx-9091400859248e2f1d04f34f37c8a30b15fc4ef7.zip
u-boot-imx-9091400859248e2f1d04f34f37c8a30b15fc4ef7.tar.gz
u-boot-imx-9091400859248e2f1d04f34f37c8a30b15fc4ef7.tar.bz2
dm: ns16550: Support CONFIG_SYS_NS16550_MEM32 with driver model
This option is used by some boards, so support it with driver model. This is really ugly - we should rewrite this driver once all users are moved to driver model. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'drivers/serial/ns16550.c')
-rw-r--r--drivers/serial/ns16550.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/serial/ns16550.c b/drivers/serial/ns16550.c
index 3d376d7..9b044a3 100644
--- a/drivers/serial/ns16550.c
+++ b/drivers/serial/ns16550.c
@@ -65,6 +65,8 @@ static inline void serial_out_shift(void *addr, int shift, int value)
out_le32(addr, value);
#elif defined(CONFIG_SYS_NS16550_MEM32) && defined(CONFIG_SYS_BIG_ENDIAN)
out_be32(addr, value);
+#elif defined(CONFIG_SYS_NS16550_MEM32)
+ writel(value, addr);
#elif defined(CONFIG_SYS_BIG_ENDIAN)
writeb(value, addr + (1 << shift) - 1);
#else
@@ -80,6 +82,8 @@ static inline int serial_in_shift(void *addr, int shift)
return in_le32(addr);
#elif defined(CONFIG_SYS_NS16550_MEM32) && defined(CONFIG_SYS_BIG_ENDIAN)
return in_be32(addr);
+#elif defined(CONFIG_SYS_NS16550_MEM32)
+ return readl(addr);
#elif defined(CONFIG_SYS_BIG_ENDIAN)
return readb(addr + (1 << shift) - 1);
#else