aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc/mm/io-unit.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-08-27 07:54:04 -0400
committerDavid S. Miller <davem@davemloft.net>2008-08-29 05:15:21 -0400
commit046e26a8ba10b8ceff822f8d91451ab6c1e08c4e (patch)
tree92e95380c0f7f6c5257023a59b88d4221d3f9744 /arch/sparc/mm/io-unit.c
parent5059625ed8862e897760b86effff0f8a35989c0d (diff)
sparc: Remove generic SBUS probing layer.
The individual SBUS IOMMU arch code now sets the IOMMU information directly into the OF device objects. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc/mm/io-unit.c')
-rw-r--r--arch/sparc/mm/io-unit.c30
1 files changed, 20 insertions, 10 deletions
diff --git a/arch/sparc/mm/io-unit.c b/arch/sparc/mm/io-unit.c
index 0f97ab30df3f..caf551ad9d8c 100644
--- a/arch/sparc/mm/io-unit.c
+++ b/arch/sparc/mm/io-unit.c
@@ -34,18 +34,10 @@
34#define IOPERM (IOUPTE_CACHE | IOUPTE_WRITE | IOUPTE_VALID) 34#define IOPERM (IOUPTE_CACHE | IOUPTE_WRITE | IOUPTE_VALID)
35#define MKIOPTE(phys) __iopte((((phys)>>4) & IOUPTE_PAGE) | IOPERM) 35#define MKIOPTE(phys) __iopte((((phys)>>4) & IOUPTE_PAGE) | IOPERM)
36 36
37void __init iounit_init(struct sbus_bus *sbus) 37static void __init iounit_iommu_init(struct of_device *op)
38{ 38{
39 struct device_node *dp = sbus->ofdev.node;
40 struct iounit_struct *iounit; 39 struct iounit_struct *iounit;
41 iopte_t *xpt, *xptend; 40 iopte_t *xpt, *xptend;
42 struct of_device *op;
43
44 op = of_find_device_by_node(dp);
45 if (!op) {
46 prom_printf("SUN4D: Cannot find SBI of_device.\n");
47 prom_halt();
48 }
49 41
50 iounit = kzalloc(sizeof(struct iounit_struct), GFP_ATOMIC); 42 iounit = kzalloc(sizeof(struct iounit_struct), GFP_ATOMIC);
51 if (!iounit) { 43 if (!iounit) {
@@ -66,7 +58,6 @@ void __init iounit_init(struct sbus_bus *sbus)
66 prom_halt(); 58 prom_halt();
67 } 59 }
68 60
69 sbus->ofdev.dev.archdata.iommu = iounit;
70 op->dev.archdata.iommu = iounit; 61 op->dev.archdata.iommu = iounit;
71 iounit->page_table = xpt; 62 iounit->page_table = xpt;
72 spin_lock_init(&iounit->lock); 63 spin_lock_init(&iounit->lock);
@@ -76,6 +67,25 @@ void __init iounit_init(struct sbus_bus *sbus)
76 iopte_val(*xpt++) = 0; 67 iopte_val(*xpt++) = 0;
77} 68}
78 69
70static int __init iounit_init(void)
71{
72 extern void sun4d_init_sbi_irq(void);
73 struct device_node *dp;
74
75 for_each_node_by_name(dp, "sbi") {
76 struct of_device *op = of_find_device_by_node(dp);
77
78 iounit_iommu_init(op);
79 of_propagate_archdata(op);
80 }
81
82 sun4d_init_sbi_irq();
83
84 return 0;
85}
86
87subsys_initcall(iounit_init);
88
79/* One has to hold iounit->lock to call this */ 89/* One has to hold iounit->lock to call this */
80static unsigned long iounit_get_area(struct iounit_struct *iounit, unsigned long vaddr, int size) 90static unsigned long iounit_get_area(struct iounit_struct *iounit, unsigned long vaddr, int size)
81{ 91{