18 #include <linux/kernel.h>
19 #include <linux/types.h>
20 #include <linux/string.h>
26 #include <asm/oplib.h>
40 prom_printf(
"prom_early_alloc(%lu) failed\n", size);
83 if (!of_node_is_root(dp->
parent)) {
87 (
unsigned int) (regs->
phys_addr & 0xffffffffUL));
92 high_bits = (regs->
phys_addr >> 32
UL) & 0x0fffffffUL;
95 if (type == 0 || type == 8) {
96 const char *
prefix = (type == 0) ?
"m" :
"i";
101 high_bits, low_bits);
107 }
else if (type == 12) {
109 dp->
name, high_bits);
123 if (!of_node_is_root(dp->
parent)) {
127 (
unsigned int) (regs->
phys_addr & 0xffffffffUL));
135 unsigned long mask = 0xffffffff
UL;
143 (
unsigned int) (regs->
phys_addr & mask));
176 devfn = (regs->
phys_hi >> 8) & 0xff;
208 (
unsigned int) (regs->
phys_addr & 0xffffffffUL));
241 (
unsigned int) (regs->
phys_addr & 0xffffffffUL));
260 dp->
name, regs[0], regs[1]);
275 if (prop->
length ==
sizeof(
u32) || regs[1] == 1) {
280 dp->
name, regs[0], regs[1]);
285 static void __init ieee1394_path_component(
struct device_node *dp,
char *tmp_buf)
296 if (regs[2] || regs[3]) {
297 sprintf(tmp_buf,
"%s@%08x%08x,%04x%08x",
298 dp->
name, regs[0], regs[1], regs[2], regs[3]);
300 sprintf(tmp_buf,
"%s@%08x%08x",
301 dp->
name, regs[0], regs[1]);
309 if (parent !=
NULL) {
312 pci_path_component(dp, tmp_buf);
316 sbus_path_component(dp, tmp_buf);
320 upa_path_component(dp, tmp_buf);
324 ebus_path_component(dp, tmp_buf);
329 usb_path_component(dp, tmp_buf);
333 i2c_path_component(dp, tmp_buf);
337 ieee1394_path_component(dp, tmp_buf);
340 if (!
strcmp(parent->
type,
"virtual-devices")) {
341 vdev_path_component(dp, tmp_buf);
349 sun4v_path_component(dp, tmp_buf);
352 sun4u_path_component(dp, tmp_buf);
358 char tmp_buf[64], *
n;
361 __build_path_component(dp, tmp_buf);
362 if (tmp_buf[0] ==
'\0')
371 static const char *get_mid_prop(
void)
373 return (
tlb_type == spitfire ?
"upa-portid" :
"portid");
376 static void *of_iterate_over_cpus(
void *(*
func)(
struct device_node *,
int,
int),
int arg)
379 const char *mid_prop;
381 mid_prop = get_mid_prop();
382 for_each_node_by_type(dp,
"cpu") {
384 const char *this_mid_prop = mid_prop;
388 this_mid_prop =
"cpuid";
393 "%s property", this_mid_prop);
404 ret =
func(dp, cpuid, arg);
411 static void *check_cpu_node(
struct device_node *dp,
int cpuid,
int id)
420 return of_iterate_over_cpus(check_cpu_node, cpuid);
423 static void *record_one_cpu(
struct device_node *dp,
int cpuid,
int arg)
439 of_iterate_over_cpus(record_one_cpu, 0);
442 static void *fill_in_one_cpu(
struct device_node *dp,
int cpuid,
int arg)
452 portid_parent = portid_parent->
parent;
493 !
cpu_data(cpuid).ecache_line_size) {
500 "l2-cache-line-size", 64);
503 cpu_data(cpuid).core_id = portid + 1;
506 sparc64_multi_core = 1;
537 of_iterate_over_cpus(fill_in_one_cpu, 0);
544 char *
msg =
"OF stdout device is: %s\n";
571 prom_printf(
"Console stdout lacks device_type property.\n");
575 if (
strcmp(type,
"display") &&
strcmp(type,
"serial")) {
576 prom_printf(
"Console device_type is neither display "