On Tue, 17 Sep 2019, Artyom Tarasenko wrote:
If in your rom.bth you have something like " ${BP}/dev/video/build/cirrus.fc" " pci1013,b8" $add-dropin " ${BP}/dev/video/build/bga.fc" " class030000" $add-dropin " ${BP}/ofw/termemu/cp881-16.obf" " font" $add-dropin
the bga drop-in should be used as a fallback option for all the VGA devices. On the other hand if you have " ${BP}/dev/video/build/bga.fc" " pci1234,1111" $add-dropin the bga drop-in would be only loaded for the specific card.
I have:
" ${BP}/dev/video/build/cirrus.fc" " pci1013,b8" $add-dropin " ${BP}/dev/video/build/bga.fc" " pci1234,1111" $add-dropin " ${BP}/dev/video/build/video.fc" " class030000" $add-dropin
So I think it should use generic VGA for ati-vga. Maybe I should try with bga.fc as well but tried all of cirrus, stdvga and ati-vga (so all three drivers above) and none of these really work so there may be a problem somewhere else not related to VGA but VGA seems to be the first PCI card detected so that's where I see the problem.
I thought the problem may not be related to VGA though but maybe because not correctly initialising memory.
Btw, you can test a pci vga card with any pci machine, including 40p and x86.
But those don't provide the necessary FDT blob so won't work with my patched OFW. Currently only pegasos2 would work.
The memory detect code for other machines runs scrub&release and the slof fdt also has call to release which I've currently disabled because I don't know how it should work. Therefore memory may not be correctly initialised and this may be needed for pci detection to work?
Are you testing it with QEMU or on a real hardware? Under QEMU it should also work without scrubbing, and for the simplicity of the initial tests you can hard code the amount of RAM similarly as it's done for 40p model.
I only test with QEMU and this is meant to only work with QEMU. Also the point of passing memory size via FDT is to avoid hard coding it. It prints the correct size and sets the reg property of the /memory node but I'm not sure memory is properly set up for OpenFirmware's own memory management. If by scrubbing you mean set to 0 that's probably not needed for QEMU but what does release do? I think that part may still be needed and currently I don't do that because I don't know how to correctly use that word.
Regards, BALATON Zoltan