2 * linux/arch/arm/mach-pxa/asus620.c
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
8 * Copyright (c) 2004 Vitaliy Sardyko
9 * Copyright (c) 2003,2004 Adam Turowski
10 * Copyright (c) 2001 Cliff Brake, Accelent Systems Inc.
13 * 2001-09-13: Cliff Brake <cbrake@accelent.com>
14 * Initial code for IDP
15 * 2003-12-03: Adam Turowski
16 * code adaptation for Asus 620
17 * 2004-07-23: Vitaliy Sardyko
18 * updated to 2.6.7 format,
19 * split functions between modules.
21 #include <linux/kernel.h>
22 #include <linux/init.h>
23 #include <linux/major.h>
25 #include <linux/interrupt.h>
27 #include <asm/setup.h>
28 #include <asm/memory.h>
29 #include <asm/mach-types.h>
30 #include <asm/hardware.h>
33 #include <asm/mach/arch.h>
34 #include <asm/mach/map.h>
36 #include <asm/arch/udc.h>
37 #include <asm/arch/pxa-regs.h>
38 #include <../drivers/pcmcia/soc_common.h>
40 #include <asm/arch/asus620-init.h>
41 #include <asm/arch/asus620-gpio.h>
43 #include "../generic.h"
48 # define DPRINTK(fmt, args...) printk("%s: " fmt, __FUNCTION__ , ## args)
50 # define DPRINTK(fmt, args...)
54 static u64 fb_dma_mask
= ~(u64
)0;
56 static void __init
asus620_init_irq(void)
61 static int asus620_udc_is_connected(void) {
62 DPRINTK("asus620_udc_is_connected\n");
63 return GET_A620_GPIO(USB_DETECT
);
66 static void asus620_udc_command(int cmd
) {
68 DPRINTK("asus620_udc_command: %d\n", cmd
);
71 case PXA2XX_UDC_CMD_DISCONNECT
:
72 pxa_gpio_mode (GPIO_NR_A620_USBP_PULLUP
| GPIO_IN
);
74 case PXA2XX_UDC_CMD_CONNECT
:
75 pxa_gpio_mode (GPIO_NR_A620_USBP_PULLUP
| GPIO_OUT
);
76 SET_A620_GPIO(USBP_PULLUP
, 1);
79 DPRINTK("asus620_udc_control: unknown command!\n");
85 static struct map_desc asus620_io_desc
[] __initdata
= {
86 // virtual physical length type
87 {ASUS_IDE_VIRTUAL
, ASUS_IDE_BASE
, ASUS_IDE_SIZE
, MT_DEVICE
}
90 static struct resource pxafb_resources
[]=
95 .flags
= IORESOURCE_MEM
,
100 .flags
= IORESOURCE_IRQ
,
104 static struct resource ad7873_resources
[]=
109 .flags
= IORESOURCE_MEM
,
114 static struct platform_device pxafb_device
= {
118 .dma_mask
= &fb_dma_mask
,
119 .coherent_dma_mask
= 0xFFFFFFFF,
121 .num_resources
= ARRAY_SIZE(pxafb_resources
),
122 .resource
= pxafb_resources
,
125 static struct platform_device ad7873_device
=
127 .name
= "pxa-ad7873",
129 .num_resources
= ARRAY_SIZE(ad7873_resources
),
130 .resource
= ad7873_resources
,
135 static void __init
asus620_map_io(void)
138 iotable_init( asus620_io_desc
, ARRAY_SIZE(asus620_io_desc
) );
140 /* Wake up on CF/SD card insertion, Power and Record buttons,
143 PWER_GPIO0
| PWER_GPIO2
| PWER_GPIO3
| PWER_GPIO4
|
144 PWER_GPIO5
| PWER_GPIO11
| /* Buttons */
145 PWER_GPIO9
| /* CF */
146 PWER_GPIO10
| /* USB */
149 PWER_GPIO0
| PWER_GPIO2
| PWER_GPIO3
| PWER_GPIO4
|
150 PWER_GPIO5
| PWER_GPIO11
| /* Buttons */
151 PWER_GPIO9
| /* CF */
153 PRER
= PWER_GPIO10
; /* USB */
156 DPRINTK("asus620_map_io\n");
160 static struct pxa2xx_udc_mach_info asus620_udc_mach_info
= {
161 .udc_is_connected
= asus620_udc_is_connected
,
162 .udc_command
= asus620_udc_command
,
166 static struct platform_device pxa2xx_pcmcia_device
= {
167 .name
= "pxa2xx-pcmcia",
171 static struct platform_device pxa2xx_udc_device
=
173 .name
= "pxa2xx_udc",
177 static struct platform_device
*devices
[] __initdata
= {
178 &pxa2xx_pcmcia_device
,
179 // &pxa2xx_udc_device,
184 static void __init
asus620_init(void)
186 DPRINTK("asus620_init()\n");
188 pxa_set_udc_info(&asus620_udc_mach_info
);
189 platform_add_devices(devices
, ARRAY_SIZE(devices
));
192 MACHINE_START(A620
, "Asus 620")
193 /* Maintainer: Adam Turowski,Vitaliy Sardyko */
194 .phys_ram
= 0xa0000000,
195 .phys_io
= 0x40000000,
196 .io_pg_offst
= (io_p2v(0x40000000) >> 18) & 0xfffc,
197 .map_io
= asus620_map_io
,
198 .boot_params
= 0xa0000100,
199 .init_irq
= asus620_init_irq
,
200 .init_machine
= asus620_init
,