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)
12 #include <asm/ptrace.h>
13 #include <asm/vaddrs.h>
14 #include <asm/contregs.h>
15 #include <asm/thread_info.h>
17 .globl sun4m_cpu_startup
18 .globl sun4d_cpu_startup
22 /* When we start up a cpu for the first time it enters this routine.
23 * This initializes the chip from whatever state the prom left it
24 * in and sets PIL in %psr to 15, no irqs.
29 sethi %hi(trapbase_cpu1), %g3
31 or %g3, %lo(trapbase_cpu1), %g3
34 sethi %hi(trapbase_cpu2), %g3
36 or %g3, %lo(trapbase_cpu2), %g3
39 sethi %hi(trapbase_cpu3), %g3
41 or %g3, %lo(trapbase_cpu3), %g3
44 /* Set up a sane %psr -- PIL<0xf> S<0x1> PS<0x1> CWP<0x0> */
45 set (PSR_PIL | PSR_S | PSR_PS), %g1
46 wr %g1, 0x0, %psr ! traps off though
49 /* Our %wim is one behind CWP */
54 /* This identifies "this cpu". */
58 /* Give ourselves a stack and curptr. */
64 sethi %hi(THREAD_SIZE - STACKFRAME_SZ), %sp
65 or %sp, %lo(THREAD_SIZE - STACKFRAME_SZ), %sp
68 /* Turn on traps (PSR_ET). */
70 wr %g1, PSR_ET, %psr ! traps on
73 /* Init our caches, etc. */
79 /* Start this processor. */
92 /* CPUID in bootbus can be found at PA 0xff0140000 */
93 #define SUN4D_BOOTBUS_CPUID 0xf0140000
98 /* Set up a sane %psr -- PIL<0xf> S<0x1> PS<0x1> CWP<0x0> */
99 set (PSR_PIL | PSR_S | PSR_PS), %g1
100 wr %g1, 0x0, %psr ! traps off though
103 /* Our %wim is one behind CWP */
108 /* Set tbr - we use just one trap table. */
113 /* Get our CPU id out of bootbus */
114 set SUN4D_BOOTBUS_CPUID, %g3
115 lduba [%g3] ASI_M_CTL, %g3
118 sta %g1, [%g0] ASI_M_VIKING_TMP1
120 /* Give ourselves a stack and curptr. */
125 sethi %hi(THREAD_SIZE - STACKFRAME_SZ), %sp
126 or %sp, %lo(THREAD_SIZE - STACKFRAME_SZ), %sp
129 /* Turn on traps (PSR_ET). */
131 wr %g1, PSR_ET, %psr ! traps on
134 /* Init our caches, etc. */
140 /* Start this processor. */
147 .global leon_smp_cpu_startup, smp_penguin_ctable
149 leon_smp_cpu_startup:
151 set smp_penguin_ctable,%g1
154 set 0x00000100,%g5 /* SRMMU_CTXTBL_PTR */
155 sta %g1, [%g5] ASI_LEON_MMUREGS
157 /* Set up a sane %psr -- PIL<0xf> S<0x1> PS<0x1> CWP<0x0> */
158 set (PSR_PIL | PSR_S | PSR_PS), %g1
159 wr %g1, 0x0, %psr ! traps off though
162 /* Our %wim is one behind CWP */
167 /* Set tbr - we use just one trap table. */
175 /* Give ourselves a stack and curptr. */
181 sethi %hi(THREAD_SIZE - STACKFRAME_SZ), %sp
182 or %sp, %lo(THREAD_SIZE - STACKFRAME_SZ), %sp
185 /* Turn on traps (PSR_ET). */
187 wr %g1, PSR_ET, %psr ! traps on
190 /* Init our caches, etc. */
196 /* Start this processor. */