aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-sparc
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-sparc')
-rw-r--r--include/asm-sparc/of_device.h20
-rw-r--r--include/asm-sparc/prom.h12
2 files changed, 22 insertions, 10 deletions
diff --git a/include/asm-sparc/of_device.h b/include/asm-sparc/of_device.h
index 4816d102f918..80ea31f6e17f 100644
--- a/include/asm-sparc/of_device.h
+++ b/include/asm-sparc/of_device.h
@@ -4,10 +4,12 @@
4 4
5#include <linux/device.h> 5#include <linux/device.h>
6#include <linux/mod_devicetable.h> 6#include <linux/mod_devicetable.h>
7#include <asm/openprom.h>
7#include <asm/prom.h> 8#include <asm/prom.h>
8 9
9extern struct bus_type ebus_bus_type; 10extern struct bus_type ebus_bus_type;
10extern struct bus_type sbus_bus_type; 11extern struct bus_type sbus_bus_type;
12extern struct bus_type of_bus_type;
11 13
12/* 14/*
13 * The of_device is a kind of "base class" that is a superset of 15 * The of_device is a kind of "base class" that is a superset of
@@ -16,11 +18,25 @@ extern struct bus_type sbus_bus_type;
16 */ 18 */
17struct of_device 19struct of_device
18{ 20{
19 struct device_node *node; /* OF device node */ 21 struct device_node *node;
20 struct device dev; /* Generic device interface */ 22 struct device dev;
23 struct resource resource[PROMREG_MAX];
24 unsigned int irqs[PROMINTR_MAX];
25 int num_irqs;
26
27 void *sysdata;
28
29 int slot;
30 int portid;
31 int clock_freq;
21}; 32};
22#define to_of_device(d) container_of(d, struct of_device, dev) 33#define to_of_device(d) container_of(d, struct of_device, dev)
23 34
35extern void __iomem *of_ioremap(struct resource *res, unsigned long offset, unsigned long size, char *name);
36extern void of_iounmap(void __iomem *base, unsigned long size);
37
38extern struct of_device *of_find_device_by_node(struct device_node *);
39
24extern const struct of_device_id *of_match_device( 40extern const struct of_device_id *of_match_device(
25 const struct of_device_id *matches, const struct of_device *dev); 41 const struct of_device_id *matches, const struct of_device *dev);
26 42
diff --git a/include/asm-sparc/prom.h b/include/asm-sparc/prom.h
index f9cf44c07164..86c13dccea3d 100644
--- a/include/asm-sparc/prom.h
+++ b/include/asm-sparc/prom.h
@@ -25,11 +25,6 @@
25typedef u32 phandle; 25typedef u32 phandle;
26typedef u32 ihandle; 26typedef u32 ihandle;
27 27
28struct interrupt_info {
29 int line;
30 int sense; /* +ve/-ve logic, edge or level, etc. */
31};
32
33struct property { 28struct property {
34 char *name; 29 char *name;
35 int length; 30 int length;
@@ -43,9 +38,6 @@ struct device_node {
43 char *name; 38 char *name;
44 char *type; 39 char *type;
45 phandle node; 40 phandle node;
46 phandle linux_phandle;
47 int n_intrs;
48 struct interrupt_info *intrs;
49 char *path_component_name; 41 char *path_component_name;
50 char *full_name; 42 char *full_name;
51 43
@@ -69,6 +61,8 @@ struct device_node {
69#define OF_IS_DYNAMIC(x) test_bit(OF_DYNAMIC, &x->_flags) 61#define OF_IS_DYNAMIC(x) test_bit(OF_DYNAMIC, &x->_flags)
70#define OF_MARK_DYNAMIC(x) set_bit(OF_DYNAMIC, &x->_flags) 62#define OF_MARK_DYNAMIC(x) set_bit(OF_DYNAMIC, &x->_flags)
71 63
64#define OF_BAD_ADDR ((u64)-1)
65
72static inline void set_node_proc_entry(struct device_node *dn, struct proc_dir_entry *de) 66static inline void set_node_proc_entry(struct device_node *dn, struct proc_dir_entry *de)
73{ 67{
74 dn->pde = de; 68 dn->pde = de;
@@ -101,6 +95,8 @@ extern int of_set_property(struct device_node *node, const char *name, void *val
101extern int of_getintprop_default(struct device_node *np, 95extern int of_getintprop_default(struct device_node *np,
102 const char *name, 96 const char *name,
103 int def); 97 int def);
98extern int of_n_addr_cells(struct device_node *np);
99extern int of_n_size_cells(struct device_node *np);
104 100
105extern void prom_build_devicetree(void); 101extern void prom_build_devicetree(void);
106 102