Subject: Re: personal impression of issues on netbsd/macppc
To: Tim Kelly <hockey@dialectronics.com>
From: Michael <macallan18@earthlink.net>
List: port-macppc
Date: 11/19/2004 16:31:03
Hello,

> As far as using I/O or memory space on PowerPC PCI, it's just easier to
> use the memory space directly.
I know. But the problem with X is that it wants to use the VGA registers on VGA-compatible hardware so we NEED to access IO space. On my S900 that works like a charm. 

> The thing to keep in mind is that there is not an exact correlation
> between the PCI spec and the Open Firmware implementation. During
> discovery process, work with OF and compensate for bugs. Then use that
> information to deal with PCI.
Well, I never bothered with that directly - the information how to access PCI IO space is encoded into the pa_iot member of struct pci_attach_args. That's what I use and so far it works.

> Don't use the I/O, use the memory space.
You don't always have a choice. The DEC 21140 on my E100 board offers both, memory and IO - and both work, it defaults to memory though. A cheap NE2000 lookalike offers only IO - works fine for me.

> You'll notice that few of the spaces are ever tagged I/O. So while
> Apple says there is I/O space, it is smoke and mirrors when it comes to
> their own chips. From what I have gathered in reading threads on mailing
> lists, things work better on PCI cards if you skip the I/O portion and
> go straight to memory. Much faster, plus better compatibility with the
> architecture. There are some built in tags that should use memory space
> instead of I/O, and it'd be a good idea to stay consistent with those
> for the macppc port.
Yes, that's all nice and true and such, but it doesn't really help with the X11 problem. 
To make it abundantly clear: there is no way around IO space to access certain registers on certain VGA-compatible graphics boards, like almost all PCI and AGP cards, and if memory mapped IO can be used depends on the XFree driver, some know how to access memory-mapped registers, some don't. Instead of fixing all the drivers and probably breaking things on other platforms I think it's way more sensible to provide something that allows them to run unchanged, which is exactly what my patches do. 
But apparently we're talking about different things again :P

have fun
Michael