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 Signed-off-by: Chali Anis <[email protected]> --- common/Kconfig.debug_ll | 10 ++++++++++ include/mach/bcm283x/debug_ll.h | 10 ++++++++++ include/mach/bcm283x/platform.h | 1 + 3 files changed, 21 insertions(+) diff --git a/common/Kconfig.debug_ll b/common/Kconfig.debug_ll index 8445b4be0872..5a28dc4a61e7 100644 --- a/common/Kconfig.debug_ll +++ b/common/Kconfig.debug_ll @@ -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 diff --git a/include/mach/bcm283x/debug_ll.h b/include/mach/bcm283x/debug_ll.h index a6a3b8f08856..3f2d5ddc9857 100644 --- a/include/mach/bcm283x/debug_ll.h +++ b/include/mach/bcm283x/debug_ll.h @@ -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) diff --git a/include/mach/bcm283x/platform.h b/include/mach/bcm283x/platform.h index b957ac8de35e..54d8b38bd8ed 100644 --- a/include/mach/bcm283x/platform.h +++ b/include/mach/bcm283x/platform.h @@ -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
