[CDG5] Rage128 NDRV

BALATON Zoltan balaton at eik.bme.hu
Tue Jul 30 06:07:08 AWST 2019


On Mon, 29 Jul 2019, Daniel B-J wrote:
>> It may be that the FCode expects something that still does not work in OpenBIOS
>
> I'm not that familiar with OpenBIOS and QEMU source, but it looks like 
> OpenBIOS is incapable of loading fcode roms from pci devices. Most 
> notably, it does not have the "config-xx" words in the pci node. If it 
> did attempt to load fcode roms, it would not be successful with it.

Sure, it does not load FCode ROM automatically yet and instead patches in 
its own FCode and Bochs VGA driver for all VGA devices. (The NDRV patching 
can be disabled with -prom-env 'vga-ndrv?=false' option.) So to test with 
ATI FCode ROM we also need patches to implement the missing words:

https://mail.coreboot.org/hyperkitty/list/[email protected]/message/HAY6UNIIVAABZ4B73RNCKS4NBKKBWQFZ/

on top of this series:

https://mail.coreboot.org/hyperkitty/list/[email protected]/thread/5TKMESCXA5YNJELEA3KV5NQQHV6PMKMJ/

(that's why I've said it may be easier to wait a few weeks until these 
hopefully get committed upstream)

and then load FCode manually to test it:

0> dev /pci/ATY
0> " /pci/ATY" open-dev to my-self
0> load hd:\rom
0> load-base 40 + 1 byte-load

You probably also need the patches not yet merged in QEMU (currently top 
3) from here:

http://patchwork.ozlabs.org/project/qemu-devel/list/?submitter=16148

What OpenBIOS does do without patches though is to add an NDRV (just the 
Joy! binary without FCode) to device tree driver,APPL,MacOS,PowerPC 
property if you pass it as -device ati-vga,romfile=/path/to/ndrv.bin so 
you may try that but then it's possible that some attributes are missing 
from the device tree node that the FCode would have added so you may need 
to add those manually or otherwise.

> Fortunately, the Trampoline's parcels are just the thing for this kind 
> of problem. If you have a dump of the device tree properties from a 
> Rage128 in an actual machine, you can instruct the Trampoline to add 
> them to the device tree in QEMU.

You can do that or we can also patch OpenBIOS to do that. However first it 
should be identified which of these are needed. I've tried the FCode in 
the hope that it would set up the card as expected and add evertyhing 
needed to device tree then I don't have to try those properties one by one 
but it did not made NDRV happy so I'm not sure it's failing because of a 
missing property in the device-tree or something else. You can see the 
properties I got after running the FCode in the above message and here's a 
dump from a real machine for comparison:

http://nandra.segv.jp/NetBSD/G4.dump-device-tree.txt

or after boot:

http://www.magnicomp.com/sysinfo/examples/macosx-10.2-power/all_tree_msglevel_all.text

> Just use Display Name Registry to dump everything and use Elliot's tbxi 
> tool to set up the parcel structs.

I probably won't, I don't have a real machine nor time to try that but if 
someone does and finds out something please let me know.

I did try comparing the properties I got from the FCode on QEMU/OpenBIOS 
to real machine and found these:

https://mail.coreboot.org/hyperkitty/list/[email protected]/message/AG3R2N57YM3MF42AKKUKLEZWKJ724G6Q/

I've tried fixing the address and add ROM BAR to assigned-addresses but 
these did not seem to make a difference, the NDRV stopped at the same 
point.

> While in theory it's "easy", I'm not sure how to actually set up 
> parcels. It will definitely be easier than trying to get OpenBIOS to 
> load the fcode rom.

Not sure about parcels and tbxi but I can make changes to OpenBIOS and 
QEMU and already fixed running the FCode ROM so I could test that. But I'm 
not sure it's only missing properties that makes the NDRV stop but maybe 
something else is different from what it expects. There could be a lot of 
differences: ati-vga is not fully emulating the card yet and QEMU's mac99 
is only somewhat like a PowerMac3,1 but not completely so anything can be 
different from what the NDRV expects so it's hard to guess what it might 
not like and therefore fixing it by trial and error would take more time 
than I have.

Regards,
BALATON Zoltan


More information about the cdg5 mailing list