Subject: Re: Mac mini curiosity
To: John Klos <john@ziaspace.com>
From: Tim Kelly <hockey@dialectronics.com>
List: port-macppc
Date: 04/12/2005 10:11:53
At 12:17 AM -0700 4/12/05, John Klos wrote:
>Regarding the Mac mini, I'm curious about something. Apple says that there
>is only one ATA bus:
>
>http://developer.apple.com/documentation/Hardware/Developer_Notes/Macintosh_CPU
>s-G4/MacMiniG4/index.html
>
>But in Matt Thomas' mini dmesg, there seems to be two busses:
>
>wdc0 at obio0 offset 0x20000 irq 24: DMA transfer
>atabus0 at wdc0 channel 0
>...
>wdc1 at pci2 dev 13 function 0: interrupting at irq 39
>atabus1 at wdc1 channel 0
>
>So the first bus, like the two extra non-fast USB busses, is just unused,
>right?

There's a device at

/pci@f2000000/mac-io@17/ata-3@20000

(pci1/mac-io/ata-3 is a short-cut)

that has properties indicating it is a keylargo-ata compatible device. This
is what is being picked up as wdc0.

One of the unused USB buses is Bluetooth. Although I've tried to associate
the OF node with the attachment and determine which ohci device Bluetooth
is (and for that matter, being 100% sure of which OF node is Bluetooth), I
have not been able to. There are OF aliases for the devices that ohci0 and
ohci1 attached to, but on the mini I am examining there are no physical
devices attached to it. I suspect that the device ohci2 is Bluetooth, even
though usb0 is attaching to it and claiming there is a keyboard and mouse
attached there. There reason I say this is that the developer note says
Bluetooth is at port 2 on the Intrepid ASIC and port 0 and port 1 are
unavailable. ohci0, ohci1, and ohci2 account for the three ports on the
ASIC.

The device
NEC USB Host Controller (USB serial bus, interface 0x20, revision 0x04)
at pci1 dev 27 function 2 not configured

appears to be USB 2.0. There are four USB entries in OF, and the fourth
one, which matches the above device and function id, is Enhanced Host
Controller Interface (ehci) compatible. This device shares device id with
ohci3 and ohci4 and in the OF tree are the same device that contain nodes
for keyboard and mouse devices.

Although I could be quite wrong, and often am, I think there is some
mismatch in device attachment with the USB. I think the proper attachment
point identification for keyboard and mouse should be at

ohci4 at pci1 dev 27 function 1: NEC USB Host Controller (rev. 0x43)
ohci4: interrupting at irq 63
ohci4: OHCI version 1.0
usb2 at ohci4: USB revision 1.0

At least, that is where OF puts some nodes for it. The whole "psuedo-hid"
(sic) stuff adds a twist to this, though.

The main thing that I'd like to determine is if ohci2 is actually Bluetooth
and if it is, unless the keyboard and mouse are also Bluetooth, fix device
attachments to Bluetooth to reflect the correct physical layout.

tim