[PATCH 8/9] ARM: rpi: move debug UART base selection to Kconfig
Lucas Stach
l.stach at pengutronix.de
Wed Mar 1 06:31:36 PST 2017
To let the user select the right base, when building multi-image.
Signed-off-by: Lucas Stach <l.stach at pengutronix.de>
---
arch/arm/mach-bcm283x/Kconfig | 20 ++++++++++++++++++++
arch/arm/mach-bcm283x/include/mach/debug_ll.h | 6 +++++-
2 files changed, 25 insertions(+), 1 deletion(-)
diff --git a/arch/arm/mach-bcm283x/Kconfig b/arch/arm/mach-bcm283x/Kconfig
index d9be1a9b65c1..bb4fe95ab2f1 100644
--- a/arch/arm/mach-bcm283x/Kconfig
+++ b/arch/arm/mach-bcm283x/Kconfig
@@ -22,4 +22,24 @@ config MACH_RPI2
endchoice
+config MACH_RPI_DEBUG_UART_BASE
+ hex
+ default 0x20201000 if MACH_RPI_DEBUG_UART_RPI
+ default 0x3f201000 if MACH_RPI_DEBUG_UART_RPI2
+
+if DEBUG_LL
+
+choice
+ prompt "Lowlevel debug UART"
+
+config MACH_RPI_DEBUG_UART_RPI
+ bool "use RaspberryPi 1 compatible base"
+
+config MACH_RPI_DEBUG_UART_RPI2
+ bool "use RaspberryPi 2 and 3 compatible base"
+
+endchoice
+
+endif
+
endif
diff --git a/arch/arm/mach-bcm283x/include/mach/debug_ll.h b/arch/arm/mach-bcm283x/include/mach/debug_ll.h
index be93cd95ad46..a625a8bdb71d 100644
--- a/arch/arm/mach-bcm283x/include/mach/debug_ll.h
+++ b/arch/arm/mach-bcm283x/include/mach/debug_ll.h
@@ -20,7 +20,11 @@
#include <mach/platform.h>
-#define DEBUG_LL_UART_ADDR BCM2835_UART0_BASE
+#ifndef CONFIG_MACH_RPI_DEBUG_UART_BASE
+#define CONFIG_MACH_RPI_DEBUG_UART_BASE 0
+#endif
+
+#define DEBUG_LL_UART_ADDR CONFIG_MACH_RPI_DEBUG_UART_BASE
#include <asm/debug_ll_pl011.h>
--
2.11.0
More information about the barebox
mailing list