Subject: Re: Bootloader problems
To: Ben Harris <bjh21@netbsd.org>
From: Chris Gilbert <chris@paradox.demon.co.uk>
List: port-arm32
Date: 04/13/2001 18:13:55
On Friday 13 April 2001  3:41 pm, Ben Harris wrote:
> In article <01041314355803.00345@pinky.paradox.demon.co.uk> you write:
> >I'm thinking more along the lines of the kernel should enable it for the
> > SA. I prefer the view that the kernel switches it on.  it's turned off in
> > the bootloader to give the impression we've just done a reset.  Note
> > though that it does appear to be an SA only feature (not in the xscale
> > from what I can tell)
>
> I agree.  As far as possible, the bootloader should present the kernel with
> the CPU as if it's just been reset, and the kernel should set things up how
> it wants them.
>
> >Perhaps it should be PR'd and, for now, disabled in the bootloader, I'm
> > just wondering if the SA-11x0 ports need it enabled?
>
> For now, if you really doubt that the SA-11x0 will like it, just turn it on
> on the SA-110.  That shouldn't bee too hard.

The SA-11x0 has it as well (appears to be an sa1 core feature)

Where would be the best place to implement it?  Seems overkill to add it to 
cpufuncs,  I'm thinking that in identify_master_cpu might be a good place 
(see patch at end of file)  but I'm not sure it is, or if having asm in there 
is sensible...

Cheers,
Chris

Index: cpu.c
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/arm/mainbus/cpu.c,v
retrieving revision 1.18
diff -u -p -r1.18 cpu.c
--- cpu.c	2001/04/04 21:40:20	1.18
+++ cpu.c	2001/04/13 17:11:13
@@ -189,6 +189,12 @@ identify_master_cpu(sc, cpu_number)
 		       sc->sc_dev.dv_xname);
 	}
 
+	if (cpus[CPU_MASTER].cpu_class == CPU_CLASS_SA1) {
+	    __asm ("mcr 15, 0, r0, c15, c1, 2");
+	    printf("%s: SA-1 core, enabled clockswitching\n",
+		    sc->sc_dev.dv_xname); 
+	}
+	
 #ifdef CPU_ARM8
 	if ((cpus[CPU_MASTER].cpu_id & CPU_ID_CPU_MASK) == CPU_ID_ARM810) {
 		int clock = arm8_clock_config(0, 0);