1 Index: linux-2.4.35.4/drivers/pcmcia/yenta.c
2 ===================================================================
3 --- linux-2.4.35.4.orig/drivers/pcmcia/yenta.c
4 +++ linux-2.4.35.4/drivers/pcmcia/yenta.c
5 @@ -543,6 +543,9 @@ static unsigned int yenta_probe_irq(pci_
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);
15 @@ -557,7 +560,8 @@ static unsigned int yenta_probe_irq(pci_
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;
25 @@ -578,6 +582,12 @@ static void yenta_get_socket_capabilitie
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);
38 @@ -609,6 +619,15 @@ static void yenta_open_bh(void * data)
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);
54 @@ -731,7 +750,7 @@ static void yenta_allocate_res(pci_socke
57 struct resource *root, *res;
59 + u32 start = 0, end = 0;
60 u32 align, size, min, max;
63 @@ -750,6 +769,15 @@ static void yenta_allocate_res(pci_socke
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;
79 @@ -794,6 +822,7 @@ static void yenta_allocate_res(pci_socke
80 res->start = res->end = 0;
85 config_writel(socket, offset, res->start);
86 config_writel(socket, offset+4, res->end);