diff options
Diffstat (limited to 'arch/sparc/kernel/prom_32.c')
-rw-r--r-- | arch/sparc/kernel/prom_32.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/arch/sparc/kernel/prom_32.c b/arch/sparc/kernel/prom_32.c index fe43e80772db..0a37e8cfd160 100644 --- a/arch/sparc/kernel/prom_32.c +++ b/arch/sparc/kernel/prom_32.c | |||
@@ -24,6 +24,8 @@ | |||
24 | 24 | ||
25 | #include <asm/prom.h> | 25 | #include <asm/prom.h> |
26 | #include <asm/oplib.h> | 26 | #include <asm/oplib.h> |
27 | #include <asm/leon.h> | ||
28 | #include <asm/leon_amba.h> | ||
27 | 29 | ||
28 | #include "prom.h" | 30 | #include "prom.h" |
29 | 31 | ||
@@ -131,6 +133,35 @@ static void __init ebus_path_component(struct device_node *dp, char *tmp_buf) | |||
131 | regs->which_io, regs->phys_addr); | 133 | regs->which_io, regs->phys_addr); |
132 | } | 134 | } |
133 | 135 | ||
136 | /* "name:vendor:device@irq,addrlo" */ | ||
137 | static void __init ambapp_path_component(struct device_node *dp, char *tmp_buf) | ||
138 | { | ||
139 | struct amba_prom_registers *regs; unsigned int *intr; | ||
140 | unsigned int *device, *vendor; | ||
141 | struct property *prop; | ||
142 | |||
143 | prop = of_find_property(dp, "reg", NULL); | ||
144 | if (!prop) | ||
145 | return; | ||
146 | regs = prop->value; | ||
147 | prop = of_find_property(dp, "interrupts", NULL); | ||
148 | if (!prop) | ||
149 | return; | ||
150 | intr = prop->value; | ||
151 | prop = of_find_property(dp, "vendor", NULL); | ||
152 | if (!prop) | ||
153 | return; | ||
154 | vendor = prop->value; | ||
155 | prop = of_find_property(dp, "device", NULL); | ||
156 | if (!prop) | ||
157 | return; | ||
158 | device = prop->value; | ||
159 | |||
160 | sprintf(tmp_buf, "%s:%d:%d@%x,%x", | ||
161 | dp->name, *vendor, *device, | ||
162 | *intr, regs->phys_addr); | ||
163 | } | ||
164 | |||
134 | static void __init __build_path_component(struct device_node *dp, char *tmp_buf) | 165 | static void __init __build_path_component(struct device_node *dp, char *tmp_buf) |
135 | { | 166 | { |
136 | struct device_node *parent = dp->parent; | 167 | struct device_node *parent = dp->parent; |
@@ -143,6 +174,8 @@ static void __init __build_path_component(struct device_node *dp, char *tmp_buf) | |||
143 | return sbus_path_component(dp, tmp_buf); | 174 | return sbus_path_component(dp, tmp_buf); |
144 | if (!strcmp(parent->type, "ebus")) | 175 | if (!strcmp(parent->type, "ebus")) |
145 | return ebus_path_component(dp, tmp_buf); | 176 | return ebus_path_component(dp, tmp_buf); |
177 | if (!strcmp(parent->type, "ambapp")) | ||
178 | return ambapp_path_component(dp, tmp_buf); | ||
146 | 179 | ||
147 | /* "isa" is handled with platform naming */ | 180 | /* "isa" is handled with platform naming */ |
148 | } | 181 | } |