On Sat, 13 Jul 2019, Jd Lyons wrote:
Try this with SLOF:
qemu-system-ppc64 -M pseries -m 512 -device ati-vga -prom-env 'vga-ndrv?=false' -device secondary-vga -cdrom ~/aty.iso
include evaluator.fs dev /pci/@1 load cdrom:,\rage “ /pci/@1” open-dev to my-self 4040 1 byte-load
Wait for it….
Works for me.
Indeed with these commands it does access the card. (You don't actually need secondary-vga, can use -serial stdio instead and I guess the vga-ndrv?=false also only makes sense for OpenBIOS so these can be omitted.)
With this on SLOF it does what it should I guess:
914a: [8bc] x8bc 0 0 2 1 1e786d20 914c: [926] x926 pci_cfg_read ati-vga 01:0 @0x14 -> 0x101 pci_cfg_read ati-vga 01:0 @0x4 -> 0x7 pci_cfg_write ati-vga 01:0 @0x4 <- 0x7 0 0 2 1 1e786d20 914e: [936] x936 ati_mm_write 4 0x0 MM_INDEX <- 0x50000000 ati_mm_write 4 0x4 MM_DATA <- 0x20005 ati_mm_write 4 0x50000000 unknown <- 0x20005 ati_mm_write 4 0x0 MM_INDEX <- 0x30000000 ati_mm_write 4 0x4 MM_DATA <- 0x40a3b371 ati_mm_write 4 0x30000000 unknown <- 0x40a3b371 ati_mm_write 4 0x0 MM_INDEX <- 0x34000000 ati_mm_write 4 0x4 MM_DATA <- 0x1f000000 ati_mm_write 4 0x34000000 unknown <- 0x1f000000
and so on. It uses indexed access to card registers but the values look wrong. Maybe they are byte swapped so there's an endianness problem somewhere? It does end eventually and adds some properties to device node.
Now the question is why values are the wrong endianness and where are they swapped? PCI devices are little endian by default and that's what the QEMU ati-vga emulates and other drivers normally use (even on ppc, Linux, MorphOS can access the card). The real hardware does have some facilities for big-endian access and an ATI ROM on PowerPC may use that but I don't see how it would enable that. as it only writes one bit before sending data. PCI config reg 0x14 is BAR1 where IO space is that aliases first 256 bytes of mmio regs. (The rest can be accessed via index/data.) This is what it maps in. Then PCI config reg 4 is Command where it turns on bits 0-2 which are enabling io access, mem access and bus master. I don't see what might enable big endian aperture. Can this be that on a Mac this is set by OpenFirmware somehow or SLOF may have some defaults for this?
Regards, BALATON Zoltan