caec3bd56bdb2d9f48fae28f5ba9b095f60d33e1
[openwrt/svn-archive/archive.git] / target / linux / generic-2.6 / patches-2.6.23 / 930-ssb_fixes.patch
1 This patch ports ssb to the 2.6.23 kernel.
2
3 Index: linux-2.6.23.16/drivers/ssb/driver_mipscore.c
4 ===================================================================
5 --- linux-2.6.23.16.orig/drivers/ssb/driver_mipscore.c 2008-03-21 17:33:28.000000000 +0100
6 +++ linux-2.6.23.16/drivers/ssb/driver_mipscore.c 2008-03-21 17:33:34.000000000 +0100
7 @@ -222,3 +222,5 @@ void ssb_mipscore_init(struct ssb_mipsco
8 ssb_mips_serial_init(mcore);
9 ssb_mips_flash_detect(mcore);
10 }
11 +
12 +EXPORT_SYMBOL(ssb_mips_irq);
13 Index: linux-2.6.23.16/include/linux/mod_devicetable.h
14 ===================================================================
15 --- linux-2.6.23.16.orig/include/linux/mod_devicetable.h 2008-03-21 17:33:28.000000000 +0100
16 +++ linux-2.6.23.16/include/linux/mod_devicetable.h 2008-03-21 17:33:34.000000000 +0100
17 @@ -352,4 +352,19 @@ struct parisc_device_id {
18 #define PA_HVERSION_ANY_ID 0xffff
19 #define PA_SVERSION_ANY_ID 0xffffffff
20
21 +/* SSB core, see drivers/ssb/ */
22 +struct ssb_device_id {
23 + __u16 vendor;
24 + __u16 coreid;
25 + __u8 revision;
26 +};
27 +#define SSB_DEVICE(_vendor, _coreid, _revision) \
28 + { .vendor = _vendor, .coreid = _coreid, .revision = _revision, }
29 +#define SSB_DEVTABLE_END \
30 + { 0, },
31 +
32 +#define SSB_ANY_VENDOR 0xFFFF
33 +#define SSB_ANY_ID 0xFFFF
34 +#define SSB_ANY_REV 0xFF
35 +
36 #endif /* LINUX_MOD_DEVICETABLE_H */
37 Index: linux-2.6.23.16/drivers/ssb/main.c
38 ===================================================================
39 --- linux-2.6.23.16.orig/drivers/ssb/main.c 2008-03-21 17:33:28.000000000 +0100
40 +++ linux-2.6.23.16/drivers/ssb/main.c 2008-03-21 17:33:34.000000000 +0100
41 @@ -321,14 +321,16 @@ static int ssb_bus_match(struct device *
42 return 0;
43 }
44
45 -static int ssb_device_uevent(struct device *dev, struct kobj_uevent_env *env)
46 +static int ssb_device_uevent(struct device *dev, char **envp,
47 + int num_envp, char *buffer, int buffer_size)
48 {
49 struct ssb_device *ssb_dev = dev_to_ssb_dev(dev);
50 + int i = 0, len = 0;
51
52 if (!dev)
53 return -ENODEV;
54
55 - return add_uevent_var(env,
56 + return add_uevent_var(envp, num_envp, &i, buffer, buffer_size, &len,
57 "MODALIAS=ssb:v%04Xid%04Xrev%02X",
58 ssb_dev->id.vendor, ssb_dev->id.coreid,
59 ssb_dev->id.revision);
60 Index: linux-2.6.23.16/drivers/ssb/scan.c
61 ===================================================================
62 --- linux-2.6.23.16.orig/drivers/ssb/scan.c 2008-03-21 17:33:28.000000000 +0100
63 +++ linux-2.6.23.16/drivers/ssb/scan.c 2008-03-21 17:33:34.000000000 +0100
64 @@ -391,12 +391,14 @@ int ssb_bus_scan(struct ssb_bus *bus,
65 if (bus->bustype == SSB_BUSTYPE_PCI) {
66 /* Ignore PCI cores on PCI-E cards.
67 * Ignore PCI-E cores on PCI cards. */
68 + //FIXME kernel 2.6.23 doesn't have is_pcie. Add this check back when updating to 2.6.24 or later.
69 if (dev->id.coreid == SSB_DEV_PCI) {
70 - if (bus->host_pci->is_pcie)
71 - continue;
72 +//FIXME if (bus->host_pci->is_pcie)
73 +//FIXME continue;
74 } else {
75 - if (!bus->host_pci->is_pcie)
76 - continue;
77 + continue; //FIXME
78 +//FIXME if (!bus->host_pci->is_pcie)
79 +//FIXME continue;
80 }
81 }
82 if (bus->pcicore.dev) {
83 Index: linux-2.6.23.16/drivers/ssb/driver_pcicore.c
84 ===================================================================
85 --- linux-2.6.23.16.orig/drivers/ssb/driver_pcicore.c 2008-03-21 17:33:28.000000000 +0100
86 +++ linux-2.6.23.16/drivers/ssb/driver_pcicore.c 2008-03-21 17:33:34.000000000 +0100
87 @@ -362,7 +362,7 @@ static int pcicore_is_in_hostmode(struct
88 chipid_top != 0x5300)
89 return 0;
90
91 - if (bus->sprom.r1.boardflags_lo & SSB_PCICORE_BFL_NOPCI)
92 + if (bus->sprom.boardflags_lo & SSB_PCICORE_BFL_NOPCI)
93 return 0;
94
95 /* The 200-pin BCM4712 package does not bond out PCI. Even when