Skip to content

Commit 538eea5

Browse files
digetxRussell King
authored andcommitted
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: [email protected] Fixes: 2596a72 ("ARM: 9009/1: uncompress: Enable debug in head.S") Reviewed-by: Linus Walleij <[email protected]> Signed-off-by: Dmitry Osipenko <[email protected]> Signed-off-by: Russell King <[email protected]>
1 parent 39d3454 commit 538eea5

File tree

1 file changed

+27
-27
lines changed

1 file changed

+27
-27
lines changed

arch/arm/include/debug/tegra.S

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,34 @@
149149

150150
.align
151151
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
152178
.word tegra_uart_config
179+
#endif
153180
.ltorg
154181

155182
/* Load previously selected UART address */
@@ -189,30 +216,3 @@
189216

190217
.macro waituarttxrdy,rd,rx
191218
.endm
192-
193-
/*
194-
* Storage for the state maintained by the macros above.
195-
*
196-
* In the kernel proper, this data is located in arch/arm/mach-tegra/tegra.c.
197-
* That's because this header is included from multiple files, and we only
198-
* want a single copy of the data. In particular, the UART probing code above
199-
* assumes it's running using physical addresses. This is true when this file
200-
* is included from head.o, but not when included from debug.o. So we need
201-
* to share the probe results between the two copies, rather than having
202-
* to re-run the probing again later.
203-
*
204-
* In the decompressor, we put the symbol/storage right here, since common.c
205-
* isn't included in the decompressor build. This symbol gets put in .text
206-
* even though it's really data, since .data is discarded from the
207-
* decompressor. Luckily, .text is writeable in the decompressor, unless
208-
* CONFIG_ZBOOT_ROM. That dependency is handled in arch/arm/Kconfig.debug.
209-
*/
210-
#if defined(ZIMAGE)
211-
tegra_uart_config:
212-
/* Debug UART initialization required */
213-
.word 1
214-
/* Debug UART physical address */
215-
.word 0
216-
/* Debug UART virtual address */
217-
.word 0
218-
#endif

0 commit comments

Comments
 (0)