summaryrefslogtreecommitdiff
path: root/arch/microblaze/kernel/prom.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/microblaze/kernel/prom.c')
-rw-r--r--arch/microblaze/kernel/prom.c53
1 files changed, 45 insertions, 8 deletions
diff --git a/arch/microblaze/kernel/prom.c b/arch/microblaze/kernel/prom.c
index e297d961c4cf..5505bcffd7dd 100644
--- a/arch/microblaze/kernel/prom.c
+++ b/arch/microblaze/kernel/prom.c
@@ -47,8 +47,9 @@ struct device_node *of_chosen;
#define early_init_dt_scan_drconf_memory(node) 0
-int __init early_init_dt_scan_cpus(unsigned long node, const char *uname,
- int depth, void *data)
+static int __init early_init_dt_scan_cpus(unsigned long node,
+ const char *uname, int depth,
+ void *data)
{
static int logical_cpuid;
char *type = of_get_flat_dt_prop(node, "device_type", NULL);
@@ -112,8 +113,8 @@ void __init early_init_dt_scan_chosen_arch(unsigned long node)
/* No Microblaze specific code here */
}
-int __init early_init_dt_scan_memory(unsigned long node, const char *uname,
- int depth, void *data)
+static int __init early_init_dt_scan_memory(unsigned long node,
+ const char *uname, int depth, void *data)
{
char *type = of_get_flat_dt_prop(node, "device_type", NULL);
__be32 *reg, *endp;
@@ -200,7 +201,7 @@ static inline unsigned long phyp_dump_calculate_reserve_size(void)
* without reserving anything. The memory in case of dump being
* active is freed when the dump is collected (by userland tools).
*/
-void __init phyp_dump_reserve_mem(void)
+static void __init phyp_dump_reserve_mem(void)
{
unsigned long base, size;
unsigned long variable_reserve_size;
@@ -239,7 +240,7 @@ void __init phyp_dump_reserve_mem(void)
}
}
#else
-inline void __init phyp_dump_reserve_mem(void) {}
+static inline void __init phyp_dump_reserve_mem(void) {}
#endif /* CONFIG_PHYP_DUMP && CONFIG_PPC_RTAS */
#ifdef CONFIG_EARLY_PRINTK
@@ -276,9 +277,45 @@ int __init early_uartlite_console(void)
}
#endif
-void __init early_init_devtree_arch(void)
+void __init early_init_devtree(void *params)
{
- /* No Microblaze specific code here */
+ pr_debug(" -> early_init_devtree(%p)\n", params);
+
+ /* Setup flat device-tree pointer */
+ initial_boot_params = params;
+
+#ifdef CONFIG_PHYP_DUMP
+ /* scan tree to see if dump occured during last boot */
+ of_scan_flat_dt(early_init_dt_scan_phyp_dump, NULL);
+#endif
+
+ /* Retrieve various informations from the /chosen node of the
+ * device-tree, including the platform type, initrd location and
+ * size, TCE reserve, and more ...
+ */
+ of_scan_flat_dt(early_init_dt_scan_chosen, NULL);
+
+ /* Scan memory nodes and rebuild LMBs */
+ lmb_init();
+ of_scan_flat_dt(early_init_dt_scan_root, NULL);
+ of_scan_flat_dt(early_init_dt_scan_memory, NULL);
+
+ /* Save command line for /proc/cmdline and then parse parameters */
+ strlcpy(boot_command_line, cmd_line, COMMAND_LINE_SIZE);
+ parse_early_param();
+
+ lmb_analyze();
+
+ pr_debug("Phys. mem: %lx\n", (unsigned long) lmb_phys_mem_size());
+
+ pr_debug("Scanning CPUs ...\n");
+
+ /* Retreive CPU related informations from the flat tree
+ * (altivec support, boot CPU ID, ...)
+ */
+ of_scan_flat_dt(early_init_dt_scan_cpus, NULL);
+
+ pr_debug(" <- early_init_devtree()\n");
}
/**