aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arc/kernel/setup.c
diff options
context:
space:
mode:
authorVineet Gupta <vgupta@synopsys.com>2013-01-22 06:30:52 -0500
committerVineet Gupta <vgupta@synopsys.com>2013-02-15 12:45:55 -0500
commit999159a5381bff3bd6f688c5d20fbec9d8789e53 (patch)
treed54af343e2fa905b3d97d9dd87d763a43b256067 /arch/arc/kernel/setup.c
parentee36d1722112f33725ec1a7fc02f6c46e630fd27 (diff)
ARC: [DeviceTree] Basic support
This is minimal infrastructure needed for devicetree work. It uses an a sample "skeleton" devicetree - embedded in kernel image - to print the board, manufacturer by parsing the top-level "compatible" string. As of now we don't need any additional "board" specific "machine_desc". TODO: support interpreting the command line as boot-loader passed dtb Signed-off-by: Vineet Gupta <vgupta@synopsys.com> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Grant Likely <grant.likely@secretlab.ca> Cc: devicetree-discuss@lists.ozlabs.org Cc: Rob Herring <rob.herring@calxeda.com> Cc: James Hogan <james.hogan@imgtec.com> Reviewed-by: Rob Herring <rob.herring@calxeda.com> Reviewed-by: James Hogan <james.hogan@imgtec.com>
Diffstat (limited to 'arch/arc/kernel/setup.c')
-rw-r--r--arch/arc/kernel/setup.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/arch/arc/kernel/setup.c b/arch/arc/kernel/setup.c
index 82ac20603398..27aebd6d9513 100644
--- a/arch/arc/kernel/setup.c
+++ b/arch/arc/kernel/setup.c
@@ -13,6 +13,8 @@
13#include <linux/console.h> 13#include <linux/console.h>
14#include <linux/module.h> 14#include <linux/module.h>
15#include <linux/cpu.h> 15#include <linux/cpu.h>
16#include <linux/of_fdt.h>
17#include <asm/sections.h>
16#include <asm/arcregs.h> 18#include <asm/arcregs.h>
17#include <asm/tlb.h> 19#include <asm/tlb.h>
18#include <asm/cache.h> 20#include <asm/cache.h>
@@ -20,6 +22,7 @@
20#include <asm/page.h> 22#include <asm/page.h>
21#include <asm/irq.h> 23#include <asm/irq.h>
22#include <asm/arcregs.h> 24#include <asm/arcregs.h>
25#include <asm/prom.h>
23 26
24#define FIX_PTR(x) __asm__ __volatile__(";" : "+r"(x)) 27#define FIX_PTR(x) __asm__ __volatile__(";" : "+r"(x))
25 28
@@ -57,6 +60,8 @@ void __init __attribute__((weak)) arc_platform_early_init(void)
57 60
58void __init setup_arch(char **cmdline_p) 61void __init setup_arch(char **cmdline_p)
59{ 62{
63 int rc;
64
60#ifdef CONFIG_CMDLINE_UBOOT 65#ifdef CONFIG_CMDLINE_UBOOT
61 /* Make sure that a whitespace is inserted before */ 66 /* Make sure that a whitespace is inserted before */
62 strlcat(command_line, " ", sizeof(command_line)); 67 strlcat(command_line, " ", sizeof(command_line));
@@ -71,6 +76,8 @@ void __init setup_arch(char **cmdline_p)
71 strlcpy(boot_command_line, command_line, COMMAND_LINE_SIZE); 76 strlcpy(boot_command_line, command_line, COMMAND_LINE_SIZE);
72 *cmdline_p = command_line; 77 *cmdline_p = command_line;
73 78
79 rc = setup_machine_fdt(__dtb_start);
80
74 /* To force early parsing of things like mem=xxx */ 81 /* To force early parsing of things like mem=xxx */
75 parse_early_param(); 82 parse_early_param();
76 83
@@ -81,6 +88,8 @@ void __init setup_arch(char **cmdline_p)
81 88
82 setup_arch_memory(); 89 setup_arch_memory();
83 90
91 unflatten_device_tree();
92
84 /* Can be issue if someone passes cmd line arg "ro" 93 /* Can be issue if someone passes cmd line arg "ro"
85 * But that is unlikely so keeping it as it is 94 * But that is unlikely so keeping it as it is
86 */ 95 */