It's how OpenBIOS assigns MMIO addresses to pci devices. It does it
by going through them in order and map them starting from the base
address (with some allingment). I guess you could look at
drivers/pci.c I think it's in there somewhere.
I think it'd make more sense to just bolt the PCI devices to their
respective devfns that they also have on real hardware. Depending on
ordering magic that happens to give us different BAR maps by firmware
doesn't really give me a lot of confidence.
I don't understand what you mean. I don't want to rewrite PCI handling
code in OpenBIOS as that would have a higher chance of breaking
something else (OpenBIOS is used by other archs as well). Also it would
require more knowledge about the emulated hardware in OpenBIOS while it
aims to be a generic implementation and wants to reduce special cases
already in it. So I don't see a cleaner and easy way to do this. If I'm
missing something please tell me. On the other hand you've said before
that the mac99 machine is mostly a hack to be enough that some OS-es can
run with it. Why reordering some devices to get the right BAR maps not
fit in this hack?