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

ARM: debug: add support for word accesses to debug/8250.S

Add 32-bit word access support to debug/8250.S and convert Picoxcell
and SoCFPGA to this.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>

+33 -72
+12 -2
arch/arm/Kconfig.debug
··· 451 451 config DEBUG_PICOXCELL_UART 452 452 depends on ARCH_PICOXCELL 453 453 bool "Use PicoXcell UART for low-level debug" 454 + select DEBUG_UART_8250 454 455 help 455 456 Say Y here if you want kernel low-level debugging support 456 457 on PicoXcell based platforms. ··· 594 593 config DEBUG_SOCFPGA_UART 595 594 depends on ARCH_SOCFPGA 596 595 bool "Use SOCFPGA UART for low-level debug" 596 + select DEBUG_UART_8250 597 597 help 598 598 Say Y here if you want kernel low-level debugging support 599 599 on SOCFPGA based platforms. ··· 853 851 default "debug/nomadik.S" if DEBUG_NOMADIK_UART 854 852 default "debug/nspire.S" if DEBUG_NSPIRE_CX_UART 855 853 default "debug/omap2plus.S" if DEBUG_OMAP2PLUS_UART 856 - default "debug/picoxcell.S" if DEBUG_PICOXCELL_UART 857 854 default "debug/sirf.S" if DEBUG_SIRFPRIMA2_UART1 || DEBUG_SIRFMARCO_UART1 858 - default "debug/socfpga.S" if DEBUG_SOCFPGA_UART 859 855 default "debug/sti.S" if DEBUG_STI_UART 860 856 default "debug/tegra.S" if DEBUG_TEGRA_UART 861 857 default "debug/u300.S" if DEBUG_U300_UART ··· 886 886 default 0x40100000 if DEBUG_PXA_UART1 887 887 default 0x42000000 if ARCH_GEMINI 888 888 default 0x7c0003f8 if FOOTBRIDGE 889 + default 0x80230000 if DEBUG_PICOXCELL_UART 889 890 default 0x90020000 if DEBUG_NSPIRE_CLASSIC_UART 890 891 default 0xc8000000 if ARCH_IXP4XX && !CPU_BIG_ENDIAN 891 892 default 0xc8000003 if ARCH_IXP4XX && CPU_BIG_ENDIAN ··· 898 897 default 0xf1012000 if ARCH_DOVE || ARCH_KIRKWOOD || ARCH_MV78XX0 || \ 899 898 ARCH_ORION5X 900 899 default 0xfe800000 if ARCH_IOP32X 900 + default 0xffc02000 if DEBUG_SOCFPGA_UART 901 901 default 0xffd82340 if ARCH_IOP13XX 902 902 default 0xfffff700 if ARCH_IOP33X 903 903 depends on DEBUG_UART_8250 ··· 917 915 default 0xfe012000 if ARCH_ORION5X 918 916 default 0xfe017000 if DEBUG_MMP_UART2 919 917 default 0xfe018000 if DEBUG_MMP_UART3 918 + default 0xfe230000 if DEBUG_PICOXCELL_UART 920 919 default 0xfe800000 if ARCH_IOP32X 921 920 default 0xfeb24000 if DEBUG_RK3X_UART0 922 921 default 0xfeb26000 if DEBUG_RK3X_UART1 ··· 925 922 default 0xfed60000 if DEBUG_RK29_UART0 926 923 default 0xfed64000 if DEBUG_RK29_UART1 || DEBUG_RK3X_UART2 927 924 default 0xfed68000 if DEBUG_RK29_UART2 || DEBUG_RK3X_UART3 925 + default 0xfec02000 if DEBUG_SOCFPGA_UART 928 926 default 0xfed12000 if ARCH_KIRKWOOD 929 927 default 0xfee003f8 if FOOTBRIDGE 930 928 default 0xfee20000 if DEBUG_NSPIRE_CLASSIC_UART ··· 940 936 depends on DEBUG_UART_8250 941 937 default 0 if FOOTBRIDGE || ARCH_IOP32X 942 938 default 2 939 + 940 + config DEBUG_UART_8250_WORD 941 + bool "Use 32-bit accesses for 8250 UART" 942 + depends on DEBUG_UART_8250 943 + depends on DEBUG_UART_8250_SHIFT >= 2 944 + default y if DEBUG_PICOXCELL_UART || DEBUG_SOCFPGA_UART 943 945 944 946 config DEBUG_UART_8250_FLOW_CONTROL 945 947 bool "Enable flow control for 8250 UART"
+21 -3
arch/arm/include/debug/8250.S
··· 14 14 ldr \rv, =CONFIG_DEBUG_UART_VIRT 15 15 .endm 16 16 17 + #ifdef CONFIG_DEBUG_UART_8250_WORD 18 + .macro store, rd, rx:vararg 19 + str \rd, \rx 20 + .endm 21 + 22 + .macro load, rd, rx:vararg 23 + ldr \rd, \rx 24 + .endm 25 + #else 26 + .macro store, rd, rx:vararg 27 + strb \rd, \rx 28 + .endm 29 + 30 + .macro load, rd, rx:vararg 31 + ldrb \rd, \rx 32 + .endm 33 + #endif 34 + 17 35 #define UART_SHIFT CONFIG_DEBUG_UART_8250_SHIFT 18 36 19 37 .macro senduart,rd,rx 20 - strb \rd, [\rx, #UART_TX << UART_SHIFT] 38 + store \rd, [\rx, #UART_TX << UART_SHIFT] 21 39 .endm 22 40 23 41 .macro busyuart,rd,rx 24 - 1002: ldrb \rd, [\rx, #UART_LSR << UART_SHIFT] 42 + 1002: load \rd, [\rx, #UART_LSR << UART_SHIFT] 25 43 and \rd, \rd, #UART_LSR_TEMT | UART_LSR_THRE 26 44 teq \rd, #UART_LSR_TEMT | UART_LSR_THRE 27 45 bne 1002b ··· 47 29 48 30 .macro waituart,rd,rx 49 31 #ifdef CONFIG_DEBUG_UART_8250_FLOW_CONTROL 50 - 1001: ldrb \rd, [\rx, #UART_MSR << UART_SHIFT] 32 + 1001: load \rd, [\rx, #UART_MSR << UART_SHIFT] 51 33 tst \rd, #UART_MSR_CTS 52 34 beq 1001b 53 35 #endif
-27
arch/arm/include/debug/8250_32.S
··· 1 - /* 2 - * Copyright (c) 2011 Picochip Ltd., Jamie Iles 3 - * 4 - * This program is free software; you can redistribute it and/or modify 5 - * it under the terms of the GNU General Public License version 2 as 6 - * published by the Free Software Foundation. 7 - * 8 - * Derived from arch/arm/mach-davinci/include/mach/debug-macro.S to use 32-bit 9 - * accesses to the 8250. 10 - */ 11 - 12 - #include <linux/serial_reg.h> 13 - 14 - .macro senduart,rd,rx 15 - str \rd, [\rx, #UART_TX << UART_SHIFT] 16 - .endm 17 - 18 - .macro busyuart,rd,rx 19 - 1002: ldr \rd, [\rx, #UART_LSR << UART_SHIFT] 20 - and \rd, \rd, #UART_LSR_TEMT | UART_LSR_THRE 21 - teq \rd, #UART_LSR_TEMT | UART_LSR_THRE 22 - bne 1002b 23 - .endm 24 - 25 - /* The UART's don't have any flow control IO's wired up. */ 26 - .macro waituart,rd,rx 27 - .endm
-19
arch/arm/include/debug/picoxcell.S
··· 1 - /* 2 - * Copyright (c) 2011 Picochip Ltd., Jamie Iles 3 - * 4 - * This program is free software; you can redistribute it and/or modify 5 - * it under the terms of the GNU General Public License version 2 as 6 - * published by the Free Software Foundation. 7 - * 8 - */ 9 - 10 - #define UART_SHIFT 2 11 - #define PICOXCELL_UART1_BASE 0x80230000 12 - #define PHYS_TO_IO(x) (((x) & 0x00ffffff) | 0xfe000000) 13 - 14 - .macro addruart, rp, rv, tmp 15 - ldr \rv, =PHYS_TO_IO(PICOXCELL_UART1_BASE) 16 - ldr \rp, =PICOXCELL_UART1_BASE 17 - .endm 18 - 19 - #include "8250_32.S"
-21
arch/arm/include/debug/socfpga.S
··· 1 - /* 2 - * Copyright (C) 1994-1999 Russell King 3 - * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks 4 - * 5 - * This program is free software; you can redistribute it and/or modify 6 - * it under the terms of the GNU General Public License version 2 as 7 - * published by the Free Software Foundation. 8 - */ 9 - 10 - #define UART_SHIFT 2 11 - #define DEBUG_LL_UART_OFFSET 0x00002000 12 - 13 - .macro addruart, rp, rv, tmp 14 - mov \rp, #DEBUG_LL_UART_OFFSET 15 - orr \rp, \rp, #0x00c00000 16 - orr \rv, \rp, #0xfe000000 @ virtual base 17 - orr \rp, \rp, #0xff000000 @ physical base 18 - .endm 19 - 20 - #include "8250_32.S" 21 -