wanzongshun | 936fbe9 | 2009-08-21 07:08:24 +0100 | [diff] [blame] | 1 | /* |
| 2 | * linux/arch/arm/mach-w90x900/mach-nuc950evb.c |
| 3 | * |
| 4 | * Based on mach-s3c2410/mach-smdk2410.c by Jonas Dietsche |
| 5 | * |
| 6 | * Copyright (C) 2008 Nuvoton technology corporation. |
| 7 | * |
| 8 | * Wan ZongShun <mcuos.com@gmail.com> |
| 9 | * |
| 10 | * This program is free software; you can redistribute it and/or |
| 11 | * modify it under the terms of the GNU General Public License as |
| 12 | * published by the Free Software Foundation;version 2 of the License. |
Wang Qiang | 8661970 | 2010-03-10 15:21:47 -0800 | [diff] [blame] | 13 | * history: |
| 14 | * Wang Qiang (rurality.linux@gmail.com) add LCD support |
wanzongshun | 936fbe9 | 2009-08-21 07:08:24 +0100 | [diff] [blame] | 15 | * |
| 16 | */ |
| 17 | |
| 18 | #include <linux/platform_device.h> |
| 19 | #include <asm/mach/arch.h> |
| 20 | #include <asm/mach/map.h> |
| 21 | #include <asm/mach-types.h> |
| 22 | #include <mach/map.h> |
Wang Qiang | 8661970 | 2010-03-10 15:21:47 -0800 | [diff] [blame] | 23 | #include <mach/regs-ldm.h> |
| 24 | #include <mach/fb.h> |
wanzongshun | 936fbe9 | 2009-08-21 07:08:24 +0100 | [diff] [blame] | 25 | |
| 26 | #include "nuc950.h" |
| 27 | |
Wang Qiang | 8661970 | 2010-03-10 15:21:47 -0800 | [diff] [blame] | 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 | |
wanzongshun | 936fbe9 | 2009-08-21 07:08:24 +0100 | [diff] [blame] | 68 | static void __init nuc950evb_map_io(void) |
| 69 | { |
| 70 | nuc950_map_io(); |
| 71 | nuc950_init_clocks(); |
| 72 | } |
| 73 | |
| 74 | static void __init nuc950evb_init(void) |
| 75 | { |
| 76 | nuc950_board_init(); |
Wang Qiang | 8661970 | 2010-03-10 15:21:47 -0800 | [diff] [blame] | 77 | #ifdef CONFIG_FB_NUC900 |
| 78 | nuc900_fb_set_platdata(&nuc950_fb_info); |
| 79 | #endif |
wanzongshun | 936fbe9 | 2009-08-21 07:08:24 +0100 | [diff] [blame] | 80 | } |
| 81 | |
| 82 | MACHINE_START(W90P950EVB, "W90P950EVB") |
| 83 | /* Maintainer: Wan ZongShun */ |
| 84 | .phys_io = W90X900_PA_UART, |
| 85 | .io_pg_offst = (((u32)W90X900_VA_UART) >> 18) & 0xfffc, |
| 86 | .boot_params = 0, |
| 87 | .map_io = nuc950evb_map_io, |
| 88 | .init_irq = nuc900_init_irq, |
| 89 | .init_machine = nuc950evb_init, |
| 90 | .timer = &nuc900_timer, |
| 91 | MACHINE_END |