diff --git a/machines/machinegossamer.cpp b/machines/machinegossamer.cpp index ec9a7a7..1e8e0db 100644 --- a/machines/machinegossamer.cpp +++ b/machines/machinegossamer.cpp @@ -109,10 +109,6 @@ int initialize_gossamer(std::string& id) grackle_obj->add_mmio_region( 0xFF000004, 4096, dynamic_cast(gMachineObj->get_comp_by_name("MachineID"))); - // register the Heathrow I/O controller with the PCI host bridge - grackle_obj->pci_register_device( - 16, dynamic_cast(gMachineObj->get_comp_by_name("Heathrow"))); - // allocate ROM region if (!grackle_obj->add_rom_region(0xFFC00000, 0x400000)) { LOG_F(ERROR, "Could not allocate ROM region!"); @@ -124,15 +120,11 @@ int initialize_gossamer(std::string& id) setup_ram_slot("RAM_DIMM_2", 0x56, GET_INT_PROP("rambank2_size")); setup_ram_slot("RAM_DIMM_3", 0x55, GET_INT_PROP("rambank3_size")); - // select built-in GPU name - std::string gpu_name = "AtiRageGT"; - if (id == "pmg3twr") { - gpu_name = "AtiRagePro"; - } - - // register built-in ATI Rage GPU with the PCI host bridge + // add pci devices grackle_obj->pci_register_device( - 18, dynamic_cast(gMachineObj->get_comp_by_name(gpu_name))); + 16, dynamic_cast(gMachineObj->get_comp_by_name("Heathrow"))); + grackle_obj->pci_register_device( + 18, dynamic_cast(gMachineObj->get_comp_by_name(id == "pmg3twr" ? "AtiRagePro" : "AtiRageGT"))); // add Athens clock generator device and register it with the I2C host gMachineObj->add_device("Athens", std::unique_ptr(new AthensClocks(0x28))); diff --git a/zdocs/grackle.md b/zdocs/grackle.md index 9a819ff..5349e08 100644 --- a/zdocs/grackle.md +++ b/zdocs/grackle.md @@ -22,3 +22,21 @@ Device ID: 0x0002 (MPC106) Within the Mac's own device tree, this is usually device 0. It also spans for 0x7F000000 bytes starting from 0x80000000. + +# Adding PCI devices to dingusppc + +The dingusppc CLI can add known PCI devices to a PCI slot (A1, B1, C1). + +Only the following device numbers are probed by Open Firmware: + +- @0 used by pci [grackle] +- @c slot PERCH interrupt 0x1c +- @d slot A1 interrupt 0x17 +- @e slot B1 interrupt 0x18 +- @f slot C1 interrupt 0x19 +- @10 used by mac-io [heathrow] which includes many devices with different interrupts +- @12 slot F1 interrupt 0x16 used by AtiRageGT or AtiRagePro + +With minor additions to source code, dingusppc can add a known PCI device to any device number between @1 and @1f except for @10 and @12. + +A nvramrc patch can make Open Firmware probe the other device numbers. An OS might be able to probe these other devices numbers even if they are not probed by Open Firmware.