Skip to contentSkip to conversation

bcm283x: debug_ll: add RaspberryPi 4 PL011 UART support

PATCH Applied [email protected] 3 participants 3 messages Aug 23 – Aug 24

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bcm283x: debug_ll: add RaspberryPi 4 PL011 UART support

From: Chali Anis <[email protected]>

Add a DEBUG_RPI4_UART choice for low-level debugging on RaspberryPi 4 and CM4 boards via the PL011 UART (uart0), for setups where the disable-bt overlay routes it onto the GPIO header pins instead of the mini UART. Mirrors the existing RPi1/RPi2-3 PL011 debug_ll support:
firmware configures the UART, so debug_ll_init() is a no-op.

Assisted-by Claude Sonnet 5
---
 common/Kconfig.debug_ll         | 10 ++++++++++
 include/mach/bcm283x/debug_ll.h | 10 ++++++++++
 include/mach/bcm283x/platform.h |  1 +
 3 files changed, 21 insertions(+)
common/Kconfig.debug_ll +10 -0
index 8445b4be0872..5a28dc4a61e7 100644
@@ -275,6 +275,16 @@ config DEBUG_RPI2_3_UART
 	  Say Y here if you want low-level debugging support on
 	  RaspberryPi 2 and 3 boards.
 
+config DEBUG_RPI4_UART
+	bool "RaspberryPi 4 PL011 UART"
+	depends on ARCH_BCM283X
+	select DEBUG_BCM283X_UART
+	help
+	  Say Y here if you want low-level debugging support on
+	  RaspberryPi 4 / CM4 boards using the PL011 UART (uart0),
+	  e.g. when the disable-bt overlay routes it onto the GPIO
+	  header pins instead of the mini UART.
+
 config DEBUG_RPI3_MINI_UART
 	bool "RaspberryPi 3 mini UART"
 	depends on ARCH_BCM283X
include/mach/bcm283x/debug_ll.h +10 -0
index a6a3b8f08856..3f2d5ddc9857 100644
@@ -40,6 +40,16 @@ static inline void debug_ll_init(void)
 #define DEBUG_LL_UART_ADDR BCM2836_PL011_BASE
 #include <debug_ll/pl011.h>
 
+#elif defined CONFIG_DEBUG_RPI4_UART
+
+static inline void debug_ll_init(void)
+{
+	/* Configured by ROM */
+}
+
+#define DEBUG_LL_UART_ADDR BCM2711_PL011_BASE
+#include <debug_ll/pl011.h>
+
 #elif defined CONFIG_DEBUG_RPI3_MINI_UART
 
 static inline uint8_t debug_ll_read_reg(void __iomem *base, int reg)
include/mach/bcm283x/platform.h +1 -0
index b957ac8de35e..54d8b38bd8ed 100644
@@ -32,6 +32,7 @@
 
 #define BCM2835_PL011_BASE 0x20201000
 #define BCM2836_PL011_BASE 0x3f201000UL
+#define BCM2711_PL011_BASE 0xfe201000UL
 #define BCM2835_MINIUART_BASE 0x20215040
 #define BCM2836_MINIUART_BASE 0x3f215040UL
 #define BCM2711_MINIUART_BASE 0xfe215040UL
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · On 8/24/26 12:13 AM, [email protected] wrote:

From: Chali Anis <[email protected]>

Add a DEBUG_RPI4_UART choice for low-level debugging on RaspberryPi 4 and CM4 boards via the PL011 UART (uart0), for setups where the disable-bt overlay routes it onto the GPIO header pins instead of the mini UART. Mirrors the existing RPi1/RPi2-3 PL011 debug_ll support:
firmware configures the UART, so debug_ll_init() is a no-op.

Assisted-by Claude Sonnet 5
Quoted 61 lines
---
 common/Kconfig.debug_ll         | 10 ++++++++++
 include/mach/bcm283x/debug_ll.h | 10 ++++++++++
 include/mach/bcm283x/platform.h |  1 +
 3 files changed, 21 insertions(+)
common/Kconfig.debug_ll +10 -0
index 8445b4be0872..5a28dc4a61e7 100644
@@ -275,6 +275,16 @@ config DEBUG_RPI2_3_UART
 	  Say Y here if you want low-level debugging support on
 	  RaspberryPi 2 and 3 boards.
 
+config DEBUG_RPI4_UART
+	bool "RaspberryPi 4 PL011 UART"
+	depends on ARCH_BCM283X
+	select DEBUG_BCM283X_UART
+	help
+	  Say Y here if you want low-level debugging support on
+	  RaspberryPi 4 / CM4 boards using the PL011 UART (uart0),
+	  e.g. when the disable-bt overlay routes it onto the GPIO
+	  header pins instead of the mini UART.
+
 config DEBUG_RPI3_MINI_UART
 	bool "RaspberryPi 3 mini UART"
 	depends on ARCH_BCM283X
include/mach/bcm283x/debug_ll.h +10 -0
index a6a3b8f08856..3f2d5ddc9857 100644
@@ -40,6 +40,16 @@ static inline void debug_ll_init(void)
 #define DEBUG_LL_UART_ADDR BCM2836_PL011_BASE
 #include <debug_ll/pl011.h>
 
+#elif defined CONFIG_DEBUG_RPI4_UART
+
+static inline void debug_ll_init(void)
+{
+	/* Configured by ROM */
+}
+
+#define DEBUG_LL_UART_ADDR BCM2711_PL011_BASE
+#include <debug_ll/pl011.h>
+
 #elif defined CONFIG_DEBUG_RPI3_MINI_UART
 
 static inline uint8_t debug_ll_read_reg(void __iomem *base, int reg)
include/mach/bcm283x/platform.h +1 -0
index b957ac8de35e..54d8b38bd8ed 100644
@@ -32,6 +32,7 @@
 
 #define BCM2835_PL011_BASE 0x20201000
 #define BCM2836_PL011_BASE 0x3f201000UL
+#define BCM2711_PL011_BASE 0xfe201000UL
 #define BCM2835_MINIUART_BASE 0x20215040
 #define BCM2836_MINIUART_BASE 0x3f215040UL
 #define BCM2711_MINIUART_BASE 0xfe215040UL
Signature · 4 lines
Pengutronix e.K.                  |                             |
Steuerwalder Str. 21              | http://www.pengutronix.de/  |
31137 Hildesheim, Germany         | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686  | Fax:   +49-5121-206917-5555 |
Applied
#2 lore raw
In reply to [email protected]
Quoted 8 lines · On Mon, 24 Aug 2026 00:13:29 +0200, [email protected] wrote:

Add a DEBUG_RPI4_UART choice for low-level debugging on RaspberryPi 4 and CM4 boards via the PL011 UART (uart0), for setups where the disable-bt overlay routes it onto the GPIO header pins instead of the mini UART. Mirrors the existing RPi1/RPi2-3 PL011 debug_ll support:
firmware configures the UART, so debug_ll_init() is a no-op.

[...]

Applied, thanks!

[1/1] bcm283x: debug_ll: add RaspberryPi 4 PL011 UART support

      https://git.pengutronix.de/cgit/barebox/commit/?id=4836941756bb (link may not be stable)

Best regards,

Signature · 1 line
Sascha Hauer <[email protected]>