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>
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!
46 // .sync = FB_SYNC_HOR_LOW_ACT|FB_SYNC_VERT_LOW_ACT,
48 /* fixme: this is a hack, use constants instead. */
54 static struct platform_device htcbeetles_udc
= { .name
= "htcbeetles_udc", };
56 static struct platform_device
*htcbeetles_asic3_devices
[] __initdata
= {
61 static struct asic3_platform_data htcbeetles_asic3_platform_data
= {
64 * These registers are configured as they are on Wince.
70 .batt_fault_out
= 0x0000,
71 .alt_function
= 0x6000, //
78 .batt_fault_out
= 0x0000,
79 .alt_function
= 0x0000, //
86 .batt_fault_out
= 0x0000,
87 .alt_function
= 0x003b, // GPIOC_LED_RED | GPIOC_LED_GREEN | GPIOC_LED_BLUE
94 .batt_fault_out
= 0x0000,
95 .alt_function
= 0x0000, //
100 .child_platform_devs
= htcbeetles_asic3_devices
,
101 .num_child_platform_devs
= ARRAY_SIZE(htcbeetles_asic3_devices
),
104 static struct resource htcbeetles_asic3_resources
[] = {
106 .start
= HTCBEETLES_ASIC3_GPIO_PHYS
,
107 .end
= HTCBEETLES_ASIC3_GPIO_PHYS
+ IPAQ_ASIC3_MAP_SIZE
,
108 .flags
= IORESOURCE_MEM
,
111 .start
= HTCBEETLES_IRQ(ASIC3_EXT_INT
),
112 .end
= HTCBEETLES_IRQ(ASIC3_EXT_INT
),
113 .flags
= IORESOURCE_IRQ
,
116 .start
= HTCBEETLES_ASIC3_MMC_PHYS
,
117 .end
= HTCBEETLES_ASIC3_MMC_PHYS
+ IPAQ_ASIC3_MAP_SIZE
,
118 .flags
= IORESOURCE_MEM
,
121 .start
= HTCBEETLES_IRQ(ASIC3_SDIO_INT_N
),
122 .flags
= IORESOURCE_IRQ
,
126 struct platform_device htcbeetles_asic3
= {
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
= {
140 /****************************************************************
141 * USB client controller
142 ****************************************************************/
144 static void udc_command(int cmd
)
148 case PXA2XX_UDC_CMD_DISCONNECT
:
149 printk(KERN_NOTICE
"USB cmd disconnect\n");
150 // GPSR_BIT(GPIO_NR_HTCAPACHE_USB);
152 case PXA2XX_UDC_CMD_CONNECT
:
153 printk(KERN_NOTICE
"USB cmd connect\n");
154 // GPCR_BIT(GPIO_NR_HTCAPACHE_USB);
159 static struct pxa2xx_udc_mach_info htcbeetles_udc_mach_info
= {
160 .udc_command
= udc_command
,
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
,
180 .init_machine
= htcbeetles_init
,