[PATCH 05/13] at91: introduce Kconfig to select the dbgu for lowlevel debug

Jean-Christophe PLAGNIOL-VILLARD plagnioj at jcrosoft.com
Fri Dec 28 14:16:06 EST 2012


so we can drop AT91_BASE_SYS too

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj at jcrosoft.com>
---
 arch/arm/mach-at91/Kconfig                 |   15 +++++++++++++++
 arch/arm/mach-at91/include/mach/debug_ll.h |    6 +++++-
 2 files changed, 20 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-at91/Kconfig b/arch/arm/mach-at91/Kconfig
index 4c2e319..0ab7e7e 100644
--- a/arch/arm/mach-at91/Kconfig
+++ b/arch/arm/mach-at91/Kconfig
@@ -1,5 +1,11 @@
 if ARCH_AT91
 
+config HAVE_AT91_DBGU0
+	bool
+
+config HAVE_AT91_DBGU1
+	bool
+
 config ARCH_TEXT_BASE
 	hex
 	default 0x73f00000 if ARCH_AT91SAM9G45
@@ -49,6 +55,7 @@ choice
 config ARCH_AT91RM9200
 	bool "AT91RM9200"
 	select CPU_ARM920T
+	select HAVE_AT91_DBGU0
 	select HAS_AT91_ETHER
 	select MACH_HAS_LOWLEVEL_INIT
 	select MACH_DO_LOWLEVEL_INIT
@@ -56,46 +63,54 @@ config ARCH_AT91RM9200
 config ARCH_AT91SAM9260
 	bool "AT91SAM9260"
 	select CPU_ARM926T
+	select HAVE_AT91_DBGU0
 	select HAS_MACB
 	select AT91SAM9_RESET
 
 config ARCH_AT91SAM9261
 	bool "AT91SAM9261"
 	select CPU_ARM926T
+	select HAVE_AT91_DBGU0
 	select AT91SAM9_RESET
 
 config ARCH_AT91SAM9263
 	bool "AT91SAM9263"
 	select CPU_ARM926T
+	select HAVE_AT91_DBGU1
 	select HAS_MACB
 	select AT91SAM9_RESET
 
 config ARCH_AT91SAM9G10
 	bool "AT91SAM9G10"
 	select CPU_ARM926T
+	select HAVE_AT91_DBGU0
 	select AT91SAM9_RESET
 
 config ARCH_AT91SAM9G20
 	bool "AT91SAM9G20"
 	select CPU_ARM926T
+	select HAVE_AT91_DBGU0
 	select HAS_MACB
 	select AT91SAM9_RESET
 
 config ARCH_AT91SAM9G45
 	bool "AT91SAM9G45 or AT91SAM9M10"
 	select CPU_ARM926T
+	select HAVE_AT91_DBGU1
 	select HAS_MACB
 	select AT91SAM9G45_RESET
 
 config ARCH_AT91SAM9X5
 	bool "AT91SAM9X5"
 	select CPU_ARM926T
+	select HAVE_AT91_DBGU0
 	select HAS_MACB
 	select AT91SAM9G45_RESET
 
 config ARCH_AT91SAM9N12
 	bool "AT91SAM9N12"
 	select CPU_ARM926T
+	select HAVE_AT91_DBGU0
 	select AT91SAM9G45_RESET
 
 endchoice
diff --git a/arch/arm/mach-at91/include/mach/debug_ll.h b/arch/arm/mach-at91/include/mach/debug_ll.h
index a85fdee..1a85ae4 100644
--- a/arch/arm/mach-at91/include/mach/debug_ll.h
+++ b/arch/arm/mach-at91/include/mach/debug_ll.h
@@ -11,7 +11,11 @@
 #include <asm/io.h>
 #include <mach/hardware.h>
 
-#define UART_BASE	(AT91_BASE_SYS + AT91_DBGU)
+#ifdef COFNIG_HAVE_AT91_DBGU0
+#define UART_BASE	AT91_BASE_DBGU0
+#else
+#define UART_BASE	AT91_BASE_DBGU1
+#endif
 
 #define ATMEL_US_CSR		0x0014
 #define ATMEL_US_THR		0x001c
-- 
1.7.10.4




More information about the barebox mailing list