summaryrefslogtreecommitdiff
path: root/include/ns16550.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/ns16550.h')
-rw-r--r--include/ns16550.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/include/ns16550.h b/include/ns16550.h
index 7f481300083..5d9ff105411 100644
--- a/include/ns16550.h
+++ b/include/ns16550.h
@@ -25,6 +25,7 @@
#define __ns16550_h
#include <linux/types.h>
+#include <serial.h>
#if CONFIG_IS_ENABLED(DM_SERIAL) || defined(CONFIG_NS16550_DYNAMIC) || \
defined(CONFIG_DEBUG_UART)
@@ -116,6 +117,15 @@ struct ns16550 {
#endif
};
+#if CONFIG_IS_ENABLED(DM_SERIAL)
+#define serial_out(value, addr) \
+ ns16550_writeb(com_port, \
+ (unsigned char *)(addr) - (unsigned char *)com_port, value)
+#define serial_in(addr) \
+ ns16550_readb(com_port, \
+ (unsigned char *)(addr) - (unsigned char *)com_port)
+#endif
+
#define thr rbr
#define iir fcr
#define dll rbr
@@ -225,6 +235,14 @@ void ns16550_putc(struct ns16550 *com_port, char c);
char ns16550_getc(struct ns16550 *com_port);
int ns16550_tstc(struct ns16550 *com_port);
void ns16550_reinit(struct ns16550 *com_port, int baud_divisor);
+int ns16550_serial_putc(struct udevice *dev, const char ch);
+int ns16550_serial_pending(struct udevice *dev, bool input);
+int ns16550_serial_getc(struct udevice *dev);
+int ns16550_serial_setbrg(struct udevice *dev, int baudrate);
+int ns16550_serial_setconfig(struct udevice *dev, uint serial_config);
+int ns16550_serial_getinfo(struct udevice *dev, struct serial_device_info *info);
+void ns16550_writeb(struct ns16550 *port, int offset, int value);
+void ns16550_setbrg(struct ns16550 *com_port, int baud_divisor);
/**
* ns16550_calc_divisor() - calculate the divisor given clock and baud rate