[PATCH 29/50] ARM: Rockchip: Only provide PUTC_LL() when activated

Sascha Hauer s.hauer at pengutronix.de
Fri Mar 3 01:21:10 PST 2023


With multi-arch support we must make sure we provide exactly one
PUTC_LL() function as indicated by the "Kernel low-level debugging port"
Kconfig choice. Make sure that the Rockchip specific debug_ll.h only
provides PUTC_LL() when specified.
The Rockchip specific debug_ll.h also provides other functions needed
by board code regardless if the Rockchip debug_ll port is enabled or
not, so include it explicitly where needed.

Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 arch/arm/boards/phytec-som-rk3288/lowlevel.c | 1 +
 arch/arm/include/asm/debug_ll.h              | 6 ++++--
 common/Kconfig                               | 7 +++++++
 include/mach/rockchip/debug_ll.h             | 2 +-
 4 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/arch/arm/boards/phytec-som-rk3288/lowlevel.c b/arch/arm/boards/phytec-som-rk3288/lowlevel.c
index 8fc8f700f9..12044b6039 100644
--- a/arch/arm/boards/phytec-som-rk3288/lowlevel.c
+++ b/arch/arm/boards/phytec-som-rk3288/lowlevel.c
@@ -11,6 +11,7 @@
 #include <mach/rockchip/grf_rk3288.h>
 #include <mach/rockchip/hardware.h>
 #include <debug_ll.h>
+#include <mach/rockchip/debug_ll.h>
 
 extern char __dtb_rk3288_phycore_som_start[];
 
diff --git a/arch/arm/include/asm/debug_ll.h b/arch/arm/include/asm/debug_ll.h
index 52723d7204..52e0b9223f 100644
--- a/arch/arm/include/asm/debug_ll.h
+++ b/arch/arm/include/asm/debug_ll.h
@@ -7,11 +7,13 @@
 #include <mach/imx/debug_ll.h>
 #endif
 
+#ifdef CONFIG_DEBUG_ROCKCHIP_UART
+#include <mach/rockchip/debug_ll.h>
+#endif
+
 #ifdef CONFIG_DEBUG_QEMU_ARM64_VIRT
 #define DEBUG_LL_UART_ADDR		0x9000000
 #include <debug_ll/pl011.h>
-#elif defined CONFIG_ARCH_ROCKCHIP
-#include <mach/rockchip/debug_ll.h>
 #elif defined CONFIG_ARCH_ZYNQMP
 #include <mach/zynqmp/debug_ll.h>
 #elif defined CONFIG_ARCH_MVEBU
diff --git a/common/Kconfig b/common/Kconfig
index dce83cfafc..25f78cca46 100644
--- a/common/Kconfig
+++ b/common/Kconfig
@@ -1252,6 +1252,9 @@ config FRAME_POINTER
 config DEBUG_IMX_UART
 	bool
 
+config DEBUG_ROCKCHIP_UART
+	bool
+
 choice
 	prompt "Kernel low-level debugging port"
 	depends on DEBUG_LL
@@ -1383,6 +1386,7 @@ config DEBUG_AM33XX_UART
 config DEBUG_ROCKCHIP_RK3188_UART
 	bool "RK3188 Debug UART"
 	depends on ARCH_RK3188
+	select DEBUG_ROCKCHIP_UART
 	help
 	  Say Y here if you want kernel low-level debugging support
 	  on RK3188.
@@ -1390,6 +1394,7 @@ config DEBUG_ROCKCHIP_RK3188_UART
 config DEBUG_ROCKCHIP_RK3288_UART
 	bool "RK3288 Debug UART"
 	depends on ARCH_RK3288
+	select DEBUG_ROCKCHIP_UART
 	help
 	  Say Y here if you want kernel low-level debugging support
 	  on RK3288.
@@ -1397,6 +1402,7 @@ config DEBUG_ROCKCHIP_RK3288_UART
 config DEBUG_ROCKCHIP_RK3568_UART
 	bool "RK3568 Debug UART"
 	depends on ARCH_RK3568
+	select DEBUG_ROCKCHIP_UART
 	help
 	  Say Y here if you want kernel low-level debugging support
 	  on RK3568.
@@ -1404,6 +1410,7 @@ config DEBUG_ROCKCHIP_RK3568_UART
 config DEBUG_ROCKCHIP_RK3399_UART
 	bool "RK3399 Debug UART"
 	depends on ARCH_RK3399
+	select DEBUG_ROCKCHIP_UART
 	help
 	  Say Y here if you want kernel low-level debugging support
 	  on RK3399.
diff --git a/include/mach/rockchip/debug_ll.h b/include/mach/rockchip/debug_ll.h
index a4b203794f..b1cf16a2dc 100644
--- a/include/mach/rockchip/debug_ll.h
+++ b/include/mach/rockchip/debug_ll.h
@@ -10,7 +10,7 @@
 #include <mach/rockchip/rk3568-regs.h>
 #include <mach/rockchip/rk3399-regs.h>
 
-#ifdef CONFIG_DEBUG_LL
+#ifdef CONFIG_DEBUG_ROCKCHIP_UART
 
 #ifdef CONFIG_DEBUG_ROCKCHIP_RK3188_UART
 
-- 
2.30.2




More information about the barebox mailing list