diff options
author | Leo Chen <leochen@broadcom.com> | 2009-08-07 14:59:57 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2009-08-15 11:01:40 -0400 |
commit | 661f78d80969eefb25a0e99c08c0eba81b37861e (patch) | |
tree | f4593dd184282a47c874419e874d4e51590bc0a0 /arch/arm/mach-bcmring/include/mach/csp | |
parent | b7462d654f623738b4b3e03cff20f68b5b9a77f5 (diff) |
ARM: 5646/1: bcmring: add mach-bcmring/mm.c and memory headers
memory map addresses
memory map description and init functions
Signed-off-by: Leo Chen <leochen@broadcom.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-bcmring/include/mach/csp')
-rw-r--r-- | arch/arm/mach-bcmring/include/mach/csp/mm_addr.h | 101 | ||||
-rw-r--r-- | arch/arm/mach-bcmring/include/mach/csp/mm_io.h | 147 |
2 files changed, 248 insertions, 0 deletions
diff --git a/arch/arm/mach-bcmring/include/mach/csp/mm_addr.h b/arch/arm/mach-bcmring/include/mach/csp/mm_addr.h new file mode 100644 index 000000000000..86bb58d4f58c --- /dev/null +++ b/arch/arm/mach-bcmring/include/mach/csp/mm_addr.h | |||
@@ -0,0 +1,101 @@ | |||
1 | /***************************************************************************** | ||
2 | * Copyright 2003 - 2008 Broadcom Corporation. All rights reserved. | ||
3 | * | ||
4 | * Unless you and Broadcom execute a separate written software license | ||
5 | * agreement governing use of this software, this software is licensed to you | ||
6 | * under the terms of the GNU General Public License version 2, available at | ||
7 | * http://www.broadcom.com/licenses/GPLv2.php (the "GPL"). | ||
8 | * | ||
9 | * Notwithstanding the above, under no circumstances may you combine this | ||
10 | * software in any way with any other Broadcom software provided under a | ||
11 | * license other than the GPL, without Broadcom's express prior written | ||
12 | * consent. | ||
13 | *****************************************************************************/ | ||
14 | |||
15 | /****************************************************************************/ | ||
16 | /** | ||
17 | * @file mm_addr.h | ||
18 | * | ||
19 | * @brief Memory Map address defintions | ||
20 | * | ||
21 | * @note | ||
22 | * None | ||
23 | */ | ||
24 | /****************************************************************************/ | ||
25 | |||
26 | #ifndef _MM_ADDR_H | ||
27 | #define _MM_ADDR_H | ||
28 | |||
29 | /* ---- Include Files ---------------------------------------------------- */ | ||
30 | |||
31 | #if !defined(CSP_SIMULATION) | ||
32 | #include <cfg_global.h> | ||
33 | #endif | ||
34 | |||
35 | /* ---- Public Constants and Types --------------------------------------- */ | ||
36 | |||
37 | /* Memory Map address definitions */ | ||
38 | |||
39 | #define MM_ADDR_DDR 0x00000000 | ||
40 | |||
41 | #define MM_ADDR_IO_VPM_EXTMEM_RSVD 0x0F000000 /* 16 MB - Reserved external memory for VPM use */ | ||
42 | |||
43 | #define MM_ADDR_IO_FLASHC 0x20000000 | ||
44 | #define MM_ADDR_IO_BROM 0x30000000 | ||
45 | #define MM_ADDR_IO_ARAM 0x30100000 /* 64 KB - extra cycle latency - WS switch */ | ||
46 | #define MM_ADDR_IO_DMA0 0x30200000 | ||
47 | #define MM_ADDR_IO_DMA1 0x30300000 | ||
48 | #define MM_ADDR_IO_ESW 0x30400000 | ||
49 | #define MM_ADDR_IO_CLCD 0x30500000 | ||
50 | #define MM_ADDR_IO_PIF 0x30580000 | ||
51 | #define MM_ADDR_IO_APM 0x30600000 | ||
52 | #define MM_ADDR_IO_SPUM 0x30700000 | ||
53 | #define MM_ADDR_IO_VPM_PROG 0x30800000 | ||
54 | #define MM_ADDR_IO_VPM_DATA 0x30A00000 | ||
55 | #define MM_ADDR_IO_VRAM 0x40000000 /* 64 KB - security block in front of it */ | ||
56 | #define MM_ADDR_IO_CHIPC 0x80000000 | ||
57 | #define MM_ADDR_IO_UMI 0x80001000 | ||
58 | #define MM_ADDR_IO_NAND 0x80001800 | ||
59 | #define MM_ADDR_IO_LEDM 0x80002000 | ||
60 | #define MM_ADDR_IO_PWM 0x80002040 | ||
61 | #define MM_ADDR_IO_VINTC 0x80003000 | ||
62 | #define MM_ADDR_IO_GPIO0 0x80004000 | ||
63 | #define MM_ADDR_IO_GPIO1 0x80004800 | ||
64 | #define MM_ADDR_IO_I2CS 0x80005000 | ||
65 | #define MM_ADDR_IO_SPIS 0x80006000 | ||
66 | #define MM_ADDR_IO_HPM 0x80007400 | ||
67 | #define MM_ADDR_IO_HPM_REMAP 0x80007800 | ||
68 | #define MM_ADDR_IO_TZPC 0x80008000 | ||
69 | #define MM_ADDR_IO_MPU 0x80009000 | ||
70 | #define MM_ADDR_IO_SPUMP 0x8000a000 | ||
71 | #define MM_ADDR_IO_PKA 0x8000b000 | ||
72 | #define MM_ADDR_IO_RNG 0x8000c000 | ||
73 | #define MM_ADDR_IO_KEYC 0x8000d000 | ||
74 | #define MM_ADDR_IO_BBL 0x8000e000 | ||
75 | #define MM_ADDR_IO_OTP 0x8000f000 | ||
76 | #define MM_ADDR_IO_I2S0 0x80010000 | ||
77 | #define MM_ADDR_IO_I2S1 0x80011000 | ||
78 | #define MM_ADDR_IO_UARTA 0x80012000 | ||
79 | #define MM_ADDR_IO_UARTB 0x80013000 | ||
80 | #define MM_ADDR_IO_I2CH 0x80014020 | ||
81 | #define MM_ADDR_IO_SPIH 0x80015000 | ||
82 | #define MM_ADDR_IO_TSC 0x80016000 | ||
83 | #define MM_ADDR_IO_TMR 0x80017000 | ||
84 | #define MM_ADDR_IO_WATCHDOG 0x80017800 | ||
85 | #define MM_ADDR_IO_ETM 0x80018000 | ||
86 | #define MM_ADDR_IO_DDRC 0x80019000 | ||
87 | #define MM_ADDR_IO_SINTC 0x80100000 | ||
88 | #define MM_ADDR_IO_INTC0 0x80200000 | ||
89 | #define MM_ADDR_IO_INTC1 0x80201000 | ||
90 | #define MM_ADDR_IO_GE 0x80300000 | ||
91 | #define MM_ADDR_IO_USB_CTLR0 0x80400000 | ||
92 | #define MM_ADDR_IO_USB_CTLR1 0x80410000 | ||
93 | #define MM_ADDR_IO_USB_PHY 0x80420000 | ||
94 | #define MM_ADDR_IO_SDIOH0 0x80500000 | ||
95 | #define MM_ADDR_IO_SDIOH1 0x80600000 | ||
96 | #define MM_ADDR_IO_VDEC 0x80700000 | ||
97 | |||
98 | /* ---- Public Variable Externs ------------------------------------------ */ | ||
99 | /* ---- Public Function Prototypes --------------------------------------- */ | ||
100 | |||
101 | #endif /* _MM_ADDR_H */ | ||
diff --git a/arch/arm/mach-bcmring/include/mach/csp/mm_io.h b/arch/arm/mach-bcmring/include/mach/csp/mm_io.h new file mode 100644 index 000000000000..de92ec6a01aa --- /dev/null +++ b/arch/arm/mach-bcmring/include/mach/csp/mm_io.h | |||
@@ -0,0 +1,147 @@ | |||
1 | /***************************************************************************** | ||
2 | * Copyright 2003 - 2008 Broadcom Corporation. All rights reserved. | ||
3 | * | ||
4 | * Unless you and Broadcom execute a separate written software license | ||
5 | * agreement governing use of this software, this software is licensed to you | ||
6 | * under the terms of the GNU General Public License version 2, available at | ||
7 | * http://www.broadcom.com/licenses/GPLv2.php (the "GPL"). | ||
8 | * | ||
9 | * Notwithstanding the above, under no circumstances may you combine this | ||
10 | * software in any way with any other Broadcom software provided under a | ||
11 | * license other than the GPL, without Broadcom's express prior written | ||
12 | * consent. | ||
13 | *****************************************************************************/ | ||
14 | |||
15 | /****************************************************************************/ | ||
16 | /** | ||
17 | * @file mm_io.h | ||
18 | * | ||
19 | * @brief Memory Map I/O definitions | ||
20 | * | ||
21 | * @note | ||
22 | * None | ||
23 | */ | ||
24 | /****************************************************************************/ | ||
25 | |||
26 | #ifndef _MM_IO_H | ||
27 | #define _MM_IO_H | ||
28 | |||
29 | /* ---- Include Files ---------------------------------------------------- */ | ||
30 | #include <mach/csp/mm_addr.h> | ||
31 | |||
32 | #if !defined(CSP_SIMULATION) | ||
33 | #include <cfg_global.h> | ||
34 | #endif | ||
35 | |||
36 | /* ---- Public Constants and Types --------------------------------------- */ | ||
37 | |||
38 | #if defined(CONFIG_MMU) | ||
39 | |||
40 | /* This macro is referenced in <mach/io.h> | ||
41 | * Phys to Virtual 0xNyxxxxxx => 0xFNxxxxxx | ||
42 | * This macro is referenced in <asm/arch/io.h> | ||
43 | * | ||
44 | * Assume VPM address is the last x MB of memory. For VPM, map to | ||
45 | * 0xf0000000 and up. | ||
46 | */ | ||
47 | |||
48 | #ifndef MM_IO_PHYS_TO_VIRT | ||
49 | #ifdef __ASSEMBLY__ | ||
50 | #define MM_IO_PHYS_TO_VIRT(phys) (0xF0000000 | (((phys) >> 4) & 0x0F000000) | ((phys) & 0xFFFFFF)) | ||
51 | #else | ||
52 | #define MM_IO_PHYS_TO_VIRT(phys) (((phys) == MM_ADDR_IO_VPM_EXTMEM_RSVD) ? 0xF0000000 : \ | ||
53 | (0xF0000000 | (((phys) >> 4) & 0x0F000000) | ((phys) & 0xFFFFFF))) | ||
54 | #endif | ||
55 | #endif | ||
56 | |||
57 | /* Virtual to Physical 0xFNxxxxxx => 0xN0xxxxxx */ | ||
58 | |||
59 | #ifndef MM_IO_VIRT_TO_PHYS | ||
60 | #ifdef __ASSEMBLY__ | ||
61 | #define MM_IO_VIRT_TO_PHYS(virt) ((((virt) & 0x0F000000) << 4) | ((virt) & 0xFFFFFF)) | ||
62 | #else | ||
63 | #define MM_IO_VIRT_TO_PHYS(virt) (((virt) == 0xF0000000) ? MM_ADDR_IO_VPM_EXTMEM_RSVD : \ | ||
64 | ((((virt) & 0x0F000000) << 4) | ((virt) & 0xFFFFFF))) | ||
65 | #endif | ||
66 | #endif | ||
67 | |||
68 | #else | ||
69 | |||
70 | #ifndef MM_IO_PHYS_TO_VIRT | ||
71 | #define MM_IO_PHYS_TO_VIRT(phys) (phys) | ||
72 | #endif | ||
73 | |||
74 | #ifndef MM_IO_VIRT_TO_PHYS | ||
75 | #define MM_IO_VIRT_TO_PHYS(virt) (virt) | ||
76 | #endif | ||
77 | |||
78 | #endif | ||
79 | |||
80 | /* Registers in 0xExxxxxxx that should be moved to 0xFxxxxxxx */ | ||
81 | #define MM_IO_BASE_FLASHC MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_FLASHC) | ||
82 | #define MM_IO_BASE_NAND MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_NAND) | ||
83 | #define MM_IO_BASE_UMI MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_UMI) | ||
84 | |||
85 | #define MM_IO_START MM_ADDR_IO_FLASHC /* Physical beginning of IO mapped memory */ | ||
86 | #define MM_IO_BASE MM_IO_BASE_FLASHC /* Virtual beginning of IO mapped memory */ | ||
87 | |||
88 | #define MM_IO_BASE_BROM MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_BROM) | ||
89 | #define MM_IO_BASE_ARAM MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_ARAM) | ||
90 | #define MM_IO_BASE_DMA0 MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_DMA0) | ||
91 | #define MM_IO_BASE_DMA1 MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_DMA1) | ||
92 | #define MM_IO_BASE_ESW MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_ESW) | ||
93 | #define MM_IO_BASE_CLCD MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_CLCD) | ||
94 | #define MM_IO_BASE_PIF MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_PIF) | ||
95 | #define MM_IO_BASE_APM MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_APM) | ||
96 | #define MM_IO_BASE_SPUM MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_SPUM) | ||
97 | #define MM_IO_BASE_VPM_PROG MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_VPM_PROG) | ||
98 | #define MM_IO_BASE_VPM_DATA MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_VPM_DATA) | ||
99 | |||
100 | #define MM_IO_BASE_VRAM MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_VRAM) | ||
101 | |||
102 | #define MM_IO_BASE_CHIPC MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_CHIPC) | ||
103 | #define MM_IO_BASE_DDRC MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_DDRC) | ||
104 | #define MM_IO_BASE_LEDM MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_LEDM) | ||
105 | #define MM_IO_BASE_PWM MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_PWM) | ||
106 | #define MM_IO_BASE_VINTC MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_VINTC) | ||
107 | #define MM_IO_BASE_GPIO0 MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_GPIO0) | ||
108 | #define MM_IO_BASE_GPIO1 MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_GPIO1) | ||
109 | #define MM_IO_BASE_TMR MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_TMR) | ||
110 | #define MM_IO_BASE_WATCHDOG MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_WATCHDOG) | ||
111 | #define MM_IO_BASE_ETM MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_ETM) | ||
112 | #define MM_IO_BASE_HPM MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_HPM) | ||
113 | #define MM_IO_BASE_HPM_REMAP MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_HPM_REMAP) | ||
114 | #define MM_IO_BASE_TZPC MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_TZPC) | ||
115 | #define MM_IO_BASE_MPU MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_MPU) | ||
116 | #define MM_IO_BASE_SPUMP MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_SPUMP) | ||
117 | #define MM_IO_BASE_PKA MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_PKA) | ||
118 | #define MM_IO_BASE_RNG MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_RNG) | ||
119 | #define MM_IO_BASE_KEYC MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_KEYC) | ||
120 | #define MM_IO_BASE_BBL MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_BBL) | ||
121 | #define MM_IO_BASE_OTP MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_OTP) | ||
122 | #define MM_IO_BASE_I2S0 MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_I2S0) | ||
123 | #define MM_IO_BASE_I2S1 MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_I2S1) | ||
124 | #define MM_IO_BASE_UARTA MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_UARTA) | ||
125 | #define MM_IO_BASE_UARTB MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_UARTB) | ||
126 | #define MM_IO_BASE_I2CH MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_I2CH) | ||
127 | #define MM_IO_BASE_SPIH MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_SPIH) | ||
128 | #define MM_IO_BASE_TSC MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_TSC) | ||
129 | #define MM_IO_BASE_I2CS MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_I2CS) | ||
130 | #define MM_IO_BASE_SPIS MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_SPIS) | ||
131 | #define MM_IO_BASE_SINTC MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_SINTC) | ||
132 | #define MM_IO_BASE_INTC0 MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_INTC0) | ||
133 | #define MM_IO_BASE_INTC1 MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_INTC1) | ||
134 | #define MM_IO_BASE_GE MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_GE) | ||
135 | #define MM_IO_BASE_USB_CTLR0 MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_USB_CTLR0) | ||
136 | #define MM_IO_BASE_USB_CTLR1 MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_USB_CTLR1) | ||
137 | #define MM_IO_BASE_USB_PHY MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_USB_PHY) | ||
138 | #define MM_IO_BASE_SDIOH0 MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_SDIOH0) | ||
139 | #define MM_IO_BASE_SDIOH1 MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_SDIOH1) | ||
140 | #define MM_IO_BASE_VDEC MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_VDEC) | ||
141 | |||
142 | #define MM_IO_BASE_VPM_EXTMEM_RSVD MM_IO_PHYS_TO_VIRT(MM_ADDR_IO_VPM_EXTMEM_RSVD) | ||
143 | |||
144 | /* ---- Public Variable Externs ------------------------------------------ */ | ||
145 | /* ---- Public Function Prototypes --------------------------------------- */ | ||
146 | |||
147 | #endif /* _MM_IO_H */ | ||