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]

 



On Tue, May 22, 2012 at 04:23:10PM -0400, David Miller wrote:
> 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. :-)

I did not like it either - but this
was a straight copy from the old code with
proper replacement of the MMUREGS.
I actually considered to just drop it.

I will rephrase the text in a separate commit.

> 
> Otherwise looks OK.
> 

Thanks for the quick feedback!

I will address it all and get back.
Will take a couple of days as weather is
too good to do serious coding ;-)

	Sam
--
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