aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/head_64.S
diff options
context:
space:
mode:
authorStephen Rothwell <sfr@canb.auug.org.au>2007-08-21 23:44:58 -0400
committerPaul Mackerras <paulus@samba.org>2007-08-22 02:48:34 -0400
commitfc68e8699f1f987060ef817cff6a13a7cd7d4c8a (patch)
tree1b5735b9669b177815eb8b2aa469b25318254265 /arch/powerpc/kernel/head_64.S
parentdc559f7cd5d6d11a99b6c29402b31fbb3f3a1db0 (diff)
[POWERPC] Move iSeries startup code out of head_64.S
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'arch/powerpc/kernel/head_64.S')
-rw-r--r--arch/powerpc/kernel/head_64.S86
1 files changed, 2 insertions, 84 deletions
diff --git a/arch/powerpc/kernel/head_64.S b/arch/powerpc/kernel/head_64.S
index 1e6d9cc06ca0..97f089b30316 100644
--- a/arch/powerpc/kernel/head_64.S
+++ b/arch/powerpc/kernel/head_64.S
@@ -802,56 +802,6 @@ system_call_iSeries:
802 STD_EXCEPTION_ISERIES( 0xe00, trap_0e, PACA_EXGEN) 802 STD_EXCEPTION_ISERIES( 0xe00, trap_0e, PACA_EXGEN)
803 STD_EXCEPTION_ISERIES( 0xf00, performance_monitor, PACA_EXGEN) 803 STD_EXCEPTION_ISERIES( 0xf00, performance_monitor, PACA_EXGEN)
804 804
805 .globl system_reset_iSeries
806system_reset_iSeries:
807 mfspr r13,SPRN_SPRG3 /* Get paca address */
808 mfmsr r24
809 ori r24,r24,MSR_RI
810 mtmsrd r24 /* RI on */
811 lhz r24,PACAPACAINDEX(r13) /* Get processor # */
812 cmpwi 0,r24,0 /* Are we processor 0? */
813 bne 1f
814 b .__start_initialization_iSeries /* Start up the first processor */
8151: mfspr r4,SPRN_CTRLF
816 li r5,CTRL_RUNLATCH /* Turn off the run light */
817 andc r4,r4,r5
818 mtspr SPRN_CTRLT,r4
819
8201:
821 HMT_LOW
822#ifdef CONFIG_SMP
823 lbz r23,PACAPROCSTART(r13) /* Test if this processor
824 * should start */
825 sync
826 LOAD_REG_IMMEDIATE(r3,current_set)
827 sldi r28,r24,3 /* get current_set[cpu#] */
828 ldx r3,r3,r28
829 addi r1,r3,THREAD_SIZE
830 subi r1,r1,STACK_FRAME_OVERHEAD
831
832 cmpwi 0,r23,0
833 beq iSeries_secondary_smp_loop /* Loop until told to go */
834 bne __secondary_start /* Loop until told to go */
835iSeries_secondary_smp_loop:
836 /* Let the Hypervisor know we are alive */
837 /* 8002 is a call to HvCallCfg::getLps, a harmless Hypervisor function */
838 lis r3,0x8002
839 rldicr r3,r3,32,15 /* r0 = (r3 << 32) & 0xffff000000000000 */
840#else /* CONFIG_SMP */
841 /* Yield the processor. This is required for non-SMP kernels
842 which are running on multi-threaded machines. */
843 lis r3,0x8000
844 rldicr r3,r3,32,15 /* r3 = (r3 << 32) & 0xffff000000000000 */
845 addi r3,r3,18 /* r3 = 0x8000000000000012 which is "yield" */
846 li r4,0 /* "yield timed" */
847 li r5,-1 /* "yield forever" */
848#endif /* CONFIG_SMP */
849 li r0,-1 /* r0=-1 indicates a Hypervisor call */
850 sc /* Invoke the hypervisor via a system call */
851 mfspr r13,SPRN_SPRG3 /* Put r13 back ???? */
852 b 1b /* If SMP not configured, secondaries
853 * loop forever */
854
855decrementer_iSeries_masked: 805decrementer_iSeries_masked:
856 /* We may not have a valid TOC pointer in here. */ 806 /* We may not have a valid TOC pointer in here. */
857 li r11,1 807 li r11,1
@@ -1622,39 +1572,6 @@ _GLOBAL(generic_secondary_smp_init)
1622 b __secondary_start 1572 b __secondary_start
1623#endif 1573#endif
1624 1574
1625#ifdef CONFIG_PPC_ISERIES
1626_INIT_STATIC(__start_initialization_iSeries)
1627 /* Clear out the BSS */
1628 LOAD_REG_IMMEDIATE(r11,__bss_stop)
1629 LOAD_REG_IMMEDIATE(r8,__bss_start)
1630 sub r11,r11,r8 /* bss size */
1631 addi r11,r11,7 /* round up to an even double word */
1632 rldicl. r11,r11,61,3 /* shift right by 3 */
1633 beq 4f
1634 addi r8,r8,-8
1635 li r0,0
1636 mtctr r11 /* zero this many doublewords */
16373: stdu r0,8(r8)
1638 bdnz 3b
16394:
1640 LOAD_REG_IMMEDIATE(r1,init_thread_union)
1641 addi r1,r1,THREAD_SIZE
1642 li r0,0
1643 stdu r0,-STACK_FRAME_OVERHEAD(r1)
1644
1645 LOAD_REG_IMMEDIATE(r2,__toc_start)
1646 addi r2,r2,0x4000
1647 addi r2,r2,0x4000
1648
1649 bl .iSeries_early_setup
1650 bl .early_setup
1651
1652 /* relocation is on at this point */
1653
1654 b .start_here_common
1655#endif /* CONFIG_PPC_ISERIES */
1656
1657
1658_STATIC(__mmu_off) 1575_STATIC(__mmu_off)
1659 mfmsr r3 1576 mfmsr r3
1660 andi. r0,r3,MSR_IR|MSR_DR 1577 andi. r0,r3,MSR_IR|MSR_DR
@@ -1902,6 +1819,7 @@ _GLOBAL(pmac_secondary_start)
1902 * r13 = paca virtual address 1819 * r13 = paca virtual address
1903 * SPRG3 = paca virtual address 1820 * SPRG3 = paca virtual address
1904 */ 1821 */
1822 .globl __secondary_start
1905__secondary_start: 1823__secondary_start:
1906 /* Set thread priority to MEDIUM */ 1824 /* Set thread priority to MEDIUM */
1907 HMT_MEDIUM 1825 HMT_MEDIUM
@@ -2032,7 +1950,7 @@ _INIT_STATIC(start_here_multiplatform)
2032 b . /* prevent speculative execution */ 1950 b . /* prevent speculative execution */
2033 1951
2034 /* This is where all platforms converge execution */ 1952 /* This is where all platforms converge execution */
2035_INIT_STATIC(start_here_common) 1953_INIT_GLOBAL(start_here_common)
2036 /* relocation is on at this point */ 1954 /* relocation is on at this point */
2037 1955
2038 /* The following code sets up the SP and TOC now that we are */ 1956 /* The following code sets up the SP and TOC now that we are */