All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] ARM: tegra: Fix misplaced tegra_uart_config in decompressor
@ 2020-12-15 13:52 ` Dmitry Osipenko
  0 siblings, 0 replies; 22+ messages in thread
From: Dmitry Osipenko @ 2020-12-15 13:52 UTC (permalink / raw)
  To: Thierry Reding, Jonathan Hunter, Linus Walleij
  Cc: linux-tegra, linux-arm-kernel, linux-kernel

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")
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
---
 arch/arm/include/debug/tegra.S | 54 +++++++++++++++++-----------------
 1 file changed, 27 insertions(+), 27 deletions(-)

diff --git a/arch/arm/include/debug/tegra.S b/arch/arm/include/debug/tegra.S
index 98daa7f48314..7267516db0ba 100644
--- a/arch/arm/include/debug/tegra.S
+++ b/arch/arm/include/debug/tegra.S
@@ -149,7 +149,34 @@
 
 		.align
 99:		.word	.
+#if defined(ZIMAGE)
+		.word	. + 4
+/*
+ * Storage for the state maintained by the macro.
+ *
+ * In the kernel proper, this data is located in arch/arm/mach-tegra/tegra.c.
+ * That's because this header is included from multiple files, and we only
+ * want a single copy of the data. In particular, the UART probing code above
+ * assumes it's running using physical addresses. This is true when this file
+ * is included from head.o, but not when included from debug.o. So we need
+ * to share the probe results between the two copies, rather than having
+ * to re-run the probing again later.
+ *
+ * In the decompressor, we put the storage right here, since common.c
+ * isn't included in the decompressor build. This storage data gets put in
+ * .text even though it's really data, since .data is discarded from the
+ * decompressor. Luckily, .text is writeable in the decompressor, unless
+ * CONFIG_ZBOOT_ROM. That dependency is handled in arch/arm/Kconfig.debug.
+ */
+		/* Debug UART initialization required */
+		.word 1
+		/* Debug UART physical address */
+		.word 0
+		/* Debug UART virtual address */
+		.word 0
+#else
 		.word	tegra_uart_config
+#endif
 		.ltorg
 
 		/* Load previously selected UART address */
@@ -189,30 +216,3 @@
 
 		.macro	waituarttxrdy,rd,rx
 		.endm
-
-/*
- * Storage for the state maintained by the macros above.
- *
- * In the kernel proper, this data is located in arch/arm/mach-tegra/tegra.c.
- * That's because this header is included from multiple files, and we only
- * want a single copy of the data. In particular, the UART probing code above
- * assumes it's running using physical addresses. This is true when this file
- * is included from head.o, but not when included from debug.o. So we need
- * to share the probe results between the two copies, rather than having
- * to re-run the probing again later.
- *
- * In the decompressor, we put the symbol/storage right here, since common.c
- * isn't included in the decompressor build. This symbol gets put in .text
- * even though it's really data, since .data is discarded from the
- * decompressor. Luckily, .text is writeable in the decompressor, unless
- * CONFIG_ZBOOT_ROM. That dependency is handled in arch/arm/Kconfig.debug.
- */
-#if defined(ZIMAGE)
-tegra_uart_config:
-	/* Debug UART initialization required */
-	.word 1
-	/* Debug UART physical address */
-	.word 0
-	/* Debug UART virtual address */
-	.word 0
-#endif
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2020-12-15 19:48 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-15 13:52 [PATCH v1] ARM: tegra: Fix misplaced tegra_uart_config in decompressor Dmitry Osipenko
2020-12-15 13:52 ` Dmitry Osipenko
2020-12-15 14:28 ` Linus Walleij
2020-12-15 14:28   ` Linus Walleij
2020-12-15 15:20   ` Dmitry Osipenko
2020-12-15 15:20     ` Dmitry Osipenko
2020-12-15 16:04 ` Florian Fainelli
2020-12-15 16:04   ` Florian Fainelli
2020-12-15 16:17   ` Dmitry Osipenko
2020-12-15 16:17     ` Dmitry Osipenko
2020-12-15 16:40     ` Florian Fainelli
2020-12-15 16:40       ` Florian Fainelli
2020-12-15 16:53       ` Dmitry Osipenko
2020-12-15 16:53         ` Dmitry Osipenko
2020-12-15 18:22         ` Florian Fainelli
2020-12-15 18:22           ` Florian Fainelli
2020-12-15 18:56           ` Dmitry Osipenko
2020-12-15 18:56             ` Dmitry Osipenko
2020-12-15 19:20             ` Florian Fainelli
2020-12-15 19:20               ` Florian Fainelli
2020-12-15 19:47               ` Dmitry Osipenko
2020-12-15 19:47                 ` Dmitry Osipenko

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.