qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] Make rtl8139 network interface card compatible


From: Programmingkid
Subject: Re: [Qemu-devel] [PATCH] Make rtl8139 network interface card compatible with Mac OS 10.4
Date: Wed, 30 Dec 2015 12:50:38 -0500

On Dec 30, 2015, at 11:58 AM, Mark Cave-Ayland wrote:

> On 30/12/15 16:47, Programmingkid wrote:
> 
>> I did disable the change I made to the pci_dma_read() function and applied 
>> this
>> patch to OpenBIOS. It makes Mac OS X stop booting. This is the message it is
>> stuck at when Zoltan's patch is applied:
>> mig_table_max_displ = 70
>> 
>> I even removed the rtl8139 from QEMU's options and Mac OS X still stopped 
>> booting
>> at the same exact spot. 
> 
> Okay. I've just posted a revised patchset to the OpenBIOS list which may
> (or may not) help, so please test with that aswell to see if it makes a
> difference.

I have test your patch set. First I disabled my change to the pci_dma_read() 
function. Then I activated my change to the rtl8139.c file. The nic didn't 
work. The driver detected the nic, but DHCP did not set it up. Disabling my 
change to the rtl8139.c file causes a timeout message to be printed by the 
driver. 

When I was doing my research, I did a test where I changed the call to 
memory_region_set_enabled() in do_pci_register_device() to set everything to 
true instead of false. The MemoryRegion's enabled property was false by the 
time the RTL8139 tried using the pci_dma_read() function. I think something 
might be setting the enabled variable to false for some reason.

> 
>>> It looks like we have to face up to the reality that Apple's OF
>>> implementation likes to enable bus mastering for some cards and emulate
>>> this behaviour in OpenBIOS, since because of this some drivers don't
>>> explicitly enable bus mastering and so fail under emulation.
>>> 
>>> I'll go back and revisit Zoltan's patches to see if we can come up with
>>> something that works better for OpenBIOS upstream. In the meantime I
>>> still can't quite work out why you still need to swap the BARs around as
>>> AFAICT both the mmio and io BARs are mapped onto the chip registers -
>>> any chance you could add some debugging to QEMU in order to figure out
>>> what is going wrong without your patch?
>> 
>> I have done a lot of debugging. With only the pci_dma_read() change applied 
>> to QEMU, nothing the Mac OS X driver does ever accesses any of the functions 
>> from the rtl8139.c file (as far as I can tell). I will add that when this 
>> code "if ( csrRead8( RTL_CM ) & R_CM_RST )" is executed by the driver, the 
>> value is 16. It appeared to be pretty consistent. The value returned by just 
>> "csrRead8( RTL_CM )" is 24. 
> 
> Right, so then the question to ask is what is the difference in
> behaviours both before and after the BAR swap? It seems that you're
> getting a value back but presumably it must be a different value with
> your patch applied.

The difference is I see activity in the RTL8139.c file when I made the swap. 
Without the change, none of the I/O functions in the RTL8139.c file are called.

This is what I did. I added this code "printf("RTL8139: %s() called\n", 
__FUNCTION__);" to these functions in the rtl8139.c file: 
rtl8139_mmio_writeb()
rtl8139_mmio_writew()
rtl8139_mmio_writel()
rtl8139_mmio_readb()
rtl8139_mmio_readw()
rtl8139_mmio_readl()
rtl8139_ioport_write()
rtl8139_ioport_read()

If a register read and write from the driver doesn't access one of these 
functions, what else could it be accessing? 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]