Real PowerMac3,1 has two PCI and one AGP buses that are emulated in QEMU but OpenBIOS currently only handles a single PCI bus and inits and puts info in the device tree of the second PCI bus only (which is where devices are connected). MorphOS is confused by this and erroneously uses the address of the first bus to access PCI config registers for devices on the second bus if the first pci node is missing from the device tree, This results in either not booting at all or devices mapped via MMIO may still appear to work but they may not be correctly initialised and some cards are not detected because of this. However, adding the other /pci node causes problems with other guests such as NetBSD. Fortunately MorphOS is happy as long as any node of pci device-type comes before the actual /pci entry.
Until proper support for multiple PCI buses is implemented, add such a dummy node in the device tree for QEMU mac99 to avoid this problem which fixes detecting PCI devices (such as USB) under MorphOS and allows it to boot.
Signed-off-by: BALATON Zoltan balaton@eik.bme.hu --- arch/ppc/qemu/init.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
diff --git a/arch/ppc/qemu/init.c b/arch/ppc/qemu/init.c index 45cd77e..ef8b27a 100644 --- a/arch/ppc/qemu/init.c +++ b/arch/ppc/qemu/init.c @@ -865,6 +865,16 @@ arch_of_init(void)
switch (machine_id) { case ARCH_MAC99: + /* This adds a dummy node of pci device-type before the actual /pci + * node which is needed for MorphOS to find devices on PCI bus. + * (Real machine has 3 /pci nodes but we only have one.) */ + fword("new-device"); + push_str("dummy-pci"); + fword("device-name"); + push_str("pci"); + fword("device-type"); + fword("finish-device"); + /* fall through */ case ARCH_MAC99_U3: /* The NewWorld NVRAM is not located in the MacIO device */ macio_nvram_init("/", 0);