diff options
author | Shawn Guo <shawn.guo@freescale.com> | 2010-12-20 09:57:42 -0500 |
---|---|---|
committer | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2010-12-20 11:29:23 -0500 |
commit | 41fa75bc09d31c47d6606233b60f595524c28cd4 (patch) | |
tree | aad3cefe310728937792a5ce6dfca8cb41fef2e6 /arch | |
parent | 289569f902dc70fc42b8c7cab627f9d615a720f1 (diff) |
ARM: mxs: Add low-level debug UART support
- DEBUG_LL support, which is incompatible with multi-soc MXS image
because of different DUART base address on MX23 and MX28
- uncompress message support
Signed-off-by: Shawn Guo <shawn.guo@freescale.com>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-mxs/include/mach/debug-macro.S | 38 | ||||
-rw-r--r-- | arch/arm/mach-mxs/include/mach/uncompress.h | 76 |
2 files changed, 114 insertions, 0 deletions
diff --git a/arch/arm/mach-mxs/include/mach/debug-macro.S b/arch/arm/mach-mxs/include/mach/debug-macro.S new file mode 100644 index 000000000000..79650a1ad78d --- /dev/null +++ b/arch/arm/mach-mxs/include/mach/debug-macro.S | |||
@@ -0,0 +1,38 @@ | |||
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 | #include <mach/mx23.h> | ||
15 | #include <mach/mx28.h> | ||
16 | |||
17 | #ifdef CONFIG_SOC_IMX23 | ||
18 | #ifdef UART_PADDR | ||
19 | #error "CONFIG_DEBUG_LL is incompatible with multiple archs" | ||
20 | #endif | ||
21 | #define UART_PADDR MX23_DUART_BASE_ADDR | ||
22 | #endif | ||
23 | |||
24 | #ifdef CONFIG_SOC_IMX28 | ||
25 | #ifdef UART_PADDR | ||
26 | #error "CONFIG_DEBUG_LL is incompatible with multiple archs" | ||
27 | #endif | ||
28 | #define UART_PADDR MX28_DUART_BASE_ADDR | ||
29 | #endif | ||
30 | |||
31 | #define UART_VADDR MXS_IO_ADDRESS(UART_PADDR) | ||
32 | |||
33 | .macro addruart, rp, rv | ||
34 | ldr \rp, =UART_PADDR @ physical | ||
35 | ldr \rv, =UART_VADDR @ virtual | ||
36 | .endm | ||
37 | |||
38 | #include <asm/hardware/debug-pl01x.S> | ||
diff --git a/arch/arm/mach-mxs/include/mach/uncompress.h b/arch/arm/mach-mxs/include/mach/uncompress.h new file mode 100644 index 000000000000..a005e76f34f9 --- /dev/null +++ b/arch/arm/mach-mxs/include/mach/uncompress.h | |||
@@ -0,0 +1,76 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-mxs/include/mach/uncompress.h | ||
3 | * | ||
4 | * Copyright (C) 1999 ARM Limited | ||
5 | * Copyright (C) Shane Nay (shane@minirl.com) | ||
6 | * Copyright 2010 Freescale Semiconductor, Inc. All Rights Reserved. | ||
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 as published by | ||
10 | * the Free Software Foundation; either version 2 of the License, or | ||
11 | * (at your option) any later version. | ||
12 | * | ||
13 | * This program is distributed in the hope that it will be useful, | ||
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
16 | * GNU General Public License for more details. | ||
17 | */ | ||
18 | #ifndef __MACH_MXS_UNCOMPRESS_H__ | ||
19 | #define __MACH_MXS_UNCOMPRESS_H__ | ||
20 | |||
21 | #include <asm/mach-types.h> | ||
22 | |||
23 | static unsigned long mxs_duart_base; | ||
24 | |||
25 | #define MXS_DUART(x) (*(volatile unsigned long *)(mxs_duart_base + (x))) | ||
26 | |||
27 | #define MXS_DUART_DR 0x00 | ||
28 | #define MXS_DUART_FR 0x18 | ||
29 | #define MXS_DUART_FR_TXFE (1 << 7) | ||
30 | #define MXS_DUART_CR 0x30 | ||
31 | #define MXS_DUART_CR_UARTEN (1 << 0) | ||
32 | |||
33 | /* | ||
34 | * The following code assumes the serial port has already been | ||
35 | * initialized by the bootloader. If it's not, the output is | ||
36 | * simply discarded. | ||
37 | */ | ||
38 | |||
39 | static void putc(int ch) | ||
40 | { | ||
41 | if (!mxs_duart_base) | ||
42 | return; | ||
43 | if (!(MXS_DUART(MXS_DUART_CR) & MXS_DUART_CR_UARTEN)) | ||
44 | return; | ||
45 | |||
46 | while (!(MXS_DUART(MXS_DUART_FR) & MXS_DUART_FR_TXFE)) | ||
47 | barrier(); | ||
48 | |||
49 | MXS_DUART(MXS_DUART_DR) = ch; | ||
50 | } | ||
51 | |||
52 | static inline void flush(void) | ||
53 | { | ||
54 | } | ||
55 | |||
56 | #define MX23_DUART_BASE_ADDR 0x80070000 | ||
57 | #define MX28_DUART_BASE_ADDR 0x80074000 | ||
58 | |||
59 | static inline void __arch_decomp_setup(unsigned long arch_id) | ||
60 | { | ||
61 | switch (arch_id) { | ||
62 | case MACH_TYPE_MX23EVK: | ||
63 | mxs_duart_base = MX23_DUART_BASE_ADDR; | ||
64 | break; | ||
65 | case MACH_TYPE_MX28EVK: | ||
66 | mxs_duart_base = MX28_DUART_BASE_ADDR; | ||
67 | break; | ||
68 | default: | ||
69 | break; | ||
70 | } | ||
71 | } | ||
72 | |||
73 | #define arch_decomp_setup() __arch_decomp_setup(arch_id) | ||
74 | #define arch_decomp_wdog() | ||
75 | |||
76 | #endif /* __MACH_MXS_UNCOMPRESS_H__ */ | ||