aboutsummaryrefslogtreecommitdiff
path: root/arch/sparc/kernel/of_device_common.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-06-16 11:52:41 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2009-06-16 11:52:41 -0700
commit98523d4630865c407d3787fd592e5e399488b93b (patch)
treeb32f2ef6bdaa43020d67e62d40a31720b9a5758a /arch/sparc/kernel/of_device_common.h
parent8d6cea5111f2daea8acf79d7b4b384a14175ecc1 (diff)
parentaaa7e2f74f11b5f7e30483807b896d7b3369586f (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-next-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-next-2.6: (30 commits) sparc64: Update defconfig. sparc: Wire up sys_rt_tgsigqueueinfo(). openprom: Squelch useless GCC warning. sparc: replace uses of CPU_MASK_ALL_PTR sparc64: Add proper dynamic ftrace support. sparc: Simplify code using is_power_of_2() routine. sparc: move of_device common code to of_device_common sparc: remove dma-mapping_{32|64}.h sparc: use dma_map_page instead of dma_map_single sparc: add sync_single_for_device and sync_sg_for_device to struct dma_ops sparc: move the duplication in dma-mapping_{32|64}.h to dma-mapping.h p9100: use standard fields for framebuffer physical address and length leo: use standard fields for framebuffer physical address and length cg6: use standard fields for framebuffer physical address and length cg3: use standard fields for framebuffer physical address and length cg14: use standard fields for framebuffer physical address and length bw2: use standard fields for framebuffer physical address and length sparc64: fix and optimize irq distribution sparc64: Use new dynamic per-cpu allocator. sparc64: Only allocate per-cpu areas for possible cpus. ...
Diffstat (limited to 'arch/sparc/kernel/of_device_common.h')
-rw-r--r--arch/sparc/kernel/of_device_common.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/arch/sparc/kernel/of_device_common.h b/arch/sparc/kernel/of_device_common.h
new file mode 100644
index 00000000000..cdfd2399284
--- /dev/null
+++ b/arch/sparc/kernel/of_device_common.h
@@ -0,0 +1,36 @@
+#ifndef _OF_DEVICE_COMMON_H
+#define _OF_DEVICE_COMMON_H
+
+static inline u64 of_read_addr(const u32 *cell, int size)
+{
+ u64 r = 0;
+ while (size--)
+ r = (r << 32) | *(cell++);
+ return r;
+}
+
+void of_bus_default_count_cells(struct device_node *dev, int *addrc,
+ int *sizec);
+int of_out_of_range(const u32 *addr, const u32 *base,
+ const u32 *size, int na, int ns);
+int of_bus_default_map(u32 *addr, const u32 *range, int na, int ns, int pna);
+unsigned long of_bus_default_get_flags(const u32 *addr, unsigned long flags);
+
+int of_bus_sbus_match(struct device_node *np);
+void of_bus_sbus_count_cells(struct device_node *child, int *addrc, int *sizec);
+
+/* Max address size we deal with */
+#define OF_MAX_ADDR_CELLS 4
+
+struct of_bus {
+ const char *name;
+ const char *addr_prop_name;
+ int (*match)(struct device_node *parent);
+ void (*count_cells)(struct device_node *child,
+ int *addrc, int *sizec);
+ int (*map)(u32 *addr, const u32 *range,
+ int na, int ns, int pna);
+ unsigned long (*get_flags)(const u32 *addr, unsigned long);
+};
+
+#endif /* _OF_DEVICE_COMMON_H */