]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ARM: at91: debug: make sama5d4 debug uart selectable
authorLothar Waßmann <LW@KARO-electronics.de>
Wed, 3 Jun 2015 05:43:03 +0000 (07:43 +0200)
committerLothar Waßmann <LW@KARO-electronics.de>
Wed, 3 Jun 2015 05:43:03 +0000 (07:43 +0200)
arch/arm/Kconfig.debug
arch/arm/include/debug/at91.S

index 0c12ffb155a23c604c9bbb9b849a913d359e34ae..2c5bf4e0175a860da82b21c4c2135fd14e205d3a 100644 (file)
@@ -1203,6 +1203,30 @@ config DEBUG_AT91_UART
        bool
        depends on ARCH_AT91
 
+choice
+       prompt "Select sama5d4 USART/UART for debugging output"
+       depends on AT91_DEBUG_LL_DBGU2
+       default DEBUG_SAMA5D4_USART
+
+config DEBUG_SAMA5D4_UART
+       bool "Use sama5d4 UART port"
+
+config DEBUG_SAMA5D4_USART
+       bool "Use sama5d4 USART port"
+
+endchoice
+
+config DEBUG_SAMA5D4_UART_PORT
+       int "SAMA5D4 Debug UART/USART Port Selection" if DEBUG_AT91_UART
+       depends on AT91_DEBUG_LL_DBGU2
+       default 3 if DEBUG_SAMA5D4_USART
+       default 0 if DEBUG_SAMA5D4_UART
+       range 0 4 if DEBUG_SAMA5D4_USART
+       range 0 1 if DEBUG_SAMA5D4_UART
+       help
+         Choose USART port (0..4) on which kernel low-level debug messages
+         should be output.
+
 config DEBUG_EXYNOS_UART
        bool
 
index c3c45e628e33bb9bf80a96014f1b510ede78580c..091fbf7388a085a976ae4795e1a524e04be80c4f 100644 (file)
@@ -9,13 +9,44 @@
  *
 */
 
+#define SAMA5D4_UART_BASE(p)   ((p) == 0 ? 0xf8004000 /* UART0 */ : \
+                                ((p) == 1 ? 0cfc004000 /* UART1 */ : \
+                               0xf8004000))
+#define SAMA5D4_USART_BASE(p)  ((p) == 0 ? 0xf802c000 /* USART0 */ : \
+                                (p) == 1 ? 0xf8030000 /* USART1 */ : \
+                                (p) == 2 ? 0xfc008000 /* USART2 */ : \
+                                (p) == 3 ? 0xfc00c000 /* USART3 */ : \
+                                (p) == 4 ? 0xfc010000 /* USART4 */ : \
+                               0xfc00c000)
+
 #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 */
+#elif defined(CONFIG_DEBUG_SAMA5D4_USART)
+#if CONFIG_DEBUG_SAMA5D4_UART_PORT == 0
+#define AT91_DBGU 0xf802c000 /* USART0 */
+#elif CONFIG_DEBUG_SAMA5D4_UART_PORT == 1
+#define AT91_DBGU 0xf8030000 /* USART1 */
+#elif CONFIG_DEBUG_SAMA5D4_UART_PORT == 2
+#define AT91_DBGU 0xfc008000 /* USART2 */
+#elif CONFIG_DEBUG_SAMA5D4_UART_PORT == 3
+#define AT91_DBGU 0xfc00c000 /* USART3 */
+#elif CONFIG_DEBUG_SAMA5D4_UART_PORT == 4
+#define AT91_DBGU 0xfc010000 /* USART4 */
+#else
+#error Invalid SAMA5D4 Debug USART port selection
+#endif
+#elif defined(CONFIG_DEBUG_SAMA5D4_UART)
+#if CONFIG_DEBUG_SAMA5D4_UART_PORT == 0
+#define AT91_DBGU 0xf8004000 /* UART0 */
+#elif CONFIG_DEBUG_SAMA5D4_UART_PORT == 1
+#define AT91_DBGU 0cfc004000 /* UART1 */
+#else
+#error Invalid SAMA5D4 Debug UART port selection
+#endif
 #else
-/* On sama5d4, use USART3 as low level serial console */
-#define AT91_DBGU 0xfc00c000 /* SAMA5D4_BASE_USART3 */
+#error Unsupported AT91 Debug UART selection
 #endif
 
 #ifdef CONFIG_MMU