PPC IBM 40p PReP emulation
cover PPC IBM 40p PReP emulation
Hi,
This patchset adds the emulation of the IBM RS/6000 7020 (40p). The real machine is able to run AIX (up to 4.3.3), Windows NT (up to 4.0 SP1), the beta of OS/2 PowerPC, Solaris, Linux, NetBSD/PReP ...
I've tested current emulation with Open Firmware PReP and with official firmware. Patch 2 has been of a great help when using official firmware. However, if required, I can drop it.
Linux kernel runs.
Windows NT starts up to the point where it wants to change endianness. Other OSes have not been tested.
To test, download firmware a http://tyom.de/qprepofw-serial-svn-3738.rom . Thanks Artyom! Then, run:
qemu-system-ppc -M 40p -bios qprepofw-serial-svn-3738.rom -readconfig ibm_40p.cfg -serial stdio
Note that you can't natively boot from a hard disk using Open Firmware, as 40p storage is SCSI.
Hervé
Hervé Poussineau (4):
prep: QOM'ify System I/O
prep: add RS/6000 debug device
prep: add IBM RS/6000 7020 (40p) memory controller
prep: add IBM RS/6000 7020 (40p) machine emulation
default-configs/ppc-softmmu.mak | 4 + docs/ibm_40p.cfg | 42 ++++++ hw/ppc/Makefile.objs | 3 + hw/ppc/prep.c | 99 +++++++++++++ hw/ppc/prep_systemio.c | 300 ++++++++++++++++++++++++++++++++++++++++ hw/ppc/rs6000_debug.c | 260 ++++++++++++++++++++++++++++++++++ hw/ppc/rs6000_mc.c | 229 ++++++++++++++++++++++++++++++ trace-events | 11 ++ 8 files changed, 948 insertions(+) create mode 100644 docs/ibm_40p.cfg create mode 100644 hw/ppc/prep_systemio.c create mode 100644 hw/ppc/rs6000_debug.c create mode 100644 hw/ppc/rs6000_mc.c
Signature · 1 line
2.1.4
PATCH 1/4 prep: QOM'ify System I/O
Part of the functionality is extracted from hw/ppc/prep.c. Also add support for board identification/equipment registers.
--- hw/ppc/Makefile.objs | 1 + hw/ppc/prep_systemio.c | 300 +++++++++++++++++++++++++++++++++++++++++++++++++ trace-events | 4 + 3 files changed, 305 insertions(+) create mode 100644 hw/ppc/prep_systemio.c
hw/ppc/Makefile.objs +1 -0
@@ -12,6 +12,7 @@ obj-y += ppc405_boards.o ppc4xx_devs.o ppc405_uc.o ppc440_bamboo.o obj-y += ppc4xx_pci.o # PReP obj-$(CONFIG_PREP) += prep.o +obj-$(CONFIG_PREP) += prep_systemio.o # OldWorld PowerMac obj-$(CONFIG_MAC) += mac_oldworld.o # NewWorld PowerMac
hw/ppc/prep_systemio.c new file +300 -0
300 lines not on this page · raw message
trace-events +4 -0
@@ -883,6 +883,10 @@ pc87312_info_ide(uint32_t base) "base 0x%x" pc87312_info_parallel(uint32_t base, uint32_t irq) "base 0x%x, irq %u" pc87312_info_serial(int n, uint32_t base, uint32_t irq) "id=%d, base 0x%x, irq %u" +# hw/ppc/prep_systemio.c +prep_systemio_read(uint32_t addr, uint32_t val) "read addr=%x val=%x" +prep_systemio_write(uint32_t addr, uint32_t val) "write addr=%x val=%x" + # hw/scsi/vmw_pvscsi.c pvscsi_ring_init_data(uint32_t txr_len_log2, uint32_t rxr_len_log2) "TX/RX rings logarithms set to %d/%d" pvscsi_ring_init_msg(uint32_t len_log2) "MSG ring logarithm set to %d"
Signature · 1 line
2.1.4
PATCH 2/4 prep: add RS/6000 debug device
In reply to Hervé Poussineau--- default-configs/ppc-softmmu.mak | 1 + hw/ppc/Makefile.objs | 1 + hw/ppc/rs6000_debug.c | 260 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 262 insertions(+) create mode 100644 hw/ppc/rs6000_debug.c
default-configs/ppc-softmmu.mak +1 -0
@@ -47,4 +47,5 @@ CONFIG_ETSEC=y CONFIG_LIBDECNUMBER=y # For PReP CONFIG_MC146818RTC=y +CONFIG_RS6000_DEBUG=y CONFIG_ISA_TESTDEV=y
hw/ppc/Makefile.objs +1 -0
@@ -13,6 +13,7 @@ obj-y += ppc4xx_pci.o # PReP obj-$(CONFIG_PREP) += prep.o obj-$(CONFIG_PREP) += prep_systemio.o +obj-${CONFIG_RS6000_DEBUG} += rs6000_debug.o # OldWorld PowerMac obj-$(CONFIG_MAC) += mac_oldworld.o # NewWorld PowerMac
hw/ppc/rs6000_debug.c new file +260 -0
260 lines not on this page · raw message
Signature · 1 line
2.1.4
PATCH 3/4 prep: add IBM RS/6000 7020 (40p) memory controller
In reply to Hervé Poussineau--- default-configs/ppc-softmmu.mak | 1 + hw/ppc/Makefile.objs | 1 + hw/ppc/rs6000_mc.c | 229 ++++++++++++++++++++++++++++++++++++++++ trace-events | 7 ++ 4 files changed, 238 insertions(+) create mode 100644 hw/ppc/rs6000_mc.c
default-configs/ppc-softmmu.mak +1 -0
@@ -48,4 +48,5 @@ CONFIG_LIBDECNUMBER=y # For PReP CONFIG_MC146818RTC=y CONFIG_RS6000_DEBUG=y +CONFIG_RS6000_MC=y CONFIG_ISA_TESTDEV=y
hw/ppc/Makefile.objs +1 -0
@@ -14,6 +14,7 @@ obj-y += ppc4xx_pci.o obj-$(CONFIG_PREP) += prep.o obj-$(CONFIG_PREP) += prep_systemio.o obj-${CONFIG_RS6000_DEBUG} += rs6000_debug.o +obj-${CONFIG_RS6000_MC} += rs6000_mc.o # OldWorld PowerMac obj-$(CONFIG_MAC) += mac_oldworld.o # NewWorld PowerMac
hw/ppc/rs6000_mc.c new file +229 -0
229 lines not on this page · raw message
trace-events +7 -0
@@ -887,6 +887,13 @@ pc87312_info_serial(int n, uint32_t base, uint32_t irq) "id=%d, base 0x%x, irq % prep_systemio_read(uint32_t addr, uint32_t val) "read addr=%x val=%x" prep_systemio_write(uint32_t addr, uint32_t val) "write addr=%x val=%x" +# hw/ppc/rs6000_mc.c +rs6000mc_id_read(uint32_t addr, uint32_t val) "read addr=%x val=%x" +rs6000mc_presence_read(uint32_t addr, uint32_t val) "read addr=%x val=%x" +rs6000mc_size_read(uint32_t addr, uint32_t val) "read addr=%x val=%x" +rs6000mc_size_write(uint32_t addr, uint32_t val) "write addr=%x val=%x" +rs6000mc_parity_read(uint32_t addr, uint32_t val) "read addr=%x val=%x" + # hw/scsi/vmw_pvscsi.c pvscsi_ring_init_data(uint32_t txr_len_log2, uint32_t rxr_len_log2) "TX/RX rings logarithms set to %d/%d" pvscsi_ring_init_msg(uint32_t len_log2) "MSG ring logarithm set to %d"
Signature · 1 line
2.1.4
PATCH 4/4 prep: add IBM RS/6000 7020 (40p) machine emulation
In reply to Hervé PoussineauMachine is very simple (only one PCI host bridge and an ISA bridge). Provide a ibm_40p.cfg file to add more devices to this machine.
Syntax is:
qemu-system-ppc -M 40p -readconfig ibm_40p.cfg
--- default-configs/ppc-softmmu.mak | 2 + docs/ibm_40p.cfg | 42 +++++++++++++++++ hw/ppc/prep.c | 99 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 143 insertions(+) create mode 100644 docs/ibm_40p.cfg
default-configs/ppc-softmmu.mak +2 -0
@@ -19,6 +19,7 @@ CONFIG_I82378=y CONFIG_PC87312=y CONFIG_MACIO=y CONFIG_PCSPK=y +CONFIG_CS4231A=y CONFIG_CUDA=y CONFIG_ADB=y CONFIG_MAC_NVRAM=y
@@ -46,6 +47,7 @@ CONFIG_PLATFORM_BUS=y CONFIG_ETSEC=y CONFIG_LIBDECNUMBER=y # For PReP +CONFIG_VGA_S3=y CONFIG_MC146818RTC=y CONFIG_RS6000_DEBUG=y CONFIG_RS6000_MC=y
docs/ibm_40p.cfg new file +42 -0
42 lines not on this page · raw message
hw/ppc/prep.c +99 -0
114 lines not on this page · raw message
Signature · 1 line
2.1.4
Hi Hervé,
Quoted 3 lines · Hervé Poussineau
Hi,
This patchset adds the emulation of the IBM RS/6000 7020 (40p).
Well done! Congratulations on a good job!
Quoted 11 lines
The real machine is
able to run AIX (up to 4.3.3), Windows NT (up to 4.0 SP1), the beta of OS/2 PowerPC, Solaris, Linux, NetBSD/PReP ...I've tested current emulation with Open Firmware PReP and with official firmware. Patch 2 has been of a great help when using official firmware. However, if required, I can drop it.
Linux kernel runs.
Windows NT starts up to the point where it wants to change endianness. Other OSes have not been tested.
Solaris would likely have the same problem: it's little-endian on PReP.
Quoted 1 line
To test, download firmware a http://tyom.de/qprepofw-serial-svn-3738.rom . Thanks Artyom!
You are welcome. I see your machine is using a S3 graphic card. If you like I can add a driver for it.
Not within the next days though. Out of curiosity: is the proprietary firmware also able to use a Cirrus Logic card?
Regards,
Artyom
Quoted 30 lines
Then, run:
qemu-system-ppc -M 40p -bios qprepofw-serial-svn-3738.rom -readconfig ibm_40p.cfg -serial stdioNote that you can't natively boot from a hard disk using Open Firmware, as 40p storage is SCSI.
Hervé
Hervé Poussineau (4):
prep: QOM'ify System I/O
prep: add RS/6000 debug device
prep: add IBM RS/6000 7020 (40p) memory controller
prep: add IBM RS/6000 7020 (40p) machine emulationdefault-configs/ppc-softmmu.mak | 4 + docs/ibm_40p.cfg | 42 ++++++ hw/ppc/Makefile.objs | 3 + hw/ppc/prep.c | 99 +++++++++++++ hw/ppc/prep_systemio.c | 300 ++++++++++++++++++++++++++++++++++++++++ hw/ppc/rs6000_debug.c | 260 ++++++++++++++++++++++++++++++++++ hw/ppc/rs6000_mc.c | 229 ++++++++++++++++++++++++++++++ trace-events | 11 ++ 8 files changed, 948 insertions(+) create mode 100644 docs/ibm_40p.cfg create mode 100644 hw/ppc/prep_systemio.c create mode 100644 hw/ppc/rs6000_debug.c create mode 100644 hw/ppc/rs6000_mc.c--
2.1.4
Signature · 4 lines
Regards, Artyom Tarasenko SPARC and PPC PReP under qemu blog: http://tyom.blogspot.com/search/label/qemu
Hi Artyom,
Quoted 21 lines · Artyom Tarasenko
Hi Hervé,
Quoted 3 lines · Hervé Poussineau
Hi,
This patchset adds the emulation of the IBM RS/6000 7020 (40p).
Well done! Congratulations on a good job!
Quoted 11 lines
The real machine is
able to run AIX (up to 4.3.3), Windows NT (up to 4.0 SP1), the beta of OS/2 PowerPC, Solaris, Linux, NetBSD/PReP ...I've tested current emulation with Open Firmware PReP and with official firmware. Patch 2 has been of a great help when using official firmware. However, if required, I can drop it.
Linux kernel runs.
Windows NT starts up to the point where it wants to change endianness. Other OSes have not been tested.
Quoted 8 lines
Solaris would likely have the same problem: it's little-endian on PReP.
Quoted 1 line
To test, download firmware a http://tyom.de/qprepofw-serial-svn-3738.rom . Thanks Artyom!
You are welcome. I see your machine is using a S3 graphic card. If you like I can add a driver for it.
Not within the next days though. Out of curiosity: is the proprietary firmware also able to use a Cirrus Logic card?
No, it only handles S3 graphic cards, as is using some IBM/8514 commands.
It would probably be more interesting to add support for LSI 53c810 SCSI card, if possible.
Regards,
Hervé