added usb_oc int to ifmips header files
[openwrt.git] / target / linux / brcm-2.4 / patches / 009-wrt54g3g_pcmcia.patch
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
4 @@ -543,6 +543,9 @@
5 * Probe for usable interrupts using the force
6 * register to generate bogus card status events.
7 */
8 +
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);
14 @@ -557,7 +560,8 @@
15 }
16 cb_writel(socket, CB_SOCKET_MASK, 0);
17 exca_writeb(socket, I365_CSCINT, 0);
18 -
19 +#endif
20 +
21 mask = probe_irq_mask(val) & 0xffff;
22
23 bridge_ctrl &= ~CB_BRIDGE_INTR;
24 @@ -578,6 +582,12 @@
25 socket->cap.cb_dev = socket->dev;
26 socket->cap.bus = NULL;
27
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;
32 +#endif
33 +
34 printk(KERN_INFO "Yenta ISA IRQ mask 0x%04x, PCI irq %d\n",
35 socket->cap.irq_mask, socket->cb_irq);
36 }
37 @@ -609,6 +619,15 @@
38 printk(KERN_INFO "Socket status: %08x\n",
39 cb_readl(socket, CB_SOCKET_STATE));
40
41 + /* Generate an interrupt on card insert/remove */
42 + config_writew(socket, CB_SOCKET_MASK, CB_CSTSMASK | CB_CDMASK);
43 +
44 + /* Set up Multifunction Routing Status Register */
45 + config_writew(socket, 0x8C, 0x1000 /* MFUNC3 to GPIO3 */ | 0x2 /* MFUNC0 to INTA */);
46 +
47 + /* Switch interrupts to parallelized */
48 + config_writeb(socket, 0x92, 0x64);
49 +
50 /* Register it with the pcmcia layer.. */
51 cardbus_register(socket);
52
53 @@ -731,7 +750,7 @@
54 {
55 struct pci_bus *bus;
56 struct resource *root, *res;
57 - u32 start, end;
58 + u32 start = 0, end = 0;
59 u32 align, size, min, max;
60 unsigned offset;
61 unsigned mask;
62 @@ -750,6 +769,15 @@
63 res->end = 0;
64 root = pci_find_parent_resource(socket->dev, res);
65
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;
72 + }
73 +
74 +#else
75 if (!root)
76 return;
77
78 @@ -794,6 +822,7 @@
79 res->start = res->end = 0;
80 return;
81 }
82 +#endif
83
84 config_writel(socket, offset, res->start);
85 config_writel(socket, offset+4, res->end);
This page took 0.052671 seconds and 5 git commands to generate.