sync hh.org
[hh.org.git] / arch / arm / mach-pxa / rover / roverp5p.c
blob9266a800b7ea56b826a3699acae25ab0f1e3cabf
1 /*
2 * Machine initialization for Rover P5+
4 * Authors: Konstantine A. Beklemishev konstantine@r66.ru
5 */
7 #include <linux/module.h>
8 #include <linux/init.h>
9 #include <linux/interrupt.h>
10 //#include <linux/fb.h>
11 #include <linux/ioport.h>
13 #include <asm/mach/arch.h>
14 #include <asm/mach/map.h>
15 #include <asm/mach-types.h>
17 #include <asm/setup.h>
18 #include <asm/io.h>
19 #include <asm/irq.h>
20 #include <asm/hardware.h>
22 #include <asm/arch/irqs.h>
23 #include <asm/arch/roverp5p-init.h>
24 #include <asm/arch/roverp5p-gpio.h>
26 //#include "../drivers/video/pxafb.h"
27 #include "../drivers/soc/mq11xx.h"
29 #define MQ_BASE 0x14000000
30 #include "../generic.h"
32 #if 0
34 /* MediaQ 1188 init state */
35 static struct mediaq11xx_init_data mq1188_init_data = {
36 /*DC*/
38 /*DC0x0*/ 0x00000001,
39 /*DC0x1*/ 0x00000043,
40 /*DC0x2*/ 0x00000001,
41 /*DC0x3*/ 0x00000008,
42 /*DC0x4*/ 0x00180004,
43 /*DC0x5*/ 0x00000007,
45 /*CC*/
47 /*CC0x0*/ 0x00000002,
48 /*CC0x1*/ 0x00201010,
49 /*CC0x2*/ 0x00a00a10,
50 /*CC0x3*/ 0x1a000200,
51 /*CC0x4*/ 0x00000004,
53 /*MIU*/
55 /*MIU0x0*/ 0x00000001,
56 /*MIU0x1*/ 0x1b676ca0,
57 /*MIU0x2*/ 0x117700b0,
58 /*MIU0x3*/ 0x00000000,
59 /*MIU0x4*/ 0x00000000,
60 /*MIU0x5*/ 0x00170211,
61 /*MIU0x6*/ 0x00000000,
63 /*GC*/
65 /*GC0x0*/ 0x080100c8,
66 /*GC0x1*/ 0x00000200,
67 /*GC0x2*/ 0x00f5011a,
68 /*GC0x3*/ 0x013f014c,
69 /*GC0x4*/ 0x010e0108,
70 /*GC0x5*/ 0x01470146,
71 /*GC0x6*/ 0x010b0000,
72 /*GC0x7*/ 0x010d0000,
73 /*GC0x8*/ 0x00ef0004,
74 /*GC0x9*/ 0x013f0000,
75 /*GC0xa*/ 0x0113010e,
76 /*GC0xb*/ 0x00a78043,
77 /*GC0xc*/ 0x00000000,
78 /*GC0xd*/ 0x00000000,
79 /*GC0xe*/ 0x000001e0,
80 /*GC0xf*/ 0x00000000,
81 /*GC0x10*/ 0x00000000,
82 /*GC0x11*/ 0x000000ff,
83 /*GC0x12*/ 0x00000000,
84 /*GC0x13*/ 0x00000000,
85 /*GC0x14*/ 0x00000000,
86 /*GC0x15*/ 0x00000000,
87 /*GC0x16*/ 0x00000000,
88 /*GC0x17*/ 0x00000000,
89 /*GC0x18*/ 0x00000000,
90 /*GC0x19*/ 0x00000000,
91 /*GC0x1a*/ 0x00000000,
93 /*FP*/
95 /*FP0x0*/ 0x00006120,
96 /*FP0x1*/ 0x071c9008,
97 /*FP0x2*/ 0xdffdfcff,
98 /*FP0x3*/ 0x00000000,
99 /*FP0x4*/ 0x00bd0001,
100 /*FP0x5*/ 0x80010000,
101 /*FP0x6*/ 0x80000000,
102 /*FP0x7*/ 0x00000000,
103 /*FP0x8*/ 0x8fadb76e,
104 /*FP0x9*/ 0xfffffdff,
105 /*FP0xa*/ 0x00000000,
106 /*FP0xb*/ 0x00000000,
107 /*FP0xc*/ 0x00000003,
108 /*FP0xd*/ 0x00000000,
109 /*FP0xe*/ 0x00000000,
110 /*FP0xf*/ 0x00005fa0,
111 /*FP0x10*/ 0x9edffafb,
112 /*FP0x11*/ 0x9ffddffb,
113 /*FP0x12*/ 0xfbefffae,
114 /*FP0x13*/ 0xfdb6179c,
115 /*FP0x14*/ 0xee7d5d68,
116 /*FP0x15*/ 0xfff793dc,
117 /*FP0x16*/ 0xe2fdfdd7,
118 /*FP0x17*/ 0x2b726d5b,
119 /*FP0x18*/ 0x785f3b0c,
120 /*FP0x19*/ 0xbfee6fdb,
121 /*FP0x1a*/ 0x7ed7eaeb,
122 /*FP0x1b*/ 0xad4bff57,
123 /*FP0x1c*/ 0x7fa96377,
124 /*FP0x1d*/ 0x73e72bf8,
125 /*FP0x1e*/ 0xfddddf5d,
126 /*FP0x1f*/ 0xeeeefee7,
127 /*FP0x20*/ 0xfff6d4bf,
128 /*FP0x21*/ 0x67f1ab2f,
129 /*FP0x22*/ 0xd6fbdddd,
130 /*FP0x23*/ 0xbe76bcff,
131 /*FP0x24*/ 0xbcd7fefe,
132 /*FP0x25*/ 0xdf7318ff,
133 /*FP0x26*/ 0xe838b777,
134 /*FP0x27*/ 0x35d4dbb3,
135 /*FP0x28*/ 0x3c6f9bfa,
136 /*FP0x29*/ 0x795ffb6d,
137 /*FP0x2a*/ 0x7f7df49f,
138 /*FP0x2b*/ 0xfe169e7d,
139 /*FP0x2c*/ 0xeebdf697,
140 /*FP0x2d*/ 0x3b5da966,
141 /*FP0x2e*/ 0xa7b7932e,
142 /*FP0x2f*/ 0x4d7bbf68,
143 /*FP0x30*/ 0x5afc7dfd,
144 /*FP0x31*/ 0x5f353796,
145 /*FP0x32*/ 0x03ad77dd,
146 /*FP0x33*/ 0xf56b9ddc,
147 /*FP0x34*/ 0xbff7a7ed,
148 /*FP0x35*/ 0x97b1fb9b,
149 /*FP0x36*/ 0xdbb36dff,
150 /*FP0x37*/ 0xdbddfff3,
151 /*FP0x38*/ 0xb49f0000,
152 /*FP0x39*/ 0x00007d53,
153 /*FP0x3a*/ 0x0000b8f7,
154 /*FP0x3b*/ 0x0000378a,
155 /*FP0x3c*/ 0xbdb8ffef,
156 /*FP0x3d*/ 0xf37fef8d,
157 /*FP0x3e*/ 0x39ff7cd0,
158 /*FP0x3f*/ 0xb96de15c,
159 /*FP0x40*/ 0x00000000,
160 /*FP0x41*/ 0x00000000,
161 /*FP0x42*/ 0x00000000,
162 /*FP0x43*/ 0x00000000,
163 /*FP0x44*/ 0x00000000,
164 /*FP0x45*/ 0x00000000,
165 /*FP0x46*/ 0x00000000,
166 /*FP0x47*/ 0x00000000,
167 /*FP0x48*/ 0x00000000,
168 /*FP0x49*/ 0x00000000,
169 /*FP0x4a*/ 0x00000000,
170 /*FP0x4b*/ 0x00000000,
171 /*FP0x4c*/ 0x00000000,
172 /*FP0x4d*/ 0x00000000,
173 /*FP0x4e*/ 0x00000000,
174 /*FP0x4f*/ 0x00000000,
175 /*FP0x50*/ 0x00000000,
176 /*FP0x51*/ 0x00000000,
177 /*FP0x52*/ 0x00000000,
178 /*FP0x53*/ 0x00000000,
179 /*FP0x54*/ 0x00000000,
180 /*FP0x55*/ 0x00000000,
181 /*FP0x56*/ 0x00000000,
182 /*FP0x57*/ 0x00000000,
183 /*FP0x58*/ 0x00000000,
184 /*FP0x59*/ 0x00000000,
185 /*FP0x5a*/ 0x00000000,
186 /*FP0x5b*/ 0x00000000,
187 /*FP0x5c*/ 0x00000000,
188 /*FP0x5d*/ 0x00000000,
189 /*FP0x5e*/ 0x00000000,
190 /*FP0x5f*/ 0x00000000,
191 /*FP0x60*/ 0x00000000,
192 /*FP0x61*/ 0x00000000,
193 /*FP0x62*/ 0x00000000,
194 /*FP0x63*/ 0x00000000,
195 /*FP0x64*/ 0x00000000,
196 /*FP0x65*/ 0x00000000,
197 /*FP0x66*/ 0x00000000,
198 /*FP0x67*/ 0x00000000,
199 /*FP0x68*/ 0x00000000,
200 /*FP0x69*/ 0x00000000,
201 /*FP0x6a*/ 0x00000000,
202 /*FP0x6b*/ 0x00000000,
203 /*FP0x6c*/ 0x00000000,
204 /*FP0x6d*/ 0x00000000,
205 /*FP0x6e*/ 0x00000000,
206 /*FP0x6f*/ 0x00000000,
207 /*FP0x70*/ 0x00000000,
208 /*FP0x71*/ 0x00000000,
209 /*FP0x72*/ 0x00000000,
210 /*FP0x73*/ 0x00000000,
211 /*FP0x74*/ 0x00000000,
212 /*FP0x75*/ 0x00000000,
213 /*FP0x76*/ 0x00000000,
214 /*FP0x77*/ 0x00000000,
216 /*GE*/
218 /*GE0x0*/ 0x00000008,
219 /*GE0x1*/ 0x00000000,
220 /*GE0x2*/ 0x00000000,
221 /*GE0x3*/ 0x00000000,
222 /*GE0x4*/ 0x00000000,
223 /*GE0x5*/ 0x00000000,
224 /*GE0x6*/ 0x00000000,
225 /*GE0x7*/ 0x00001400,
226 /*GE0x8*/ 0x93edfd2f,
227 /*GE0x9*/ 0x00000000,
228 /*GE0xa*/ 0x00000000,
229 /*GE0xb*/ 0x00000000,
233 static void __init roverp5p_init_irq (void)
235 /* Initialize standard IRQs */
236 pxa_init_irq();
237 // printk("init_irq done \n");
241 //#ifdef DEBUG
242 /* A debug mapping giving access to the screen RAM */
243 //static struct map_desc roverp5p_io_desc[] __initdata = {
244 /*virtual physical length domain */
245 // { 0xf0000000, 0x0c100000, 0x02000000, DOMAIN_IO}
246 //};
247 //#endif
249 static void __init roverp5p_map_io(void)
251 /* Initialize standard IO maps */
252 pxa_map_io();
253 //#ifdef DEBUG
254 // iotable_init(roverp5p_io_desc, ARRAY_SIZE(roverp5p_io_desc));
255 //#endif
256 /* Configure power management stuff. */
257 PWER = PWER_GPIO0 | PWER_RTC;
258 PFER = PWER_GPIO0 | PWER_RTC;
259 PRER = 0;
260 PCFR = PCFR_OPDE;
261 CKEN = CKEN6_FFUART;
263 PGSR0 = GPSRx_SleepValue;
264 PGSR1 = GPSRy_SleepValue;
265 PGSR2 = GPSRz_SleepValue;
267 /* Set up GPIO direction and alternate function registers */
268 GAFR0_L = GAFR0x_InitValue;
269 GAFR0_U = GAFR1x_InitValue;
270 GAFR1_L = GAFR0y_InitValue;
271 GAFR1_U = GAFR1y_InitValue;
272 GAFR2_L = GAFR0z_InitValue;
273 GAFR2_U = GAFR1z_InitValue;
275 GPDR0 = GPDRx_InitValue;
276 GPDR1 = GPDRy_InitValue;
277 GPDR2 = GPDRz_InitValue;
279 GPSR0 = GPSRx_InitValue;
280 GPSR1 = GPSRy_InitValue;
281 GPSR2 = GPSRz_InitValue;
283 GPCR0 = ~GPSRx_InitValue;
284 GPCR1 = ~GPSRy_InitValue;
285 GPCR2 = ~GPSRz_InitValue;
287 // GPCR0 = 0x0fffffff; /* All outputs are set low by default */
288 // printk("map_io done \n");
291 static struct resource mq1188_resources[] = {
292 /* Synchronous memory */
293 [0] = {
294 .start = MQ_BASE,
295 .end = MQ_BASE + MQ11xx_FB_SIZE - 1,
296 .flags = IORESOURCE_MEM,
298 /* Non-synchronous memory */
299 [1] = {
300 .start = MQ_BASE + MQ11xx_FB_SIZE + MQ11xx_REG_SIZE,
301 .end = MQ_BASE + MQ11xx_FB_SIZE * 2 - 1,
302 .flags = IORESOURCE_MEM,
304 /* MediaQ registers */
305 [2] = {
306 .start = MQ_BASE + MQ11xx_FB_SIZE,
307 .end = MQ_BASE + MQ11xx_FB_SIZE + MQ11xx_REG_SIZE - 1,
308 .flags = IORESOURCE_MEM,
310 /* MediaQ interrupt number */
311 [3] = {
312 .start = IRQ_GPIO (GPIO_NR_ROVERP5P_PXA_nMQINT),
313 .flags = IORESOURCE_IRQ,
317 struct platform_device roverp5p_mq1188 = {
318 .name = "mq11xx",
319 .id = 0,
320 .num_resources = ARRAY_SIZE(mq1188_resources),
321 .resource = mq1188_resources,
322 .dev = {
323 .platform_data = &mq1188_init_data,
327 static void __init roverp5p_init (void)
329 platform_device_register (&roverp5p_mq1188);
330 // memset ((void *)0x14000000, 0x99, 320*200*2);
331 // printk("mach_init done \n");
334 MACHINE_START(ROVERP5P, "Rover Rover P5+")
335 /* Maintainer Konstantine A. Beklemishev */
336 .phys_ram = 0xa0000000,
337 .phys_io = 0x40000000,
338 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
339 .boot_params = 0xa0000100,
340 .map_io = roverp5p_map_io,
341 .init_irq = roverp5p_init_irq,
342 .init_machine = roverp5p_init,
343 MACHINE_END
345 #endif