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

ARM: 9043/1: tegra: Fix misplaced tegra_uart_config in decompressor

The tegra_uart_config of the DEBUG_LL code is now placed right at the
start of the .text section after commit which enabled debug output in the
decompressor. Tegra devices are not booting anymore if DEBUG_LL is enabled
since tegra_uart_config data is executes as a code. Fix the misplaced
tegra_uart_config storage by embedding it into the code.

Cc: stable@vger.kernel.org
Fixes: 2596a72d3384 ("ARM: 9009/1: uncompress: Enable debug in head.S")
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>

authored by

Dmitry Osipenko and committed by
Russell King
538eea53 39d3454c

+27 -27
+27 -27
arch/arm/include/debug/tegra.S
··· 149 149 150 150 .align 151 151 99: .word . 152 + #if defined(ZIMAGE) 153 + .word . + 4 154 + /* 155 + * Storage for the state maintained by the macro. 156 + * 157 + * In the kernel proper, this data is located in arch/arm/mach-tegra/tegra.c. 158 + * That's because this header is included from multiple files, and we only 159 + * want a single copy of the data. In particular, the UART probing code above 160 + * assumes it's running using physical addresses. This is true when this file 161 + * is included from head.o, but not when included from debug.o. So we need 162 + * to share the probe results between the two copies, rather than having 163 + * to re-run the probing again later. 164 + * 165 + * In the decompressor, we put the storage right here, since common.c 166 + * isn't included in the decompressor build. This storage data gets put in 167 + * .text even though it's really data, since .data is discarded from the 168 + * decompressor. Luckily, .text is writeable in the decompressor, unless 169 + * CONFIG_ZBOOT_ROM. That dependency is handled in arch/arm/Kconfig.debug. 170 + */ 171 + /* Debug UART initialization required */ 172 + .word 1 173 + /* Debug UART physical address */ 174 + .word 0 175 + /* Debug UART virtual address */ 176 + .word 0 177 + #else 152 178 .word tegra_uart_config 179 + #endif 153 180 .ltorg 154 181 155 182 /* Load previously selected UART address */ ··· 216 189 217 190 .macro waituarttxrdy,rd,rx 218 191 .endm 219 - 220 - /* 221 - * Storage for the state maintained by the macros above. 222 - * 223 - * In the kernel proper, this data is located in arch/arm/mach-tegra/tegra.c. 224 - * That's because this header is included from multiple files, and we only 225 - * want a single copy of the data. In particular, the UART probing code above 226 - * assumes it's running using physical addresses. This is true when this file 227 - * is included from head.o, but not when included from debug.o. So we need 228 - * to share the probe results between the two copies, rather than having 229 - * to re-run the probing again later. 230 - * 231 - * In the decompressor, we put the symbol/storage right here, since common.c 232 - * isn't included in the decompressor build. This symbol gets put in .text 233 - * even though it's really data, since .data is discarded from the 234 - * decompressor. Luckily, .text is writeable in the decompressor, unless 235 - * CONFIG_ZBOOT_ROM. That dependency is handled in arch/arm/Kconfig.debug. 236 - */ 237 - #if defined(ZIMAGE) 238 - tegra_uart_config: 239 - /* Debug UART initialization required */ 240 - .word 1 241 - /* Debug UART physical address */ 242 - .word 0 243 - /* Debug UART virtual address */ 244 - .word 0 245 - #endif