aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/head_64.S
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/kernel/head_64.S')
-rw-r--r--arch/powerpc/kernel/head_64.S111
1 files changed, 6 insertions, 105 deletions
diff --git a/arch/powerpc/kernel/head_64.S b/arch/powerpc/kernel/head_64.S
index 415659629394..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,12 +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#else
161#ifdef CONFIG_SMP
162 LOAD_REG_IMMEDIATE(r4, .pSeries_secondary_smp_init) 157 LOAD_REG_IMMEDIATE(r4, .pSeries_secondary_smp_init)
163 mtctr r4 158 mtctr r4
164 mr r3,r24 159 mr r3,r24
@@ -166,7 +161,6 @@ _GLOBAL(__secondary_hold)
166#else 161#else
167 BUG_OPCODE 162 BUG_OPCODE
168#endif 163#endif
169#endif
170 164
171/* This value is used to mark exception frames on the stack. */ 165/* This value is used to mark exception frames on the stack. */
172 .section ".toc","aw" 166 .section ".toc","aw"
@@ -321,7 +315,6 @@ exception_marker:
321label##_pSeries: \ 315label##_pSeries: \
322 HMT_MEDIUM; \ 316 HMT_MEDIUM; \
323 mtspr SPRN_SPRG1,r13; /* save r13 */ \ 317 mtspr SPRN_SPRG1,r13; /* save r13 */ \
324 RUNLATCH_ON(r13); \
325 EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, label##_common) 318 EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, label##_common)
326 319
327#define STD_EXCEPTION_ISERIES(n, label, area) \ 320#define STD_EXCEPTION_ISERIES(n, label, area) \
@@ -329,7 +322,6 @@ label##_pSeries: \
329label##_iSeries: \ 322label##_iSeries: \
330 HMT_MEDIUM; \ 323 HMT_MEDIUM; \
331 mtspr SPRN_SPRG1,r13; /* save r13 */ \ 324 mtspr SPRN_SPRG1,r13; /* save r13 */ \
332 RUNLATCH_ON(r13); \
333 EXCEPTION_PROLOG_ISERIES_1(area); \ 325 EXCEPTION_PROLOG_ISERIES_1(area); \
334 EXCEPTION_PROLOG_ISERIES_2; \ 326 EXCEPTION_PROLOG_ISERIES_2; \
335 b label##_common 327 b label##_common
@@ -339,7 +331,6 @@ label##_iSeries: \
339label##_iSeries: \ 331label##_iSeries: \
340 HMT_MEDIUM; \ 332 HMT_MEDIUM; \
341 mtspr SPRN_SPRG1,r13; /* save r13 */ \ 333 mtspr SPRN_SPRG1,r13; /* save r13 */ \
342 RUNLATCH_ON(r13); \
343 EXCEPTION_PROLOG_ISERIES_1(PACA_EXGEN); \ 334 EXCEPTION_PROLOG_ISERIES_1(PACA_EXGEN); \
344 lbz r10,PACAPROCENABLED(r13); \ 335 lbz r10,PACAPROCENABLED(r13); \
345 cmpwi 0,r10,0; \ 336 cmpwi 0,r10,0; \
@@ -392,6 +383,7 @@ label##_common: \
392label##_common: \ 383label##_common: \
393 EXCEPTION_PROLOG_COMMON(trap, PACA_EXGEN); \ 384 EXCEPTION_PROLOG_COMMON(trap, PACA_EXGEN); \
394 DISABLE_INTS; \ 385 DISABLE_INTS; \
386 bl .ppc64_runlatch_on; \
395 addi r3,r1,STACK_FRAME_OVERHEAD; \ 387 addi r3,r1,STACK_FRAME_OVERHEAD; \
396 bl hdlr; \ 388 bl hdlr; \
397 b .ret_from_except_lite 389 b .ret_from_except_lite
@@ -409,7 +401,6 @@ __start_interrupts:
409_machine_check_pSeries: 401_machine_check_pSeries:
410 HMT_MEDIUM 402 HMT_MEDIUM
411 mtspr SPRN_SPRG1,r13 /* save r13 */ 403 mtspr SPRN_SPRG1,r13 /* save r13 */
412 RUNLATCH_ON(r13)
413 EXCEPTION_PROLOG_PSERIES(PACA_EXMC, machine_check_common) 404 EXCEPTION_PROLOG_PSERIES(PACA_EXMC, machine_check_common)
414 405
415 . = 0x300 406 . = 0x300
@@ -436,7 +427,6 @@ END_FTR_SECTION_IFCLR(CPU_FTR_SLB)
436data_access_slb_pSeries: 427data_access_slb_pSeries:
437 HMT_MEDIUM 428 HMT_MEDIUM
438 mtspr SPRN_SPRG1,r13 429 mtspr SPRN_SPRG1,r13
439 RUNLATCH_ON(r13)
440 mfspr r13,SPRN_SPRG3 /* get paca address into r13 */ 430 mfspr r13,SPRN_SPRG3 /* get paca address into r13 */
441 std r3,PACA_EXSLB+EX_R3(r13) 431 std r3,PACA_EXSLB+EX_R3(r13)
442 mfspr r3,SPRN_DAR 432 mfspr r3,SPRN_DAR
@@ -462,7 +452,6 @@ data_access_slb_pSeries:
462instruction_access_slb_pSeries: 452instruction_access_slb_pSeries:
463 HMT_MEDIUM 453 HMT_MEDIUM
464 mtspr SPRN_SPRG1,r13 454 mtspr SPRN_SPRG1,r13
465 RUNLATCH_ON(r13)
466 mfspr r13,SPRN_SPRG3 /* get paca address into r13 */ 455 mfspr r13,SPRN_SPRG3 /* get paca address into r13 */
467 std r3,PACA_EXSLB+EX_R3(r13) 456 std r3,PACA_EXSLB+EX_R3(r13)
468 mfspr r3,SPRN_SRR0 /* SRR0 is faulting address */ 457 mfspr r3,SPRN_SRR0 /* SRR0 is faulting address */
@@ -493,7 +482,6 @@ instruction_access_slb_pSeries:
493 .globl system_call_pSeries 482 .globl system_call_pSeries
494system_call_pSeries: 483system_call_pSeries:
495 HMT_MEDIUM 484 HMT_MEDIUM
496 RUNLATCH_ON(r9)
497 mr r9,r13 485 mr r9,r13
498 mfmsr r10 486 mfmsr r10
499 mfspr r13,SPRN_SPRG3 487 mfspr r13,SPRN_SPRG3
@@ -577,7 +565,6 @@ slb_miss_user_pseries:
577system_reset_fwnmi: 565system_reset_fwnmi:
578 HMT_MEDIUM 566 HMT_MEDIUM
579 mtspr SPRN_SPRG1,r13 /* save r13 */ 567 mtspr SPRN_SPRG1,r13 /* save r13 */
580 RUNLATCH_ON(r13)
581 EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, system_reset_common) 568 EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, system_reset_common)
582 569
583 .globl machine_check_fwnmi 570 .globl machine_check_fwnmi
@@ -585,7 +572,6 @@ system_reset_fwnmi:
585machine_check_fwnmi: 572machine_check_fwnmi:
586 HMT_MEDIUM 573 HMT_MEDIUM
587 mtspr SPRN_SPRG1,r13 /* save r13 */ 574 mtspr SPRN_SPRG1,r13 /* save r13 */
588 RUNLATCH_ON(r13)
589 EXCEPTION_PROLOG_PSERIES(PACA_EXMC, machine_check_common) 575 EXCEPTION_PROLOG_PSERIES(PACA_EXMC, machine_check_common)
590 576
591#ifdef CONFIG_PPC_ISERIES 577#ifdef CONFIG_PPC_ISERIES
@@ -896,7 +882,6 @@ unrecov_fer:
896 .align 7 882 .align 7
897 .globl data_access_common 883 .globl data_access_common
898data_access_common: 884data_access_common:
899 RUNLATCH_ON(r10) /* It wont fit in the 0x300 handler */
900 mfspr r10,SPRN_DAR 885 mfspr r10,SPRN_DAR
901 std r10,PACA_EXGEN+EX_DAR(r13) 886 std r10,PACA_EXGEN+EX_DAR(r13)
902 mfspr r10,SPRN_DSISR 887 mfspr r10,SPRN_DSISR
@@ -1044,6 +1029,7 @@ hardware_interrupt_common:
1044 EXCEPTION_PROLOG_COMMON(0x500, PACA_EXGEN) 1029 EXCEPTION_PROLOG_COMMON(0x500, PACA_EXGEN)
1045hardware_interrupt_entry: 1030hardware_interrupt_entry:
1046 DISABLE_INTS 1031 DISABLE_INTS
1032 bl .ppc64_runlatch_on
1047 addi r3,r1,STACK_FRAME_OVERHEAD 1033 addi r3,r1,STACK_FRAME_OVERHEAD
1048 bl .do_IRQ 1034 bl .do_IRQ
1049 b .ret_from_except_lite 1035 b .ret_from_except_lite
@@ -1818,22 +1804,6 @@ _STATIC(start_here_multiplatform)
1818 ori r6,r6,MSR_RI 1804 ori r6,r6,MSR_RI
1819 mtmsrd r6 /* RI on */ 1805 mtmsrd r6 /* RI on */
1820 1806
1821#ifdef CONFIG_HMT
1822 /* Start up the second thread on cpu 0 */
1823 mfspr r3,SPRN_PVR
1824 srwi r3,r3,16
1825 cmpwi r3,0x34 /* Pulsar */
1826 beq 90f
1827 cmpwi r3,0x36 /* Icestar */
1828 beq 90f
1829 cmpwi r3,0x37 /* SStar */
1830 beq 90f
1831 b 91f /* HMT not supported */
183290: li r3,0
1833 bl .hmt_start_secondary
183491:
1835#endif
1836
1837 /* 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 */
1838 /* pointing to the real addr of the kernel stack. This is */ 1808 /* pointing to the real addr of the kernel stack. This is */
1839 /* all done to support the C function call below which sets */ 1809 /* all done to support the C function call below which sets */
@@ -1947,77 +1917,8 @@ _STATIC(start_here_common)
1947 1917
1948 bl .start_kernel 1918 bl .start_kernel
1949 1919
1950_GLOBAL(hmt_init) 1920 /* Not reached */
1951#ifdef CONFIG_HMT 1921 BUG_OPCODE
1952 LOAD_REG_IMMEDIATE(r5, hmt_thread_data)
1953 mfspr r7,SPRN_PVR
1954 srwi r7,r7,16
1955 cmpwi r7,0x34 /* Pulsar */
1956 beq 90f
1957 cmpwi r7,0x36 /* Icestar */
1958 beq 91f
1959 cmpwi r7,0x37 /* SStar */
1960 beq 91f
1961 b 101f
196290: mfspr r6,SPRN_PIR
1963 andi. r6,r6,0x1f
1964 b 92f
196591: mfspr r6,SPRN_PIR
1966 andi. r6,r6,0x3ff
196792: sldi r4,r24,3
1968 stwx r6,r5,r4
1969 bl .hmt_start_secondary
1970 b 101f
1971
1972__hmt_secondary_hold:
1973 LOAD_REG_IMMEDIATE(r5, hmt_thread_data)
1974 clrldi r5,r5,4
1975 li r7,0
1976 mfspr r6,SPRN_PIR
1977 mfspr r8,SPRN_PVR
1978 srwi r8,r8,16
1979 cmpwi r8,0x34
1980 bne 93f
1981 andi. r6,r6,0x1f
1982 b 103f
198393: andi. r6,r6,0x3f
1984
1985103: lwzx r8,r5,r7
1986 cmpw r8,r6
1987 beq 104f
1988 addi r7,r7,8
1989 b 103b
1990
1991104: addi r7,r7,4
1992 lwzx r9,r5,r7
1993 mr r24,r9
1994101:
1995#endif
1996 mr r3,r24
1997 b .pSeries_secondary_smp_init
1998
1999#ifdef CONFIG_HMT
2000_GLOBAL(hmt_start_secondary)
2001 LOAD_REG_IMMEDIATE(r4,__hmt_secondary_hold)
2002 clrldi r4,r4,4
2003 mtspr SPRN_NIADORM, r4
2004 mfspr r4, SPRN_MSRDORM
2005 li r5, -65
2006 and r4, r4, r5
2007 mtspr SPRN_MSRDORM, r4
2008 lis r4,0xffef
2009 ori r4,r4,0x7403
2010 mtspr SPRN_TSC, r4
2011 li r4,0x1f4
2012 mtspr SPRN_TST, r4
2013 mfspr r4, SPRN_HID0
2014 ori r4, r4, 0x1
2015 mtspr SPRN_HID0, r4
2016 mfspr r4, SPRN_CTRLF
2017 oris r4, r4, 0x40
2018 mtspr SPRN_CTRLT, r4
2019 blr
2020#endif
2021 1922
2022/* 1923/*
2023 * 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.