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. */
97 /* CPUID in bootbus can be found at PA 0xff0140000 */
98 #define SUN4D_BOOTBUS_CPUID 0xf0140000
104 /* Set up a sane %psr -- PIL<0xf> S<0x1> PS<0x1> CWP<0x0> */
105 set (PSR_PIL | PSR_S | PSR_PS), %g1
106 wr %g1, 0x0, %psr ! traps off though
109 /* Our %wim is one behind CWP */
114 /* Set tbr - we use just one trap table. */
119 /* Get our CPU id out of bootbus */
120 set SUN4D_BOOTBUS_CPUID, %g3
121 lduba [%g3] ASI_M_CTL, %g3
124 sta %g1, [%g0] ASI_M_VIKING_TMP1
126 /* Give ourselves a stack and curptr. */
131 sethi %hi(THREAD_SIZE - STACKFRAME_SZ), %sp
132 or %sp, %lo(THREAD_SIZE - STACKFRAME_SZ), %sp
135 /* Turn on traps (PSR_ET). */
137 wr %g1, PSR_ET, %psr ! traps on
140 /* Init our caches, etc. */
146 /* Start this processor. */
154 .global leon_smp_cpu_startup, smp_penguin_ctable
156 leon_smp_cpu_startup:
158 set smp_penguin_ctable,%g1
161 set 0x00000100,%g5 /* SRMMU_CTXTBL_PTR */
162 sta %g1, [%g5] ASI_LEON_MMUREGS
164 /* Set up a sane %psr -- PIL<0xf> S<0x1> PS<0x1> CWP<0x0> */
165 set (PSR_PIL | PSR_S | PSR_PS), %g1
166 wr %g1, 0x0, %psr ! traps off though
169 /* Our %wim is one behind CWP */
174 /* Set tbr - we use just one trap table. */
182 /* Give ourselves a stack and curptr. */
188 sethi %hi(THREAD_SIZE - STACKFRAME_SZ), %sp
189 or %sp, %lo(THREAD_SIZE - STACKFRAME_SZ), %sp
192 /* Turn on traps (PSR_ET). */
194 wr %g1, PSR_ET, %psr ! traps on
197 /* Init our caches, etc. */
203 /* Start this processor. */