aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-sparc64
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-06-26 13:08:32 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-06-26 13:08:32 -0400
commit8871e73fdbde07d0a41393f7ee30787b65387b36 (patch)
treec54027e3ceb18f00db886871494d5e7b56e74b45 /include/asm-sparc64
parent61a46dc9d1c10d07a2ed6b7d346b868803b52506 (diff)
parent749805dc10e955b0170573061f9522a6a21cbae0 (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/asm-sparc64')
-rw-r--r--include/asm-sparc64/dma-mapping.h43
-rw-r--r--include/asm-sparc64/floppy.h50
-rw-r--r--include/asm-sparc64/prom.h10
3 files changed, 102 insertions, 1 deletions
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
172static inline int
173dma_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
180static inline void
181dma_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
189static inline void
190dma_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
198static inline void
199dma_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
211extern irqreturn_t sparc_floppy_irq(int, void *, struct pt_regs *); 211irqreturn_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
257main_interrupt:
258 return floppy_interrupt(irq, dev_cookie, regs);
259}
212 260
213static int sun_fd_request_irq(void) 261static 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
40struct device_node { 42struct 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
63static inline void set_node_proc_entry(struct device_node *dn, struct proc_dir_entry *de) 72static 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,
88extern int of_device_is_compatible(struct device_node *device, const char *); 97extern int of_device_is_compatible(struct device_node *device, const char *);
89extern void *of_get_property(struct device_node *node, const char *name, 98extern void *of_get_property(struct device_node *node, const char *name,
90 int *lenp); 99 int *lenp);
100extern int of_set_property(struct device_node *node, const char *name, void *val, int len);
91extern int of_getintprop_default(struct device_node *np, 101extern int of_getintprop_default(struct device_node *np,
92 const char *name, 102 const char *name,
93 int def); 103 int def);