2 * linux/arch/arm/mach-pxa/idp.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) 2001 Cliff Brake, Accelent Systems Inc.
10 * 2001-09-13: Cliff Brake <cbrake@accelent.com>
13 * 2005-02-15: Cliff Brake <cliff.brake@gmail.com>
14 * <http://www.vibren.com> <http://bec-systems.com>
15 * Updated for 2.6 kernel
19 #include <linux/init.h>
20 #include <linux/interrupt.h>
21 #include <linux/device.h>
24 #include <asm/setup.h>
25 #include <asm/memory.h>
26 #include <asm/mach-types.h>
27 #include <asm/hardware.h>
30 #include <asm/mach/arch.h>
31 #include <asm/mach/map.h>
33 #include <asm/arch/pxa-regs.h>
34 #include <asm/arch/idp.h>
35 #include <asm/arch/pxafb.h>
36 #include <asm/arch/bitfield.h>
37 #include <asm/arch/mmc.h>
42 * - add pxa2xx_audio_ops_t device structure
43 * - Ethernet interrupt
46 static struct resource smc91x_resources[] = {
48 .start = (IDP_ETH_PHYS + 0x300),
49 .end = (IDP_ETH_PHYS + 0xfffff),
50 .flags = IORESOURCE_MEM,
55 .flags = IORESOURCE_IRQ,
59 static struct platform_device smc91x_device = {
62 .num_resources = ARRAY_SIZE(smc91x_resources),
63 .resource = smc91x_resources,
66 static void idp_backlight_power(int on)
69 IDP_CPLD_LCD |= (1<<1);
71 IDP_CPLD_LCD &= ~(1<<1);
75 static void idp_vlcd(int on)
78 IDP_CPLD_LCD |= (1<<2);
80 IDP_CPLD_LCD &= ~(1<<2);
84 static void idp_lcd_power(int on)
87 IDP_CPLD_LCD |= (1<<0);
89 IDP_CPLD_LCD &= ~(1<<0);
92 /* call idp_vlcd for now as core driver does not support
93 * both power and vlcd hooks. Note, this is not technically
94 * the correct sequence, but seems to work. Disclaimer:
95 * this may eventually damage the display.
101 static struct pxafb_mach_info sharp_lm8v31 __initdata = {
112 .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
117 .lccr3 = LCCR3_PCP | LCCR3_Acb(255),
118 .pxafb_backlight_power = &idp_backlight_power,
119 .pxafb_lcd_power = &idp_lcd_power
122 static int idp_mci_init(struct device *dev, irqreturn_t (*idp_detect_int)(int, void *, struct pt_regs *), void *data)
124 /* setup GPIO for PXA25x MMC controller */
125 pxa_gpio_mode(GPIO6_MMCCLK_MD);
126 pxa_gpio_mode(GPIO8_MMCCS0_MD);
131 static struct pxamci_platform_data idp_mci_platform_data = {
132 .ocr_mask = MMC_VDD_32_33|MMC_VDD_33_34,
133 .init = idp_mci_init,
136 static void __init idp_init(void)
138 printk("idp_init()\n");
140 platform_device_register(&smc91x_device);
141 //platform_device_register(&mst_audio_device);
142 set_pxa_fb_info(&sharp_lm8v31);
143 pxa_set_mci_info(&idp_mci_platform_data);
146 static void __init idp_init_irq(void)
151 set_irq_type(TOUCH_PANEL_IRQ, TOUCH_PANEL_IRQ_EDGE);
154 static struct map_desc idp_io_desc[] __initdata = {
155 /* virtual physical length type */
167 static void __init idp_map_io(void)
170 iotable_init(idp_io_desc, ARRAY_SIZE(idp_io_desc));
172 // serial ports 2 & 3
173 pxa_gpio_mode(GPIO42_BTRXD_MD);
174 pxa_gpio_mode(GPIO43_BTTXD_MD);
175 pxa_gpio_mode(GPIO44_BTCTS_MD);
176 pxa_gpio_mode(GPIO45_BTRTS_MD);
177 pxa_gpio_mode(GPIO46_STRXD_MD);
178 pxa_gpio_mode(GPIO47_STTXD_MD);
183 MACHINE_START(PXA_IDP, "Vibren PXA255 IDP")
184 /* Maintainer: Vibren Technologies */
185 .phys_ram = 0xa0000000,
186 .phys_io = 0x40000000,
187 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
188 .map_io = idp_map_io,
189 .init_irq = idp_init_irq,
191 .init_machine = idp_init,