Re: [PATCH 2/5] sparc32: implement proper LEON support in head_32 (before highmem)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Sam Ravnborg <sam@xxxxxxxxxxxx>
Date: Tue, 22 May 2012 22:10:40 +0200

> Use PSR to check if the PCU is LEON and jump to
                          ^^^

"CPU" :-)

> +		/* Check if this is a LEON CPU */
> +		rd	%psr, %g3
> +		set	PSR_IMPL, %g2
> +		and	%g2, %g3, %g3
> +		srl	%g3, PSR_IMPL_SHIFT, %g3
> +		cmp	%g3, PSR_IMPL_LEON

I would code this like:

	rd	%psr, %g3
	srl	%g3, PSR_IMPL_SHIFT, %g3
	and	%g3, 0xf /* PST_IMPL_WHATEVER_MASK */, %g3
	cmp	%g3, PSR_IMPL_LEON


> +		/* Check for a viking (TI) module. */
> +		cmp	%g3, PSR_IMPL_TEXAS
> +		bne	srmmu_not_viking
>  		 nop

PSR_IMPL_TI is probably a better name fo this macro.

> @@ -313,6 +326,29 @@ srmmu_nviking:
>  		 nop					! wheee....
>  
>  
> +leon_remap:
> +		/* Sanity-check, is MMU enabled */
> +		lda	[%g0] ASI_LEON_MMUREGS, %g1
> +		andcc	%g1, 1, %g0
> +		be	halt_sun4_or_sun4c
> +		 nop

Checking that the MMU is disabled is correct, but branching
to the sun4c-not-supported error message is probably not. :-)

Otherwise looks OK.
--
To unsubscribe from this list: send the line "unsubscribe sparclinux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Kernel Development]     [DCCP]     [Linux ARM Development]     [Linux]     [Photo]     [Yosemite Help]     [Linux ARM Kernel]     [Linux SCSI]     [Linux x86_64]     [Linux Hams]

  Powered by Linux