diff options
author | Aurelien Jacquiot <a-jacquiot@ti.com> | 2011-10-04 11:00:02 -0400 |
---|---|---|
committer | Mark Salter <msalter@redhat.com> | 2011-10-06 19:47:28 -0400 |
commit | c1a144d77a6ca3a14ba3c0fec30bc4fd20b3d817 (patch) | |
tree | e5a761211a22a90ca2eb1c933d2b3539c6888831 /arch/c6x/kernel/head.S | |
parent | c278400c52c14203894c5dc0d63cf385239d8329 (diff) |
C6X: early boot code
Original port to early 2.6 kernel using TI COFF toolchain.
Brought up to date by Mark Salter <msalter@redhat.com>
This patch provides the early boot code for C6X architecture. There is a
16 entry vector table which is used to direct reset and interrupt events. The
vector table entries contain a small amount of code (maximum of 8 opcodes)
which simply branches to the actual event handling code.
The head.S code simply clears BSS, setups up a few control registers, and calls
machine_init followed by start_kernel. The machine_init code in setup.c does
the early flat tree parsing (memory, commandline, etc). At setup_arch time, the
code does the usual memory setup and minimally scans the devicetree for any
needed information.
Signed-off-by: Aurelien Jacquiot <a-jacquiot@ti.com>
Signed-off-by: Mark Salter <msalter@redhat.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'arch/c6x/kernel/head.S')
-rw-r--r-- | arch/c6x/kernel/head.S | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/arch/c6x/kernel/head.S b/arch/c6x/kernel/head.S new file mode 100644 index 000000000000..133eab6edf6b --- /dev/null +++ b/arch/c6x/kernel/head.S | |||
@@ -0,0 +1,84 @@ | |||
1 | ; | ||
2 | ; Port on Texas Instruments TMS320C6x architecture | ||
3 | ; | ||
4 | ; Copyright (C) 2004, 2009, 2010, 2011 Texas Instruments Incorporated | ||
5 | ; Author: Aurelien Jacquiot (aurelien.jacquiot@jaluna.com) | ||
6 | ; | ||
7 | ; This program is free software; you can redistribute it and/or modify | ||
8 | ; it under the terms of the GNU General Public License version 2 as | ||
9 | ; published by the Free Software Foundation. | ||
10 | ; | ||
11 | #include <linux/linkage.h> | ||
12 | #include <linux/of_fdt.h> | ||
13 | #include <asm/asm-offsets.h> | ||
14 | |||
15 | __HEAD | ||
16 | ENTRY(_c_int00) | ||
17 | ;; Save magic and pointer | ||
18 | MV .S1 A4,A10 | ||
19 | MV .S2 B4,B10 | ||
20 | MVKL .S2 __bss_start,B5 | ||
21 | MVKH .S2 __bss_start,B5 | ||
22 | MVKL .S2 __bss_stop,B6 | ||
23 | MVKH .S2 __bss_stop,B6 | ||
24 | SUB .L2 B6,B5,B6 ; bss size | ||
25 | |||
26 | ;; Set the stack pointer | ||
27 | MVKL .S2 current_ksp,B0 | ||
28 | MVKH .S2 current_ksp,B0 | ||
29 | LDW .D2T2 *B0,B15 | ||
30 | |||
31 | ;; clear bss | ||
32 | SHR .S2 B6,3,B0 ; number of dwords to clear | ||
33 | ZERO .L2 B13 | ||
34 | ZERO .L2 B12 | ||
35 | bss_loop: | ||
36 | BDEC .S2 bss_loop,B0 | ||
37 | NOP 3 | ||
38 | CMPLT .L2 B0,0,B1 | ||
39 | [!B1] STDW .D2T2 B13:B12,*B5++[1] | ||
40 | |||
41 | NOP 4 | ||
42 | AND .D2 ~7,B15,B15 | ||
43 | |||
44 | ;; Clear GIE and PGIE | ||
45 | MVC .S2 CSR,B2 | ||
46 | CLR .S2 B2,0,1,B2 | ||
47 | MVC .S2 B2,CSR | ||
48 | MVC .S2 TSR,B2 | ||
49 | CLR .S2 B2,0,1,B2 | ||
50 | MVC .S2 B2,TSR | ||
51 | MVC .S2 ITSR,B2 | ||
52 | CLR .S2 B2,0,1,B2 | ||
53 | MVC .S2 B2,ITSR | ||
54 | MVC .S2 NTSR,B2 | ||
55 | CLR .S2 B2,0,1,B2 | ||
56 | MVC .S2 B2,NTSR | ||
57 | |||
58 | ;; pass DTB pointer to machine_init (or zero if none) | ||
59 | MVKL .S1 OF_DT_HEADER,A0 | ||
60 | MVKH .S1 OF_DT_HEADER,A0 | ||
61 | CMPEQ .L1 A10,A0,A0 | ||
62 | [A0] MV .S1X B10,A4 | ||
63 | [!A0] MVK .S1 0,A4 | ||
64 | |||
65 | #ifdef CONFIG_C6X_BIG_KERNEL | ||
66 | MVKL .S1 machine_init,A0 | ||
67 | MVKH .S1 machine_init,A0 | ||
68 | B .S2X A0 | ||
69 | ADDKPC .S2 0f,B3,4 | ||
70 | 0: | ||
71 | #else | ||
72 | CALLP .S2 machine_init,B3 | ||
73 | #endif | ||
74 | |||
75 | ;; Jump to Linux init | ||
76 | #ifdef CONFIG_C6X_BIG_KERNEL | ||
77 | MVKL .S1 start_kernel,A0 | ||
78 | MVKH .S1 start_kernel,A0 | ||
79 | B .S2X A0 | ||
80 | #else | ||
81 | B .S2 start_kernel | ||
82 | #endif | ||
83 | NOP 5 | ||
84 | L1: BNOP .S2 L1,5 | ||