summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-bcm283x/include
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2022-06-09 07:59:20 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2022-06-17 08:28:55 +0200
commit5f3249f5a1ac75afaf02506b155db63b6dea3bf9 (patch)
tree00dbac62737a6b98aea424b0d52b447ecec2a6d1 /arch/arm/mach-bcm283x/include
parent4f6ab07e2d485acc05316c3982670e5a5800caa2 (diff)
downloadbarebox-5f3249f5a1ac75afaf02506b155db63b6dea3bf9.tar.gz
barebox-5f3249f5a1ac75afaf02506b155db63b6dea3bf9.tar.xz
ARM: rpi: add debug_ll support for Raspberry Pi 4
The mini uart (Pins 8/10) is the primary UART on the Raspberry Pi 4 and can be set up in firmware by specifying enable_uart=1 in the config.txt. Add a DEBUG_LL implementation to use this for early debugging. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220609055922.667016-20-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/mach-bcm283x/include')
-rw-r--r--arch/arm/mach-bcm283x/include/mach/debug_ll.h20
-rw-r--r--arch/arm/mach-bcm283x/include/mach/platform.h1
2 files changed, 21 insertions, 0 deletions
diff --git a/arch/arm/mach-bcm283x/include/mach/debug_ll.h b/arch/arm/mach-bcm283x/include/mach/debug_ll.h
index db23112aa0..fdb63b4f5a 100644
--- a/arch/arm/mach-bcm283x/include/mach/debug_ll.h
+++ b/arch/arm/mach-bcm283x/include/mach/debug_ll.h
@@ -18,6 +18,7 @@
#define __MACH_BCM2835_DEBUG_LL_H__
#include <mach/platform.h>
+#include <io.h>
#ifdef CONFIG_DEBUG_RPI1_UART
@@ -66,6 +67,25 @@ static inline void debug_ll_init(void)
debug_ll_ns16550_init(divisor);
}
+#elif defined CONFIG_DEBUG_RPI4_MINI_UART
+
+static inline uint8_t debug_ll_read_reg(int reg)
+{
+ return readb(BCM2711_MINIUART_BASE + (reg << 2));
+}
+
+static inline void debug_ll_write_reg(int reg, uint8_t val)
+{
+ writeb(val, BCM2711_MINIUART_BASE + (reg << 2));
+}
+
+#include <debug_ll/ns16550.h>
+
+static inline void debug_ll_init(void)
+{
+ /* Configured by ROM */
+}
+
#else
static inline void debug_ll_init(void)
diff --git a/arch/arm/mach-bcm283x/include/mach/platform.h b/arch/arm/mach-bcm283x/include/mach/platform.h
index 6917e1f345..b957ac8de3 100644
--- a/arch/arm/mach-bcm283x/include/mach/platform.h
+++ b/arch/arm/mach-bcm283x/include/mach/platform.h
@@ -34,6 +34,7 @@
#define BCM2836_PL011_BASE 0x3f201000UL
#define BCM2835_MINIUART_BASE 0x20215040
#define BCM2836_MINIUART_BASE 0x3f215040UL
+#define BCM2711_MINIUART_BASE 0xfe215040UL
#endif