2 * linux/arch/arm/mach-pxa/himalaya.c
4 * Hardware definitions for the HTC Himalaya
6 * Based on 2.6.21-hh20's himalaya.c and himalaya_lcd.c
8 * Copyright (c) 2008 Zbynek Michl <Zbynek.Michl@seznam.cz>
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.
15 #include <linux/kernel.h>
16 #include <linux/init.h>
17 #include <linux/device.h>
19 #include <linux/platform_device.h>
21 #include <video/w100fb.h>
23 #include <asm/setup.h>
24 #include <asm/mach-types.h>
25 #include <asm/mach/arch.h>
27 #include <mach/mfp-pxa25x.h>
28 #include <mach/hardware.h>
32 /* ---------------------- Himalaya LCD definitions -------------------- */
34 static struct w100_gen_regs himalaya_lcd_regs = {
35 .lcd_format = 0x00000003,
36 .lcdd_cntl1 = 0x00000000,
37 .lcdd_cntl2 = 0x0003ffff,
38 .genlcd_cntl1 = 0x00fff003,
39 .genlcd_cntl2 = 0x00000003,
40 .genlcd_cntl3 = 0x000102aa,
43 static struct w100_mode himalaya4_lcd_mode = {
50 .crtc_ss = 0x80150014,
51 .crtc_ls = 0xa0fb00f7,
52 .crtc_gs = 0xc0080007,
53 .crtc_vpos_gs = 0x00080007,
54 .crtc_rev = 0x0000000a,
55 .crtc_dclk = 0x81700030,
56 .crtc_gclk = 0x8015010f,
57 .crtc_goe = 0x00000000,
60 .pixclk_divider_rotated = 15,
61 .pixclk_src = CLK_SRC_PLL,
63 .sysclk_src = CLK_SRC_PLL,
66 static struct w100_mode himalaya6_lcd_mode = {
73 .crtc_ss = 0x80150014,
74 .crtc_ls = 0xa0fb00f7,
75 .crtc_gs = 0xc0080007,
76 .crtc_vpos_gs = 0x00080007,
77 .crtc_rev = 0x0000000a,
78 .crtc_dclk = 0xa1700030,
79 .crtc_gclk = 0x8015010f,
80 .crtc_goe = 0x00000000,
82 .pixclk_divider = 0xb,
83 .pixclk_divider_rotated = 4,
84 .pixclk_src = CLK_SRC_PLL,
86 .sysclk_src = CLK_SRC_PLL,
89 static struct w100_gpio_regs himalaya_w100_gpio_info = {
90 .init_data1 = 0xffff0000, /* GPIO_DATA */
91 .gpio_dir1 = 0x00000000, /* GPIO_CNTL1 */
92 .gpio_oe1 = 0x003c0000, /* GPIO_CNTL2 */
93 .init_data2 = 0x00000000, /* GPIO_DATA2 */
94 .gpio_dir2 = 0x00000000, /* GPIO_CNTL3 */
95 .gpio_oe2 = 0x00000000, /* GPIO_CNTL4 */
98 static struct w100fb_mach_info himalaya_fb_info = {
100 .regs = &himalaya_lcd_regs,
101 .gpio = &himalaya_w100_gpio_info,
102 .xtal_freq = 16000000,
105 static struct resource himalaya_fb_resources[] = {
109 .flags = IORESOURCE_MEM,
113 static struct platform_device himalaya_fb_device = {
117 .platform_data = &himalaya_fb_info,
119 .num_resources = ARRAY_SIZE(himalaya_fb_resources),
120 .resource = himalaya_fb_resources,
123 /* ----------------------------------------------------------------------- */
125 static struct platform_device *devices[] __initdata = {
129 static void __init himalaya_lcd_init(void)
131 int himalaya_boardid;
133 himalaya_boardid = 0x4; /* hardcoded (detection needs ASIC3 functions) */
134 printk(KERN_INFO "himalaya LCD Driver init. boardid=%d\n",
137 switch (himalaya_boardid) {
139 himalaya_fb_info.modelist = &himalaya4_lcd_mode;
142 himalaya_fb_info.modelist = &himalaya6_lcd_mode;
145 printk(KERN_INFO "himalaya lcd_init: unknown boardid=%d. Using 0x4\n",
147 himalaya_fb_info.modelist = &himalaya4_lcd_mode;
151 static void __init himalaya_init(void)
154 platform_add_devices(devices, ARRAY_SIZE(devices));
158 MACHINE_START(HIMALAYA, "HTC Himalaya")
159 .phys_io = 0x40000000,
160 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
161 .boot_params = 0xa0000100,
162 .map_io = pxa_map_io,
163 .init_irq = pxa25x_init_irq,
164 .init_machine = himalaya_init,