hh.org updates
[hh.org.git] / arch / arm / mach-pxa / htcbeetles / htcbeetles.c
blob175d506779cbded86a3bb6fca6bc9a8ada20f9b4
1 /*
2 * linux/arch/arm/mach-pxa/htcbeetles/htcbeetles.c
4 * Support for the Intel XScale based Palm PDAs. Only the LifeDrive is
5 * supported at the moment.
7 * Author: Alex Osborne <bobofdoom@gmail.com>
9 * USB stubs based on aximx30.c (Michael Opdenacker)
13 #include <linux/kernel.h>
14 #include <linux/init.h>
15 #include <linux/fb.h>
16 #include <linux/platform_device.h>
18 #include <asm/mach-types.h>
19 #include <asm/mach/arch.h>
21 #include <asm/arch/hardware.h>
22 #include <asm/arch/pxafb.h>
23 #include <asm/arch/pxa-regs.h>
24 #include <asm/arch/udc.h>
26 #include <asm/arch/htcbeetles-gpio.h>
27 #include <asm/arch/htcbeetles-asic.h>
29 #include <asm/hardware/ipaq-asic3.h>
30 #include <linux/soc/asic3_base.h>
32 #include "../generic.h"
34 static struct pxafb_mach_info htcbeetles_lcd __initdata = {
35 .pixclock = 480769, // LCCR4 bit is set!
36 .xres = 240,
37 .yres = 240,
38 .bpp = 16,
39 .hsync_len = 4,
40 .vsync_len = 2,
41 .left_margin = 12,
42 .right_margin = 8,
43 .upper_margin = 3,
44 .lower_margin = 3,
46 // .sync = FB_SYNC_HOR_LOW_ACT|FB_SYNC_VERT_LOW_ACT,
48 /* fixme: this is a hack, use constants instead. */
49 .lccr0 = 0x042000b1,
50 .lccr3 = 0x04700019,
54 static struct platform_device htcbeetles_udc = { .name = "htcbeetles_udc", };
56 static struct platform_device *htcbeetles_asic3_devices[] __initdata = {
57 // &htcbeetles_lcd,
58 &htcbeetles_udc,
61 static struct asic3_platform_data htcbeetles_asic3_platform_data = {
64 * These registers are configured as they are on Wince.
66 .gpio_a = {
67 .dir = 0xbfff,
68 .init = 0xc0a5,
69 .sleep_out = 0x0000,
70 .batt_fault_out = 0x0000,
71 .alt_function = 0x6000, //
72 .sleep_conf = 0x000c,
74 .gpio_b = {
75 .dir = 0xe008,
76 .init = 0xd347,
77 .sleep_out = 0x0000,
78 .batt_fault_out = 0x0000,
79 .alt_function = 0x0000, //
80 .sleep_conf = 0x000c,
82 .gpio_c = {
83 .dir = 0xfff7,
84 .init = 0xb640,
85 .sleep_out = 0x0000,
86 .batt_fault_out = 0x0000,
87 .alt_function = 0x003b, // GPIOC_LED_RED | GPIOC_LED_GREEN | GPIOC_LED_BLUE
88 .sleep_conf = 0x000c,
90 .gpio_d = {
91 .dir = 0xffff,
92 .init = 0x2330,
93 .sleep_out = 0x0000,
94 .batt_fault_out = 0x0000,
95 .alt_function = 0x0000, //
96 .sleep_conf = 0x0008,
98 .bus_shift = 1,
100 .child_platform_devs = htcbeetles_asic3_devices,
101 .num_child_platform_devs = ARRAY_SIZE(htcbeetles_asic3_devices),
104 static struct resource htcbeetles_asic3_resources[] = {
105 [0] = {
106 .start = HTCBEETLES_ASIC3_GPIO_PHYS,
107 .end = HTCBEETLES_ASIC3_GPIO_PHYS + IPAQ_ASIC3_MAP_SIZE,
108 .flags = IORESOURCE_MEM,
110 [1] = {
111 .start = HTCBEETLES_IRQ(ASIC3_EXT_INT),
112 .end = HTCBEETLES_IRQ(ASIC3_EXT_INT),
113 .flags = IORESOURCE_IRQ,
115 [2] = {
116 .start = HTCBEETLES_ASIC3_MMC_PHYS,
117 .end = HTCBEETLES_ASIC3_MMC_PHYS + IPAQ_ASIC3_MAP_SIZE,
118 .flags = IORESOURCE_MEM,
120 [3] = {
121 .start = HTCBEETLES_IRQ(ASIC3_SDIO_INT_N),
122 .flags = IORESOURCE_IRQ,
126 struct platform_device htcbeetles_asic3 = {
127 .name = "asic3",
128 .id = 0,
129 .num_resources = ARRAY_SIZE(htcbeetles_asic3_resources),
130 .resource = htcbeetles_asic3_resources,
131 .dev = { .platform_data = &htcbeetles_asic3_platform_data, },
133 EXPORT_SYMBOL(htcbeetles_asic3);
135 static struct platform_device *devices[] __initdata = {
136 &htcbeetles_asic3,
139 #if 0
140 /****************************************************************
141 * USB client controller
142 ****************************************************************/
144 static void udc_command(int cmd)
146 switch (cmd)
148 case PXA2XX_UDC_CMD_DISCONNECT:
149 printk(KERN_NOTICE "USB cmd disconnect\n");
150 // GPSR_BIT(GPIO_NR_HTCAPACHE_USB);
151 break;
152 case PXA2XX_UDC_CMD_CONNECT:
153 printk(KERN_NOTICE "USB cmd connect\n");
154 // GPCR_BIT(GPIO_NR_HTCAPACHE_USB);
155 break;
159 static struct pxa2xx_udc_mach_info htcbeetles_udc_mach_info = {
160 .udc_command = udc_command,
162 #endif
164 static void __init htcbeetles_init(void)
166 set_pxa_fb_info( &htcbeetles_lcd );
168 platform_device_register(&htcbeetles_asic3);
169 // platform_add_devices( devices, ARRAY_SIZE(devices) );
170 // pxa_set_udc_info( &htcbeetles_udc_mach_info );
173 MACHINE_START(HTCBEETLES, "HTC Beetles")
174 .phys_io = 0x40000000,
175 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
176 .boot_params = 0xa0000100,
177 .map_io = pxa_map_io,
178 .init_irq = pxa_init_irq,
179 .timer = &pxa_timer,
180 .init_machine = htcbeetles_init,
181 MACHINE_END