Subject: "Blue & White" G3 (long)
To: None <port-macppc@netbsd.org>
From: William O Ferry <woferry@iname.com>
List: port-macppc
Date: 03/06/1999 23:08:36
	I recently got my new G3, and figured I'd try booting NetBSD on it.
What follows is my successes & failures with getting NetBSD up on this box 
today,
so if you're not interested in the new G3 desktops then there probably isn't 
much
point in reading the rest of this.  Really I'm wondering if anybody has or is
trying to get NetBSD up on these machines, I'm looking to trade info.

	"boot enet:0" seems to work just fine for these machines, though it seems
to grab the file in quick bursts, with long delays in between, and the latest
GENERIC kernel I built gets about half-way through the PCI device probing and 
dies
with a trap in the pci_conf_read() function.

	I played with this a bit, and found that doing a pci_conf_read() on any
device # that does not exist on the PCI-PCI bridge seems to fail (in the 
in32rb()
macro, the value in r->data seems to be the problem).  So I hacked 
pci_probe_bus
to not actually check devices on bus 1 other than the ones I saw listed in
"dev / ls" in OFW (0, 1, 5 and 6), and it listed all of the devices without 
dying.

	The next problem was that it detected the Paddington chip, but did not
configure it.  This is because the path of the device in OFW is different, 
since
it's on the other side of the PCI-PCI bridge.  Adding the code:
	case 0x10:
	case 0x17:
		node = OF_finddevice("/pci/mac-io");
+		if (node == -1) {
+		  node = OF_finddevice("/pci/pci-bridge/mac-io");
+		}
		break;
in obio.c seems to have done the trick, obio0 listed it's children.  It seems 
-1
indicates an error in OF_finddevice, so I think this is the right thing to do.
It definitely works on my machine.

	Additionally, the Paddington IDE controller has yet another new name
in OFW (do any two machines have the same name?!?!?  =), this time it's
"ata-3".  Adding this to the list of names in wdc_obio.c got it to see the
secondary IDE bus (that the CD and Zip drives are connected to).

	I tried to get pciide up and running, to access the CMD0604.  I
just couldn't get it to work.  It seemed that the iot and ioh addresses it
wound up with were wrong, though for the most part it seemed to "just work".
I suspect the information coming into pciide from the start was wrong, I
will probably look into this more tomorrow.

Here's the boot output:

NetBSD 1.3K (kernel) #33: Sat Mar  6 16:46:28 PST 1999
    woferry@ludicrous.wofme.com:/build/kernel
CPU: 750 (Revision 202)
real mem  = 134217728
avail mem = 119152640
using 1638 buffers containing 6709248 bytes of memory
mainbus0 (root)
cpu0 at mainbus0
pci0 at mainbus0 bus 0
pci0: i/o enabled, memory enabled
pchb0 at pci0 dev 0 function 0
pchb0: Motorola product 0x0002 (rev. 0x40)
ppb0 at pci0 dev 13 function 0: Digital Equipment DECchip 21154 PCI-PCI Bridge 
(rev. 0x02)
pci1 at ppb0 bus 1
pci1: i/o enabled, memory enabled
Texas Instruments product 0x8000 (Firewire serial bus, revision 0x02) at pci1 
dev 0 function 0 not configured
CMD Technology PCI0646 (IDE mass storage, interface 0x8f, revision 0x05) at 
pci1 dev 1 function 0 not configured
ofbio0 at pci1 dev 5 function 0: addr 0x80800000
interrupt-controller at obio0 offset 0x10 not configured
scsi at obio0 offset 0x10000 not configured
escc-legacy at obio0 offset 0x12000 not configured
zsc0 at obio0 offset 0x13000: irq 15,16
zstty0 at zsc0 channel 0
zstty1 at zsc0 channel 1
davbus at obio0 offset 0x14000 not configured
power-mgt at obio0 offset 0x0 not configured
fdc at obio0 offset 0x15000 not configured
adb0 at obio0 offset 0x16000 irq 18: 0 targets
aed0 at adb0 addr 0: ADB Event device
wdc0 at obio0 offset 0x20000 irq 13
atapibus0 at wdc0 channel 0
cd0 at atapibus0 drive 0: <MATSHITA CR-587, , 7S14> type 5 cdrom removable
cd0: drive supports PIO mode 4, DMA mode 2
sd0 at atapibus0 drive 1: <IOMEGA  ZIP 100      ATAPI, , 12.A> type 0 direct 
removable
sd0: drive offline
sd0: drive supports PIO mode 3
bm0 at obio0 offset 0x11000 irq 42,33: address xx:xx:xx:xx:xx:xx
nvram0 at obio0 offset 0x60000
ohci0 at pci1 dev 6 function 0: Opti RM861HA (rev. 0x10)
ohci0: interrupting at irq 1
ohci0: OHCI version 1.0, legacy support
usb0 at ohci0
uhub0 at usb0
uhub0: Opti OHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub0: 2 ports with 2 removable, self powered
uhub1 at uhub0 port 2
uhub1: NEC hub, class 9/0, rev 1.00/1.00, addr 2
uhub1: 4 ports with 4 removable, bus powered
ukbd0 at uhub1 port 1 configuration 1 interface 0
ukbd0: Alps Electric M2452, rev 1.00/1.01, addr 3, iclass 3/1
wskbd1 at ukbd0
ofb0 at pci0 dev 16 function 0: ATI Technologies product 0x5245
ofb0: 1024 x 768, 8bpp
wsdisplay0 at ofb0: console (std, vt100 emulation)
wscons: wskbd1 glued to wsdisplay0

	Now the machine is listing all of it's devices, but still isn't up and
running.  At this point I get the root device prompt, and the cursor is 
actually
shimmering (as if it is being redrawn continuously).  Not sure what this means.
I can't type anything at this point, and the caps lock on the keyboard does
nothing (FWIW).  I tried inserting an ADB keyboard rather than the USB keyboard
and the machine died during boot (in wskbd_load_keymap()??).

	I also tried a kernel with the root device set to bm0, my bootp
server saw a request from the G3 and responded, but the G3 simply reported
"bm0: device timeout" and eventually failed.

	Anybody else working on this?  Care to trade notes?  Any suggestions
if any of these problems sound familiar would be greatly appreciated.  Thanks
in advance.


                                                          Will Ferry

-----------------
woferry@iname.com