diff options
Diffstat (limited to 'arch/powerpc/kernel/head_64.S')
-rw-r--r-- | arch/powerpc/kernel/head_64.S | 109 |
1 files changed, 6 insertions, 103 deletions
diff --git a/arch/powerpc/kernel/head_64.S b/arch/powerpc/kernel/head_64.S index 2b03a09fe5e9..11f2cd5af7dc 100644 --- a/arch/powerpc/kernel/head_64.S +++ b/arch/powerpc/kernel/head_64.S | |||
@@ -139,7 +139,7 @@ _GLOBAL(__secondary_hold) | |||
139 | ori r24,r24,MSR_RI | 139 | ori r24,r24,MSR_RI |
140 | mtmsrd r24 /* RI on */ | 140 | mtmsrd r24 /* RI on */ |
141 | 141 | ||
142 | /* Grab our linux cpu number */ | 142 | /* Grab our physical cpu number */ |
143 | mr r24,r3 | 143 | mr r24,r3 |
144 | 144 | ||
145 | /* Tell the master cpu we're here */ | 145 | /* Tell the master cpu we're here */ |
@@ -153,11 +153,7 @@ _GLOBAL(__secondary_hold) | |||
153 | cmpdi 0,r4,1 | 153 | cmpdi 0,r4,1 |
154 | bne 100b | 154 | bne 100b |
155 | 155 | ||
156 | #ifdef CONFIG_HMT | 156 | #if defined(CONFIG_SMP) || defined(CONFIG_KEXEC) |
157 | SET_REG_IMMEDIATE(r4, .hmt_init) | ||
158 | mtctr r4 | ||
159 | bctr | ||
160 | #elif defined(CONFIG_SMP) || defined(CONFIG_KEXEC) | ||
161 | LOAD_REG_IMMEDIATE(r4, .pSeries_secondary_smp_init) | 157 | LOAD_REG_IMMEDIATE(r4, .pSeries_secondary_smp_init) |
162 | mtctr r4 | 158 | mtctr r4 |
163 | mr r3,r24 | 159 | mr r3,r24 |
@@ -319,7 +315,6 @@ exception_marker: | |||
319 | label##_pSeries: \ | 315 | label##_pSeries: \ |
320 | HMT_MEDIUM; \ | 316 | HMT_MEDIUM; \ |
321 | mtspr SPRN_SPRG1,r13; /* save r13 */ \ | 317 | mtspr SPRN_SPRG1,r13; /* save r13 */ \ |
322 | RUNLATCH_ON(r13); \ | ||
323 | EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, label##_common) | 318 | EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, label##_common) |
324 | 319 | ||
325 | #define STD_EXCEPTION_ISERIES(n, label, area) \ | 320 | #define STD_EXCEPTION_ISERIES(n, label, area) \ |
@@ -327,7 +322,6 @@ label##_pSeries: \ | |||
327 | label##_iSeries: \ | 322 | label##_iSeries: \ |
328 | HMT_MEDIUM; \ | 323 | HMT_MEDIUM; \ |
329 | mtspr SPRN_SPRG1,r13; /* save r13 */ \ | 324 | mtspr SPRN_SPRG1,r13; /* save r13 */ \ |
330 | RUNLATCH_ON(r13); \ | ||
331 | EXCEPTION_PROLOG_ISERIES_1(area); \ | 325 | EXCEPTION_PROLOG_ISERIES_1(area); \ |
332 | EXCEPTION_PROLOG_ISERIES_2; \ | 326 | EXCEPTION_PROLOG_ISERIES_2; \ |
333 | b label##_common | 327 | b label##_common |
@@ -337,7 +331,6 @@ label##_iSeries: \ | |||
337 | label##_iSeries: \ | 331 | label##_iSeries: \ |
338 | HMT_MEDIUM; \ | 332 | HMT_MEDIUM; \ |
339 | mtspr SPRN_SPRG1,r13; /* save r13 */ \ | 333 | mtspr SPRN_SPRG1,r13; /* save r13 */ \ |
340 | RUNLATCH_ON(r13); \ | ||
341 | EXCEPTION_PROLOG_ISERIES_1(PACA_EXGEN); \ | 334 | EXCEPTION_PROLOG_ISERIES_1(PACA_EXGEN); \ |
342 | lbz r10,PACAPROCENABLED(r13); \ | 335 | lbz r10,PACAPROCENABLED(r13); \ |
343 | cmpwi 0,r10,0; \ | 336 | cmpwi 0,r10,0; \ |
@@ -390,6 +383,7 @@ label##_common: \ | |||
390 | label##_common: \ | 383 | label##_common: \ |
391 | EXCEPTION_PROLOG_COMMON(trap, PACA_EXGEN); \ | 384 | EXCEPTION_PROLOG_COMMON(trap, PACA_EXGEN); \ |
392 | DISABLE_INTS; \ | 385 | DISABLE_INTS; \ |
386 | bl .ppc64_runlatch_on; \ | ||
393 | addi r3,r1,STACK_FRAME_OVERHEAD; \ | 387 | addi r3,r1,STACK_FRAME_OVERHEAD; \ |
394 | bl hdlr; \ | 388 | bl hdlr; \ |
395 | b .ret_from_except_lite | 389 | b .ret_from_except_lite |
@@ -407,7 +401,6 @@ __start_interrupts: | |||
407 | _machine_check_pSeries: | 401 | _machine_check_pSeries: |
408 | HMT_MEDIUM | 402 | HMT_MEDIUM |
409 | mtspr SPRN_SPRG1,r13 /* save r13 */ | 403 | mtspr SPRN_SPRG1,r13 /* save r13 */ |
410 | RUNLATCH_ON(r13) | ||
411 | EXCEPTION_PROLOG_PSERIES(PACA_EXMC, machine_check_common) | 404 | EXCEPTION_PROLOG_PSERIES(PACA_EXMC, machine_check_common) |
412 | 405 | ||
413 | . = 0x300 | 406 | . = 0x300 |
@@ -434,7 +427,6 @@ END_FTR_SECTION_IFCLR(CPU_FTR_SLB) | |||
434 | data_access_slb_pSeries: | 427 | data_access_slb_pSeries: |
435 | HMT_MEDIUM | 428 | HMT_MEDIUM |
436 | mtspr SPRN_SPRG1,r13 | 429 | mtspr SPRN_SPRG1,r13 |
437 | RUNLATCH_ON(r13) | ||
438 | mfspr r13,SPRN_SPRG3 /* get paca address into r13 */ | 430 | mfspr r13,SPRN_SPRG3 /* get paca address into r13 */ |
439 | std r3,PACA_EXSLB+EX_R3(r13) | 431 | std r3,PACA_EXSLB+EX_R3(r13) |
440 | mfspr r3,SPRN_DAR | 432 | mfspr r3,SPRN_DAR |
@@ -460,7 +452,6 @@ data_access_slb_pSeries: | |||
460 | instruction_access_slb_pSeries: | 452 | instruction_access_slb_pSeries: |
461 | HMT_MEDIUM | 453 | HMT_MEDIUM |
462 | mtspr SPRN_SPRG1,r13 | 454 | mtspr SPRN_SPRG1,r13 |
463 | RUNLATCH_ON(r13) | ||
464 | mfspr r13,SPRN_SPRG3 /* get paca address into r13 */ | 455 | mfspr r13,SPRN_SPRG3 /* get paca address into r13 */ |
465 | std r3,PACA_EXSLB+EX_R3(r13) | 456 | std r3,PACA_EXSLB+EX_R3(r13) |
466 | mfspr r3,SPRN_SRR0 /* SRR0 is faulting address */ | 457 | mfspr r3,SPRN_SRR0 /* SRR0 is faulting address */ |
@@ -491,7 +482,6 @@ instruction_access_slb_pSeries: | |||
491 | .globl system_call_pSeries | 482 | .globl system_call_pSeries |
492 | system_call_pSeries: | 483 | system_call_pSeries: |
493 | HMT_MEDIUM | 484 | HMT_MEDIUM |
494 | RUNLATCH_ON(r9) | ||
495 | mr r9,r13 | 485 | mr r9,r13 |
496 | mfmsr r10 | 486 | mfmsr r10 |
497 | mfspr r13,SPRN_SPRG3 | 487 | mfspr r13,SPRN_SPRG3 |
@@ -575,7 +565,6 @@ slb_miss_user_pseries: | |||
575 | system_reset_fwnmi: | 565 | system_reset_fwnmi: |
576 | HMT_MEDIUM | 566 | HMT_MEDIUM |
577 | mtspr SPRN_SPRG1,r13 /* save r13 */ | 567 | mtspr SPRN_SPRG1,r13 /* save r13 */ |
578 | RUNLATCH_ON(r13) | ||
579 | EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, system_reset_common) | 568 | EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, system_reset_common) |
580 | 569 | ||
581 | .globl machine_check_fwnmi | 570 | .globl machine_check_fwnmi |
@@ -583,7 +572,6 @@ system_reset_fwnmi: | |||
583 | machine_check_fwnmi: | 572 | machine_check_fwnmi: |
584 | HMT_MEDIUM | 573 | HMT_MEDIUM |
585 | mtspr SPRN_SPRG1,r13 /* save r13 */ | 574 | mtspr SPRN_SPRG1,r13 /* save r13 */ |
586 | RUNLATCH_ON(r13) | ||
587 | EXCEPTION_PROLOG_PSERIES(PACA_EXMC, machine_check_common) | 575 | EXCEPTION_PROLOG_PSERIES(PACA_EXMC, machine_check_common) |
588 | 576 | ||
589 | #ifdef CONFIG_PPC_ISERIES | 577 | #ifdef CONFIG_PPC_ISERIES |
@@ -894,7 +882,6 @@ unrecov_fer: | |||
894 | .align 7 | 882 | .align 7 |
895 | .globl data_access_common | 883 | .globl data_access_common |
896 | data_access_common: | 884 | data_access_common: |
897 | RUNLATCH_ON(r10) /* It wont fit in the 0x300 handler */ | ||
898 | mfspr r10,SPRN_DAR | 885 | mfspr r10,SPRN_DAR |
899 | std r10,PACA_EXGEN+EX_DAR(r13) | 886 | std r10,PACA_EXGEN+EX_DAR(r13) |
900 | mfspr r10,SPRN_DSISR | 887 | mfspr r10,SPRN_DSISR |
@@ -1042,6 +1029,7 @@ hardware_interrupt_common: | |||
1042 | EXCEPTION_PROLOG_COMMON(0x500, PACA_EXGEN) | 1029 | EXCEPTION_PROLOG_COMMON(0x500, PACA_EXGEN) |
1043 | hardware_interrupt_entry: | 1030 | hardware_interrupt_entry: |
1044 | DISABLE_INTS | 1031 | DISABLE_INTS |
1032 | bl .ppc64_runlatch_on | ||
1045 | addi r3,r1,STACK_FRAME_OVERHEAD | 1033 | addi r3,r1,STACK_FRAME_OVERHEAD |
1046 | bl .do_IRQ | 1034 | bl .do_IRQ |
1047 | b .ret_from_except_lite | 1035 | b .ret_from_except_lite |
@@ -1816,22 +1804,6 @@ _STATIC(start_here_multiplatform) | |||
1816 | ori r6,r6,MSR_RI | 1804 | ori r6,r6,MSR_RI |
1817 | mtmsrd r6 /* RI on */ | 1805 | mtmsrd r6 /* RI on */ |
1818 | 1806 | ||
1819 | #ifdef CONFIG_HMT | ||
1820 | /* Start up the second thread on cpu 0 */ | ||
1821 | mfspr r3,SPRN_PVR | ||
1822 | srwi r3,r3,16 | ||
1823 | cmpwi r3,0x34 /* Pulsar */ | ||
1824 | beq 90f | ||
1825 | cmpwi r3,0x36 /* Icestar */ | ||
1826 | beq 90f | ||
1827 | cmpwi r3,0x37 /* SStar */ | ||
1828 | beq 90f | ||
1829 | b 91f /* HMT not supported */ | ||
1830 | 90: li r3,0 | ||
1831 | bl .hmt_start_secondary | ||
1832 | 91: | ||
1833 | #endif | ||
1834 | |||
1835 | /* The following gets the stack and TOC set up with the regs */ | 1807 | /* The following gets the stack and TOC set up with the regs */ |
1836 | /* pointing to the real addr of the kernel stack. This is */ | 1808 | /* pointing to the real addr of the kernel stack. This is */ |
1837 | /* all done to support the C function call below which sets */ | 1809 | /* all done to support the C function call below which sets */ |
@@ -1945,77 +1917,8 @@ _STATIC(start_here_common) | |||
1945 | 1917 | ||
1946 | bl .start_kernel | 1918 | bl .start_kernel |
1947 | 1919 | ||
1948 | _GLOBAL(hmt_init) | 1920 | /* Not reached */ |
1949 | #ifdef CONFIG_HMT | 1921 | BUG_OPCODE |
1950 | LOAD_REG_IMMEDIATE(r5, hmt_thread_data) | ||
1951 | mfspr r7,SPRN_PVR | ||
1952 | srwi r7,r7,16 | ||
1953 | cmpwi r7,0x34 /* Pulsar */ | ||
1954 | beq 90f | ||
1955 | cmpwi r7,0x36 /* Icestar */ | ||
1956 | beq 91f | ||
1957 | cmpwi r7,0x37 /* SStar */ | ||
1958 | beq 91f | ||
1959 | b 101f | ||
1960 | 90: mfspr r6,SPRN_PIR | ||
1961 | andi. r6,r6,0x1f | ||
1962 | b 92f | ||
1963 | 91: mfspr r6,SPRN_PIR | ||
1964 | andi. r6,r6,0x3ff | ||
1965 | 92: sldi r4,r24,3 | ||
1966 | stwx r6,r5,r4 | ||
1967 | bl .hmt_start_secondary | ||
1968 | b 101f | ||
1969 | |||
1970 | __hmt_secondary_hold: | ||
1971 | LOAD_REG_IMMEDIATE(r5, hmt_thread_data) | ||
1972 | clrldi r5,r5,4 | ||
1973 | li r7,0 | ||
1974 | mfspr r6,SPRN_PIR | ||
1975 | mfspr r8,SPRN_PVR | ||
1976 | srwi r8,r8,16 | ||
1977 | cmpwi r8,0x34 | ||
1978 | bne 93f | ||
1979 | andi. r6,r6,0x1f | ||
1980 | b 103f | ||
1981 | 93: andi. r6,r6,0x3f | ||
1982 | |||
1983 | 103: lwzx r8,r5,r7 | ||
1984 | cmpw r8,r6 | ||
1985 | beq 104f | ||
1986 | addi r7,r7,8 | ||
1987 | b 103b | ||
1988 | |||
1989 | 104: addi r7,r7,4 | ||
1990 | lwzx r9,r5,r7 | ||
1991 | mr r24,r9 | ||
1992 | 101: | ||
1993 | #endif | ||
1994 | mr r3,r24 | ||
1995 | b .pSeries_secondary_smp_init | ||
1996 | |||
1997 | #ifdef CONFIG_HMT | ||
1998 | _GLOBAL(hmt_start_secondary) | ||
1999 | LOAD_REG_IMMEDIATE(r4,__hmt_secondary_hold) | ||
2000 | clrldi r4,r4,4 | ||
2001 | mtspr SPRN_NIADORM, r4 | ||
2002 | mfspr r4, SPRN_MSRDORM | ||
2003 | li r5, -65 | ||
2004 | and r4, r4, r5 | ||
2005 | mtspr SPRN_MSRDORM, r4 | ||
2006 | lis r4,0xffef | ||
2007 | ori r4,r4,0x7403 | ||
2008 | mtspr SPRN_TSC, r4 | ||
2009 | li r4,0x1f4 | ||
2010 | mtspr SPRN_TST, r4 | ||
2011 | mfspr r4, SPRN_HID0 | ||
2012 | ori r4, r4, 0x1 | ||
2013 | mtspr SPRN_HID0, r4 | ||
2014 | mfspr r4, SPRN_CTRLF | ||
2015 | oris r4, r4, 0x40 | ||
2016 | mtspr SPRN_CTRLT, r4 | ||
2017 | blr | ||
2018 | #endif | ||
2019 | 1922 | ||
2020 | /* | 1923 | /* |
2021 | * We put a few things here that have to be page-aligned. | 1924 | * We put a few things here that have to be page-aligned. |