On Tue, Sep 17, 2019 at 4:19 PM BALATON Zoltan balaton@eik.bme.hu wrote:
On Tue, 17 Sep 2019, Artyom Tarasenko wrote:
On Fri, Aug 23, 2019 at 1:55 AM BALATON Zoltan balaton@eik.bme.hu wrote:
Currently this gets to an OFW prompt but detecting pci devices does not work yet. With the default (for pegasos2) cirrus vga a /pci/vga device node is created but I think it stops during that and does not detect any more pci devices. With -vga std (that's the normal QEMU Bochs compatible VGA) it freezes during init-ing the card
You can use the serial to debug the vga. To initialize the vga card you can use
select /vga
if the above hangs, you can turn on debugging of the specific words: dev /vga debug init ( or open or whatever word you want to debug and after that) select /vga
I think the simplest /vga driver is Bochs VGA (bga.fth), since it knows that device is virtual, it doesn't set up clock generator etc.
and with my experimental -vga none -device ati-vga (that's also upstream in QEMU now) an unnamed node is created so something is wrong with PCI probing at the moment. Could it be because not properly doing memory scrub&release?
For some reason (copyright I guess) the ATI drives were never released. You may try extracting the drop-in from the physical ROM if it was built as a drop-in. Otherwise creating an unnamed node is a good sign: your PCI enumerating code is somewhat working
Thanks for the suggestion I'll try to get more debugging output to find where it hangs when I'll have time (not now). The bochs driver should also work with the QEMU ati-vga emulation because it also supports Bochs VBE (that's how it works with OpenBIOS) but I'm not sure what driver OFW tries to use for it. Should also work as generic VGA so no specific ati driver shuold be needed to get some picture. (OSes I may want to boot have their own drivers so from OFW only basic support is enough,)
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 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.
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.