Skip to contentSkip to conversation

sparc32: implement proper LEON support in head_32 (after highmem)

PATCH In review Sam Ravnborg 2 participants 2 messages May 22, 2012 SPARC + UltraSPARC (sparc/sparc64)

lore
Share & tools
lore
#0 lore raw

PATCH 3/5 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 and the support code is not yet converted.

Cc Daniel Hellstrom <[email protected]>
Cc Konrad Eisele <[email protected]>
---
 arch/sparc/kernel/head_32.S |   18 ++++++++++++++++--
 1 files changed, 16 insertions(+), 2 deletions(-)
arch/sparc/kernel/head_32.S +16 -2
index 1be5b62..488a23a 100644
@@ -392,7 +392,18 @@ execute_in_high_mem:
 						! to a buf where above string
 						! will get stored by the prom.
 
-#ifdef CONFIG_SPARC_LEON
+		/* If this is a LEON cpu we ignore the result
+		 * of the getprops call.
+		 * XXX Can we drop the getprops call?
+		 */
+		rd	%psr, %g1
+		set     PSR_IMPL, %g2
+		and     %g1, %g2, %g1
+		srl     %g1, PSR_IMPL_SHIFT, %g1
+		cmp     %g1, PSR_IMPL_LEON
+		bne	check_cputype
+		 nop
+
 	        /* no cpu-type check is needed, it is a SPARC-LEON */
 
 		sethi	%hi(boot_cpu_id), %g2	! boot-cpu index
@@ -400,9 +411,12 @@ execute_in_high_mem:
 #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
 		srl    %g1, 28, %g1
@@ -412,8 +426,8 @@ execute_in_high_mem:
 
 		ba continue_boot
 		 nop
-#endif
 
+check_cputype:
 /* Check to cputype. We may be booted on a sun4u (64 bit box),
  * and sun4d needs special treatment.
  */
Signature · 1 line
1.6.0.6
maintainer
#1 lore raw

From: Sam Ravnborg <[email protected]>
Date: Tue, 22 May 2012 22:10:41 +0200

Quoted 8 lines

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 and the support code is not yet converted.

Looks ok.