Skip to contentSkip to conversation

ARM: brcmstb: Add earlyprintk support using run-time checks

PATCH Superseded Florian Fainelli 1 participant 2 messages Jul 1, 2016

Subsystems (4)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: brcmstb: Add earlyprintk support using run-time checks

SUN_TOP_CTRL_FAMILY_ID is at a fixed absolute address for all of our supported chips, so utilize its value to determine what the UARTA base address should be.

Since the code is called both during decompressor when the MMU is off, and after the MMU has been turned on, and we want to do the lookup only once, we use the same technique as tegra.S and have a shared storage location between the decompressor and the kernel.

---
 arch/arm/Kconfig.debug           |   7 +-
 arch/arm/include/debug/brcmstb.S | 145 +++++++++++++++++++++++++++++++++++++++
 arch/arm/mach-bcm/brcmstb.c      |  16 +++++
 3 files changed, 163 insertions(+), 5 deletions(-)
 create mode 100644 arch/arm/include/debug/brcmstb.S
arch/arm/Kconfig.debug +2 -5
index 19a3dcf5eb2e..260a973ab87d 100644
@@ -168,7 +168,6 @@ choice
 	config DEBUG_BRCMSTB_UART
 		bool "Use BRCMSTB UART for low-level debug"
 		depends on ARCH_BRCMSTB
-		select DEBUG_UART_8250
 		help
 		  Say Y here if you want the debug print routines to direct
 		  their output to the first serial port on these devices.
@@ -1408,6 +1407,7 @@ config DEBUG_LL_INCLUDE
 	default "debug/zynq.S" if DEBUG_ZYNQ_UART0 || DEBUG_ZYNQ_UART1
 	default "debug/bcm63xx.S" if DEBUG_BCM63XX_UART
 	default "debug/digicolor.S" if DEBUG_DIGICOLOR_UA0
+	default "debug/brcmstb.S" if DEBUG_BRCMSTB_UART
 	default "mach/debug-macro.S"
 
 # Compatibility options for PL01x
@@ -1498,7 +1498,6 @@ config DEBUG_UART_PHYS
 	default 0xe6e60000 if DEBUG_RCAR_GEN2_SCIF0
 	default 0xe8008000 if DEBUG_R7S72100_SCIF2
 	default 0xf0000be0 if ARCH_EBSA110
-	default 0xf040ab00 if DEBUG_BRCMSTB_UART
 	default 0xf1012000 if DEBUG_MVEBU_UART0_ALTERNATE
 	default 0xf1012100 if DEBUG_MVEBU_UART1_ALTERNATE
 	default 0xf7fc9000 if DEBUG_BERLIN_UART
@@ -1574,7 +1573,6 @@ config DEBUG_UART_VIRT
 	default 0xfb002000 if DEBUG_CNS3XXX
 	default 0xfb009000 if DEBUG_REALVIEW_STD_PORT
 	default 0xfb10c000 if DEBUG_REALVIEW_PB1176_PORT
-	default 0xfc40ab00 if DEBUG_BRCMSTB_UART
 	default 0xfc705000 if DEBUG_ZTE_ZX
 	default 0xfcfe8600 if DEBUG_BCM63XX_UART
 	default 0xfd000000 if DEBUG_SPEAR3XX || DEBUG_SPEAR13XX
@@ -1646,8 +1644,7 @@ config DEBUG_UART_8250_WORD
 		DEBUG_ALPINE_UART0 || \
 		DEBUG_DAVINCI_DMx_UART0 || DEBUG_DAVINCI_DA8XX_UART1 || \
 		DEBUG_DAVINCI_DA8XX_UART2 || \
-		DEBUG_BCM_KONA_UART || DEBUG_RK32_UART2 || \
-		DEBUG_BRCMSTB_UART
+		DEBUG_BCM_KONA_UART || DEBUG_RK32_UART2
 
 config DEBUG_UART_8250_PALMCHIP
 	bool "8250 UART is Palmchip BK-310x"
arch/arm/include/debug/brcmstb.S new file +145 -0

145 lines not on this page · raw message

arch/arm/mach-bcm/brcmstb.c +16 -0
index 99a67cfb7c0d..07e3a86c6466 100644
@@ -19,6 +19,22 @@
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 
+/*
+ * Storage for debug-macro.S's state.
+ *
+ * This must be in .data not .bss so that it gets initialized each time the
+ * kernel is loaded. The data is declared here rather than debug-macro.S so
+ * that multiple inclusions of debug-macro.S point at the same data.
+ */
+u32 brcmstb_uart_config[3] = {
+	/* Debug UART initialization required */
+	1,
+	/* Debug UART physical address */
+	0,
+	/* Debug UART virtual address */
+	0,
+};
+
 static void __init brcmstb_init_irq(void)
 {
 	irqchip_init();
Signature · 1 line
2.7.4
#1 lore raw
Quoted 9 lines · Florian Fainelli

SUN_TOP_CTRL_FAMILY_ID is at a fixed absolute address for all of our supported chips, so utilize its value to determine what the UARTA base address should be.

Since the code is called both during decompressor when the MMU is off, and after the MMU has been turned on, and we want to do the lookup only once, we use the same technique as tegra.S and have a shared storage location between the decompressor and the kernel.

Looks like I missed an update to DEBUG_UNCOMPRESS to make it disbaled if DEBUG_BRCMSTB_UART is enabled.

Should patches to Kconfig.debug be submitted to RMK's patch system, or pulled via arm-soc changes?

Thanks

Signature · 1 line
Florian