mirror of
https://github.com/torvalds/linux.git
synced 2024-11-01 17:51:43 +00:00
477099f189
Apart from the necessity to do this change for multi-platform kernels the previous logic depended on the zImage decompressor to write the physical and virtual address to a magic memory location. If the decompressor is unused or not correctly configured for the current machid, the addruart macro was an infinite loop. Moreover debugging the early zImage code was not possible either. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> [nsekhar@ti.com: add braces in _DEBUG_LL_ENTRY() macro to fix checkpatch error. Fix debug port choice config dependency for traditional DaVincis. Modify debug port config names and add help text.] Signed-off-by: Sekhar Nori <nsekhar@ti.com>
68 lines
1.7 KiB
ArmAsm
68 lines
1.7 KiB
ArmAsm
/*
|
|
* Debugging macro for DaVinci
|
|
*
|
|
* Author: Kevin Hilman, MontaVista Software, Inc. <source@mvista.com>
|
|
*
|
|
* 2007 (c) MontaVista Software, Inc. This file is licensed under
|
|
* the terms of the GNU General Public License version 2. This program
|
|
* is licensed "as is" without any warranty of any kind, whether express
|
|
* or implied.
|
|
*/
|
|
|
|
/* Modifications
|
|
* Jan 2009 Chaithrika U S Added senduart, busyuart, waituart
|
|
* macros, based on debug-8250.S file
|
|
* but using 32-bit accesses required for
|
|
* some davinci devices.
|
|
*/
|
|
|
|
#include <linux/serial_reg.h>
|
|
|
|
#include <mach/serial.h>
|
|
|
|
#define UART_SHIFT 2
|
|
|
|
#if defined(CONFIG_DEBUG_DAVINCI_DMx_UART0)
|
|
#define UART_BASE DAVINCI_UART0_BASE
|
|
#elif defined(CONFIG_DEBUG_DAVINCI_DA8XX_UART0)
|
|
#define UART_BASE DA8XX_UART0_BASE
|
|
#elif defined(CONFIG_DEBUG_DAVINCI_DA8XX_UART1)
|
|
#define UART_BASE DA8XX_UART1_BASE
|
|
#elif defined(CONFIG_DEBUG_DAVINCI_DA8XX_UART2)
|
|
#define UART_BASE DA8XX_UART2_BASE
|
|
#elif defined(CONFIG_DEBUG_DAVINCI_TNETV107X_UART1)
|
|
#define UART_BASE TNETV107X_UART2_BASE
|
|
#define UART_VIRTBASE TNETV107X_UART2_VIRT
|
|
#else
|
|
#error "Select a specifc port for DEBUG_LL"
|
|
#endif
|
|
|
|
#ifndef UART_VIRTBASE
|
|
#define UART_VIRTBASE IO_ADDRESS(UART_BASE)
|
|
#endif
|
|
|
|
.macro addruart, rp, rv, tmp
|
|
ldr \rp, =UART_BASE
|
|
ldr \rv, =UART_VIRTBASE
|
|
.endm
|
|
|
|
.macro senduart,rd,rx
|
|
str \rd, [\rx, #UART_TX << UART_SHIFT]
|
|
.endm
|
|
|
|
.macro busyuart,rd,rx
|
|
1002: ldr \rd, [\rx, #UART_LSR << UART_SHIFT]
|
|
and \rd, \rd, #UART_LSR_TEMT | UART_LSR_THRE
|
|
teq \rd, #UART_LSR_TEMT | UART_LSR_THRE
|
|
bne 1002b
|
|
.endm
|
|
|
|
.macro waituart,rd,rx
|
|
#ifdef FLOW_CONTROL
|
|
1001: ldr \rd, [\rx, #UART_MSR << UART_SHIFT]
|
|
tst \rd, #UART_MSR_CTS
|
|
beq 1001b
|
|
#endif
|
|
.endm
|
|
|