Subject: RE: question about MP G4 systems
To: 'Chuck Silvers' <chuq@chuq.com>
From: Evertz NetBSD <evertz-netbsd@evertz.com>
List: port-macppc
Date: 08/05/2003 09:55:49
> hi,
> 
> On Tue, Jul 29, 2003 at 11:50:48AM -0400, Evertz NetBSD wrote:
> > I have a dual-G4 "firewire 800" system, on which the second 
> CPU doesn't come
> > up.  Just wondering if anyone has any suggestions (or 
> documentation) for me
> > on bringing it up.
> 
> I should be getting one of these in a few weeks, I'll see 
> about getting it
> working once it arrives.

I'd appreciate any hints or patches you might make.

> > I thought there was an openfirmware call to start secondary 
> CPUs, which I
> > don't think is being used.  Is there a reason?
> 
> I didn't know such a thing existed.  can you point me to some 
> documentation
> for this?

If you look at http://playground.sun.com/1275/home.html#OFDisaPPC and read
either the draft or accepted version, section 11 "MP Extensions" describes
methods "start-cpu", "stop-self", "idle-self" and "resume-cpu".  No idea if
Apple implemented them.

I was thinking of hacking ofwboot to actually start the second CPU and leave
it running a tight loop somewhere, and then having the CPU spinup code set a
flag telling the second CPU to exit it's tight loop and go through the
hatching routine.  Except I'm not sure about if/when NetBSD reclaims the
memory ofwboot allocates when it loads.  Also, I haven't actually tried
running a compiled ofwboot.xcf yet, and I remember there were some issues on
the newer machines.

So then I thought about having a vector at, say, entry-4, and having ofwboot
start the second CPU and branch it off to there just before jumping to
entry.  Same idea, have the second CPU loop until the main CPU really wants
it to start, except now the code is part of the kernel and therefore won't
be reallocated.

All this is based on the assumption that I don't want to figure whether it's
safe to make OF calls in the middle of the cpu starting code.

> > The code seems logical for second CPUs that can boot with 
> MSR[IP] = 0, but
> > the 7455 boots with MSR[IP] = 1 only.  Does the Apple ROM 
> fix this somehow,
> > so that all we're doing is taking it out of soft reset with 
> MSR[IP] already
> > cleared?
> 
> no idea.

The older PowerPCs, or at least the versions of them I've used, have the
initial value of MSR[IP] as part of their power on configuration, but the
7455 and it's kin only boot from MSR[IP] = 1.

> -Chuck
>