aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-sparc64/sbus.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-sparc64/sbus.h')
-rw-r--r--include/asm-sparc64/sbus.h29
1 files changed, 21 insertions, 8 deletions
diff --git a/include/asm-sparc64/sbus.h b/include/asm-sparc64/sbus.h
index 48279e10f385..56ee985e4605 100644
--- a/include/asm-sparc64/sbus.h
+++ b/include/asm-sparc64/sbus.h
@@ -11,6 +11,8 @@
11#include <linux/ioport.h> 11#include <linux/ioport.h>
12 12
13#include <asm/oplib.h> 13#include <asm/oplib.h>
14#include <asm/prom.h>
15#include <asm/of_device.h>
14#include <asm/iommu.h> 16#include <asm/iommu.h>
15#include <asm/scatterlist.h> 17#include <asm/scatterlist.h>
16 18
@@ -42,18 +44,19 @@ struct sbus_bus;
42 44
43/* Linux SBUS device tables */ 45/* Linux SBUS device tables */
44struct sbus_dev { 46struct sbus_dev {
45 struct sbus_bus *bus; /* Our toplevel parent SBUS */ 47 struct of_device ofdev;
46 struct sbus_dev *next; /* Chain of siblings */ 48 struct sbus_bus *bus;
47 struct sbus_dev *child; /* Chain of children */ 49 struct sbus_dev *next;
48 struct sbus_dev *parent;/* Parent device if not toplevel*/ 50 struct sbus_dev *child;
49 int prom_node; /* OBP node of this device */ 51 struct sbus_dev *parent;
50 char prom_name[64]; /* OBP device name property */ 52 int prom_node;
51 int slot; /* SBUS slot number */ 53 char prom_name[64];
54 int slot;
52 55
53 struct resource resource[PROMREG_MAX]; 56 struct resource resource[PROMREG_MAX];
54 57
55 struct linux_prom_registers reg_addrs[PROMREG_MAX]; 58 struct linux_prom_registers reg_addrs[PROMREG_MAX];
56 int num_registers, ranges_applied; 59 int num_registers;
57 60
58 struct linux_prom_ranges device_ranges[PROMREG_MAX]; 61 struct linux_prom_ranges device_ranges[PROMREG_MAX];
59 int num_device_ranges; 62 int num_device_ranges;
@@ -61,9 +64,11 @@ struct sbus_dev {
61 unsigned int irqs[4]; 64 unsigned int irqs[4];
62 int num_irqs; 65 int num_irqs;
63}; 66};
67#define to_sbus_device(d) container_of(d, struct sbus_dev, ofdev.dev)
64 68
65/* This struct describes the SBus(s) found on this machine. */ 69/* This struct describes the SBus(s) found on this machine. */
66struct sbus_bus { 70struct sbus_bus {
71 struct of_device ofdev;
67 void *iommu; /* Opaque IOMMU cookie */ 72 void *iommu; /* Opaque IOMMU cookie */
68 struct sbus_dev *devices; /* Tree of SBUS devices */ 73 struct sbus_dev *devices; /* Tree of SBUS devices */
69 struct sbus_bus *next; /* Next SBUS in system */ 74 struct sbus_bus *next; /* Next SBUS in system */
@@ -77,6 +82,7 @@ struct sbus_bus {
77 int portid; 82 int portid;
78 void *starfire_cookie; 83 void *starfire_cookie;
79}; 84};
85#define to_sbus(d) container_of(d, struct sbus_bus, ofdev.dev)
80 86
81extern struct sbus_bus *sbus_root; 87extern struct sbus_bus *sbus_root;
82 88
@@ -95,6 +101,7 @@ extern struct sbus_bus *sbus_root;
95#define sbus_can_dma_64bit(sdev) (1) 101#define sbus_can_dma_64bit(sdev) (1)
96#define sbus_can_burst64(sdev) (1) 102#define sbus_can_burst64(sdev) (1)
97extern void sbus_set_sbus64(struct sbus_dev *, int); 103extern void sbus_set_sbus64(struct sbus_dev *, int);
104extern void sbus_fill_device_irq(struct sbus_dev *);
98 105
99/* These yield IOMMU mappings in consistent mode. */ 106/* These yield IOMMU mappings in consistent mode. */
100extern void *sbus_alloc_consistent(struct sbus_dev *, size_t, dma_addr_t *dma_addrp); 107extern void *sbus_alloc_consistent(struct sbus_dev *, size_t, dma_addr_t *dma_addrp);
@@ -119,4 +126,10 @@ extern void sbus_dma_sync_sg_for_cpu(struct sbus_dev *, struct scatterlist *, in
119#define sbus_dma_sync_sg sbus_dma_sync_sg_for_cpu 126#define sbus_dma_sync_sg sbus_dma_sync_sg_for_cpu
120extern void sbus_dma_sync_sg_for_device(struct sbus_dev *, struct scatterlist *, int, int); 127extern void sbus_dma_sync_sg_for_device(struct sbus_dev *, struct scatterlist *, int, int);
121 128
129extern void sbus_arch_bus_ranges_init(struct device_node *, struct sbus_bus *);
130extern void sbus_setup_iommu(struct sbus_bus *, struct device_node *);
131extern void sbus_setup_arch_props(struct sbus_bus *, struct device_node *);
132extern int sbus_arch_preinit(void);
133extern void sbus_arch_postinit(void);
134
122#endif /* !(_SPARC64_SBUS_H) */ 135#endif /* !(_SPARC64_SBUS_H) */