diff options
Diffstat (limited to 'arch/arm/mach-w90x900')
-rw-r--r-- | arch/arm/mach-w90x900/cpu.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-w90x900/dev.c | 96 | ||||
-rw-r--r-- | arch/arm/mach-w90x900/include/mach/regs-gcr.h | 39 | ||||
-rw-r--r-- | arch/arm/mach-w90x900/mach-nuc950evb.c | 44 | ||||
-rw-r--r-- | arch/arm/mach-w90x900/nuc910.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-w90x900/nuc950.c | 2 |
6 files changed, 121 insertions, 64 deletions
diff --git a/arch/arm/mach-w90x900/cpu.c b/arch/arm/mach-w90x900/cpu.c index 642207e18198..83c56324a472 100644 --- a/arch/arm/mach-w90x900/cpu.c +++ b/arch/arm/mach-w90x900/cpu.c | |||
@@ -93,7 +93,7 @@ static struct clk_lookup nuc900_clkregs[] = { | |||
93 | DEF_CLKLOOK(&clk_kpi, "nuc900-kpi", NULL), | 93 | DEF_CLKLOOK(&clk_kpi, "nuc900-kpi", NULL), |
94 | DEF_CLKLOOK(&clk_wdt, "nuc900-wdt", NULL), | 94 | DEF_CLKLOOK(&clk_wdt, "nuc900-wdt", NULL), |
95 | DEF_CLKLOOK(&clk_gdma, "nuc900-gdma", NULL), | 95 | DEF_CLKLOOK(&clk_gdma, "nuc900-gdma", NULL), |
96 | DEF_CLKLOOK(&clk_adc, "nuc900-adc", NULL), | 96 | DEF_CLKLOOK(&clk_adc, "nuc900-ts", NULL), |
97 | DEF_CLKLOOK(&clk_usi, "nuc900-spi", NULL), | 97 | DEF_CLKLOOK(&clk_usi, "nuc900-spi", NULL), |
98 | DEF_CLKLOOK(&clk_ext, NULL, "ext"), | 98 | DEF_CLKLOOK(&clk_ext, NULL, "ext"), |
99 | DEF_CLKLOOK(&clk_timer0, NULL, "timer0"), | 99 | DEF_CLKLOOK(&clk_timer0, NULL, "timer0"), |
diff --git a/arch/arm/mach-w90x900/dev.c b/arch/arm/mach-w90x900/dev.c index b2eda4dc1c34..7a1fa6adb7c3 100644 --- a/arch/arm/mach-w90x900/dev.c +++ b/arch/arm/mach-w90x900/dev.c | |||
@@ -36,6 +36,8 @@ | |||
36 | #include <mach/nuc900_spi.h> | 36 | #include <mach/nuc900_spi.h> |
37 | #include <mach/map.h> | 37 | #include <mach/map.h> |
38 | #include <mach/fb.h> | 38 | #include <mach/fb.h> |
39 | #include <mach/regs-ldm.h> | ||
40 | #include <mach/w90p910_keypad.h> | ||
39 | 41 | ||
40 | #include "cpu.h" | 42 | #include "cpu.h" |
41 | 43 | ||
@@ -207,7 +209,7 @@ static struct nuc900_spi_info nuc900_spiflash_data = { | |||
207 | .divider = 24, | 209 | .divider = 24, |
208 | .sleep = 0, | 210 | .sleep = 0, |
209 | .txnum = 0, | 211 | .txnum = 0, |
210 | .txbitlen = 1, | 212 | .txbitlen = 8, |
211 | .bus_num = 0, | 213 | .bus_num = 0, |
212 | }; | 214 | }; |
213 | 215 | ||
@@ -256,7 +258,7 @@ static struct spi_board_info nuc900_spi_board_info[] __initdata = { | |||
256 | .modalias = "m25p80", | 258 | .modalias = "m25p80", |
257 | .max_speed_hz = 20000000, | 259 | .max_speed_hz = 20000000, |
258 | .bus_num = 0, | 260 | .bus_num = 0, |
259 | .chip_select = 1, | 261 | .chip_select = 0, |
260 | .platform_data = &nuc900_spi_flash_data, | 262 | .platform_data = &nuc900_spi_flash_data, |
261 | .mode = SPI_MODE_0, | 263 | .mode = SPI_MODE_0, |
262 | }, | 264 | }, |
@@ -361,6 +363,39 @@ struct platform_device nuc900_device_fmi = { | |||
361 | 363 | ||
362 | /* KPI controller*/ | 364 | /* KPI controller*/ |
363 | 365 | ||
366 | static int nuc900_keymap[] = { | ||
367 | KEY(0, 0, KEY_A), | ||
368 | KEY(0, 1, KEY_B), | ||
369 | KEY(0, 2, KEY_C), | ||
370 | KEY(0, 3, KEY_D), | ||
371 | |||
372 | KEY(1, 0, KEY_E), | ||
373 | KEY(1, 1, KEY_F), | ||
374 | KEY(1, 2, KEY_G), | ||
375 | KEY(1, 3, KEY_H), | ||
376 | |||
377 | KEY(2, 0, KEY_I), | ||
378 | KEY(2, 1, KEY_J), | ||
379 | KEY(2, 2, KEY_K), | ||
380 | KEY(2, 3, KEY_L), | ||
381 | |||
382 | KEY(3, 0, KEY_M), | ||
383 | KEY(3, 1, KEY_N), | ||
384 | KEY(3, 2, KEY_O), | ||
385 | KEY(3, 3, KEY_P), | ||
386 | }; | ||
387 | |||
388 | static struct matrix_keymap_data nuc900_map_data = { | ||
389 | .keymap = nuc900_keymap, | ||
390 | .keymap_size = ARRAY_SIZE(nuc900_keymap), | ||
391 | }; | ||
392 | |||
393 | struct w90p910_keypad_platform_data nuc900_keypad_info = { | ||
394 | .keymap_data = &nuc900_map_data, | ||
395 | .prescale = 0xfa, | ||
396 | .debounce = 0x50, | ||
397 | }; | ||
398 | |||
364 | static struct resource nuc900_kpi_resource[] = { | 399 | static struct resource nuc900_kpi_resource[] = { |
365 | [0] = { | 400 | [0] = { |
366 | .start = W90X900_PA_KPI, | 401 | .start = W90X900_PA_KPI, |
@@ -380,9 +415,49 @@ struct platform_device nuc900_device_kpi = { | |||
380 | .id = -1, | 415 | .id = -1, |
381 | .num_resources = ARRAY_SIZE(nuc900_kpi_resource), | 416 | .num_resources = ARRAY_SIZE(nuc900_kpi_resource), |
382 | .resource = nuc900_kpi_resource, | 417 | .resource = nuc900_kpi_resource, |
418 | .dev = { | ||
419 | .platform_data = &nuc900_keypad_info, | ||
420 | } | ||
383 | }; | 421 | }; |
384 | 422 | ||
385 | #ifdef CONFIG_FB_NUC900 | 423 | /* LCD controller*/ |
424 | |||
425 | static struct nuc900fb_display __initdata nuc900_lcd_info[] = { | ||
426 | /* Giantplus Technology GPM1040A0 320x240 Color TFT LCD */ | ||
427 | [0] = { | ||
428 | .type = LCM_DCCS_VA_SRC_RGB565, | ||
429 | .width = 320, | ||
430 | .height = 240, | ||
431 | .xres = 320, | ||
432 | .yres = 240, | ||
433 | .bpp = 16, | ||
434 | .pixclock = 200000, | ||
435 | .left_margin = 34, | ||
436 | .right_margin = 54, | ||
437 | .hsync_len = 10, | ||
438 | .upper_margin = 18, | ||
439 | .lower_margin = 4, | ||
440 | .vsync_len = 1, | ||
441 | .dccs = 0x8e00041a, | ||
442 | .devctl = 0x060800c0, | ||
443 | .fbctrl = 0x00a000a0, | ||
444 | .scale = 0x04000400, | ||
445 | }, | ||
446 | }; | ||
447 | |||
448 | static struct nuc900fb_mach_info nuc900_fb_info __initdata = { | ||
449 | #if defined(CONFIG_GPM1040A0_320X240) | ||
450 | .displays = &nuc900_lcd_info[0], | ||
451 | #else | ||
452 | .displays = nuc900_lcd_info, | ||
453 | #endif | ||
454 | .num_displays = ARRAY_SIZE(nuc900_lcd_info), | ||
455 | .default_display = 0, | ||
456 | .gpio_dir = 0x00000004, | ||
457 | .gpio_dir_mask = 0xFFFFFFFD, | ||
458 | .gpio_data = 0x00000004, | ||
459 | .gpio_data_mask = 0xFFFFFFFD, | ||
460 | }; | ||
386 | 461 | ||
387 | static struct resource nuc900_lcd_resource[] = { | 462 | static struct resource nuc900_lcd_resource[] = { |
388 | [0] = { | 463 | [0] = { |
@@ -406,23 +481,10 @@ struct platform_device nuc900_device_lcd = { | |||
406 | .dev = { | 481 | .dev = { |
407 | .dma_mask = &nuc900_device_lcd_dmamask, | 482 | .dma_mask = &nuc900_device_lcd_dmamask, |
408 | .coherent_dma_mask = -1, | 483 | .coherent_dma_mask = -1, |
484 | .platform_data = &nuc900_fb_info, | ||
409 | } | 485 | } |
410 | }; | 486 | }; |
411 | 487 | ||
412 | void nuc900_fb_set_platdata(struct nuc900fb_mach_info *pd) | ||
413 | { | ||
414 | struct nuc900fb_mach_info *npd; | ||
415 | |||
416 | npd = kmalloc(sizeof(*npd), GFP_KERNEL); | ||
417 | if (npd) { | ||
418 | memcpy(npd, pd, sizeof(*npd)); | ||
419 | nuc900_device_lcd.dev.platform_data = npd; | ||
420 | } else { | ||
421 | printk(KERN_ERR "no memory for LCD platform data\n"); | ||
422 | } | ||
423 | } | ||
424 | #endif | ||
425 | |||
426 | /* AUDIO controller*/ | 488 | /* AUDIO controller*/ |
427 | static u64 nuc900_device_audio_dmamask = -1; | 489 | static u64 nuc900_device_audio_dmamask = -1; |
428 | static struct resource nuc900_ac97_resource[] = { | 490 | static struct resource nuc900_ac97_resource[] = { |
diff --git a/arch/arm/mach-w90x900/include/mach/regs-gcr.h b/arch/arm/mach-w90x900/include/mach/regs-gcr.h new file mode 100644 index 000000000000..6087abd93ef5 --- /dev/null +++ b/arch/arm/mach-w90x900/include/mach/regs-gcr.h | |||
@@ -0,0 +1,39 @@ | |||
1 | /* | ||
2 | * arch/arm/mach-w90x900/include/mach/regs-gcr.h | ||
3 | * | ||
4 | * Copyright (c) 2010 Nuvoton technology corporation | ||
5 | * All rights reserved. | ||
6 | * | ||
7 | * Wan ZongShun <mcuos.com@gmail.com> | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License as published by | ||
11 | * the Free Software Foundation; either version 2 of the License, or | ||
12 | * (at your option) any later version. | ||
13 | * | ||
14 | */ | ||
15 | |||
16 | #ifndef __ASM_ARCH_REGS_GCR_H | ||
17 | #define __ASM_ARCH_REGS_GCR_H | ||
18 | |||
19 | /* Global control registers */ | ||
20 | |||
21 | #define GCR_BA W90X900_VA_GCR | ||
22 | #define REG_PDID (GCR_BA+0x000) | ||
23 | #define REG_PWRON (GCR_BA+0x004) | ||
24 | #define REG_ARBCON (GCR_BA+0x008) | ||
25 | #define REG_MFSEL (GCR_BA+0x00C) | ||
26 | #define REG_EBIDPE (GCR_BA+0x010) | ||
27 | #define REG_LCDDPE (GCR_BA+0x014) | ||
28 | #define REG_GPIOCPE (GCR_BA+0x018) | ||
29 | #define REG_GPIODPE (GCR_BA+0x01C) | ||
30 | #define REG_GPIOEPE (GCR_BA+0x020) | ||
31 | #define REG_GPIOFPE (GCR_BA+0x024) | ||
32 | #define REG_GPIOGPE (GCR_BA+0x028) | ||
33 | #define REG_GPIOHPE (GCR_BA+0x02C) | ||
34 | #define REG_GPIOIPE (GCR_BA+0x030) | ||
35 | #define REG_GTMP1 (GCR_BA+0x034) | ||
36 | #define REG_GTMP2 (GCR_BA+0x038) | ||
37 | #define REG_GTMP3 (GCR_BA+0x03C) | ||
38 | |||
39 | #endif /* __ASM_ARCH_REGS_GCR_H */ | ||
diff --git a/arch/arm/mach-w90x900/mach-nuc950evb.c b/arch/arm/mach-w90x900/mach-nuc950evb.c index b3edc3cccf52..04d295f89eb0 100644 --- a/arch/arm/mach-w90x900/mach-nuc950evb.c +++ b/arch/arm/mach-w90x900/mach-nuc950evb.c | |||
@@ -20,51 +20,10 @@ | |||
20 | #include <asm/mach/map.h> | 20 | #include <asm/mach/map.h> |
21 | #include <asm/mach-types.h> | 21 | #include <asm/mach-types.h> |
22 | #include <mach/map.h> | 22 | #include <mach/map.h> |
23 | #include <mach/regs-ldm.h> | ||
24 | #include <mach/fb.h> | 23 | #include <mach/fb.h> |
25 | 24 | ||
26 | #include "nuc950.h" | 25 | #include "nuc950.h" |
27 | 26 | ||
28 | #ifdef CONFIG_FB_NUC900 | ||
29 | /* LCD Controller */ | ||
30 | static struct nuc900fb_display __initdata nuc950_lcd_info[] = { | ||
31 | /* Giantplus Technology GPM1040A0 320x240 Color TFT LCD */ | ||
32 | [0] = { | ||
33 | .type = LCM_DCCS_VA_SRC_RGB565, | ||
34 | .width = 320, | ||
35 | .height = 240, | ||
36 | .xres = 320, | ||
37 | .yres = 240, | ||
38 | .bpp = 16, | ||
39 | .pixclock = 200000, | ||
40 | .left_margin = 34, | ||
41 | .right_margin = 54, | ||
42 | .hsync_len = 10, | ||
43 | .upper_margin = 18, | ||
44 | .lower_margin = 4, | ||
45 | .vsync_len = 1, | ||
46 | .dccs = 0x8e00041a, | ||
47 | .devctl = 0x060800c0, | ||
48 | .fbctrl = 0x00a000a0, | ||
49 | .scale = 0x04000400, | ||
50 | }, | ||
51 | }; | ||
52 | |||
53 | static struct nuc900fb_mach_info nuc950_fb_info __initdata = { | ||
54 | #if defined(CONFIG_GPM1040A0_320X240) | ||
55 | .displays = &nuc950_lcd_info[0], | ||
56 | #else | ||
57 | .displays = nuc950_lcd_info, | ||
58 | #endif | ||
59 | .num_displays = ARRAY_SIZE(nuc950_lcd_info), | ||
60 | .default_display = 0, | ||
61 | .gpio_dir = 0x00000004, | ||
62 | .gpio_dir_mask = 0xFFFFFFFD, | ||
63 | .gpio_data = 0x00000004, | ||
64 | .gpio_data_mask = 0xFFFFFFFD, | ||
65 | }; | ||
66 | #endif | ||
67 | |||
68 | static void __init nuc950evb_map_io(void) | 27 | static void __init nuc950evb_map_io(void) |
69 | { | 28 | { |
70 | nuc950_map_io(); | 29 | nuc950_map_io(); |
@@ -74,9 +33,6 @@ static void __init nuc950evb_map_io(void) | |||
74 | static void __init nuc950evb_init(void) | 33 | static void __init nuc950evb_init(void) |
75 | { | 34 | { |
76 | nuc950_board_init(); | 35 | nuc950_board_init(); |
77 | #ifdef CONFIG_FB_NUC900 | ||
78 | nuc900_fb_set_platdata(&nuc950_fb_info); | ||
79 | #endif | ||
80 | } | 36 | } |
81 | 37 | ||
82 | MACHINE_START(W90P950EVB, "W90P950EVB") | 38 | MACHINE_START(W90P950EVB, "W90P950EVB") |
diff --git a/arch/arm/mach-w90x900/nuc910.c b/arch/arm/mach-w90x900/nuc910.c index 656f03b3b629..1523f4136985 100644 --- a/arch/arm/mach-w90x900/nuc910.c +++ b/arch/arm/mach-w90x900/nuc910.c | |||
@@ -26,6 +26,8 @@ | |||
26 | static struct platform_device *nuc910_dev[] __initdata = { | 26 | static struct platform_device *nuc910_dev[] __initdata = { |
27 | &nuc900_device_ts, | 27 | &nuc900_device_ts, |
28 | &nuc900_device_rtc, | 28 | &nuc900_device_rtc, |
29 | &nuc900_device_lcd, | ||
30 | &nuc900_device_kpi, | ||
29 | }; | 31 | }; |
30 | 32 | ||
31 | /* define specific CPU platform io map */ | 33 | /* define specific CPU platform io map */ |
diff --git a/arch/arm/mach-w90x900/nuc950.c b/arch/arm/mach-w90x900/nuc950.c index 4d1f1ab044c4..5704f74a50ee 100644 --- a/arch/arm/mach-w90x900/nuc950.c +++ b/arch/arm/mach-w90x900/nuc950.c | |||
@@ -26,9 +26,7 @@ | |||
26 | static struct platform_device *nuc950_dev[] __initdata = { | 26 | static struct platform_device *nuc950_dev[] __initdata = { |
27 | &nuc900_device_kpi, | 27 | &nuc900_device_kpi, |
28 | &nuc900_device_fmi, | 28 | &nuc900_device_fmi, |
29 | #ifdef CONFIG_FB_NUC900 | ||
30 | &nuc900_device_lcd, | 29 | &nuc900_device_lcd, |
31 | #endif | ||
32 | }; | 30 | }; |
33 | 31 | ||
34 | /* define specific CPU platform io map */ | 32 | /* define specific CPU platform io map */ |