From c9f6ceb59e06c49bbfba8f2ca9902cadcdaf3a78 Mon Sep 17 00:00:00 2001 From: Vicente Bergas Date: Sun, 10 Mar 2013 00:19:37 +0100 Subject: [PATCH] omap_uart: add low level port serial initialization some sort of UART setup has to be done in order to use PUTC_LL Signed-off-by: Vicente Bergas Signed-off-by: Sascha Hauer --- arch/arm/mach-omap/include/mach/debug_ll.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/arch/arm/mach-omap/include/mach/debug_ll.h b/arch/arm/mach-omap/include/mach/debug_ll.h index ed1777b55..3125fd39e 100644 --- a/arch/arm/mach-omap/include/mach/debug_ll.h +++ b/arch/arm/mach-omap/include/mach/debug_ll.h @@ -41,9 +41,30 @@ #endif #define LSR_THRE 0x20 /* Xmit holding register empty */ +#define LCR_BKSE 0x80 /* Bank select enable */ #define LSR (5 << 2) #define THR (0 << 2) +#define DLL (0 << 2) +#define IER (1 << 2) +#define DLM (1 << 2) +#define FCR (2 << 2) +#define LCR (3 << 2) +#define MCR (4 << 2) +#define MDR (8 << 2) +static inline void INIT_LL(void) +{ + writeb(0x00, UART_BASE + LCR); + writeb(0x00, UART_BASE + IER); + writeb(0x07, UART_BASE + MDR); + writeb(LCR_BKSE, UART_BASE + LCR); + writeb(26, UART_BASE + DLL); /* 115200 */ + writeb(0, UART_BASE + DLM); + writeb(0x03, UART_BASE + LCR); + writeb(0x03, UART_BASE + MCR); + writeb(0x07, UART_BASE + FCR); + writeb(0x00, UART_BASE + MDR); +} static inline void PUTC_LL(char c) { /* Wait until there is space in the FIFO */