blob: 78eb7cfbd3d1d838ffa5a3929892aaa061f682b5 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
Heiko Carstensc70d0fe2009-03-26 15:24:57 +01002 * Copyright IBM Corp 2000,2009
3 * Author(s): Holger Smolinski <Holger.Smolinski@de.ibm.com>,
4 * Denis Joseph Barrow,
Linus Torvalds1da177e2005-04-16 15:20:36 -07005 */
6
Jan Glauber144d6342011-07-24 10:48:19 +02007#include <linux/linkage.h>
Heiko Carstenscbb870c2010-02-26 22:37:43 +01008#include <asm/asm-offsets.h>
Heiko Carstensc5dd8582007-03-05 23:35:43 +01009
10#
11# do_reipl_asm
12# Parameter: r2 = schid of reipl device
13#
14
Jan Glauber144d6342011-07-24 10:48:19 +020015ENTRY(do_reipl_asm)
16 basr %r13,0
Heiko Carstens15e9b582006-12-04 15:40:26 +010017.Lpg0: lpswe .Lnewpsw-.Lpg0(%r13)
18.Lpg1: # do store status of all registers
Michael Holzheuff6b8ea2006-09-20 15:58:49 +020019
Heiko Carstens15e9b582006-12-04 15:40:26 +010020 stg %r1,.Lregsave-.Lpg0(%r13)
Michael Holzheuff6b8ea2006-09-20 15:58:49 +020021 lghi %r1,0x1000
22 stmg %r0,%r15,__LC_GPREGS_SAVE_AREA-0x1000(%r1)
23 lg %r0,.Lregsave-.Lpg0(%r13)
24 stg %r0,__LC_GPREGS_SAVE_AREA-0x1000+8(%r1)
25 stctg %c0,%c15,__LC_CREGS_SAVE_AREA-0x1000(%r1)
26 stam %a0,%a15,__LC_AREGS_SAVE_AREA-0x1000(%r1)
Heiko Carstensc5dd8582007-03-05 23:35:43 +010027 lg %r10,.Ldump_pfx-.Lpg0(%r13)
28 mvc __LC_PREFIX_SAVE_AREA-0x1000(4,%r1),0(%r10)
Michael Holzheuff6b8ea2006-09-20 15:58:49 +020029 stfpc __LC_FP_CREG_SAVE_AREA-0x1000(%r1)
30 stckc .Lclkcmp-.Lpg0(%r13)
Heiko Carstensc70d0fe2009-03-26 15:24:57 +010031 mvc __LC_CLOCK_COMP_SAVE_AREA-0x1000(7,%r1),.Lclkcmp-.Lpg0(%r13)
Michael Holzheuff6b8ea2006-09-20 15:58:49 +020032 stpt __LC_CPU_TIMER_SAVE_AREA-0x1000(%r1)
33 stg %r13, __LC_PSW_SAVE_AREA-0x1000+8(%r1)
34
Heiko Carstens15e9b582006-12-04 15:40:26 +010035 lctlg %c6,%c6,.Lall-.Lpg0(%r13)
Heiko Carstens25d83cb2006-09-28 16:56:37 +020036 lgr %r1,%r2
37 mvc __LC_PGM_NEW_PSW(16),.Lpcnew-.Lpg0(%r13)
38 stsch .Lschib-.Lpg0(%r13)
39 oi .Lschib+5-.Lpg0(%r13),0x84
40.Lecs: xi .Lschib+27-.Lpg0(%r13),0x01
41 msch .Lschib-.Lpg0(%r13)
42 lghi %r0,5
43.Lssch: ssch .Liplorb-.Lpg0(%r13)
Linus Torvalds1da177e2005-04-16 15:20:36 -070044 jz .L001
Heiko Carstens25d83cb2006-09-28 16:56:37 +020045 brct %r0,.Lssch
Linus Torvalds1da177e2005-04-16 15:20:36 -070046 bas %r14,.Ldisab-.Lpg0(%r13)
Heiko Carstens25d83cb2006-09-28 16:56:37 +020047.L001: mvc __LC_IO_NEW_PSW(16),.Lionew-.Lpg0(%r13)
48.Ltpi: lpswe .Lwaitpsw-.Lpg0(%r13)
Linus Torvalds1da177e2005-04-16 15:20:36 -070049.Lcont: c %r1,__LC_SUBCHANNEL_ID
50 jnz .Ltpi
51 clc __LC_IO_INT_PARM(4),.Liplorb-.Lpg0(%r13)
52 jnz .Ltpi
Heiko Carstens25d83cb2006-09-28 16:56:37 +020053 tsch .Liplirb-.Lpg0(%r13)
Linus Torvalds1da177e2005-04-16 15:20:36 -070054 tm .Liplirb+9-.Lpg0(%r13),0xbf
Heiko Carstens25d83cb2006-09-28 16:56:37 +020055 jz .L002
56 bas %r14,.Ldisab-.Lpg0(%r13)
57.L002: tm .Liplirb+8-.Lpg0(%r13),0xf3
58 jz .L003
59 bas %r14,.Ldisab-.Lpg0(%r13)
Heiko Carstens15e9b582006-12-04 15:40:26 +010060.L003: st %r1,__LC_SUBCHANNEL_ID
Heiko Carstens25d83cb2006-09-28 16:56:37 +020061 lhi %r1,0 # mode 0 = esa
62 slr %r0,%r0 # set cpuid to zero
63 sigp %r1,%r0,0x12 # switch to esa mode
64 lpsw 0
65.Ldisab: sll %r14,1
66 srl %r14,1 # need to kill hi bit to avoid specification exceptions.
67 st %r14,.Ldispsw+12-.Lpg0(%r13)
Linus Torvalds1da177e2005-04-16 15:20:36 -070068 lpswe .Ldispsw-.Lpg0(%r13)
Heiko Carstens25d83cb2006-09-28 16:56:37 +020069 .align 8
Michael Holzheuff6b8ea2006-09-20 15:58:49 +020070.Lclkcmp: .quad 0x0000000000000000
Linus Torvalds1da177e2005-04-16 15:20:36 -070071.Lall: .quad 0x00000000ff000000
Heiko Carstensc5dd8582007-03-05 23:35:43 +010072.Ldump_pfx: .quad dump_prefix_page
Michael Holzheuff6b8ea2006-09-20 15:58:49 +020073.Lregsave: .quad 0x0000000000000000
Heiko Carstens25d83cb2006-09-28 16:56:37 +020074 .align 16
Linus Torvalds1da177e2005-04-16 15:20:36 -070075/*
76 * These addresses have to be 31 bit otherwise
77 * the sigp will throw a specifcation exception
78 * when switching to ESA mode as bit 31 be set
79 * in the ESA psw.
80 * Bit 31 of the addresses has to be 0 for the
81 * 31bit lpswe instruction a fact they appear to have
Lucas De Marchi25985ed2011-03-30 22:57:33 -030082 * omitted from the pop.
Linus Torvalds1da177e2005-04-16 15:20:36 -070083 */
Heiko Carstens25d83cb2006-09-28 16:56:37 +020084.Lnewpsw: .quad 0x0000000080000000
85 .quad .Lpg1
86.Lpcnew: .quad 0x0000000080000000
87 .quad .Lecs
88.Lionew: .quad 0x0000000080000000
89 .quad .Lcont
Linus Torvalds1da177e2005-04-16 15:20:36 -070090.Lwaitpsw: .quad 0x0202000080000000
Heiko Carstens25d83cb2006-09-28 16:56:37 +020091 .quad .Ltpi
92.Ldispsw: .quad 0x0002000080000000
93 .quad 0x0000000000000000
94.Liplccws: .long 0x02000000,0x60000018
95 .long 0x08000008,0x20000001
Linus Torvalds1da177e2005-04-16 15:20:36 -070096.Liplorb: .long 0x0049504c,0x0040ff80
97 .long 0x00000000+.Liplccws
Heiko Carstens25d83cb2006-09-28 16:56:37 +020098.Lschib: .long 0x00000000,0x00000000
99 .long 0x00000000,0x00000000
100 .long 0x00000000,0x00000000
101 .long 0x00000000,0x00000000
102 .long 0x00000000,0x00000000
103 .long 0x00000000,0x00000000
Linus Torvalds1da177e2005-04-16 15:20:36 -0700104.Liplirb: .long 0x00000000,0x00000000
105 .long 0x00000000,0x00000000
106 .long 0x00000000,0x00000000
107 .long 0x00000000,0x00000000
108 .long 0x00000000,0x00000000
109 .long 0x00000000,0x00000000
110 .long 0x00000000,0x00000000
111 .long 0x00000000,0x00000000