diff options
author | Zbynek Michl <Zbynek.Michl@seznam.cz> | 2009-01-01 18:26:13 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2009-02-10 06:29:41 -0500 |
commit | b7eb1a5ed50c6f622664bb8a7113313fa8b6dd1e (patch) | |
tree | 6339a4f9c88fd4b7f1e8e5d4d7c02732cb41b3a4 /arch/arm/mach-pxa/himalaya.c | |
parent | 4ce255c1420dd7c4b97ad4dabd13fa5d862ad700 (diff) |
[ARM] 5355/1: Adding support for the HTC Himalaya and its framebuffer
Patch adds support for the HTC Himalaya device. It includes hardware definitions and w100fb support.
Signed-off-by: Zbynek Michl <Zbynek.Michl@seznam.cz>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-pxa/himalaya.c')
-rw-r--r-- | arch/arm/mach-pxa/himalaya.c | 168 |
1 files changed, 168 insertions, 0 deletions
diff --git a/arch/arm/mach-pxa/himalaya.c b/arch/arm/mach-pxa/himalaya.c new file mode 100644 index 000000000000..00884e5a6042 --- /dev/null +++ b/arch/arm/mach-pxa/himalaya.c | |||
@@ -0,0 +1,168 @@ | |||
1 | /* | ||
2 | * linux/arch/arm/mach-pxa/himalaya.c | ||
3 | * | ||
4 | * Hardware definitions for the HTC Himalaya | ||
5 | * | ||
6 | * Based on 2.6.21-hh20's himalaya.c and himalaya_lcd.c | ||
7 | * | ||
8 | * Copyright (c) 2008 Zbynek Michl <Zbynek.Michl@seznam.cz> | ||
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/kernel.h> | ||
16 | #include <linux/init.h> | ||
17 | #include <linux/device.h> | ||
18 | #include <linux/fb.h> | ||
19 | #include <linux/platform_device.h> | ||
20 | |||
21 | #include <video/w100fb.h> | ||
22 | |||
23 | #include <asm/setup.h> | ||
24 | #include <asm/mach-types.h> | ||
25 | #include <asm/mach/arch.h> | ||
26 | |||
27 | #include <mach/mfp-pxa25x.h> | ||
28 | #include <mach/hardware.h> | ||
29 | #include <mach/pxa-regs.h> | ||
30 | #include <mach/pxa2xx-regs.h> | ||
31 | |||
32 | #include "generic.h" | ||
33 | |||
34 | /* ---------------------- Himalaya LCD definitions -------------------- */ | ||
35 | |||
36 | static struct w100_gen_regs himalaya_lcd_regs = { | ||
37 | .lcd_format = 0x00000003, | ||
38 | .lcdd_cntl1 = 0x00000000, | ||
39 | .lcdd_cntl2 = 0x0003ffff, | ||
40 | .genlcd_cntl1 = 0x00fff003, | ||
41 | .genlcd_cntl2 = 0x00000003, | ||
42 | .genlcd_cntl3 = 0x000102aa, | ||
43 | }; | ||
44 | |||
45 | static struct w100_mode himalaya4_lcd_mode = { | ||
46 | .xres = 240, | ||
47 | .yres = 320, | ||
48 | .left_margin = 0, | ||
49 | .right_margin = 31, | ||
50 | .upper_margin = 15, | ||
51 | .lower_margin = 0, | ||
52 | .crtc_ss = 0x80150014, | ||
53 | .crtc_ls = 0xa0fb00f7, | ||
54 | .crtc_gs = 0xc0080007, | ||
55 | .crtc_vpos_gs = 0x00080007, | ||
56 | .crtc_rev = 0x0000000a, | ||
57 | .crtc_dclk = 0x81700030, | ||
58 | .crtc_gclk = 0x8015010f, | ||
59 | .crtc_goe = 0x00000000, | ||
60 | .pll_freq = 80, | ||
61 | .pixclk_divider = 15, | ||
62 | .pixclk_divider_rotated = 15, | ||
63 | .pixclk_src = CLK_SRC_PLL, | ||
64 | .sysclk_divider = 0, | ||
65 | .sysclk_src = CLK_SRC_PLL, | ||
66 | }; | ||
67 | |||
68 | static struct w100_mode himalaya6_lcd_mode = { | ||
69 | .xres = 240, | ||
70 | .yres = 320, | ||
71 | .left_margin = 9, | ||
72 | .right_margin = 8, | ||
73 | .upper_margin = 5, | ||
74 | .lower_margin = 4, | ||
75 | .crtc_ss = 0x80150014, | ||
76 | .crtc_ls = 0xa0fb00f7, | ||
77 | .crtc_gs = 0xc0080007, | ||
78 | .crtc_vpos_gs = 0x00080007, | ||
79 | .crtc_rev = 0x0000000a, | ||
80 | .crtc_dclk = 0xa1700030, | ||
81 | .crtc_gclk = 0x8015010f, | ||
82 | .crtc_goe = 0x00000000, | ||
83 | .pll_freq = 95, | ||
84 | .pixclk_divider = 0xb, | ||
85 | .pixclk_divider_rotated = 4, | ||
86 | .pixclk_src = CLK_SRC_PLL, | ||
87 | .sysclk_divider = 1, | ||
88 | .sysclk_src = CLK_SRC_PLL, | ||
89 | }; | ||
90 | |||
91 | static struct w100_gpio_regs himalaya_w100_gpio_info = { | ||
92 | .init_data1 = 0xffff0000, /* GPIO_DATA */ | ||
93 | .gpio_dir1 = 0x00000000, /* GPIO_CNTL1 */ | ||
94 | .gpio_oe1 = 0x003c0000, /* GPIO_CNTL2 */ | ||
95 | .init_data2 = 0x00000000, /* GPIO_DATA2 */ | ||
96 | .gpio_dir2 = 0x00000000, /* GPIO_CNTL3 */ | ||
97 | .gpio_oe2 = 0x00000000, /* GPIO_CNTL4 */ | ||
98 | }; | ||
99 | |||
100 | static struct w100fb_mach_info himalaya_fb_info = { | ||
101 | .num_modes = 1, | ||
102 | .regs = &himalaya_lcd_regs, | ||
103 | .gpio = &himalaya_w100_gpio_info, | ||
104 | .xtal_freq = 16000000, | ||
105 | }; | ||
106 | |||
107 | static struct resource himalaya_fb_resources[] = { | ||
108 | [0] = { | ||
109 | .start = 0x08000000, | ||
110 | .end = 0x08ffffff, | ||
111 | .flags = IORESOURCE_MEM, | ||
112 | }, | ||
113 | }; | ||
114 | |||
115 | static struct platform_device himalaya_fb_device = { | ||
116 | .name = "w100fb", | ||
117 | .id = -1, | ||
118 | .dev = { | ||
119 | .platform_data = &himalaya_fb_info, | ||
120 | }, | ||
121 | .num_resources = ARRAY_SIZE(himalaya_fb_resources), | ||
122 | .resource = himalaya_fb_resources, | ||
123 | }; | ||
124 | |||
125 | /* ----------------------------------------------------------------------- */ | ||
126 | |||
127 | static struct platform_device *devices[] __initdata = { | ||
128 | &himalaya_fb_device, | ||
129 | }; | ||
130 | |||
131 | static void __init himalaya_lcd_init(void) | ||
132 | { | ||
133 | int himalaya_boardid; | ||
134 | |||
135 | himalaya_boardid = 0x4; /* hardcoded (detection needs ASIC3 functions) */ | ||
136 | printk(KERN_INFO "himalaya LCD Driver init. boardid=%d\n", | ||
137 | himalaya_boardid); | ||
138 | |||
139 | switch (himalaya_boardid) { | ||
140 | case 0x4: | ||
141 | himalaya_fb_info.modelist = &himalaya4_lcd_mode; | ||
142 | break; | ||
143 | case 0x6: | ||
144 | himalaya_fb_info.modelist = &himalaya6_lcd_mode; | ||
145 | break; | ||
146 | default: | ||
147 | printk(KERN_INFO "himalaya lcd_init: unknown boardid=%d. Using 0x4\n", | ||
148 | himalaya_boardid); | ||
149 | himalaya_fb_info.modelist = &himalaya4_lcd_mode; | ||
150 | } | ||
151 | } | ||
152 | |||
153 | static void __init himalaya_init(void) | ||
154 | { | ||
155 | himalaya_lcd_init(); | ||
156 | platform_add_devices(devices, ARRAY_SIZE(devices)); | ||
157 | } | ||
158 | |||
159 | |||
160 | MACHINE_START(HIMALAYA, "HTC Himalaya") | ||
161 | .phys_io = 0x40000000, | ||
162 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, | ||
163 | .boot_params = 0xa0000100, | ||
164 | .map_io = pxa_map_io, | ||
165 | .init_irq = pxa25x_init_irq, | ||
166 | .init_machine = himalaya_init, | ||
167 | .timer = &pxa_timer, | ||
168 | MACHINE_END | ||