diff options
Diffstat (limited to 'arch/sparc64/kernel/devices.c')
-rw-r--r-- | arch/sparc64/kernel/devices.c | 97 |
1 files changed, 0 insertions, 97 deletions
diff --git a/arch/sparc64/kernel/devices.c b/arch/sparc64/kernel/devices.c index ddbe8cda06af..f8ef2f2b9b37 100644 --- a/arch/sparc64/kernel/devices.c +++ b/arch/sparc64/kernel/devices.c | |||
@@ -20,8 +20,6 @@ | |||
20 | #include <asm/spitfire.h> | 20 | #include <asm/spitfire.h> |
21 | #include <asm/timer.h> | 21 | #include <asm/timer.h> |
22 | #include <asm/cpudata.h> | 22 | #include <asm/cpudata.h> |
23 | #include <asm/vdev.h> | ||
24 | #include <asm/irq.h> | ||
25 | 23 | ||
26 | /* Used to synchronize acceses to NatSemi SUPER I/O chip configure | 24 | /* Used to synchronize acceses to NatSemi SUPER I/O chip configure |
27 | * operations in asm/ns87303.h | 25 | * operations in asm/ns87303.h |
@@ -31,100 +29,6 @@ DEFINE_SPINLOCK(ns87303_lock); | |||
31 | extern void cpu_probe(void); | 29 | extern void cpu_probe(void); |
32 | extern void central_probe(void); | 30 | extern void central_probe(void); |
33 | 31 | ||
34 | u32 sun4v_vdev_devhandle; | ||
35 | struct device_node *sun4v_vdev_root; | ||
36 | |||
37 | struct vdev_intmap { | ||
38 | unsigned int phys; | ||
39 | unsigned int irq; | ||
40 | unsigned int cnode; | ||
41 | unsigned int cinterrupt; | ||
42 | }; | ||
43 | |||
44 | struct vdev_intmask { | ||
45 | unsigned int phys; | ||
46 | unsigned int interrupt; | ||
47 | unsigned int __unused; | ||
48 | }; | ||
49 | |||
50 | static struct vdev_intmap *vdev_intmap; | ||
51 | static int vdev_num_intmap; | ||
52 | static struct vdev_intmask *vdev_intmask; | ||
53 | |||
54 | static void __init sun4v_virtual_device_probe(void) | ||
55 | { | ||
56 | struct linux_prom64_registers *regs; | ||
57 | struct property *prop; | ||
58 | struct device_node *dp; | ||
59 | int sz; | ||
60 | |||
61 | if (tlb_type != hypervisor) | ||
62 | return; | ||
63 | |||
64 | dp = of_find_node_by_name(NULL, "virtual-devices"); | ||
65 | if (!dp) { | ||
66 | prom_printf("SUN4V: Fatal error, no virtual-devices node.\n"); | ||
67 | prom_halt(); | ||
68 | } | ||
69 | |||
70 | sun4v_vdev_root = dp; | ||
71 | |||
72 | prop = of_find_property(dp, "reg", NULL); | ||
73 | regs = prop->value; | ||
74 | sun4v_vdev_devhandle = (regs[0].phys_addr >> 32UL) & 0x0fffffff; | ||
75 | |||
76 | prop = of_find_property(dp, "interrupt-map", &sz); | ||
77 | vdev_intmap = prop->value; | ||
78 | vdev_num_intmap = sz / sizeof(struct vdev_intmap); | ||
79 | |||
80 | prop = of_find_property(dp, "interrupt-map-mask", NULL); | ||
81 | vdev_intmask = prop->value; | ||
82 | |||
83 | printk("%s: Virtual Device Bus devhandle[%x]\n", | ||
84 | dp->full_name, sun4v_vdev_devhandle); | ||
85 | } | ||
86 | |||
87 | unsigned int sun4v_vdev_device_interrupt(struct device_node *dev_node) | ||
88 | { | ||
89 | struct property *prop; | ||
90 | unsigned int irq, reg; | ||
91 | int i; | ||
92 | |||
93 | prop = of_find_property(dev_node, "interrupts", NULL); | ||
94 | if (!prop) { | ||
95 | printk("VDEV: Cannot get \"interrupts\" " | ||
96 | "property for OBP node %s\n", | ||
97 | dev_node->full_name); | ||
98 | return 0; | ||
99 | } | ||
100 | irq = *(unsigned int *) prop->value; | ||
101 | |||
102 | prop = of_find_property(dev_node, "reg", NULL); | ||
103 | if (!prop) { | ||
104 | printk("VDEV: Cannot get \"reg\" " | ||
105 | "property for OBP node %s\n", | ||
106 | dev_node->full_name); | ||
107 | return 0; | ||
108 | } | ||
109 | reg = *(unsigned int *) prop->value; | ||
110 | |||
111 | for (i = 0; i < vdev_num_intmap; i++) { | ||
112 | if (vdev_intmap[i].phys == (reg & vdev_intmask->phys) && | ||
113 | vdev_intmap[i].irq == (irq & vdev_intmask->interrupt)) { | ||
114 | irq = vdev_intmap[i].cinterrupt; | ||
115 | break; | ||
116 | } | ||
117 | } | ||
118 | |||
119 | if (i == vdev_num_intmap) { | ||
120 | printk("VDEV: No matching interrupt map entry " | ||
121 | "for OBP node %s\n", dev_node->full_name); | ||
122 | return 0; | ||
123 | } | ||
124 | |||
125 | return sun4v_build_irq(sun4v_vdev_devhandle, irq); | ||
126 | } | ||
127 | |||
128 | static const char *cpu_mid_prop(void) | 32 | static const char *cpu_mid_prop(void) |
129 | { | 33 | { |
130 | if (tlb_type == spitfire) | 34 | if (tlb_type == spitfire) |
@@ -289,7 +193,6 @@ void __init device_scan(void) | |||
289 | } | 193 | } |
290 | #endif | 194 | #endif |
291 | 195 | ||
292 | sun4v_virtual_device_probe(); | ||
293 | central_probe(); | 196 | central_probe(); |
294 | 197 | ||
295 | cpu_probe(); | 198 | cpu_probe(); |