2 * Early serial debug output macro for Keystone SOCs
4 * Copyright 2013 Texas Instruments, Inc.
5 * Santosh Shilimkar <santosh.shilimkar@ti.com>
7 * Based on RMKs low level debug code.
8 * Copyright (C) 1994-1999 Russell King
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
15 #include <linux/serial_reg.h>
18 #if defined(CONFIG_DEBUG_KEYSTONE_UART0)
19 #define UART_PHYS 0x02530c00
20 #define UART_VIRT 0xfeb30c00
21 #elif defined(CONFIG_DEBUG_KEYSTONE_UART1)
22 #define UART_PHYS 0x02531000
23 #define UART_VIRT 0xfeb31000
26 .macro addruart, rp, rv, tmp
27 ldr \rv, =UART_VIRT @ physical base address
28 ldr \rp, =UART_PHYS @ virtual base address
32 str \rd, [\rx, #UART_TX << UART_SHIFT]
36 1002: ldr \rd, [\rx, #UART_LSR << UART_SHIFT]
37 and \rd, \rd, #UART_LSR_TEMT | UART_LSR_THRE
38 teq \rd, #UART_LSR_TEMT | UART_LSR_THRE