diff options
author | Vineet Gupta <vgupta@synopsys.com> | 2013-01-18 04:42:20 -0500 |
---|---|---|
committer | Vineet Gupta <vgupta@synopsys.com> | 2013-02-15 12:45:54 -0500 |
commit | c121c5063c0674fad6811f0b0d86ec3bc6eecbbd (patch) | |
tree | 956c6f18fcf72d3e20a86168669237ecdabd8a13 /arch/arc/kernel/head.S | |
parent | 1162b0701b14ba112d4e3fe5c27c694caf983539 (diff) |
ARC: Boot #1: low-level, setup_arch(), /proc/cpuinfo, mem init
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'arch/arc/kernel/head.S')
-rw-r--r-- | arch/arc/kernel/head.S | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/arch/arc/kernel/head.S b/arch/arc/kernel/head.S new file mode 100644 index 000000000000..e63f6a43abb1 --- /dev/null +++ b/arch/arc/kernel/head.S | |||
@@ -0,0 +1,78 @@ | |||
1 | /* | ||
2 | * ARC CPU startup Code | ||
3 | * | ||
4 | * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com) | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | * | ||
10 | * Vineetg: Dec 2007 | ||
11 | * -Check if we are running on Simulator or on real hardware | ||
12 | * to skip certain things during boot on simulator | ||
13 | */ | ||
14 | |||
15 | #include <asm/asm-offsets.h> | ||
16 | #include <asm/entry.h> | ||
17 | #include <linux/linkage.h> | ||
18 | #include <asm/arcregs.h> | ||
19 | |||
20 | .cpu A7 | ||
21 | |||
22 | .section .init.text, "ax",@progbits | ||
23 | .type stext, @function | ||
24 | .globl stext | ||
25 | stext: | ||
26 | ;------------------------------------------------------------------- | ||
27 | ; Don't clobber r0-r4 yet. It might have bootloader provided info | ||
28 | ;------------------------------------------------------------------- | ||
29 | |||
30 | ; Clear BSS before updating any globals | ||
31 | ; XXX: use ZOL here | ||
32 | mov r5, __bss_start | ||
33 | mov r6, __bss_stop | ||
34 | 1: | ||
35 | st.ab 0, [r5,4] | ||
36 | brlt r5, r6, 1b | ||
37 | |||
38 | #ifdef CONFIG_CMDLINE_UBOOT | ||
39 | ; support for bootloader provided cmdline | ||
40 | ; If cmdline passed by u-boot, then | ||
41 | ; r0 = 1 (because ATAGS parsing, now retired, used to use 0) | ||
42 | ; r1 = magic number (board identity) | ||
43 | ; r2 = addr of cmdline string (somewhere in memory/flash) | ||
44 | |||
45 | brne r0, 1, .Lother_bootup_chores ; u-boot didn't pass cmdline | ||
46 | breq r2, 0, .Lother_bootup_chores ; or cmdline is NULL | ||
47 | |||
48 | mov r5, @command_line | ||
49 | 1: | ||
50 | ldb.ab r6, [r2, 1] | ||
51 | breq r6, 0, .Lother_bootup_chores | ||
52 | b.d 1b | ||
53 | stb.ab r6, [r5, 1] | ||
54 | #endif | ||
55 | |||
56 | .Lother_bootup_chores: | ||
57 | |||
58 | ; Identify if running on ISS vs Silicon | ||
59 | ; IDENTITY Reg [ 3 2 1 0 ] | ||
60 | ; (chip-id) ^^^^^ ==> 0xffff for ISS | ||
61 | lr r0, [identity] | ||
62 | lsr r3, r0, 16 | ||
63 | cmp r3, 0xffff | ||
64 | mov.z r4, 0 | ||
65 | mov.nz r4, 1 | ||
66 | st r4, [@running_on_hw] | ||
67 | |||
68 | ; setup "current" tsk and optionally cache it in dedicated r25 | ||
69 | mov r9, @init_task | ||
70 | SET_CURR_TASK_ON_CPU r9, r0 ; r9 = tsk, r0 = scratch | ||
71 | |||
72 | ; setup stack (fp, sp) | ||
73 | mov fp, 0 | ||
74 | |||
75 | ; tsk->thread_info is really a PAGE, whose bottom hoists stack | ||
76 | GET_TSK_STACK_BASE r9, sp ; r9 = tsk, sp = stack base(output) | ||
77 | |||
78 | j start_kernel ; "C" entry point | ||