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

ARM: BCM63XX: add low-level UART debug support

Broadcom BCM63xx DSL SoCs have a different UART implementation for which
we need specially crafted low-level debug assembly code to support. Add
support for this using the standard definitions provided in
include/linux/serial_bcm63xx.h (shared with their MIPS counterparts).

Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>

+49 -2
+16 -2
arch/arm/Kconfig.debug
··· 122 122 mobile SoCs in the Kona family of chips (e.g. bcm28155, 123 123 bcm11351, etc...) 124 124 125 + config DEBUG_BCM63XX 126 + bool "Kernel low-level debugging on BCM63XX UART" 127 + depends on ARCH_BCM_63XX 128 + select DEBUG_UART_BCM63XX 129 + 125 130 config DEBUG_BERLIN_UART 126 131 bool "Marvell Berlin SoC Debug UART" 127 132 depends on ARCH_BERLIN ··· 1043 1038 default "debug/vf.S" if DEBUG_VF_UART 1044 1039 default "debug/vt8500.S" if DEBUG_VT8500_UART0 1045 1040 default "debug/zynq.S" if DEBUG_ZYNQ_UART0 || DEBUG_ZYNQ_UART1 1041 + default "debug/bcm63xx.S" if DEBUG_UART_BCM63XX 1046 1042 default "mach/debug-macro.S" 1047 1043 1048 1044 # Compatibility options for PL01x ··· 1062 1056 ARCH_GEMINI || ARCH_IOP13XX || ARCH_IOP32X || \ 1063 1057 ARCH_IOP33X || ARCH_IXP4XX || \ 1064 1058 ARCH_LPC32XX || ARCH_MV78XX0 || ARCH_ORION5X || ARCH_RPC 1059 + 1060 + # Compatibility options for BCM63xx 1061 + config DEBUG_UART_BCM63XX 1062 + def_bool ARCH_BCM_63XX 1065 1063 1066 1064 config DEBUG_UART_PHYS 1067 1065 hex "Physical base address of debug UART" ··· 1132 1122 default 0xffc02000 if DEBUG_SOCFPGA_UART 1133 1123 default 0xffd82340 if ARCH_IOP13XX 1134 1124 default 0xfff36000 if DEBUG_HIGHBANK_UART 1125 + default 0xfffe8600 if DEBUG_UART_BCM63XX 1135 1126 default 0xfffff700 if ARCH_IOP33X 1136 1127 depends on DEBUG_LL_UART_8250 || DEBUG_LL_UART_PL01X || \ 1137 1128 DEBUG_LL_UART_EFM32 || \ 1138 1129 DEBUG_UART_8250 || DEBUG_UART_PL01X || \ 1139 - DEBUG_MSM_UART || DEBUG_QCOM_UARTDM || DEBUG_S3C24XX_UART 1130 + DEBUG_MSM_UART || DEBUG_QCOM_UARTDM || DEBUG_S3C24XX_UART || \ 1131 + DEBUG_UART_BCM63XX 1140 1132 1141 1133 config DEBUG_UART_VIRT 1142 1134 hex "Virtual base address of debug UART" ··· 1169 1157 default 0xfa71e000 if DEBUG_QCOM_UARTDM 1170 1158 default 0xfb009000 if DEBUG_REALVIEW_STD_PORT 1171 1159 default 0xfb10c000 if DEBUG_REALVIEW_PB1176_PORT 1160 + default 0xfcfe8600 if DEBUG_UART_BCM63XX 1172 1161 default 0xfd000000 if ARCH_SPEAR3XX || ARCH_SPEAR6XX 1173 1162 default 0xfd000000 if ARCH_SPEAR13XX 1174 1163 default 0xfd012000 if ARCH_MV78XX0 ··· 1207 1194 default DEBUG_UART_PHYS if !MMU 1208 1195 depends on DEBUG_LL_UART_8250 || DEBUG_LL_UART_PL01X || \ 1209 1196 DEBUG_UART_8250 || DEBUG_UART_PL01X || \ 1210 - DEBUG_MSM_UART || DEBUG_QCOM_UARTDM || DEBUG_S3C24XX_UART 1197 + DEBUG_MSM_UART || DEBUG_QCOM_UARTDM || DEBUG_S3C24XX_UART || \ 1198 + DEBUG_UART_BCM63XX 1211 1199 1212 1200 config DEBUG_UART_8250_SHIFT 1213 1201 int "Register offset shift for the 8250 debug UART"
+33
arch/arm/include/debug/bcm63xx.S
··· 1 + /* 2 + * Broadcom BCM63xx low-level UART debug 3 + * 4 + * Copyright (C) 2014 Broadcom Corporation 5 + * 6 + * This program is free software; you can redistribute it and/or modify 7 + * it under the terms of the GNU General Public License version 2 as 8 + * published by the Free Software Foundation. 9 + */ 10 + 11 + #include <linux/serial_bcm63xx.h> 12 + 13 + .macro addruart, rp, rv, tmp 14 + ldr \rp, =CONFIG_DEBUG_UART_PHYS 15 + ldr \rv, =CONFIG_DEBUG_UART_VIRT 16 + .endm 17 + 18 + .macro senduart, rd, rx 19 + /* word access do not work */ 20 + strb \rd, [\rx, #UART_FIFO_REG] 21 + .endm 22 + 23 + .macro waituart, rd, rx 24 + 1001: ldr \rd, [\rx, #UART_IR_REG] 25 + tst \rd, #(1 << UART_IR_TXEMPTY) 26 + beq 1001b 27 + .endm 28 + 29 + .macro busyuart, rd, rx 30 + 1002: ldr \rd, [\rx, #UART_IR_REG] 31 + tst \rd, #(1 << UART_IR_TXTRESH) 32 + beq 1002b 33 + .endm