diff options
author | Sam Ravnborg <sam@ravnborg.org> | 2012-05-25 17:20:07 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-05-28 02:52:41 -0400 |
commit | 30005efc9818d715cc72f15e962d06457c529783 (patch) | |
tree | aae40ce4536a05fc17ac40f560b139a74a752168 /arch | |
parent | 7b372d6582ca3bf41a1af9f168f3a852f3d7b21d (diff) |
sparc32: implement proper LEON support in head_32 (after highmem)
We use the compatibility property to determine the
sun models. For leon we use psr.impl and ignore the
result of the getprops call.
Include a hack to allow build as the support code
is not yet converted.
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Daniel Hellstrom <daniel@gaisler.com>
Cc: Konrad Eisele <konrad@gaisler.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/sparc/kernel/head_32.S | 58 |
1 files changed, 33 insertions, 25 deletions
diff --git a/arch/sparc/kernel/head_32.S b/arch/sparc/kernel/head_32.S index 5a418d32d94c..f22a729dfb3d 100644 --- a/arch/sparc/kernel/head_32.S +++ b/arch/sparc/kernel/head_32.S | |||
@@ -372,37 +372,27 @@ execute_in_high_mem: | |||
372 | sethi %hi(linux_dbvec), %g1 | 372 | sethi %hi(linux_dbvec), %g1 |
373 | st %o1, [%g1 + %lo(linux_dbvec)] | 373 | st %o1, [%g1 + %lo(linux_dbvec)] |
374 | 374 | ||
375 | /* Get the machine type via the mysterious romvec node operations. */ | 375 | /* Check if this is a LEON CPU. |
376 | 376 | * Skip getprops call if it is | |
377 | add %g7, 0x1c, %l1 | 377 | */ |
378 | ld [%l1], %l0 | 378 | srl %g3, PSR_IMPL_SHIFT, %g3 |
379 | ld [%l0], %l0 | 379 | and %g3, PSR_IMPL_SHIFTED_MASK, %g3 |
380 | call %l0 | 380 | cmp %g3, PSR_IMPL_LEON |
381 | or %g0, %g0, %o0 ! next_node(0) = first_node | 381 | bne get_cputype |
382 | or %o0, %g0, %g6 | ||
383 | |||
384 | sethi %hi(cputypvar), %o1 ! First node has cpu-arch | ||
385 | or %o1, %lo(cputypvar), %o1 | ||
386 | sethi %hi(cputypval), %o2 ! information, the string | ||
387 | or %o2, %lo(cputypval), %o2 | ||
388 | ld [%l1], %l0 ! 'compatible' tells | ||
389 | ld [%l0 + 0xc], %l0 ! that we want 'sun4x' where | ||
390 | call %l0 ! x is one of 'm', 'd' or 'e'. | ||
391 | nop ! %o2 holds pointer | ||
392 | ! to a buf where above string | ||
393 | ! will get stored by the prom. | ||
394 | 382 | ||
395 | #ifdef CONFIG_SPARC_LEON | ||
396 | /* no cpu-type check is needed, it is a SPARC-LEON */ | ||
397 | 383 | ||
384 | /* LEON CPU - set boot_cpu_id */ | ||
398 | sethi %hi(boot_cpu_id), %g2 ! boot-cpu index | 385 | sethi %hi(boot_cpu_id), %g2 ! boot-cpu index |
399 | 386 | ||
400 | #ifdef CONFIG_SMP | 387 | #ifdef CONFIG_SMP |
401 | ldub [%g2 + %lo(boot_cpu_id)], %g1 | 388 | ldub [%g2 + %lo(boot_cpu_id)], %g1 |
402 | cmp %g1, 0xff ! unset means first CPU | 389 | cmp %g1, 0xff ! unset means first CPU |
390 | #ifdef CONFIG_SPARC_LEON | ||
391 | /* XXX Hack to allow build - remove ifdef later */ | ||
403 | bne leon_smp_cpu_startup ! continue only with master | 392 | bne leon_smp_cpu_startup ! continue only with master |
404 | nop | 393 | nop |
405 | #endif | 394 | #endif |
395 | #endif | ||
406 | /* Get CPU-ID from most significant 4-bit of ASR17 */ | 396 | /* Get CPU-ID from most significant 4-bit of ASR17 */ |
407 | rd %asr17, %g1 | 397 | rd %asr17, %g1 |
408 | srl %g1, 28, %g1 | 398 | srl %g1, 28, %g1 |
@@ -412,12 +402,30 @@ execute_in_high_mem: | |||
412 | 402 | ||
413 | ba continue_boot | 403 | ba continue_boot |
414 | nop | 404 | nop |
415 | #endif | 405 | |
406 | /* Get the machine type via the mysterious romvec node operations. */ | ||
407 | get_cputype: | ||
408 | add %g7, 0x1c, %l1 | ||
409 | ld [%l1], %l0 | ||
410 | ld [%l0], %l0 | ||
411 | call %l0 | ||
412 | or %g0, %g0, %o0 ! next_node(0) = first_node | ||
413 | or %o0, %g0, %g6 | ||
414 | |||
415 | sethi %hi(cputypvar), %o1 ! First node has cpu-arch | ||
416 | or %o1, %lo(cputypvar), %o1 | ||
417 | sethi %hi(cputypval), %o2 ! information, the string | ||
418 | or %o2, %lo(cputypval), %o2 | ||
419 | ld [%l1], %l0 ! 'compatible' tells | ||
420 | ld [%l0 + 0xc], %l0 ! that we want 'sun4x' where | ||
421 | call %l0 ! x is one of 'm', 'd' or 'e'. | ||
422 | nop ! %o2 holds pointer | ||
423 | ! to a buf where above string | ||
424 | ! will get stored by the prom. | ||
416 | 425 | ||
417 | /* Check to cputype. We may be booted on a sun4u (64 bit box), | 426 | /* Check to cputype. We may be booted on a sun4u (64 bit box), |
418 | * and sun4d needs special treatment. | 427 | * and sun4d needs special treatment. |
419 | */ | 428 | */ |
420 | |||
421 | set cputypval, %o2 | 429 | set cputypval, %o2 |
422 | ldub [%o2 + 0x4], %l1 | 430 | ldub [%o2 + 0x4], %l1 |
423 | 431 | ||
@@ -467,9 +475,9 @@ sun4m_init: | |||
467 | /* This sucks, apparently this makes Vikings call prom panic, will fix later */ | 475 | /* This sucks, apparently this makes Vikings call prom panic, will fix later */ |
468 | 2: | 476 | 2: |
469 | rd %psr, %o1 | 477 | rd %psr, %o1 |
470 | srl %o1, 28, %o1 ! Get a type of the CPU | 478 | srl %o1, PSR_IMPL_SHIFT, %o1 ! Get a type of the CPU |
471 | 479 | ||
472 | subcc %o1, 4, %g0 ! TI: Viking or MicroSPARC | 480 | subcc %o1, PSR_IMPL_TI, %g0 ! TI: Viking or MicroSPARC |
473 | be continue_boot | 481 | be continue_boot |
474 | nop | 482 | nop |
475 | 483 | ||