ARM: at91: move debug-macro.S into the common space
authorAlexandre Belloni <alexandre.belloni@free-electrons.com>
Mon, 12 Jan 2015 18:42:14 +0000 (19:42 +0100)
committerNicolas Ferre <nicolas.ferre@atmel.com>
Thu, 15 Jan 2015 14:24:06 +0000 (15:24 +0100)
Move debug-macro.S from include/mach/ to include/debug where all other common
debug macros are.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
MAINTAINERS
arch/arm/Kconfig.debug
arch/arm/include/debug/at91.S [new file with mode: 0644]
arch/arm/mach-at91/include/mach/debug-macro.S [deleted file]

index 3589d67437f867e121bc36b0ff2b92e758499c04..8c25979a3c43eef38da5cc2d5b4e2d5976b61801 100644 (file)
@@ -877,6 +877,7 @@ F:  arch/arm/boot/dts/at91*.dts
 F:     arch/arm/boot/dts/at91*.dtsi
 F:     arch/arm/boot/dts/sama*.dts
 F:     arch/arm/boot/dts/sama*.dtsi
+F:     arch/arm/include/debug/at91.S
 
 ARM/ATMEL AT91 Clock Support
 M:     Boris Brezillon <boris.brezillon@free-electrons.com>
index 5ddd4906f7a74599b780e0410c1ea5681a5d8f71..e34d24949c6a7c3d94075ec584e37568abf13809 100644 (file)
@@ -115,15 +115,18 @@ choice
                    0x80024000      | 0xf0024000     | UART9
 
        config AT91_DEBUG_LL_DBGU0
-               bool "Kernel low-level debugging on rm9200, 9260/9g20, 9261/9g10 and 9rl"
+               bool "Kernel low-level debugging on rm9200, 9260/9g20, 9261/9g10, 9rl, 9x5, 9n12"
+               select DEBUG_AT91_UART
                depends on HAVE_AT91_DBGU0
 
        config AT91_DEBUG_LL_DBGU1
-               bool "Kernel low-level debugging on 9263 and 9g45"
+               bool "Kernel low-level debugging on 9263, 9g45 and sama5d3"
+               select DEBUG_AT91_UART
                depends on HAVE_AT91_DBGU1
 
        config AT91_DEBUG_LL_DBGU2
                bool "Kernel low-level debugging on sama5d4"
+               select DEBUG_AT91_UART
                depends on HAVE_AT91_DBGU2
 
        config DEBUG_BCM2835
@@ -1165,6 +1168,8 @@ config DEBUG_LL_INCLUDE
        string
        default "debug/sa1100.S" if DEBUG_SA1100
        default "debug/8250.S" if DEBUG_LL_UART_8250 || DEBUG_UART_8250
+       default "debug/at91.S" if AT91_DEBUG_LL_DBGU0 || AT91_DEBUG_LL_DBGU1 || \
+                               AT91_DEBUG_LL_DBGU2
        default "debug/asm9260.S" if DEBUG_ASM9260_UART
        default "debug/clps711x.S" if DEBUG_CLPS711X_UART1 || DEBUG_CLPS711X_UART2
        default "debug/meson.S" if DEBUG_MESON_UARTAO
diff --git a/arch/arm/include/debug/at91.S b/arch/arm/include/debug/at91.S
new file mode 100644 (file)
index 0000000..80a6501
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ *  Copyright (C) 2003-2005 SAN People
+ *
+ * Debugging macro include header
+ *
+ * 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.
+ *
+*/
+
+#if defined(CONFIG_AT91_DEBUG_LL_DBGU0)
+#define AT91_DBGU 0xfffff200 /* AT91_BASE_DBGU0 */
+#elif defined(CONFIG_AT91_DEBUG_LL_DBGU1)
+#define AT91_DBGU 0xffffee00 /* AT91_BASE_DBGU1 */
+#else
+/* On sama5d4, use USART3 as low level serial console */
+#define AT91_DBGU 0xfc00c000 /* SAMA5D4_BASE_USART3 */
+#endif
+
+/* Keep in sync with mach-at91/include/mach/hardware.h */
+#define AT91_IO_P2V(x) ((x) - 0x01000000)
+
+#define AT91_DBGU_SR           (0x14)  /* Status Register */
+#define AT91_DBGU_THR          (0x1c)  /* Transmitter Holding Register */
+#define AT91_DBGU_TXRDY                (1 << 1)        /* Transmitter Ready */
+#define AT91_DBGU_TXEMPTY      (1 << 9)        /* Transmitter Empty */
+
+       .macro  addruart, rp, rv, tmp
+       ldr     \rp, =AT91_DBGU                         @ System peripherals (phys address)
+       ldr     \rv, =AT91_IO_P2V(AT91_DBGU)            @ System peripherals (virt address)
+       .endm
+
+       .macro  senduart,rd,rx
+       strb    \rd, [\rx, #(AT91_DBGU_THR)]            @ Write to Transmitter Holding Register
+       .endm
+
+       .macro  waituart,rd,rx
+1001:  ldr     \rd, [\rx, #(AT91_DBGU_SR)]             @ Read Status Register
+       tst     \rd, #AT91_DBGU_TXRDY                   @ DBGU_TXRDY = 1 when ready to transmit
+       beq     1001b
+       .endm
+
+       .macro  busyuart,rd,rx
+1001:  ldr     \rd, [\rx, #(AT91_DBGU_SR)]             @ Read Status Register
+       tst     \rd, #AT91_DBGU_TXEMPTY                 @ DBGU_TXEMPTY = 1 when transmission complete
+       beq     1001b
+       .endm
+
diff --git a/arch/arm/mach-at91/include/mach/debug-macro.S b/arch/arm/mach-at91/include/mach/debug-macro.S
deleted file mode 100644 (file)
index 2103a90..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * arch/arm/mach-at91/include/mach/debug-macro.S
- *
- *  Copyright (C) 2003-2005 SAN People
- *
- * Debugging macro include header
- *
- * 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 <mach/hardware.h>
-#include <mach/at91_dbgu.h>
-
-#if defined(CONFIG_AT91_DEBUG_LL_DBGU0)
-#define AT91_DBGU AT91_BASE_DBGU0
-#elif defined(CONFIG_AT91_DEBUG_LL_DBGU1)
-#define AT91_DBGU AT91_BASE_DBGU1
-#else
-/* On sama5d4, use USART3 as low level serial console */
-#define AT91_DBGU SAMA5D4_BASE_USART3
-#endif
-
-       .macro  addruart, rp, rv, tmp
-       ldr     \rp, =AT91_DBGU                         @ System peripherals (phys address)
-       ldr     \rv, =AT91_IO_P2V(AT91_DBGU)            @ System peripherals (virt address)
-       .endm
-
-       .macro  senduart,rd,rx
-       strb    \rd, [\rx, #(AT91_DBGU_THR)]            @ Write to Transmitter Holding Register
-       .endm
-
-       .macro  waituart,rd,rx
-1001:  ldr     \rd, [\rx, #(AT91_DBGU_SR)]             @ Read Status Register
-       tst     \rd, #AT91_DBGU_TXRDY                   @ DBGU_TXRDY = 1 when ready to transmit
-       beq     1001b
-       .endm
-
-       .macro  busyuart,rd,rx
-1001:  ldr     \rd, [\rx, #(AT91_DBGU_SR)]             @ Read Status Register
-       tst     \rd, #AT91_DBGU_TXEMPTY                 @ DBGU_TXEMPTY = 1 when transmission complete
-       beq     1001b
-       .endm
-