From b51312bebfa4452470c2bbf179200cb7c16d82d4 Mon Sep 17 00:00:00 2001 From: Florian Fainelli Date: Wed, 8 Jan 2014 09:19:50 -0800 Subject: ARM: BCM63XX: add low-level UART debug support Broadcom BCM63xx DSL SoCs have a different UART implementation for which we need specially crafted low-level debug assembly code to support. Add support for this using the standard definitions provided in include/linux/serial_bcm63xx.h (shared with their MIPS counterparts). Acked-by: Arnd Bergmann Signed-off-by: Florian Fainelli --- arch/arm/include/debug/bcm63xx.S | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 arch/arm/include/debug/bcm63xx.S (limited to 'arch/arm/include/debug') diff --git a/arch/arm/include/debug/bcm63xx.S b/arch/arm/include/debug/bcm63xx.S new file mode 100644 index 000000000000..e7164d570f44 --- /dev/null +++ b/arch/arm/include/debug/bcm63xx.S @@ -0,0 +1,33 @@ +/* + * Broadcom BCM63xx low-level UART debug + * + * Copyright (C) 2014 Broadcom Corporation + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +#include + + .macro addruart, rp, rv, tmp + ldr \rp, =CONFIG_DEBUG_UART_PHYS + ldr \rv, =CONFIG_DEBUG_UART_VIRT + .endm + + .macro senduart, rd, rx + /* word access do not work */ + strb \rd, [\rx, #UART_FIFO_REG] + .endm + + .macro waituart, rd, rx +1001: ldr \rd, [\rx, #UART_IR_REG] + tst \rd, #(1 << UART_IR_TXEMPTY) + beq 1001b + .endm + + .macro busyuart, rd, rx +1002: ldr \rd, [\rx, #UART_IR_REG] + tst \rd, #(1 << UART_IR_TXTRESH) + beq 1002b + .endm -- cgit v1.2.1