hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/arch/arm/include/debug/tegra.S
....@@ -1,3 +1,4 @@
1
+/* SPDX-License-Identifier: GPL-2.0-only */
12 /*
23 * Copyright (C) 2010,2011 Google, Inc.
34 * Copyright (C) 2011-2012 NVIDIA CORPORATION. All Rights Reserved.
....@@ -10,16 +11,6 @@
1011 *
1112 * Portions based on mach-omap2's debug-macro.S
1213 * Copyright (C) 1994-1999 Russell King
13
- *
14
- * This software is licensed under the terms of the GNU General Public
15
- * License version 2, as published by the Free Software Foundation, and
16
- * may be copied, distributed, and modified under those terms.
17
- *
18
- * This program is distributed in the hope that it will be useful,
19
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
20
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
- * GNU General Public License for more details.
22
- *
2314 */
2415
2516 #include <linux/serial_reg.h>
....@@ -158,7 +149,34 @@
158149
159150 .align
160151 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
161178 .word tegra_uart_config
179
+#endif
162180 .ltorg
163181
164182 /* Load previously selected UART address */
....@@ -173,7 +191,7 @@
173191
174192 .macro senduart, rd, rx
175193 cmp \rx, #0
176
- strneb \rd, [\rx, #UART_TX << UART_SHIFT]
194
+ strbne \rd, [\rx, #UART_TX << UART_SHIFT]
177195 1001:
178196 .endm
179197
....@@ -187,40 +205,14 @@
187205 1002:
188206 .endm
189207
190
- .macro waituart, rd, rx
191
-#ifdef FLOW_CONTROL
208
+ .macro waituartcts, rd, rx
192209 cmp \rx, #0
193210 beq 1002f
194211 1001: ldrb \rd, [\rx, #UART_MSR << UART_SHIFT]
195212 tst \rd, #UART_MSR_CTS
196213 beq 1001b
197214 1002:
198
-#endif
199215 .endm
200216
201
-/*
202
- * Storage for the state maintained by the macros above.
203
- *
204
- * In the kernel proper, this data is located in arch/arm/mach-tegra/tegra.c.
205
- * That's because this header is included from multiple files, and we only
206
- * want a single copy of the data. In particular, the UART probing code above
207
- * assumes it's running using physical addresses. This is true when this file
208
- * is included from head.o, but not when included from debug.o. So we need
209
- * to share the probe results between the two copies, rather than having
210
- * to re-run the probing again later.
211
- *
212
- * In the decompressor, we put the symbol/storage right here, since common.c
213
- * isn't included in the decompressor build. This symbol gets put in .text
214
- * even though it's really data, since .data is discarded from the
215
- * decompressor. Luckily, .text is writeable in the decompressor, unless
216
- * CONFIG_ZBOOT_ROM. That dependency is handled in arch/arm/Kconfig.debug.
217
- */
218
-#if defined(ZIMAGE)
219
-tegra_uart_config:
220
- /* Debug UART initialization required */
221
- .word 1
222
- /* Debug UART physical address */
223
- .word 0
224
- /* Debug UART virtual address */
225
- .word 0
226
-#endif
217
+ .macro waituarttxrdy,rd,rx
218
+ .endm