diff options
Diffstat (limited to 'arch/arm/mach-pxa')
-rw-r--r-- | arch/arm/mach-pxa/Kconfig | 19 | ||||
-rw-r--r-- | arch/arm/mach-pxa/Makefile | 2 | ||||
-rw-r--r-- | arch/arm/mach-pxa/leds-trizeps4.c | 134 | ||||
-rw-r--r-- | arch/arm/mach-pxa/leds.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-pxa/leds.h | 1 | ||||
-rw-r--r-- | arch/arm/mach-pxa/lpd270.c | 126 | ||||
-rw-r--r-- | arch/arm/mach-pxa/trizeps4.c | 471 |
7 files changed, 731 insertions, 24 deletions
diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig index ea5137f319c4..03d07cae26c8 100644 --- a/arch/arm/mach-pxa/Kconfig +++ b/arch/arm/mach-pxa/Kconfig | |||
@@ -35,6 +35,10 @@ config PXA_SHARPSL | |||
35 | SL-C3000 (Spitz), SL-C3100 (Borzoi) or SL-C6000x (Tosa) | 35 | SL-C3000 (Spitz), SL-C3100 (Borzoi) or SL-C6000x (Tosa) |
36 | handheld computer. | 36 | handheld computer. |
37 | 37 | ||
38 | config MACH_TRIZEPS4 | ||
39 | bool "Keith und Koep Trizeps4 DIMM-Module" | ||
40 | select PXA27x | ||
41 | |||
38 | endchoice | 42 | endchoice |
39 | 43 | ||
40 | if PXA_SHARPSL | 44 | if PXA_SHARPSL |
@@ -55,6 +59,21 @@ endchoice | |||
55 | 59 | ||
56 | endif | 60 | endif |
57 | 61 | ||
62 | if MACH_TRIZEPS4 | ||
63 | |||
64 | choice | ||
65 | prompt "Select base board for Trizeps 4 module" | ||
66 | |||
67 | config MACH_TRIZEPS4_CONXS | ||
68 | bool "ConXS Eval Board" | ||
69 | |||
70 | config MACH_TRIZEPS4_ANY | ||
71 | bool "another Board" | ||
72 | |||
73 | endchoice | ||
74 | |||
75 | endif | ||
76 | |||
58 | endmenu | 77 | endmenu |
59 | 78 | ||
60 | config MACH_POODLE | 79 | config MACH_POODLE |
diff --git a/arch/arm/mach-pxa/Makefile b/arch/arm/mach-pxa/Makefile index 1610690be419..9093eb1c94eb 100644 --- a/arch/arm/mach-pxa/Makefile +++ b/arch/arm/mach-pxa/Makefile | |||
@@ -12,6 +12,7 @@ obj-$(CONFIG_ARCH_LUBBOCK) += lubbock.o | |||
12 | obj-$(CONFIG_MACH_LOGICPD_PXA270) += lpd270.o | 12 | obj-$(CONFIG_MACH_LOGICPD_PXA270) += lpd270.o |
13 | obj-$(CONFIG_MACH_MAINSTONE) += mainstone.o | 13 | obj-$(CONFIG_MACH_MAINSTONE) += mainstone.o |
14 | obj-$(CONFIG_ARCH_PXA_IDP) += idp.o | 14 | obj-$(CONFIG_ARCH_PXA_IDP) += idp.o |
15 | obj-$(CONFIG_MACH_TRIZEPS4) += trizeps4.o | ||
15 | obj-$(CONFIG_PXA_SHARP_C7xx) += corgi.o corgi_ssp.o corgi_lcd.o sharpsl_pm.o corgi_pm.o | 16 | obj-$(CONFIG_PXA_SHARP_C7xx) += corgi.o corgi_ssp.o corgi_lcd.o sharpsl_pm.o corgi_pm.o |
16 | obj-$(CONFIG_PXA_SHARP_Cxx00) += spitz.o corgi_ssp.o corgi_lcd.o sharpsl_pm.o spitz_pm.o | 17 | obj-$(CONFIG_PXA_SHARP_Cxx00) += spitz.o corgi_ssp.o corgi_lcd.o sharpsl_pm.o spitz_pm.o |
17 | obj-$(CONFIG_MACH_AKITA) += akita-ioexp.o | 18 | obj-$(CONFIG_MACH_AKITA) += akita-ioexp.o |
@@ -23,6 +24,7 @@ led-y := leds.o | |||
23 | led-$(CONFIG_ARCH_LUBBOCK) += leds-lubbock.o | 24 | led-$(CONFIG_ARCH_LUBBOCK) += leds-lubbock.o |
24 | led-$(CONFIG_MACH_MAINSTONE) += leds-mainstone.o | 25 | led-$(CONFIG_MACH_MAINSTONE) += leds-mainstone.o |
25 | led-$(CONFIG_ARCH_PXA_IDP) += leds-idp.o | 26 | led-$(CONFIG_ARCH_PXA_IDP) += leds-idp.o |
27 | led-$(CONFIG_MACH_TRIZEPS4) += leds-trizeps4.o | ||
26 | 28 | ||
27 | obj-$(CONFIG_LEDS) += $(led-y) | 29 | obj-$(CONFIG_LEDS) += $(led-y) |
28 | 30 | ||
diff --git a/arch/arm/mach-pxa/leds-trizeps4.c b/arch/arm/mach-pxa/leds-trizeps4.c new file mode 100644 index 000000000000..14cfc85e44b5 --- /dev/null +++ b/arch/arm/mach-pxa/leds-trizeps4.c | |||
@@ -0,0 +1,134 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mach-pxa/leds-trizeps4.c | ||
3 | * | ||
4 | * Author: Jürgen Schindele | ||
5 | * Created: 20 02, 2006 | ||
6 | * Copyright: Jürgen Schindele | ||
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 | |||
13 | #include <linux/config.h> | ||
14 | #include <linux/init.h> | ||
15 | |||
16 | #include <asm/hardware.h> | ||
17 | #include <asm/system.h> | ||
18 | #include <asm/types.h> | ||
19 | #include <asm/leds.h> | ||
20 | |||
21 | #include <asm/arch/pxa-regs.h> | ||
22 | #include <asm/arch/trizeps4.h> | ||
23 | |||
24 | #include "leds.h" | ||
25 | |||
26 | #define LED_STATE_ENABLED 1 | ||
27 | #define LED_STATE_CLAIMED 2 | ||
28 | |||
29 | #define SYS_BUSY 0x01 | ||
30 | #define HEARTBEAT 0x02 | ||
31 | #define BLINK 0x04 | ||
32 | |||
33 | static unsigned int led_state; | ||
34 | static unsigned int hw_led_state; | ||
35 | |||
36 | void trizeps4_leds_event(led_event_t evt) | ||
37 | { | ||
38 | unsigned long flags; | ||
39 | |||
40 | local_irq_save(flags); | ||
41 | |||
42 | switch (evt) { | ||
43 | case led_start: | ||
44 | hw_led_state = 0; | ||
45 | pxa_gpio_mode( GPIO_SYS_BUSY_LED | GPIO_OUT); /* LED1 */ | ||
46 | pxa_gpio_mode( GPIO_HEARTBEAT_LED | GPIO_OUT); /* LED2 */ | ||
47 | led_state = LED_STATE_ENABLED; | ||
48 | break; | ||
49 | |||
50 | case led_stop: | ||
51 | led_state &= ~LED_STATE_ENABLED; | ||
52 | break; | ||
53 | |||
54 | case led_claim: | ||
55 | led_state |= LED_STATE_CLAIMED; | ||
56 | hw_led_state = 0; | ||
57 | break; | ||
58 | |||
59 | case led_release: | ||
60 | led_state &= ~LED_STATE_CLAIMED; | ||
61 | hw_led_state = 0; | ||
62 | break; | ||
63 | |||
64 | #ifdef CONFIG_LEDS_TIMER | ||
65 | case led_timer: | ||
66 | hw_led_state ^= HEARTBEAT; | ||
67 | break; | ||
68 | #endif | ||
69 | |||
70 | #ifdef CONFIG_LEDS_CPU | ||
71 | case led_idle_start: | ||
72 | hw_led_state &= ~SYS_BUSY; | ||
73 | break; | ||
74 | |||
75 | case led_idle_end: | ||
76 | hw_led_state |= SYS_BUSY; | ||
77 | break; | ||
78 | #endif | ||
79 | |||
80 | case led_halted: | ||
81 | break; | ||
82 | |||
83 | case led_green_on: | ||
84 | hw_led_state |= BLINK; | ||
85 | break; | ||
86 | |||
87 | case led_green_off: | ||
88 | hw_led_state &= ~BLINK; | ||
89 | break; | ||
90 | |||
91 | case led_amber_on: | ||
92 | break; | ||
93 | |||
94 | case led_amber_off: | ||
95 | break; | ||
96 | |||
97 | case led_red_on: | ||
98 | break; | ||
99 | |||
100 | case led_red_off: | ||
101 | break; | ||
102 | |||
103 | default: | ||
104 | break; | ||
105 | } | ||
106 | |||
107 | if (led_state & LED_STATE_ENABLED) { | ||
108 | switch (hw_led_state) { | ||
109 | case 0: | ||
110 | GPSR(GPIO_SYS_BUSY_LED) |= GPIO_bit(GPIO_SYS_BUSY_LED); | ||
111 | GPSR(GPIO_HEARTBEAT_LED) |= GPIO_bit(GPIO_HEARTBEAT_LED); | ||
112 | break; | ||
113 | case 1: | ||
114 | GPCR(GPIO_SYS_BUSY_LED) |= GPIO_bit(GPIO_SYS_BUSY_LED); | ||
115 | GPSR(GPIO_HEARTBEAT_LED) |= GPIO_bit(GPIO_HEARTBEAT_LED); | ||
116 | break; | ||
117 | case 2: | ||
118 | GPSR(GPIO_SYS_BUSY_LED) |= GPIO_bit(GPIO_SYS_BUSY_LED); | ||
119 | GPCR(GPIO_HEARTBEAT_LED) |= GPIO_bit(GPIO_HEARTBEAT_LED); | ||
120 | break; | ||
121 | case 3: | ||
122 | GPCR(GPIO_SYS_BUSY_LED) |= GPIO_bit(GPIO_SYS_BUSY_LED); | ||
123 | GPCR(GPIO_HEARTBEAT_LED) |= GPIO_bit(GPIO_HEARTBEAT_LED); | ||
124 | break; | ||
125 | } | ||
126 | } | ||
127 | else { | ||
128 | /* turn all off */ | ||
129 | GPSR(GPIO_SYS_BUSY_LED) |= GPIO_bit(GPIO_SYS_BUSY_LED); | ||
130 | GPSR(GPIO_HEARTBEAT_LED) |= GPIO_bit(GPIO_HEARTBEAT_LED); | ||
131 | } | ||
132 | |||
133 | local_irq_restore(flags); | ||
134 | } | ||
diff --git a/arch/arm/mach-pxa/leds.c b/arch/arm/mach-pxa/leds.c index bbe4d5f6afaa..e13eb841e48d 100644 --- a/arch/arm/mach-pxa/leds.c +++ b/arch/arm/mach-pxa/leds.c | |||
@@ -24,6 +24,8 @@ pxa_leds_init(void) | |||
24 | leds_event = mainstone_leds_event; | 24 | leds_event = mainstone_leds_event; |
25 | if (machine_is_pxa_idp()) | 25 | if (machine_is_pxa_idp()) |
26 | leds_event = idp_leds_event; | 26 | leds_event = idp_leds_event; |
27 | if (machine_is_trizeps4()) | ||
28 | leds_event = trizeps4_leds_event; | ||
27 | 29 | ||
28 | leds_event(led_start); | 30 | leds_event(led_start); |
29 | return 0; | 31 | return 0; |
diff --git a/arch/arm/mach-pxa/leds.h b/arch/arm/mach-pxa/leds.h index d98f6e93c12b..4f829b8c39dd 100644 --- a/arch/arm/mach-pxa/leds.h +++ b/arch/arm/mach-pxa/leds.h | |||
@@ -10,3 +10,4 @@ | |||
10 | extern void idp_leds_event(led_event_t evt); | 10 | extern void idp_leds_event(led_event_t evt); |
11 | extern void lubbock_leds_event(led_event_t evt); | 11 | extern void lubbock_leds_event(led_event_t evt); |
12 | extern void mainstone_leds_event(led_event_t evt); | 12 | extern void mainstone_leds_event(led_event_t evt); |
13 | extern void trizeps4_leds_event(led_event_t evt); | ||
diff --git a/arch/arm/mach-pxa/lpd270.c b/arch/arm/mach-pxa/lpd270.c index ec0f43a102c7..1a5f5c21481e 100644 --- a/arch/arm/mach-pxa/lpd270.c +++ b/arch/arm/mach-pxa/lpd270.c | |||
@@ -248,58 +248,137 @@ static void lpd270_backlight_power(int on) | |||
248 | 248 | ||
249 | /* 5.7" TFT QVGA (LoLo display number 1) */ | 249 | /* 5.7" TFT QVGA (LoLo display number 1) */ |
250 | static struct pxafb_mach_info sharp_lq057q3dc02 __initdata = { | 250 | static struct pxafb_mach_info sharp_lq057q3dc02 __initdata = { |
251 | .pixclock = 100000, | 251 | .pixclock = 150000, |
252 | .xres = 240, | 252 | .xres = 320, |
253 | .yres = 320, | 253 | .yres = 240, |
254 | .bpp = 16, | 254 | .bpp = 16, |
255 | .hsync_len = 64, | 255 | .hsync_len = 0x14, |
256 | .left_margin = 0x27, | 256 | .left_margin = 0x28, |
257 | .right_margin = 0x09, | 257 | .right_margin = 0x0a, |
258 | .vsync_len = 0x04, | 258 | .vsync_len = 0x02, |
259 | .upper_margin = 0x08, | 259 | .upper_margin = 0x08, |
260 | .lower_margin = 0x14, | 260 | .lower_margin = 0x14, |
261 | .sync = 0, | 261 | .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, |
262 | .lccr0 = 0x07800080, | 262 | .lccr0 = 0x07800080, |
263 | .lccr3 = 0x04400007, | 263 | .lccr3 = 0x00400000, |
264 | .pxafb_backlight_power = lpd270_backlight_power, | ||
265 | }; | ||
266 | |||
267 | /* 12.1" TFT SVGA (LoLo display number 2) */ | ||
268 | static struct pxafb_mach_info sharp_lq121s1dg31 __initdata = { | ||
269 | .pixclock = 50000, | ||
270 | .xres = 800, | ||
271 | .yres = 600, | ||
272 | .bpp = 16, | ||
273 | .hsync_len = 0x05, | ||
274 | .left_margin = 0x52, | ||
275 | .right_margin = 0x05, | ||
276 | .vsync_len = 0x04, | ||
277 | .upper_margin = 0x14, | ||
278 | .lower_margin = 0x0a, | ||
279 | .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, | ||
280 | .lccr0 = 0x07800080, | ||
281 | .lccr3 = 0x00400000, | ||
282 | .pxafb_backlight_power = lpd270_backlight_power, | ||
283 | }; | ||
284 | |||
285 | /* 3.6" TFT QVGA (LoLo display number 3) */ | ||
286 | static struct pxafb_mach_info sharp_lq036q1da01 __initdata = { | ||
287 | .pixclock = 150000, | ||
288 | .xres = 320, | ||
289 | .yres = 240, | ||
290 | .bpp = 16, | ||
291 | .hsync_len = 0x0e, | ||
292 | .left_margin = 0x04, | ||
293 | .right_margin = 0x0a, | ||
294 | .vsync_len = 0x03, | ||
295 | .upper_margin = 0x03, | ||
296 | .lower_margin = 0x03, | ||
297 | .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, | ||
298 | .lccr0 = 0x07800080, | ||
299 | .lccr3 = 0x00400000, | ||
264 | .pxafb_backlight_power = lpd270_backlight_power, | 300 | .pxafb_backlight_power = lpd270_backlight_power, |
265 | }; | 301 | }; |
266 | 302 | ||
267 | /* 6.4" TFT VGA (LoLo display number 5) */ | 303 | /* 6.4" TFT VGA (LoLo display number 5) */ |
268 | static struct pxafb_mach_info sharp_lq64d343 __initdata = { | 304 | static struct pxafb_mach_info sharp_lq64d343 __initdata = { |
269 | .pixclock = 20000, | 305 | .pixclock = 25000, |
270 | .xres = 640, | 306 | .xres = 640, |
271 | .yres = 480, | 307 | .yres = 480, |
272 | .bpp = 16, | 308 | .bpp = 16, |
273 | .hsync_len = 49, | 309 | .hsync_len = 0x31, |
274 | .left_margin = 0x89, | 310 | .left_margin = 0x89, |
275 | .right_margin = 0x19, | 311 | .right_margin = 0x19, |
276 | .vsync_len = 18, | 312 | .vsync_len = 0x12, |
277 | .upper_margin = 0x22, | 313 | .upper_margin = 0x22, |
278 | .lower_margin = 0, | 314 | .lower_margin = 0x00, |
279 | .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, | 315 | .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, |
280 | .lccr0 = 0x07800080, | 316 | .lccr0 = 0x07800080, |
281 | .lccr3 = 0x04400001, | 317 | .lccr3 = 0x00400000, |
318 | .pxafb_backlight_power = lpd270_backlight_power, | ||
319 | }; | ||
320 | |||
321 | /* 10.4" TFT VGA (LoLo display number 7) */ | ||
322 | static struct pxafb_mach_info sharp_lq10d368 __initdata = { | ||
323 | .pixclock = 25000, | ||
324 | .xres = 640, | ||
325 | .yres = 480, | ||
326 | .bpp = 16, | ||
327 | .hsync_len = 0x31, | ||
328 | .left_margin = 0x89, | ||
329 | .right_margin = 0x19, | ||
330 | .vsync_len = 0x12, | ||
331 | .upper_margin = 0x22, | ||
332 | .lower_margin = 0x00, | ||
333 | .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, | ||
334 | .lccr0 = 0x07800080, | ||
335 | .lccr3 = 0x00400000, | ||
282 | .pxafb_backlight_power = lpd270_backlight_power, | 336 | .pxafb_backlight_power = lpd270_backlight_power, |
283 | }; | 337 | }; |
284 | 338 | ||
285 | /* 3.5" TFT QVGA (LoLo display number 8) */ | 339 | /* 3.5" TFT QVGA (LoLo display number 8) */ |
286 | static struct pxafb_mach_info sharp_lq035q7db02_20 __initdata = { | 340 | static struct pxafb_mach_info sharp_lq035q7db02_20 __initdata = { |
287 | .pixclock = 100000, | 341 | .pixclock = 150000, |
288 | .xres = 240, | 342 | .xres = 240, |
289 | .yres = 320, | 343 | .yres = 320, |
290 | .bpp = 16, | 344 | .bpp = 16, |
291 | .hsync_len = 0x34, | 345 | .hsync_len = 0x0e, |
292 | .left_margin = 0x09, | 346 | .left_margin = 0x0a, |
293 | .right_margin = 0x09, | 347 | .right_margin = 0x0a, |
294 | .vsync_len = 0x08, | 348 | .vsync_len = 0x03, |
295 | .upper_margin = 0x05, | 349 | .upper_margin = 0x05, |
296 | .lower_margin = 0x14, | 350 | .lower_margin = 0x14, |
297 | .sync = 0, | 351 | .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, |
298 | .lccr0 = 0x07800080, | 352 | .lccr0 = 0x07800080, |
299 | .lccr3 = 0x04400007, | 353 | .lccr3 = 0x00400000, |
300 | .pxafb_backlight_power = lpd270_backlight_power, | 354 | .pxafb_backlight_power = lpd270_backlight_power, |
301 | }; | 355 | }; |
302 | 356 | ||
357 | static struct pxafb_mach_info *lpd270_lcd_to_use; | ||
358 | |||
359 | static int __init lpd270_set_lcd(char *str) | ||
360 | { | ||
361 | if (!strnicmp(str, "lq057q3dc02", 11)) { | ||
362 | lpd270_lcd_to_use = &sharp_lq057q3dc02; | ||
363 | } else if (!strnicmp(str, "lq121s1dg31", 11)) { | ||
364 | lpd270_lcd_to_use = &sharp_lq121s1dg31; | ||
365 | } else if (!strnicmp(str, "lq036q1da01", 11)) { | ||
366 | lpd270_lcd_to_use = &sharp_lq036q1da01; | ||
367 | } else if (!strnicmp(str, "lq64d343", 8)) { | ||
368 | lpd270_lcd_to_use = &sharp_lq64d343; | ||
369 | } else if (!strnicmp(str, "lq10d368", 8)) { | ||
370 | lpd270_lcd_to_use = &sharp_lq10d368; | ||
371 | } else if (!strnicmp(str, "lq035q7db02-20", 14)) { | ||
372 | lpd270_lcd_to_use = &sharp_lq035q7db02_20; | ||
373 | } else { | ||
374 | printk(KERN_INFO "lpd270: unknown lcd panel [%s]\n", str); | ||
375 | } | ||
376 | |||
377 | return 1; | ||
378 | } | ||
379 | |||
380 | __setup("lcd=", lpd270_set_lcd); | ||
381 | |||
303 | static struct platform_device *platform_devices[] __initdata = { | 382 | static struct platform_device *platform_devices[] __initdata = { |
304 | &smc91x_device, | 383 | &smc91x_device, |
305 | &lpd270_audio_device, | 384 | &lpd270_audio_device, |
@@ -345,9 +424,8 @@ static void __init lpd270_init(void) | |||
345 | 424 | ||
346 | platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); | 425 | platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices)); |
347 | 426 | ||
348 | // set_pxa_fb_info(&sharp_lq057q3dc02); | 427 | if (lpd270_lcd_to_use != NULL) |
349 | set_pxa_fb_info(&sharp_lq64d343); | 428 | set_pxa_fb_info(lpd270_lcd_to_use); |
350 | // set_pxa_fb_info(&sharp_lq035q7db02_20); | ||
351 | 429 | ||
352 | pxa_set_ohci_info(&lpd270_ohci_platform_data); | 430 | pxa_set_ohci_info(&lpd270_ohci_platform_data); |
353 | } | 431 | } |
diff --git a/arch/arm/mach-pxa/trizeps4.c b/arch/arm/mach-pxa/trizeps4.c new file mode 100644 index 000000000000..4ffff9e95eca --- /dev/null +++ b/arch/arm/mach-pxa/trizeps4.c | |||
@@ -0,0 +1,471 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mach-pxa/trizeps4.c | ||
3 | * | ||
4 | * Support for the Keith und Koep Trizeps4 Module Platform. | ||
5 | * | ||
6 | * Author: Jürgen Schindele | ||
7 | * Created: 20 02, 2006 | ||
8 | * Copyright: Jürgen Schindele | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify | ||
11 | * it under the terms of the GNU General Public License version 2 as | ||
12 | * published by the Free Software Foundation. | ||
13 | */ | ||
14 | |||
15 | #include <linux/init.h> | ||
16 | #include <linux/kernel.h> | ||
17 | #include <linux/platform_device.h> | ||
18 | #include <linux/sysdev.h> | ||
19 | #include <linux/interrupt.h> | ||
20 | #include <linux/sched.h> | ||
21 | #include <linux/bitops.h> | ||
22 | #include <linux/fb.h> | ||
23 | #include <linux/ioport.h> | ||
24 | #include <linux/delay.h> | ||
25 | #include <linux/serial_8250.h> | ||
26 | #include <linux/mtd/mtd.h> | ||
27 | #include <linux/mtd/partitions.h> | ||
28 | |||
29 | #include <asm/types.h> | ||
30 | #include <asm/setup.h> | ||
31 | #include <asm/memory.h> | ||
32 | #include <asm/mach-types.h> | ||
33 | #include <asm/hardware.h> | ||
34 | #include <asm/irq.h> | ||
35 | #include <asm/sizes.h> | ||
36 | |||
37 | #include <asm/mach/arch.h> | ||
38 | #include <asm/mach/map.h> | ||
39 | #include <asm/mach/irq.h> | ||
40 | #include <asm/mach/flash.h> | ||
41 | |||
42 | #include <asm/arch/pxa-regs.h> | ||
43 | #include <asm/arch/trizeps4.h> | ||
44 | #include <asm/arch/audio.h> | ||
45 | #include <asm/arch/pxafb.h> | ||
46 | #include <asm/arch/mmc.h> | ||
47 | #include <asm/arch/irda.h> | ||
48 | #include <asm/arch/ohci.h> | ||
49 | |||
50 | #include "generic.h" | ||
51 | |||
52 | /******************************************************************************************** | ||
53 | * ONBOARD FLASH | ||
54 | ********************************************************************************************/ | ||
55 | static struct mtd_partition trizeps4_partitions[] = { | ||
56 | { | ||
57 | .name = "Bootloader", | ||
58 | .size = 0x00040000, | ||
59 | .offset = 0, | ||
60 | .mask_flags = MTD_WRITEABLE /* force read-only */ | ||
61 | },{ | ||
62 | .name = "Kernel", | ||
63 | .size = 0x00400000, | ||
64 | .offset = 0x00040000 | ||
65 | },{ | ||
66 | .name = "Filesystem", | ||
67 | .size = MTDPART_SIZ_FULL, | ||
68 | .offset = 0x00440000 | ||
69 | } | ||
70 | }; | ||
71 | |||
72 | static struct flash_platform_data trizeps4_flash_data[] = { | ||
73 | { | ||
74 | .map_name = "cfi_probe", | ||
75 | .parts = trizeps4_partitions, | ||
76 | .nr_parts = ARRAY_SIZE(trizeps4_partitions) | ||
77 | } | ||
78 | }; | ||
79 | |||
80 | static struct resource flash_resource = { | ||
81 | .start = PXA_CS0_PHYS, | ||
82 | .end = PXA_CS0_PHYS + SZ_64M - 1, | ||
83 | .flags = IORESOURCE_MEM, | ||
84 | }; | ||
85 | |||
86 | static struct platform_device flash_device = { | ||
87 | .name = "pxa2xx-flash", | ||
88 | .id = 0, | ||
89 | .dev = { | ||
90 | .platform_data = &trizeps4_flash_data, | ||
91 | }, | ||
92 | .resource = &flash_resource, | ||
93 | .num_resources = 1, | ||
94 | }; | ||
95 | |||
96 | /******************************************************************************************** | ||
97 | * DAVICOM DM9000 Ethernet | ||
98 | ********************************************************************************************/ | ||
99 | static struct resource dm9000_resources[] = { | ||
100 | [0] = { | ||
101 | .start = TRIZEPS4_ETH_PHYS+0x300, | ||
102 | .end = TRIZEPS4_ETH_PHYS+0x400-1, | ||
103 | .flags = IORESOURCE_MEM, | ||
104 | }, | ||
105 | [1] = { | ||
106 | .start = TRIZEPS4_ETH_PHYS+0x8300, | ||
107 | .end = TRIZEPS4_ETH_PHYS+0x8400-1, | ||
108 | .flags = IORESOURCE_MEM, | ||
109 | }, | ||
110 | [2] = { | ||
111 | .start = TRIZEPS4_ETH_IRQ, | ||
112 | .end = TRIZEPS4_ETH_IRQ, | ||
113 | .flags = (IORESOURCE_IRQ | IRQT_RISING), | ||
114 | }, | ||
115 | }; | ||
116 | |||
117 | static struct platform_device dm9000_device = { | ||
118 | .name = "dm9000", | ||
119 | .id = -1, | ||
120 | .num_resources = ARRAY_SIZE(dm9000_resources), | ||
121 | .resource = dm9000_resources, | ||
122 | }; | ||
123 | |||
124 | /******************************************************************************************** | ||
125 | * PXA270 serial ports | ||
126 | ********************************************************************************************/ | ||
127 | static struct plat_serial8250_port tri_serial_ports[] = { | ||
128 | #ifdef CONFIG_SERIAL_PXA | ||
129 | /* this uses the own PXA driver */ | ||
130 | { | ||
131 | 0, | ||
132 | }, | ||
133 | #else | ||
134 | /* this uses the generic 8520 driver */ | ||
135 | [0] = { | ||
136 | .membase = (void *)&FFUART, | ||
137 | .irq = IRQ_FFUART, | ||
138 | .flags = UPF_BOOT_AUTOCONF, | ||
139 | .iotype = UPIO_MEM32, | ||
140 | .regshift = 2, | ||
141 | .uartclk = (921600*16), | ||
142 | }, | ||
143 | [1] = { | ||
144 | .membase = (void *)&BTUART, | ||
145 | .irq = IRQ_BTUART, | ||
146 | .flags = UPF_BOOT_AUTOCONF, | ||
147 | .iotype = UPIO_MEM32, | ||
148 | .regshift = 2, | ||
149 | .uartclk = (921600*16), | ||
150 | }, | ||
151 | { | ||
152 | 0, | ||
153 | }, | ||
154 | #endif | ||
155 | }; | ||
156 | |||
157 | static struct platform_device uart_devices = { | ||
158 | .name = "serial8250", | ||
159 | .id = 0, | ||
160 | .dev = { | ||
161 | .platform_data = tri_serial_ports, | ||
162 | }, | ||
163 | .num_resources = 0, | ||
164 | .resource = NULL, | ||
165 | }; | ||
166 | |||
167 | /******************************************************************************************** | ||
168 | * PXA270 ac97 sound codec | ||
169 | ********************************************************************************************/ | ||
170 | static struct platform_device ac97_audio_device = { | ||
171 | .name = "pxa2xx-ac97", | ||
172 | .id = -1, | ||
173 | }; | ||
174 | |||
175 | static struct platform_device * trizeps4_devices[] __initdata = { | ||
176 | &flash_device, | ||
177 | &uart_devices, | ||
178 | &dm9000_device, | ||
179 | &ac97_audio_device, | ||
180 | }; | ||
181 | |||
182 | #ifdef CONFIG_MACH_TRIZEPS4_CONXS | ||
183 | static short trizeps_conxs_bcr; | ||
184 | |||
185 | /* PCCARD power switching supports only 3,3V */ | ||
186 | void board_pcmcia_power(int power) | ||
187 | { | ||
188 | if (power) { | ||
189 | /* switch power on, put in reset and enable buffers */ | ||
190 | trizeps_conxs_bcr |= power; | ||
191 | trizeps_conxs_bcr |= ConXS_BCR_CF_RESET; | ||
192 | trizeps_conxs_bcr &= ~(ConXS_BCR_CF_BUF_EN); | ||
193 | ConXS_BCR = trizeps_conxs_bcr; | ||
194 | /* wait a little */ | ||
195 | udelay(2000); | ||
196 | /* take reset away */ | ||
197 | trizeps_conxs_bcr &= ~(ConXS_BCR_CF_RESET); | ||
198 | ConXS_BCR = trizeps_conxs_bcr; | ||
199 | udelay(2000); | ||
200 | } else { | ||
201 | /* put in reset */ | ||
202 | trizeps_conxs_bcr |= ConXS_BCR_CF_RESET; | ||
203 | ConXS_BCR = trizeps_conxs_bcr; | ||
204 | udelay(1000); | ||
205 | /* switch power off */ | ||
206 | trizeps_conxs_bcr &= ~(0xf); | ||
207 | ConXS_BCR = trizeps_conxs_bcr; | ||
208 | |||
209 | } | ||
210 | pr_debug("%s: o%s 0x%x\n", __FUNCTION__, power ? "n": "ff", trizeps_conxs_bcr); | ||
211 | } | ||
212 | |||
213 | /* backlight power switching for LCD panel */ | ||
214 | static void board_backlight_power(int on) | ||
215 | { | ||
216 | if (on) { | ||
217 | trizeps_conxs_bcr |= ConXS_BCR_L_DISP; | ||
218 | } else { | ||
219 | trizeps_conxs_bcr &= ~ConXS_BCR_L_DISP; | ||
220 | } | ||
221 | pr_debug("%s: o%s 0x%x\n", __FUNCTION__, on ? "n" : "ff", trizeps_conxs_bcr); | ||
222 | ConXS_BCR = trizeps_conxs_bcr; | ||
223 | } | ||
224 | |||
225 | /* Powersupply for MMC/SD cardslot */ | ||
226 | static void board_mci_power(struct device *dev, unsigned int vdd) | ||
227 | { | ||
228 | struct pxamci_platform_data* p_d = dev->platform_data; | ||
229 | |||
230 | if (( 1 << vdd) & p_d->ocr_mask) { | ||
231 | pr_debug("%s: on\n", __FUNCTION__); | ||
232 | /* FIXME fill in values here */ | ||
233 | } else { | ||
234 | pr_debug("%s: off\n", __FUNCTION__); | ||
235 | /* FIXME fill in values here */ | ||
236 | } | ||
237 | } | ||
238 | |||
239 | static short trizeps_conxs_ircr; | ||
240 | |||
241 | /* Switch modes and Power for IRDA receiver */ | ||
242 | static void board_irda_mode(struct device *dev, int mode) | ||
243 | { | ||
244 | unsigned long flags; | ||
245 | |||
246 | local_irq_save(flags); | ||
247 | if (mode & IR_SIRMODE) { | ||
248 | /* Slow mode */ | ||
249 | trizeps_conxs_ircr &= ~ConXS_IRCR_MODE; | ||
250 | } else if (mode & IR_FIRMODE) { | ||
251 | /* Fast mode */ | ||
252 | trizeps_conxs_ircr |= ConXS_IRCR_MODE; | ||
253 | } | ||
254 | if (mode & IR_OFF) { | ||
255 | trizeps_conxs_ircr |= ConXS_IRCR_SD; | ||
256 | } else { | ||
257 | trizeps_conxs_ircr &= ~ConXS_IRCR_SD; | ||
258 | } | ||
259 | /* FIXME write values to register */ | ||
260 | local_irq_restore(flags); | ||
261 | } | ||
262 | |||
263 | #else | ||
264 | /* for other baseboards define dummies */ | ||
265 | void board_pcmcia_power(int power) {;} | ||
266 | #define board_backlight_power NULL | ||
267 | #define board_mci_power NULL | ||
268 | #define board_irda_mode NULL | ||
269 | |||
270 | #endif /* CONFIG_MACH_TRIZEPS4_CONXS */ | ||
271 | EXPORT_SYMBOL(board_pcmcia_power); | ||
272 | |||
273 | static int trizeps4_mci_init(struct device *dev, irqreturn_t (*mci_detect_int)(int, void *, struct pt_regs *), void *data) | ||
274 | { | ||
275 | int err; | ||
276 | /* setup GPIO for PXA27x MMC controller */ | ||
277 | pxa_gpio_mode(GPIO32_MMCCLK_MD); | ||
278 | pxa_gpio_mode(GPIO112_MMCCMD_MD); | ||
279 | pxa_gpio_mode(GPIO92_MMCDAT0_MD); | ||
280 | pxa_gpio_mode(GPIO109_MMCDAT1_MD); | ||
281 | pxa_gpio_mode(GPIO110_MMCDAT2_MD); | ||
282 | pxa_gpio_mode(GPIO111_MMCDAT3_MD); | ||
283 | |||
284 | pxa_gpio_mode(GPIO_MMC_DET | GPIO_IN); | ||
285 | |||
286 | err = request_irq(TRIZEPS4_MMC_IRQ, mci_detect_int, SA_INTERRUPT | SA_TRIGGER_RISING, "MMC card detect", data); | ||
287 | if (err) { | ||
288 | printk(KERN_ERR "trizeps4_mci_init: MMC/SD: can't request MMC card detect IRQ\n"); | ||
289 | return -1; | ||
290 | } | ||
291 | return 0; | ||
292 | } | ||
293 | |||
294 | static void trizeps4_mci_exit(struct device *dev, void *data) | ||
295 | { | ||
296 | free_irq(TRIZEPS4_MMC_IRQ, data); | ||
297 | } | ||
298 | |||
299 | static struct pxamci_platform_data trizeps4_mci_platform_data = { | ||
300 | .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34, | ||
301 | .init = trizeps4_mci_init, | ||
302 | .exit = trizeps4_mci_exit, | ||
303 | .setpower = board_mci_power, | ||
304 | }; | ||
305 | |||
306 | static struct pxaficp_platform_data trizeps4_ficp_platform_data = { | ||
307 | .transceiver_cap = IR_SIRMODE | IR_FIRMODE | IR_OFF, | ||
308 | .transceiver_mode = board_irda_mode, | ||
309 | }; | ||
310 | |||
311 | static int trizeps4_ohci_init(struct device *dev) | ||
312 | { | ||
313 | /* setup Port1 GPIO pin. */ | ||
314 | pxa_gpio_mode( 88 | GPIO_ALT_FN_1_IN); /* USBHPWR1 */ | ||
315 | pxa_gpio_mode( 89 | GPIO_ALT_FN_2_OUT); /* USBHPEN1 */ | ||
316 | |||
317 | /* Set the Power Control Polarity Low and Power Sense | ||
318 | Polarity Low to active low. */ | ||
319 | UHCHR = (UHCHR | UHCHR_PCPL | UHCHR_PSPL) & | ||
320 | ~(UHCHR_SSEP1 | UHCHR_SSEP2 | UHCHR_SSEP3 | UHCHR_SSE); | ||
321 | |||
322 | return 0; | ||
323 | } | ||
324 | |||
325 | static void trizeps4_ohci_exit(struct device *dev) | ||
326 | { | ||
327 | ; | ||
328 | } | ||
329 | |||
330 | static struct pxaohci_platform_data trizeps4_ohci_platform_data = { | ||
331 | .port_mode = PMM_PERPORT_MODE, | ||
332 | .init = trizeps4_ohci_init, | ||
333 | .exit = trizeps4_ohci_exit, | ||
334 | }; | ||
335 | |||
336 | static struct map_desc trizeps4_io_desc[] __initdata = { | ||
337 | { /* ConXS CFSR */ | ||
338 | .virtual = TRIZEPS4_CFSR_VIRT, | ||
339 | .pfn = __phys_to_pfn(TRIZEPS4_CFSR_PHYS), | ||
340 | .length = 0x00001000, | ||
341 | .type = MT_DEVICE | ||
342 | }, | ||
343 | { /* ConXS BCR */ | ||
344 | .virtual = TRIZEPS4_BOCR_VIRT, | ||
345 | .pfn = __phys_to_pfn(TRIZEPS4_BOCR_PHYS), | ||
346 | .length = 0x00001000, | ||
347 | .type = MT_DEVICE | ||
348 | }, | ||
349 | { /* ConXS IRCR */ | ||
350 | .virtual = TRIZEPS4_IRCR_VIRT, | ||
351 | .pfn = __phys_to_pfn(TRIZEPS4_IRCR_PHYS), | ||
352 | .length = 0x00001000, | ||
353 | .type = MT_DEVICE | ||
354 | }, | ||
355 | { /* ConXS DCR */ | ||
356 | .virtual = TRIZEPS4_DICR_VIRT, | ||
357 | .pfn = __phys_to_pfn(TRIZEPS4_DICR_PHYS), | ||
358 | .length = 0x00001000, | ||
359 | .type = MT_DEVICE | ||
360 | }, | ||
361 | { /* ConXS UPSR */ | ||
362 | .virtual = TRIZEPS4_UPSR_VIRT, | ||
363 | .pfn = __phys_to_pfn(TRIZEPS4_UPSR_PHYS), | ||
364 | .length = 0x00001000, | ||
365 | .type = MT_DEVICE | ||
366 | } | ||
367 | }; | ||
368 | |||
369 | static struct pxafb_mach_info sharp_lcd __initdata = { | ||
370 | .pixclock = 78000, | ||
371 | .xres = 640, | ||
372 | .yres = 480, | ||
373 | .bpp = 8, | ||
374 | .hsync_len = 4, | ||
375 | .left_margin = 4, | ||
376 | .right_margin = 4, | ||
377 | .vsync_len = 2, | ||
378 | .upper_margin = 0, | ||
379 | .lower_margin = 0, | ||
380 | .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT, | ||
381 | .cmap_greyscale = 0, | ||
382 | .cmap_inverse = 0, | ||
383 | .cmap_static = 0, | ||
384 | .lccr0 = LCCR0_Color | LCCR0_Pas | LCCR0_Dual, | ||
385 | .lccr3 = 0x0340ff02, | ||
386 | .pxafb_backlight_power = board_backlight_power, | ||
387 | }; | ||
388 | |||
389 | static void __init trizeps4_fixup(struct machine_desc *desc, struct tag *tags, char **cmdline, struct meminfo *mi) | ||
390 | { | ||
391 | } | ||
392 | |||
393 | static void __init trizeps4_init(void) | ||
394 | { | ||
395 | platform_add_devices(trizeps4_devices, ARRAY_SIZE(trizeps4_devices)); | ||
396 | |||
397 | set_pxa_fb_info(&sharp_lcd); | ||
398 | |||
399 | pxa_set_mci_info(&trizeps4_mci_platform_data); | ||
400 | pxa_set_ficp_info(&trizeps4_ficp_platform_data); | ||
401 | pxa_set_ohci_info(&trizeps4_ohci_platform_data); | ||
402 | } | ||
403 | |||
404 | static void __init trizeps4_map_io(void) | ||
405 | { | ||
406 | pxa_map_io(); | ||
407 | iotable_init(trizeps4_io_desc, ARRAY_SIZE(trizeps4_io_desc)); | ||
408 | |||
409 | /* for DiskOnChip */ | ||
410 | pxa_gpio_mode(GPIO15_nCS_1_MD); | ||
411 | |||
412 | /* for off-module PIC on ConXS board */ | ||
413 | pxa_gpio_mode(GPIO_PIC | GPIO_IN); | ||
414 | |||
415 | /* UCB1400 irq */ | ||
416 | pxa_gpio_mode(GPIO_UCB1400 | GPIO_IN); | ||
417 | |||
418 | /* for DM9000 LAN */ | ||
419 | pxa_gpio_mode(GPIO78_nCS_2_MD); | ||
420 | pxa_gpio_mode(GPIO_DM9000 | GPIO_IN); | ||
421 | |||
422 | /* for PCMCIA device */ | ||
423 | pxa_gpio_mode(GPIO_PCD | GPIO_IN); | ||
424 | pxa_gpio_mode(GPIO_PRDY | GPIO_IN); | ||
425 | |||
426 | /* for I2C adapter */ | ||
427 | pxa_gpio_mode(GPIO117_I2CSCL_MD); | ||
428 | pxa_gpio_mode(GPIO118_I2CSDA_MD); | ||
429 | |||
430 | /* MMC_DET s.o. */ | ||
431 | pxa_gpio_mode(GPIO_MMC_DET | GPIO_IN); | ||
432 | |||
433 | /* whats that for ??? */ | ||
434 | pxa_gpio_mode(GPIO79_nCS_3_MD); | ||
435 | |||
436 | pxa_gpio_mode( GPIO_SYS_BUSY_LED | GPIO_OUT); /* LED1 */ | ||
437 | pxa_gpio_mode( GPIO_HEARTBEAT_LED | GPIO_OUT); /* LED2 */ | ||
438 | |||
439 | #ifdef CONFIG_MACH_TRIZEPS4_CONXS | ||
440 | #ifdef CONFIG_IDE_PXA_CF | ||
441 | /* if boot direct from compact flash dont disable power */ | ||
442 | trizeps_conxs_bcr = 0x0009; | ||
443 | #else | ||
444 | /* this is the reset value */ | ||
445 | trizeps_conxs_bcr = 0x00A0; | ||
446 | #endif | ||
447 | ConXS_BCR = trizeps_conxs_bcr; | ||
448 | #endif | ||
449 | |||
450 | PWER = 0x00000002; | ||
451 | PFER = 0x00000000; | ||
452 | PRER = 0x00000002; | ||
453 | PGSR0 = 0x0158C000; | ||
454 | PGSR1 = 0x00FF0080; | ||
455 | PGSR2 = 0x0001C004; | ||
456 | /* Stop 3.6MHz and drive HIGH to PCMCIA and CS */ | ||
457 | PCFR |= PCFR_OPDE; | ||
458 | } | ||
459 | |||
460 | MACHINE_START(TRIZEPS4, "Keith und Koep Trizeps IV module") | ||
461 | /* MAINTAINER("Jürgen Schindele") */ | ||
462 | .phys_io = 0x40000000, | ||
463 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, | ||
464 | .boot_params = TRIZEPS4_SDRAM_BASE + 0x100, | ||
465 | .fixup = trizeps4_fixup, | ||
466 | .init_machine = trizeps4_init, | ||
467 | .map_io = trizeps4_map_io, | ||
468 | .init_irq = pxa_init_irq, | ||
469 | .timer = &pxa_timer, | ||
470 | MACHINE_END | ||
471 | |||