1 --- a/drivers/pcmcia/yenta.c
2 +++ b/drivers/pcmcia/yenta.c
3 @@ -543,6 +543,9 @@ static unsigned int yenta_probe_irq(pci_
4 * Probe for usable interrupts using the force
5 * register to generate bogus card status events.
8 +#ifndef CONFIG_BCM947XX
9 + /* WRT54G3G does not like this */
10 cb_writel(socket, CB_SOCKET_EVENT, -1);
11 cb_writel(socket, CB_SOCKET_MASK, CB_CSTSMASK);
12 exca_writeb(socket, I365_CSCINT, 0);
13 @@ -557,7 +560,8 @@ static unsigned int yenta_probe_irq(pci_
15 cb_writel(socket, CB_SOCKET_MASK, 0);
16 exca_writeb(socket, I365_CSCINT, 0);
20 mask = probe_irq_mask(val) & 0xffff;
22 bridge_ctrl &= ~CB_BRIDGE_INTR;
23 @@ -578,6 +582,12 @@ static void yenta_get_socket_capabilitie
24 socket->cap.cb_dev = socket->dev;
25 socket->cap.bus = NULL;
27 +#ifdef CONFIG_BCM947XX
28 + /* irq mask probing is broken for the WRT54G3G */
29 + if (socket->cap.irq_mask == 0)
30 + socket->cap.irq_mask = 0x6f8;
33 printk(KERN_INFO "Yenta ISA IRQ mask 0x%04x, PCI irq %d\n",
34 socket->cap.irq_mask, socket->cb_irq);
36 @@ -609,6 +619,15 @@ static void yenta_open_bh(void * data)
37 printk(KERN_INFO "Socket status: %08x\n",
38 cb_readl(socket, CB_SOCKET_STATE));
40 + /* Generate an interrupt on card insert/remove */
41 + config_writew(socket, CB_SOCKET_MASK, CB_CSTSMASK | CB_CDMASK);
43 + /* Set up Multifunction Routing Status Register */
44 + config_writew(socket, 0x8C, 0x1000 /* MFUNC3 to GPIO3 */ | 0x2 /* MFUNC0 to INTA */);
46 + /* Switch interrupts to parallelized */
47 + config_writeb(socket, 0x92, 0x64);
49 /* Register it with the pcmcia layer.. */
50 cardbus_register(socket);
52 @@ -731,7 +750,7 @@ static void yenta_allocate_res(pci_socke
55 struct resource *root, *res;
57 + u32 start = 0, end = 0;
58 u32 align, size, min, max;
61 @@ -750,6 +769,15 @@ static void yenta_allocate_res(pci_socke
63 root = pci_find_parent_resource(socket->dev, res);
65 +#ifdef CONFIG_BCM947XX
66 + /* default mem resources are completely fscked up on the wrt54g3g */
67 + /* bypass the entire resource allocation stuff below and just set it statically */
68 + if (type & IORESOURCE_MEM) {
69 + res->start = 0x40004000;
70 + res->end = res->start + 0x3fff;
77 @@ -794,6 +822,7 @@ static void yenta_allocate_res(pci_socke
78 res->start = res->end = 0;
83 config_writel(socket, offset, res->start);
84 config_writel(socket, offset+4, res->end);