1 diff -urN linux.old/drivers/pcmcia/yenta.c linux.dev/drivers/pcmcia/yenta.c
2 --- linux.old/drivers/pcmcia/yenta.c 2004-11-17 12:54:21.000000000 +0100
3 +++ linux.dev/drivers/pcmcia/yenta.c 2006-04-11 17:47:45.000000000 +0200
5 * Probe for usable interrupts using the force
6 * register to generate bogus card status events.
9 +#ifndef CONFIG_BCM947XX
10 + /* WRT54G3G does not like this */
11 cb_writel(socket, CB_SOCKET_EVENT, -1);
12 cb_writel(socket, CB_SOCKET_MASK, CB_CSTSMASK);
13 exca_writeb(socket, I365_CSCINT, 0);
16 cb_writel(socket, CB_SOCKET_MASK, 0);
17 exca_writeb(socket, I365_CSCINT, 0);
21 mask = probe_irq_mask(val) & 0xffff;
23 bridge_ctrl &= ~CB_BRIDGE_INTR;
25 socket->cap.cb_dev = socket->dev;
26 socket->cap.bus = NULL;
28 +#ifdef CONFIG_BCM947XX
29 + /* irq mask probing is broken for the WRT54G3G */
30 + if (socket->cap.irq_mask == 0)
31 + socket->cap.irq_mask = 0x6f8;
34 printk(KERN_INFO "Yenta ISA IRQ mask 0x%04x, PCI irq %d\n",
35 socket->cap.irq_mask, socket->cb_irq);
38 printk(KERN_INFO "Socket status: %08x\n",
39 cb_readl(socket, CB_SOCKET_STATE));
41 + /* Generate an interrupt on card insert/remove */
42 + config_writew(socket, CB_SOCKET_MASK, CB_CSTSMASK | CB_CDMASK);
44 + /* Set up Multifunction Routing Status Register */
45 + config_writew(socket, 0x8C, 0x1000 /* MFUNC3 to GPIO3 */ | 0x2 /* MFUNC0 to INTA */);
47 + /* Switch interrupts to parallelized */
48 + config_writeb(socket, 0x92, 0x64);
50 /* Register it with the pcmcia layer.. */
51 cardbus_register(socket);
56 struct resource *root, *res;
58 + u32 start = 0, end = 0;
59 u32 align, size, min, max;
64 root = pci_find_parent_resource(socket->dev, res);
66 +#ifdef CONFIG_BCM947XX
67 + /* default mem resources are completely fscked up on the wrt54g3g */
68 + /* bypass the entire resource allocation stuff below and just set it statically */
69 + if (type & IORESOURCE_MEM) {
70 + res->start = 0x40004000;
71 + res->end = res->start + 0x3fff;
79 res->start = res->end = 0;
84 config_writel(socket, offset, res->start);
85 config_writel(socket, offset+4, res->end);