summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2006-06-29 14:34:50 -0700
committerDavid S. Miller <davem@sunset.davemloft.net>2006-06-29 16:37:12 -0700
commitcf44bbc26cf1361b692ab68c884f6a0df7da2fdb (patch)
treee16c980a25df8a31445a005d75da2c37f30a7b67 /include
parent3ae9a3489a4e2ba665a344a9250c2af05b7b0c59 (diff)
[SPARC]: Beginnings of generic of_device framework.
The idea is to fully construct the device register and interrupt values into these of_device objects, and convert all of SBUS, EBUS, ISA drivers to use this new stuff. Much ideas and code taken from Ben H.'s powerpc work. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r--include/asm-sparc/of_device.h14
-rw-r--r--include/asm-sparc/prom.h2
-rw-r--r--include/asm-sparc64/of_device.h14
-rw-r--r--include/asm-sparc64/prom.h2
4 files changed, 28 insertions, 4 deletions
diff --git a/include/asm-sparc/of_device.h b/include/asm-sparc/of_device.h
index 4816d102f918..1b43ee5eb5e7 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,8 +18,16 @@ 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 irq;
+
+ void *sysdata;
+
+ int slot;
+ int portid;
+ int clock_freq;
};
#define to_of_device(d) container_of(d, struct of_device, dev)
diff --git a/include/asm-sparc/prom.h b/include/asm-sparc/prom.h
index 7032d02d3197..b4a061c5241d 100644
--- a/include/asm-sparc/prom.h
+++ b/include/asm-sparc/prom.h
@@ -69,6 +69,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;
diff --git a/include/asm-sparc64/of_device.h b/include/asm-sparc64/of_device.h
index 024088ef9d27..27bc08671d68 100644
--- a/include/asm-sparc64/of_device.h
+++ b/include/asm-sparc64/of_device.h
@@ -4,11 +4,13 @@
#include <linux/device.h>
#include <linux/mod_devicetable.h>
+#include <asm/openprom.h>
#include <asm/prom.h>
extern struct bus_type isa_bus_type;
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
@@ -17,8 +19,16 @@ 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 irq;
+
+ void *sysdata;
+
+ int slot;
+ int portid;
+ int clock_freq;
};
#define to_of_device(d) container_of(d, struct of_device, dev)
diff --git a/include/asm-sparc64/prom.h b/include/asm-sparc64/prom.h
index 4cecfe6d135d..d2849312dea1 100644
--- a/include/asm-sparc64/prom.h
+++ b/include/asm-sparc64/prom.h
@@ -69,6 +69,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;