pegasos2.rom.org = original firmware pegasos2.rom pegasos2_kas1e.rom - your new firmware version testkas1e.hdf = disk image with AmigaOS 4.1FE containing Update 3 (kernel 54.57) and standard boot via amigaboot.off testkas1e-2.hdf = disk image with AmigaOS 4.1FE containing Update 3 (kernel 54.57) and standard boot via bboot (bboot.fth) Tested on an ASUS RX 560 Dual Fan OC 2 GB graphics card and QEMU-11.
1. Booting on the original PEG2 firmware and standard system boot ".qemu-system-ppc -M pegasos2 -m 1024 -bios pegasos2.rom.org -rtc base=localtime -serial none -vga none -nographic -parallel none -device ide-hd,drive=hd-drive,bus=ide.0 -drive file=testkas1e.hdf,if=none, id=hd-drive,format=raw -device vfio-pci,host=01:00.0,x-vga=on,multifunction=on,bus=pci.0,x-igd-gms=0xff -device vfio-pci,host=01:00.1,bus=pci.0....."
The system does not boot; there is no firmware output screen on the RadeonRX card.
2. Booting on the original PEG2 firmware and booting the bboot system ".qemu-system-ppc -M pegasos2 -m 1024 -bios pegasos2.rom.org -rtc base=localtime -serial none -vga none -nographic -parallel none -device ide-hd,drive=hd-drive,bus=ide.0 -drive file=testkas1e-2.hdf,if=none, id=hd-drive,format=raw -device vfio-pci,host=01:00.0,x-vga=on,multifunction=on,bus=pci.0,x-igd-gms=0xff -device vfio-pci,host=01:00.1,bus=pci.0....."
The system boots correctly, no firmware output screen on the RadeonRX card screen -> https://ibb.co/YBJjdy4N
3. Booting on the new PEG2 firmware and standard system boot ".qemu-system-ppc -M pegasos2 -m 1024 -bios pegasos2_kas1e.rom -rtc base=localtime -serial stdio -vga none -nographic -parallel none -device ide-hd,drive=hd-drive,bus=ide.0 -drive file=testkas1e.hdf,if=none, id=hd-drive,format=raw -device vfio-pci,host=01:00.0,x-vga=on,multifunction=on,bus=pci.0,x-igd-gms=0xff -device vfio-pci,host=01:00.1,bus=pci.0....." The system does not boot; there is a firmware output screen on the RadeonRX card. screen -> https://ibb.co/8LGzjYyw
RTAS instantiate base=01EE8BE0 size=00002A90 blob=00002A90 src_hash=E220CAD1 dst_hash=E220CAD1 words=7CA802A6 48000225 4800011D 480000ED
RadeonRX (2): Identified the chipset as: POLARIS11
RadeonRX (2): Graphics card name is: Radeon RX Polaris11
RadeonRX (2): If - and only if - your card does not work or does not work optimally
please submit a bug report at:
http://www.amiga.org/developer/bugreports
Remember to include the driver version, and the following card details:
0x67FF:0x1043:0x052D:
and *please* describe the problems you are seeing in detail.
graphics.library AltiVec/VMX enabled
graphics.library PPC74xx optimizations enabled
RadeonRX (0): RadeonRX.chip 2.11 (26.1.2022)
RadeonRX (2): Identified the chipset as: POLARIS11
RadeonRX (2): Graphics card name is: Radeon RX Polaris11
RadeonRX (2): If - and only if - your card does not work or does not work optimally
please submit a bug report at:
http://www.amiga.org/developer/bugreports
Remember to include the driver version, and the following card details:
0x67FF:0x1043:0x052D:
and *please* describe the problems you are seeing in detail.
RadeonRX (0): ERROR: Could not get the video RAM resource range
Dump of context at 0x02252460
Trap type: DSI exception
Machine State (raw): 0x0000B030
Machine State (verbose): [ExtInt on] [Super] [FPU on] [IAT on] [DAT on]
Instruction pointer: in module RadeonRX.chip+0x0009DD5C (0x01D7055C)
Crashed task: exec.task (0x6FFAB240)
DSI verbose error description: Access not found in hash or BAT (page fault)
Access was a load operation
0: 01CEFB38 02220130 0020F800 00000000 00000000 00000000 01000800 02253B17
8: 022536CC 00000000 00000000 02220088 26022482 FFF045B4 6FF13000 6FFA4070
16: 60700000 6FFAB780 6FF1B000 6FF57150 6FF963A4 6FF66010 020230E0 00000001
24: 0000004F 6FFA4000 00000000 02410000 00000000 6FF03EEC 6FF03000 6FF03000
CR: 2A022824 XER: 00000000 CTR: 018370FC LR: 01CEFB38
DSISR: 40000000 DAR: 00000000
screen ->https://ibb.co/HDWggYfc In AOS4 debug mode, an infinite loop of the error “Could not get the video RAM resource range” appears continuously.
4. Booting on the new PEG2 firmware and starting the bboot system. ".qemu-system-ppc -M pegasos2 -m 1024 -bios pegasos2_kas1e.rom -rtc base=localtime -serial stdio -vga none -nographic -parallel none -device ide-hd,drive=hd-drive,bus=ide.0 -drive file=testkas1e-2.hdf, if=none,id=hd-drive,format=raw -device vfio-pci,host=01:00.0,x-vga=on,multifunction=on,bus=pci.0,x-igd-gms=0xff -device vfio-pci,host=01:00.1,bus=pci.0....." The system does not boot; there is a firmware output screen on the RadeonRX card. screen -> https://ibb.co/8LGzjYyw
In AOS4 debug mode, an infinite loop of the error “Could not get the video RAM resource range” appears continuously.
RTAS instantiate base=01EE8BE0 size=00002A90 blob=00002A90 src_hash=E220CAD1 dst_hash=E220CAD1 words=7CA802A6 48000225 4800011D 480000ED
RadeonRX (2): Identified the chipset as: POLARIS11
RadeonRX (2): Graphics card name is: Radeon RX Polaris11
RadeonRX (2): If - and only if - your card does not work or does not work optimally
please submit a bug report at:
http://www.amiga.org/developer/bugreports
Remember to include the driver version, and the following card details:
0x67FF:0x1043:0x052D: <name of board>
and *please* describe the problems you are seeing in detail.
graphics.library AltiVec/VMX enabled
graphics.library PPC74xx optimizations enabled
RadeonRX (0): RadeonRX.chip 2.11 (26.1.2022)
RadeonRX (2): Identified the chipset as: POLARIS11
RadeonRX (2): Graphics card name is: Radeon RX Polaris11
RadeonRX (2): If - and only if - your card does not work or does not work optimally
please submit a bug report at:
http://www.amiga.org/developer/bugreports
Remember to include the driver version, and the following card details:
0x67FF:0x1043:0x052D: <name of board>
and *please* describe the problems you are seeing in detail.
RadeonRX (0): ERROR: Could not get the video RAM resource range
Dump of context at 0x02252460
Trap type: DSI exception
Machine State (raw): 0x0000B030
Machine State (verbose): [ExtInt on] [Super] [FPU on] [IAT on] [DAT on]
Instruction pointer: in module RadeonRX.chip+0x0009DD5C (0x01D7055C)
Crashed task: exec.task (0x6FFAB240)
DSI verbose error description: Access not found in hash or BAT (page fault)
Access was a load operation
0: 01CEFB38 02220130 0020F800 00000000 00000000 00000000 01000800 02253B17
8: 022536CC 00000000 00000000 02220088 26022482 FFF045B4 6FF13000 6FFA4070
16: 60700000 6FFAB780 6FF1B000 6FF57150 6FF963A4 6FF66010 020230E0 00000001
24: 0000004F 6FFA4000 00000000 02410000 00000000 6FF03EEC 6FF03000 6FF03000
CR: 2A022824 XER: 00000000 CTR: 018370FC LR: 01CEFB38
DSISR: 40000000 DAR: 00000000
Now, when you say that "All graphics cards emulated in QEMU and supported by AOS4 work correctly with the original pegasos2.rom. ", it make it sounds , like with new firmware they stop working ? Or what ?
Here's a very simple example using sm501 in QEMU. Test code:
#### pegasos2-kas1e.rom # Here on the testkas1e.hdf disk the boot.fth file is actually amigaboot.of!!!! /home/markus/QEMU/qemu-11/bin/qemu-system-ppc -machine pegasos2 -rtc base=localtime -m 1024 -serial stdio -vga none -bios ./pegasos2_kas1e.rom -drive format=raw,if=none,id=rdb,file=testkas1e.hdf -device ide-hd,drive=rdb,bus=ide.0 -device sm501 # bboot.fth /home/markus/QEMU/qemu-11/bin/qemu-system-ppc -machine pegasos2 -rtc base=localtime -m 1024 -serial stdio -vga none -bios ./pegasos2_kas1e.rom -drive format=raw,if=none,id=rdb,file=testkas1e-2.hdf -device ide-hd,drive=rdb,bus=ide.0 -device sm501 #### pegasos2.rom # Here on the testkas1e.hdf disk the boot.fth file is actually amigaboot.of!!!! /home/markus/QEMU/qemu-11/bin/qemu-system-ppc -machine pegasos2 -rtc base=localtime -m 1024 -serial stdio -vga none -bios ./pegasos2.rom -drive format=raw,if=none,id=rdb,file=testkas1e.hdf -device ide-hd,drive=rdb,bus=ide.0 -device sm501 # bboot.fth /home/markus/QEMU/qemu-11/bin/qemu-system-ppc -machine pegasos2 -rtc base=localtime -m 1024 -serial stdio -vga none -bios ./pegasos2.rom -drive format=raw,if=none,id=rdb,file=testkas1e-2.hdf -device ide-hd,drive=rdb,bus=ide.0 -device sm501
Based on this example, it seems that pegasos2_kas1e.rom is trying to change something it shouldn't. Perhaps when it is unable to initialize VGABIOS, it tries to force a change? The original pegasos2.rom behaves correctly. test video -> https://youtu.be/ZSJgQdRSdZQ
@smarkusg Ok thanks, that enough for me to play with, will keep you informed once deal with or have more info about.
@mlehto Quote:
That part I didnt understood.What you mean you run POST? By setting vga0/vga1?
Any gfx card have it's x86 bios which we run over emulator, which do "POST" (basic init of video card, etc): so, we do this "emulator POST initialization" only for the card we choose (that only for firmware itself) , so to avoid extra time spend on card which is not the one to show firmware on.
@kas1e There is one more thing that might be useful: I tested pegasos2_kas1e.rom under QEMU on Linux. For the test, I used ‘-device virtio-gpu-pci’ 1. Test for pegasos2.rom – the system boots up and the kernel loads correctly
qemu-system-ppc -machine pegasos2 -rtc base=localtime -device virtio-gpu-pci -serial stdio -vga none -bios ../pegasos2.rom -drive format=raw,if=none,id=rdb1,file=test_linux_a.hdf -device ide-hd,drive=rdb1,bus=ide.0
boot hd:0 vmlinuz-5.15.132-peg root=/dev/sda2 video=uvesafb:1024x768-16, console=tty0
--
Preparing to boot Linux version 5.15.132-mc6-pegasos2 (markus@markus-HP-EliteBook-8470p) (ppc-linux-gnu-gcc (GCC) 11.1.0, GNU ld (GNU Binutils) 2.36) #1 Mon Aug 5 22:50:56 CEST 2024
Detected machine type: 00000500
command line: root=/dev/sda2 video=uvesafb:1024x768-16, console=tty0
memory layout at init:
memory_limit : 00000000 (16 MB aligned)
alloc_bottom : 0288e000
alloc_top : 20000000
alloc_top_hi : 20000000
rmo_top : 20000000
ram_top : 20000000
instantiating rtas at 0x0fbfd000... done
Fixing up missing ISA range on Pegasos...
Fixing up IDE interrupt on Pegasos...
Fixing up IDE class-code on Pegasos...
copying OF device tree...
Building dt strings...
Building dt structure...
Device tree strings 0x0288f000 -> 0x0288e0a4
Device tree struct 0x02890000 -> 0x00000000
Quiescing Open Firmware ...
Booting Linux via __start() @ 0x01814000 ...
Linux/PPC 5.15.1
--
2. Test for pegasos2_kas1e.rom – error when loading the Linux kernel. The system freezes/fails to boot.
I think it may be a problem with RTAS. The "instantiating rtas" line is missing in your failed case. RTAS has functions to read PCI config which I think these OSes use so maybe that's not correctly implemented. I think MorphOS does not use it but reads PCI config directly so you can cross check if MorphOS boots, then it's likely an RTAS problem.
@balaton You're right about that, because I did check it, but I didn't mention it here as the topic concerns AmigaOS4. Morphos boots up with the sm501 card.
@smarkusg I don't remember exactly, it was discussed on this forum somewhere, but I think Hans's changes for PCI bridge support in the latest unreleased pegasos2 kernel may also changed AmigaOS to not use RTAS for this so if @kas1e uses that kernel version, that may explain why this problem did not occur there. Earlier in this thread I think @kas1e also mentioned something about RTAS only supporting first PCI bus which is a limitation of how it is defined and cannot easily be changed because it's what the OSes depend on so I think it does not worth trying to fix it in firmware if it's already fixed in the kernel. For QEMU every device is on the PCI bus anyway so this would only be an issue with real machine with a bridge and the easiest way to support that is to release the fixed kernel not to break the firmware for it. Basically I think the OS can use RTAS to discover the devices on the PCI bus including the bridge but then needs to use its own bridge driver to access devices behind the bridge where it can't use RTAS any more.
In the version i send to smarkusg, RTAS was a blob-massive in c-array taken fully from original. I currently already rewrote it on readable assembler code, but so far it was original which i didn't touch (only lately). But it still of course can be problems as vga based code were new (original sources of smartfirmware didn't have any).
Quote:
I think MorphOS does not use it but reads PCI config directly so you can cross check if MorphOS boots,
Yes, morphos has it's own pci probe code, and it sure like that because when we for example check on what bus and where bridge and device in placed in morphos, it shows the logical: all usuall stuff on pci0/bus0, the AGP video as expected on pci1/bus0 , the bride in pci on pci0/bus0 as expected too, and the card behind the bridge is on pci0/bus1 , as expected too.
On amigaos4, even with fixed kernel, while bridge is on bus0 as expected, the RadeonHD card and it's Audio is on bus 2 , not on bus1 , who know why and what the reasons behind, but looks a bit unlogical.
Also, i do not get why in Ranger on pegasos2 , the whole list is Flat. I mean, for example if we take amigaone and sam boards, when you go to pci bus in ranger, and you check bridge , it have "+" which you can tick, and it will expand to show you what is on this bridge. On pegasos2 , there is no single "+" for anything, everything comes like a flat list. And i do not know why too , because if we use not RTAS in fixed kernel , but direct pci config access, then it should be no "flat" anymore. But maybe RTAS there involved again somehow, dunno.
And yes amigaos4 , originally (and in public kernel) just an RTAS usage. But RTAS on original smartfirmware have bugs as we know, and the ones which i find already is : any non zero PCI bus numbers, (like bus 1 behind a PCI2PCIe bridge), were for first encoded incorrectly and for second routed through the wrong config registers. So as result, read-pci-config and write-pci-config fail.
What Hans did is in 54.57 kernel add fix for 64/32bar issue (the one you fixed in BBOOT before), and this 54.57 kernel is out in public now with update3. Then, in 54.66 he add direct pci config access instead of RTAS , because, and of mention issues i find, and , because there also were issues with reading from wrong memory or something, so he always return 0xFFFFFFFF when trying to do so via RTAS, and then allocation of the memory always were failed (and, that by the way the same on Linux for pegasos2, they also code for RTAS, and also for card behind a bridge have 0x00000000 when trying to alloc memory for).
Now, we in situation of total mess with kernel : it's owned by AEON, and who know if ever any new kernel will be released. I mean, it can ends up that we will have no new kernel release ever.
And, with what we left now (at least as i see it):
RTAS should be fixed in firmware in any case, because
1). we have only 54.57 kernel, and if that will be last one (which we always should think about as a possible outcome), we need to work with that limitation. So, fixing RTAS and related bugs will make it works.
2). Morphos has it's own pci probing code, that ok, but Linux same fail with RTAS, of course, we can add code to linux for direct pci config register usage, but i do not want to , and ISOs of linux long ago done, no one will ever know there any update if i will fix it in linux source code, etc, so , fixing RTAS will help casual known .isos of linux for peg2 to work too with bridge.
So.. What i tried to do for now, is to fix properly RTAS, so os4's RTAS-usage code will have it all correctly, and we will have no needs for kernel update in that regard. But if ever there will be kernel update, then no problems too, as this one will works over direct pci config register usage.
On amigaos4, even with fixed kernel, while bridge is on bus0 as expected, the RadeonHD card and it's Audio is on bus 2 , not on bus1 , who know why and what the reasons behind, but looks a bit unlogical.
Just a guess but it may be confusion between pci and bus numbers. I mean PegasosII has pci0 and pci1 and maybe the bridge was added as pci2 not pci0/bus1?
Quote:
Now, we in situation of total mess with kernel : it's owned by AEON, and who know if ever any new kernel will be released. I mean, it can ends up that we will have no new kernel release ever.
AFAIK it's not AEon only Trevor personally so maybe he's more sensible about letting it released.
Quote:
So.. What i tried to do for now, is to fix properly RTAS, so os4's RTAS-usage code will have it all correctly, and we will have no needs for kernel update in that regard. But if ever there will be kernel update, then no problems too, as this one will works over direct pci config register usage.
If you can do that just by fixing the RTAS call alone then that's probably OK but if it also needs changing the device tree I would not go that far for this. But this may be trying to patch up bugs in Linux and AmigaOS kernel instead of fixing those.