diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-26 13:08:32 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-26 13:08:32 -0400 |
commit | 8871e73fdbde07d0a41393f7ee30787b65387b36 (patch) | |
tree | c54027e3ceb18f00db886871494d5e7b56e74b45 /include | |
parent | 61a46dc9d1c10d07a2ed6b7d346b868803b52506 (diff) | |
parent | 749805dc10e955b0170573061f9522a6a21cbae0 (diff) |
Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6:
[SPARC]: Add iomap interfaces.
[OPENPROM]: Rewrite driver to use in-kernel device tree.
[OPENPROMFS]: Rewrite using in-kernel device tree and seq_file.
[SPARC]: Add unique device_node IDs and a ".node" property.
[SPARC]: Add of_set_property() interface.
[SPARC64]: Export auxio_register to modules.
[SPARC64]: Add missing interfaces to dma-mapping.h
[SPARC64]: Export _PAGE_IE to modules.
[SPARC64]: Allow floppy driver to build modular.
[SPARC]: Export x_bus_type to modules.
[RIOWATCHDOG]: Fix the build.
[CPWATCHDOG]: Fix the build.
[PARPORT] sunbpp: Fix typo.
[MTD] sun_uflash: Port to new EBUS device layer.
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-sparc/io.h | 16 | ||||
-rw-r--r-- | include/asm-sparc/prom.h | 10 | ||||
-rw-r--r-- | include/asm-sparc64/dma-mapping.h | 43 | ||||
-rw-r--r-- | include/asm-sparc64/floppy.h | 50 | ||||
-rw-r--r-- | include/asm-sparc64/prom.h | 10 |
5 files changed, 128 insertions, 1 deletions
diff --git a/include/asm-sparc/io.h b/include/asm-sparc/io.h index a42df208d590..cab0b851b8b1 100644 --- a/include/asm-sparc/io.h +++ b/include/asm-sparc/io.h | |||
@@ -249,6 +249,22 @@ extern void __iomem *ioremap(unsigned long offset, unsigned long size); | |||
249 | #define ioremap_nocache(X,Y) ioremap((X),(Y)) | 249 | #define ioremap_nocache(X,Y) ioremap((X),(Y)) |
250 | extern void iounmap(volatile void __iomem *addr); | 250 | extern void iounmap(volatile void __iomem *addr); |
251 | 251 | ||
252 | #define ioread8(X) readb(X) | ||
253 | #define ioread16(X) readw(X) | ||
254 | #define ioread32(X) readl(X) | ||
255 | #define iowrite8(val,X) writeb(val,X) | ||
256 | #define iowrite16(val,X) writew(val,X) | ||
257 | #define iowrite32(val,X) writel(val,X) | ||
258 | |||
259 | /* Create a virtual mapping cookie for an IO port range */ | ||
260 | extern void __iomem *ioport_map(unsigned long port, unsigned int nr); | ||
261 | extern void ioport_unmap(void __iomem *); | ||
262 | |||
263 | /* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ | ||
264 | struct pci_dev; | ||
265 | extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max); | ||
266 | extern void pci_iounmap(struct pci_dev *dev, void __iomem *); | ||
267 | |||
252 | /* | 268 | /* |
253 | * Bus number may be in res->flags... somewhere. | 269 | * Bus number may be in res->flags... somewhere. |
254 | */ | 270 | */ |
diff --git a/include/asm-sparc/prom.h b/include/asm-sparc/prom.h index c5e3d26eabd3..f9cf44c07164 100644 --- a/include/asm-sparc/prom.h +++ b/include/asm-sparc/prom.h | |||
@@ -35,6 +35,8 @@ struct property { | |||
35 | int length; | 35 | int length; |
36 | void *value; | 36 | void *value; |
37 | struct property *next; | 37 | struct property *next; |
38 | unsigned long _flags; | ||
39 | unsigned int unique_id; | ||
38 | }; | 40 | }; |
39 | 41 | ||
40 | struct device_node { | 42 | struct device_node { |
@@ -58,8 +60,15 @@ struct device_node { | |||
58 | struct kref kref; | 60 | struct kref kref; |
59 | unsigned long _flags; | 61 | unsigned long _flags; |
60 | void *data; | 62 | void *data; |
63 | unsigned int unique_id; | ||
61 | }; | 64 | }; |
62 | 65 | ||
66 | /* flag descriptions */ | ||
67 | #define OF_DYNAMIC 1 /* node and properties were allocated via kmalloc */ | ||
68 | |||
69 | #define OF_IS_DYNAMIC(x) test_bit(OF_DYNAMIC, &x->_flags) | ||
70 | #define OF_MARK_DYNAMIC(x) set_bit(OF_DYNAMIC, &x->_flags) | ||
71 | |||
63 | static inline void set_node_proc_entry(struct device_node *dn, struct proc_dir_entry *de) | 72 | static inline void set_node_proc_entry(struct device_node *dn, struct proc_dir_entry *de) |
64 | { | 73 | { |
65 | dn->pde = de; | 74 | dn->pde = de; |
@@ -88,6 +97,7 @@ extern struct property *of_find_property(struct device_node *np, | |||
88 | extern int of_device_is_compatible(struct device_node *device, const char *); | 97 | extern int of_device_is_compatible(struct device_node *device, const char *); |
89 | extern void *of_get_property(struct device_node *node, const char *name, | 98 | extern void *of_get_property(struct device_node *node, const char *name, |
90 | int *lenp); | 99 | int *lenp); |
100 | extern int of_set_property(struct device_node *node, const char *name, void *val, int len); | ||
91 | extern int of_getintprop_default(struct device_node *np, | 101 | extern int of_getintprop_default(struct device_node *np, |
92 | const char *name, | 102 | const char *name, |
93 | int def); | 103 | int def); |
diff --git a/include/asm-sparc64/dma-mapping.h b/include/asm-sparc64/dma-mapping.h index 3c2b5bc8650b..0f5b89c9323b 100644 --- a/include/asm-sparc64/dma-mapping.h +++ b/include/asm-sparc64/dma-mapping.h | |||
@@ -162,4 +162,47 @@ static inline void dma_free_coherent(struct device *dev, size_t size, | |||
162 | 162 | ||
163 | #endif /* PCI */ | 163 | #endif /* PCI */ |
164 | 164 | ||
165 | |||
166 | /* Now for the API extensions over the pci_ one */ | ||
167 | |||
168 | #define dma_alloc_noncoherent(d, s, h, f) dma_alloc_coherent(d, s, h, f) | ||
169 | #define dma_free_noncoherent(d, s, v, h) dma_free_coherent(d, s, v, h) | ||
170 | #define dma_is_consistent(d) (1) | ||
171 | |||
172 | static inline int | ||
173 | dma_get_cache_alignment(void) | ||
174 | { | ||
175 | /* no easy way to get cache size on all processors, so return | ||
176 | * the maximum possible, to be safe */ | ||
177 | return (1 << INTERNODE_CACHE_SHIFT); | ||
178 | } | ||
179 | |||
180 | static inline void | ||
181 | dma_sync_single_range_for_cpu(struct device *dev, dma_addr_t dma_handle, | ||
182 | unsigned long offset, size_t size, | ||
183 | enum dma_data_direction direction) | ||
184 | { | ||
185 | /* just sync everything, that's all the pci API can do */ | ||
186 | dma_sync_single_for_cpu(dev, dma_handle, offset+size, direction); | ||
187 | } | ||
188 | |||
189 | static inline void | ||
190 | dma_sync_single_range_for_device(struct device *dev, dma_addr_t dma_handle, | ||
191 | unsigned long offset, size_t size, | ||
192 | enum dma_data_direction direction) | ||
193 | { | ||
194 | /* just sync everything, that's all the pci API can do */ | ||
195 | dma_sync_single_for_device(dev, dma_handle, offset+size, direction); | ||
196 | } | ||
197 | |||
198 | static inline void | ||
199 | dma_cache_sync(void *vaddr, size_t size, | ||
200 | enum dma_data_direction direction) | ||
201 | { | ||
202 | /* could define this in terms of the dma_cache ... operations, | ||
203 | * but if you get this on a platform, you should convert the platform | ||
204 | * to using the generic device DMA API */ | ||
205 | BUG(); | ||
206 | } | ||
207 | |||
165 | #endif /* _ASM_SPARC64_DMA_MAPPING_H */ | 208 | #endif /* _ASM_SPARC64_DMA_MAPPING_H */ |
diff --git a/include/asm-sparc64/floppy.h b/include/asm-sparc64/floppy.h index f8d57bb5570c..b591d0e8d8f0 100644 --- a/include/asm-sparc64/floppy.h +++ b/include/asm-sparc64/floppy.h | |||
@@ -208,7 +208,55 @@ static void sun_fd_enable_dma(void) | |||
208 | pdma_areasize = pdma_size; | 208 | pdma_areasize = pdma_size; |
209 | } | 209 | } |
210 | 210 | ||
211 | extern irqreturn_t sparc_floppy_irq(int, void *, struct pt_regs *); | 211 | irqreturn_t sparc_floppy_irq(int irq, void *dev_cookie, struct pt_regs *regs) |
212 | { | ||
213 | if (likely(doing_pdma)) { | ||
214 | void __iomem *stat = (void __iomem *) fdc_status; | ||
215 | unsigned char *vaddr = pdma_vaddr; | ||
216 | unsigned long size = pdma_size; | ||
217 | u8 val; | ||
218 | |||
219 | while (size) { | ||
220 | val = readb(stat); | ||
221 | if (unlikely(!(val & 0x80))) { | ||
222 | pdma_vaddr = vaddr; | ||
223 | pdma_size = size; | ||
224 | return IRQ_HANDLED; | ||
225 | } | ||
226 | if (unlikely(!(val & 0x20))) { | ||
227 | pdma_vaddr = vaddr; | ||
228 | pdma_size = size; | ||
229 | doing_pdma = 0; | ||
230 | goto main_interrupt; | ||
231 | } | ||
232 | if (val & 0x40) { | ||
233 | /* read */ | ||
234 | *vaddr++ = readb(stat + 1); | ||
235 | } else { | ||
236 | unsigned char data = *vaddr++; | ||
237 | |||
238 | /* write */ | ||
239 | writeb(data, stat + 1); | ||
240 | } | ||
241 | size--; | ||
242 | } | ||
243 | |||
244 | pdma_vaddr = vaddr; | ||
245 | pdma_size = size; | ||
246 | |||
247 | /* Send Terminal Count pulse to floppy controller. */ | ||
248 | val = readb(auxio_register); | ||
249 | val |= AUXIO_AUX1_FTCNT; | ||
250 | writeb(val, auxio_register); | ||
251 | val &= ~AUXIO_AUX1_FTCNT; | ||
252 | writeb(val, auxio_register); | ||
253 | |||
254 | doing_pdma = 0; | ||
255 | } | ||
256 | |||
257 | main_interrupt: | ||
258 | return floppy_interrupt(irq, dev_cookie, regs); | ||
259 | } | ||
212 | 260 | ||
213 | static int sun_fd_request_irq(void) | 261 | static int sun_fd_request_irq(void) |
214 | { | 262 | { |
diff --git a/include/asm-sparc64/prom.h b/include/asm-sparc64/prom.h index 6d1556c0c263..265614d497c4 100644 --- a/include/asm-sparc64/prom.h +++ b/include/asm-sparc64/prom.h | |||
@@ -35,6 +35,8 @@ struct property { | |||
35 | int length; | 35 | int length; |
36 | void *value; | 36 | void *value; |
37 | struct property *next; | 37 | struct property *next; |
38 | unsigned long _flags; | ||
39 | unsigned int unique_id; | ||
38 | }; | 40 | }; |
39 | 41 | ||
40 | struct device_node { | 42 | struct device_node { |
@@ -58,8 +60,15 @@ struct device_node { | |||
58 | struct kref kref; | 60 | struct kref kref; |
59 | unsigned long _flags; | 61 | unsigned long _flags; |
60 | void *data; | 62 | void *data; |
63 | unsigned int unique_id; | ||
61 | }; | 64 | }; |
62 | 65 | ||
66 | /* flag descriptions */ | ||
67 | #define OF_DYNAMIC 1 /* node and properties were allocated via kmalloc */ | ||
68 | |||
69 | #define OF_IS_DYNAMIC(x) test_bit(OF_DYNAMIC, &x->_flags) | ||
70 | #define OF_MARK_DYNAMIC(x) set_bit(OF_DYNAMIC, &x->_flags) | ||
71 | |||
63 | static inline void set_node_proc_entry(struct device_node *dn, struct proc_dir_entry *de) | 72 | static inline void set_node_proc_entry(struct device_node *dn, struct proc_dir_entry *de) |
64 | { | 73 | { |
65 | dn->pde = de; | 74 | dn->pde = de; |
@@ -88,6 +97,7 @@ extern struct property *of_find_property(struct device_node *np, | |||
88 | extern int of_device_is_compatible(struct device_node *device, const char *); | 97 | extern int of_device_is_compatible(struct device_node *device, const char *); |
89 | extern void *of_get_property(struct device_node *node, const char *name, | 98 | extern void *of_get_property(struct device_node *node, const char *name, |
90 | int *lenp); | 99 | int *lenp); |
100 | extern int of_set_property(struct device_node *node, const char *name, void *val, int len); | ||
91 | extern int of_getintprop_default(struct device_node *np, | 101 | extern int of_getintprop_default(struct device_node *np, |
92 | const char *name, | 102 | const char *name, |
93 | int def); | 103 | int def); |