This patchset is loosely based on earlier work by BALATON Zoltan balaton@eik.bme.hu and provides basic infrastructure to allow OpenBIOS to enable PCI device bus mastering.
Following on from discussions on the QEMU mailing list, it seems that Apple's OF enables bus mastering for some PCI devices by default, and as a result some buggy drivers forget to explicitly enable it and hence these devices fail under QEMU's emulation.
The first 2 patches add the basic support routines while the last patch enables bus mastering for the rtl8139 card on Apple PPC machines which is required for some OS 9, OS X and MorphOS drivers.
Signed-off-by: Mark Cave-Ayland mark.cave-ayland@ilande.co.uk
Mark Cave-Ayland (3): pci: introduce ob_pci_enable_bus_master() function pci: add PCI database entry for rtl8139 network card pci: add rtl8139_config_cb() to configure rtl8139 network cards
drivers/pci.c | 27 +++++++++++++++++++++++++++ drivers/pci_database.c | 6 ++++++ drivers/pci_database.h | 3 +++ include/drivers/pci.h | 1 + 4 files changed, 37 insertions(+)
This will activate the bus mastering bit for the device represented by the given PCI configuration.
Signed-off-by: Mark Cave-Ayland mark.cave-ayland@ilande.co.uk --- drivers/pci.c | 12 ++++++++++++ drivers/pci_database.h | 2 ++ 2 files changed, 14 insertions(+)
diff --git a/drivers/pci.c b/drivers/pci.c index eec6a20..8ceb9c1 100644 --- a/drivers/pci.c +++ b/drivers/pci.c @@ -919,6 +919,18 @@ int usb_ohci_config_cb(const pci_config_t *config) return 0; }
+void ob_pci_enable_bus_master(const pci_config_t *config) +{ + /* Enable bus mastering for the PCI device */ + uint16_t cmd; + pci_addr addr = PCI_ADDR( + PCI_BUS(config->dev), PCI_DEV(config->dev), PCI_FN(config->dev)); + + cmd = pci_config_read16(addr, PCI_COMMAND); + cmd |= PCI_COMMAND_BUS_MASTER; + pci_config_write16(addr, PCI_COMMAND, cmd); +} + static void ob_pci_add_properties(phandle_t phandle, pci_addr addr, const pci_dev_t *pci_dev, const pci_config_t *config, int num_bars) diff --git a/drivers/pci_database.h b/drivers/pci_database.h index 7f053d8..9e8dc05 100644 --- a/drivers/pci_database.h +++ b/drivers/pci_database.h @@ -55,3 +55,5 @@ static inline int pci_compat_len(const pci_dev_t *dev) extern const pci_dev_t *pci_find_device(uint8_t class, uint8_t subclass, uint8_t iface, uint16_t vendor, uint16_t product); + +extern void ob_pci_enable_bus_master(const pci_config_t *config);
This is taken from a patch submitted earlier by BALATON Zoltan balaton@eik.bme.hu.
Signed-off-by: Mark Cave-Ayland mark.cave-ayland@ilande.co.uk --- drivers/pci_database.c | 6 ++++++ include/drivers/pci.h | 1 + 2 files changed, 7 insertions(+)
diff --git a/drivers/pci_database.c b/drivers/pci_database.c index 0070a78..65cff27 100644 --- a/drivers/pci_database.c +++ b/drivers/pci_database.c @@ -129,6 +129,12 @@ static const pci_dev_t eth_devices[] = { NULL, "ethernet", }, { + PCI_VENDOR_ID_REALTEK, PCI_DEVICE_ID_REALTEK_RTL8139, + NULL, "rtl8139", "RTL8139 PCI", "pci10ec,8139\0", + 0, 0, 0, + NULL, "ethernet", + }, + { /* Virtio-network controller */ PCI_VENDOR_ID_REDHAT_QUMRANET, PCI_DEVICE_ID_VIRTIO_NET, NULL, "virtio-net", NULL, diff --git a/include/drivers/pci.h b/include/drivers/pci.h index 2eb5685..5772b79 100644 --- a/include/drivers/pci.h +++ b/include/drivers/pci.h @@ -202,6 +202,7 @@ extern const pci_arch_t *arch;
#define PCI_VENDOR_ID_REALTEK 0x10ec #define PCI_DEVICE_ID_REALTEK_RTL8029 0x8029 +#define PCI_DEVICE_ID_REALTEK_RTL8139 0x8139
#define PCI_VENDOR_ID_QEMU 0x1234 #define PCI_DEVICE_ID_QEMU_VGA 0x1111
If we are running on an Apple PPC platform, enable bus mastering for this card. This is because it seems that Apple's OF implementation enables bus mastering for rtl8139 cards by default with the result that several drivers forget to explicitly enable it, causing them to fail under QEMU.
This has been reported necessary for various rtl8139 drivers under OS 9, OS X and MorphOS.
Signed-off-by: Mark Cave-Ayland mark.cave-ayland@ilande.co.uk --- drivers/pci.c | 15 +++++++++++++++ drivers/pci_database.c | 2 +- drivers/pci_database.h | 1 + 3 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/drivers/pci.c b/drivers/pci.c index 8ceb9c1..3abd5bf 100644 --- a/drivers/pci.c +++ b/drivers/pci.c @@ -567,6 +567,21 @@ int eth_config_cb (const pci_config_t *config) return 0; }
+int rtl8139_config_cb(const pci_config_t *config) +{ +#ifdef CONFIG_PPC + /* Apple's OF seemingly enables bus mastering on some cards by + * default, which means that some buggy drivers forget to + * explicitly set it (OS X, MorphOS). Mimic this behaviour so + * that these buggy drivers work under emulation. */ + if (is_apple()) { + ob_pci_enable_bus_master(config); + } +#endif + + return eth_config_cb(config); +} + static inline void pci_decode_pci_addr(pci_addr addr, int *flags, int *space_code, uint32_t *mask) { diff --git a/drivers/pci_database.c b/drivers/pci_database.c index 65cff27..b220586 100644 --- a/drivers/pci_database.c +++ b/drivers/pci_database.c @@ -132,7 +132,7 @@ static const pci_dev_t eth_devices[] = { PCI_VENDOR_ID_REALTEK, PCI_DEVICE_ID_REALTEK_RTL8139, NULL, "rtl8139", "RTL8139 PCI", "pci10ec,8139\0", 0, 0, 0, - NULL, "ethernet", + rtl8139_config_cb, "ethernet", }, { /* Virtio-network controller */ diff --git a/drivers/pci_database.h b/drivers/pci_database.h index 9e8dc05..1cc1e56 100644 --- a/drivers/pci_database.h +++ b/drivers/pci_database.h @@ -39,6 +39,7 @@ extern int bridge_config_cb(const pci_config_t *config); extern int ebus_config_cb(const pci_config_t *config); extern int i82378_config_cb(const pci_config_t *config); extern int usb_ohci_config_cb(const pci_config_t *config); +extern int rtl8139_config_cb(const pci_config_t *config);
static inline int pci_compat_len(const pci_dev_t *dev) {
Hello Mark,
The recent changes in openbios and qemu really improved the support of 10.4.11. I can now logon on the raw disk I have and the system looks pretty good and stable. All these issues are gone :
https://www.coreboot.org/pipermail/openbios/2016-June/009436.html
I still need :
-prom-env boot-device=hd:3,\System\Library\CoreServices\BootX
to boot, but I suppose this is due to the state of the disk which also has a macosx 9 on it.
However, the network is not detected. This is curious as the command 'ioreg' does list a rtl8139 with this patchset, see below, and I suppose the driver is correct :
28 1 0x55c000 0x1f000 0x1e000 com.apple.iokit.IONetworkingFamily (1.5.0) <6 5 4 3 2> 29 0 0x57b000 0x5000 0x4000 com.apple.driver.AppleRTL8139Ethernet (1.1.0) <28 16 5 4 3 2>
Is there anything I could do to learn a bit more why the adapter is not showing in the system ? I did not find anything in the osx logs.
Thanks, C.
+-o Root <class IORegistryEntry, retain count 6> +-o PowerMac3,1 <class IOPlatformExpertDevice, registered, matched, active, busy 1, retain count 20> +-o Core99PE <class Core99PE, !registered, !matched, active, busy 1, retain count 14> | +-o IOPMrootDomain <class IOPMrootDomain, registered, matched, active, busy 0, retain count 29> | | +-o IORootParent <class IORootParent, !registered, !matched, active, busy 0, retain count 8> | | +-o RootDomainUserClient <class RootDomainUserClient, !registered, !matched, active, busy 0, retain count 5> | | +-o RootDomainUserClient <class RootDomainUserClient, !registered, !matched, active, busy 0, retain count 5> | | +-o RootDomainUserClient <class RootDomainUserClient, !registered, !matched, active, busy 0, retain count 5> | | +-o RootDomainUserClient <class RootDomainUserClient, !registered, !matched, active, busy 0, retain count 5> | | +-o RootDomainUserClient <class RootDomainUserClient, !registered, !matched, active, busy 0, retain count 5> | | +-o RootDomainUserClient <class RootDomainUserClient, !registered, !matched, active, busy 0, retain count 5> | | +-o RootDomainUserClient <class RootDomainUserClient, !registered, !matched, active, busy 0, retain count 5> | | +-o RootDomainUserClient <class RootDomainUserClient, !registered, !matched, active, busy 0, retain count 5> | | +-o RootDomainUserClient <class RootDomainUserClient, !registered, !matched, active, busy 0, retain count 5> | | +-o RootDomainUserClient <class RootDomainUserClient, !registered, !matched, active, busy 0, retain count 5> | | +-o RootDomainUserClient <class RootDomainUserClient, !registered, !matched, active, busy 0, retain count 5> | | +-o RootDomainUserClient <class RootDomainUserClient, !registered, !matched, active, busy 0, retain count 5> | | +-o RootDomainUserClient <class RootDomainUserClient, !registered, !matched, active, busy 0, retain count 5> | | +-o RootDomainUserClient <class RootDomainUserClient, !registered, !matched, active, busy 0, retain count 5> | | +-o RootDomainUserClient <class RootDomainUserClient, !registered, !matched, active, busy 0, retain count 5> | | +-o RootDomainUserClient <class RootDomainUserClient, !registered, !matched, active, busy 0, retain count 5> | +-o IOPMUSB99 <class IOPMUSB99, !registered, !matched, active, busy 0, retain count 8> | +-o IOPMSlots99 <class IOPMSlots99, !registered, !matched, active, busy 0, retain count 7> | +-o options <class IODTNVRAM, registered, matched, active, busy 0, retain count 6> | +-o PowerPC,G4@0 <class IOPlatformDevice, registered, matched, active, busy 0, retain count 8> | | +-o Core99CPU <class Core99CPU, registered, matched, active, busy 0, retain count 7> | | +-o IOCPUInterruptController <class IOCPUInterruptController, registered, matched, active, busy 0, retain count 6> | +-o builtin <class IOPlatformDevice, registered, matched, active, busy 0, retain count 7> | +-o cpus <class IOPlatformDevice, registered, matched, active, busy 0, retain count 8> | +-o pci@f2000000 <class IOPlatformDevice, registered, matched, active, busy 1, retain count 11> | | +-o AppleMacRiscPCI <class AppleMacRiscPCI, !registered, !matched, active, busy 2, retain count 14> | | +-o mac-io@C <class IOPCIDevice, registered, matched, active, busy 0, retain count 16> | | | +-o AppleKeyLargo <class AppleKeyLargo, registered, matched, active, busy 0, retain count 23> | | | +-o via-cuda@16000 <class AppleMacIODevice, registered, matched, active, busy 0, retain count 9> | | | | +-o AppleVIA <class AppleVIA, !registered, !matched, active, busy 0, retain count 5> | | | | +-o cuda <class AppleVIADevice, registered, matched, active, busy 0, retain count 6> | | | | +-o AppleCuda <class AppleCuda, registered, matched, active, busy 0, retain count 8> | | | | +-o IOCudaADBController <class IOCudaADBController, !registered, !matched, active, busy 0, retain count 8> | | | | +-o 2-00@2 <class IOADBDevice, registered, matched, active, busy 0, retain count 6> | | | | | +-o AppleADBKeyboard <class AppleADBKeyboard, registered, matched, active, busy 0, retain count 8> | | | | | +-o IOHIDSystem <class IOHIDSystem, registered, matched, active, busy 0, retain count 10> | | | | | | +-o IOHIDUserClient <class IOHIDUserClient, !registered, !matched, active, busy 0, retain count 5> | | | | | | +-o IOHIDParamUserClient <class IOHIDParamUserClient, !registered, !matched, active, busy 0, retain count 5> | | | | | +-o IOBSDConsole <class IOBSDConsole, !registered, !matched, active, busy 0, retain count 5> | | | | | +-o IOHIDKeyboardDevice <class IOHIDKeyboardDevice, registered, matched, active, busy 0, retain count 6> | | | | | +-o IOHIDInterface <class IOHIDInterface, registered, matched, active, busy 0, retain count 5> | | | | +-o 3-00@3 <class IOADBDevice, registered, matched, active, busy 0, retain count 6> | | | | +-o AppleADBMouseType2 <class AppleADBMouseType2, registered, matched, active, busy 0, retain count 7> | | | | +-o IOHIDPointingDevice <class IOHIDPointingDevice, registered, matched, active, busy 0, retain count 6> | | | | | +-o IOHIDInterface <class IOHIDInterface, registered, matched, active, busy 0, retain count 5> | | | | +-o IOHIDSystem <class IOHIDSystem, registered, matched, active, busy 0, retain count 10> | | | | +-o IOHIDUserClient <class IOHIDUserClient, !registered, !matched, active, busy 0, retain count 5> | | | | +-o IOHIDParamUserClient <class IOHIDParamUserClient, !registered, !matched, active, busy 0, retain count 5> | | | +-o adb <class AppleMacIODevice, registered, matched, active, busy 0, retain count 8> | | | +-o keyboard@8 <class AppleMacIODevice, registered, matched, active, busy 0, retain count 6> | | | +-o power-mgt <class AppleMacIODevice, registered, matched, active, busy 0, retain count 7> | | | +-o escc@13000 <class AppleMacIODevice, registered, matched, active, busy 0, retain count 8> | | | +-o ch-a@13020 <class AppleMacIODevice, registered, matched, active, busy 0, retain count 6> | | | +-o ch-b@13000 <class AppleMacIODevice, registered, matched, active, busy 0, retain count 6> | | | +-o escc-legacy@12000 <class AppleMacIODevice, registered, matched, active, busy 0, retain count 8> | | | +-o ch-a@12004 <class AppleMacIODevice, registered, matched, active, busy 0, retain count 6> | | | +-o ch-b@12000 <class AppleMacIODevice, registered, matched, active, busy 0, retain count 6> | | | +-o ata-3@20000 <class AppleMacIODevice, registered, matched, active, busy 0, retain count 13> | | | | +-o KeyLargoATA <class KeyLargoATA, registered, matched, active, busy 0, retain count 6> | | | | +-o ATADeviceNub@0 <class ATADeviceNub, registered, matched, active, busy 0, retain count 6> | | | | | +-o IOATABlockStorageDriver <class IOATABlockStorageDriver, registered, matched, active, busy 0, retain count 7> | | | | | +-o IOATABlockStorageDevice <class IOATABlockStorageDevice, registered, matched, active, busy 0, retain count 5> | | | | | +-o IOBlockStorageDriver <class IOBlockStorageDriver, registered, matched, active, busy 0, retain count 7> | | | | | +-o QEMU HARDDISK Media <class IOMedia, registered, matched, active, busy 0, retain count 10> | | | | | +-o IOMediaBSDClient <class IOMediaBSDClient, registered, matched, active, busy 0, retain count 5> | | | | | +-o IOApplePartitionScheme <class IOApplePartitionScheme, !registered, !matched, active, busy 0, retain count 7> | | | | | +-o Apple@1 <class IOMedia, registered, matched, active, busy 0, retain count 8> | | | | | | +-o IOMediaBSDClient <class IOMediaBSDClient, registered, matched, active, busy 0, retain count 5> | | | | | +-o Apple_HFS_Untitled_1@3 <class IOMedia, registered, matched, active, busy 0, retain count 10> | | | | | +-o IOMediaBSDClient <class IOMediaBSDClient, registered, matched, active, busy 0, retain count 6> | | | | +-o ATADeviceNub@1 <class ATADeviceNub, registered, matched, active, busy 0, retain count 6> | | | | +-o IOATABlockStorageDriver <class IOATABlockStorageDriver, registered, matched, active, busy 0, retain count 7> | | | | +-o IOATABlockStorageDevice <class IOATABlockStorageDevice, registered, matched, active, busy 0, retain count 5> | | | | +-o IOBlockStorageDriver <class IOBlockStorageDriver, registered, matched, active, busy 0, retain count 7> | | | | +-o QEMU HARDDISK Media <class IOMedia, registered, matched, active, busy 0, retain count 10> | | | | +-o IOMediaBSDClient <class IOMediaBSDClient, registered, matched, active, busy 0, retain count 5> | | | | +-o IOApplePartitionScheme <class IOApplePartitionScheme, !registered, !matched, active, busy 0, retain count 7> | | | | +-o Apple@1 <class IOMedia, registered, matched, active, busy 0, retain count 8> | | | | | +-o IOMediaBSDClient <class IOMediaBSDClient, registered, matched, active, busy 0, retain count 5> | | | | +-o Apple_HFS_Untitled_1@3 <class IOMedia, registered, matched, active, busy 0, retain count 9> | | | | +-o IOMediaBSDClient <class IOMediaBSDClient, registered, matched, active, busy 0, retain count 6> | | | +-o ata-3@21000 <class AppleMacIODevice, registered, matched, active, busy 0, retain count 8> | | | | +-o KeyLargoATA <class KeyLargoATA, registered, matched, active, busy 0, retain count 5> | | | | +-o ATADeviceNub@0 <class ATADeviceNub, registered, matched, active, busy 0, retain count 6> | | | | +-o IOATAPIProtocolTransport <class IOATAPIProtocolTransport, registered, matched, active, busy 0, retain count 8> | | | | +-o IOSCSIPeripheralDeviceNub <class IOSCSIPeripheralDeviceNub, registered, matched, active, busy 0, retain count 5> | | | | +-o IOSCSIPeripheralDeviceType05 <class IOSCSIPeripheralDeviceType05, !registered, !matched, active, busy 0, retain count 7> | | | | +-o IODVDServices <class IODVDServices, registered, matched, active, busy 0, retain count 5> | | | | +-o IODVDBlockStorageDriver <class IODVDBlockStorageDriver, registered, matched, active, busy 0, retain count 7> | | | | +-o QEMU QEMU DVD-ROM Media <class IOCDMedia, registered, matched, active, busy 0, retain count 10> | | | | +-o IOCDMediaBSDClient <class IOCDMediaBSDClient, registered, matched, active, busy 0, retain count 5> | | | | +-o IOCDPartitionScheme <class IOCDPartitionScheme, !registered, !matched, active, busy 0, retain count 6> | | | | +-o Untitled 0@0 <class IOMedia, registered, matched, active, busy 0, retain count 8> | | | | +-o IOMediaBSDClient <class IOMediaBSDClient, registered, matched, active, busy 0, retain count 6> | | | +-o cdrom@0 <class AppleMacIODevice, registered, matched, active, busy 0, retain count 5> | | | +-o interrupt-controller@40000 <class AppleMacIODevice, registered, matched, active, busy 0, retain count 7> | | | +-o AppleMPICInterruptController <class AppleMPICInterruptController, registered, matched, active, busy 0, retain count 5> | | +-o usb@D <class IOPCIDevice, !registered, matched, active, busy 1, retain count 11> | | | +-o AppleUSBOHCI <class AppleUSBOHCI, !registered, !matched, active, busy 0, retain count 6> | | +-o QEMU,VGA@E <class IOPCIDevice, registered, matched, active, busy 0, retain count 10> | | | +-o .Display_boot <class IONDRVFramebuffer, registered, matched, active, busy 0, retain count 10> | | | +-o display0 <class IODisplayConnect, registered, matched, active, busy 0, retain count 5> | | | | +-o AppleDisplay <class AppleDisplay, registered, matched, active, busy 0, retain count 7> | | | +-o IOFramebufferUserClient <class IOFramebufferUserClient, !registered, !matched, active, busy 0, retain count 5> | | +-o rtl8139@F <class IOPCIDevice, !registered, matched, active, busy 1, retain count 12> | | | { | | | "removable" = <"network"> | | | "IODeviceMemory" = ({"offset"=0x400,"parent"=({"address"=0xfffffffff2000000,"length"=0x10000}),"length"=0x100},({"address"=0xffffffff82020000,"length"=0x100})) | | | "interrupts" = <00000001> | | | "device-id" = <00008139> | | | "name" = <"rtl8139"> | | | "cache-line-size" = <00000000> | | | "category" = <"net"> | | | "device_type" = <"network"> | | | "vendor-id" = <000010ec> | | | "revision-id" = <00000020> | | | "max-latency" = <00000000> | | | "subsystem-vendor-id" = <00001af4> | | | "devsel-speed" = <00000000> | | | "model" = <"RTL8139 PCI"> | | | "network-type" = <"ethernet"> | | | "IOInterruptControllers" = ("IOInterruptControllerFFF55788") | | | "min-grant" = <00000000> | | | "Power Management protected data" = "{ theNumberOfPowerStates = 3, version 1, power state 0 = { capabilityFlags 00000000, outputPowerCharacter 00000000, inputPowerRequirement 00000000, staticP$ | | | "AAPL,address" = <f200040082020000> | | | "Power Management private data" = "{ this object = 01998100, interested driver = 01998100, driverDesire = 0, deviceDesire = 2, ourDesiredPowerState = 2, previousRequest = 2 }" | | | "class-code" = <00020000> | | | "compatible" = <"pci10ec,8139"> | | | "AAPL,phandle" = <fff567f0> | | | "subsystem-id" = <00001100> | | | "assigned-addresses" = <01007810000000000000040000000000000001000200781400000000820200000000000000000100> | | | "reg" = <000078000000000000000000000000000000000001007810000000000000000000000000000001000200781400000000000000000000000000000100> | | | "IOInterruptSpecifiers" = (<0000001b00000003>) | | | } | | | | | +-o com_apple_driver_RTL8139 <class com_apple_driver_RTL8139, !registered, !matched, active, busy 0, retain count 6> | +-o nvram@fff04000 <class IOPlatformDevice, registered, matched, active, busy 0, retain count 7> | | +-o Core99NVRAM <class Core99NVRAM, !registered, !matched, active, busy 0, retain count 4> | +-o uni-n@f8000000 <class IOPlatformDevice, registered, matched, active, busy 0, retain count 7> +-o IOResources <class IOResources, registered, matched, active, busy 0, retain count 14> +-o IOHIDSystem <class IOHIDSystem, registered, matched, active, busy 0, retain count 10> | +-o IOHIDUserClient <class IOHIDUserClient, !registered, !matched, active, busy 0, retain count 5> | +-o IOHIDParamUserClient <class IOHIDParamUserClient, !registered, !matched, active, busy 0, retain count 5> +-o com_apple_BootCache <class com_apple_BootCache, !registered, !matched, active, busy 0, retain count 4> +-o IOBSDConsole <class IOBSDConsole, !registered, !matched, active, busy 0, retain count 5> +-o IONetworkStack <class IONetworkStack, registered, matched, active, busy 0, retain count 5> | +-o IONetworkStackUserClient <class IONetworkStackUserClient, !registered, !matched, active, busy 0, retain count 5> +-o com_apple_driver_AudioIPCDevice <class com_apple_driver_AudioIPCDevice, registered, matched, active, busy 0, retain count 7> | +-o com_apple_driver_AudioIPCEngine <class com_apple_driver_AudioIPCEngine, registered, matched, active, busy 0, retain count 8> | +-o IOAudioEngineUserClient <class IOAudioEngineUserClient, !registered, !matched, active, busy 0, retain count 6> | +-o IOAudioEngineUserClient <class IOAudioEngineUserClient, !registered, !matched, active, busy 0, retain count 6> | +-o IOAudioEngineUserClient <class IOAudioEngineUserClient, !registered, !matched, active, busy 0, retain count 6> +-o DigiIO <class DigiIO, registered, matched, active, busy 0, retain count 4> +-o IODisplayWrangler <class IODisplayWrangler, registered, matched, active, busy 0, retain count 6> +-o AppleSCSISubsystemGlobals <class AppleSCSISubsystemGlobals, registered, matched, active, busy 0, retain count 5>
On 08/05/2016 06:35 PM, Mark Cave-Ayland wrote:
This patchset is loosely based on earlier work by BALATON Zoltan balaton@eik.bme.hu and provides basic infrastructure to allow OpenBIOS to enable PCI device bus mastering.
Following on from discussions on the QEMU mailing list, it seems that Apple's OF enables bus mastering for some PCI devices by default, and as a result some buggy drivers forget to explicitly enable it and hence these devices fail under QEMU's emulation.
The first 2 patches add the basic support routines while the last patch enables bus mastering for the rtl8139 card on Apple PPC machines which is required for some OS 9, OS X and MorphOS drivers.
Signed-off-by: Mark Cave-Ayland mark.cave-ayland@ilande.co.uk
Mark Cave-Ayland (3): pci: introduce ob_pci_enable_bus_master() function pci: add PCI database entry for rtl8139 network card pci: add rtl8139_config_cb() to configure rtl8139 network cards
drivers/pci.c | 27 +++++++++++++++++++++++++++ drivers/pci_database.c | 6 ++++++ drivers/pci_database.h | 3 +++ include/drivers/pci.h | 1 + 4 files changed, 37 insertions(+)
On 07/08/16 11:05, Cédric Le Goater wrote:
Hello Mark,
The recent changes in openbios and qemu really improved the support of 10.4.11. I can now logon on the raw disk I have and the system looks pretty good and stable. All these issues are gone :
https://www.coreboot.org/pipermail/openbios/2016-June/009436.html
I still need :
-prom-env boot-device=hd:3,\System\Library\CoreServices\BootX
to boot, but I suppose this is due to the state of the disk which also has a macosx 9 on it.
Right. I think I asked the question before if we should simply add this to the search patch, e.g. "hd:,\System\Library\CoreServices\BootX" before "hd:,\:tbxi" if an installed BootX should always take priority?
However, the network is not detected. This is curious as the command 'ioreg' does list a rtl8139 with this patchset, see below, and I suppose the driver is correct :
28 1 0x55c000 0x1f000 0x1e000 com.apple.iokit.IONetworkingFamily (1.5.0) <6 5 4 3 2> 29 0 0x57b000 0x5000 0x4000 com.apple.driver.AppleRTL8139Ethernet (1.1.0) <28 16 5 4 3 2>
Is there anything I could do to learn a bit more why the adapter is not showing in the system ? I did not find anything in the osx logs.
Following on from Howard's testing earlier, maybe something in the ppc-for-2.8 branch breaks this? If you try running QEMU git master with an OpenBIOS from https://github.com/mcayland/openbios/commits/ppc-busmaster and -cpu 750 does networking work?
If so that suggest something in the ppc-for-2.8 queue breaks it in which case if you try and bisect that would be very helpful :)
ATB,
Mark.
On 08/07/2016 03:52 PM, Mark Cave-Ayland wrote:
On 07/08/16 11:05, Cédric Le Goater wrote:
Hello Mark,
The recent changes in openbios and qemu really improved the support of 10.4.11. I can now logon on the raw disk I have and the system looks pretty good and stable. All these issues are gone :
https://www.coreboot.org/pipermail/openbios/2016-June/009436.html
I still need :
-prom-env boot-device=hd:3,\System\Library\CoreServices\BootX
to boot, but I suppose this is due to the state of the disk which also has a macosx 9 on it.
Right. I think I asked the question before if we should simply add this to the search patch, e.g. "hd:,\System\Library\CoreServices\BootX" before "hd:,\:tbxi" if an installed BootX should always take priority?
yes. That works. sorry for the late answer.
However, the network is not detected. This is curious as the command 'ioreg' does list a rtl8139 with this patchset, see below, and I suppose the driver is correct :
28 1 0x55c000 0x1f000 0x1e000 com.apple.iokit.IONetworkingFamily (1.5.0) <6 5 4 3 2> 29 0 0x57b000 0x5000 0x4000 com.apple.driver.AppleRTL8139Ethernet (1.1.0) <28 16 5 4 3 2>
Is there anything I could do to learn a bit more why the adapter is not showing in the system ? I did not find anything in the osx logs.
Following on from Howard's testing earlier, maybe something in the ppc-for-2.8 branch breaks this? If you try running QEMU git master with an OpenBIOS from https://github.com/mcayland/openbios/commits/ppc-busmaster and -cpu 750 does networking work?
That's better. I was using the mainline openbios with your set of patches for busmaster but I was missing Ben's fixes.
So, with your ppc-busmaster branch, macosx 10.4.11 finds the adapter. However, dhcp does not work. Investigation in progress.
If so that suggest something in the ppc-for-2.8 queue breaks it in which case if you try and bisect that would be very helpful :)
There are no regression with David's branch.
Cheers,
C.
ATB,
Mark.
Hello
Following on from Howard's testing earlier, maybe something in the ppc-for-2.8 branch breaks this? If you try running QEMU git master with an OpenBIOS from https://github.com/mcayland/openbios/commits/ppc-busmaster and -cpu 750 does networking work?
That's better. I was using the mainline openbios with your set of patches for busmaster but I was missing Ben's fixes.
So, with your ppc-busmaster branch, macosx 10.4.11 finds the adapter. However, dhcp does not work. Investigation in progress.
That was just a macosx configuration issue. All is good now :)
Here is a little screenshot :
http://kaod.org/qemu/ppc/qemu-macosx-10.4.11.png
I could ssh into the guest.
Thanks !
C.
On 08/08/16 07:47, Cédric Le Goater wrote:
Hello
Following on from Howard's testing earlier, maybe something in the ppc-for-2.8 branch breaks this? If you try running QEMU git master with an OpenBIOS from https://github.com/mcayland/openbios/commits/ppc-busmaster and -cpu 750 does networking work?
That's better. I was using the mainline openbios with your set of patches for busmaster but I was missing Ben's fixes.
So, with your ppc-busmaster branch, macosx 10.4.11 finds the adapter. However, dhcp does not work. Investigation in progress.
That was just a macosx configuration issue. All is good now :)
Here is a little screenshot :
http://kaod.org/qemu/ppc/qemu-macosx-10.4.11.png
I could ssh into the guest.
Thanks !
Great, thanks a lot for testing!
ATB,
Mark.