Add info for possible grackle PCI devices

Devices that are not probed by Open Firmware might still be usable by Mac OS X or Linux if they can enumerate PCI devices without using Open Firmware's device tree.
A patch in nvramrc can make Open Firmware probe all the devices.
The point is that the emulation does not need to be limited to 5 slots.
This commit is contained in:
joevt 2022-08-22 01:52:48 -07:00
parent 753427f262
commit fca6cb11b6
2 changed files with 22 additions and 12 deletions

View File

@ -109,10 +109,6 @@ int initialize_gossamer(std::string& id)
grackle_obj->add_mmio_region(
0xFF000004, 4096, dynamic_cast<MMIODevice*>(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<PCIDevice*>(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<PCIDevice*>(gMachineObj->get_comp_by_name(gpu_name)));
16, dynamic_cast<PCIDevice*>(gMachineObj->get_comp_by_name("Heathrow")));
grackle_obj->pci_register_device(
18, dynamic_cast<PCIDevice*>(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<AthensClocks>(new AthensClocks(0x28)));

View File

@ -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.