Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ARM: bcm: Support BCMBCA debug UART

The debug UART on the BCMBCA SoCs are in a different place
than on the other BCM platforms. Support this with a static
map when debugging is explicitly configured.

Right now I can only test this on BCM6846 so this is the
only compatible I list for the debug boardfile, but other
compatibles from the BCMBCA family can be added to get
LL_DEBUG support.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: William Zhang <william.zhang@broadcom.com>
Link: https://lore.kernel.org/r/20240923-bcm-arm-bcm6846-v2-1-f4a7191b501a@linaro.org
Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>

authored by

Linus Walleij and committed by
Florian Fainelli
60d76ce9 9852d85e

+41 -3
+9 -3
arch/arm/Kconfig.debug
··· 242 242 depends on ARCH_BCM_5301X || ARCH_BCM_NSP 243 243 select DEBUG_UART_8250 244 244 245 + config DEBUG_BCMBCA 246 + bool "Kernel low-level debugging on BCMBCA UART0" 247 + depends on ARCH_BCMBCA 248 + 245 249 config DEBUG_BCM_HR2 246 250 bool "Kernel low-level debugging on Hurricane 2 UART2" 247 251 depends on ARCH_BCM_HR2 ··· 1530 1526 default "debug/vf.S" if DEBUG_VF_UART 1531 1527 default "debug/vt8500.S" if DEBUG_VT8500_UART0 1532 1528 default "debug/zynq.S" if DEBUG_ZYNQ_UART0 || DEBUG_ZYNQ_UART1 1533 - default "debug/bcm63xx.S" if DEBUG_BCM63XX_UART 1529 + default "debug/bcm63xx.S" if DEBUG_BCM63XX_UART || DEBUG_BCMBCA 1534 1530 default "debug/digicolor.S" if DEBUG_DIGICOLOR_UA0 1535 1531 default "debug/brcmstb.S" if DEBUG_BRCMSTB_UART 1536 1532 default "mach/debug-macro.S" ··· 1644 1640 default 0xfe531000 if DEBUG_STIH41X_SBC_ASC1 1645 1641 default 0xfed32000 if DEBUG_STIH41X_ASC2 1646 1642 default 0xff690000 if DEBUG_RK32_UART2 1643 + default 0xff800640 if DEBUG_BCMBCA 1647 1644 default 0xffc02000 if DEBUG_SOCFPGA_UART0 1648 1645 default 0xffc02100 if DEBUG_SOCFPGA_ARRIA10_UART1 1649 1646 default 0xffc03000 if DEBUG_SOCFPGA_CYCLONE5_UART1 ··· 1669 1664 DEBUG_RMOBILE_SCIFA0 || DEBUG_RMOBILE_SCIFA1 || \ 1670 1665 DEBUG_RMOBILE_SCIFA4 || \ 1671 1666 DEBUG_S3C64XX_UART || \ 1672 - DEBUG_BCM63XX_UART || DEBUG_ASM9260_UART || \ 1667 + DEBUG_BCM63XX_UART || DEBUG_BCMBCA || DEBUG_ASM9260_UART || \ 1673 1668 DEBUG_DIGICOLOR_UA0 || \ 1674 1669 DEBUG_AT91_UART || DEBUG_STM32_UART || \ 1675 1670 DEBUG_STIH41X_ASC2 || DEBUG_STIH41X_SBC_ASC1 || \ ··· 1739 1734 default 0xfe018000 if DEBUG_MMP_UART3 1740 1735 default 0xfe100000 if DEBUG_IMX23_UART || DEBUG_IMX28_UART 1741 1736 default 0xfe300000 if DEBUG_BCM_KONA_UART 1737 + default 0xfe300640 if DEBUG_BCMBCA 1742 1738 default 0xfeb00000 if DEBUG_HI3620_UART || DEBUG_HIX5HD2_UART 1743 1739 default 0xfeb24000 if DEBUG_RK3X_UART0 1744 1740 default 0xfeb26000 if DEBUG_RK3X_UART1 ··· 1771 1765 DEBUG_UART_8250 || DEBUG_UART_PL01X || DEBUG_MESON_UARTAO || \ 1772 1766 DEBUG_QCOM_UARTDM || \ 1773 1767 DEBUG_S3C64XX_UART || \ 1774 - DEBUG_BCM63XX_UART || DEBUG_ASM9260_UART || \ 1768 + DEBUG_BCM63XX_UART || DEBUG_BCMBCA || DEBUG_ASM9260_UART || \ 1775 1769 DEBUG_DIGICOLOR_UA0 || \ 1776 1770 DEBUG_AT91_UART || DEBUG_STM32_UART || \ 1777 1771 DEBUG_STIH41X_ASC2 || DEBUG_STIH41X_SBC_ASC1 || \
+1
arch/arm/mach-bcm/Makefile
··· 58 58 59 59 # BCMBCA 60 60 ifeq ($(CONFIG_ARCH_BCMBCA),y) 61 + obj-$(CONFIG_DEBUG_BCMBCA) += board_bcmbca.o 61 62 obj-$(CONFIG_SMP) += bcm63xx_smp.o bcm63xx_pmb.o 62 63 endif
+31
arch/arm/mach-bcm/board_bcmbca.c
··· 1 + // SPDX-License-Identifier: GPL-2.0-only 2 + // Copyright (C) 2024 Linus Walleij <linus.walleij@linaro.org> 3 + 4 + #include <asm/mach/arch.h> 5 + #include <asm/mach/map.h> 6 + 7 + /* This is needed for LL-debug/earlyprintk/debug-macro.S */ 8 + static struct map_desc bcmbca_io_desc[] __initdata = { 9 + { 10 + .virtual = CONFIG_DEBUG_UART_VIRT, 11 + .pfn = __phys_to_pfn(CONFIG_DEBUG_UART_PHYS), 12 + .length = SZ_4K, 13 + .type = MT_DEVICE, 14 + }, 15 + }; 16 + 17 + static void __init bcmbca_map_io(void) 18 + { 19 + iotable_init(bcmbca_io_desc, ARRAY_SIZE(bcmbca_io_desc)); 20 + } 21 + 22 + static const char * const bcmbca_dt_compat[] = { 23 + /* TODO: Add other BCMBCA SoCs here to get debug UART support */ 24 + "brcm,bcm6846", 25 + NULL, 26 + }; 27 + 28 + DT_MACHINE_START(BCMBCA_DT, "BCMBCA Broadband Access Processors") 29 + .map_io = bcmbca_map_io, 30 + .dt_compat = bcmbca_dt_compat, 31 + MACHINE_END