X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=arch%2Fsparc%2Fkernel%2Fprom_32.c;h=fe43e80772dbf597e201b7badd87521b364c6e53;hb=45e3e1935e2857c54783291107d33323b3ef33c8;hp=a9859d2b256590bf26755ba29f0e94e3aa8770b7;hpb=b9e5567cda6387e0f4061bfceebbc1bd63ee42a6;p=mv-sheeva.git diff --git a/arch/sparc/kernel/prom_32.c b/arch/sparc/kernel/prom_32.c index a9859d2b256..fe43e80772d 100644 --- a/arch/sparc/kernel/prom_32.c +++ b/arch/sparc/kernel/prom_32.c @@ -27,8 +27,6 @@ #include "prom.h" -static unsigned int prom_early_allocated; - void * __init prom_early_alloc(unsigned long size) { void *ret; @@ -42,14 +40,6 @@ void * __init prom_early_alloc(unsigned long size) return ret; } -static int is_root_node(const struct device_node *dp) -{ - if (!dp) - return 0; - - return (dp->parent == NULL); -} - /* The following routines deal with the black magic of fully naming a * node. * @@ -161,7 +151,7 @@ static void __init __build_path_component(struct device_node *dp, char *tmp_buf) return sparc32_path_component(dp, tmp_buf); } -static char * __init build_path_component(struct device_node *dp) +char * __init build_path_component(struct device_node *dp) { char tmp_buf[64], *n; @@ -176,96 +166,9 @@ static char * __init build_path_component(struct device_node *dp) return n; } -static char * __init build_full_name(struct device_node *dp) -{ - int len, ourlen, plen; - char *n; - - plen = strlen(dp->parent->full_name); - ourlen = strlen(dp->path_component_name); - len = ourlen + plen + 2; - - n = prom_early_alloc(len); - strcpy(n, dp->parent->full_name); - if (!is_root_node(dp->parent)) { - strcpy(n + plen, "/"); - plen++; - } - strcpy(n + plen, dp->path_component_name); - - return n; -} - -static char * __init get_one_property(phandle node, char *name) -{ - char *buf = ""; - int len; - - len = prom_getproplen(node, name); - if (len > 0) { - buf = prom_early_alloc(len); - len = prom_getproperty(node, name, buf, len); - } - - return buf; -} - -static struct device_node * __init create_node(phandle node) -{ - struct device_node *dp; - - if (!node) - return NULL; - - dp = prom_early_alloc(sizeof(*dp)); - dp->unique_id = prom_unique_id++; - - kref_init(&dp->kref); - - dp->name = get_one_property(node, "name"); - dp->type = get_one_property(node, "device_type"); - dp->node = node; - - /* Build interrupts later... */ - - dp->properties = build_prop_list(node); - - return dp; -} - -static struct device_node * __init build_tree(struct device_node *parent, phandle node, struct device_node ***nextp) -{ - struct device_node *dp; - - dp = create_node(node); - if (dp) { - *(*nextp) = dp; - *nextp = &dp->allnext; - - dp->parent = parent; - dp->path_component_name = build_path_component(dp); - dp->full_name = build_full_name(dp); - - dp->child = build_tree(dp, prom_getchild(node), nextp); - - dp->sibling = build_tree(parent, prom_getsibling(node), nextp); - } - - return dp; -} - -struct device_node *of_console_device; -EXPORT_SYMBOL(of_console_device); - -char *of_console_path; -EXPORT_SYMBOL(of_console_path); - -char *of_console_options; -EXPORT_SYMBOL(of_console_options); - extern void restore_current(void); -static void __init of_console_init(void) +void __init of_console_init(void) { char *msg = "OF stdout device is: %s\n"; struct device_node *dp; @@ -383,20 +286,10 @@ static void __init of_console_init(void) printk(msg, of_console_path); } -void __init prom_build_devicetree(void) +void __init of_fill_in_cpu_data(void) { - struct device_node **nextp; - - allnodes = create_node(prom_root_node); - allnodes->path_component_name = ""; - allnodes->full_name = "/"; - - nextp = &allnodes->allnext; - allnodes->child = build_tree(allnodes, - prom_getchild(allnodes->node), - &nextp); - of_console_init(); +} - printk("PROM: Built device tree with %u bytes of memory.\n", - prom_early_allocated); +void __init irq_trans_init(struct device_node *dp) +{ }