1 Index: linux-2.4.35.4/drivers/pcmcia/yenta.c
2 ===================================================================
3 --- linux-2.4.35.4.orig/drivers/pcmcia/yenta.c 2007-12-15 05:19:36.066476349 +0100
4 +++ linux-2.4.35.4/drivers/pcmcia/yenta.c 2007-12-15 05:20:16.268767348 +0100
6 * Probe for usable interrupts using the force
7 * register to generate bogus card status events.
10 +#ifndef CONFIG_BCM947XX
11 + /* WRT54G3G does not like this */
12 cb_writel(socket, CB_SOCKET_EVENT, -1);
13 cb_writel(socket, CB_SOCKET_MASK, CB_CSTSMASK);
14 exca_writeb(socket, I365_CSCINT, 0);
17 cb_writel(socket, CB_SOCKET_MASK, 0);
18 exca_writeb(socket, I365_CSCINT, 0);
22 mask = probe_irq_mask(val) & 0xffff;
24 bridge_ctrl &= ~CB_BRIDGE_INTR;
26 socket->cap.cb_dev = socket->dev;
27 socket->cap.bus = NULL;
29 +#ifdef CONFIG_BCM947XX
30 + /* irq mask probing is broken for the WRT54G3G */
31 + if (socket->cap.irq_mask == 0)
32 + socket->cap.irq_mask = 0x6f8;
35 printk(KERN_INFO "Yenta ISA IRQ mask 0x%04x, PCI irq %d\n",
36 socket->cap.irq_mask, socket->cb_irq);
39 printk(KERN_INFO "Socket status: %08x\n",
40 cb_readl(socket, CB_SOCKET_STATE));
42 + /* Generate an interrupt on card insert/remove */
43 + config_writew(socket, CB_SOCKET_MASK, CB_CSTSMASK | CB_CDMASK);
45 + /* Set up Multifunction Routing Status Register */
46 + config_writew(socket, 0x8C, 0x1000 /* MFUNC3 to GPIO3 */ | 0x2 /* MFUNC0 to INTA */);
48 + /* Switch interrupts to parallelized */
49 + config_writeb(socket, 0x92, 0x64);
51 /* Register it with the pcmcia layer.. */
52 cardbus_register(socket);
57 struct resource *root, *res;
59 + u32 start = 0, end = 0;
60 u32 align, size, min, max;
65 root = pci_find_parent_resource(socket->dev, res);
67 +#ifdef CONFIG_BCM947XX
68 + /* default mem resources are completely fscked up on the wrt54g3g */
69 + /* bypass the entire resource allocation stuff below and just set it statically */
70 + if (type & IORESOURCE_MEM) {
71 + res->start = 0x40004000;
72 + res->end = res->start + 0x3fff;
80 res->start = res->end = 0;
85 config_writel(socket, offset, res->start);
86 config_writel(socket, offset+4, res->end);