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/pxa25x.h>
31 /* ---------------------- Himalaya LCD definitions -------------------- */
33 static struct w100_gen_regs himalaya_lcd_regs
= {
34 .lcd_format
= 0x00000003,
35 .lcdd_cntl1
= 0x00000000,
36 .lcdd_cntl2
= 0x0003ffff,
37 .genlcd_cntl1
= 0x00fff003,
38 .genlcd_cntl2
= 0x00000003,
39 .genlcd_cntl3
= 0x000102aa,
42 static struct w100_mode himalaya4_lcd_mode
= {
49 .crtc_ss
= 0x80150014,
50 .crtc_ls
= 0xa0fb00f7,
51 .crtc_gs
= 0xc0080007,
52 .crtc_vpos_gs
= 0x00080007,
53 .crtc_rev
= 0x0000000a,
54 .crtc_dclk
= 0x81700030,
55 .crtc_gclk
= 0x8015010f,
56 .crtc_goe
= 0x00000000,
59 .pixclk_divider_rotated
= 15,
60 .pixclk_src
= CLK_SRC_PLL
,
62 .sysclk_src
= CLK_SRC_PLL
,
65 static struct w100_mode himalaya6_lcd_mode
= {
72 .crtc_ss
= 0x80150014,
73 .crtc_ls
= 0xa0fb00f7,
74 .crtc_gs
= 0xc0080007,
75 .crtc_vpos_gs
= 0x00080007,
76 .crtc_rev
= 0x0000000a,
77 .crtc_dclk
= 0xa1700030,
78 .crtc_gclk
= 0x8015010f,
79 .crtc_goe
= 0x00000000,
81 .pixclk_divider
= 0xb,
82 .pixclk_divider_rotated
= 4,
83 .pixclk_src
= CLK_SRC_PLL
,
85 .sysclk_src
= CLK_SRC_PLL
,
88 static struct w100_gpio_regs himalaya_w100_gpio_info
= {
89 .init_data1
= 0xffff0000, /* GPIO_DATA */
90 .gpio_dir1
= 0x00000000, /* GPIO_CNTL1 */
91 .gpio_oe1
= 0x003c0000, /* GPIO_CNTL2 */
92 .init_data2
= 0x00000000, /* GPIO_DATA2 */
93 .gpio_dir2
= 0x00000000, /* GPIO_CNTL3 */
94 .gpio_oe2
= 0x00000000, /* GPIO_CNTL4 */
97 static struct w100fb_mach_info himalaya_fb_info
= {
99 .regs
= &himalaya_lcd_regs
,
100 .gpio
= &himalaya_w100_gpio_info
,
101 .xtal_freq
= 16000000,
104 static struct resource himalaya_fb_resources
[] = {
108 .flags
= IORESOURCE_MEM
,
112 static struct platform_device himalaya_fb_device
= {
116 .platform_data
= &himalaya_fb_info
,
118 .num_resources
= ARRAY_SIZE(himalaya_fb_resources
),
119 .resource
= himalaya_fb_resources
,
122 /* ----------------------------------------------------------------------- */
124 static struct platform_device
*devices
[] __initdata
= {
128 static void __init
himalaya_lcd_init(void)
130 int himalaya_boardid
;
132 himalaya_boardid
= 0x4; /* hardcoded (detection needs ASIC3 functions) */
133 printk(KERN_INFO
"himalaya LCD Driver init. boardid=%d\n",
136 switch (himalaya_boardid
) {
138 himalaya_fb_info
.modelist
= &himalaya4_lcd_mode
;
141 himalaya_fb_info
.modelist
= &himalaya6_lcd_mode
;
144 printk(KERN_INFO
"himalaya lcd_init: unknown boardid=%d. Using 0x4\n",
146 himalaya_fb_info
.modelist
= &himalaya4_lcd_mode
;
150 static void __init
himalaya_init(void)
152 pxa_set_ffuart_info(NULL
);
153 pxa_set_btuart_info(NULL
);
154 pxa_set_stuart_info(NULL
);
156 platform_add_devices(devices
, ARRAY_SIZE(devices
));
160 MACHINE_START(HIMALAYA
, "HTC Himalaya")
161 .atag_offset
= 0x100,
162 .map_io
= pxa25x_map_io
,
163 .nr_irqs
= PXA_NR_IRQS
,
164 .init_irq
= pxa25x_init_irq
,
165 .handle_irq
= pxa25x_handle_irq
,
166 .init_machine
= himalaya_init
,
167 .init_time
= pxa_timer_init
,
168 .restart
= pxa_restart
,