aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap1
diff options
context:
space:
mode:
authorDaniel Thompson <daniel.thompson@linaro.org>2015-01-09 12:33:50 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2015-01-21 10:49:39 -0500
commitc26b999353339c235b9e166739926d0199eeecbf (patch)
tree996dfedab9127d69042dd332ed769acab7968cb3 /arch/arm/mach-omap1
parentabbfb21efcd704e8b858e94e327bb014386ba0dd (diff)
ARM: 8271/1: omap1: Migrate debug_ll macros to use 8250.S
The omap1's debug-macro.S is similar to the generic 8250 code. Compared to the 8520 code the omap1 macro automatically determines what UART to use based on breadcrumbs left by the bootloader and automatically copes with the eccentric register layout on OMAP7XX. This patch drops both these features and relies instead on the generic 8250 macros: 1. Dropping support for the bootloader breadcrumbs is identical to the way the migration was handled for OMAP2 (see 808b7e07464d...). 2. Support for OMAP7XX still exists but it must be configured by hand (DEBUG_OMAP7XXUART1/2/3) rather than handled at runtime. Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org> Cc: Arnd Bergmann <arnd.bergmann@linaro.org> Cc: linux-omap@vger.kernel.org Tested-by: Aaro Koskinen <aaro.koskinen@iki.fi> Acked-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-omap1')
-rw-r--r--arch/arm/mach-omap1/include/mach/debug-macro.S101
1 files changed, 0 insertions, 101 deletions
diff --git a/arch/arm/mach-omap1/include/mach/debug-macro.S b/arch/arm/mach-omap1/include/mach/debug-macro.S
deleted file mode 100644
index 5c1a26c9f490..000000000000
--- a/arch/arm/mach-omap1/include/mach/debug-macro.S
+++ /dev/null
@@ -1,101 +0,0 @@
1/* arch/arm/mach-omap1/include/mach/debug-macro.S
2 *
3 * Debugging macro include header
4 *
5 * Copyright (C) 1994-1999 Russell King
6 * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 *
12*/
13
14#include <linux/serial_reg.h>
15
16#include "serial.h"
17
18 .pushsection .data
19omap_uart_phys: .word 0x0
20omap_uart_virt: .word 0x0
21 .popsection
22
23 /*
24 * Note that this code won't work if the bootloader passes
25 * a wrong machine ID number in r1. To debug, just hardcode
26 * the desired UART phys and virt addresses temporarily into
27 * the omap_uart_phys and omap_uart_virt above.
28 */
29 .macro addruart, rp, rv, tmp
30
31 /* Use omap_uart_phys/virt if already configured */
329: adr \rp, 99f @ get effective addr of 99f
33 ldr \rv, [\rp] @ get absolute addr of 99f
34 sub \rv, \rv, \rp @ offset between the two
35 ldr \rp, [\rp, #4] @ abs addr of omap_uart_phys
36 sub \tmp, \rp, \rv @ make it effective
37 ldr \rp, [\tmp, #0] @ omap_uart_phys
38 ldr \rv, [\tmp, #4] @ omap_uart_virt
39 cmp \rp, #0 @ is port configured?
40 cmpne \rv, #0
41 bne 100f @ already configured
42
43 /* Check the debug UART configuration set in uncompress.h */
44 and \rp, pc, #0xff000000
45 ldr \rv, =OMAP_UART_INFO_OFS
46 ldr \rp, [\rp, \rv]
47
48 /* Select the UART to use based on the UART1 scratchpad value */
4910: cmp \rp, #0 @ no port configured?
50 beq 11f @ if none, try to use UART1
51 cmp \rp, #OMAP1UART1
52 beq 11f @ configure OMAP1UART1
53 cmp \rp, #OMAP1UART2
54 beq 12f @ configure OMAP1UART2
55 cmp \rp, #OMAP1UART3
56 beq 13f @ configure OMAP2UART3
57
58 /* Configure the UART offset from the phys/virt base */
5911: mov \rp, #0x00fb0000 @ OMAP1UART1
60 b 98f
6112: mov \rp, #0x00fb0000 @ OMAP1UART1
62 orr \rp, \rp, #0x00000800 @ OMAP1UART2
63 b 98f
6413: mov \rp, #0x00fb0000 @ OMAP1UART1
65 orr \rp, \rp, #0x00000800 @ OMAP1UART2
66 orr \rp, \rp, #0x00009000 @ OMAP1UART3
67
68 /* Store both phys and virt address for the uart */
6998: add \rp, \rp, #0xff000000 @ phys base
70 str \rp, [\tmp, #0] @ omap_uart_phys
71 sub \rp, \rp, #0xff000000 @ phys base
72 add \rp, \rp, #0xfe000000 @ virt base
73 str \rp, [\tmp, #4] @ omap_uart_virt
74 b 9b
75
76 .align
7799: .word .
78 .word omap_uart_phys
79 .ltorg
80
81100:
82 .endm
83
84 .macro senduart,rd,rx
85 strb \rd, [\rx]
86 .endm
87
88 .macro busyuart,rd,rx
891001: ldrb \rd, [\rx, #(UART_LSR << OMAP_PORT_SHIFT)]
90 and \rd, \rd, #(UART_LSR_TEMT | UART_LSR_THRE)
91 teq \rd, #(UART_LSR_TEMT | UART_LSR_THRE)
92 beq 1002f
93 ldrb \rd, [\rx, #(UART_LSR << OMAP7XX_PORT_SHIFT)]
94 and \rd, \rd, #(UART_LSR_TEMT | UART_LSR_THRE)
95 teq \rd, #(UART_LSR_TEMT | UART_LSR_THRE)
96 bne 1001b
971002:
98 .endm
99
100 .macro waituart,rd,rx
101 .endm