diff options
author | Heiko Stuebner <heiko@sntech.de> | 2014-05-15 17:59:18 -0400 |
---|---|---|
committer | Kukjin Kim <kgene.kim@samsung.com> | 2014-05-25 15:05:00 -0400 |
commit | daf67dfc5989495c887cfdbe76be72b7db724e60 (patch) | |
tree | c78979790b42a27cfbd5dd0f965383d47a9431ed /arch | |
parent | 46f34abc750c66fdb4daa9a8bc9d7f955e95eb9c (diff) |
ARM: S3C24XX: trim down debug uart handling
Using 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.
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/Kconfig.debug | 30 | ||||
-rw-r--r-- | arch/arm/mach-s3c24xx/Kconfig | 28 | ||||
-rw-r--r-- | arch/arm/mach-s3c24xx/include/mach/debug-macro.S | 52 |
3 files changed, 31 insertions, 79 deletions
diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug index eab8ecbe69c1..8c72e1003b9a 100644 --- a/arch/arm/Kconfig.debug +++ b/arch/arm/Kconfig.debug | |||
@@ -670,6 +670,33 @@ choice | |||
670 | The uncompressor code port configuration is now handled | 670 | The uncompressor code port configuration is now handled |
671 | by CONFIG_S3C_LOWLEVEL_UART_PORT. | 671 | by CONFIG_S3C_LOWLEVEL_UART_PORT. |
672 | 672 | ||
673 | config DEBUG_S3C2410_UART0 | ||
674 | depends on ARCH_S3C24XX | ||
675 | select DEBUG_S3C2410_UART | ||
676 | bool "Use S3C2410/S3C2412 UART 0 for low-level debug" | ||
677 | help | ||
678 | Say Y here if you want the debug print routines to direct | ||
679 | their output to UART 0. The port must have been initialised | ||
680 | by the boot-loader before use. | ||
681 | |||
682 | config DEBUG_S3C2410_UART1 | ||
683 | depends on ARCH_S3C24XX | ||
684 | select DEBUG_S3C2410_UART | ||
685 | bool "Use S3C2410/S3C2412 UART 1 for low-level debug" | ||
686 | help | ||
687 | Say Y here if you want the debug print routines to direct | ||
688 | their output to UART 1. The port must have been initialised | ||
689 | by the boot-loader before use. | ||
690 | |||
691 | config DEBUG_S3C2410_UART2 | ||
692 | depends on ARCH_S3C24XX | ||
693 | select DEBUG_S3C2410_UART | ||
694 | bool "Use S3C2410/S3C2412 UART 2 for low-level debug" | ||
695 | help | ||
696 | Say Y here if you want the debug print routines to direct | ||
697 | their output to UART 2. The port must have been initialised | ||
698 | by the boot-loader before use. | ||
699 | |||
673 | config DEBUG_SOCFPGA_UART | 700 | config DEBUG_SOCFPGA_UART |
674 | depends on ARCH_SOCFPGA | 701 | depends on ARCH_SOCFPGA |
675 | bool "Use SOCFPGA UART for low-level debug" | 702 | bool "Use SOCFPGA UART for low-level debug" |
@@ -921,6 +948,9 @@ endchoice | |||
921 | config DEBUG_EXYNOS_UART | 948 | config DEBUG_EXYNOS_UART |
922 | bool | 949 | bool |
923 | 950 | ||
951 | config DEBUG_S3C2410_UART | ||
952 | bool | ||
953 | |||
924 | config DEBUG_OMAP2PLUS_UART | 954 | config DEBUG_OMAP2PLUS_UART |
925 | bool | 955 | bool |
926 | depends on ARCH_OMAP2PLUS | 956 | depends on ARCH_OMAP2PLUS |
diff --git a/arch/arm/mach-s3c24xx/Kconfig b/arch/arm/mach-s3c24xx/Kconfig index 22d149bcfcc6..45a7026e9419 100644 --- a/arch/arm/mach-s3c24xx/Kconfig +++ b/arch/arm/mach-s3c24xx/Kconfig | |||
@@ -39,7 +39,6 @@ config CPU_S3C2410 | |||
39 | default y | 39 | default y |
40 | select COMMON_CLK | 40 | select COMMON_CLK |
41 | select CPU_ARM920T | 41 | select CPU_ARM920T |
42 | select CPU_LLSERIAL_S3C2410 | ||
43 | select S3C2410_COMMON_CLK | 42 | select S3C2410_COMMON_CLK |
44 | select S3C2410_DMA if S3C24XX_DMA | 43 | select S3C2410_DMA if S3C24XX_DMA |
45 | select ARM_S3C2410_CPUFREQ if ARM_S3C24XX_CPUFREQ | 44 | select ARM_S3C2410_CPUFREQ if ARM_S3C24XX_CPUFREQ |
@@ -53,7 +52,6 @@ config CPU_S3C2412 | |||
53 | bool "SAMSUNG S3C2412" | 52 | bool "SAMSUNG S3C2412" |
54 | select COMMON_CLK | 53 | select COMMON_CLK |
55 | select CPU_ARM926T | 54 | select CPU_ARM926T |
56 | select CPU_LLSERIAL_S3C2440 | ||
57 | select S3C2412_COMMON_CLK | 55 | select S3C2412_COMMON_CLK |
58 | select S3C2412_DMA if S3C24XX_DMA | 56 | select S3C2412_DMA if S3C24XX_DMA |
59 | select S3C2412_PM if PM | 57 | select S3C2412_PM if PM |
@@ -64,7 +62,6 @@ config CPU_S3C2416 | |||
64 | bool "SAMSUNG S3C2416/S3C2450" | 62 | bool "SAMSUNG S3C2416/S3C2450" |
65 | select COMMON_CLK | 63 | select COMMON_CLK |
66 | select CPU_ARM926T | 64 | select CPU_ARM926T |
67 | select CPU_LLSERIAL_S3C2440 | ||
68 | select S3C2416_PM if PM | 65 | select S3C2416_PM if PM |
69 | select S3C2443_COMMON_CLK | 66 | select S3C2443_COMMON_CLK |
70 | select S3C2443_DMA if S3C24XX_DMA | 67 | select S3C2443_DMA if S3C24XX_DMA |
@@ -75,7 +72,6 @@ config CPU_S3C2440 | |||
75 | bool "SAMSUNG S3C2440" | 72 | bool "SAMSUNG S3C2440" |
76 | select COMMON_CLK | 73 | select COMMON_CLK |
77 | select CPU_ARM920T | 74 | select CPU_ARM920T |
78 | select CPU_LLSERIAL_S3C2440 | ||
79 | select S3C2410_COMMON_CLK | 75 | select S3C2410_COMMON_CLK |
80 | select S3C2410_PM if PM | 76 | select S3C2410_PM if PM |
81 | select S3C2440_DMA if S3C24XX_DMA | 77 | select S3C2440_DMA if S3C24XX_DMA |
@@ -86,7 +82,6 @@ config CPU_S3C2442 | |||
86 | bool "SAMSUNG S3C2442" | 82 | bool "SAMSUNG S3C2442" |
87 | select COMMON_CLK | 83 | select COMMON_CLK |
88 | select CPU_ARM920T | 84 | select CPU_ARM920T |
89 | select CPU_LLSERIAL_S3C2440 | ||
90 | select S3C2410_COMMON_CLK | 85 | select S3C2410_COMMON_CLK |
91 | select S3C2410_DMA if S3C24XX_DMA | 86 | select S3C2410_DMA if S3C24XX_DMA |
92 | select S3C2410_PM if PM | 87 | select S3C2410_PM if PM |
@@ -102,7 +97,6 @@ config CPU_S3C2443 | |||
102 | bool "SAMSUNG S3C2443" | 97 | bool "SAMSUNG S3C2443" |
103 | select COMMON_CLK | 98 | select COMMON_CLK |
104 | select CPU_ARM920T | 99 | select CPU_ARM920T |
105 | select CPU_LLSERIAL_S3C2440 | ||
106 | select S3C2443_COMMON_CLK | 100 | select S3C2443_COMMON_CLK |
107 | select S3C2443_DMA if S3C24XX_DMA | 101 | select S3C2443_DMA if S3C24XX_DMA |
108 | help | 102 | help |
@@ -164,28 +158,6 @@ config S3C2410_PM | |||
164 | help | 158 | help |
165 | Power Management code common to S3C2410 and better | 159 | Power Management code common to S3C2410 and better |
166 | 160 | ||
167 | # low-level serial option nodes | ||
168 | |||
169 | config CPU_LLSERIAL_S3C2410_ONLY | ||
170 | bool | ||
171 | default y if CPU_LLSERIAL_S3C2410 && !CPU_LLSERIAL_S3C2440 | ||
172 | |||
173 | config CPU_LLSERIAL_S3C2440_ONLY | ||
174 | bool | ||
175 | default y if CPU_LLSERIAL_S3C2440 && !CPU_LLSERIAL_S3C2410 | ||
176 | |||
177 | config CPU_LLSERIAL_S3C2410 | ||
178 | bool | ||
179 | help | ||
180 | Selected if there is an S3C2410 (or register compatible) serial | ||
181 | low-level implementation needed | ||
182 | |||
183 | config CPU_LLSERIAL_S3C2440 | ||
184 | bool | ||
185 | help | ||
186 | Selected if there is an S3C2440 (or register compatible) serial | ||
187 | low-level implementation needed | ||
188 | |||
189 | config S3C24XX_PLL | 161 | config S3C24XX_PLL |
190 | bool "Support CPUfreq changing of PLL frequency (EXPERIMENTAL)" | 162 | bool "Support CPUfreq changing of PLL frequency (EXPERIMENTAL)" |
191 | depends on ARM_S3C24XX_CPUFREQ | 163 | depends on ARM_S3C24XX_CPUFREQ |
diff --git a/arch/arm/mach-s3c24xx/include/mach/debug-macro.S b/arch/arm/mach-s3c24xx/include/mach/debug-macro.S index 2f39737544c0..fbe3e711ebab 100644 --- a/arch/arm/mach-s3c24xx/include/mach/debug-macro.S +++ b/arch/arm/mach-s3c24xx/include/mach/debug-macro.S | |||
@@ -13,11 +13,9 @@ | |||
13 | */ | 13 | */ |
14 | 14 | ||
15 | #include <mach/map.h> | 15 | #include <mach/map.h> |
16 | #include <mach/regs-gpio.h> | ||
17 | #include <linux/serial_s3c.h> | 16 | #include <linux/serial_s3c.h> |
18 | 17 | ||
19 | #define S3C2410_UART1_OFF (0x4000) | 18 | #define S3C2410_UART1_OFF (0x4000) |
20 | #define SHIFT_2440TXF (14-9) | ||
21 | 19 | ||
22 | .macro addruart, rp, rv, tmp | 20 | .macro addruart, rp, rv, tmp |
23 | ldr \rp, = S3C24XX_PA_UART | 21 | ldr \rp, = S3C24XX_PA_UART |
@@ -28,56 +26,11 @@ | |||
28 | #endif | 26 | #endif |
29 | .endm | 27 | .endm |
30 | 28 | ||
31 | .macro fifo_full_s3c24xx rd, rx | ||
32 | @ check for arm920 vs arm926. currently assume all arm926 | ||
33 | @ devices have an 64 byte FIFO identical to the s3c2440 | ||
34 | mrc p15, 0, \rd, c0, c0 | ||
35 | and \rd, \rd, #0xff0 | ||
36 | teq \rd, #0x260 | ||
37 | beq 1004f | ||
38 | mrc p15, 0, \rd, c1, c0 | ||
39 | tst \rd, #1 | ||
40 | addeq \rd, \rx, #(S3C24XX_PA_GPIO - S3C24XX_PA_UART) | ||
41 | addne \rd, \rx, #(S3C24XX_VA_GPIO - S3C24XX_VA_UART) | ||
42 | bic \rd, \rd, #0xff000 | ||
43 | ldr \rd, [\rd, # S3C2410_GSTATUS1 - S3C2410_GPIOREG(0)] | ||
44 | and \rd, \rd, #0x00ff0000 | ||
45 | teq \rd, #0x00440000 @ is it 2440? | ||
46 | 1004: | ||
47 | ldr \rd, [\rx, # S3C2410_UFSTAT] | ||
48 | moveq \rd, \rd, lsr #SHIFT_2440TXF | ||
49 | tst \rd, #S3C2410_UFSTAT_TXFULL | ||
50 | .endm | ||
51 | |||
52 | .macro fifo_full_s3c2410 rd, rx | 29 | .macro fifo_full_s3c2410 rd, rx |
53 | ldr \rd, [\rx, # S3C2410_UFSTAT] | 30 | ldr \rd, [\rx, # S3C2410_UFSTAT] |
54 | tst \rd, #S3C2410_UFSTAT_TXFULL | 31 | tst \rd, #S3C2410_UFSTAT_TXFULL |
55 | .endm | 32 | .endm |
56 | 33 | ||
57 | /* fifo level reading */ | ||
58 | |||
59 | .macro fifo_level_s3c24xx rd, rx | ||
60 | @ check for arm920 vs arm926. currently assume all arm926 | ||
61 | @ devices have an 64 byte FIFO identical to the s3c2440 | ||
62 | mrc p15, 0, \rd, c0, c0 | ||
63 | and \rd, \rd, #0xff0 | ||
64 | teq \rd, #0x260 | ||
65 | beq 10000f | ||
66 | mrc p15, 0, \rd, c1, c0 | ||
67 | tst \rd, #1 | ||
68 | addeq \rd, \rx, #(S3C24XX_PA_GPIO - S3C24XX_PA_UART) | ||
69 | addne \rd, \rx, #(S3C24XX_VA_GPIO - S3C24XX_VA_UART) | ||
70 | bic \rd, \rd, #0xff000 | ||
71 | ldr \rd, [\rd, # S3C2410_GSTATUS1 - S3C2410_GPIOREG(0)] | ||
72 | and \rd, \rd, #0x00ff0000 | ||
73 | teq \rd, #0x00440000 @ is it 2440? | ||
74 | |||
75 | 10000: | ||
76 | ldr \rd, [\rx, # S3C2410_UFSTAT] | ||
77 | andne \rd, \rd, #S3C2410_UFSTAT_TXMASK | ||
78 | andeq \rd, \rd, #S3C2440_UFSTAT_TXMASK | ||
79 | .endm | ||
80 | |||
81 | .macro fifo_level_s3c2410 rd, rx | 34 | .macro fifo_level_s3c2410 rd, rx |
82 | ldr \rd, [\rx, # S3C2410_UFSTAT] | 35 | ldr \rd, [\rx, # S3C2410_UFSTAT] |
83 | and \rd, \rd, #S3C2410_UFSTAT_TXMASK | 36 | and \rd, \rd, #S3C2410_UFSTAT_TXMASK |
@@ -88,12 +41,9 @@ | |||
88 | * used variants of these | 41 | * used variants of these |
89 | */ | 42 | */ |
90 | 43 | ||
91 | #if defined(CONFIG_CPU_LLSERIAL_S3C2410_ONLY) | 44 | #if defined(CONFIG_DEBUG_S3C2410_UART) |
92 | #define fifo_full fifo_full_s3c2410 | 45 | #define fifo_full fifo_full_s3c2410 |
93 | #define fifo_level fifo_level_s3c2410 | 46 | #define fifo_level fifo_level_s3c2410 |
94 | #elif !defined(CONFIG_CPU_LLSERIAL_S3C2440_ONLY) | ||
95 | #define fifo_full fifo_full_s3c24xx | ||
96 | #define fifo_level fifo_level_s3c24xx | ||
97 | #endif | 47 | #endif |
98 | 48 | ||
99 | /* include the reset of the code which will do the work */ | 49 | /* include the reset of the code which will do the work */ |