1 // SPDX-License-Identifier: GPL-2.0-only
3 * linux/arch/arm/mach-pxa/himalaya.c
5 * Hardware definitions for the HTC Himalaya
7 * Based on 2.6.21-hh20's himalaya.c and himalaya_lcd.c
9 * Copyright (c) 2008 Zbynek Michl <Zbynek.Michl@seznam.cz>
12 #include <linux/kernel.h>
13 #include <linux/init.h>
14 #include <linux/device.h>
16 #include <linux/platform_device.h>
18 #include <video/w100fb.h>
20 #include <asm/setup.h>
21 #include <asm/mach-types.h>
22 #include <asm/mach/arch.h>
28 /* ---------------------- Himalaya LCD definitions -------------------- */
30 static struct w100_gen_regs himalaya_lcd_regs
= {
31 .lcd_format
= 0x00000003,
32 .lcdd_cntl1
= 0x00000000,
33 .lcdd_cntl2
= 0x0003ffff,
34 .genlcd_cntl1
= 0x00fff003,
35 .genlcd_cntl2
= 0x00000003,
36 .genlcd_cntl3
= 0x000102aa,
39 static struct w100_mode himalaya4_lcd_mode
= {
46 .crtc_ss
= 0x80150014,
47 .crtc_ls
= 0xa0fb00f7,
48 .crtc_gs
= 0xc0080007,
49 .crtc_vpos_gs
= 0x00080007,
50 .crtc_rev
= 0x0000000a,
51 .crtc_dclk
= 0x81700030,
52 .crtc_gclk
= 0x8015010f,
53 .crtc_goe
= 0x00000000,
56 .pixclk_divider_rotated
= 15,
57 .pixclk_src
= CLK_SRC_PLL
,
59 .sysclk_src
= CLK_SRC_PLL
,
62 static struct w100_mode himalaya6_lcd_mode
= {
69 .crtc_ss
= 0x80150014,
70 .crtc_ls
= 0xa0fb00f7,
71 .crtc_gs
= 0xc0080007,
72 .crtc_vpos_gs
= 0x00080007,
73 .crtc_rev
= 0x0000000a,
74 .crtc_dclk
= 0xa1700030,
75 .crtc_gclk
= 0x8015010f,
76 .crtc_goe
= 0x00000000,
78 .pixclk_divider
= 0xb,
79 .pixclk_divider_rotated
= 4,
80 .pixclk_src
= CLK_SRC_PLL
,
82 .sysclk_src
= CLK_SRC_PLL
,
85 static struct w100_gpio_regs himalaya_w100_gpio_info
= {
86 .init_data1
= 0xffff0000, /* GPIO_DATA */
87 .gpio_dir1
= 0x00000000, /* GPIO_CNTL1 */
88 .gpio_oe1
= 0x003c0000, /* GPIO_CNTL2 */
89 .init_data2
= 0x00000000, /* GPIO_DATA2 */
90 .gpio_dir2
= 0x00000000, /* GPIO_CNTL3 */
91 .gpio_oe2
= 0x00000000, /* GPIO_CNTL4 */
94 static struct w100fb_mach_info himalaya_fb_info
= {
96 .regs
= &himalaya_lcd_regs
,
97 .gpio
= &himalaya_w100_gpio_info
,
98 .xtal_freq
= 16000000,
101 static struct resource himalaya_fb_resources
[] = {
105 .flags
= IORESOURCE_MEM
,
109 static struct platform_device himalaya_fb_device
= {
113 .platform_data
= &himalaya_fb_info
,
115 .num_resources
= ARRAY_SIZE(himalaya_fb_resources
),
116 .resource
= himalaya_fb_resources
,
119 /* ----------------------------------------------------------------------- */
121 static struct platform_device
*devices
[] __initdata
= {
125 static void __init
himalaya_lcd_init(void)
127 int himalaya_boardid
;
129 himalaya_boardid
= 0x4; /* hardcoded (detection needs ASIC3 functions) */
130 printk(KERN_INFO
"himalaya LCD Driver init. boardid=%d\n",
133 switch (himalaya_boardid
) {
135 himalaya_fb_info
.modelist
= &himalaya4_lcd_mode
;
138 himalaya_fb_info
.modelist
= &himalaya6_lcd_mode
;
141 printk(KERN_INFO
"himalaya lcd_init: unknown boardid=%d. Using 0x4\n",
143 himalaya_fb_info
.modelist
= &himalaya4_lcd_mode
;
147 static void __init
himalaya_init(void)
149 pxa_set_ffuart_info(NULL
);
150 pxa_set_btuart_info(NULL
);
151 pxa_set_stuart_info(NULL
);
153 platform_add_devices(devices
, ARRAY_SIZE(devices
));
157 MACHINE_START(HIMALAYA
, "HTC Himalaya")
158 .atag_offset
= 0x100,
159 .map_io
= pxa25x_map_io
,
160 .nr_irqs
= PXA_NR_IRQS
,
161 .init_irq
= pxa25x_init_irq
,
162 .handle_irq
= pxa25x_handle_irq
,
163 .init_machine
= himalaya_init
,
164 .init_time
= pxa_timer_init
,
165 .restart
= pxa_restart
,