aboutsummaryrefslogtreecommitdiffstats
path: root/arch/openrisc/kernel/prom.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/openrisc/kernel/prom.c')
-rw-r--r--arch/openrisc/kernel/prom.c70
1 files changed, 1 insertions, 69 deletions
diff --git a/arch/openrisc/kernel/prom.c b/arch/openrisc/kernel/prom.c
index a63e76872f84..6a44340d1b18 100644
--- a/arch/openrisc/kernel/prom.c
+++ b/arch/openrisc/kernel/prom.c
@@ -18,83 +18,15 @@
18 * 18 *
19 */ 19 */
20 20
21#include <stdarg.h>
22#include <linux/kernel.h>
23#include <linux/string.h>
24#include <linux/init.h> 21#include <linux/init.h>
25#include <linux/threads.h>
26#include <linux/spinlock.h>
27#include <linux/types.h> 22#include <linux/types.h>
28#include <linux/pci.h>
29#include <linux/stringify.h>
30#include <linux/delay.h>
31#include <linux/initrd.h>
32#include <linux/bitops.h>
33#include <linux/module.h>
34#include <linux/kexec.h>
35#include <linux/debugfs.h>
36#include <linux/irq.h>
37#include <linux/memblock.h> 23#include <linux/memblock.h>
38#include <linux/of_fdt.h> 24#include <linux/of_fdt.h>
39 25
40#include <asm/prom.h>
41#include <asm/page.h> 26#include <asm/page.h>
42#include <asm/processor.h>
43#include <asm/irq.h>
44#include <linux/io.h>
45#include <asm/mmu.h>
46#include <asm/pgtable.h>
47#include <asm/sections.h>
48#include <asm/setup.h>
49
50extern char cmd_line[COMMAND_LINE_SIZE];
51
52void __init early_init_dt_add_memory_arch(u64 base, u64 size)
53{
54 size &= PAGE_MASK;
55 memblock_add(base, size);
56}
57 27
58void __init early_init_devtree(void *params) 28void __init early_init_devtree(void *params)
59{ 29{
60 void *alloc; 30 early_init_dt_scan(params);
61
62 /* Setup flat device-tree pointer */
63 initial_boot_params = params;
64
65
66 /* Retrieve various informations from the /chosen node of the
67 * device-tree, including the platform type, initrd location and
68 * size, TCE reserve, and more ...
69 */
70 of_scan_flat_dt(early_init_dt_scan_chosen, cmd_line);
71
72 /* Scan memory nodes and rebuild MEMBLOCKs */
73 of_scan_flat_dt(early_init_dt_scan_root, NULL);
74 of_scan_flat_dt(early_init_dt_scan_memory, NULL);
75
76 /* Save command line for /proc/cmdline and then parse parameters */
77 strlcpy(boot_command_line, cmd_line, COMMAND_LINE_SIZE);
78
79 memblock_allow_resize(); 31 memblock_allow_resize();
80
81 /* We must copy the flattend device tree from init memory to regular
82 * memory because the device tree references the strings in it
83 * directly.
84 */
85
86 alloc = __va(memblock_alloc(initial_boot_params->totalsize, PAGE_SIZE));
87
88 memcpy(alloc, initial_boot_params, initial_boot_params->totalsize);
89
90 initial_boot_params = alloc;
91}
92
93#ifdef CONFIG_BLK_DEV_INITRD
94void __init early_init_dt_setup_initrd_arch(u64 start, u64 end)
95{
96 initrd_start = (unsigned long)__va(start);
97 initrd_end = (unsigned long)__va(end);
98 initrd_below_start_ok = 1;
99} 32}
100#endif