ARM: S3C24XX: cleanup debug macro/earlyprintk
Subsystems (3)
v2 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)
changes since v1:
- do not introduce a secondary choice option, instead implement the s3c2410 debug uarts as separate options
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 | 54 +++++++++++- 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, 98 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 v2 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 v2 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 | 30 ++++++++++++++ arch/arm/mach-s3c24xx/Kconfig | 28 ------------- arch/arm/mach-s3c24xx/include/mach/debug-macro.S | 52 +----------------------- 3 files changed, 31 insertions(+), 79 deletions(-)
arch/arm/Kconfig.debug +30 -0
@@ -670,6 +670,33 @@ choice The uncompressor code port configuration is now handled by CONFIG_S3C_LOWLEVEL_UART_PORT. + config DEBUG_S3C2410_UART0 + depends on ARCH_S3C24XX + select DEBUG_S3C2410_UART + bool "Use S3C2410/S3C2412 UART 0 for low-level debug" + help + Say Y here if you want the debug print routines to direct + their output to UART 0. The port must have been initialised + by the boot-loader before use. + + config DEBUG_S3C2410_UART1 + depends on ARCH_S3C24XX + select DEBUG_S3C2410_UART + bool "Use S3C2410/S3C2412 UART 1 for low-level debug" + help + Say Y here if you want the debug print routines to direct + their output to UART 1. The port must have been initialised + by the boot-loader before use. + + config DEBUG_S3C2410_UART2 + depends on ARCH_S3C24XX + select DEBUG_S3C2410_UART + bool "Use S3C2410/S3C2412 UART 2 for low-level debug" + help + Say Y here if you want the debug print routines to direct + their output to UART 2. The port must have been initialised + by the boot-loader before use. + config DEBUG_SOCFPGA_UART depends on ARCH_SOCFPGA bool "Use SOCFPGA UART for low-level debug"
@@ -921,6 +948,9 @@ endchoice config DEBUG_EXYNOS_UART bool +config DEBUG_S3C2410_UART + bool + config DEBUG_OMAP2PLUS_UART bool depends on ARCH_OMAP2PLUS
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 v2 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 | 23 +++++++++++++++++++++-- arch/arm/mach-s3c24xx/include/mach/debug-macro.S | 9 ++------- 2 files changed, 23 insertions(+), 9 deletions(-)
arch/arm/Kconfig.debug +21 -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
@@ -950,6 +953,10 @@ config DEBUG_EXYNOS_UART config DEBUG_S3C2410_UART bool + select DEBUG_S3C24XX_UART + +config DEBUG_S3C24XX_UART + bool config DEBUG_OMAP2PLUS_UART bool
@@ -1059,6 +1066,12 @@ 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 || \ + DEBUG_S3C2410_UART0) + default 0x50004000 if DEBUG_S3C24XX_UART && (DEBUG_S3C_UART1 || \ + DEBUG_S3C2410_UART1) + default 0x50008000 if DEBUG_S3C24XX_UART && (DEBUG_S3C_UART2 || \ + DEBUG_S3C2410_UART2) default 0x7c0003f8 if FOOTBRIDGE default 0x80230000 if DEBUG_PICOXCELL_UART default 0x80070000 if DEBUG_IMX23_UART
@@ -1088,7 +1101,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"
@@ -1105,6 +1118,12 @@ 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 || \ + DEBUG_S3C2410_UART0) + default 0xf7004000 if DEBUG_S3C24XX_UART && (DEBUG_S3C_UART1 || \ + DEBUG_S3C2410_UART1) + default 0xf7008000 if DEBUG_S3C24XX_UART && (DEBUG_S3C_UART2 || \ + DEBUG_S3C2410_UART2) default 0xf7fc9000 if DEBUG_BERLIN_UART default 0xf8009000 if DEBUG_VEXPRESS_UART0_CA9 default 0xf8090000 if DEBUG_VEXPRESS_UART0_RS1
@@ -1146,7 +1165,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 v2 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
@@ -1010,6 +1010,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
v2 cover ARM: S3C24XX: cleanup debug macro/earlyprintk
In reply to Heiko StübnerQuoted 6 lines · Heiko St?bner
This series tries to simplify the s3c24xx debug macro, removing dependencies
on mach/ includes, static mappings and finally moving it intoinclude/debug.
I think, it's good way :)
Quoted 7 lines
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.
Yeah, I also don't want s3c24xx to support multiplatform in near future.
Quoted 22 lines
Based on 3.15-rc1 and tested on a S3C2442 Openmoko Freerunner (GTA02)
changes since v1:
- do not introduce a secondary choice option, instead implement the s3c2410 debug uarts as separate optionsHeiko 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: movedebug-macro.Sinto the common spacearch/arm/Kconfig.debug | 54 +++++++++++- 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, 98 insertions(+), 136 deletions(-) create mode 100644 arch/arm/include/debug/s3c24xx.S delete mode 100644 arch/arm/mach-s3c24xx/include/mach/debug-macro.S
Quoted 2 lines
--
1.9.0
Basically I'm OK on this series but need to get review from Russell?
Thanks,
Kukjin
v2 cover ARM: S3C24XX: cleanup debug macro/earlyprintk
Am Dienstag, 6. Mai 2014, 13:16:14 schrieb Kukjin Kim:
Quoted 38 lines
Quoted 4 lines · Heiko St?bner
This series tries to simplify the s3c24xx debug macro, removing dependencies
on mach/ includes, static mappings and finally moving it intoinclude/debug.I think, it's good way :)
Quoted 6 lines
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.
Yeah, I also don't want s3c24xx to support multiplatform in near future.
Quoted 21 lines
Based on 3.15-rc1 and tested on a S3C2442 Openmoko Freerunner (GTA02)
changes since v1:
- do not introduce a secondary choice option, instead implement thes3c2410 debug uarts as separate options
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: movedebug-macro.Sinto the common spacearch/arm/Kconfig.debug | 54 +++++++++++- 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 -----------------------
Quoted 8 lines
Quoted 6 lines
5 files changed, 98 insertions(+), 136 deletions(-) create mode 100644 arch/arm/include/debug/s3c24xx.S delete mode 100644 arch/arm/mach-s3c24xx/include/mach/debug-macro.S--
1.9.0Basically I'm OK on this series but need to get review from Russell?
Russell pointed out a bad decision on my part in v1, so I guess he is aware of this series :-) . I've also added arm at kernel.org now, so they can complain, if anything is done wrong [should've probably done that from the beginning].
Heiko
v2 cover ARM: S3C24XX: cleanup debug macro/earlyprintk
Quoted 1 line · Heiko St?bner
[...]
Quoted 20 lines
Quoted 7 lines
Quoted 7 lines
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: movedebug-macro.Sinto the common spaceQuoted 5 lines
Quoted 5 lines
arch/arm/Kconfig.debug | 54 +++++++++++- 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 ------------------
Quoted 7 lines
Quoted 7 lines
-----
5 files changed, 98 insertions(+), 136 deletions(-) create mode 100644 arch/arm/include/debug/s3c24xx.S delete mode 100644 arch/arm/mach-s3c24xx/include/mach/debug-macro.S
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines
--
1.9.0Basically I'm OK on this series but need to get review from Russell?
Russell pointed out a bad decision on my part in v1, so I guess he is aware of
this series :-) . I've also added arm at kernel.org now, so they can
complain,
Quoted 3 lines
if
anything is done wrong [should've probably done that from the beginning].
OK, I will apply this series.
Russell, do you have any comments on this series, please kindly let us know.
Thanks,
Kukjin