mac99(stage1): fix obtaining OHCI controller base address in qemu

openbios doesn't set up a devalias for usb, so under qemu use the full path to the OHCI controller
This commit is contained in:
Rairii 2024-11-07 19:13:12 +00:00
parent 7022d2ccd9
commit 12010b38e5

View File

@ -1445,10 +1445,10 @@ int _start(int argc, char** argv, tfpOpenFirmwareCall of) {
Desc->MrFlags = s_MrpFlags;
bool HasPciBridge = false;
bool InQemu = (s_MrpFlags & MRF_IN_EMULATOR) != 0;
{
// Get the PCI slot interrupts.
bool PciSuccess = false;
bool InQemu = (s_MrpFlags & MRF_IN_EMULATOR) != 0;
do {
// if pci1/@d/mac-io exists we need to get the vectors based on the bridge
OFHANDLE Pci1 = OFNULL;
@ -1513,6 +1513,9 @@ int _start(int argc, char** argv, tfpOpenFirmwareCall of) {
if (Usb != OFNULL) {
Desc->UsbOhciStart[1] = UsbGetBase(Usb);
}
} else if (InQemu) {
Usb = OfFindDevice("/pci/usb");
if (Usb != OFNULL) Desc->UsbOhciStart[0] = UsbGetBase(Usb);
}
}
}