On Thu, 7 Jan 2021, Philippe Mathieu-Daudé wrote: > On 1/7/21 2:15 AM, BALATON Zoltan wrote: >> On Wed, 6 Jan 2021, BALATON Zoltan wrote: >>> Hello, >>> >>> This is adding a new PPC board called pegasos2 currently posted as RFC >>> because it depends on not yet merged VT8231 emulation currently on the >>> list: >>> >>> https://patchew.org/QEMU/cover.1609967638.git.balaton@eik.bme.hu/ > > This note ^^^ ... > >>> >>> and may need some changes like a test case but I'm posting it now for >>> getting feedback on what's needed to merge this. More info on it can >>> be found at: >>> >>> https://osdn.net/projects/qmiga/wiki/SubprojectPegasos2 >>> >>> Currently it needs a firmware ROM image that I cannot include due to >>> original copyright holder (bPlan) did not release it under a free >>> licence but I have plans to write a replacement in the future. With >>> that firmware it can boot MorphOS now as: >>> >>> qemu-system-ppc -M pegasos2 -cdrom morphos.iso -device >>> ati-vga,romfile="" -serial stdio >>> >>> then enter "boot cd boot.img" at the firmware "ok" prompt as described >>> in the MorphOS.readme. To boot Linux use same command line with e.g. >>> -cdrom debian-8.11.0-powerpc-netinst.iso then enter >>> "boot cd install/pegasos" >>> >>> Patch 2 adds the actual board code after patch 1 adding MV64361 system >>> controller chip. The mv643xx.h header file is taken from Linux and >>> produces a bunch of checkpatch warnings due to different formatting >>> rules it follows, I'm not sure we want to adopt it or keep it as it is >>> given that it does not appear any more in recent Linux versions so we >>> could reformat it as it's unlikely to get updated in the future. >> >> Interestingly it applies for patchew while this was accidentally based >> on my previous series that has hw/ppc/Kconfig reverts so it does not >> apply on current master. > > ... can be passed as hint to patchew as a tag: > > Based-on: > >> Also missing a file so does not compile but >> other than that the content could be reviewed. I've now updated this repo: >> >> https://osdn.net/projects/qmiga/scm/git/qemu/tree/pegasos2/ >> >> which contains all the needed patches over QEMU master at one place in >> case somebody wants to try this. I'll send an updated version later >> after I get some feedback. >> >> The command lines above also need -bios /path/to/firmware.rom > > An integration test similar to the Fuloong PMON would be highly > appreciated :) > > https://www.mail-archive.com/qemu-devel@nongnu.org/msg752605.html This does not seem to be in master so I could copy and modify. I also have no way to test this test so maybe you could help writing and testing the necessary module. Basically we need to download a boot iso from here: https://www.morphos-team.net/morphos-3.15.iso For the pegasos2.rom the easiest may be to extract it from an update still available here: https://morph.zone/modules/newbb_plus/viewtopic.php?forum=11&topic_id=11892&post_id=129768&viewmode=flat&sortorder=0&showonepost=1 which links to http://web.archive.org/web/20071021223056/http://www.bplan-gmbh.de/up050404/up050404 that has the actual file as the original site does not have it any more (used to be here: http://www.bplan-gmbh.de/flash_update_for_pegasos_ii_en.html ). Then the rom can be extracted with: https://osdn.net/projects/qmiga/wiki/SubprojectPegasos2/attach/extract_rom_from_updater To get a binary with MD5 sum 3248e02596480f2dba5944bd219ecfad Then running it like this should produce the following output: $ qemu-system-ppc -M pegasos2 -bios pegasos2.rom -device ati-vga,romfile="" -cdrom morphos-3.15.iso -serial stdio PegasosII Boot Strap (c) 2002-2003 bplan GmbH Running on CPU PVR:000C0209 Enable L1 ICache... Done. Reading W83194 : FAILED. Setting Front Side Bus to 133MHz... FAILED. Configuring DDR... Done. Configuring PCI0... Done. Configuring PCI1... Done. Configuring ETH... Done. Releasing IDE reset ... Done. Configuring Legacy Devices Initializing KBD... Done. Testing 10000000 Bytes, Pass: 00000000 Failed: 00000000 RAM TEST (fill linear)... Done. FFFFFFFF SmartFirmware: cpu0: PowerPC,G4 CPUClock 599 Mhz BUSClock 133 Mhz (Version 0x000C,0x0209) no/bad nvramrc - performing default startup script channel 1 unit 0 : atapi | QEMU DVD-ROM | 2.5+ ATA device not present or not responding Welcome to SmartFirmware(tm) for bplan Pegasos2 version 1.1 (20040405172512) SmartFirmware(tm) Copyright 1996-2001 by CodeGen, Inc. All Rights Reserved. Pegasos BIOS Extensions Copyright 2001-2003 by bplan GmbH. All Rights Reserved. entering main read/eval loop... ok boot cd boot.img ISO-9660 filesystem: System-ID: "MORPHOS" Volume-ID: "MorphOSBoot" Root dir: "" flags=0x2 extent=0x20 size=0x1800 Memory used before SYS_Init: 9MB ABox 1.30 (2.7.2018) © 1999-2018 by Ralph Schmidt, Emmanuel Lesueur, Teemu Suikki, Harry Sintonen PCI ATA/ATAPI Driver@2: PIO Mode 4 PCI ATA/ATAPI Driver@2: UDMA Mode 5 ide.device@2: QEMU QEMU DVD-ROM ide.device@2: CDRom , found, bootable ide.device@2: Mount ide.device@2: Partition DosType 0x43444653 BootPri 127 Maybe you should wait for the "Welcome to SmartFirmware" banner or "entering main read/eval loop" followed by the "ok" prompt where you should send "boot cd boot.img" string then wait for the "ide.device@2: Mount " string to confirm it found the boot CD at which point it should be working which also tests that via-ide DMA works (it it doesn't it won't find the CD). This tests mv64361, vt8231 (including via-ide half-native mode). Also uses ati-vga but that's already tested by other tests and these texts on serial do not confirm it works with ati-vga, that's just so you can also see it boot if you let it running further. The romfile="" is needed to disable vgabios-ati.bin which the firmware cannot handle. Can you turn this into a python script implementing a test case based on your other similar tests? I think you have more experience with this and have a way to actually test it that I lack. Regards, BALATON Zoltan