diff options
author | Paulius Zaleckas <paulius.zaleckas@teltonika.lt> | 2009-03-26 04:06:08 -0400 |
---|---|---|
committer | Paulius Zaleckas <paulius.zaleckas@teltonika.lt> | 2009-03-26 04:06:08 -0400 |
commit | 59d3a193f1ec1639db447aa1ceb39cd1811fb36e (patch) | |
tree | e5c5572b3b8b654da76f0fa82c3c78449bb53e90 /arch/arm/mach-gemini/include | |
parent | 6a915af99fc974be8f2180132ddff7d32aad8779 (diff) |
ARM: Add Gemini architecture v3
Adds support for Cortina Systems Gemini family CPUs:
http://www.cortina-systems.com/products/category/18
v3:
- fixed __io(a) to be defined as __typesafe_io(a)
v2:
- #include <asm/io.h> -> <linux/io.h>
- remove asm/system.h include
- revorked mm.c to use named initializers
- removed "empty" dma.h
- updated copyrights
Signed-off-by: Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
Diffstat (limited to 'arch/arm/mach-gemini/include')
-rw-r--r-- | arch/arm/mach-gemini/include/mach/debug-macro.S | 23 | ||||
-rw-r--r-- | arch/arm/mach-gemini/include/mach/entry-macro.S | 39 | ||||
-rw-r--r-- | arch/arm/mach-gemini/include/mach/global_reg.h | 278 | ||||
-rw-r--r-- | arch/arm/mach-gemini/include/mach/hardware.h | 75 | ||||
-rw-r--r-- | arch/arm/mach-gemini/include/mach/io.h | 18 | ||||
-rw-r--r-- | arch/arm/mach-gemini/include/mach/irqs.h | 50 | ||||
-rw-r--r-- | arch/arm/mach-gemini/include/mach/memory.h | 19 | ||||
-rw-r--r-- | arch/arm/mach-gemini/include/mach/system.h | 37 | ||||
-rw-r--r-- | arch/arm/mach-gemini/include/mach/timex.h | 13 | ||||
-rw-r--r-- | arch/arm/mach-gemini/include/mach/uncompress.h | 42 | ||||
-rw-r--r-- | arch/arm/mach-gemini/include/mach/vmalloc.h | 10 |
11 files changed, 604 insertions, 0 deletions
diff --git a/arch/arm/mach-gemini/include/mach/debug-macro.S b/arch/arm/mach-gemini/include/mach/debug-macro.S new file mode 100644 index 000000000000..d04a6eaeae14 --- /dev/null +++ b/arch/arm/mach-gemini/include/mach/debug-macro.S | |||
@@ -0,0 +1,23 @@ | |||
1 | /* | ||
2 | * Debugging macro include header | ||
3 | * | ||
4 | * Copyright (C) 1994-1999 Russell King | ||
5 | * Copyright (C) 2001-2006 Storlink, Corp. | ||
6 | * Copyright (C) 2008-2009 Paulius Zaleckas <paulius.zaleckas@teltonika.lt> | ||
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 | #include <mach/hardware.h> | ||
13 | |||
14 | .macro addruart,rx | ||
15 | mrc p15, 0, \rx, c1, c0 | ||
16 | tst \rx, #1 @ MMU enabled? | ||
17 | ldreq \rx, =GEMINI_UART_BASE @ physical | ||
18 | ldrne \rx, =IO_ADDRESS(GEMINI_UART_BASE) @ virtual | ||
19 | .endm | ||
20 | |||
21 | #define UART_SHIFT 2 | ||
22 | #define FLOW_CONTROL | ||
23 | #include <asm/hardware/debug-8250.S> | ||
diff --git a/arch/arm/mach-gemini/include/mach/entry-macro.S b/arch/arm/mach-gemini/include/mach/entry-macro.S new file mode 100644 index 000000000000..1624f91a2b8b --- /dev/null +++ b/arch/arm/mach-gemini/include/mach/entry-macro.S | |||
@@ -0,0 +1,39 @@ | |||
1 | /* | ||
2 | * Low-level IRQ helper macros for Gemini platform. | ||
3 | * | ||
4 | * Copyright (C) 2001-2006 Storlink, Corp. | ||
5 | * Copyright (C) 2008-2009 Paulius Zaleckas <paulius.zaleckas@teltonika.lt> | ||
6 | * | ||
7 | * This file is licensed under the terms of the GNU General Public | ||
8 | * License version 2. This program is licensed "as is" without any | ||
9 | * warranty of any kind, whether express or implied. | ||
10 | */ | ||
11 | #include <mach/hardware.h> | ||
12 | |||
13 | #define IRQ_STATUS 0x14 | ||
14 | |||
15 | .macro disable_fiq | ||
16 | .endm | ||
17 | |||
18 | .macro get_irqnr_preamble, base, tmp | ||
19 | .endm | ||
20 | |||
21 | .macro arch_ret_to_user, tmp1, tmp2 | ||
22 | .endm | ||
23 | |||
24 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp | ||
25 | ldr \irqstat, =IO_ADDRESS(GEMINI_INTERRUPT_BASE + IRQ_STATUS) | ||
26 | ldr \irqnr, [\irqstat] | ||
27 | cmp \irqnr, #0 | ||
28 | beq 2313f | ||
29 | mov \tmp, \irqnr | ||
30 | mov \irqnr, #0 | ||
31 | 2312: | ||
32 | tst \tmp, #1 | ||
33 | bne 2313f | ||
34 | add \irqnr, \irqnr, #1 | ||
35 | mov \tmp, \tmp, lsr #1 | ||
36 | cmp \irqnr, #31 | ||
37 | bcc 2312b | ||
38 | 2313: | ||
39 | .endm | ||
diff --git a/arch/arm/mach-gemini/include/mach/global_reg.h b/arch/arm/mach-gemini/include/mach/global_reg.h new file mode 100644 index 000000000000..de7ff7e849fc --- /dev/null +++ b/arch/arm/mach-gemini/include/mach/global_reg.h | |||
@@ -0,0 +1,278 @@ | |||
1 | /* | ||
2 | * This file contains the hardware definitions for Gemini. | ||
3 | * | ||
4 | * Copyright (C) 2009 Paulius Zaleckas <paulius.zaleckas@teltonika.lt> | ||
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 as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | */ | ||
11 | #ifndef __MACH_GLOBAL_REG_H | ||
12 | #define __MACH_GLOBAL_REG_H | ||
13 | |||
14 | /* Global Word ID Register*/ | ||
15 | #define GLOBAL_ID 0x00 | ||
16 | |||
17 | #define CHIP_ID(reg) ((reg) >> 8) | ||
18 | #define CHIP_REVISION(reg) ((reg) & 0xFF) | ||
19 | |||
20 | /* Global Status Register */ | ||
21 | #define GLOBAL_STATUS 0x04 | ||
22 | |||
23 | #define CPU_BIG_ENDIAN (1 << 31) | ||
24 | #define PLL_OSC_30M (1 << 30) /* else 60MHz */ | ||
25 | |||
26 | #define OPERATION_MODE_MASK (0xF << 26) | ||
27 | #define OPM_IDDQ (0xF << 26) | ||
28 | #define OPM_NAND (0xE << 26) | ||
29 | #define OPM_RING (0xD << 26) | ||
30 | #define OPM_DIRECT_BOOT (0xC << 26) | ||
31 | #define OPM_USB1_PHY_TEST (0xB << 26) | ||
32 | #define OPM_USB0_PHY_TEST (0xA << 26) | ||
33 | #define OPM_SATA1_PHY_TEST (0x9 << 26) | ||
34 | #define OPM_SATA0_PHY_TEST (0x8 << 26) | ||
35 | #define OPM_ICE_ARM (0x7 << 26) | ||
36 | #define OPM_ICE_FARADAY (0x6 << 26) | ||
37 | #define OPM_PLL_BYPASS (0x5 << 26) | ||
38 | #define OPM_DEBUG (0x4 << 26) | ||
39 | #define OPM_BURN_IN (0x3 << 26) | ||
40 | #define OPM_MBIST (0x2 << 26) | ||
41 | #define OPM_SCAN (0x1 << 26) | ||
42 | #define OPM_REAL (0x0 << 26) | ||
43 | |||
44 | #define FLASH_TYPE_MASK (0x3 << 24) | ||
45 | #define FLASH_TYPE_NAND_2K (0x3 << 24) | ||
46 | #define FLASH_TYPE_NAND_512 (0x2 << 24) | ||
47 | #define FLASH_TYPE_PARALLEL (0x1 << 24) | ||
48 | #define FLASH_TYPE_SERIAL (0x0 << 24) | ||
49 | /* if parallel */ | ||
50 | #define FLASH_WIDTH_16BIT (1 << 23) /* else 8 bit */ | ||
51 | /* if serial */ | ||
52 | #define FLASH_ATMEL (1 << 23) /* else STM */ | ||
53 | |||
54 | #define FLASH_SIZE_MASK (0x3 << 21) | ||
55 | #define NAND_256M (0x3 << 21) /* and more */ | ||
56 | #define NAND_128M (0x2 << 21) | ||
57 | #define NAND_64M (0x1 << 21) | ||
58 | #define NAND_32M (0x0 << 21) | ||
59 | #define ATMEL_16M (0x3 << 21) /* and more */ | ||
60 | #define ATMEL_8M (0x2 << 21) | ||
61 | #define ATMEL_4M_2M (0x1 << 21) | ||
62 | #define ATMEL_1M (0x0 << 21) /* and less */ | ||
63 | #define STM_32M (1 << 22) /* and more */ | ||
64 | #define STM_16M (0 << 22) /* and less */ | ||
65 | |||
66 | #define FLASH_PARALLEL_HIGH_PIN_CNT (1 << 20) /* else low pin cnt */ | ||
67 | |||
68 | #define CPU_AHB_RATIO_MASK (0x3 << 18) | ||
69 | #define CPU_AHB_1_1 (0x0 << 18) | ||
70 | #define CPU_AHB_3_2 (0x1 << 18) | ||
71 | #define CPU_AHB_24_13 (0x2 << 18) | ||
72 | #define CPU_AHB_2_1 (0x3 << 18) | ||
73 | |||
74 | #define REG_TO_AHB_SPEED(reg) ((((reg) >> 15) & 0x7) * 10 + 130) | ||
75 | #define AHB_SPEED_TO_REG(x) ((((x - 130)) / 10) << 15) | ||
76 | |||
77 | /* it is posible to override some settings, use >> OVERRIDE_xxxx_SHIFT */ | ||
78 | #define OVERRIDE_FLASH_TYPE_SHIFT 16 | ||
79 | #define OVERRIDE_FLASH_WIDTH_SHIFT 16 | ||
80 | #define OVERRIDE_FLASH_SIZE_SHIFT 16 | ||
81 | #define OVERRIDE_CPU_AHB_RATIO_SHIFT 15 | ||
82 | #define OVERRIDE_AHB_SPEED_SHIFT 15 | ||
83 | |||
84 | /* Global PLL Control Register */ | ||
85 | #define GLOBAL_PLL_CTRL 0x08 | ||
86 | |||
87 | #define PLL_BYPASS (1 << 31) | ||
88 | #define PLL_POWER_DOWN (1 << 8) | ||
89 | #define PLL_CONTROL_Q (0x1F << 0) | ||
90 | |||
91 | /* Global Soft Reset Control Register */ | ||
92 | #define GLOBAL_RESET 0x0C | ||
93 | |||
94 | #define RESET_GLOBAL (1 << 31) | ||
95 | #define RESET_CPU1 (1 << 30) | ||
96 | #define RESET_TVE (1 << 28) | ||
97 | #define RESET_SATA1 (1 << 27) | ||
98 | #define RESET_SATA0 (1 << 26) | ||
99 | #define RESET_CIR (1 << 25) | ||
100 | #define RESET_EXT_DEV (1 << 24) | ||
101 | #define RESET_WD (1 << 23) | ||
102 | #define RESET_GPIO2 (1 << 22) | ||
103 | #define RESET_GPIO1 (1 << 21) | ||
104 | #define RESET_GPIO0 (1 << 20) | ||
105 | #define RESET_SSP (1 << 19) | ||
106 | #define RESET_UART (1 << 18) | ||
107 | #define RESET_TIMER (1 << 17) | ||
108 | #define RESET_RTC (1 << 16) | ||
109 | #define RESET_INT1 (1 << 15) | ||
110 | #define RESET_INT0 (1 << 14) | ||
111 | #define RESET_LCD (1 << 13) | ||
112 | #define RESET_LPC (1 << 12) | ||
113 | #define RESET_APB (1 << 11) | ||
114 | #define RESET_DMA (1 << 10) | ||
115 | #define RESET_USB1 (1 << 9) | ||
116 | #define RESET_USB0 (1 << 8) | ||
117 | #define RESET_PCI (1 << 7) | ||
118 | #define RESET_GMAC1 (1 << 6) | ||
119 | #define RESET_GMAC0 (1 << 5) | ||
120 | #define RESET_SECURITY (1 << 4) | ||
121 | #define RESET_RAID (1 << 3) | ||
122 | #define RESET_IDE (1 << 2) | ||
123 | #define RESET_FLASH (1 << 1) | ||
124 | #define RESET_DRAM (1 << 0) | ||
125 | |||
126 | /* Global IO Pad Driving Capability Control Register */ | ||
127 | #define GLOBAL_IO_DRIVING_CTRL 0x10 | ||
128 | |||
129 | #define DRIVING_CURRENT_MASK 0x3 | ||
130 | |||
131 | /* here 00-4mA, 01-8mA, 10-12mA, 11-16mA */ | ||
132 | #define GPIO1_PADS_31_28_SHIFT 28 | ||
133 | #define GPIO0_PADS_31_16_SHIFT 26 | ||
134 | #define GPIO0_PADS_15_0_SHIFT 24 | ||
135 | #define PCI_AND_EXT_RESET_PADS_SHIFT 22 | ||
136 | #define IDE_PADS_SHIFT 20 | ||
137 | #define GMAC1_PADS_SHIFT 18 | ||
138 | #define GMAC0_PADS_SHIFT 16 | ||
139 | /* DRAM is not in mA and poorly documented */ | ||
140 | #define DRAM_CLOCK_PADS_SHIFT 8 | ||
141 | #define DRAM_DATA_PADS_SHIFT 4 | ||
142 | #define DRAM_CONTROL_PADS_SHIFT 0 | ||
143 | |||
144 | /* Global IO Pad Slew Rate Control Register */ | ||
145 | #define GLOBAL_IO_SLEW_RATE_CTRL 0x14 | ||
146 | |||
147 | #define GPIO1_PADS_31_28_SLOW (1 << 10) | ||
148 | #define GPIO0_PADS_31_16_SLOW (1 << 9) | ||
149 | #define GPIO0_PADS_15_0_SLOW (1 << 8) | ||
150 | #define PCI_PADS_SLOW (1 << 7) | ||
151 | #define IDE_PADS_SLOW (1 << 6) | ||
152 | #define GMAC1_PADS_SLOW (1 << 5) | ||
153 | #define GMAC0_PADS_SLOW (1 << 4) | ||
154 | #define DRAM_CLOCK_PADS_SLOW (1 << 1) | ||
155 | #define DRAM_IO_PADS_SLOW (1 << 0) | ||
156 | |||
157 | /* | ||
158 | * General skew control defines | ||
159 | * 16 steps, each step is around 0.2ns | ||
160 | */ | ||
161 | #define SKEW_MASK 0xF | ||
162 | |||
163 | /* Global IDE PAD Skew Control Register */ | ||
164 | #define GLOBAL_IDE_SKEW_CTRL 0x18 | ||
165 | |||
166 | #define IDE1_HOST_STROBE_DELAY_SHIFT 28 | ||
167 | #define IDE1_DEVICE_STROBE_DELAY_SHIFT 24 | ||
168 | #define IDE1_OUTPUT_IO_SKEW_SHIFT 20 | ||
169 | #define IDE1_INPUT_IO_SKEW_SHIFT 16 | ||
170 | #define IDE0_HOST_STROBE_DELAY_SHIFT 12 | ||
171 | #define IDE0_DEVICE_STROBE_DELAY_SHIFT 8 | ||
172 | #define IDE0_OUTPUT_IO_SKEW_SHIFT 4 | ||
173 | #define IDE0_INPUT_IO_SKEW_SHIFT 0 | ||
174 | |||
175 | /* Global GMAC Control Pad Skew Control Register */ | ||
176 | #define GLOBAL_GMAC_CTRL_SKEW_CTRL 0x1C | ||
177 | |||
178 | #define GMAC1_TXC_SKEW_SHIFT 28 | ||
179 | #define GMAC1_TXEN_SKEW_SHIFT 24 | ||
180 | #define GMAC1_RXC_SKEW_SHIFT 20 | ||
181 | #define GMAC1_RXDV_SKEW_SHIFT 16 | ||
182 | #define GMAC0_TXC_SKEW_SHIFT 12 | ||
183 | #define GMAC0_TXEN_SKEW_SHIFT 8 | ||
184 | #define GMAC0_RXC_SKEW_SHIFT 4 | ||
185 | #define GMAC0_RXDV_SKEW_SHIFT 0 | ||
186 | |||
187 | /* Global GMAC0 Data PAD Skew Control Register */ | ||
188 | #define GLOBAL_GMAC0_DATA_SKEW_CTRL 0x20 | ||
189 | /* Global GMAC1 Data PAD Skew Control Register */ | ||
190 | #define GLOBAL_GMAC1_DATA_SKEW_CTRL 0x24 | ||
191 | |||
192 | #define GMAC_TXD_SKEW_SHIFT(x) (((x) * 4) + 16) | ||
193 | #define GMAC_RXD_SKEW_SHIFT(x) ((x) * 4) | ||
194 | |||
195 | /* CPU has two AHB busses. */ | ||
196 | |||
197 | /* Global Arbitration0 Control Register */ | ||
198 | #define GLOBAL_ARBITRATION0_CTRL 0x28 | ||
199 | |||
200 | #define BOOT_CONTROLLER_HIGH_PRIO (1 << 3) | ||
201 | #define DMA_BUS1_HIGH_PRIO (1 << 2) | ||
202 | #define CPU0_HIGH_PRIO (1 << 0) | ||
203 | |||
204 | /* Global Arbitration1 Control Register */ | ||
205 | #define GLOBAL_ARBITRATION1_CTRL 0x2C | ||
206 | |||
207 | #define TVE_HIGH_PRIO (1 << 9) | ||
208 | #define PCI_HIGH_PRIO (1 << 8) | ||
209 | #define USB1_HIGH_PRIO (1 << 7) | ||
210 | #define USB0_HIGH_PRIO (1 << 6) | ||
211 | #define GMAC1_HIGH_PRIO (1 << 5) | ||
212 | #define GMAC0_HIGH_PRIO (1 << 4) | ||
213 | #define SECURITY_HIGH_PRIO (1 << 3) | ||
214 | #define RAID_HIGH_PRIO (1 << 2) | ||
215 | #define IDE_HIGH_PRIO (1 << 1) | ||
216 | #define DMA_BUS2_HIGH_PRIO (1 << 0) | ||
217 | |||
218 | /* Common bits for both arbitration registers */ | ||
219 | #define BURST_LENGTH_SHIFT 16 | ||
220 | #define BURST_LENGTH_MASK (0x3F << 16) | ||
221 | |||
222 | /* Miscellaneous Control Register */ | ||
223 | #define GLOBAL_MISC_CTRL 0x30 | ||
224 | |||
225 | #define MEMORY_SPACE_SWAP (1 << 31) | ||
226 | #define USB1_PLUG_MINIB (1 << 30) /* else plug is mini-A */ | ||
227 | #define USB0_PLUG_MINIB (1 << 29) | ||
228 | #define GMAC_GMII (1 << 28) | ||
229 | #define GMAC_1_ENABLE (1 << 27) | ||
230 | /* TODO: define ATA/SATA bits */ | ||
231 | #define USB1_VBUS_ON (1 << 23) | ||
232 | #define USB0_VBUS_ON (1 << 22) | ||
233 | #define APB_CLKOUT_ENABLE (1 << 21) | ||
234 | #define TVC_CLKOUT_ENABLE (1 << 20) | ||
235 | #define EXT_CLKIN_ENABLE (1 << 19) | ||
236 | #define PCI_66MHZ (1 << 18) /* else 33 MHz */ | ||
237 | #define PCI_CLKOUT_ENABLE (1 << 17) | ||
238 | #define LPC_CLKOUT_ENABLE (1 << 16) | ||
239 | #define USB1_WAKEUP_ON (1 << 15) | ||
240 | #define USB0_WAKEUP_ON (1 << 14) | ||
241 | /* TODO: define PCI idle detect bits */ | ||
242 | #define TVC_PADS_ENABLE (1 << 9) | ||
243 | #define SSP_PADS_ENABLE (1 << 8) | ||
244 | #define LCD_PADS_ENABLE (1 << 7) | ||
245 | #define LPC_PADS_ENABLE (1 << 6) | ||
246 | #define PCI_PADS_ENABLE (1 << 5) | ||
247 | #define IDE_PADS_ENABLE (1 << 4) | ||
248 | #define DRAM_PADS_POWER_DOWN (1 << 3) | ||
249 | #define NAND_PADS_DISABLE (1 << 2) | ||
250 | #define PFLASH_PADS_DISABLE (1 << 1) | ||
251 | #define SFLASH_PADS_DISABLE (1 << 0) | ||
252 | |||
253 | /* Global Clock Control Register */ | ||
254 | #define GLOBAL_CLOCK_CTRL 0x34 | ||
255 | |||
256 | #define POWER_STATE_G0 (1 << 31) | ||
257 | #define POWER_STATE_S1 (1 << 30) /* else it is S3/S4 state */ | ||
258 | #define SECURITY_APB_AHB (1 << 29) | ||
259 | /* else Security APB clk will be 0.75xAHB */ | ||
260 | /* TODO: TVC clock divider */ | ||
261 | #define PCI_CLKRUN_ENABLE (1 << 16) | ||
262 | #define BOOT_CLK_DISABLE (1 << 13) | ||
263 | #define TVC_CLK_DISABLE (1 << 12) | ||
264 | #define FLASH_CLK_DISABLE (1 << 11) | ||
265 | #define DDR_CLK_DISABLE (1 << 10) | ||
266 | #define PCI_CLK_DISABLE (1 << 9) | ||
267 | #define IDE_CLK_DISABLE (1 << 8) | ||
268 | #define USB1_CLK_DISABLE (1 << 7) | ||
269 | #define USB0_CLK_DISABLE (1 << 6) | ||
270 | #define SATA1_CLK_DISABLE (1 << 5) | ||
271 | #define SATA0_CLK_DISABLE (1 << 4) | ||
272 | #define GMAC1_CLK_DISABLE (1 << 3) | ||
273 | #define GMAC0_CLK_DISABLE (1 << 2) | ||
274 | #define SECURITY_CLK_DISABLE (1 << 1) | ||
275 | |||
276 | /* TODO: other registers definitions if needed */ | ||
277 | |||
278 | #endif /* __MACH_GLOBAL_REG_H */ | ||
diff --git a/arch/arm/mach-gemini/include/mach/hardware.h b/arch/arm/mach-gemini/include/mach/hardware.h new file mode 100644 index 000000000000..de6752674c05 --- /dev/null +++ b/arch/arm/mach-gemini/include/mach/hardware.h | |||
@@ -0,0 +1,75 @@ | |||
1 | /* | ||
2 | * This file contains the hardware definitions for Gemini. | ||
3 | * | ||
4 | * Copyright (C) 2001-2006 Storlink, Corp. | ||
5 | * Copyright (C) 2008-2009 Paulius Zaleckas <paulius.zaleckas@teltonika.lt> | ||
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 as published by | ||
9 | * the Free Software Foundation; either version 2 of the License, or | ||
10 | * (at your option) any later version. | ||
11 | */ | ||
12 | #ifndef __MACH_HARDWARE_H | ||
13 | #define __MACH_HARDWARE_H | ||
14 | |||
15 | /* | ||
16 | * Memory Map definitions | ||
17 | */ | ||
18 | /* FIXME: Does it really swap SRAM like this? */ | ||
19 | #ifdef CONFIG_GEMINI_MEM_SWAP | ||
20 | # define GEMINI_DRAM_BASE 0x00000000 | ||
21 | # define GEMINI_SRAM_BASE 0x20000000 | ||
22 | #else | ||
23 | # define GEMINI_SRAM_BASE 0x00000000 | ||
24 | # define GEMINI_DRAM_BASE 0x10000000 | ||
25 | #endif | ||
26 | #define GEMINI_FLASH_BASE 0x30000000 | ||
27 | #define GEMINI_GLOBAL_BASE 0x40000000 | ||
28 | #define GEMINI_WAQTCHDOG_BASE 0x41000000 | ||
29 | #define GEMINI_UART_BASE 0x42000000 | ||
30 | #define GEMINI_TIMER_BASE 0x43000000 | ||
31 | #define GEMINI_LCD_BASE 0x44000000 | ||
32 | #define GEMINI_RTC_BASE 0x45000000 | ||
33 | #define GEMINI_SATA_BASE 0x46000000 | ||
34 | #define GEMINI_LPC_HOST_BASE 0x47000000 | ||
35 | #define GEMINI_LPC_IO_BASE 0x47800000 | ||
36 | #define GEMINI_INTERRUPT_BASE 0x48000000 | ||
37 | /* TODO: Different interrupt controlers when SMP | ||
38 | * #define GEMINI_INTERRUPT0_BASE 0x48000000 | ||
39 | * #define GEMINI_INTERRUPT1_BASE 0x49000000 | ||
40 | */ | ||
41 | #define GEMINI_SSP_CTRL_BASE 0x4A000000 | ||
42 | #define GEMINI_POWER_CTRL_BASE 0x4B000000 | ||
43 | #define GEMINI_CIR_BASE 0x4C000000 | ||
44 | #define GEMINI_GPIO_BASE(x) (0x4D000000 + (x) * 0x1000000) | ||
45 | #define GEMINI_PCI_IO_BASE 0x50000000 | ||
46 | #define GEMINI_PCI_MEM_BASE 0x58000000 | ||
47 | #define GEMINI_TOE_BASE 0x60000000 | ||
48 | #define GEMINI_GMAC0_BASE 0x6000A000 | ||
49 | #define GEMINI_GMAC1_BASE 0x6000E000 | ||
50 | #define GEMINI_SECURITY_BASE 0x62000000 | ||
51 | #define GEMINI_IDE0_BASE 0x63000000 | ||
52 | #define GEMINI_IDE1_BASE 0x63400000 | ||
53 | #define GEMINI_RAID_BASE 0x64000000 | ||
54 | #define GEMINI_FLASH_CTRL_BASE 0x65000000 | ||
55 | #define GEMINI_DRAM_CTRL_BASE 0x66000000 | ||
56 | #define GEMINI_GENERAL_DMA_BASE 0x67000000 | ||
57 | #define GEMINI_USB0_BASE 0x68000000 | ||
58 | #define GEMINI_USB1_BASE 0x69000000 | ||
59 | #define GEMINI_BIG_ENDIAN_BASE 0x80000000 | ||
60 | |||
61 | #define GEMINI_TIMER1_BASE GEMINI_TIMER_BASE | ||
62 | #define GEMINI_TIMER2_BASE (GEMINI_TIMER_BASE + 0x10) | ||
63 | #define GEMINI_TIMER3_BASE (GEMINI_TIMER_BASE + 0x20) | ||
64 | |||
65 | /* | ||
66 | * UART Clock when System clk is 150MHz | ||
67 | */ | ||
68 | #define UART_CLK 48000000 | ||
69 | |||
70 | /* | ||
71 | * macro to get at IO space when running virtually | ||
72 | */ | ||
73 | #define IO_ADDRESS(x) ((((x) & 0xFFF00000) >> 4) | ((x) & 0x000FFFFF) | 0xF0000000) | ||
74 | |||
75 | #endif | ||
diff --git a/arch/arm/mach-gemini/include/mach/io.h b/arch/arm/mach-gemini/include/mach/io.h new file mode 100644 index 000000000000..c548056b98b2 --- /dev/null +++ b/arch/arm/mach-gemini/include/mach/io.h | |||
@@ -0,0 +1,18 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2001-2006 Storlink, Corp. | ||
3 | * Copyright (C) 2008-2009 Paulius Zaleckas <paulius.zaleckas@teltonika.lt> | ||
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 as published by | ||
7 | * the Free Software Foundation; either version 2 of the License, or | ||
8 | * (at your option) any later version. | ||
9 | */ | ||
10 | #ifndef __MACH_IO_H | ||
11 | #define __MACH_IO_H | ||
12 | |||
13 | #define IO_SPACE_LIMIT 0xffffffff | ||
14 | |||
15 | #define __io(a) __typesafe_io(a) | ||
16 | #define __mem_pci(a) (a) | ||
17 | |||
18 | #endif /* __MACH_IO_H */ | ||
diff --git a/arch/arm/mach-gemini/include/mach/irqs.h b/arch/arm/mach-gemini/include/mach/irqs.h new file mode 100644 index 000000000000..c7728ac458f3 --- /dev/null +++ b/arch/arm/mach-gemini/include/mach/irqs.h | |||
@@ -0,0 +1,50 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2001-2006 Storlink, Corp. | ||
3 | * Copyright (C) 2008-2009 Paulius Zaleckas <paulius.zaleckas@teltonika.lt> | ||
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 as published by | ||
7 | * the Free Software Foundation; either version 2 of the License, or | ||
8 | * (at your option) any later version. | ||
9 | */ | ||
10 | |||
11 | #ifndef __MACH_IRQS_H__ | ||
12 | #define __MACH_IRQS_H__ | ||
13 | |||
14 | #define IRQ_SERIRQ1 31 | ||
15 | #define IRQ_SERIRQ0 30 | ||
16 | #define IRQ_PCID 29 | ||
17 | #define IRQ_PCIC 28 | ||
18 | #define IRQ_PCIB 27 | ||
19 | #define IRQ_PWR 26 | ||
20 | #define IRQ_CIR 25 | ||
21 | #define IRQ_GPIO(x) (22 + (x)) | ||
22 | #define IRQ_SSP 21 | ||
23 | #define IRQ_LPC 20 | ||
24 | #define IRQ_LCD 19 | ||
25 | #define IRQ_UART 18 | ||
26 | #define IRQ_RTC 17 | ||
27 | #define IRQ_TIMER3 16 | ||
28 | #define IRQ_TIMER2 15 | ||
29 | #define IRQ_TIMER1 14 | ||
30 | #define IRQ_FLASH 12 | ||
31 | #define IRQ_USB1 11 | ||
32 | #define IRQ_USB0 10 | ||
33 | #define IRQ_DMA 9 | ||
34 | #define IRQ_PCI 8 | ||
35 | #define IRQ_IPSEC 7 | ||
36 | #define IRQ_RAID 6 | ||
37 | #define IRQ_IDE1 5 | ||
38 | #define IRQ_IDE0 4 | ||
39 | #define IRQ_WATCHDOG 3 | ||
40 | #define IRQ_GMAC1 2 | ||
41 | #define IRQ_GMAC0 1 | ||
42 | #define IRQ_IPI 0 | ||
43 | |||
44 | #define NORMAL_IRQ_NUM 32 | ||
45 | |||
46 | #define ARCH_TIMER_IRQ IRQ_TIMER2 | ||
47 | |||
48 | #define NR_IRQS NORMAL_IRQ_NUM | ||
49 | |||
50 | #endif /* __MACH_IRQS_H__ */ | ||
diff --git a/arch/arm/mach-gemini/include/mach/memory.h b/arch/arm/mach-gemini/include/mach/memory.h new file mode 100644 index 000000000000..2d14d5bf1f9f --- /dev/null +++ b/arch/arm/mach-gemini/include/mach/memory.h | |||
@@ -0,0 +1,19 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2001-2006 Storlink, Corp. | ||
3 | * Copyright (C) 2008-2009 Paulius Zaleckas <paulius.zaleckas@teltonika.lt> | ||
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 as published by | ||
7 | * the Free Software Foundation; either version 2 of the License, or | ||
8 | * (at your option) any later version. | ||
9 | */ | ||
10 | #ifndef __MACH_MEMORY_H | ||
11 | #define __MACH_MEMORY_H | ||
12 | |||
13 | #ifdef CONFIG_GEMINI_MEM_SWAP | ||
14 | # define PHYS_OFFSET UL(0x00000000) | ||
15 | #else | ||
16 | # define PHYS_OFFSET UL(0x10000000) | ||
17 | #endif | ||
18 | |||
19 | #endif /* __MACH_MEMORY_H */ | ||
diff --git a/arch/arm/mach-gemini/include/mach/system.h b/arch/arm/mach-gemini/include/mach/system.h new file mode 100644 index 000000000000..bbbd72767a02 --- /dev/null +++ b/arch/arm/mach-gemini/include/mach/system.h | |||
@@ -0,0 +1,37 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2001-2006 Storlink, Corp. | ||
3 | * Copyright (C) 2008-2009 Paulius Zaleckas <paulius.zaleckas@teltonika.lt> | ||
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 as published by | ||
7 | * the Free Software Foundation; either version 2 of the License, or | ||
8 | * (at your option) any later version. | ||
9 | */ | ||
10 | #ifndef __MACH_SYSTEM_H | ||
11 | #define __MACH_SYSTEM_H | ||
12 | |||
13 | #include <linux/io.h> | ||
14 | #include <mach/hardware.h> | ||
15 | #include <mach/global_reg.h> | ||
16 | |||
17 | static inline void arch_idle(void) | ||
18 | { | ||
19 | /* | ||
20 | * Because of broken hardware we have to enable interrupts or the CPU | ||
21 | * will never wakeup... Acctualy it is not very good to enable | ||
22 | * interrupts here since scheduler can miss a tick, but there is | ||
23 | * no other way around this. Platforms that needs it for power saving | ||
24 | * should call enable_hlt() in init code, since by default it is | ||
25 | * disabled. | ||
26 | */ | ||
27 | local_irq_enable(); | ||
28 | cpu_do_idle(); | ||
29 | } | ||
30 | |||
31 | static inline void arch_reset(char mode) | ||
32 | { | ||
33 | __raw_writel(RESET_GLOBAL | RESET_CPU1, | ||
34 | IO_ADDRESS(GEMINI_GLOBAL_BASE) + GLOBAL_RESET); | ||
35 | } | ||
36 | |||
37 | #endif /* __MACH_SYSTEM_H */ | ||
diff --git a/arch/arm/mach-gemini/include/mach/timex.h b/arch/arm/mach-gemini/include/mach/timex.h new file mode 100644 index 000000000000..dc5690ba975c --- /dev/null +++ b/arch/arm/mach-gemini/include/mach/timex.h | |||
@@ -0,0 +1,13 @@ | |||
1 | /* | ||
2 | * Gemini timex specifications | ||
3 | * | ||
4 | * Copyright (C) 2008-2009 Paulius Zaleckas <paulius.zaleckas@teltonika.lt> | ||
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 as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | */ | ||
11 | |||
12 | /* When AHB bus frequency is 150MHz */ | ||
13 | #define CLOCK_TICK_RATE 38000000 | ||
diff --git a/arch/arm/mach-gemini/include/mach/uncompress.h b/arch/arm/mach-gemini/include/mach/uncompress.h new file mode 100644 index 000000000000..59c5df7e716c --- /dev/null +++ b/arch/arm/mach-gemini/include/mach/uncompress.h | |||
@@ -0,0 +1,42 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2008-2009 Paulius Zaleckas <paulius.zaleckas@teltonika.lt> | ||
3 | * | ||
4 | * Based on mach-pxa/include/mach/uncompress.h: | ||
5 | * Copyright: (C) 2001 MontaVista Software Inc. | ||
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 as published by | ||
9 | * the Free Software Foundation; either version 2 of the License, or | ||
10 | * (at your option) any later version. | ||
11 | */ | ||
12 | |||
13 | #ifndef __MACH_UNCOMPRESS_H | ||
14 | #define __MACH_UNCOMPRESS_H | ||
15 | |||
16 | #include <linux/serial_reg.h> | ||
17 | #include <mach/hardware.h> | ||
18 | |||
19 | static volatile unsigned long *UART = (unsigned long *)GEMINI_UART_BASE; | ||
20 | |||
21 | /* | ||
22 | * The following code assumes the serial port has already been | ||
23 | * initialized by the bootloader. If you didn't setup a port in | ||
24 | * your bootloader then nothing will appear (which might be desired). | ||
25 | */ | ||
26 | static inline void putc(char c) | ||
27 | { | ||
28 | while (!(UART[UART_LSR] & UART_LSR_THRE)) | ||
29 | barrier(); | ||
30 | UART[UART_TX] = c; | ||
31 | } | ||
32 | |||
33 | #define flush() do { } while (0) | ||
34 | |||
35 | /* | ||
36 | * nothing to do | ||
37 | */ | ||
38 | #define arch_decomp_setup() | ||
39 | |||
40 | #define arch_decomp_wdog() | ||
41 | |||
42 | #endif /* __MACH_UNCOMPRESS_H */ | ||
diff --git a/arch/arm/mach-gemini/include/mach/vmalloc.h b/arch/arm/mach-gemini/include/mach/vmalloc.h new file mode 100644 index 000000000000..83e536d9436c --- /dev/null +++ b/arch/arm/mach-gemini/include/mach/vmalloc.h | |||
@@ -0,0 +1,10 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2008-2009 Paulius Zaleckas <paulius.zaleckas@teltonika.lt> | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License as published by | ||
6 | * the Free Software Foundation; either version 2 of the License, or | ||
7 | * (at your option) any later version. | ||
8 | */ | ||
9 | |||
10 | #define VMALLOC_END 0xF0000000 | ||