diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-sparc/of_device.h | 20 | ||||
-rw-r--r-- | include/asm-sparc/prom.h | 12 | ||||
-rw-r--r-- | include/asm-sparc64/of_device.h | 20 | ||||
-rw-r--r-- | include/asm-sparc64/pbm.h | 5 | ||||
-rw-r--r-- | include/asm-sparc64/prom.h | 20 | ||||
-rw-r--r-- | include/asm-sparc64/sbus.h | 1 | ||||
-rw-r--r-- | include/asm-sparc64/starfire.h | 2 |
7 files changed, 55 insertions, 25 deletions
diff --git a/include/asm-sparc/of_device.h b/include/asm-sparc/of_device.h index 4816d102f91..80ea31f6e17 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 f9cf44c0716..86c13dccea3 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); diff --git a/include/asm-sparc64/of_device.h b/include/asm-sparc64/of_device.h index 024088ef9d2..a62c7b997d6 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,11 +19,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-sparc64/pbm.h b/include/asm-sparc64/pbm.h index cebe80b1da6..dcfa7629358 100644 --- a/include/asm-sparc64/pbm.h +++ b/include/asm-sparc64/pbm.h @@ -16,6 +16,7 @@ #include <asm/page.h> #include <asm/oplib.h> #include <asm/prom.h> +#include <asm/of_device.h> #include <asm/iommu.h> /* The abstraction used here is that there are PCI controllers, @@ -209,7 +210,6 @@ struct pci_controller_info { /* Operations which are controller specific. */ void (*scan_bus)(struct pci_controller_info *); - unsigned int (*irq_build)(struct pci_pbm_info *, struct pci_dev *, unsigned int); void (*base_address_update)(struct pci_dev *, int); void (*resource_adjust)(struct pci_dev *, struct resource *, struct resource *); @@ -217,8 +217,6 @@ struct pci_controller_info { struct pci_ops *pci_ops; unsigned int pci_first_busno; unsigned int pci_last_busno; - - void *starfire_cookie; }; /* PCI devices which are not bridges have this placed in their pci_dev @@ -228,6 +226,7 @@ struct pci_controller_info { struct pcidev_cookie { struct pci_pbm_info *pbm; struct device_node *prom_node; + struct of_device *op; struct linux_prom_pci_registers prom_regs[PROMREG_MAX]; int num_prom_regs; struct linux_prom_pci_registers prom_assignments[PROMREG_MAX]; diff --git a/include/asm-sparc64/prom.h b/include/asm-sparc64/prom.h index 265614d497c..99671ed6625 100644 --- a/include/asm-sparc64/prom.h +++ b/include/asm-sparc64/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; @@ -39,13 +34,11 @@ struct property { unsigned int unique_id; }; +struct of_irq_controller; 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; @@ -61,6 +54,13 @@ struct device_node { unsigned long _flags; void *data; unsigned int unique_id; + + struct of_irq_controller *irq_trans; +}; + +struct of_irq_controller { + unsigned int (*irq_build)(struct device_node *, unsigned int, void *); + void *data; }; /* flag descriptions */ @@ -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; @@ -101,6 +103,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); diff --git a/include/asm-sparc64/sbus.h b/include/asm-sparc64/sbus.h index 56ee985e460..7efd49d31bb 100644 --- a/include/asm-sparc64/sbus.h +++ b/include/asm-sparc64/sbus.h @@ -80,7 +80,6 @@ struct sbus_bus { int num_sbus_ranges; int portid; - void *starfire_cookie; }; #define to_sbus(d) container_of(d, struct sbus_bus, ofdev.dev) diff --git a/include/asm-sparc64/starfire.h b/include/asm-sparc64/starfire.h index b606cb2b32a..48b50b5e35b 100644 --- a/include/asm-sparc64/starfire.h +++ b/include/asm-sparc64/starfire.h @@ -14,7 +14,7 @@ extern int this_is_starfire; extern void check_if_starfire(void); extern void starfire_cpu_setup(void); extern int starfire_hard_smp_processor_id(void); -extern void *starfire_hookup(int); +extern void starfire_hookup(int); extern unsigned int starfire_translate(unsigned long imap, unsigned int upaid); #endif |