[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-ppc] Problems with QEMU 2.5 and initializing the virtio device
From: |
Alexander Graf |
Subject: |
Re: [Qemu-ppc] Problems with QEMU 2.5 and initializing the virtio device |
Date: |
Fri, 1 Apr 2016 17:51:49 +0200 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 |
Hi,
On 01.04.16 11:45, address@hidden wrote:
> I am trying to launch a QEMU 2.5 ppc variant with the following command:
>
> /cygdrive/c/MinGW/msys/1.0/local/qemu/qemu-system-ppc64 -m 240 -g
> 640x400x16
> -name ppc -M ppce500 -cpu e5500
> -icount 2 -gdb tcp:127.0.0.1:1234,ipv4
> -netdev tap,id=vlan0,ifname=tap0
> -device virtio-net-pci,netdev=vlan0,id=virtio,bus=pci.0,addr=1.0,
> -bios u-boot.e500
> -kernel boot.bin
> -initrd boot.qemu
>
> I get control when U-Boot has executed.
> Its version is: U-Boot 2015.10-rc2-00179-g79c884d-dirty (Aug 28 2015 -
> 11:00:43 +0000).
> After writing other details it reports:
>
> Net: No ethernet found.
>
> In order to start my application, I use the cp command to copy the
> boot.bin (placed at 0x200000) to its proper destination, and
> subsequently use a go command to start it. When a debugger is connected
> I get control where I want it.
>
> But U-Boot has not initialized the virtio connection it appears, nor the
> bridge it is subordinate to.
> If I switch to the 'compat_monitor0 console', I get the following with
> 'info pci':'
>
> Bus 0, device 0, function 0:
> PCI bridge: PCI device 1957:0030
> BUS 0.
> secondary bus 0.
> subordinate bus 0.
> IO range [0.x0000, 0x0fff]
> memory range [0x00000000, 0x000fffff]
> prefetchable memory range [0x00000000, 0x000fffff]
> BAR0: 32 bit memory at 0xffffffffffffffff [0x000ffffe].
> id ""
> Bus 0, device 1, function 0:
> Ethernet controller: PCI device 1af4:1000
> IRQ 0.
> BAR0: I/O at 0xffffffffffffffff [0x001e].
> BAR1: 32 bit memory at 0xffffffffffffffff [0x00000ffe].
> BAR6: 32 bit memory at 0xffffffffffffffff [0x0003fffe].
> id "virtio"
>
> /Is there any way to cut-and-paste from these windows? I had to type
> everything again, and this is pretty annoying./
Yes, just use -nographic and switch between serial and monitor using
Ctrl-A C.
>
> I would have hoped that U-Boot had initialized the above, but it didn't.
> Why not?
U-Boot simply doesn't have virtio drivers :). IIRC I used to have an
emulated e1000 NIC working in U-Boot at one point. But nobody ever went
through the effort to implement virtio-net support in U-Boot.
>
> In the CTRL-ALT-2 window I tried to set BAR1 to 0xfe000000 using pci
> modify.l 0.1.0 14 and changing the value from 0.
> Why BAR6? There is no BAR6 in a PCI ethernet device.
If your OS needs virtio support, why doesn't it set up the BARs itself?
>
> Similarly I changed the Bridge BAR0 to a range that includes the
> ethernet controller memory, but it does not matter.
>
> When inside the CTRL-ALT-1 window I try to read at 0xfe000000 I get
> zeroes which cannot be correct.
>
> In the running application when I inside that has mapped a virtual
> address to the 0xfe000000 area there is nothing there, and I trap.
>
> What can I write differently in the above command to make U_Boot
> recognize the virtio ethernet controller?
I don't think it's a good idea to poke this in from the outside. Either
add virtio support in U-Boot if you actually need it there (I don't
think so?) or modify your guest kernel to just map it itself.
If you just need a quick hack, hack up u-boot to map it.
Alex