]> git.karo-electronics.de Git - linux-beck.git/blobdiff - include/asm-powerpc/prom.h
[PATCH] powerpc: Add of_parse_dma_window()
[linux-beck.git] / include / asm-powerpc / prom.h
index cbd297f44cce6490ac1220898a945d58c95158aa..c79d58ab7441898e6b68ee8a5504b66754cd8222 100644 (file)
@@ -126,8 +126,14 @@ extern struct device_node *find_all_nodes(void);
 /* New style node lookup */
 extern struct device_node *of_find_node_by_name(struct device_node *from,
        const char *name);
+#define for_each_node_by_name(dn, name) \
+       for (dn = of_find_node_by_name(NULL, name); dn; \
+            dn = of_find_node_by_name(dn, name))
 extern struct device_node *of_find_node_by_type(struct device_node *from,
        const char *type);
+#define for_each_node_by_type(dn, type) \
+       for (dn = of_find_node_by_type(NULL, type); dn; \
+            dn = of_find_node_by_type(dn, type))
 extern struct device_node *of_find_compatible_node(struct device_node *from,
        const char *type, const char *compat);
 extern struct device_node *of_find_node_by_path(const char *path);
@@ -143,12 +149,14 @@ extern struct device_node *of_node_get(struct device_node *node);
 extern void of_node_put(struct device_node *node);
 
 /* For scanning the flat device-tree at boot time */
-int __init of_scan_flat_dt(int (*it)(unsigned long node,
-                                    const char *uname, int depth,
-                                    void *data),
-                          void *data);
-void* __init of_get_flat_dt_prop(unsigned long node, const char *name,
-                                unsigned long *size);
+extern int __init of_scan_flat_dt(int (*it)(unsigned long node,
+                                           const char *uname, int depth,
+                                           void *data),
+                                 void *data);
+extern void* __init of_get_flat_dt_prop(unsigned long node, const char *name,
+                                       unsigned long *size);
+extern int __init of_flat_dt_is_compatible(unsigned long node, const char *name);
+extern unsigned long __init of_get_flat_dt_root(void);
 
 /* For updating the device tree at runtime */
 extern void of_attach_node(struct device_node *);
@@ -222,6 +230,12 @@ extern int of_address_to_resource(struct device_node *dev, int index,
 extern int of_pci_address_to_resource(struct device_node *dev, int bar,
                                      struct resource *r);
 
+/* Parse the ibm,dma-window property of an OF node into the busno, phys and
+ * size parameters.
+ */
+void of_parse_dma_window(struct device_node *dn, unsigned char *dma_window_prop,
+               unsigned long *busno, unsigned long *phys, unsigned long *size);
+
 extern void kdump_move_device_tree(void);
 
 #endif /* __KERNEL__ */