Received: from eggs.gnu.org ([2001:4830:134:3::10]:36685) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aEjBq-0000R3-PO for qemu-devel@nongnu.org; Thu, 31 Dec 2015 14:47:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aEjBl-0007Fb-PA for qemu-devel@nongnu.org; Thu, 31 Dec 2015 14:47:14 -0500 Received: from mail-ig0-x234.google.com ([2607:f8b0:4001:c05::234]:35559) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aEjBl-0007FX-J9 for qemu-devel@nongnu.org; Thu, 31 Dec 2015 14:47:09 -0500 Received: by mail-ig0-x234.google.com with SMTP id to4so200164599igc.0 for ; Thu, 31 Dec 2015 11:47:09 -0800 (PST) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Programmingkid In-Reply-To: <56857A42.8050903@ilande.co.uk> Date: Thu, 31 Dec 2015 14:47:06 -0500 Content-Transfer-Encoding: quoted-printable Message-Id: <238EE8AC-04B7-4BBD-8DBA-A7A6D88B75C7@gmail.com> References: <5682F552.90305@ilande.co.uk> <9C26B2B6-1384-437E-B60F-8CC452F2F159@gmail.com> <5683E43A.9040203@ilande.co.uk> <96B9267A-2429-4C38-B187-0A8F68B5A991@gmail.com> <56840D2B.7020908@ilande.co.uk> <251F828B-25A7-41D1-B536-4CEC57A02EDE@gmail.com> <56852C68.9050509@ilande.co.uk> <56857A42.8050903@ilande.co.uk> Subject: Re: [Qemu-devel] [PATCH] Make rtl8139 network interface card compatible with Mac OS 10.4 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Mark Cave-Ayland Cc: jasowang@redhat.com, qemu-devel qemu-devel On Dec 31, 2015, at 1:56 PM, Mark Cave-Ayland wrote: > On 31/12/15 18:26, Programmingkid wrote: >=20 >>> 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/AppleRTL8139Et= hernet-141/RTL8139.cpp >>> or similar like this to display the csrMap and csrBase variables: >>>=20 >>>=20 >>> // Get the virtual address mapping of CSR registers located at >>> // Base Address Range 0 (0x10). >>>=20 >>> csrMap =3D pciNub->mapDeviceMemoryWithRegister( = kIOPCIConfigBaseAddress1 ); >>>=20 >>> DEBUG_LOG("csrMap: %x\n", csrMap); >>>=20 >>> if ( 0 =3D=3D csrMap ) >>> break; >>>=20 >>> csrBase =3D (volatile void*)csrMap->getVirtualAddress(); >>>=20 >>> DEBUG_LOG("csrBase: %x\n", csrBase); >>>=20 >>>=20 >>> 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. >>=20 >> Here are the results. >>=20 >> Values with my patch fully applied (with pci_dma_read() change): >> csrMap: 0x270b3c0 >> csrBase: 0x20f8e000 >>=20 >> I then kextunload'ed the kernel extension and loaded it again. Here = are the values: >> csrMap: 0x270ffc0 >> csrBase: 0x20f8c000 >>=20 >>=20 >> Values with only the RTL8139.c changes applied (no pci_dma_read() = change): >> csrMap: 0x1177740 >> csrBase: 0x1f5bf000 >>=20 >> After unloading and loading the kernel extension: >> csrMap: 0x11776c0 >> csrBase: 0x1f5d6000 >=20 > 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? You are right! Good job catching this! The value before the write is 0. = The value after the write is still 0. The value it should be after the = write is 21.=20 >=20 > 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. Which target are you using: mac99 or g3beige. I use the g3beige target. = Mac OS 10.4 is not suppose to be able to run on this machine, so I = wonder if that has something to do with it. I did try to run Mac OS 10.4 = in the mac99 target, but it just does not run very well there. It was = unusable. The mouse didn't seem to work right. The console application = didn't even load. I had to give up on that target. I do still plan on reviewing your patch set for fixing booting on the = mac99 target. I just haven't found the time to do it yet.