diff options
Diffstat (limited to 'arch/arm/include/debug')
-rw-r--r-- | arch/arm/include/debug/bcm2835.S | 22 | ||||
-rw-r--r-- | arch/arm/include/debug/cns3xxx.S | 19 | ||||
-rw-r--r-- | arch/arm/include/debug/exynos.S | 39 | ||||
-rw-r--r-- | arch/arm/include/debug/mxs.S | 27 | ||||
-rw-r--r-- | arch/arm/include/debug/nomadik.S | 20 | ||||
-rw-r--r-- | arch/arm/include/debug/samsung.S | 87 | ||||
-rw-r--r-- | arch/arm/include/debug/sirf.S | 42 | ||||
-rw-r--r-- | arch/arm/include/debug/ux500.S | 48 |
8 files changed, 304 insertions, 0 deletions
diff --git a/arch/arm/include/debug/bcm2835.S b/arch/arm/include/debug/bcm2835.S new file mode 100644 index 000000000000..aed9199bd847 --- /dev/null +++ b/arch/arm/include/debug/bcm2835.S | |||
@@ -0,0 +1,22 @@ | |||
1 | /* | ||
2 | * Debugging macro include header | ||
3 | * | ||
4 | * Copyright (C) 2010 Broadcom | ||
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 | #define BCM2835_DEBUG_PHYS 0x20201000 | ||
15 | #define BCM2835_DEBUG_VIRT 0xf0201000 | ||
16 | |||
17 | .macro addruart, rp, rv, tmp | ||
18 | ldr \rp, =BCM2835_DEBUG_PHYS | ||
19 | ldr \rv, =BCM2835_DEBUG_VIRT | ||
20 | .endm | ||
21 | |||
22 | #include <asm/hardware/debug-pl01x.S> | ||
diff --git a/arch/arm/include/debug/cns3xxx.S b/arch/arm/include/debug/cns3xxx.S new file mode 100644 index 000000000000..d04c150baa1c --- /dev/null +++ b/arch/arm/include/debug/cns3xxx.S | |||
@@ -0,0 +1,19 @@ | |||
1 | /* | ||
2 | * Debugging macro include header | ||
3 | * | ||
4 | * Copyright 1994-1999 Russell King | ||
5 | * Copyright 2008 Cavium Networks | ||
6 | * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks | ||
7 | * | ||
8 | * This file 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 | .macro addruart,rp,rv,tmp | ||
14 | mov \rp, #0x00009000 | ||
15 | orr \rv, \rp, #0xf0000000 @ virtual base | ||
16 | orr \rp, \rp, #0x10000000 | ||
17 | .endm | ||
18 | |||
19 | #include <asm/hardware/debug-pl01x.S> | ||
diff --git a/arch/arm/include/debug/exynos.S b/arch/arm/include/debug/exynos.S new file mode 100644 index 000000000000..b17fdb7fbd34 --- /dev/null +++ b/arch/arm/include/debug/exynos.S | |||
@@ -0,0 +1,39 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd. | ||
3 | * http://www.samsung.com | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License version 2 as | ||
7 | * published by the Free Software Foundation. | ||
8 | */ | ||
9 | |||
10 | /* pull in the relevant register and map files. */ | ||
11 | |||
12 | #define S3C_ADDR_BASE 0xF6000000 | ||
13 | #define S3C_VA_UART S3C_ADDR_BASE + 0x01000000 | ||
14 | #define EXYNOS4_PA_UART 0x13800000 | ||
15 | #define EXYNOS5_PA_UART 0x12C00000 | ||
16 | |||
17 | /* note, for the boot process to work we have to keep the UART | ||
18 | * virtual address aligned to an 1MiB boundary for the L1 | ||
19 | * mapping the head code makes. We keep the UART virtual address | ||
20 | * aligned and add in the offset when we load the value here. | ||
21 | */ | ||
22 | |||
23 | .macro addruart, rp, rv, tmp | ||
24 | mrc p15, 0, \tmp, c0, c0, 0 | ||
25 | and \tmp, \tmp, #0xf0 | ||
26 | teq \tmp, #0xf0 @@ A15 | ||
27 | ldreq \rp, =EXYNOS5_PA_UART | ||
28 | movne \rp, #EXYNOS4_PA_UART @@ EXYNOS4 | ||
29 | ldr \rv, =S3C_VA_UART | ||
30 | #if CONFIG_DEBUG_S3C_UART != 0 | ||
31 | add \rp, \rp, #(0x10000 * CONFIG_DEBUG_S3C_UART) | ||
32 | add \rv, \rv, #(0x10000 * CONFIG_DEBUG_S3C_UART) | ||
33 | #endif | ||
34 | .endm | ||
35 | |||
36 | #define fifo_full fifo_full_s5pv210 | ||
37 | #define fifo_level fifo_level_s5pv210 | ||
38 | |||
39 | #include <debug/samsung.S> | ||
diff --git a/arch/arm/include/debug/mxs.S b/arch/arm/include/debug/mxs.S new file mode 100644 index 000000000000..d86951551ca1 --- /dev/null +++ b/arch/arm/include/debug/mxs.S | |||
@@ -0,0 +1,27 @@ | |||
1 | /* arch/arm/mach-mxs/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 | #ifdef CONFIG_DEBUG_IMX23_UART | ||
15 | #define UART_PADDR 0x80070000 | ||
16 | #elif defined (CONFIG_DEBUG_IMX28_UART) | ||
17 | #define UART_PADDR 0x80074000 | ||
18 | #endif | ||
19 | |||
20 | #define UART_VADDR 0xfe100000 | ||
21 | |||
22 | .macro addruart, rp, rv, tmp | ||
23 | ldr \rp, =UART_PADDR @ physical | ||
24 | ldr \rv, =UART_VADDR @ virtual | ||
25 | .endm | ||
26 | |||
27 | #include <asm/hardware/debug-pl01x.S> | ||
diff --git a/arch/arm/include/debug/nomadik.S b/arch/arm/include/debug/nomadik.S new file mode 100644 index 000000000000..735417922ce2 --- /dev/null +++ b/arch/arm/include/debug/nomadik.S | |||
@@ -0,0 +1,20 @@ | |||
1 | /* | ||
2 | * Debugging macro include header | ||
3 | * | ||
4 | * Copyright (C) 1994-1999 Russell King | ||
5 | * Moved from linux/arch/arm/kernel/debug.S by Ben Dooks | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License version 2 as | ||
9 | * published by the Free Software Foundation. | ||
10 | * | ||
11 | */ | ||
12 | |||
13 | .macro addruart, rp, rv, tmp | ||
14 | mov \rp, #0x00100000 | ||
15 | add \rp, \rp, #0x000fb000 | ||
16 | add \rv, \rp, #0xf0000000 @ virtual base | ||
17 | add \rp, \rp, #0x10000000 @ physical base address | ||
18 | .endm | ||
19 | |||
20 | #include <asm/hardware/debug-pl01x.S> | ||
diff --git a/arch/arm/include/debug/samsung.S b/arch/arm/include/debug/samsung.S new file mode 100644 index 000000000000..f3a9cff6d5d4 --- /dev/null +++ b/arch/arm/include/debug/samsung.S | |||
@@ -0,0 +1,87 @@ | |||
1 | /* arch/arm/plat-samsung/include/plat/debug-macro.S | ||
2 | * | ||
3 | * Copyright 2005, 2007 Simtec Electronics | ||
4 | * http://armlinux.simtec.co.uk/ | ||
5 | * Ben Dooks <ben@simtec.co.uk> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License version 2 as | ||
9 | * published by the Free Software Foundation. | ||
10 | */ | ||
11 | |||
12 | #include <plat/regs-serial.h> | ||
13 | |||
14 | /* The S5PV210/S5PC110 implementations are as belows. */ | ||
15 | |||
16 | .macro fifo_level_s5pv210 rd, rx | ||
17 | ldr \rd, [\rx, # S3C2410_UFSTAT] | ||
18 | and \rd, \rd, #S5PV210_UFSTAT_TXMASK | ||
19 | .endm | ||
20 | |||
21 | .macro fifo_full_s5pv210 rd, rx | ||
22 | ldr \rd, [\rx, # S3C2410_UFSTAT] | ||
23 | tst \rd, #S5PV210_UFSTAT_TXFULL | ||
24 | .endm | ||
25 | |||
26 | /* The S3C2440 implementations are used by default as they are the | ||
27 | * most widely re-used */ | ||
28 | |||
29 | .macro fifo_level_s3c2440 rd, rx | ||
30 | ldr \rd, [\rx, # S3C2410_UFSTAT] | ||
31 | and \rd, \rd, #S3C2440_UFSTAT_TXMASK | ||
32 | .endm | ||
33 | |||
34 | #ifndef fifo_level | ||
35 | #define fifo_level fifo_level_s3c2440 | ||
36 | #endif | ||
37 | |||
38 | .macro fifo_full_s3c2440 rd, rx | ||
39 | ldr \rd, [\rx, # S3C2410_UFSTAT] | ||
40 | tst \rd, #S3C2440_UFSTAT_TXFULL | ||
41 | .endm | ||
42 | |||
43 | #ifndef fifo_full | ||
44 | #define fifo_full fifo_full_s3c2440 | ||
45 | #endif | ||
46 | |||
47 | .macro senduart,rd,rx | ||
48 | strb \rd, [\rx, # S3C2410_UTXH] | ||
49 | .endm | ||
50 | |||
51 | .macro busyuart, rd, rx | ||
52 | ldr \rd, [\rx, # S3C2410_UFCON] | ||
53 | tst \rd, #S3C2410_UFCON_FIFOMODE @ fifo enabled? | ||
54 | beq 1001f @ | ||
55 | @ FIFO enabled... | ||
56 | 1003: | ||
57 | fifo_full \rd, \rx | ||
58 | bne 1003b | ||
59 | b 1002f | ||
60 | |||
61 | 1001: | ||
62 | @ busy waiting for non fifo | ||
63 | ldr \rd, [\rx, # S3C2410_UTRSTAT] | ||
64 | tst \rd, #S3C2410_UTRSTAT_TXFE | ||
65 | beq 1001b | ||
66 | |||
67 | 1002: @ exit busyuart | ||
68 | .endm | ||
69 | |||
70 | .macro waituart,rd,rx | ||
71 | ldr \rd, [\rx, # S3C2410_UFCON] | ||
72 | tst \rd, #S3C2410_UFCON_FIFOMODE @ fifo enabled? | ||
73 | beq 1001f @ | ||
74 | @ FIFO enabled... | ||
75 | 1003: | ||
76 | fifo_level \rd, \rx | ||
77 | teq \rd, #0 | ||
78 | bne 1003b | ||
79 | b 1002f | ||
80 | 1001: | ||
81 | @ idle waiting for non fifo | ||
82 | ldr \rd, [\rx, # S3C2410_UTRSTAT] | ||
83 | tst \rd, #S3C2410_UTRSTAT_TXFE | ||
84 | beq 1001b | ||
85 | |||
86 | 1002: @ exit busyuart | ||
87 | .endm | ||
diff --git a/arch/arm/include/debug/sirf.S b/arch/arm/include/debug/sirf.S new file mode 100644 index 000000000000..dbf250cf18e6 --- /dev/null +++ b/arch/arm/include/debug/sirf.S | |||
@@ -0,0 +1,42 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-prima2/include/mach/debug-macro.S | ||
3 | * | ||
4 | * Copyright (c) 2011 Cambridge Silicon Radio Limited, a CSR plc group company. | ||
5 | * | ||
6 | * Licensed under GPLv2 or later. | ||
7 | */ | ||
8 | |||
9 | #if defined(CONFIG_DEBUG_SIRFPRIMA2_UART1) | ||
10 | #define SIRFSOC_UART1_PA_BASE 0xb0060000 | ||
11 | #elif defined(CONFIG_DEBUG_SIRFMARCO_UART1) | ||
12 | #define SIRFSOC_UART1_PA_BASE 0xcc060000 | ||
13 | #else | ||
14 | #define SIRFSOC_UART1_PA_BASE 0 | ||
15 | #endif | ||
16 | |||
17 | #define SIRFSOC_UART1_VA_BASE 0xFEC60000 | ||
18 | |||
19 | #define SIRFSOC_UART_TXFIFO_STATUS 0x0114 | ||
20 | #define SIRFSOC_UART_TXFIFO_DATA 0x0118 | ||
21 | |||
22 | #define SIRFSOC_UART1_TXFIFO_FULL (1 << 5) | ||
23 | #define SIRFSOC_UART1_TXFIFO_EMPTY (1 << 6) | ||
24 | |||
25 | .macro addruart, rp, rv, tmp | ||
26 | ldr \rp, =SIRFSOC_UART1_PA_BASE @ physical | ||
27 | ldr \rv, =SIRFSOC_UART1_VA_BASE @ virtual | ||
28 | .endm | ||
29 | |||
30 | .macro senduart,rd,rx | ||
31 | str \rd, [\rx, #SIRFSOC_UART_TXFIFO_DATA] | ||
32 | .endm | ||
33 | |||
34 | .macro busyuart,rd,rx | ||
35 | .endm | ||
36 | |||
37 | .macro waituart,rd,rx | ||
38 | 1001: ldr \rd, [\rx, #SIRFSOC_UART_TXFIFO_STATUS] | ||
39 | tst \rd, #SIRFSOC_UART1_TXFIFO_EMPTY | ||
40 | beq 1001b | ||
41 | .endm | ||
42 | |||
diff --git a/arch/arm/include/debug/ux500.S b/arch/arm/include/debug/ux500.S new file mode 100644 index 000000000000..2848857f5b62 --- /dev/null +++ b/arch/arm/include/debug/ux500.S | |||
@@ -0,0 +1,48 @@ | |||
1 | /* | ||
2 | * Debugging macro include header | ||
3 | * | ||
4 | * Copyright (C) 2009 ST-Ericsson | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | * | ||
10 | */ | ||
11 | |||
12 | |||
13 | #if CONFIG_UX500_DEBUG_UART > 2 | ||
14 | #error Invalid Ux500 debug UART | ||
15 | #endif | ||
16 | |||
17 | /* | ||
18 | * DEBUG_LL only works if only one SOC is built in. We don't use #else below | ||
19 | * in order to get "__UX500_UART redefined" warnings if more than one SOC is | ||
20 | * built, so that there's some hint during the build that something is wrong. | ||
21 | */ | ||
22 | |||
23 | #ifdef CONFIG_UX500_SOC_DB8500 | ||
24 | #define U8500_UART0_PHYS_BASE (0x80120000) | ||
25 | #define U8500_UART1_PHYS_BASE (0x80121000) | ||
26 | #define U8500_UART2_PHYS_BASE (0x80007000) | ||
27 | #define U8500_UART0_VIRT_BASE (0xa8120000) | ||
28 | #define U8500_UART1_VIRT_BASE (0xa8121000) | ||
29 | #define U8500_UART2_VIRT_BASE (0xa8007000) | ||
30 | #define __UX500_PHYS_UART(n) U8500_UART##n##_PHYS_BASE | ||
31 | #define __UX500_VIRT_UART(n) U8500_UART##n##_VIRT_BASE | ||
32 | #endif | ||
33 | |||
34 | #if !defined(__UX500_PHYS_UART) || !defined(__UX500_VIRT_UART) | ||
35 | #error Unknown SOC | ||
36 | #endif | ||
37 | |||
38 | #define UX500_PHYS_UART(n) __UX500_PHYS_UART(n) | ||
39 | #define UX500_VIRT_UART(n) __UX500_VIRT_UART(n) | ||
40 | #define UART_PHYS_BASE UX500_PHYS_UART(CONFIG_UX500_DEBUG_UART) | ||
41 | #define UART_VIRT_BASE UX500_VIRT_UART(CONFIG_UX500_DEBUG_UART) | ||
42 | |||
43 | .macro addruart, rp, rv, tmp | ||
44 | ldr \rp, =UART_PHYS_BASE @ no, physical address | ||
45 | ldr \rv, =UART_VIRT_BASE @ yes, virtual address | ||
46 | .endm | ||
47 | |||
48 | #include <asm/hardware/debug-pl01x.S> | ||