diff options
Diffstat (limited to 'arch/arm/mach-pxa/zylonite.c')
-rw-r--r-- | arch/arm/mach-pxa/zylonite.c | 129 |
1 files changed, 120 insertions, 9 deletions
diff --git a/arch/arm/mach-pxa/zylonite.c b/arch/arm/mach-pxa/zylonite.c index 4a0028087ea6..8fca6d890b7d 100644 --- a/arch/arm/mach-pxa/zylonite.c +++ b/arch/arm/mach-pxa/zylonite.c | |||
@@ -18,23 +18,29 @@ | |||
18 | #include <linux/interrupt.h> | 18 | #include <linux/interrupt.h> |
19 | #include <linux/init.h> | 19 | #include <linux/init.h> |
20 | #include <linux/platform_device.h> | 20 | #include <linux/platform_device.h> |
21 | #include <linux/pwm_backlight.h> | ||
22 | #include <linux/smc91x.h> | ||
21 | 23 | ||
22 | #include <asm/mach-types.h> | 24 | #include <asm/mach-types.h> |
23 | #include <asm/mach/arch.h> | 25 | #include <asm/mach/arch.h> |
24 | #include <asm/hardware.h> | 26 | #include <asm/hardware.h> |
27 | #include <asm/arch/audio.h> | ||
25 | #include <asm/arch/gpio.h> | 28 | #include <asm/arch/gpio.h> |
26 | #include <asm/arch/pxafb.h> | 29 | #include <asm/arch/pxafb.h> |
27 | #include <asm/arch/zylonite.h> | 30 | #include <asm/arch/zylonite.h> |
28 | #include <asm/arch/mmc.h> | 31 | #include <asm/arch/mmc.h> |
29 | #include <asm/arch/pxa27x_keypad.h> | 32 | #include <asm/arch/pxa27x_keypad.h> |
33 | #include <asm/arch/pxa3xx_nand.h> | ||
30 | 34 | ||
35 | #include "devices.h" | ||
31 | #include "generic.h" | 36 | #include "generic.h" |
32 | 37 | ||
33 | #define MAX_SLOTS 3 | 38 | #define MAX_SLOTS 3 |
34 | struct platform_mmc_slot zylonite_mmc_slot[MAX_SLOTS]; | 39 | struct platform_mmc_slot zylonite_mmc_slot[MAX_SLOTS]; |
35 | 40 | ||
36 | int gpio_backlight; | ||
37 | int gpio_eth_irq; | 41 | int gpio_eth_irq; |
42 | int gpio_debug_led1; | ||
43 | int gpio_debug_led2; | ||
38 | 44 | ||
39 | int wm9713_irq; | 45 | int wm9713_irq; |
40 | 46 | ||
@@ -54,18 +60,72 @@ static struct resource smc91x_resources[] = { | |||
54 | } | 60 | } |
55 | }; | 61 | }; |
56 | 62 | ||
63 | static struct smc91x_platdata zylonite_smc91x_info = { | ||
64 | .flags = SMC91X_USE_8BIT | SMC91X_USE_16BIT | | ||
65 | SMC91X_NOWAIT | SMC91X_USE_DMA, | ||
66 | }; | ||
67 | |||
57 | static struct platform_device smc91x_device = { | 68 | static struct platform_device smc91x_device = { |
58 | .name = "smc91x", | 69 | .name = "smc91x", |
59 | .id = 0, | 70 | .id = 0, |
60 | .num_resources = ARRAY_SIZE(smc91x_resources), | 71 | .num_resources = ARRAY_SIZE(smc91x_resources), |
61 | .resource = smc91x_resources, | 72 | .resource = smc91x_resources, |
73 | .dev = { | ||
74 | .platform_data = &zylonite_smc91x_info, | ||
75 | }, | ||
62 | }; | 76 | }; |
63 | 77 | ||
64 | #if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE) | 78 | #if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE) |
65 | static void zylonite_backlight_power(int on) | 79 | static struct gpio_led zylonite_debug_leds[] = { |
80 | [0] = { | ||
81 | .name = "zylonite:yellow:1", | ||
82 | .default_trigger = "heartbeat", | ||
83 | }, | ||
84 | [1] = { | ||
85 | .name = "zylonite:yellow:2", | ||
86 | .default_trigger = "default-on", | ||
87 | }, | ||
88 | }; | ||
89 | |||
90 | static struct gpio_led_platform_data zylonite_debug_leds_info = { | ||
91 | .leds = zylonite_debug_leds, | ||
92 | .num_leds = ARRAY_SIZE(zylonite_debug_leds), | ||
93 | }; | ||
94 | |||
95 | static struct platform_device zylonite_device_leds = { | ||
96 | .name = "leds-gpio", | ||
97 | .id = -1, | ||
98 | .dev = { | ||
99 | .platform_data = &zylonite_debug_leds_info, | ||
100 | } | ||
101 | }; | ||
102 | |||
103 | static void __init zylonite_init_leds(void) | ||
66 | { | 104 | { |
67 | gpio_set_value(gpio_backlight, on); | 105 | zylonite_debug_leds[0].gpio = gpio_debug_led1; |
106 | zylonite_debug_leds[1].gpio = gpio_debug_led2; | ||
107 | |||
108 | platform_device_register(&zylonite_device_leds); | ||
68 | } | 109 | } |
110 | #else | ||
111 | static inline void zylonite_init_leds(void) {} | ||
112 | #endif | ||
113 | |||
114 | #if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE) | ||
115 | static struct platform_pwm_backlight_data zylonite_backlight_data = { | ||
116 | .pwm_id = 3, | ||
117 | .max_brightness = 100, | ||
118 | .dft_brightness = 100, | ||
119 | .pwm_period_ns = 10000, | ||
120 | }; | ||
121 | |||
122 | static struct platform_device zylonite_backlight_device = { | ||
123 | .name = "pwm-backlight", | ||
124 | .dev = { | ||
125 | .parent = &pxa27x_device_pwm1.dev, | ||
126 | .platform_data = &zylonite_backlight_data, | ||
127 | }, | ||
128 | }; | ||
69 | 129 | ||
70 | static struct pxafb_mode_info toshiba_ltm035a776c_mode = { | 130 | static struct pxafb_mode_info toshiba_ltm035a776c_mode = { |
71 | .pixclock = 110000, | 131 | .pixclock = 110000, |
@@ -98,7 +158,6 @@ static struct pxafb_mode_info toshiba_ltm04c380k_mode = { | |||
98 | static struct pxafb_mach_info zylonite_toshiba_lcd_info = { | 158 | static struct pxafb_mach_info zylonite_toshiba_lcd_info = { |
99 | .num_modes = 1, | 159 | .num_modes = 1, |
100 | .lcd_conn = LCD_COLOR_TFT_16BPP | LCD_PCLK_EDGE_FALL, | 160 | .lcd_conn = LCD_COLOR_TFT_16BPP | LCD_PCLK_EDGE_FALL, |
101 | .pxafb_backlight_power = zylonite_backlight_power, | ||
102 | }; | 161 | }; |
103 | 162 | ||
104 | static struct pxafb_mode_info sharp_ls037_modes[] = { | 163 | static struct pxafb_mode_info sharp_ls037_modes[] = { |
@@ -134,13 +193,11 @@ static struct pxafb_mach_info zylonite_sharp_lcd_info = { | |||
134 | .modes = sharp_ls037_modes, | 193 | .modes = sharp_ls037_modes, |
135 | .num_modes = 2, | 194 | .num_modes = 2, |
136 | .lcd_conn = LCD_COLOR_TFT_16BPP | LCD_PCLK_EDGE_FALL, | 195 | .lcd_conn = LCD_COLOR_TFT_16BPP | LCD_PCLK_EDGE_FALL, |
137 | .pxafb_backlight_power = zylonite_backlight_power, | ||
138 | }; | 196 | }; |
139 | 197 | ||
140 | static void __init zylonite_init_lcd(void) | 198 | static void __init zylonite_init_lcd(void) |
141 | { | 199 | { |
142 | /* backlight GPIO: output, default on */ | 200 | platform_device_register(&zylonite_backlight_device); |
143 | gpio_direction_output(gpio_backlight, 1); | ||
144 | 201 | ||
145 | if (lcd_id & 0x20) { | 202 | if (lcd_id & 0x20) { |
146 | set_pxa_fb_info(&zylonite_sharp_lcd_info); | 203 | set_pxa_fb_info(&zylonite_sharp_lcd_info); |
@@ -250,7 +307,7 @@ static void __init zylonite_init_mmc(void) | |||
250 | static inline void zylonite_init_mmc(void) {} | 307 | static inline void zylonite_init_mmc(void) {} |
251 | #endif | 308 | #endif |
252 | 309 | ||
253 | #if defined(CONFIG_KEYBOARD_PXA27x) || defined(CONFIG_KEYBOARD_PXA27x_MODULES) | 310 | #if defined(CONFIG_KEYBOARD_PXA27x) || defined(CONFIG_KEYBOARD_PXA27x_MODULE) |
254 | static unsigned int zylonite_matrix_key_map[] = { | 311 | static unsigned int zylonite_matrix_key_map[] = { |
255 | /* KEY(row, col, key_code) */ | 312 | /* KEY(row, col, key_code) */ |
256 | KEY(0, 0, KEY_A), KEY(0, 1, KEY_B), KEY(0, 2, KEY_C), KEY(0, 5, KEY_D), | 313 | KEY(0, 0, KEY_A), KEY(0, 1, KEY_B), KEY(0, 2, KEY_C), KEY(0, 5, KEY_D), |
@@ -315,6 +372,57 @@ static void __init zylonite_init_keypad(void) | |||
315 | static inline void zylonite_init_keypad(void) {} | 372 | static inline void zylonite_init_keypad(void) {} |
316 | #endif | 373 | #endif |
317 | 374 | ||
375 | #if defined(CONFIG_MTD_NAND_PXA3xx) || defined(CONFIG_MTD_NAND_PXA3xx_MODULE) | ||
376 | static struct mtd_partition zylonite_nand_partitions[] = { | ||
377 | [0] = { | ||
378 | .name = "Bootloader", | ||
379 | .offset = 0, | ||
380 | .size = 0x060000, | ||
381 | .mask_flags = MTD_WRITEABLE, /* force read-only */ | ||
382 | }, | ||
383 | [1] = { | ||
384 | .name = "Kernel", | ||
385 | .offset = 0x060000, | ||
386 | .size = 0x200000, | ||
387 | .mask_flags = MTD_WRITEABLE, /* force read-only */ | ||
388 | }, | ||
389 | [2] = { | ||
390 | .name = "Filesystem", | ||
391 | .offset = 0x0260000, | ||
392 | .size = 0x3000000, /* 48M - rootfs */ | ||
393 | }, | ||
394 | [3] = { | ||
395 | .name = "MassStorage", | ||
396 | .offset = 0x3260000, | ||
397 | .size = 0x3d40000, | ||
398 | }, | ||
399 | [4] = { | ||
400 | .name = "BBT", | ||
401 | .offset = 0x6FA0000, | ||
402 | .size = 0x80000, | ||
403 | .mask_flags = MTD_WRITEABLE, /* force read-only */ | ||
404 | }, | ||
405 | /* NOTE: we reserve some blocks at the end of the NAND flash for | ||
406 | * bad block management, and the max number of relocation blocks | ||
407 | * differs on different platforms. Please take care with it when | ||
408 | * defining the partition table. | ||
409 | */ | ||
410 | }; | ||
411 | |||
412 | static struct pxa3xx_nand_platform_data zylonite_nand_info = { | ||
413 | .enable_arbiter = 1, | ||
414 | .parts = zylonite_nand_partitions, | ||
415 | .nr_parts = ARRAY_SIZE(zylonite_nand_partitions), | ||
416 | }; | ||
417 | |||
418 | static void __init zylonite_init_nand(void) | ||
419 | { | ||
420 | pxa3xx_set_nand_info(&zylonite_nand_info); | ||
421 | } | ||
422 | #else | ||
423 | static inline void zylonite_init_nand(void) {} | ||
424 | #endif /* CONFIG_MTD_NAND_PXA3xx || CONFIG_MTD_NAND_PXA3xx_MODULE */ | ||
425 | |||
318 | static void __init zylonite_init(void) | 426 | static void __init zylonite_init(void) |
319 | { | 427 | { |
320 | /* board-processor specific initialization */ | 428 | /* board-processor specific initialization */ |
@@ -329,9 +437,12 @@ static void __init zylonite_init(void) | |||
329 | smc91x_resources[1].end = gpio_to_irq(gpio_eth_irq); | 437 | smc91x_resources[1].end = gpio_to_irq(gpio_eth_irq); |
330 | platform_device_register(&smc91x_device); | 438 | platform_device_register(&smc91x_device); |
331 | 439 | ||
440 | pxa_set_ac97_info(NULL); | ||
332 | zylonite_init_lcd(); | 441 | zylonite_init_lcd(); |
333 | zylonite_init_mmc(); | 442 | zylonite_init_mmc(); |
334 | zylonite_init_keypad(); | 443 | zylonite_init_keypad(); |
444 | zylonite_init_nand(); | ||
445 | zylonite_init_leds(); | ||
335 | } | 446 | } |
336 | 447 | ||
337 | MACHINE_START(ZYLONITE, "PXA3xx Platform Development Kit (aka Zylonite)") | 448 | MACHINE_START(ZYLONITE, "PXA3xx Platform Development Kit (aka Zylonite)") |