blob: 041807ecc71a3f07654df2a08d93d0596ed71e44 [file] [log] [blame]
Sven Schnelle332a7e92012-02-09 21:05:20 +01001 /* Save BIST result */
2
3 movl %eax, %ebp
4
Sven Schnelle1a7a7e62012-06-17 14:23:35 +02005 /* check if SPAD0 is cleared. If yes, it means this was a hard reset */
6 movl $0x800080d0, %eax
7 movw $0xcf8, %dx
8 outl %eax, %dx
9
10 addw $4, %dx
11 inl %dx, %eax
12 cmp $0, %eax
13 je no_reset
14
15 /* perform hard reset */
16 movw $0xcf9, %dx
Sven Schnelle14546852012-06-20 16:59:15 +020017 movb $0x06, %al
18 outb %al, %dx
Sven Schnelle1a7a7e62012-06-17 14:23:35 +020019
20loop0: hlt
Sven Schnelle39b47d22012-06-20 15:36:53 +020021 jmp loop0
Sven Schnelle1a7a7e62012-06-17 14:23:35 +020022
23no_reset:
24
Sven Schnelle332a7e92012-02-09 21:05:20 +010025 /* Read the semaphore register of i5000 (BOFL0).
26 If it returns zero, it means there was already
27 another read by another CPU */
28
29 movl $0x800080c0, %eax
30 movw $0xcf8, %dx
31 outl %eax, %dx
32
33 addw $4, %dx
34 inl %dx, %eax
35 cmp $0, %eax
36 jne 1f
37
38 /* degrade BSP to AP */
39 mov $0x1b, %ecx
40 rdmsr
41 andl $(~0x100), %eax
42 wrmsr
43
44 cli
45loop: hlt
46 jmp loop
47
Sven Schnelle1a7a7e62012-06-17 14:23:35 +0200481: /* set magic value for soft reset detection */
49 movl $0x800080d0, %eax
50 movw $0xcf8, %dx
51 outl %eax, %dx
52
53 addw $4, %dx
54 movl $0x12345678, %eax
55 outl %eax, %dx
56
57 /* Restore BIST */
Sven Schnelle332a7e92012-02-09 21:05:20 +010058 mov %ebp, %eax