Skip to content

Commit 9f3ba45

Browse files
committed
ARM: tegra: make debug_ll code build for ARMv6
In a combined ARMv6/v7 kernel, we cannot use the movt/movw instructions to load an immediate, as they are not valid on ARMv6. This changes the file to use an indirect load instead, as lots of other implementations do. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Tested-by: Stephen Warren <swarren@wwwdotorg.org> Acked-by: Stephen Warren <swarren@wwwdotorg.org> Cc: Thierry Reding <thierry.reding@gmail.com> Cc: linux-tegra@vger.kernel.org
1 parent 1146b60 commit 9f3ba45

1 file changed

Lines changed: 8 additions & 10 deletions

File tree

‎arch/arm/include/debug/tegra.S‎

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -53,26 +53,23 @@
5353

5454
#define checkuart(rp, rv, lhu, bit, uart) \
5555
/* Load address of CLK_RST register */ \
56-
movw rp, #TEGRA_CLK_RST_DEVICES_##lhu & 0xffff ; \
57-
movt rp, #TEGRA_CLK_RST_DEVICES_##lhu >> 16 ; \
56+
ldr rp, =TEGRA_CLK_RST_DEVICES_##lhu ; \
5857
/* Load value from CLK_RST register */ \
5958
ldr rp, [rp, #0] ; \
6059
/* Test UART's reset bit */ \
6160
tst rp, #(1 << bit) ; \
6261
/* If set, can't use UART; jump to save no UART */ \
6362
bne 90f ; \
6463
/* Load address of CLK_OUT_ENB register */ \
65-
movw rp, #TEGRA_CLK_OUT_ENB_##lhu & 0xffff ; \
66-
movt rp, #TEGRA_CLK_OUT_ENB_##lhu >> 16 ; \
64+
ldr rp, =TEGRA_CLK_OUT_ENB_##lhu ; \
6765
/* Load value from CLK_OUT_ENB register */ \
6866
ldr rp, [rp, #0] ; \
6967
/* Test UART's clock enable bit */ \
7068
tst rp, #(1 << bit) ; \
7169
/* If clear, can't use UART; jump to save no UART */ \
7270
beq 90f ; \
7371
/* Passed all tests, load address of UART registers */ \
74-
movw rp, #TEGRA_UART##uart##_BASE & 0xffff ; \
75-
movt rp, #TEGRA_UART##uart##_BASE >> 16 ; \
72+
ldr rp, =TEGRA_UART##uart##_BASE ; \
7673
/* Jump to save UART address */ \
7774
b 91f
7875

@@ -90,15 +87,16 @@
9087

9188
#ifdef CONFIG_TEGRA_DEBUG_UART_AUTO_ODMDATA
9289
/* Check ODMDATA */
93-
10: movw \rp, #TEGRA_PMC_SCRATCH20 & 0xffff
94-
movt \rp, #TEGRA_PMC_SCRATCH20 >> 16
90+
10: ldr \rp, =TEGRA_PMC_SCRATCH20
9591
ldr \rp, [\rp, #0] @ Load PMC_SCRATCH20
96-
ubfx \rv, \rp, #18, #2 @ 19:18 are console type
92+
lsr \rv, \rp, #18 @ 19:18 are console type
93+
and \rv, \rv, #3
9794
cmp \rv, #2 @ 2 and 3 mean DCC, UART
9895
beq 11f @ some boards swap the meaning
9996
cmp \rv, #3 @ so accept either
10097
bne 90f
101-
11: ubfx \rv, \rp, #15, #3 @ 17:15 are UART ID
98+
11: lsr \rv, \rp, #15 @ 17:15 are UART ID
99+
and \rv, #7
102100
cmp \rv, #0 @ UART 0?
103101
beq 20f
104102
cmp \rv, #1 @ UART 1?

0 commit comments

Comments
 (0)