[adm5120] generate firmware images for the CAS-700/771/790/861 devices
[openwrt.git] / target / linux / brcm47xx / patches-2.6.23 / 210-ssb_fixes.patch
1 Index: linux-2.6.23/drivers/ssb/driver_mipscore.c
2 ===================================================================
3 --- linux-2.6.23.orig/drivers/ssb/driver_mipscore.c 2007-10-14 04:32:45.793470742 +0200
4 +++ linux-2.6.23/drivers/ssb/driver_mipscore.c 2007-10-14 04:33:25.155713862 +0200
5 @@ -222,3 +222,5 @@
6 ssb_mips_serial_init(mcore);
7 ssb_mips_flash_detect(mcore);
8 }
9 +
10 +EXPORT_SYMBOL(ssb_mips_irq);
11 Index: linux-2.6.23/include/linux/ssb/ssb_driver_chipcommon.h
12 ===================================================================
13 --- linux-2.6.23.orig/include/linux/ssb/ssb_driver_chipcommon.h 2007-10-14 04:32:45.817472111 +0200
14 +++ linux-2.6.23/include/linux/ssb/ssb_driver_chipcommon.h 2007-10-14 04:33:25.159714091 +0200
15 @@ -382,11 +382,45 @@
16 extern void ssb_chipco_watchdog_timer_set(struct ssb_chipcommon *cc,
17 u32 ticks);
18
19 -u32 ssb_chipco_gpio_in(struct ssb_chipcommon *cc, u32 mask);
20 +/* GPIO functions */
21 +static inline u32 ssb_chipco_gpio_in(struct ssb_chipcommon *cc,
22 + u32 mask)
23 +{
24 + return ssb_read32(cc->dev, SSB_CHIPCO_GPIOIN) & mask;
25 +}
26
27 -void ssb_chipco_gpio_out(struct ssb_chipcommon *cc, u32 mask, u32 value);
28 +static inline u32 ssb_chipco_gpio_out(struct ssb_chipcommon *cc,
29 + u32 mask, u32 value)
30 +{
31 + return ssb_write32_masked(cc->dev, SSB_CHIPCO_GPIOOUT, mask, value);
32 +}
33
34 -void ssb_chipco_gpio_outen(struct ssb_chipcommon *cc, u32 mask, u32 value);
35 +static inline u32 ssb_chipco_gpio_outen(struct ssb_chipcommon *cc,
36 + u32 mask, u32 value)
37 +{
38 + return ssb_write32_masked(cc->dev, SSB_CHIPCO_GPIOOUTEN, mask, value);
39 +}
40 +
41 +static inline u32 ssb_chipco_gpio_control(struct ssb_chipcommon *cc,
42 + u32 mask, u32 value)
43 +{
44 + return ssb_write32_masked(cc->dev, SSB_CHIPCO_GPIOCTL, mask, value);
45 +}
46 +
47 +static inline u32 ssb_chipco_gpio_intmask(struct ssb_chipcommon *cc,
48 + u32 mask, u32 value)
49 +{
50 + return ssb_write32_masked(cc->dev, SSB_CHIPCO_GPIOIRQ, mask, value);
51 +}
52 +
53 +static inline u32 ssb_chipco_gpio_polarity(struct ssb_chipcommon *cc,
54 + u32 mask, u32 value)
55 +{
56 + return ssb_write32_masked(cc->dev, SSB_CHIPCO_GPIOPOL, mask, value);
57 +}
58 +/* TODO: GPIO reservation */
59 +
60 +extern int ssb_chipco_watchdog(struct ssb_chipcommon *cc, uint ticks);
61
62 #ifdef CONFIG_SSB_SERIAL
63 extern int ssb_chipco_serial_init(struct ssb_chipcommon *cc,
64 Index: linux-2.6.23/include/linux/ssb/ssb_driver_extif.h
65 ===================================================================
66 --- linux-2.6.23.orig/include/linux/ssb/ssb_driver_extif.h 2007-10-14 04:32:45.821472339 +0200
67 +++ linux-2.6.23/include/linux/ssb/ssb_driver_extif.h 2007-10-14 04:33:25.167714544 +0200
68 @@ -153,7 +153,6 @@
69 #define SSB_EXTIF_WATCHDOG_CLK 48000000 /* Hz */
70
71
72 -
73 #ifdef CONFIG_SSB_DRIVER_EXTIF
74
75 struct ssb_extif {
76 @@ -171,17 +170,42 @@
77 extern void ssb_extif_timing_init(struct ssb_extif *extif,
78 unsigned long ns);
79
80 -u32 ssb_extif_gpio_in(struct ssb_extif *extif, u32 mask);
81 -
82 -void ssb_extif_gpio_out(struct ssb_extif *extif, u32 mask, u32 value);
83 -
84 -void ssb_extif_gpio_outen(struct ssb_extif *extif, u32 mask, u32 value);
85 -
86 #ifdef CONFIG_SSB_SERIAL
87 extern int ssb_extif_serial_init(struct ssb_extif *extif,
88 struct ssb_serial_port *ports);
89 #endif /* CONFIG_SSB_SERIAL */
90
91 +/* GPIO functions */
92 +static inline u32 ssb_extif_gpio_in(struct ssb_extif *extif,
93 + u32 mask)
94 +{
95 + return ssb_read32(extif->dev, SSB_EXTIF_GPIO_IN) & mask;
96 +}
97 +
98 +static inline u32 ssb_extif_gpio_out(struct ssb_extif *extif,
99 + u32 mask, u32 value)
100 +{
101 + return ssb_write32_masked(extif->dev, SSB_EXTIF_GPIO_OUT(0), mask, value);
102 +}
103 +
104 +static inline u32 ssb_extif_gpio_outen(struct ssb_extif *extif,
105 + u32 mask, u32 value)
106 +{
107 + return ssb_write32_masked(extif->dev, SSB_EXTIF_GPIO_OUTEN(0), mask, value);
108 +}
109 +
110 +static inline u32 ssb_extif_gpio_polarity(struct ssb_extif *extif,
111 + u32 mask, u32 value)
112 +{
113 + return ssb_write32_masked(extif->dev, SSB_EXTIF_GPIO_INTPOL, mask, value);
114 +}
115 +
116 +static inline u32 ssb_extif_gpio_intmask(struct ssb_extif *extif,
117 + u32 mask, u32 value)
118 +{
119 + return ssb_write32_masked(extif->dev, SSB_EXTIF_GPIO_INTMASK, mask, value);
120 +}
121 +
122
123 #else /* CONFIG_SSB_DRIVER_EXTIF */
124 /* extif disabled */
125 Index: linux-2.6.23/include/linux/ssb/ssb.h
126 ===================================================================
127 --- linux-2.6.23.orig/include/linux/ssb/ssb.h 2007-10-14 04:32:45.833473010 +0200
128 +++ linux-2.6.23/include/linux/ssb/ssb.h 2007-10-14 04:33:25.171714773 +0200
129 @@ -255,6 +255,12 @@
130 #define SSB_CHIPPACK_BCM4712M 2 /* Medium 225pin 4712 */
131 #define SSB_CHIPPACK_BCM4712L 0 /* Large 340pin 4712 */
132
133 +static inline u16 ssb_read16(struct ssb_device *dev, u16 offset);
134 +static inline u32 ssb_read32(struct ssb_device *dev, u16 offset);
135 +static inline void ssb_write16(struct ssb_device *dev, u16 offset, u16 value);
136 +static inline void ssb_write32(struct ssb_device *dev, u16 offset, u32 value);
137 +static inline u32 ssb_write32_masked(struct ssb_device *dev, u16 offset, u32 mask, u32 value);
138 +
139 #include <linux/ssb/ssb_driver_chipcommon.h>
140 #include <linux/ssb/ssb_driver_mips.h>
141 #include <linux/ssb/ssb_driver_extif.h>
142 @@ -385,6 +391,16 @@
143 dev->ops->write32(dev, offset, value);
144 }
145
146 +static inline u32 ssb_write32_masked(struct ssb_device *dev,
147 + u16 offset,
148 + u32 mask,
149 + u32 value)
150 +{
151 + value &= mask;
152 + value |= ssb_read32(dev, offset) & ~mask;
153 + ssb_write32(dev, offset, value);
154 + return value;
155 +}
156
157 /* Translation (routing) bits that need to be ORed to DMA
158 * addresses before they are given to a device. */
159 Index: linux-2.6.23/drivers/ssb/driver_chipcommon.c
160 ===================================================================
161 --- linux-2.6.23.orig/drivers/ssb/driver_chipcommon.c 2007-10-14 04:32:45.797470966 +0200
162 +++ linux-2.6.23/drivers/ssb/driver_chipcommon.c 2007-10-14 04:33:25.175715001 +0200
163 @@ -351,21 +351,6 @@
164 chipco_write32(cc, SSB_CHIPCO_WATCHDOG, ticks);
165 }
166
167 -u32 ssb_chipco_gpio_in(struct ssb_chipcommon *cc, u32 mask)
168 -{
169 - return chipco_read32(cc, SSB_CHIPCO_GPIOIN) & mask;
170 -}
171 -
172 -void ssb_chipco_gpio_out(struct ssb_chipcommon *cc, u32 mask, u32 value)
173 -{
174 - chipco_write32_masked(cc, SSB_CHIPCO_GPIOOUT, mask, value);
175 -}
176 -
177 -void ssb_chipco_gpio_outen(struct ssb_chipcommon *cc, u32 mask, u32 value)
178 -{
179 - chipco_write32_masked(cc, SSB_CHIPCO_GPIOOUTEN, mask, value);
180 -}
181 -
182 #ifdef CONFIG_SSB_SERIAL
183 int ssb_chipco_serial_init(struct ssb_chipcommon *cc,
184 struct ssb_serial_port *ports)
185 Index: linux-2.6.23/drivers/ssb/driver_extif.c
186 ===================================================================
187 --- linux-2.6.23.orig/drivers/ssb/driver_extif.c 2007-10-14 04:32:45.809471640 +0200
188 +++ linux-2.6.23/drivers/ssb/driver_extif.c 2007-10-14 04:33:25.179715231 +0200
189 @@ -110,20 +110,4 @@
190 *m = extif_read32(extif, SSB_EXTIF_CLOCK_SB);
191 }
192
193 -u32 ssb_extif_gpio_in(struct ssb_extif *extif, u32 mask)
194 -{
195 - return extif_read32(extif, SSB_EXTIF_GPIO_IN) & mask;
196 -}
197 -
198 -void ssb_extif_gpio_out(struct ssb_extif *extif, u32 mask, u32 value)
199 -{
200 - return extif_write32_masked(extif, SSB_EXTIF_GPIO_OUT(0),
201 - mask, value);
202 -}
203 -
204 -void ssb_extif_gpio_outen(struct ssb_extif *extif, u32 mask, u32 value)
205 -{
206 - return extif_write32_masked(extif, SSB_EXTIF_GPIO_OUTEN(0),
207 - mask, value);
208 -}
209
210 Index: linux-2.6.23/include/linux/mod_devicetable.h
211 ===================================================================
212 --- linux-2.6.23.orig/include/linux/mod_devicetable.h 2007-10-14 04:35:22.102378272 +0200
213 +++ linux-2.6.23/include/linux/mod_devicetable.h 2007-10-14 04:34:41.172045787 +0200
214 @@ -340,4 +340,19 @@
215 #define PA_HVERSION_ANY_ID 0xffff
216 #define PA_SVERSION_ANY_ID 0xffffffff
217
218 +/* SSB core, see drivers/ssb/ */
219 +struct ssb_device_id {
220 + __u16 vendor;
221 + __u16 coreid;
222 + __u8 revision;
223 +};
224 +#define SSB_DEVICE(_vendor, _coreid, _revision) \
225 + { .vendor = _vendor, .coreid = _coreid, .revision = _revision, }
226 +#define SSB_DEVTABLE_END \
227 + { 0, },
228 +
229 +#define SSB_ANY_VENDOR 0xFFFF
230 +#define SSB_ANY_ID 0xFFFF
231 +#define SSB_ANY_REV 0xFF
232 +
233 #endif /* LINUX_MOD_DEVICETABLE_H */
This page took 0.050215 seconds and 5 git commands to generate.