]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - arch/arm/include/debug/at91.S
ARM: at91: debug: make sama5d4 debug uart selectable
[karo-tx-linux.git] / arch / arm / include / debug / at91.S
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