[S390] Add processor type march=z10 and a processor type safety check.
[linux-2.6.git] / arch / s390 / kernel / head31.S
1 /*
2  * arch/s390/kernel/head31.S
3  *
4  * Copyright (C) IBM Corp. 2005,2006
5  *
6  *   Author(s): Hartmut Penner <hp@de.ibm.com>
7  *              Martin Schwidefsky <schwidefsky@de.ibm.com>
8  *              Rob van der Heij <rvdhei@iae.nl>
9  *              Heiko Carstens <heiko.carstens@de.ibm.com>
10  *
11  */
12
13         .org    0x11000
14
15 startup_continue:
16         basr    %r13,0                  # get base
17 .LPG1:
18
19         mvi     __LC_AR_MODE_ID,0       # set ESA flag (mode 0)
20         lctl    %c0,%c15,.Lctl-.LPG1(%r13) # load control registers
21         l       %r12,.Lparmaddr-.LPG1(%r13) # pointer to parameter area
22                                         # move IPL device to lowcore
23         mvc     __LC_IPLDEV(4),IPL_DEVICE-PARMAREA(%r12)
24 #
25 # Setup stack
26 #
27         l       %r15,.Linittu-.LPG1(%r13)
28         mvc     __LC_CURRENT(4),__TI_task(%r15)
29         ahi     %r15,1<<(PAGE_SHIFT+THREAD_ORDER) # init_task_union+THREAD_SIZE
30         st      %r15,__LC_KERNEL_STACK  # set end of kernel stack
31         ahi     %r15,-96
32         xc      __SF_BACKCHAIN(4,%r15),__SF_BACKCHAIN(%r15) # clear backchain
33 #
34 # Save ipl parameters, clear bss memory, initialize storage key for kernel pages,
35 # and create a kernel NSS if the SAVESYS= parm is defined
36 #
37         l       %r14,.Lstartup_init-.LPG1(%r13)
38         basr    %r14,%r14
39         lpsw  .Lentry-.LPG1(13)         # jump to _stext in primary-space,
40                                         # virtual and never return ...
41         .align  8
42 .Lentry:.long   0x00080000,0x80000000 + _stext
43 .Lctl:  .long   0x04b50002              # cr0: various things
44         .long   0                       # cr1: primary space segment table
45         .long   .Lduct                  # cr2: dispatchable unit control table
46         .long   0                       # cr3: instruction authorization
47         .long   0                       # cr4: instruction authorization
48         .long   .Lduct                  # cr5: primary-aste origin
49         .long   0                       # cr6:  I/O interrupts
50         .long   0                       # cr7:  secondary space segment table
51         .long   0                       # cr8:  access registers translation
52         .long   0                       # cr9:  tracing off
53         .long   0                       # cr10: tracing off
54         .long   0                       # cr11: tracing off
55         .long   0                       # cr12: tracing off
56         .long   0                       # cr13: home space segment table
57         .long   0xc0000000              # cr14: machine check handling off
58         .long   0                       # cr15: linkage stack operations
59 .Lmchunk:.long  memory_chunk
60 .Lbss_bgn:  .long __bss_start
61 .Lbss_end:  .long _end
62 .Lparmaddr: .long PARMAREA
63 .Linittu:   .long init_thread_union
64 .Lstartup_init:
65             .long startup_init
66         .align  64
67 .Lduct: .long   0,0,0,0,.Lduald,0,0,0
68         .long   0,0,0,0,0,0,0,0
69         .align  128
70 .Lduald:.rept   8
71         .long   0x80000000,0,0,0        # invalid access-list entries
72         .endr
73
74         .org    0x12000
75         .globl  _ehead
76 _ehead:
77 #ifdef CONFIG_SHARED_KERNEL
78         .org    0x100000
79 #endif
80
81 #
82 # startup-code, running in absolute addressing mode
83 #
84         .globl  _stext
85 _stext: basr    %r13,0                  # get base
86 .LPG3:
87 # check control registers
88         stctl   %c0,%c15,0(%r15)
89         oi      2(%r15),0x40            # enable sigp emergency signal
90         oi      0(%r15),0x10            # switch on low address protection
91         lctl    %c0,%c15,0(%r15)
92
93 #
94         lam     0,15,.Laregs-.LPG3(%r13) # load access regs needed by uaccess
95         l       %r14,.Lstart-.LPG3(%r13)
96         basr    %r14,%r14               # call start_kernel
97 #
98 # We returned from start_kernel ?!? PANIK
99 #
100         basr    %r13,0
101         lpsw    .Ldw-.(%r13)            # load disabled wait psw
102 #
103         .align  8
104 .Ldw:   .long   0x000a0000,0x00000000
105 .Lstart:.long   start_kernel
106 .Laregs:.long   0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0