diff options
Diffstat (limited to 'arch/s390/kernel/head64.S')
| -rw-r--r-- | arch/s390/kernel/head64.S | 92 |
1 files changed, 12 insertions, 80 deletions
diff --git a/arch/s390/kernel/head64.S b/arch/s390/kernel/head64.S index d984a2a380c3..39580e768658 100644 --- a/arch/s390/kernel/head64.S +++ b/arch/s390/kernel/head64.S | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * arch/s390/kernel/head64.S | 2 | * arch/s390/kernel/head64.S |
| 3 | * | 3 | * |
| 4 | * Copyright (C) IBM Corp. 1999,2006 | 4 | * Copyright (C) IBM Corp. 1999,2010 |
| 5 | * | 5 | * |
| 6 | * Author(s): Hartmut Penner <hp@de.ibm.com> | 6 | * Author(s): Hartmut Penner <hp@de.ibm.com> |
| 7 | * Martin Schwidefsky <schwidefsky@de.ibm.com> | 7 | * Martin Schwidefsky <schwidefsky@de.ibm.com> |
| @@ -10,80 +10,17 @@ | |||
| 10 | * | 10 | * |
| 11 | */ | 11 | */ |
| 12 | 12 | ||
| 13 | .org 0x11000 | 13 | #include <linux/init.h> |
| 14 | #include <asm/asm-offsets.h> | ||
| 15 | #include <asm/thread_info.h> | ||
| 16 | #include <asm/page.h> | ||
| 14 | 17 | ||
| 18 | __HEAD | ||
| 19 | .globl startup_continue | ||
| 15 | startup_continue: | 20 | startup_continue: |
| 16 | basr %r13,0 # get base | 21 | larl %r1,sched_clock_base_cc |
| 17 | .LPG1: sll %r13,1 # remove high order bit | 22 | mvc 0(8,%r1),__LC_LAST_UPDATE_CLOCK |
| 18 | srl %r13,1 | 23 | larl %r13,.LPG1 # get base |
| 19 | |||
| 20 | #ifdef CONFIG_ZFCPDUMP | ||
| 21 | |||
| 22 | # check if we have been ipled using zfcp dump: | ||
| 23 | |||
| 24 | tm 0xb9,0x01 # test if subchannel is enabled | ||
| 25 | jno .nodump # subchannel disabled | ||
| 26 | l %r1,0xb8 | ||
| 27 | la %r5,.Lipl_schib-.LPG1(%r13) | ||
| 28 | stsch 0(%r5) # get schib of subchannel | ||
| 29 | jne .nodump # schib not available | ||
| 30 | tm 5(%r5),0x01 # devno valid? | ||
| 31 | jno .nodump | ||
| 32 | tm 4(%r5),0x80 # qdio capable device? | ||
| 33 | jno .nodump | ||
| 34 | l %r2,20(%r0) # address of ipl parameter block | ||
| 35 | lhi %r3,0 | ||
| 36 | ic %r3,0x148(%r2) # get opt field | ||
| 37 | chi %r3,0x20 # load with dump? | ||
| 38 | jne .nodump | ||
| 39 | |||
| 40 | # store all prefix registers in case of load with dump: | ||
| 41 | |||
| 42 | la %r7,0 # base register for 0 page | ||
| 43 | la %r8,0 # first cpu | ||
| 44 | l %r11,.Lpref_arr_ptr-.LPG1(%r13) # address of prefix array | ||
| 45 | ahi %r11,4 # skip boot cpu | ||
| 46 | lr %r12,%r11 | ||
| 47 | ahi %r12,(CONFIG_NR_CPUS*4) # end of prefix array | ||
| 48 | stap .Lcurrent_cpu+2-.LPG1(%r13) # store current cpu addr | ||
| 49 | 1: | ||
| 50 | cl %r8,.Lcurrent_cpu-.LPG1(%r13) # is ipl cpu ? | ||
| 51 | je 4f # if yes get next cpu | ||
| 52 | 2: | ||
| 53 | lr %r9,%r7 | ||
| 54 | sigp %r9,%r8,0x9 # stop & store status of cpu | ||
| 55 | brc 8,3f # accepted | ||
| 56 | brc 4,4f # status stored: next cpu | ||
| 57 | brc 2,2b # busy: try again | ||
| 58 | brc 1,4f # not op: next cpu | ||
| 59 | 3: | ||
| 60 | mvc 0(4,%r11),264(%r7) # copy prefix register to prefix array | ||
| 61 | ahi %r11,4 # next element in prefix array | ||
| 62 | clr %r11,%r12 | ||
| 63 | je 5f # no more space in prefix array | ||
| 64 | 4: | ||
| 65 | ahi %r8,1 # next cpu (r8 += 1) | ||
| 66 | chi %r8,MAX_CPU_ADDRESS # is last possible cpu ? | ||
| 67 | jle 1b # jump if not last cpu | ||
| 68 | 5: | ||
| 69 | lhi %r1,2 # mode 2 = esame (dump) | ||
| 70 | j 6f | ||
| 71 | .align 4 | ||
| 72 | .Lipl_schib: | ||
| 73 | .rept 13 | ||
| 74 | .long 0 | ||
| 75 | .endr | ||
| 76 | .nodump: | ||
| 77 | lhi %r1,1 # mode 1 = esame (normal ipl) | ||
| 78 | 6: | ||
| 79 | #else | ||
| 80 | lhi %r1,1 # mode 1 = esame (normal ipl) | ||
| 81 | #endif /* CONFIG_ZFCPDUMP */ | ||
| 82 | mvi __LC_AR_MODE_ID,1 # set esame flag | ||
| 83 | slr %r0,%r0 # set cpuid to zero | ||
| 84 | sigp %r1,%r0,0x12 # switch to esame mode | ||
| 85 | sam64 # switch to 64 bit mode | ||
| 86 | llgfr %r13,%r13 # clear high-order half of base reg | ||
| 87 | lmh %r0,%r15,.Lzero64-.LPG1(%r13) # clear high-order half | 24 | lmh %r0,%r15,.Lzero64-.LPG1(%r13) # clear high-order half |
| 88 | lctlg %c0,%c15,.Lctl-.LPG1(%r13) # load control registers | 25 | lctlg %c0,%c15,.Lctl-.LPG1(%r13) # load control registers |
| 89 | lg %r12,.Lparmaddr-.LPG1(%r13) # pointer to parameter area | 26 | lg %r12,.Lparmaddr-.LPG1(%r13) # pointer to parameter area |
| @@ -108,6 +45,7 @@ startup_continue: | |||
| 108 | lpswe .Lentry-.LPG1(13) # jump to _stext in primary-space, | 45 | lpswe .Lentry-.LPG1(13) # jump to _stext in primary-space, |
| 109 | # virtual and never return ... | 46 | # virtual and never return ... |
| 110 | .align 16 | 47 | .align 16 |
| 48 | .LPG1: | ||
| 111 | .Lentry:.quad 0x0000000180000000,_stext | 49 | .Lentry:.quad 0x0000000180000000,_stext |
| 112 | .Lctl: .quad 0x04350002 # cr0: various things | 50 | .Lctl: .quad 0x04350002 # cr0: various things |
| 113 | .quad 0 # cr1: primary space segment table | 51 | .quad 0 # cr1: primary space segment table |
| @@ -130,12 +68,6 @@ startup_continue: | |||
| 130 | .Lscan2g:.quad 0x80000000 + 0x20000 - 8 # 2GB + 128K - 8 | 68 | .Lscan2g:.quad 0x80000000 + 0x20000 - 8 # 2GB + 128K - 8 |
| 131 | .Lnop: .long 0x07000700 | 69 | .Lnop: .long 0x07000700 |
| 132 | .Lzero64:.fill 16,4,0x0 | 70 | .Lzero64:.fill 16,4,0x0 |
| 133 | #ifdef CONFIG_ZFCPDUMP | ||
| 134 | .Lcurrent_cpu: | ||
| 135 | .long 0x0 | ||
| 136 | .Lpref_arr_ptr: | ||
| 137 | .long zfcpdump_prefix_array | ||
| 138 | #endif /* CONFIG_ZFCPDUMP */ | ||
| 139 | .Lparmaddr: | 71 | .Lparmaddr: |
| 140 | .quad PARMAREA | 72 | .quad PARMAREA |
| 141 | .align 64 | 73 | .align 64 |
| @@ -146,9 +78,9 @@ startup_continue: | |||
| 146 | .long 0x80000000,0,0,0 # invalid access-list entries | 78 | .long 0x80000000,0,0,0 # invalid access-list entries |
| 147 | .endr | 79 | .endr |
| 148 | 80 | ||
| 149 | .org 0x12000 | ||
| 150 | .globl _ehead | 81 | .globl _ehead |
| 151 | _ehead: | 82 | _ehead: |
| 83 | |||
| 152 | #ifdef CONFIG_SHARED_KERNEL | 84 | #ifdef CONFIG_SHARED_KERNEL |
| 153 | .org 0x100000 | 85 | .org 0x100000 |
| 154 | #endif | 86 | #endif |
