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 @@
#include <linux/device.h>
#include <linux/mod_devicetable.h>
+#include <asm/openprom.h>
#include <asm/prom.h>
extern struct bus_type ebus_bus_type;
extern struct bus_type sbus_bus_type;
+extern struct bus_type of_bus_type;
/*
* 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;
*/
struct of_device
{
- struct device_node *node; /* OF device node */
- struct device dev; /* Generic device interface */
+ struct device_node *node;
+ struct device dev;
+ struct resource resource[PROMREG_MAX];
+ unsigned int irqs[PROMINTR_MAX];
+ int num_irqs;
+
+ void *sysdata;
+
+ int slot;
+ int portid;
+ int clock_freq;
};
#define to_of_device(d) container_of(d, struct of_device, dev)
+extern void __iomem *of_ioremap(struct resource *res, unsigned long offset, unsigned long size, char *name);
+extern void of_iounmap(void __iomem *base, unsigned long size);
+
+extern struct of_device *of_find_device_by_node(struct device_node *);
+
extern const struct of_device_id *of_match_device(
const struct of_device_id *matches, const struct of_device *dev);
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 @@
typedef u32 phandle;
typedef u32 ihandle;
-struct interrupt_info {
- int line;
- int sense; /* +ve/-ve logic, edge or level, etc. */
-};
-
struct property {
char *name;
int length;
@@ -43,9 +38,6 @@ struct device_node {
char *name;
char *type;
phandle node;
- phandle linux_phandle;
- int n_intrs;
- struct interrupt_info *intrs;
char *path_component_name;
char *full_name;
@@ -69,6 +61,8 @@ struct device_node {
#define OF_IS_DYNAMIC(x) test_bit(OF_DYNAMIC, &x->_flags)
#define OF_MARK_DYNAMIC(x) set_bit(OF_DYNAMIC, &x->_flags)
+#define OF_BAD_ADDR ((u64)-1)
+
static inline void set_node_proc_entry(struct device_node *dn, struct proc_dir_entry *de)
{
dn->pde = de;
@@ -101,6 +95,8 @@ extern int of_set_property(struct device_node *node, const char *name, void *val
extern int of_getintprop_default(struct device_node *np,
const char *name,
int def);
+extern int of_n_addr_cells(struct device_node *np);
+extern int of_n_size_cells(struct device_node *np);
extern void prom_build_devicetree(void);