Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux...
[firefly-linux-kernel-4.4.55.git] / arch / metag / kernel / head.S
1         ! Copyright 2005,2006,2007,2009 Imagination Technologies
2
3 #include <linux/init.h>
4 #include <generated/asm-offsets.h>
5 #undef __exit
6
7         __HEAD
8         ! Setup the stack and get going into _metag_start_kernel
9         .global __start
10         .type   __start,function
11 __start:
12         ! D1Ar1 contains pTBI (ISTAT)
13         ! D0Ar2 contains pTBI
14         ! D1Ar3 contains __pTBISegs
15         ! D0Ar4 contains kernel arglist pointer
16
17         MOVT    D0Re0,#HI(___pTBIs)
18         ADD     D0Re0,D0Re0,#LO(___pTBIs)
19         SETL    [D0Re0],D0Ar2,D1Ar1
20         MOVT    D0Re0,#HI(___pTBISegs)
21         ADD     D0Re0,D0Re0,#LO(___pTBISegs)
22         SETD    [D0Re0],D1Ar3
23         MOV     A0FrP,#0
24         MOV     D0Re0,#0
25         MOV     D1Re0,#0
26         MOV     D1Ar3,#0
27         MOV     D1Ar1,D0Ar4                     !Store kernel boot params
28         MOV     D1Ar5,#0
29         MOV     D0Ar6,#0
30 #ifdef CONFIG_METAG_DSP
31         MOV     D0.8,#0
32 #endif
33         MOVT    A0StP,#HI(_init_thread_union)
34         ADD     A0StP,A0StP,#LO(_init_thread_union)
35         ADD     A0StP,A0StP,#THREAD_INFO_SIZE
36         MOVT    D1RtP,#HI(_metag_start_kernel)
37         CALL    D1RtP,#LO(_metag_start_kernel)
38         .size   __start,.-__start
39
40         !! Needed by TBX
41         .global __exit
42         .type   __exit,function
43 __exit:
44         XOR     TXENABLE,D0Re0,D0Re0
45         .size   __exit,.-__exit
46
47 #ifdef CONFIG_SMP
48         .global _secondary_startup
49         .type _secondary_startup,function
50 _secondary_startup:
51         MOVT    A0StP,#HI(_secondary_data_stack)
52         ADD     A0StP,A0StP,#LO(_secondary_data_stack)
53         GETD    A0StP,[A0StP]
54         ADD     A0StP,A0StP,#THREAD_INFO_SIZE
55         B       _secondary_start_kernel
56         .size   _secondary_startup,.-_secondary_startup
57 #endif