2 * linux/arch/arm/mach-pxa/lubbock.c
4 * Support for the Intel DBPXA250 Development Platform.
6 * Author: Nicolas Pitre
7 * Created: Jun 15, 2001
8 * Copyright: MontaVista Software Inc.
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
14 #include <linux/module.h>
15 #include <linux/kernel.h>
16 #include <linux/init.h>
17 #include <linux/device.h>
18 #include <linux/major.h>
20 #include <linux/interrupt.h>
22 #include <asm/setup.h>
23 #include <asm/memory.h>
24 #include <asm/mach-types.h>
25 #include <asm/hardware.h>
28 #include <asm/mach/arch.h>
29 #include <asm/mach/map.h>
30 #include <asm/mach/irq.h>
32 #include <asm/arch/lubbock.h>
33 #include <asm/arch/udc.h>
34 #include <asm/arch/pxafb.h>
35 #include <asm/hardware/sa1111.h>
40 void lubbock_set_misc_wr(unsigned int mask, unsigned int set)
44 local_irq_save(flags);
45 LUB_MISC_WR = (LUB_MISC_WR & ~mask) | (set & mask);
46 local_irq_restore(flags);
48 EXPORT_SYMBOL(lubbock_set_misc_wr);
50 static unsigned long lubbock_irq_enabled;
52 static void lubbock_mask_irq(unsigned int irq)
54 int lubbock_irq = (irq - LUBBOCK_IRQ(0));
55 LUB_IRQ_MASK_EN = (lubbock_irq_enabled &= ~(1 << lubbock_irq));
58 static void lubbock_unmask_irq(unsigned int irq)
60 int lubbock_irq = (irq - LUBBOCK_IRQ(0));
61 /* the irq can be acknowledged only if deasserted, so it's done here */
62 LUB_IRQ_SET_CLR &= ~(1 << lubbock_irq);
63 LUB_IRQ_MASK_EN = (lubbock_irq_enabled |= (1 << lubbock_irq));
66 static struct irqchip lubbock_irq_chip = {
67 .ack = lubbock_mask_irq,
68 .mask = lubbock_mask_irq,
69 .unmask = lubbock_unmask_irq,
72 static void lubbock_irq_handler(unsigned int irq, struct irqdesc *desc,
75 unsigned long pending = LUB_IRQ_SET_CLR & lubbock_irq_enabled;
77 GEDR(0) = GPIO_bit(0); /* clear our parent irq */
78 if (likely(pending)) {
79 irq = LUBBOCK_IRQ(0) + __ffs(pending);
80 desc = irq_desc + irq;
81 desc->handle(irq, desc, regs);
83 pending = LUB_IRQ_SET_CLR & lubbock_irq_enabled;
87 static void __init lubbock_init_irq(void)
93 /* setup extra lubbock irqs */
94 for (irq = LUBBOCK_IRQ(0); irq <= LUBBOCK_LAST_IRQ; irq++) {
95 set_irq_chip(irq, &lubbock_irq_chip);
96 set_irq_handler(irq, do_level_IRQ);
97 set_irq_flags(irq, IRQF_VALID | IRQF_PROBE);
100 set_irq_chained_handler(IRQ_GPIO(0), lubbock_irq_handler);
101 set_irq_type(IRQ_GPIO(0), IRQT_FALLING);
104 static int lubbock_udc_is_connected(void)
106 return (LUB_MISC_RD & (1 << 9)) == 0;
109 static struct pxa2xx_udc_mach_info udc_info __initdata = {
110 .udc_is_connected = lubbock_udc_is_connected,
111 // no D+ pullup; lubbock can't connect/disconnect in software
114 static struct resource sa1111_resources[] = {
118 .flags = IORESOURCE_MEM,
121 .start = LUBBOCK_SA1111_IRQ,
122 .end = LUBBOCK_SA1111_IRQ,
123 .flags = IORESOURCE_IRQ,
127 static struct platform_device sa1111_device = {
130 .num_resources = ARRAY_SIZE(sa1111_resources),
131 .resource = sa1111_resources,
134 static struct resource smc91x_resources[] = {
138 .flags = IORESOURCE_MEM,
141 .start = LUBBOCK_ETH_IRQ,
142 .end = LUBBOCK_ETH_IRQ,
143 .flags = IORESOURCE_IRQ,
148 .flags = IORESOURCE_MEM,
152 static struct platform_device smc91x_device = {
155 .num_resources = ARRAY_SIZE(smc91x_resources),
156 .resource = smc91x_resources,
159 static struct platform_device *devices[] __initdata = {
164 static struct pxafb_mach_info sharp_lm8v31 __initdata = {
175 .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
180 .lccr3 = LCCR3_PCP | LCCR3_Acb(255),
183 static void __init lubbock_init(void)
185 pxa_set_udc_info(&udc_info);
186 set_pxa_fb_info(&sharp_lm8v31);
187 (void) platform_add_devices(devices, ARRAY_SIZE(devices));
190 static struct map_desc lubbock_io_desc[] __initdata = {
191 { LUBBOCK_FPGA_VIRT, LUBBOCK_FPGA_PHYS, 0x00100000, MT_DEVICE }, /* CPLD */
194 static void __init lubbock_map_io(void)
197 iotable_init(lubbock_io_desc, ARRAY_SIZE(lubbock_io_desc));
199 /* This enables the BTUART */
200 pxa_gpio_mode(GPIO42_BTRXD_MD);
201 pxa_gpio_mode(GPIO43_BTTXD_MD);
202 pxa_gpio_mode(GPIO44_BTCTS_MD);
203 pxa_gpio_mode(GPIO45_BTRTS_MD);
205 /* This is for the SMC chip select */
206 pxa_gpio_mode(GPIO79_nCS_3_MD);
208 /* setup sleep mode values */
218 MACHINE_START(LUBBOCK, "Intel DBPXA250 Development Platform (aka Lubbock)")
219 MAINTAINER("MontaVista Software Inc.")
220 BOOT_MEM(0xa0000000, 0x40000000, io_p2v(0x40000000))
221 MAPIO(lubbock_map_io)
222 INITIRQ(lubbock_init_irq)
223 INIT_MACHINE(lubbock_init)