Michael Lorenz | 2 Oct 03:46 2007
Picon

ADB setup

Hello,

I thought I fixed this in 4.0 but I guess I was wrong.
On some newer *Books we accidentally power down when the adb driver  
attaches. As far as I know this happens on machines which don't have  
an ADB bus, so the PMU regards ADB commands as error and powers down.  
The attached patch will prevent the adb driver from issuing any ADB  
commands when the pmu node doesn't have an adb child. I've tested it  
on a PowerMac G4 which doesn't have ADB but the PMU is similar enough  
to the one used in newer PowerBooks although it doesn't power down on  
every error and a PowerBook 3400c which does have ADB. On the G4 no  
ADB commands are issued ( usually there would be a timeout message )  
and on the PowerBook the normal ADB devices attach.

Please test this on machines with or without ADB, if it fixes the  
power down problem and doesn't have any funny side effects I'll  
request pullup into 4.0

have fun
Michael
Attachment (adb.patch): application/octet-stream, 1222 bytes
Michael Lorenz | 3 Oct 00:13 2007
Picon

SMP in ppcoea-renovation


Hello,

now that I have a dual G4 box I gave ppcoea-renovation a shot. Here's  
what I found:
uniprocessor kernels seem to work just fine, as expected
SMP kernels don't compile but that's trivial to fix, the secondary  
CPU startup code tries to write to some OpenPIC register to make sure  
only the 1st CPU gets interrupts.
with those things fixed the kernel stops in cpu_spinup() when  
trying to reset the 2nd CPU via out8(gpio, 4)

The code looks ok to me, gpio is the same as in a 4.0 kernel which  
works. So I suspected missing or wrong BAT mappings for the gpio's  
address but changing oeaofw_ppcinit() back to use the same code as  
macppc in 4.0 didn't help.

So, what needs to be done is:
find out why out8(gpio, 4) hangs the machine
add an abstract interface for IPIs , hide information which vector  
to use etc. inside the PIC drivers, find a sane way to register IPI  
handlers.
deal with special cases where only CPU0 can handle interrupts like  
with legacy Apple PICs. Find out if that's a hardware limitation or  
just laziness. Unfortunately I don't have an Old World SMP box.
do we need to add locking to interrupt handling code? At least with  
Old World PICs we probably have to if we want both CPUs to take  
interrupt. OpenPIC seems to do something like that in hardware?

have fun
(Continue reading)

SUNAGAWA Keiki | 3 Oct 15:37 2007
Picon

Re: ADB setup

> I thought I fixed this in 4.0 but I guess I was wrong.
> On some newer *Books we accidentally power down when the adb driver  
> attaches. As far as I know this happens on machines which don't have  
> an ADB bus, so the PMU regards ADB commands as error and powers down.  
> The attached patch will prevent the adb driver from issuing any ADB  
> commands when the pmu node doesn't have an adb child. I've tested it  
> on a PowerMac G4 which doesn't have ADB but the PMU is similar enough  
> to the one used in newer PowerBooks although it doesn't power down on  
> every error and a PowerBook 3400c which does have ADB. On the G4 no  
> ADB commands are issued ( usually there would be a timeout message )  
> and on the PowerBook the normal ADB devices attach.
> 
> Please test this on machines with or without ADB, if it fixes the  
> power down problem and doesn't have any funny side effects I'll  
> request pullup into 4.0

Do you have a test kernel with the patch incorporated?

BTW, my PowerBook G4 12" powered down when I hitted f2 key
twice or more with the kernel 3.99.x or earlier, but 4.99.31
works fine.  Not tested 4.0.x.

My machine is:
  PowerBook6,4 (late 2004)
  166.402MHz

Regards,

--
SUNAGAWA Keiki <kei_sun <at> ba2.so-net.ne.jp>
(Continue reading)

Allen Wong | 3 Oct 18:53 2007

Re: 4.0 SMP problems?


-> For the records - a freshly built 4.0_RC1 SMP kernel works just fine  
-> on a Gigabit Ethernet PMac G4 with two 500MHz G4. I'll torture it a  
-> bit more, let's see how it does a userland build with -j2.
-> 

Is it just me, then?  What could account for the differences?  I'm booting
from a scsi disk (Adaptec 29160) and I replaced the Rage 128 video card with
an ATI Radeon 7500.

Allen
--

-- 
Don't just do something, sit there.
 9:00AM  up 11 days, 11:59, 0 users, load averages: 0.84, 0.55, 0.41
Michael Lorenz | 3 Oct 19:38 2007
Picon

Re: 4.0 SMP problems?


Hello,

On Oct 3, 2007, at 12:53, Allen Wong wrote:

> -> For the records - a freshly built 4.0_RC1 SMP kernel works just  
> fine
> -> on a Gigabit Ethernet PMac G4 with two 500MHz G4. I'll torture it a
> -> bit more, let's see how it does a userland build with -j2.
> ->
>
> Is it just me, then?  What could account for the differences?  I'm  
> booting
> from a scsi disk (Adaptec 29160) and I replaced the Rage 128 video  
> card with
> an ATI Radeon 7500.

This G4 boots from an IDE disk and still has the R128 it came with.  
I'd strongly suggest to try a uniprocessor kernel to check if the  
problem is really SMP related.
Then, did you build your own kernels? If so please try a /very/  
recent 4.0 GENERIC. Also, those links to dmesg and ofctl output you  
posted earlier don't seem to work right now ( www. submoron.org  
doesn't resolve )
Finally, do you run into the same problem when attempting to boot  
from any IDE device?

have fun
Michael
(Continue reading)

Michael Lorenz | 4 Oct 03:13 2007
Picon

Re: ADB setup


Hello,

On Oct 3, 2007, at 09:37, SUNAGAWA Keiki wrote:

>> I thought I fixed this in 4.0 but I guess I was wrong.
>> On some newer *Books we accidentally power down when the adb driver
>> attaches. As far as I know this happens on machines which don't have
>> an ADB bus, so the PMU regards ADB commands as error and powers down.
>> The attached patch will prevent the adb driver from issuing any ADB
>> commands when the pmu node doesn't have an adb child. I've tested it
>> on a PowerMac G4 which doesn't have ADB but the PMU is similar enough
>> to the one used in newer PowerBooks although it doesn't power down on
>> every error and a PowerBook 3400c which does have ADB. On the G4 no
>> ADB commands are issued ( usually there would be a timeout message )
>> and on the PowerBook the normal ADB devices attach.
>>
>> Please test this on machines with or without ADB, if it fixes the
>> power down problem and doesn't have any funny side effects I'll
>> request pullup into 4.0
>
> Do you have a test kernel with the patch incorporated?

Sure:
ftp://ftp.netbsd.org/pub/NetBSD/misc/macallan/macppc/netbsd_4_generic

> BTW, my PowerBook G4 12" powered down when I hitted f2 key
> twice or more with the kernel 3.99.x or earlier, but 4.99.31
> works fine.  Not tested 4.0.x.

(Continue reading)

Allen Wong | 4 Oct 07:31 2007

Re: 4.0 SMP problems?


Michael,

-> This G4 boots from an IDE disk and still has the R128 it came with.  
-> I'd strongly suggest to try a uniprocessor kernel to check if the  
-> problem is really SMP related.

I tried booting with a uniprocessor kernel with the same results.

-> Then, did you build your own kernels? If so please try a /very/  
-> recent 4.0 GENERIC. Also, those links to dmesg and ofctl output you  

I downloaded the kernels from the NetBSD ftp site.  The full path is:

/pub/NetBSD/NetBSD-4.0_RC2/macppc/binary/kernel/netbsd-GENERIC.MP.gz
/pub/NetBSD/NetBSD-4.0_RC2/macppc/binary/kernel/netbsd-GENERIC.gz

-> posted earlier don't seem to work right now ( www. submoron.org  
-> doesn't resolve )

My apache server is back up now.  The files are located at:

http://www.submoron.org/dmesg.txt
http://www.submoron.org/ofctl.txt

-> Finally, do you run into the same problem when attempting to boot  
-> from any IDE device?
-> 

I'll attach an IDE disk and test it.  Thank you for your time and help.
(Continue reading)

Iain Dooley | 4 Oct 09:15 2007
Picon

public email address

hi, i posted to this list and my email address is publicy accessible on 
this page:

http://mail-index.netbsd.org/port-macppc/2007/06/01/0001.html

could you please blank it out?

cheers

iain

Michael Lorenz | 4 Oct 10:38 2007
Picon

Re: 4.0 SMP problems?


Hello,

On Oct 4, 2007, at 01:31, Allen Wong wrote:

> -> This G4 boots from an IDE disk and still has the R128 it came with.
> -> I'd strongly suggest to try a uniprocessor kernel to check if the
> -> problem is really SMP related.
>
> I tried booting with a uniprocessor kernel with the same results.

Ok, so at least it's not SMP related.

> -> Then, did you build your own kernels? If so please try a /very/
> -> recent 4.0 GENERIC. Also, those links to dmesg and ofctl output you
>
> I downloaded the kernels from the NetBSD ftp site.  The full path is:
>
> /pub/NetBSD/NetBSD-4.0_RC2/macppc/binary/kernel/netbsd-GENERIC.MP.gz
> /pub/NetBSD/NetBSD-4.0_RC2/macppc/binary/kernel/netbsd-GENERIC.gz

Definitely new enough.

We need to find out where the first trap happens, so
any chance to narrow it down a bit? How far - approximately - did  
the kernel boot before faulting?
how old is your boot loader? I know ofwboot.xcf from 3.1 can load  
4.0 and -current kernels, older versions might cause funky problems.

have fun
(Continue reading)

Erik Bertelsen | 4 Oct 21:45 2007
Picon

Re: CVS commit: [ppcoea-renovation] src/sys/arch/macppc/macppc

2007/10/4, Michael Lorenz <macallan <at> netbsd.org>:

> Modified Files:
>         src/sys/arch/macppc/macppc [ppcoea-renovation]: cpu.c
>
> Log Message:
> unbork SMP for G4 machines

Just to confirm: now my dual-CPU G4 boots with options MULTIPROCESSOR
and seems to run happily.

NetBSD 4.99.31 (ALFAST) #30: Thu Oct  4 21:33:50 CEST 2007
        erik <at> alfast.h.erikb.net:/home/NetBSD/src/sys/arch/macppc/compile/ALFAST
total memory = 1024 MB
avail memory = 989 MB
timecounter: Timecounters tick every 10.000 msec
found openpic PIC at 80040000
OpenPIC Version 1.2: Supports 4 CPUs and 64 interrupt sources.
mainbus0 (root)
cpu0 at mainbus0: 7400 (Revision 0.9), ID 0 (primary)
cpu0: HID0 8094c0a4<EMCP,DOZE,DPM,EIEC,ICE,DCE,SGE,BTIC,BHT>, powersave: 1
cpu0: 450.00 MHz, no-parity 1MB WB L2 cache (PB SRAM) at 2:1 ratio
cpu1 at mainbus0: 7400 (Revision 0.9), ID 1
cpu1: HID0 8094c0a4<EMCP,DOZE,DPM,EIEC,ICE,DCE,SGE,BTIC,BHT>, powersave: 1
cpu1: 450.00 MHz, no-parity 1MB WB L2 cache (PB SRAM) at 2:1 ratio
uni_n0 at mainbus0 address 0xf8000000
ki2c0 at uni_n0 address 0xf8001000
...

regards
(Continue reading)


Gmane