qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
To: Programmingkid <programmingkidx@gmail.com>
Cc: jasowang@redhat.com, qemu-devel qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH] Make rtl8139 network interface card compatible with Mac OS 10.4
Date: Thu, 31 Dec 2015 18:56:02 +0000	[thread overview]
Message-ID: <56857A42.8050903@ilande.co.uk> (raw)
In-Reply-To: <A7CA9D24-067C-4149-83EF-C4956A718FCD@gmail.com>

On 31/12/15 18:26, Programmingkid wrote:

>> Yeah, I see that too. Given that you have the source to the Apple
>> RTL8139 driver at hand, can you try with a patched OpenBIOS using the
>> bus master patchset on the mailing list and also add some debugging to
>> your copy of
>> http://www.opensource.apple.com/source/AppleRTL8139Ethernet/AppleRTL8139Ethernet-141/RTL8139.cpp
>> or similar like this to display the csrMap and csrBase variables:
>>
>>
>> // Get the virtual address mapping of CSR registers located at
>> // Base Address Range 0 (0x10).
>>
>> csrMap = pciNub->mapDeviceMemoryWithRegister( kIOPCIConfigBaseAddress1 );
>>
>> DEBUG_LOG("csrMap: %x\n", csrMap);
>>
>> if ( 0 == csrMap )
>>    break;
>>
>> csrBase = (volatile void*)csrMap->getVirtualAddress();
>>
>> DEBUG_LOG("csrBase: %x\n", csrBase);
>>
>>
>> At the very least these should give the addresses that the driver is
>> trying to use in order to access the chip. If you can try this both
>> before and after swapping the BARs over in QEMU that would be great.
> 
> Here are the results.
> 
> Values with my patch fully applied (with pci_dma_read() change):
> csrMap: 0x270b3c0
> csrBase: 0x20f8e000
> 
> I then kextunload'ed the kernel extension and loaded it again. Here are the values:
> csrMap: 0x270ffc0
> csrBase: 0x20f8c000
> 
> 
> Values with only the RTL8139.c changes applied (no pci_dma_read() change):
> csrMap: 0x1177740
> csrBase: 0x1f5bf000
> 
> After unloading and loading the kernel extension:
> csrMap: 0x11776c0
> csrBase: 0x1f5d6000

Well they are returning non-zero values, so that's good. After a bit
more poking, something doesn't make sense - in that same file
RTL8139::initPCIConfigSpace() claims to set the bus master bit, but if I
add tracing to hw/pci/pci-host.c then I don't see any writes to the PCI
command register outside of OpenBIOS? Any chance you can add debugging
to the before and after values for the reg16 variable which this
function claims to set?

Also with similar tracing involved, apparently the writes to PCI I/O
space in order to access the chip registers are actually going through
pci_host_config_write(), i.e. configuration space rather than I/O space
which is why they aren't accessing the chip registers. So more digging
is required to figure out why this is happening.


ATB,

Mark.

  reply	other threads:[~2015-12-31 18:56 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-29 17:59 [Qemu-devel] [PATCH] Make rtl8139 network interface card compatible with Mac OS 10.4 Programmingkid
2015-12-29 21:04 ` Mark Cave-Ayland
2015-12-30  0:05   ` Programmingkid
2015-12-30  0:35     ` Programmingkid
2015-12-30 14:03       ` Mark Cave-Ayland
2015-12-30 16:47         ` Programmingkid
2015-12-30 16:58           ` Mark Cave-Ayland
2015-12-30 17:50             ` Programmingkid
2015-12-31 13:23               ` Mark Cave-Ayland
2015-12-31 18:26                 ` Programmingkid
2015-12-31 18:56                   ` Mark Cave-Ayland [this message]
2015-12-31 19:47                     ` Programmingkid
2016-01-02  4:00                     ` Programmingkid
2016-01-02  9:39                       ` Mark Cave-Ayland
2016-01-02 17:08                         ` Programmingkid
2016-01-02 20:46                           ` Mark Cave-Ayland
2016-01-01 21:36       ` Paolo Bonzini
2016-01-01 21:49         ` Programmingkid
2016-01-01 20:32 ` Paolo Bonzini
2016-01-01 20:42   ` Programmingkid
2016-01-01 22:36     ` Paolo Bonzini
2016-01-01 22:42       ` Programmingkid

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56857A42.8050903@ilande.co.uk \
    --to=mark.cave-ayland@ilande.co.uk \
    --cc=jasowang@redhat.com \
    --cc=programmingkidx@gmail.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).