reipl64.S 3.16 KB
Newer Older
Linus Torvalds's avatar
Linus Torvalds committed
1
/*
2
3
4
 *    Copyright IBM Corp 2000,2009
 *    Author(s): Holger Smolinski <Holger.Smolinski@de.ibm.com>,
 *		 Denis Joseph Barrow,
Linus Torvalds's avatar
Linus Torvalds committed
5
6
 */

7
#include <asm/asm-offsets.h>
8
9
10
11
12
13

#
# do_reipl_asm
# Parameter: r2 = schid of reipl device
#

Michael Holzheu's avatar
Michael Holzheu committed
14
15
		.globl	do_reipl_asm
do_reipl_asm:	basr	%r13,0
16
17
.Lpg0:		lpswe	.Lnewpsw-.Lpg0(%r13)
.Lpg1:		# do store status of all registers
Michael Holzheu's avatar
Michael Holzheu committed
18

19
		stg	%r1,.Lregsave-.Lpg0(%r13)
Michael Holzheu's avatar
Michael Holzheu committed
20
21
22
23
24
25
		lghi	%r1,0x1000
		stmg	%r0,%r15,__LC_GPREGS_SAVE_AREA-0x1000(%r1)
		lg	%r0,.Lregsave-.Lpg0(%r13)
		stg	%r0,__LC_GPREGS_SAVE_AREA-0x1000+8(%r1)
		stctg	%c0,%c15,__LC_CREGS_SAVE_AREA-0x1000(%r1)
		stam	%a0,%a15,__LC_AREGS_SAVE_AREA-0x1000(%r1)
26
27
		lg	%r10,.Ldump_pfx-.Lpg0(%r13)
		mvc	__LC_PREFIX_SAVE_AREA-0x1000(4,%r1),0(%r10)
Michael Holzheu's avatar
Michael Holzheu committed
28
29
		stfpc	__LC_FP_CREG_SAVE_AREA-0x1000(%r1)
		stckc	.Lclkcmp-.Lpg0(%r13)
30
		mvc	__LC_CLOCK_COMP_SAVE_AREA-0x1000(7,%r1),.Lclkcmp-.Lpg0(%r13)
Michael Holzheu's avatar
Michael Holzheu committed
31
32
33
		stpt	__LC_CPU_TIMER_SAVE_AREA-0x1000(%r1)
		stg	%r13, __LC_PSW_SAVE_AREA-0x1000+8(%r1)

34
		lctlg	%c6,%c6,.Lall-.Lpg0(%r13)
Heiko Carstens's avatar
Heiko Carstens committed
35
36
37
38
39
40
41
42
		lgr	%r1,%r2
		mvc	__LC_PGM_NEW_PSW(16),.Lpcnew-.Lpg0(%r13)
		stsch	.Lschib-.Lpg0(%r13)
		oi	.Lschib+5-.Lpg0(%r13),0x84
.Lecs:  	xi	.Lschib+27-.Lpg0(%r13),0x01
		msch	.Lschib-.Lpg0(%r13)
		lghi	%r0,5
.Lssch:		ssch	.Liplorb-.Lpg0(%r13)
Linus Torvalds's avatar
Linus Torvalds committed
43
		jz	.L001
Heiko Carstens's avatar
Heiko Carstens committed
44
		brct	%r0,.Lssch
Linus Torvalds's avatar
Linus Torvalds committed
45
		bas	%r14,.Ldisab-.Lpg0(%r13)
Heiko Carstens's avatar
Heiko Carstens committed
46
47
.L001:		mvc	__LC_IO_NEW_PSW(16),.Lionew-.Lpg0(%r13)
.Ltpi:		lpswe	.Lwaitpsw-.Lpg0(%r13)
Linus Torvalds's avatar
Linus Torvalds committed
48
49
50
51
.Lcont:		c	%r1,__LC_SUBCHANNEL_ID
		jnz	.Ltpi
		clc	__LC_IO_INT_PARM(4),.Liplorb-.Lpg0(%r13)
		jnz	.Ltpi
Heiko Carstens's avatar
Heiko Carstens committed
52
		tsch	.Liplirb-.Lpg0(%r13)
Linus Torvalds's avatar
Linus Torvalds committed
53
		tm	.Liplirb+9-.Lpg0(%r13),0xbf
Heiko Carstens's avatar
Heiko Carstens committed
54
55
56
57
58
		jz	.L002
		bas	%r14,.Ldisab-.Lpg0(%r13)
.L002:		tm	.Liplirb+8-.Lpg0(%r13),0xf3
		jz	.L003
		bas	%r14,.Ldisab-.Lpg0(%r13)
59
.L003:		st	%r1,__LC_SUBCHANNEL_ID
Heiko Carstens's avatar
Heiko Carstens committed
60
61
62
63
64
65
66
		lhi	%r1,0		 # mode 0 = esa
		slr	%r0,%r0 	 # set cpuid to zero
		sigp	%r1,%r0,0x12	 # switch to esa mode
		lpsw	0
.Ldisab:	sll	%r14,1
		srl	%r14,1		 # need to kill hi bit to avoid specification exceptions.
		st	%r14,.Ldispsw+12-.Lpg0(%r13)
Linus Torvalds's avatar
Linus Torvalds committed
67
		lpswe	.Ldispsw-.Lpg0(%r13)
Heiko Carstens's avatar
Heiko Carstens committed
68
		.align	8
Michael Holzheu's avatar
Michael Holzheu committed
69
.Lclkcmp:	.quad	0x0000000000000000
Linus Torvalds's avatar
Linus Torvalds committed
70
.Lall:		.quad	0x00000000ff000000
71
.Ldump_pfx:	.quad	dump_prefix_page
Michael Holzheu's avatar
Michael Holzheu committed
72
.Lregsave:	.quad	0x0000000000000000
Heiko Carstens's avatar
Heiko Carstens committed
73
		.align	16
Linus Torvalds's avatar
Linus Torvalds committed
74
75
76
77
78
79
80
81
82
/*
 * These addresses have to be 31 bit otherwise
 * the sigp will throw a specifcation exception
 * when switching to ESA mode as bit 31 be set
 * in the ESA psw.
 * Bit 31 of the addresses has to be 0 for the
 * 31bit lpswe instruction a fact they appear to have
 * ommited from the pop.
 */
Heiko Carstens's avatar
Heiko Carstens committed
83
84
85
86
87
88
.Lnewpsw:	.quad	0x0000000080000000
		.quad	.Lpg1
.Lpcnew:	.quad	0x0000000080000000
		.quad	.Lecs
.Lionew:	.quad	0x0000000080000000
		.quad	.Lcont
Linus Torvalds's avatar
Linus Torvalds committed
89
.Lwaitpsw:	.quad	0x0202000080000000
Heiko Carstens's avatar
Heiko Carstens committed
90
91
92
93
94
		.quad	.Ltpi
.Ldispsw:	.quad	0x0002000080000000
		.quad	0x0000000000000000
.Liplccws:	.long	0x02000000,0x60000018
		.long	0x08000008,0x20000001
Linus Torvalds's avatar
Linus Torvalds committed
95
96
.Liplorb:	.long	0x0049504c,0x0040ff80
		.long	0x00000000+.Liplccws
Heiko Carstens's avatar
Heiko Carstens committed
97
98
99
100
101
102
.Lschib:	.long	0x00000000,0x00000000
		.long	0x00000000,0x00000000
		.long	0x00000000,0x00000000
		.long	0x00000000,0x00000000
		.long	0x00000000,0x00000000
		.long	0x00000000,0x00000000
Linus Torvalds's avatar
Linus Torvalds committed
103
104
105
106
107
108
109
110
.Liplirb:	.long	0x00000000,0x00000000
		.long	0x00000000,0x00000000
		.long	0x00000000,0x00000000
		.long	0x00000000,0x00000000
		.long	0x00000000,0x00000000
		.long	0x00000000,0x00000000
		.long	0x00000000,0x00000000
		.long	0x00000000,0x00000000