diff options
Diffstat (limited to 'arch/arm/mach-davinci')
-rw-r--r-- | arch/arm/mach-davinci/cpuidle.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-davinci/include/mach/ddr2.h | 4 | ||||
-rw-r--r-- | arch/arm/mach-davinci/include/mach/debug-macro.S | 52 | ||||
-rw-r--r-- | arch/arm/mach-davinci/include/mach/memory.h | 39 | ||||
-rw-r--r-- | arch/arm/mach-davinci/include/mach/serial.h | 3 | ||||
-rw-r--r-- | arch/arm/mach-davinci/include/mach/uncompress.h | 7 | ||||
-rw-r--r-- | arch/arm/mach-davinci/sleep.S | 2 |
7 files changed, 37 insertions, 72 deletions
diff --git a/arch/arm/mach-davinci/cpuidle.c b/arch/arm/mach-davinci/cpuidle.c index bd59f31b8a95..0b314bf16f7f 100644 --- a/arch/arm/mach-davinci/cpuidle.c +++ b/arch/arm/mach-davinci/cpuidle.c | |||
@@ -19,7 +19,7 @@ | |||
19 | #include <asm/proc-fns.h> | 19 | #include <asm/proc-fns.h> |
20 | 20 | ||
21 | #include <mach/cpuidle.h> | 21 | #include <mach/cpuidle.h> |
22 | #include <mach/memory.h> | 22 | #include <mach/ddr2.h> |
23 | 23 | ||
24 | #define DAVINCI_CPUIDLE_MAX_STATES 2 | 24 | #define DAVINCI_CPUIDLE_MAX_STATES 2 |
25 | 25 | ||
diff --git a/arch/arm/mach-davinci/include/mach/ddr2.h b/arch/arm/mach-davinci/include/mach/ddr2.h new file mode 100644 index 000000000000..c19e047d0e6a --- /dev/null +++ b/arch/arm/mach-davinci/include/mach/ddr2.h | |||
@@ -0,0 +1,4 @@ | |||
1 | #define DDR2_SDRCR_OFFSET 0xc | ||
2 | #define DDR2_SRPD_BIT (1 << 23) | ||
3 | #define DDR2_MCLKSTOPEN_BIT (1 << 30) | ||
4 | #define DDR2_LPMODEN_BIT (1 << 31) | ||
diff --git a/arch/arm/mach-davinci/include/mach/debug-macro.S b/arch/arm/mach-davinci/include/mach/debug-macro.S index f8b7ea4f6235..cf94552d5274 100644 --- a/arch/arm/mach-davinci/include/mach/debug-macro.S +++ b/arch/arm/mach-davinci/include/mach/debug-macro.S | |||
@@ -18,56 +18,50 @@ | |||
18 | 18 | ||
19 | #include <linux/serial_reg.h> | 19 | #include <linux/serial_reg.h> |
20 | 20 | ||
21 | #include <asm/memory.h> | ||
22 | |||
23 | #include <mach/serial.h> | 21 | #include <mach/serial.h> |
24 | 22 | ||
25 | #define UART_SHIFT 2 | 23 | #define UART_SHIFT 2 |
26 | 24 | ||
27 | #define davinci_uart_v2p(x) ((x) - PAGE_OFFSET + PLAT_PHYS_OFFSET) | ||
28 | #define davinci_uart_p2v(x) ((x) - PLAT_PHYS_OFFSET + PAGE_OFFSET) | ||
29 | |||
30 | .pushsection .data | 25 | .pushsection .data |
31 | davinci_uart_phys: .word 0 | 26 | davinci_uart_phys: .word 0 |
32 | davinci_uart_virt: .word 0 | 27 | davinci_uart_virt: .word 0 |
33 | .popsection | 28 | .popsection |
34 | 29 | ||
35 | .macro addruart, rp, rv | 30 | .macro addruart, rp, rv, tmp |
36 | 31 | ||
37 | /* Use davinci_uart_phys/virt if already configured */ | 32 | /* Use davinci_uart_phys/virt if already configured */ |
38 | 10: mrc p15, 0, \rp, c1, c0 | 33 | 10: adr \rp, 99f @ get effective addr of 99f |
39 | tst \rp, #1 @ MMU enabled? | 34 | ldr \rv, [\rp] @ get absolute addr of 99f |
40 | ldreq \rp, =davinci_uart_v2p(davinci_uart_phys) | 35 | sub \rv, \rv, \rp @ offset between the two |
41 | ldrne \rp, =davinci_uart_phys | 36 | ldr \rp, [\rp, #4] @ abs addr of omap_uart_phys |
42 | add \rv, \rp, #4 @ davinci_uart_virt | 37 | sub \tmp, \rp, \rv @ make it effective |
43 | ldr \rp, [\rp, #0] | 38 | ldr \rp, [\tmp, #0] @ davinci_uart_phys |
44 | ldr \rv, [\rv, #0] | 39 | ldr \rv, [\tmp, #4] @ davinci_uart_virt |
45 | cmp \rp, #0 @ is port configured? | 40 | cmp \rp, #0 @ is port configured? |
46 | cmpne \rv, #0 | 41 | cmpne \rv, #0 |
47 | bne 99f @ already configured | 42 | bne 100f @ already configured |
48 | 43 | ||
49 | /* Check the debug UART address set in uncompress.h */ | 44 | /* Check the debug UART address set in uncompress.h */ |
50 | mrc p15, 0, \rp, c1, c0 | 45 | and \rp, pc, #0xff000000 |
51 | tst \rp, #1 @ MMU enabled? | 46 | ldr \rv, =DAVINCI_UART_INFO_OFS |
47 | add \rp, \rp, \rv | ||
52 | 48 | ||
53 | /* Copy uart phys address from decompressor uart info */ | 49 | /* Copy uart phys address from decompressor uart info */ |
54 | ldreq \rv, =davinci_uart_v2p(davinci_uart_phys) | 50 | ldr \rv, [\rp, #0] |
55 | ldrne \rv, =davinci_uart_phys | 51 | str \rv, [\tmp, #0] |
56 | ldreq \rp, =DAVINCI_UART_INFO | ||
57 | ldrne \rp, =davinci_uart_p2v(DAVINCI_UART_INFO) | ||
58 | ldr \rp, [\rp, #0] | ||
59 | str \rp, [\rv] | ||
60 | 52 | ||
61 | /* Copy uart virt address from decompressor uart info */ | 53 | /* Copy uart virt address from decompressor uart info */ |
62 | ldreq \rv, =davinci_uart_v2p(davinci_uart_virt) | 54 | ldr \rv, [\rp, #4] |
63 | ldrne \rv, =davinci_uart_virt | 55 | str \rv, [\tmp, #4] |
64 | ldreq \rp, =DAVINCI_UART_INFO | ||
65 | ldrne \rp, =davinci_uart_p2v(DAVINCI_UART_INFO) | ||
66 | ldr \rp, [\rp, #4] | ||
67 | str \rp, [\rv] | ||
68 | 56 | ||
69 | b 10b | 57 | b 10b |
70 | 99: | 58 | |
59 | .align | ||
60 | 99: .word . | ||
61 | .word davinci_uart_phys | ||
62 | .ltorg | ||
63 | |||
64 | 100: | ||
71 | .endm | 65 | .endm |
72 | 66 | ||
73 | .macro senduart,rd,rx | 67 | .macro senduart,rd,rx |
diff --git a/arch/arm/mach-davinci/include/mach/memory.h b/arch/arm/mach-davinci/include/mach/memory.h deleted file mode 100644 index 885d23319668..000000000000 --- a/arch/arm/mach-davinci/include/mach/memory.h +++ /dev/null | |||
@@ -1,39 +0,0 @@ | |||
1 | /* | ||
2 | * DaVinci memory space definitions | ||
3 | * | ||
4 | * Author: Kevin Hilman, MontaVista Software, Inc. <source@mvista.com> | ||
5 | * | ||
6 | * 2007 (c) MontaVista Software, Inc. This file is licensed under | ||
7 | * the terms of the GNU General Public License version 2. This program | ||
8 | * is licensed "as is" without any warranty of any kind, whether express | ||
9 | * or implied. | ||
10 | */ | ||
11 | #ifndef __ASM_ARCH_MEMORY_H | ||
12 | #define __ASM_ARCH_MEMORY_H | ||
13 | |||
14 | /************************************************************************** | ||
15 | * Included Files | ||
16 | **************************************************************************/ | ||
17 | #include <asm/page.h> | ||
18 | #include <asm/sizes.h> | ||
19 | |||
20 | /************************************************************************** | ||
21 | * Definitions | ||
22 | **************************************************************************/ | ||
23 | #define DAVINCI_DDR_BASE 0x80000000 | ||
24 | #define DA8XX_DDR_BASE 0xc0000000 | ||
25 | |||
26 | #if defined(CONFIG_ARCH_DAVINCI_DA8XX) && defined(CONFIG_ARCH_DAVINCI_DMx) | ||
27 | #error Cannot enable DaVinci and DA8XX platforms concurrently | ||
28 | #elif defined(CONFIG_ARCH_DAVINCI_DA8XX) | ||
29 | #define PLAT_PHYS_OFFSET DA8XX_DDR_BASE | ||
30 | #else | ||
31 | #define PLAT_PHYS_OFFSET DAVINCI_DDR_BASE | ||
32 | #endif | ||
33 | |||
34 | #define DDR2_SDRCR_OFFSET 0xc | ||
35 | #define DDR2_SRPD_BIT BIT(23) | ||
36 | #define DDR2_MCLKSTOPEN_BIT BIT(30) | ||
37 | #define DDR2_LPMODEN_BIT BIT(31) | ||
38 | |||
39 | #endif /* __ASM_ARCH_MEMORY_H */ | ||
diff --git a/arch/arm/mach-davinci/include/mach/serial.h b/arch/arm/mach-davinci/include/mach/serial.h index c9e6ce185a66..e347d88fef91 100644 --- a/arch/arm/mach-davinci/include/mach/serial.h +++ b/arch/arm/mach-davinci/include/mach/serial.h | |||
@@ -21,8 +21,9 @@ | |||
21 | * macros in debug-macro.S. | 21 | * macros in debug-macro.S. |
22 | * | 22 | * |
23 | * This area sits just below the page tables (see arch/arm/kernel/head.S). | 23 | * This area sits just below the page tables (see arch/arm/kernel/head.S). |
24 | * We define it as a relative offset from start of usable RAM. | ||
24 | */ | 25 | */ |
25 | #define DAVINCI_UART_INFO (PLAT_PHYS_OFFSET + 0x3ff8) | 26 | #define DAVINCI_UART_INFO_OFS 0x3ff8 |
26 | 27 | ||
27 | #define DAVINCI_UART0_BASE (IO_PHYS + 0x20000) | 28 | #define DAVINCI_UART0_BASE (IO_PHYS + 0x20000) |
28 | #define DAVINCI_UART1_BASE (IO_PHYS + 0x20400) | 29 | #define DAVINCI_UART1_BASE (IO_PHYS + 0x20400) |
diff --git a/arch/arm/mach-davinci/include/mach/uncompress.h b/arch/arm/mach-davinci/include/mach/uncompress.h index 78d80683cdc2..9dc7cf9664fe 100644 --- a/arch/arm/mach-davinci/include/mach/uncompress.h +++ b/arch/arm/mach-davinci/include/mach/uncompress.h | |||
@@ -43,7 +43,12 @@ static inline void flush(void) | |||
43 | 43 | ||
44 | static inline void set_uart_info(u32 phys, void * __iomem virt) | 44 | static inline void set_uart_info(u32 phys, void * __iomem virt) |
45 | { | 45 | { |
46 | u32 *uart_info = (u32 *)(DAVINCI_UART_INFO); | 46 | /* |
47 | * Get address of some.bss variable and round it down | ||
48 | * a la CONFIG_AUTO_ZRELADDR. | ||
49 | */ | ||
50 | u32 ram_start = (u32)&uart & 0xf8000000; | ||
51 | u32 *uart_info = (u32 *)(ram_start + DAVINCI_UART_INFO_OFS); | ||
47 | 52 | ||
48 | uart = (u32 *)phys; | 53 | uart = (u32 *)phys; |
49 | uart_info[0] = phys; | 54 | uart_info[0] = phys; |
diff --git a/arch/arm/mach-davinci/sleep.S b/arch/arm/mach-davinci/sleep.S index 5f1e045a3ad1..d4e9316ecacb 100644 --- a/arch/arm/mach-davinci/sleep.S +++ b/arch/arm/mach-davinci/sleep.S | |||
@@ -22,7 +22,7 @@ | |||
22 | #include <linux/linkage.h> | 22 | #include <linux/linkage.h> |
23 | #include <asm/assembler.h> | 23 | #include <asm/assembler.h> |
24 | #include <mach/psc.h> | 24 | #include <mach/psc.h> |
25 | #include <mach/memory.h> | 25 | #include <mach/ddr2.h> |
26 | 26 | ||
27 | #include "clock.h" | 27 | #include "clock.h" |
28 | 28 | ||