Commit | Line | Data |
---|---|---|
95790873 CW |
1 | /* Machine specific code for the Acer n30, Acer N35, Navman PiN 570, |
2 | * Yakumo AlphaX and Airis NC05 PDAs. | |
1da177e4 LT |
3 | * |
4 | * Copyright (c) 2003-2005 Simtec Electronics | |
5 | * Ben Dooks <ben@simtec.co.uk> | |
6 | * | |
196a0475 | 7 | * Copyright (c) 2005-2008 Christer Weinigel <christer@weinigel.se> |
1da177e4 LT |
8 | * |
9 | * There is a wiki with more information about the n30 port at | |
10 | * http://handhelds.org/moin/moin.cgi/AcerN30Documentation . | |
11 | * | |
12 | * This program is free software; you can redistribute it and/or modify | |
13 | * it under the terms of the GNU General Public License version 2 as | |
14 | * published by the Free Software Foundation. | |
95790873 | 15 | */ |
1da177e4 LT |
16 | |
17 | #include <linux/kernel.h> | |
18 | #include <linux/types.h> | |
196a0475 | 19 | |
62065750 | 20 | #include <linux/gpio_keys.h> |
196a0475 | 21 | #include <linux/init.h> |
ec976d6e | 22 | #include <linux/gpio.h> |
62065750 | 23 | #include <linux/input.h> |
196a0475 | 24 | #include <linux/interrupt.h> |
d052d1be | 25 | #include <linux/platform_device.h> |
196a0475 CW |
26 | #include <linux/serial_core.h> |
27 | #include <linux/timer.h> | |
fced80c7 | 28 | #include <linux/io.h> |
50cdba78 | 29 | #include <linux/mmc/host.h> |
1da177e4 | 30 | |
a09e64fb | 31 | #include <mach/hardware.h> |
1da177e4 LT |
32 | #include <asm/irq.h> |
33 | #include <asm/mach-types.h> | |
34 | ||
a09e64fb RK |
35 | #include <mach/fb.h> |
36 | #include <mach/leds-gpio.h> | |
37 | #include <mach/regs-gpio.h> | |
38 | #include <mach/regs-lcd.h> | |
196a0475 CW |
39 | |
40 | #include <asm/mach/arch.h> | |
41 | #include <asm/mach/irq.h> | |
42 | #include <asm/mach/map.h> | |
43 | ||
9498cb79 | 44 | #include <plat/iic.h> |
a2b7ba9c | 45 | #include <plat/regs-serial.h> |
1da177e4 | 46 | |
d5120ae7 | 47 | #include <plat/clock.h> |
a2b7ba9c BD |
48 | #include <plat/cpu.h> |
49 | #include <plat/devs.h> | |
50cdba78 | 50 | #include <plat/mci.h> |
a2b7ba9c | 51 | #include <plat/s3c2410.h> |
57bd4b91 | 52 | #include <plat/udc.h> |
1da177e4 LT |
53 | |
54 | static struct map_desc n30_iodesc[] __initdata = { | |
55 | /* nothing here yet */ | |
56 | }; | |
57 | ||
58 | static struct s3c2410_uartcfg n30_uartcfgs[] = { | |
59 | /* Normal serial port */ | |
60 | [0] = { | |
61 | .hwport = 0, | |
62 | .flags = 0, | |
63 | .ucon = 0x2c5, | |
64 | .ulcon = 0x03, | |
65 | .ufcon = 0x51, | |
66 | }, | |
67 | /* IR port */ | |
68 | [1] = { | |
69 | .hwport = 1, | |
70 | .flags = 0, | |
71 | .uart_flags = UPF_CONS_FLOW, | |
72 | .ucon = 0x2c5, | |
73 | .ulcon = 0x43, | |
74 | .ufcon = 0x51, | |
75 | }, | |
95790873 CW |
76 | /* On the N30 the bluetooth controller is connected here. |
77 | * On the N35 and variants the GPS receiver is connected here. */ | |
1da177e4 LT |
78 | [2] = { |
79 | .hwport = 2, | |
80 | .flags = 0, | |
81 | .ucon = 0x2c5, | |
82 | .ulcon = 0x03, | |
83 | .ufcon = 0x51, | |
84 | }, | |
85 | }; | |
86 | ||
d088e5fe CW |
87 | static void n30_udc_pullup(enum s3c2410_udc_cmd_e cmd) |
88 | { | |
a6755780 BD |
89 | switch (cmd) { |
90 | case S3C2410_UDC_P_ENABLE : | |
070276d5 | 91 | s3c2410_gpio_setpin(S3C2410_GPB(3), 1); |
a6755780 BD |
92 | break; |
93 | case S3C2410_UDC_P_DISABLE : | |
070276d5 | 94 | s3c2410_gpio_setpin(S3C2410_GPB(3), 0); |
a6755780 BD |
95 | break; |
96 | case S3C2410_UDC_P_RESET : | |
97 | break; | |
98 | default: | |
99 | break; | |
d088e5fe CW |
100 | } |
101 | } | |
102 | ||
103 | static struct s3c2410_udc_mach_info n30_udc_cfg __initdata = { | |
104 | .udc_command = n30_udc_pullup, | |
070276d5 | 105 | .vbus_pin = S3C2410_GPG(1), |
d088e5fe CW |
106 | .vbus_pin_inverted = 0, |
107 | }; | |
108 | ||
62065750 CW |
109 | static struct gpio_keys_button n30_buttons[] = { |
110 | { | |
070276d5 | 111 | .gpio = S3C2410_GPF(0), |
62065750 CW |
112 | .code = KEY_POWER, |
113 | .desc = "Power", | |
114 | .active_low = 0, | |
115 | }, | |
116 | { | |
070276d5 | 117 | .gpio = S3C2410_GPG(9), |
62065750 CW |
118 | .code = KEY_UP, |
119 | .desc = "Thumbwheel Up", | |
120 | .active_low = 0, | |
121 | }, | |
122 | { | |
070276d5 | 123 | .gpio = S3C2410_GPG(8), |
62065750 CW |
124 | .code = KEY_DOWN, |
125 | .desc = "Thumbwheel Down", | |
126 | .active_low = 0, | |
127 | }, | |
128 | { | |
070276d5 | 129 | .gpio = S3C2410_GPG(7), |
62065750 CW |
130 | .code = KEY_ENTER, |
131 | .desc = "Thumbwheel Press", | |
132 | .active_low = 0, | |
133 | }, | |
134 | { | |
070276d5 | 135 | .gpio = S3C2410_GPF(7), |
62065750 CW |
136 | .code = KEY_HOMEPAGE, |
137 | .desc = "Home", | |
138 | .active_low = 0, | |
139 | }, | |
140 | { | |
070276d5 | 141 | .gpio = S3C2410_GPF(6), |
62065750 CW |
142 | .code = KEY_CALENDAR, |
143 | .desc = "Calendar", | |
144 | .active_low = 0, | |
145 | }, | |
146 | { | |
070276d5 | 147 | .gpio = S3C2410_GPF(5), |
62065750 CW |
148 | .code = KEY_ADDRESSBOOK, |
149 | .desc = "Contacts", | |
150 | .active_low = 0, | |
151 | }, | |
152 | { | |
070276d5 | 153 | .gpio = S3C2410_GPF(4), |
62065750 CW |
154 | .code = KEY_MAIL, |
155 | .desc = "Mail", | |
156 | .active_low = 0, | |
157 | }, | |
158 | }; | |
159 | ||
160 | static struct gpio_keys_platform_data n30_button_data = { | |
161 | .buttons = n30_buttons, | |
162 | .nbuttons = ARRAY_SIZE(n30_buttons), | |
163 | }; | |
164 | ||
165 | static struct platform_device n30_button_device = { | |
166 | .name = "gpio-keys", | |
167 | .id = -1, | |
168 | .dev = { | |
169 | .platform_data = &n30_button_data, | |
170 | } | |
171 | }; | |
172 | ||
95790873 CW |
173 | static struct gpio_keys_button n35_buttons[] = { |
174 | { | |
070276d5 | 175 | .gpio = S3C2410_GPF(0), |
95790873 | 176 | .code = KEY_POWER, |
aeb1b7e4 | 177 | .type = EV_PWR, |
95790873 CW |
178 | .desc = "Power", |
179 | .active_low = 0, | |
aeb1b7e4 | 180 | .wakeup = 1, |
95790873 CW |
181 | }, |
182 | { | |
070276d5 | 183 | .gpio = S3C2410_GPG(9), |
95790873 CW |
184 | .code = KEY_UP, |
185 | .desc = "Joystick Up", | |
186 | .active_low = 0, | |
187 | }, | |
188 | { | |
070276d5 | 189 | .gpio = S3C2410_GPG(8), |
95790873 CW |
190 | .code = KEY_DOWN, |
191 | .desc = "Joystick Down", | |
192 | .active_low = 0, | |
193 | }, | |
194 | { | |
070276d5 | 195 | .gpio = S3C2410_GPG(6), |
95790873 CW |
196 | .code = KEY_DOWN, |
197 | .desc = "Joystick Left", | |
198 | .active_low = 0, | |
199 | }, | |
200 | { | |
070276d5 | 201 | .gpio = S3C2410_GPG(5), |
95790873 CW |
202 | .code = KEY_DOWN, |
203 | .desc = "Joystick Right", | |
204 | .active_low = 0, | |
205 | }, | |
206 | { | |
070276d5 | 207 | .gpio = S3C2410_GPG(7), |
95790873 CW |
208 | .code = KEY_ENTER, |
209 | .desc = "Joystick Press", | |
210 | .active_low = 0, | |
211 | }, | |
212 | { | |
070276d5 | 213 | .gpio = S3C2410_GPF(7), |
95790873 CW |
214 | .code = KEY_HOMEPAGE, |
215 | .desc = "Home", | |
216 | .active_low = 0, | |
217 | }, | |
218 | { | |
070276d5 | 219 | .gpio = S3C2410_GPF(6), |
95790873 CW |
220 | .code = KEY_CALENDAR, |
221 | .desc = "Calendar", | |
222 | .active_low = 0, | |
223 | }, | |
224 | { | |
070276d5 | 225 | .gpio = S3C2410_GPF(5), |
95790873 CW |
226 | .code = KEY_ADDRESSBOOK, |
227 | .desc = "Contacts", | |
228 | .active_low = 0, | |
229 | }, | |
230 | { | |
070276d5 | 231 | .gpio = S3C2410_GPF(4), |
95790873 CW |
232 | .code = KEY_MAIL, |
233 | .desc = "Mail", | |
234 | .active_low = 0, | |
235 | }, | |
236 | { | |
070276d5 | 237 | .gpio = S3C2410_GPF(3), |
95790873 CW |
238 | .code = SW_RADIO, |
239 | .desc = "GPS Antenna", | |
240 | .active_low = 0, | |
241 | }, | |
242 | { | |
070276d5 | 243 | .gpio = S3C2410_GPG(2), |
95790873 CW |
244 | .code = SW_HEADPHONE_INSERT, |
245 | .desc = "Headphone", | |
246 | .active_low = 0, | |
247 | }, | |
248 | }; | |
249 | ||
250 | static struct gpio_keys_platform_data n35_button_data = { | |
251 | .buttons = n35_buttons, | |
252 | .nbuttons = ARRAY_SIZE(n35_buttons), | |
253 | }; | |
254 | ||
255 | static struct platform_device n35_button_device = { | |
256 | .name = "gpio-keys", | |
257 | .id = -1, | |
258 | .num_resources = 0, | |
259 | .dev = { | |
260 | .platform_data = &n35_button_data, | |
261 | } | |
262 | }; | |
263 | ||
865cc639 CW |
264 | /* This is the bluetooth LED on the device. */ |
265 | static struct s3c24xx_led_platdata n30_blue_led_pdata = { | |
266 | .name = "blue_led", | |
070276d5 | 267 | .gpio = S3C2410_GPG(6), |
865cc639 CW |
268 | .def_trigger = "", |
269 | }; | |
270 | ||
319887ee P |
271 | /* This is the blue LED on the device. Originaly used to indicate GPS activity |
272 | * by flashing. */ | |
273 | static struct s3c24xx_led_platdata n35_blue_led_pdata = { | |
274 | .name = "blue_led", | |
275 | .gpio = S3C2410_GPD(8), | |
276 | .def_trigger = "", | |
277 | }; | |
278 | ||
865cc639 CW |
279 | /* This LED is driven by the battery microcontroller, and is blinking |
280 | * red, blinking green or solid green when the battery is low, | |
281 | * charging or full respectively. By driving GPD9 low, it's possible | |
282 | * to force the LED to blink red, so call that warning LED. */ | |
283 | static struct s3c24xx_led_platdata n30_warning_led_pdata = { | |
284 | .name = "warning_led", | |
285 | .flags = S3C24XX_LEDF_ACTLOW, | |
070276d5 | 286 | .gpio = S3C2410_GPD(9), |
865cc639 CW |
287 | .def_trigger = "", |
288 | }; | |
289 | ||
319887ee P |
290 | static struct s3c24xx_led_platdata n35_warning_led_pdata = { |
291 | .name = "warning_led", | |
292 | .flags = S3C24XX_LEDF_ACTLOW | S3C24XX_LEDF_TRISTATE, | |
293 | .gpio = S3C2410_GPD(9), | |
294 | .def_trigger = "", | |
295 | }; | |
296 | ||
865cc639 CW |
297 | static struct platform_device n30_blue_led = { |
298 | .name = "s3c24xx_led", | |
299 | .id = 1, | |
300 | .dev = { | |
301 | .platform_data = &n30_blue_led_pdata, | |
302 | }, | |
303 | }; | |
304 | ||
319887ee P |
305 | static struct platform_device n35_blue_led = { |
306 | .name = "s3c24xx_led", | |
307 | .id = 1, | |
308 | .dev = { | |
309 | .platform_data = &n35_blue_led_pdata, | |
310 | }, | |
311 | }; | |
312 | ||
865cc639 CW |
313 | static struct platform_device n30_warning_led = { |
314 | .name = "s3c24xx_led", | |
315 | .id = 2, | |
316 | .dev = { | |
317 | .platform_data = &n30_warning_led_pdata, | |
318 | }, | |
319 | }; | |
320 | ||
319887ee P |
321 | static struct platform_device n35_warning_led = { |
322 | .name = "s3c24xx_led", | |
323 | .id = 2, | |
324 | .dev = { | |
325 | .platform_data = &n35_warning_led_pdata, | |
326 | }, | |
327 | }; | |
328 | ||
e43f2383 | 329 | static struct s3c2410fb_display n30_display __initdata = { |
a6755780 BD |
330 | .type = S3C2410_LCDCON1_TFT, |
331 | .width = 240, | |
332 | .height = 320, | |
333 | .pixclock = 170000, | |
334 | ||
335 | .xres = 240, | |
336 | .yres = 320, | |
337 | .bpp = 16, | |
338 | .left_margin = 3, | |
339 | .right_margin = 40, | |
340 | .hsync_len = 40, | |
341 | .upper_margin = 2, | |
342 | .lower_margin = 3, | |
343 | .vsync_len = 2, | |
e43f2383 CW |
344 | |
345 | .lcdcon5 = S3C2410_LCDCON5_INVVLINE | S3C2410_LCDCON5_INVVFRAME, | |
346 | }; | |
347 | ||
348 | static struct s3c2410fb_mach_info n30_fb_info __initdata = { | |
a6755780 BD |
349 | .displays = &n30_display, |
350 | .num_displays = 1, | |
e43f2383 | 351 | .default_display = 0, |
a6755780 | 352 | .lpcsel = 0x06, |
e43f2383 CW |
353 | }; |
354 | ||
50cdba78 P |
355 | static struct s3c24xx_mci_pdata n30_mci_cfg __initdata = { |
356 | .gpio_detect = S3C2410_GPF(1), | |
357 | .gpio_wprotect = S3C2410_GPG(10), | |
358 | .ocr_avail = MMC_VDD_32_33, | |
359 | }; | |
360 | ||
1da177e4 | 361 | static struct platform_device *n30_devices[] __initdata = { |
1da177e4 LT |
362 | &s3c_device_lcd, |
363 | &s3c_device_wdt, | |
3e1b776c | 364 | &s3c_device_i2c0, |
1da177e4 | 365 | &s3c_device_iis, |
b813248c | 366 | &s3c_device_ohci, |
8ecad349 | 367 | &s3c_device_rtc, |
1da177e4 | 368 | &s3c_device_usbgadget, |
50cdba78 | 369 | &s3c_device_sdi, |
62065750 | 370 | &n30_button_device, |
865cc639 CW |
371 | &n30_blue_led, |
372 | &n30_warning_led, | |
1da177e4 LT |
373 | }; |
374 | ||
95790873 CW |
375 | static struct platform_device *n35_devices[] __initdata = { |
376 | &s3c_device_lcd, | |
377 | &s3c_device_wdt, | |
3e1b776c | 378 | &s3c_device_i2c0, |
95790873 | 379 | &s3c_device_iis, |
8ecad349 | 380 | &s3c_device_rtc, |
95790873 | 381 | &s3c_device_usbgadget, |
50cdba78 | 382 | &s3c_device_sdi, |
95790873 | 383 | &n35_button_device, |
319887ee P |
384 | &n35_blue_led, |
385 | &n35_warning_led, | |
95790873 CW |
386 | }; |
387 | ||
7bcb7eda | 388 | static struct s3c2410_platform_i2c __initdata n30_i2ccfg = { |
1da177e4 LT |
389 | .flags = 0, |
390 | .slave_addr = 0x10, | |
c564e6ae | 391 | .frequency = 10*1000, |
1da177e4 LT |
392 | }; |
393 | ||
9a2ddb78 CW |
394 | /* Lots of hardcoded stuff, but it sets up the hardware in a useful |
395 | * state so that we can boot Linux directly from flash. */ | |
396 | static void __init n30_hwinit(void) | |
397 | { | |
398 | /* GPA0-11 special functions -- unknown what they do | |
399 | * GPA12 N30 special function -- unknown what it does | |
400 | * N35/PiN output -- unknown what it does | |
401 | * | |
402 | * A12 is nGCS1 on the N30 and an output on the N35/PiN. I | |
403 | * don't think it does anything useful on the N30, so I ought | |
404 | * to make it an output there too since it always driven to 0 | |
405 | * as far as I can tell. */ | |
406 | if (machine_is_n30()) | |
407 | __raw_writel(0x007fffff, S3C2410_GPACON); | |
408 | if (machine_is_n35()) | |
409 | __raw_writel(0x007fefff, S3C2410_GPACON); | |
410 | __raw_writel(0x00000000, S3C2410_GPADAT); | |
411 | ||
412 | /* GPB0 TOUT0 backlight level | |
413 | * GPB1 output 1=backlight on | |
414 | * GPB2 output IrDA enable 0=transceiver enabled, 1=disabled | |
415 | * GPB3 output USB D+ pull up 0=disabled, 1=enabled | |
416 | * GPB4 N30 output -- unknown function | |
417 | * N30/PiN GPS control 0=GPS enabled, 1=GPS disabled | |
418 | * GPB5 output -- unknown function | |
419 | * GPB6 input -- unknown function | |
420 | * GPB7 output -- unknown function | |
421 | * GPB8 output -- probably LCD driver enable | |
422 | * GPB9 output -- probably LCD VSYNC driver enable | |
423 | * GPB10 output -- probably LCD HSYNC driver enable | |
424 | */ | |
425 | __raw_writel(0x00154556, S3C2410_GPBCON); | |
426 | __raw_writel(0x00000750, S3C2410_GPBDAT); | |
427 | __raw_writel(0x00000073, S3C2410_GPBUP); | |
428 | ||
429 | /* GPC0 input RS232 DCD/DSR/RI | |
430 | * GPC1 LCD | |
431 | * GPC2 output RS232 DTR? | |
432 | * GPC3 input RS232 DCD/DSR/RI | |
433 | * GPC4 LCD | |
434 | * GPC5 output 0=NAND write enabled, 1=NAND write protect | |
435 | * GPC6 input -- unknown function | |
436 | * GPC7 input charger status 0=charger connected | |
437 | * this input can be triggered by power on the USB device | |
438 | * port too, but will go back to disconnected soon after. | |
439 | * GPC8 N30/N35 output -- unknown function, always driven to 1 | |
440 | * PiN input -- unknown function, always read as 1 | |
441 | * Make it an input with a pull up for all models. | |
442 | * GPC9-15 LCD | |
443 | */ | |
444 | __raw_writel(0xaaa80618, S3C2410_GPCCON); | |
445 | __raw_writel(0x0000014c, S3C2410_GPCDAT); | |
446 | __raw_writel(0x0000fef2, S3C2410_GPCUP); | |
447 | ||
448 | /* GPD0 input -- unknown function | |
449 | * GPD1-D7 LCD | |
450 | * GPD8 N30 output -- unknown function | |
451 | * N35/PiN output 1=GPS LED on | |
452 | * GPD9 output 0=power led blinks red, 1=normal power led function | |
453 | * GPD10 output -- unknown function | |
454 | * GPD11-15 LCD drivers | |
455 | */ | |
456 | __raw_writel(0xaa95aaa4, S3C2410_GPDCON); | |
457 | __raw_writel(0x00000601, S3C2410_GPDDAT); | |
458 | __raw_writel(0x0000fbfe, S3C2410_GPDUP); | |
459 | ||
460 | /* GPE0-4 I2S audio bus | |
461 | * GPE5-10 SD/MMC bus | |
462 | * E11-13 outputs -- unknown function, probably power management | |
463 | * E14-15 I2C bus connected to the battery controller | |
464 | */ | |
465 | __raw_writel(0xa56aaaaa, S3C2410_GPECON); | |
466 | __raw_writel(0x0000efc5, S3C2410_GPEDAT); | |
467 | __raw_writel(0x0000f81f, S3C2410_GPEUP); | |
468 | ||
469 | /* GPF0 input 0=power button pressed | |
470 | * GPF1 input SD/MMC switch 0=card present | |
471 | * GPF2 N30 1=reset button pressed (inverted compared to the rest) | |
472 | * N35/PiN 0=reset button pressed | |
473 | * GPF3 N30/PiN input -- unknown function | |
474 | * N35 input GPS antenna position, 0=antenna closed, 1=open | |
475 | * GPF4 input 0=button 4 pressed | |
476 | * GPF5 input 0=button 3 pressed | |
477 | * GPF6 input 0=button 2 pressed | |
478 | * GPF7 input 0=button 1 pressed | |
479 | */ | |
480 | __raw_writel(0x0000aaaa, S3C2410_GPFCON); | |
481 | __raw_writel(0x00000000, S3C2410_GPFDAT); | |
482 | __raw_writel(0x000000ff, S3C2410_GPFUP); | |
483 | ||
484 | /* GPG0 input RS232 DCD/DSR/RI | |
485 | * GPG1 input 1=USB gadget port has power from a host | |
486 | * GPG2 N30 input -- unknown function | |
487 | * N35/PiN input 0=headphones plugged in, 1=not plugged in | |
488 | * GPG3 N30 output -- unknown function | |
489 | * N35/PiN input with unknown function | |
490 | * GPG4 N30 output 0=MMC enabled, 1=MMC disabled | |
491 | * GPG5 N30 output 0=BlueTooth chip disabled, 1=enabled | |
492 | * N35/PiN input joystick right | |
493 | * GPG6 N30 output 0=blue led on, 1=off | |
494 | * N35/PiN input joystick left | |
495 | * GPG7 input 0=thumbwheel pressed | |
496 | * GPG8 input 0=thumbwheel down | |
497 | * GPG9 input 0=thumbwheel up | |
498 | * GPG10 input SD/MMC write protect switch | |
499 | * GPG11 N30 input -- unknown function | |
500 | * N35 output 0=GPS antenna powered, 1=not powered | |
501 | * PiN output -- unknown function | |
502 | * GPG12-15 touch screen functions | |
503 | * | |
504 | * The pullups differ between the models, so enable all | |
505 | * pullups that are enabled on any of the models. | |
506 | */ | |
507 | if (machine_is_n30()) | |
508 | __raw_writel(0xff0a956a, S3C2410_GPGCON); | |
509 | if (machine_is_n35()) | |
510 | __raw_writel(0xff4aa92a, S3C2410_GPGCON); | |
511 | __raw_writel(0x0000e800, S3C2410_GPGDAT); | |
512 | __raw_writel(0x0000f86f, S3C2410_GPGUP); | |
513 | ||
514 | /* GPH0/1/2/3 RS232 serial port | |
515 | * GPH4/5 IrDA serial port | |
516 | * GPH6/7 N30 BlueTooth serial port | |
517 | * N35/PiN GPS receiver | |
518 | * GPH8 input -- unknown function | |
519 | * GPH9 CLKOUT0 HCLK -- unknown use | |
520 | * GPH10 CLKOUT1 FCLK -- unknown use | |
521 | * | |
522 | * The pull ups for H6/H7 are enabled on N30 but not on the | |
523 | * N35/PiN. I suppose is useful for a budget model of the N30 | |
524 | * with no bluetooh. It doesn't hurt to have the pull ups | |
525 | * enabled on the N35, so leave them enabled for all models. | |
526 | */ | |
527 | __raw_writel(0x0028aaaa, S3C2410_GPHCON); | |
528 | __raw_writel(0x000005ef, S3C2410_GPHDAT); | |
529 | __raw_writel(0x0000063f, S3C2410_GPHUP); | |
530 | } | |
531 | ||
5fe10ab1 | 532 | static void __init n30_map_io(void) |
1da177e4 LT |
533 | { |
534 | s3c24xx_init_io(n30_iodesc, ARRAY_SIZE(n30_iodesc)); | |
9a2ddb78 | 535 | n30_hwinit(); |
1da177e4 LT |
536 | s3c24xx_init_clocks(0); |
537 | s3c24xx_init_uarts(n30_uartcfgs, ARRAY_SIZE(n30_uartcfgs)); | |
1da177e4 LT |
538 | } |
539 | ||
5fe10ab1 | 540 | static void __init n30_init_irq(void) |
1da177e4 LT |
541 | { |
542 | s3c24xx_init_irq(); | |
543 | } | |
544 | ||
027da01d | 545 | /* GPB3 is the line that controls the pull-up for the USB D+ line */ |
1da177e4 | 546 | |
5fe10ab1 | 547 | static void __init n30_init(void) |
1da177e4 | 548 | { |
e43f2383 | 549 | s3c24xx_fb_set_platdata(&n30_fb_info); |
d088e5fe | 550 | s3c24xx_udc_set_platdata(&n30_udc_cfg); |
50cdba78 | 551 | s3c24xx_mci_set_platdata(&n30_mci_cfg); |
7bcb7eda | 552 | s3c_i2c0_set_platdata(&n30_i2ccfg); |
1da177e4 | 553 | |
027da01d BD |
554 | /* Turn off suspend on both USB ports, and switch the |
555 | * selectable USB port to USB device mode. */ | |
556 | ||
557 | s3c2410_modify_misccr(S3C2410_MISCCR_USBHOST | | |
558 | S3C2410_MISCCR_USBSUSPND0 | | |
559 | S3C2410_MISCCR_USBSUSPND1, 0x0); | |
57e5171c | 560 | |
95790873 CW |
561 | if (machine_is_n30()) { |
562 | /* Turn off suspend on both USB ports, and switch the | |
563 | * selectable USB port to USB device mode. */ | |
564 | s3c2410_modify_misccr(S3C2410_MISCCR_USBHOST | | |
565 | S3C2410_MISCCR_USBSUSPND0 | | |
566 | S3C2410_MISCCR_USBSUSPND1, 0x0); | |
567 | ||
568 | platform_add_devices(n30_devices, ARRAY_SIZE(n30_devices)); | |
569 | } | |
570 | ||
571 | if (machine_is_n35()) { | |
572 | /* Turn off suspend and switch the selectable USB port | |
573 | * to USB device mode. Turn on suspend for the host | |
574 | * port since it is not connected on the N35. | |
575 | * | |
576 | * Actually, the host port is available at some pads | |
577 | * on the back of the device, so it would actually be | |
578 | * possible to add a USB device inside the N35 if you | |
579 | * are willing to do some hardware modifications. */ | |
580 | s3c2410_modify_misccr(S3C2410_MISCCR_USBHOST | | |
581 | S3C2410_MISCCR_USBSUSPND0 | | |
582 | S3C2410_MISCCR_USBSUSPND1, | |
be7c4cf6 | 583 | S3C2410_MISCCR_USBSUSPND0); |
95790873 CW |
584 | |
585 | platform_add_devices(n35_devices, ARRAY_SIZE(n35_devices)); | |
586 | } | |
1da177e4 LT |
587 | } |
588 | ||
589 | MACHINE_START(N30, "Acer-N30") | |
027da01d BD |
590 | /* Maintainer: Christer Weinigel <christer@weinigel.se>, |
591 | Ben Dooks <ben-linux@fluff.org> | |
592 | */ | |
e9dea0c6 RK |
593 | .phys_io = S3C2410_PA_UART, |
594 | .io_pg_offst = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc, | |
595 | .boot_params = S3C2410_SDRAM_PA + 0x100, | |
1da177e4 LT |
596 | .timer = &s3c24xx_timer, |
597 | .init_machine = n30_init, | |
598 | .init_irq = n30_init_irq, | |
599 | .map_io = n30_map_io, | |
600 | MACHINE_END | |
95790873 CW |
601 | |
602 | MACHINE_START(N35, "Acer-N35") | |
603 | /* Maintainer: Christer Weinigel <christer@weinigel.se> | |
604 | */ | |
605 | .phys_io = S3C2410_PA_UART, | |
606 | .io_pg_offst = (((u32)S3C24XX_VA_UART) >> 18) & 0xfffc, | |
607 | .boot_params = S3C2410_SDRAM_PA + 0x100, | |
608 | .timer = &s3c24xx_timer, | |
609 | .init_machine = n30_init, | |
610 | .init_irq = n30_init_irq, | |
611 | .map_io = n30_map_io, | |
612 | MACHINE_END |