2 * trampoline.S: SMP cpu boot-up trampoline code.
4 * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
5 * Copyright (C) 1998 Jakub Jelinek (jj@sunsite.mff.cuni.cz)
8 #include <linux/init.h>
13 #include <asm/ptrace.h>
14 #include <asm/vaddrs.h>
15 #include <asm/contregs.h>
16 #include <asm/thread_info.h>
18 .globl sun4m_cpu_startup
19 .globl sun4d_cpu_startup
24 /* When we start up a cpu for the first time it enters this routine.
25 * This initializes the chip from whatever state the prom left it
26 * in and sets PIL in %psr to 15, no irqs.
31 sethi %hi(trapbase_cpu1), %g3
33 or %g3, %lo(trapbase_cpu1), %g3
36 sethi %hi(trapbase_cpu2), %g3
38 or %g3, %lo(trapbase_cpu2), %g3
41 sethi %hi(trapbase_cpu3), %g3
43 or %g3, %lo(trapbase_cpu3), %g3
46 /* Set up a sane %psr -- PIL<0xf> S<0x1> PS<0x1> CWP<0x0> */
47 set (PSR_PIL | PSR_S | PSR_PS), %g1
48 wr %g1, 0x0, %psr ! traps off though
51 /* Our %wim is one behind CWP */
56 /* This identifies "this cpu". */
60 /* Give ourselves a stack and curptr. */
66 sethi %hi(THREAD_SIZE - STACKFRAME_SZ), %sp
67 or %sp, %lo(THREAD_SIZE - STACKFRAME_SZ), %sp
70 /* Turn on traps (PSR_ET). */
72 wr %g1, PSR_ET, %psr ! traps on
75 /* Init our caches, etc. */
81 /* Start this processor. */
94 /* CPUID in bootbus can be found at PA 0xff0140000 */
95 #define SUN4D_BOOTBUS_CPUID 0xf0140000
101 /* Set up a sane %psr -- PIL<0xf> S<0x1> PS<0x1> CWP<0x0> */
102 set (PSR_PIL | PSR_S | PSR_PS), %g1
103 wr %g1, 0x0, %psr ! traps off though
106 /* Our %wim is one behind CWP */
111 /* Set tbr - we use just one trap table. */
116 /* Get our CPU id out of bootbus */
117 set SUN4D_BOOTBUS_CPUID, %g3
118 lduba [%g3] ASI_M_CTL, %g3
121 sta %g1, [%g0] ASI_M_VIKING_TMP1
123 /* Give ourselves a stack and curptr. */
128 sethi %hi(THREAD_SIZE - STACKFRAME_SZ), %sp
129 or %sp, %lo(THREAD_SIZE - STACKFRAME_SZ), %sp
132 /* Turn on traps (PSR_ET). */
134 wr %g1, PSR_ET, %psr ! traps on
137 /* Init our caches, etc. */
143 /* Start this processor. */
151 .global leon_smp_cpu_startup, smp_penguin_ctable
153 leon_smp_cpu_startup:
155 set smp_penguin_ctable,%g1
158 set 0x00000100,%g5 /* SRMMU_CTXTBL_PTR */
159 sta %g1, [%g5] ASI_LEON_MMUREGS
161 /* Set up a sane %psr -- PIL<0xf> S<0x1> PS<0x1> CWP<0x0> */
162 set (PSR_PIL | PSR_S | PSR_PS), %g1
163 wr %g1, 0x0, %psr ! traps off though
166 /* Our %wim is one behind CWP */
171 /* Set tbr - we use just one trap table. */
179 /* Give ourselves a stack and curptr. */
185 sethi %hi(THREAD_SIZE - STACKFRAME_SZ), %sp
186 or %sp, %lo(THREAD_SIZE - STACKFRAME_SZ), %sp
189 /* Turn on traps (PSR_ET). */
191 wr %g1, PSR_ET, %psr ! traps on
194 /* Init our caches, etc. */
200 /* Start this processor. */