aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arc/kernel/setup.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arc/kernel/setup.c')
-rw-r--r--arch/arc/kernel/setup.c28
1 files changed, 25 insertions, 3 deletions
diff --git a/arch/arc/kernel/setup.c b/arch/arc/kernel/setup.c
index 6cc361c6751a..20273b89e545 100644
--- a/arch/arc/kernel/setup.c
+++ b/arch/arc/kernel/setup.c
@@ -25,12 +25,14 @@
25#include <asm/prom.h> 25#include <asm/prom.h>
26#include <asm/unwind.h> 26#include <asm/unwind.h>
27#include <asm/clk.h> 27#include <asm/clk.h>
28#include <asm/mach_desc.h>
28 29
29#define FIX_PTR(x) __asm__ __volatile__(";" : "+r"(x)) 30#define FIX_PTR(x) __asm__ __volatile__(";" : "+r"(x))
30 31
31int running_on_hw = 1; /* vs. on ISS */ 32int running_on_hw = 1; /* vs. on ISS */
32 33
33char __initdata command_line[COMMAND_LINE_SIZE]; 34char __initdata command_line[COMMAND_LINE_SIZE];
35struct machine_desc *machine_desc __initdata;
34 36
35struct task_struct *_current_task[NR_CPUS]; /* For stack switching */ 37struct task_struct *_current_task[NR_CPUS]; /* For stack switching */
36 38
@@ -323,8 +325,6 @@ void __init __attribute__((weak)) arc_platform_early_init(void)
323 325
324void __init setup_arch(char **cmdline_p) 326void __init setup_arch(char **cmdline_p)
325{ 327{
326 int rc;
327
328#ifdef CONFIG_CMDLINE_UBOOT 328#ifdef CONFIG_CMDLINE_UBOOT
329 /* Make sure that a whitespace is inserted before */ 329 /* Make sure that a whitespace is inserted before */
330 strlcat(command_line, " ", sizeof(command_line)); 330 strlcat(command_line, " ", sizeof(command_line));
@@ -339,13 +339,17 @@ void __init setup_arch(char **cmdline_p)
339 strlcpy(boot_command_line, command_line, COMMAND_LINE_SIZE); 339 strlcpy(boot_command_line, command_line, COMMAND_LINE_SIZE);
340 *cmdline_p = command_line; 340 *cmdline_p = command_line;
341 341
342 rc = setup_machine_fdt(__dtb_start); 342 machine_desc = setup_machine_fdt(__dtb_start);
343 if (!machine_desc)
344 panic("Embedded DT invalid\n");
343 345
344 /* To force early parsing of things like mem=xxx */ 346 /* To force early parsing of things like mem=xxx */
345 parse_early_param(); 347 parse_early_param();
346 348
347 /* Platform/board specific: e.g. early console registration */ 349 /* Platform/board specific: e.g. early console registration */
348 arc_platform_early_init(); 350 arc_platform_early_init();
351 if (machine_desc->init_early)
352 machine_desc->init_early();
349 353
350 setup_processor(); 354 setup_processor();
351 355
@@ -372,6 +376,24 @@ void __init setup_arch(char **cmdline_p)
372 arc_unwind_setup(); 376 arc_unwind_setup();
373} 377}
374 378
379static int __init customize_machine(void)
380{
381 /* Add platform devices */
382 if (machine_desc->init_machine)
383 machine_desc->init_machine();
384
385 return 0;
386}
387arch_initcall(customize_machine);
388
389static int __init init_late_machine(void)
390{
391 if (machine_desc->init_late)
392 machine_desc->init_late();
393
394 return 0;
395}
396late_initcall(init_late_machine);
375/* 397/*
376 * Get CPU information for use by the procfs. 398 * Get CPU information for use by the procfs.
377 */ 399 */