diff options
author | Stephen Boyd <sboyd@codeaurora.org> | 2011-11-08 13:33:04 -0500 |
---|---|---|
committer | David Brown <davidb@codeaurora.org> | 2011-11-10 13:17:06 -0500 |
commit | a3d3ef9d4fd57cfd407c8d2d0a7daec000468ebf (patch) | |
tree | 4894c7c2c68b9caa9e6842d317cde4800905e03e /arch/arm/mach-msm | |
parent | 650e3f0d66ade2a614d854765dae3bbc9a87f58d (diff) |
msm: Support DEBUG_LL on MSM8660 and MSM8960
Add support for DEBUG_LL on the 8660 and 8960 development boards.
While we're here cleanup the uncompress.h code a bit. Avoid
the use of readl/writel as those are Linux specific APIs that
aren't guaranteed to work in the decompressor.
Cc: Nicolas Pitre <nico@fluxnic.net>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Acked-by: Nicolas Pitre <nico@linaro.org>
Signed-off-by: David Brown <davidb@codeaurora.org>
Diffstat (limited to 'arch/arm/mach-msm')
-rw-r--r-- | arch/arm/mach-msm/Kconfig | 3 | ||||
-rw-r--r-- | arch/arm/mach-msm/include/mach/debug-macro.S | 32 | ||||
-rw-r--r-- | arch/arm/mach-msm/include/mach/msm_iomap-8960.h | 5 | ||||
-rw-r--r-- | arch/arm/mach-msm/include/mach/msm_iomap-8x60.h | 5 | ||||
-rw-r--r-- | arch/arm/mach-msm/include/mach/uncompress.h | 39 | ||||
-rw-r--r-- | arch/arm/mach-msm/io.c | 6 |
6 files changed, 79 insertions, 11 deletions
diff --git a/arch/arm/mach-msm/Kconfig b/arch/arm/mach-msm/Kconfig index 5b07b6104e5d..000ddf0a4f33 100644 --- a/arch/arm/mach-msm/Kconfig +++ b/arch/arm/mach-msm/Kconfig | |||
@@ -60,6 +60,9 @@ config ARCH_MSM8960 | |||
60 | 60 | ||
61 | endchoice | 61 | endchoice |
62 | 62 | ||
63 | config MSM_HAS_DEBUG_UART_HS | ||
64 | bool | ||
65 | |||
63 | config MSM_SOC_REV_A | 66 | config MSM_SOC_REV_A |
64 | bool | 67 | bool |
65 | config ARCH_MSM_SCORPIONMP | 68 | config ARCH_MSM_SCORPIONMP |
diff --git a/arch/arm/mach-msm/include/mach/debug-macro.S b/arch/arm/mach-msm/include/mach/debug-macro.S index db1f22830d64..3ffd8668c9a5 100644 --- a/arch/arm/mach-msm/include/mach/debug-macro.S +++ b/arch/arm/mach-msm/include/mach/debug-macro.S | |||
@@ -1,6 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * | 2 | * |
3 | * Copyright (C) 2007 Google, Inc. | 3 | * Copyright (C) 2007 Google, Inc. |
4 | * Copyright (c) 2011, Code Aurora Forum. All rights reserved. | ||
4 | * Author: Brian Swetland <swetland@google.com> | 5 | * Author: Brian Swetland <swetland@google.com> |
5 | * | 6 | * |
6 | * This software is licensed under the terms of the GNU General Public | 7 | * This software is licensed under the terms of the GNU General Public |
@@ -24,17 +25,42 @@ | |||
24 | #endif | 25 | #endif |
25 | .endm | 26 | .endm |
26 | 27 | ||
27 | .macro senduart,rd,rx | 28 | .macro senduart, rd, rx |
29 | #ifdef CONFIG_MSM_HAS_DEBUG_UART_HS | ||
30 | @ Write the 1 character to UARTDM_TF | ||
31 | str \rd, [\rx, #0x70] | ||
32 | #else | ||
28 | teq \rx, #0 | 33 | teq \rx, #0 |
29 | strne \rd, [\rx, #0x0C] | 34 | strne \rd, [\rx, #0x0C] |
35 | #endif | ||
30 | .endm | 36 | .endm |
31 | 37 | ||
32 | .macro waituart,rd,rx | 38 | .macro waituart, rd, rx |
39 | #ifdef CONFIG_MSM_HAS_DEBUG_UART_HS | ||
40 | @ check for TX_EMT in UARTDM_SR | ||
41 | ldr \rd, [\rx, #0x08] | ||
42 | tst \rd, #0x08 | ||
43 | bne 1002f | ||
44 | @ wait for TXREADY in UARTDM_ISR | ||
45 | 1001: ldr \rd, [\rx, #0x14] | ||
46 | tst \rd, #0x80 | ||
47 | beq 1001b | ||
48 | 1002: | ||
49 | @ Clear TX_READY by writing to the UARTDM_CR register | ||
50 | mov \rd, #0x300 | ||
51 | str \rd, [\rx, #0x10] | ||
52 | @ Write 0x1 to NCF register | ||
53 | mov \rd, #0x1 | ||
54 | str \rd, [\rx, #0x40] | ||
55 | @ UARTDM reg. Read to induce delay | ||
56 | ldr \rd, [\rx, #0x08] | ||
57 | #else | ||
33 | @ wait for TX_READY | 58 | @ wait for TX_READY |
34 | 1001: ldr \rd, [\rx, #0x08] | 59 | 1001: ldr \rd, [\rx, #0x08] |
35 | tst \rd, #0x04 | 60 | tst \rd, #0x04 |
36 | beq 1001b | 61 | beq 1001b |
62 | #endif | ||
37 | .endm | 63 | .endm |
38 | 64 | ||
39 | .macro busyuart,rd,rx | 65 | .macro busyuart, rd, rx |
40 | .endm | 66 | .endm |
diff --git a/arch/arm/mach-msm/include/mach/msm_iomap-8960.h b/arch/arm/mach-msm/include/mach/msm_iomap-8960.h index 3c9d9602a318..800b55767e6b 100644 --- a/arch/arm/mach-msm/include/mach/msm_iomap-8960.h +++ b/arch/arm/mach-msm/include/mach/msm_iomap-8960.h | |||
@@ -45,4 +45,9 @@ | |||
45 | #define MSM8960_TMR0_PHYS 0x0208A000 | 45 | #define MSM8960_TMR0_PHYS 0x0208A000 |
46 | #define MSM8960_TMR0_SIZE SZ_4K | 46 | #define MSM8960_TMR0_SIZE SZ_4K |
47 | 47 | ||
48 | #ifdef CONFIG_DEBUG_MSM8960_UART | ||
49 | #define MSM_DEBUG_UART_BASE 0xE1040000 | ||
50 | #define MSM_DEBUG_UART_PHYS 0x16440000 | ||
51 | #endif | ||
52 | |||
48 | #endif | 53 | #endif |
diff --git a/arch/arm/mach-msm/include/mach/msm_iomap-8x60.h b/arch/arm/mach-msm/include/mach/msm_iomap-8x60.h index 3b19b8f244b8..54e12caa8d86 100644 --- a/arch/arm/mach-msm/include/mach/msm_iomap-8x60.h +++ b/arch/arm/mach-msm/include/mach/msm_iomap-8x60.h | |||
@@ -62,4 +62,9 @@ | |||
62 | #define MSM8X60_TMR0_PHYS 0x02040000 | 62 | #define MSM8X60_TMR0_PHYS 0x02040000 |
63 | #define MSM8X60_TMR0_SIZE SZ_4K | 63 | #define MSM8X60_TMR0_SIZE SZ_4K |
64 | 64 | ||
65 | #ifdef CONFIG_DEBUG_MSM8660_UART | ||
66 | #define MSM_DEBUG_UART_BASE 0xE1040000 | ||
67 | #define MSM_DEBUG_UART_PHYS 0x19C40000 | ||
68 | #endif | ||
69 | |||
65 | #endif | 70 | #endif |
diff --git a/arch/arm/mach-msm/include/mach/uncompress.h b/arch/arm/mach-msm/include/mach/uncompress.h index d94292c29d8e..169a84007456 100644 --- a/arch/arm/mach-msm/include/mach/uncompress.h +++ b/arch/arm/mach-msm/include/mach/uncompress.h | |||
@@ -1,6 +1,6 @@ | |||
1 | /* arch/arm/mach-msm/include/mach/uncompress.h | 1 | /* |
2 | * | ||
3 | * Copyright (C) 2007 Google, Inc. | 2 | * Copyright (C) 2007 Google, Inc. |
3 | * Copyright (c) 2011, Code Aurora Forum. All rights reserved. | ||
4 | * | 4 | * |
5 | * This software is licensed under the terms of the GNU General Public | 5 | * This software is licensed under the terms of the GNU General Public |
6 | * License version 2, as published by the Free Software Foundation, and | 6 | * License version 2, as published by the Free Software Foundation, and |
@@ -14,17 +14,40 @@ | |||
14 | */ | 14 | */ |
15 | 15 | ||
16 | #ifndef __ASM_ARCH_MSM_UNCOMPRESS_H | 16 | #ifndef __ASM_ARCH_MSM_UNCOMPRESS_H |
17 | #define __ASM_ARCH_MSM_UNCOMPRESS_H | ||
18 | |||
19 | #include <asm/processor.h> | ||
20 | #include <mach/msm_iomap.h> | ||
21 | |||
22 | #define UART_CSR (*(volatile uint32_t *)(MSM_DEBUG_UART_PHYS + 0x08)) | ||
23 | #define UART_TF (*(volatile uint32_t *)(MSM_DEBUG_UART_PHYS + 0x0c)) | ||
17 | 24 | ||
18 | #include "hardware.h" | 25 | #define UART_DM_SR (*((volatile uint32_t *)(MSM_DEBUG_UART_PHYS + 0x08))) |
19 | #include "linux/io.h" | 26 | #define UART_DM_CR (*((volatile uint32_t *)(MSM_DEBUG_UART_PHYS + 0x10))) |
20 | #include "mach/msm_iomap.h" | 27 | #define UART_DM_ISR (*((volatile uint32_t *)(MSM_DEBUG_UART_PHYS + 0x14))) |
28 | #define UART_DM_NCHAR (*((volatile uint32_t *)(MSM_DEBUG_UART_PHYS + 0x40))) | ||
29 | #define UART_DM_TF (*((volatile uint32_t *)(MSM_DEBUG_UART_PHYS + 0x70))) | ||
21 | 30 | ||
22 | static void putc(int c) | 31 | static void putc(int c) |
23 | { | 32 | { |
24 | #if defined(MSM_DEBUG_UART_PHYS) | 33 | #if defined(MSM_DEBUG_UART_PHYS) |
25 | unsigned base = MSM_DEBUG_UART_PHYS; | 34 | #ifdef CONFIG_MSM_HAS_DEBUG_UART_HS |
26 | while (!(readl(base + 0x08) & 0x04)) ; | 35 | /* |
27 | writel(c, base + 0x0c); | 36 | * Wait for TX_READY to be set; but skip it if we have a |
37 | * TX underrun. | ||
38 | */ | ||
39 | if (UART_DM_SR & 0x08) | ||
40 | while (!(UART_DM_ISR & 0x80)) | ||
41 | cpu_relax(); | ||
42 | |||
43 | UART_DM_CR = 0x300; | ||
44 | UART_DM_NCHAR = 0x1; | ||
45 | UART_DM_TF = c; | ||
46 | #else | ||
47 | while (!(UART_CSR & 0x04)) | ||
48 | cpu_relax(); | ||
49 | UART_TF = c; | ||
50 | #endif | ||
28 | #endif | 51 | #endif |
29 | } | 52 | } |
30 | 53 | ||
diff --git a/arch/arm/mach-msm/io.c b/arch/arm/mach-msm/io.c index 03036afe6266..578b04e42deb 100644 --- a/arch/arm/mach-msm/io.c +++ b/arch/arm/mach-msm/io.c | |||
@@ -111,6 +111,9 @@ static struct map_desc msm8x60_io_desc[] __initdata = { | |||
111 | MSM_CHIP_DEVICE(TMR0, MSM8X60), | 111 | MSM_CHIP_DEVICE(TMR0, MSM8X60), |
112 | MSM_DEVICE(ACC), | 112 | MSM_DEVICE(ACC), |
113 | MSM_DEVICE(GCC), | 113 | MSM_DEVICE(GCC), |
114 | #ifdef CONFIG_DEBUG_MSM8660_UART | ||
115 | MSM_DEVICE(DEBUG_UART), | ||
116 | #endif | ||
114 | }; | 117 | }; |
115 | 118 | ||
116 | void __init msm_map_msm8x60_io(void) | 119 | void __init msm_map_msm8x60_io(void) |
@@ -125,6 +128,9 @@ static struct map_desc msm8960_io_desc[] __initdata = { | |||
125 | MSM_CHIP_DEVICE(QGIC_CPU, MSM8960), | 128 | MSM_CHIP_DEVICE(QGIC_CPU, MSM8960), |
126 | MSM_CHIP_DEVICE(TMR, MSM8960), | 129 | MSM_CHIP_DEVICE(TMR, MSM8960), |
127 | MSM_CHIP_DEVICE(TMR0, MSM8960), | 130 | MSM_CHIP_DEVICE(TMR0, MSM8960), |
131 | #ifdef CONFIG_DEBUG_MSM8960_UART | ||
132 | MSM_DEVICE(DEBUG_UART), | ||
133 | #endif | ||
128 | }; | 134 | }; |
129 | 135 | ||
130 | void __init msm_map_msm8960_io(void) | 136 | void __init msm_map_msm8960_io(void) |