diff options
author | Stephen Warren <swarren@nvidia.com> | 2012-10-01 17:21:20 -0400 |
---|---|---|
committer | Stephen Warren <swarren@nvidia.com> | 2012-11-16 14:22:17 -0500 |
commit | adc18315889b3e67a4a2a9717fbbfab5cd2d7b57 (patch) | |
tree | 29e1af24405e1b2b21ae660e2d5b663a15029158 /arch/arm/mach-tegra/include/mach | |
parent | c5a4d6b07ac98405f347c796bc74f4367e516898 (diff) |
ARM: tegra: simplify DEBUG_LL UART selection options
Delete CONFIG_TEGRA_DEBUG_UART_AUTO_SCRATCH; it's not useful any more:
* No upstream bootloader currently or will ever support this option.
* CONFIG_TEGRA_DEBUG_UART_AUTO_ODMDATA is a much more direct alternative.
Merge the fixed and automatic UART selection menus into a single choice
for simplicity; now you either pick AUTO_ODMDATA or a single fixed UART,
rather than potentially having an AUTO option override whatever fixed
option was chosen.
Remove TEGRA_DEBUG_UART_NONE; if you don't want a Tegra DEBUG_LL UART,
simply don't turn on DEBUG_LL. NONE used to be the default option, so
pick AUTO_ODMDATA as the new default.
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Diffstat (limited to 'arch/arm/mach-tegra/include/mach')
-rw-r--r-- | arch/arm/mach-tegra/include/mach/uncompress.h | 52 |
1 files changed, 4 insertions, 48 deletions
diff --git a/arch/arm/mach-tegra/include/mach/uncompress.h b/arch/arm/mach-tegra/include/mach/uncompress.h index 27725750ca3e..4150c71c006f 100644 --- a/arch/arm/mach-tegra/include/mach/uncompress.h +++ b/arch/arm/mach-tegra/include/mach/uncompress.h | |||
@@ -139,51 +139,19 @@ int auto_odmdata(void) | |||
139 | } | 139 | } |
140 | #endif | 140 | #endif |
141 | 141 | ||
142 | #ifdef CONFIG_TEGRA_DEBUG_UART_AUTO_SCRATCH | ||
143 | int auto_scratch(void) | ||
144 | { | ||
145 | int i; | ||
146 | |||
147 | /* | ||
148 | * Look for the first UART that: | ||
149 | * a) Is not in reset. | ||
150 | * b) Is clocked. | ||
151 | * c) Has a 'D' in the scratchpad register. | ||
152 | * | ||
153 | * Note that on Tegra30, the first two conditions are required, since | ||
154 | * if not true, accesses to the UART scratch register will hang. | ||
155 | * Tegra20 doesn't have this issue. | ||
156 | * | ||
157 | * The intent is that the bootloader will tell the kernel which UART | ||
158 | * to use by setting up those conditions. If nothing found, we'll fall | ||
159 | * back to what's specified in TEGRA_DEBUG_UART_BASE. | ||
160 | */ | ||
161 | for (i = 0; i < ARRAY_SIZE(uarts); i++) { | ||
162 | if (!uart_clocked(i)) | ||
163 | continue; | ||
164 | |||
165 | uart = (volatile u8 *)uarts[i].base; | ||
166 | if (uart[UART_SCR << DEBUG_UART_SHIFT] != 'D') | ||
167 | continue; | ||
168 | |||
169 | return i; | ||
170 | } | ||
171 | |||
172 | return -1; | ||
173 | } | ||
174 | #endif | ||
175 | |||
176 | /* | 142 | /* |
177 | * Setup before decompression. This is where we do UART selection for | 143 | * Setup before decompression. This is where we do UART selection for |
178 | * earlyprintk and init the uart_base register. | 144 | * earlyprintk and init the uart_base register. |
179 | */ | 145 | */ |
180 | static inline void arch_decomp_setup(void) | 146 | static inline void arch_decomp_setup(void) |
181 | { | 147 | { |
182 | int uart_id, auto_uart_id; | 148 | int uart_id; |
183 | volatile u32 *apb_misc = (volatile u32 *)TEGRA_APB_MISC_BASE; | 149 | volatile u32 *apb_misc = (volatile u32 *)TEGRA_APB_MISC_BASE; |
184 | u32 chip, div; | 150 | u32 chip, div; |
185 | 151 | ||
186 | #if defined(CONFIG_TEGRA_DEBUG_UARTA) | 152 | #if defined(CONFIG_TEGRA_DEBUG_UART_AUTO_ODMDATA) |
153 | uart_id = auto_odmdata(); | ||
154 | #elif defined(CONFIG_TEGRA_DEBUG_UARTA) | ||
187 | uart_id = 0; | 155 | uart_id = 0; |
188 | #elif defined(CONFIG_TEGRA_DEBUG_UARTB) | 156 | #elif defined(CONFIG_TEGRA_DEBUG_UARTB) |
189 | uart_id = 1; | 157 | uart_id = 1; |
@@ -193,19 +161,7 @@ static inline void arch_decomp_setup(void) | |||
193 | uart_id = 3; | 161 | uart_id = 3; |
194 | #elif defined(CONFIG_TEGRA_DEBUG_UARTE) | 162 | #elif defined(CONFIG_TEGRA_DEBUG_UARTE) |
195 | uart_id = 4; | 163 | uart_id = 4; |
196 | #else | ||
197 | uart_id = -1; | ||
198 | #endif | ||
199 | |||
200 | #if defined(CONFIG_TEGRA_DEBUG_UART_AUTO_ODMDATA) | ||
201 | auto_uart_id = auto_odmdata(); | ||
202 | #elif defined(CONFIG_TEGRA_DEBUG_UART_AUTO_SCRATCH) | ||
203 | auto_uart_id = auto_scratch(); | ||
204 | #else | ||
205 | auto_uart_id = -1; | ||
206 | #endif | 164 | #endif |
207 | if (auto_uart_id != -1) | ||
208 | uart_id = auto_uart_id; | ||
209 | 165 | ||
210 | if (uart_id < 0 || uart_id >= ARRAY_SIZE(uarts) || | 166 | if (uart_id < 0 || uart_id >= ARRAY_SIZE(uarts) || |
211 | !uart_clocked(uart_id)) | 167 | !uart_clocked(uart_id)) |