ARM: S3C24XX: cleanup debug macro/earlyprintk
Subsystems (3)
cover ARM: S3C24XX: cleanup debug macro/earlyprintk
This series tries to simplify the s3c24xx debug macro, removing dependencies on mach/ includes, static mappings and finally moving it into include/debug.
The one slightly invasive change is the need for the developer to select the uart type by himself, which gets rid of the debug macro trying to determine the uart type itself.
But as usage of the debug-uart is not the common case - especially in a multiplatform scenario - I didn't worry to much.
Based on 3.15-rc1 and tested on a S3C2442 Openmoko Freerunner (GTA02)
Heiko Stuebner (4):
ARM: compressed/head.S: remove s3c24xx special case
ARM: S3C24XX: trim down debug uart handling
ARM: S3C24XX: use generic DEBUG_UART_PHY/_VIRT in debug macro
ARM: S3C24XX: move debug-macro.S into the common space
arch/arm/Kconfig.debug | 36 +++++++- arch/arm/boot/compressed/head.S | 5 -- arch/arm/include/debug/s3c24xx.S | 46 +++++++++++ arch/arm/mach-s3c24xx/Kconfig | 28 ------- arch/arm/mach-s3c24xx/include/mach/debug-macro.S | 101 ----------------------- 5 files changed, 80 insertions(+), 136 deletions(-) create mode 100644 arch/arm/include/debug/s3c24xx.S delete mode 100644 arch/arm/mach-s3c24xx/include/mach/debug-macro.S
Signature · 1 line
1.9.0
PATCH 1/4 ARM: compressed/head.S: remove s3c24xx special case
addruart from the generic debug macro is doing exactly the same using the common lowlevel uart definition, so there is no cause for this special casing for s3c24xx.
--- arch/arm/boot/compressed/head.S | 5 ----- 1 file changed, 5 deletions(-)
arch/arm/boot/compressed/head.S +0 -5
@@ -60,11 +60,6 @@ add \rb, \rb, #0x00010000 @ Ser1 #endif .endm -#elif defined(CONFIG_ARCH_S3C24XX) - .macro loadsp, rb, tmp - mov \rb, #0x50000000 - add \rb, \rb, #0x4000 * CONFIG_S3C_LOWLEVEL_UART_PORT - .endm #else .macro loadsp, rb, tmp addruart \rb, \tmp
Signature · 1 line
1.9.0
PATCH 2/4 ARM: S3C24XX: trim down debug uart handling
In reply to Heiko StübnerUsing the lowlevel debug uart is a corner case - even more so in a multiplatform environment. So it seems reasonable to simply let the developer set the appropriate uart type for the debugged SoC.
--- arch/arm/Kconfig.debug | 16 ++++++++ arch/arm/mach-s3c24xx/Kconfig | 28 ------------- arch/arm/mach-s3c24xx/include/mach/debug-macro.S | 52 +----------------------- 3 files changed, 17 insertions(+), 79 deletions(-)
arch/arm/Kconfig.debug +16 -0
@@ -918,6 +918,22 @@ choice endchoice +choice + prompt "S3C24XX low-level debugging port type" + depends on DEBUG_LL && ARCH_S3C24XX + + config DEBUG_S3C24XX_UART_S3C2440 + bool "S3C2440 uart type" + help + Select this if you're debugging S3C2416, S3C2440, S3C2442, + S3C2443 or S3C2450 SoCs. + + config DEBUG_S3C24XX_UART_S3C2410 + bool "S3C2410 uart type" + help + Select this if you're debugging S3C2410 or S3C2412 SoCs. +endchoice + config DEBUG_EXYNOS_UART bool
arch/arm/mach-s3c24xx/Kconfig +0 -28
@@ -26,7 +26,6 @@ config CPU_S3C2410 bool "SAMSUNG S3C2410" default y select CPU_ARM920T - select CPU_LLSERIAL_S3C2410 select S3C2410_CLOCK select S3C2410_DMA if S3C24XX_DMA select ARM_S3C2410_CPUFREQ if ARM_S3C24XX_CPUFREQ
@@ -39,7 +38,6 @@ config CPU_S3C2410 config CPU_S3C2412 bool "SAMSUNG S3C2412" select CPU_ARM926T - select CPU_LLSERIAL_S3C2440 select S3C2412_DMA if S3C24XX_DMA select S3C2412_PM if PM help
@@ -48,7 +46,6 @@ config CPU_S3C2412 config CPU_S3C2416 bool "SAMSUNG S3C2416/S3C2450" select CPU_ARM926T - select CPU_LLSERIAL_S3C2440 select S3C2416_PM if PM select S3C2443_COMMON select S3C2443_DMA if S3C24XX_DMA
@@ -59,7 +56,6 @@ config CPU_S3C2416 config CPU_S3C2440 bool "SAMSUNG S3C2440" select CPU_ARM920T - select CPU_LLSERIAL_S3C2440 select S3C2410_CLOCK select S3C2410_PM if PM select S3C2440_DMA if S3C24XX_DMA
@@ -69,7 +65,6 @@ config CPU_S3C2440 config CPU_S3C2442 bool "SAMSUNG S3C2442" select CPU_ARM920T - select CPU_LLSERIAL_S3C2440 select S3C2410_CLOCK select S3C2410_DMA if S3C24XX_DMA select S3C2410_PM if PM
@@ -84,7 +79,6 @@ config CPU_S3C244X config CPU_S3C2443 bool "SAMSUNG S3C2443" select CPU_ARM920T - select CPU_LLSERIAL_S3C2440 select S3C2443_COMMON select S3C2443_DMA if S3C24XX_DMA select SAMSUNG_CLKSRC
@@ -158,28 +152,6 @@ config S3C2410_PM help Power Management code common to S3C2410 and better -# low-level serial option nodes - -config CPU_LLSERIAL_S3C2410_ONLY - bool - default y if CPU_LLSERIAL_S3C2410 && !CPU_LLSERIAL_S3C2440 - -config CPU_LLSERIAL_S3C2440_ONLY - bool - default y if CPU_LLSERIAL_S3C2440 && !CPU_LLSERIAL_S3C2410 - -config CPU_LLSERIAL_S3C2410 - bool - help - Selected if there is an S3C2410 (or register compatible) serial - low-level implementation needed - -config CPU_LLSERIAL_S3C2440 - bool - help - Selected if there is an S3C2440 (or register compatible) serial - low-level implementation needed - config S3C24XX_PLL bool "Support CPUfreq changing of PLL frequency (EXPERIMENTAL)" depends on ARM_S3C24XX_CPUFREQ
arch/arm/mach-s3c24xx/include/mach/debug-macro.S +1 -51
80 lines not on this page · raw message
Signature · 1 line
1.9.0
PATCH 3/4 ARM: S3C24XX: use generic DEBUG_UART_PHY/_VIRT in debug macro
In reply to Heiko StübnerThis removes the need for mach/-headers in the debug macro.
--- arch/arm/Kconfig.debug | 19 +++++++++++++++++-- arch/arm/mach-s3c24xx/include/mach/debug-macro.S | 9 ++------- 2 files changed, 19 insertions(+), 9 deletions(-)
arch/arm/Kconfig.debug +17 -2
@@ -625,6 +625,7 @@ choice config DEBUG_S3C_UART0 depends on PLAT_SAMSUNG select DEBUG_EXYNOS_UART if ARCH_EXYNOS + select DEBUG_S3C24XX_UART if ARCH_S3C24XX bool "Use S3C UART 0 for low-level debug" help Say Y here if you want the debug print routines to direct
@@ -637,6 +638,7 @@ choice config DEBUG_S3C_UART1 depends on PLAT_SAMSUNG select DEBUG_EXYNOS_UART if ARCH_EXYNOS + select DEBUG_S3C24XX_UART if ARCH_S3C24XX bool "Use S3C UART 1 for low-level debug" help Say Y here if you want the debug print routines to direct
@@ -649,6 +651,7 @@ choice config DEBUG_S3C_UART2 depends on PLAT_SAMSUNG select DEBUG_EXYNOS_UART if ARCH_EXYNOS + select DEBUG_S3C24XX_UART if ARCH_S3C24XX bool "Use S3C UART 2 for low-level debug" help Say Y here if you want the debug print routines to direct
@@ -661,6 +664,7 @@ choice config DEBUG_S3C_UART3 depends on PLAT_SAMSUNG && ARCH_EXYNOS select DEBUG_EXYNOS_UART + select DEBUG_S3C24XX_UART if ARCH_S3C24XX bool "Use S3C UART 3 for low-level debug" help Say Y here if you want the debug print routines to direct
@@ -937,6 +941,9 @@ endchoice config DEBUG_EXYNOS_UART bool +config DEBUG_S3C24XX_UART + bool + config DEBUG_OMAP2PLUS_UART bool depends on ARCH_OMAP2PLUS
@@ -1045,6 +1052,10 @@ config DEBUG_UART_PHYS default 0x40090000 if ARCH_LPC32XX default 0x40100000 if DEBUG_PXA_UART1 default 0x42000000 if ARCH_GEMINI + default 0x50000000 if DEBUG_S3C24XX_UART && DEBUG_S3C_UART0 + default 0x50004000 if DEBUG_S3C24XX_UART && DEBUG_S3C_UART1 + default 0x50008000 if DEBUG_S3C24XX_UART && DEBUG_S3C_UART2 + default 0x5000C000 if DEBUG_S3C24XX_UART && DEBUG_S3C_UART3 default 0x7c0003f8 if FOOTBRIDGE default 0x80230000 if DEBUG_PICOXCELL_UART default 0x80070000 if DEBUG_IMX23_UART
@@ -1074,7 +1085,7 @@ config DEBUG_UART_PHYS default 0xfffff700 if ARCH_IOP33X depends on DEBUG_LL_UART_8250 || DEBUG_LL_UART_PL01X || \ DEBUG_LL_UART_EFM32 || \ - DEBUG_UART_8250 || DEBUG_UART_PL01X + DEBUG_UART_8250 || DEBUG_UART_PL01X || DEBUG_S3C24XX_UART config DEBUG_UART_VIRT hex "Virtual base address of debug UART"
@@ -1091,6 +1102,10 @@ config DEBUG_UART_VIRT default 0xf2100000 if DEBUG_PXA_UART1 default 0xf4090000 if ARCH_LPC32XX default 0xf4200000 if ARCH_GEMINI + default 0xf7000000 if DEBUG_S3C24XX_UART && DEBUG_S3C_UART0 + default 0xf7004000 if DEBUG_S3C24XX_UART && DEBUG_S3C_UART1 + default 0xf7008000 if DEBUG_S3C24XX_UART && DEBUG_S3C_UART2 + default 0xf700c000 if DEBUG_S3C24XX_UART && DEBUG_S3C_UART3 default 0xf7fc9000 if DEBUG_BERLIN_UART default 0xf8009000 if DEBUG_VEXPRESS_UART0_CA9 default 0xf8090000 if DEBUG_VEXPRESS_UART0_RS1
@@ -1132,7 +1147,7 @@ config DEBUG_UART_VIRT default 0xff003000 if DEBUG_U300_UART default DEBUG_UART_PHYS if !MMU depends on DEBUG_LL_UART_8250 || DEBUG_LL_UART_PL01X || \ - DEBUG_UART_8250 || DEBUG_UART_PL01X + DEBUG_UART_8250 || DEBUG_UART_PL01X || DEBUG_S3C24XX_UART config DEBUG_UART_8250_SHIFT int "Register offset shift for the 8250 debug UART"
arch/arm/mach-s3c24xx/include/mach/debug-macro.S +2 -7
@@ -12,18 +12,13 @@ * published by the Free Software Foundation. */ -#include <mach/map.h> #include <linux/serial_s3c.h> #define S3C2410_UART1_OFF (0x4000) .macro addruart, rp, rv, tmp - ldr \rp, = S3C24XX_PA_UART - ldr \rv, = S3C24XX_VA_UART -#if CONFIG_DEBUG_S3C_UART != 0 - add \rp, \rp, #(S3C2410_UART1_OFF * CONFIG_DEBUG_S3C_UART) - add \rv, \rv, #(S3C2410_UART1_OFF * CONFIG_DEBUG_S3C_UART) -#endif + ldr \rp, = CONFIG_DEBUG_UART_PHYS + ldr \rv, = CONFIG_DEBUG_UART_VIRT .endm .macro fifo_full_s3c2410 rd, rx
Signature · 1 line
1.9.0
PATCH 4/4 ARM: S3C24XX: move debug-macro.S into the common space
In reply to Heiko StübnerMove debug-macro.S from mach/include to include/debug where all other common debug macros are.
---
arch/arm/Kconfig.debug | 1 +
.../{mach-s3c24xx/include/mach/debug-macro.S => include/debug/s3c24xx.S} | 0
2 files changed, 1 insertion(+)
rename arch/arm/{mach-s3c24xx/include/mach/debug-macro.S => include/debug/s3c24xx.S} (100%)arch/arm/Kconfig.debug +1 -0
@@ -996,6 +996,7 @@ config DEBUG_LL_INCLUDE DEBUG_IMX6SL_UART default "debug/msm.S" if DEBUG_MSM_UART default "debug/omap2plus.S" if DEBUG_OMAP2PLUS_UART + default "debug/s3c24xx.S" if DEBUG_S3C24XX_UART default "debug/sirf.S" if DEBUG_SIRFPRIMA2_UART1 || DEBUG_SIRFMARCO_UART1 default "debug/sti.S" if DEBUG_STI_UART default "debug/tegra.S" if DEBUG_TEGRA_UART
arch/arm/include/debug/s3c24xx.S renamed from arch/arm/mach-s3c24xx/include/mach/debug-macro.S +0 -0
Signature · 1 line
1.9.0
PATCH 2/4 ARM: S3C24XX: trim down debug uart handling
In reply to Heiko StübnerQuoted 5 lines · Heiko St?bner
arch/arm/Kconfig.debug +5
-0+choice + prompt "S3C24XX low-level debugging port type" + depends on DEBUG_LL && ARCH_S3C24XX + + config DEBUG_S3C24XX_UART_S3C2440
arch/arm/Kconfig.debug choice · line 935
Quoted 10 lines
arch/arm/Kconfig.debug +10
-0+ bool "S3C2440 uart type" + help + Select this if you're debugging S3C2416, S3C2440, S3C2442, + S3C2443 or S3C2450 SoCs. + + config DEBUG_S3C24XX_UART_S3C2410 + bool "S3C2410 uart type" + help + Select this if you're debugging S3C2410 or S3C2412 SoCs. +endchoice
Why does this need to be a separate choice statement? What's special about S3C24XX? Is there something wrong with the main choice statement just above this where everyone else lists their debugging UART?
Signature · 2 lines
FTTC broadband for 0.8mile line: now at 9.7Mbps down 460kbps up... slowly improving, and getting towards what was expected from it.
PATCH 2/4 ARM: S3C24XX: trim down debug uart handling
Am Donnerstag, 24. April 2014, 11:34:55 schrieb Russell King - ARM Linux:
Quoted 12 lines · Heiko St?bner
Quoted 11 lines
arch/arm/Kconfig.debug +11
-0+choice + prompt "S3C24XX low-level debugging port type" + depends on DEBUG_LL && ARCH_S3C24XX + + config DEBUG_S3C24XX_UART_S3C2440 + bool "S3C2440 uart type" + help + Select this if you're debugging S3C2416, S3C2440, S3C2442, + S3C2443 or S3C2450 SoCs. + + config DEBUG_S3C24XX_UART_S3C2410
Quoted 8 lines
arch/arm/Kconfig.debug choice · line 935
Quoted 4 lines
arch/arm/Kconfig.debug +4
-0+ bool "S3C2410 uart type" + help + Select this if you're debugging S3C2410 or S3C2412 SoCs. +endchoiceWhy does this need to be a separate choice statement? What's special about S3C24XX? Is there something wrong with the main choice statement just above this where everyone else lists their debugging UART?
The special case is that s3c24xx as architecture has two different uart types. Everything else is the same so I didn't want to duplicate the s3c_debug_uartX entries.
The other option would have been to duplicate these, like having
- s3c_debug_uart[0-3] for the more common s3c2440 type and
- s3c2410_debug_uart[0-3] for the named type
I guess, judging from your comment this would be better? [or I'm just overlooking the obvious third way :-) ]
Heiko