Rev 1900 | Rev 1905 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 1900 | Rev 1903 | ||
|---|---|---|---|
| Line 24... | Line 24... | ||
| 24 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
24 | # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 25 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
25 | # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
| 26 | # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 27 | # |
27 | # |
| 28 | 28 | ||
| - | 29 | #include <arch/arch.h> |
|
| 29 | #include <arch/regdef.h> |
30 | #include <arch/regdef.h> |
| 30 | #include <arch/boot/boot.h> |
31 | #include <arch/boot/boot.h> |
| 31 | 32 | ||
| 32 | #include <arch/mm/mmu.h> |
33 | #include <arch/mm/mmu.h> |
| 33 | #include <arch/mm/tlb.h> |
34 | #include <arch/mm/tlb.h> |
| 34 | #include <arch/mm/tte.h> |
35 | #include <arch/mm/tte.h> |
| 35 | 36 | ||
| - | 37 | #ifdef CONFIG_SMP |
|
| - | 38 | #include <arch/context_offset.h> |
|
| - | 39 | #endif |
|
| - | 40 | ||
| 36 | .register %g2, #scratch |
41 | .register %g2, #scratch |
| 37 | .register %g3, #scratch |
42 | .register %g3, #scratch |
| 38 | 43 | ||
| 39 | .section K_TEXT_START, "ax" |
44 | .section K_TEXT_START, "ax" |
| 40 | 45 | ||
| Line 224... | Line 229... | ||
| 224 | flush %g5 |
229 | flush %g5 |
| 225 | 230 | ||
| 226 | ! set TL back to 0 |
231 | ! set TL back to 0 |
| 227 | wrpr %g0, 0, %tl |
232 | wrpr %g0, 0, %tl |
| 228 | 233 | ||
| 229 | brz %l7, 2f ! skip if you are not the bootstrap CPU |
234 | brz %l7, 1f ! skip if you are not the bootstrap CPU |
| - | 235 | nop |
|
| 230 | 236 | ||
| 231 | call arch_pre_main |
237 | call arch_pre_main |
| 232 | nop |
238 | nop |
| 233 | 239 | ||
| 234 | call main_bsp |
240 | call main_bsp |
| 235 | nop |
241 | nop |
| 236 | 242 | ||
| 237 | /* Not reached. */ |
243 | /* Not reached. */ |
| 238 | 244 | ||
| - | 245 | 0: |
|
| - | 246 | ba 0b |
|
| - | 247 | nop |
|
| - | 248 | ||
| - | 249 | ||
| - | 250 | /* |
|
| - | 251 | * Read MID from the processor. |
|
| - | 252 | */ |
|
| - | 253 | 1: |
|
| - | 254 | ldxa [%g0] ASI_UPA_CONFIG, %g1 |
|
| - | 255 | srlx %g1, UPA_CONFIG_MID_SHIFT, %g1 |
|
| - | 256 | and %g1, UPA_CONFIG_MID_MASK, %g1 |
|
| - | 257 | ||
| - | 258 | /* |
|
| - | 259 | * Active loop for APs until the BSP picks them up. |
|
| - | 260 | * A processor cannot leave the loop until the |
|
| - | 261 | * global variable 'waking_up_mid' equals its |
|
| - | 262 | * MID. |
|
| - | 263 | */ |
|
| - | 264 | set waking_up_mid, %g2 |
|
| 239 | 2: |
265 | 2: |
| - | 266 | ldx [%g2], %g3 |
|
| - | 267 | cmp %g3, %g1 |
|
| 240 | b 2b |
268 | bne 2b |
| - | 269 | nop |
|
| - | 270 | ||
| - | 271 | #ifdef CONFIG_SMP |
|
| - | 272 | /* |
|
| - | 273 | * Configure stack for the AP. |
|
| - | 274 | * The AP is expected to use the stack saved |
|
| - | 275 | * in the ctx global variable. |
|
| - | 276 | */ |
|
| - | 277 | set ctx, %g1 |
|
| - | 278 | add %g1, OFFSET_SP, %g1 |
|
| - | 279 | ldx [%g1], %o6 |
|
| - | 280 | ||
| - | 281 | call main_ap |
|
| - | 282 | nop |
|
| - | 283 | #endif |
|
| - | 284 | ||
| - | 285 | /* Not reached. */ |
|
| - | 286 | ||
| - | 287 | 0: |
|
| - | 288 | ba 0b |
|
| 241 | nop |
289 | nop |