aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/include/debug
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2014-11-21 07:04:06 -0500
committerArnd Bergmann <arnd@arndb.de>2014-11-21 07:04:06 -0500
commit6febbf472b6f3df1b6a137fe246ac88dcd5b2c0e (patch)
tree96d30ffad60888ff22285782950564c3eea87d0b /arch/arm/include/debug
parent00f879bed45148612e1065ac26e46a7a39e5c8d9 (diff)
parent7a2071c58f36450fbf44a27d2e5d371c18534a25 (diff)
Merge tag 'renesas-soc4-for-v3.19' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas into next/soc
Pull "Fourth Round of Renesas ARM Based SoC Updates for v3.19" from Simon Horman: * Add early debugging support using SCIF(A) * tag 'renesas-soc4-for-v3.19' of git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas: ARM: shmobile: Add early debugging support using SCIF(A) Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'arch/arm/include/debug')
-rw-r--r--arch/arm/include/debug/renesas-scif.S52
1 files changed, 52 insertions, 0 deletions
diff --git a/arch/arm/include/debug/renesas-scif.S b/arch/arm/include/debug/renesas-scif.S
new file mode 100644
index 000000000000..97820a8df51a
--- /dev/null
+++ b/arch/arm/include/debug/renesas-scif.S
@@ -0,0 +1,52 @@
1/*
2 * Renesas SCIF(A) debugging macro include header
3 *
4 * Based on r8a7790.S
5 *
6 * Copyright (C) 2012-2013 Renesas Electronics Corporation
7 * Copyright (C) 1994-1999 Russell King
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12 */
13
14#define SCIF_PHYS CONFIG_DEBUG_UART_PHYS
15#define SCIF_VIRT ((SCIF_PHYS & 0x00ffffff) | 0xfd000000)
16
17#if CONFIG_DEBUG_UART_PHYS < 0xe6e00000
18/* SCIFA */
19#define FTDR 0x20
20#define FSR 0x14
21#else
22/* SCIF */
23#define FTDR 0x0c
24#define FSR 0x10
25#endif
26
27#define TDFE (1 << 5)
28#define TEND (1 << 6)
29
30 .macro addruart, rp, rv, tmp
31 ldr \rp, =SCIF_PHYS
32 ldr \rv, =SCIF_VIRT
33 .endm
34
35 .macro waituart, rd, rx
361001: ldrh \rd, [\rx, #FSR]
37 tst \rd, #TDFE
38 beq 1001b
39 .endm
40
41 .macro senduart, rd, rx
42 strb \rd, [\rx, #FTDR]
43 ldrh \rd, [\rx, #FSR]
44 bic \rd, \rd, #TEND
45 strh \rd, [\rx, #FSR]
46 .endm
47
48 .macro busyuart, rd, rx
491001: ldrh \rd, [\rx, #FSR]
50 tst \rd, #TEND
51 beq 1001b
52 .endm