* [U-Boot] [PATCH] serial: omap: Add code for early debugging
@ 2018-12-03 14:12 Felix Brack
2018-12-07 20:34 ` [U-Boot] " Tom Rini
0 siblings, 1 reply; 2+ messages in thread
From: Felix Brack @ 2018-12-03 14:12 UTC (permalink / raw)
To: u-boot
This patch adds code missing when CONFIG_DEBUG_UART_OMAP is enabled as
early debugging UART. The code is basically copied from the ns16550
driver.
Signed-off-by: Felix Brack <fb@ltec.ch>
---
drivers/serial/serial_omap.c | 42 +++++++++++++++++++++++++++++++++++-
1 file changed, 41 insertions(+), 1 deletion(-)
diff --git a/drivers/serial/serial_omap.c b/drivers/serial/serial_omap.c
index ee6ad9c9e5..a31d73766d 100644
--- a/drivers/serial/serial_omap.c
+++ b/drivers/serial/serial_omap.c
@@ -7,7 +7,6 @@
*/
#include <common.h>
-#include <debug_uart.h>
#include <dm.h>
#include <dt-structs.h>
#include <ns16550.h>
@@ -20,6 +19,47 @@
#ifdef CONFIG_DEBUG_UART_OMAP
+#ifndef CONFIG_SYS_NS16550_IER
+#define CONFIG_SYS_NS16550_IER 0x00
+#endif
+
+#define UART_MCRVAL 0x00
+#define UART_LCRVAL UART_LCR_8N1
+
+static inline void serial_out_shift(void *addr, int shift, int value)
+{
+#ifdef CONFIG_SYS_NS16550_PORT_MAPPED
+ outb(value, (ulong)addr);
+#elif defined(CONFIG_SYS_NS16550_MEM32) && defined(CONFIG_SYS_LITTLE_ENDIAN)
+ 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
+ writeb(value, addr);
+#endif
+}
+
+static inline int serial_in_shift(void *addr, int shift)
+{
+#ifdef CONFIG_SYS_NS16550_PORT_MAPPED
+ return inb((ulong)addr);
+#elif defined(CONFIG_SYS_NS16550_MEM32) && defined(CONFIG_SYS_LITTLE_ENDIAN)
+ 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
+ return readb(addr);
+#endif
+}
+
#include <debug_uart.h>
static inline void _debug_uart_init(void)
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [U-Boot] serial: omap: Add code for early debugging
2018-12-03 14:12 [U-Boot] [PATCH] serial: omap: Add code for early debugging Felix Brack
@ 2018-12-07 20:34 ` Tom Rini
0 siblings, 0 replies; 2+ messages in thread
From: Tom Rini @ 2018-12-07 20:34 UTC (permalink / raw)
To: u-boot
On Mon, Dec 03, 2018 at 03:12:25PM +0100, Felix Brack wrote:
> This patch adds code missing when CONFIG_DEBUG_UART_OMAP is enabled as
> early debugging UART. The code is basically copied from the ns16550
> driver.
>
> Signed-off-by: Felix Brack <fb@ltec.ch>
Applied to u-boot/master, thanks!
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181207/1f54cd50/attachment.sig>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-12-07 20:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-03 14:12 [U-Boot] [PATCH] serial: omap: Add code for early debugging Felix Brack
2018-12-07 20:34 ` [U-Boot] " Tom Rini
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.