Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 309524
b: refs/heads/master
c: 30005ef
h: refs/heads/master
v: v3
  • Loading branch information
Sam Ravnborg authored and David S. Miller committed May 28, 2012
1 parent cf7e856 commit e43c41b
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 26 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7b372d6582ca3bf41a1af9f168f3a852f3d7b21d
refs/heads/master: 30005efc9818d715cc72f15e962d06457c529783
58 changes: 33 additions & 25 deletions trunk/arch/sparc/kernel/head_32.S
Original file line number Diff line number Diff line change
Expand Up @@ -372,36 +372,26 @@ execute_in_high_mem:
sethi %hi(linux_dbvec), %g1
st %o1, [%g1 + %lo(linux_dbvec)]

/* Get the machine type via the mysterious romvec node operations. */

add %g7, 0x1c, %l1
ld [%l1], %l0
ld [%l0], %l0
call %l0
or %g0, %g0, %o0 ! next_node(0) = first_node
or %o0, %g0, %g6

sethi %hi(cputypvar), %o1 ! First node has cpu-arch
or %o1, %lo(cputypvar), %o1
sethi %hi(cputypval), %o2 ! information, the string
or %o2, %lo(cputypval), %o2
ld [%l1], %l0 ! 'compatible' tells
ld [%l0 + 0xc], %l0 ! that we want 'sun4x' where
call %l0 ! x is one of 'm', 'd' or 'e'.
nop ! %o2 holds pointer
! to a buf where above string
! will get stored by the prom.
/* Check if this is a LEON CPU.
* Skip getprops call if it is
*/
srl %g3, PSR_IMPL_SHIFT, %g3
and %g3, PSR_IMPL_SHIFTED_MASK, %g3
cmp %g3, PSR_IMPL_LEON
bne get_cputype

#ifdef CONFIG_SPARC_LEON
/* no cpu-type check is needed, it is a SPARC-LEON */

/* LEON CPU - set boot_cpu_id */
sethi %hi(boot_cpu_id), %g2 ! boot-cpu index

#ifdef CONFIG_SMP
ldub [%g2 + %lo(boot_cpu_id)], %g1
cmp %g1, 0xff ! unset means first CPU
#ifdef CONFIG_SPARC_LEON
/* XXX Hack to allow build - remove ifdef later */
bne leon_smp_cpu_startup ! continue only with master
nop
#endif
#endif
/* Get CPU-ID from most significant 4-bit of ASR17 */
rd %asr17, %g1
Expand All @@ -412,12 +402,30 @@ execute_in_high_mem:

ba continue_boot
nop
#endif

/* Get the machine type via the mysterious romvec node operations. */
get_cputype:
add %g7, 0x1c, %l1
ld [%l1], %l0
ld [%l0], %l0
call %l0
or %g0, %g0, %o0 ! next_node(0) = first_node
or %o0, %g0, %g6

sethi %hi(cputypvar), %o1 ! First node has cpu-arch
or %o1, %lo(cputypvar), %o1
sethi %hi(cputypval), %o2 ! information, the string
or %o2, %lo(cputypval), %o2
ld [%l1], %l0 ! 'compatible' tells
ld [%l0 + 0xc], %l0 ! that we want 'sun4x' where
call %l0 ! x is one of 'm', 'd' or 'e'.
nop ! %o2 holds pointer
! to a buf where above string
! will get stored by the prom.

/* Check to cputype. We may be booted on a sun4u (64 bit box),
* and sun4d needs special treatment.
*/

set cputypval, %o2
ldub [%o2 + 0x4], %l1

Expand Down Expand Up @@ -467,9 +475,9 @@ sun4m_init:
/* This sucks, apparently this makes Vikings call prom panic, will fix later */
2:
rd %psr, %o1
srl %o1, 28, %o1 ! Get a type of the CPU
srl %o1, PSR_IMPL_SHIFT, %o1 ! Get a type of the CPU

subcc %o1, 4, %g0 ! TI: Viking or MicroSPARC
subcc %o1, PSR_IMPL_TI, %g0 ! TI: Viking or MicroSPARC
be continue_boot
nop

Expand Down

0 comments on commit e43c41b

Please sign in to comment.