Skip to contentSkip to conversation

: Does QEMU support SMSC LAN9514 chip for Raspberry Pi2(raspi2)?

Qemu-arm Daniel Chang 2 participants 3 messages Jul 3, 2017 – Jul 4, 2017

lore
Share & tools
lore
#0 lore raw

Hi guys,

Recently I’m trying to emulate a Raspberry Pi 2 system on QEMU(host is X86-64 ubuntu server 17.04). The guest OS is made by myself with 4.9.34 linux kernel and buildroot. And I can boot it up.

Then I want to configure network to make the guest access internet.
The idea is to use host tap device as backend and connected it with guest frontend interface(virtual NIC). But the problem is, which virtual NIC should I use?

According to Wikipedia( https://en.wikipedia.org/wiki/Raspberry_Pi#cite_note-SMSC-LAN9514-specs-33),
Raspberry Pi 2 Model B has a build-in USB Ethernet adapter using the SMSC LAN9514 chip. But I didn’t see it in the device list for raspi2.

Does anyone know:

1. If SMSC LAN9514 is support in QEMU for raspi2

2. If yes, how to configure it

3. If no, any way else can bring up the network for guest

Any hints or suggestions would be appreciated.
Daniel

#1 lore raw

Hi Daniel,

Quoted 2 lines · Daniel Chang

Recently I’m trying to emulate a Raspberry Pi 2 system on QEMU(host is X86-64 ubuntu server 17.04).

[...]

Quoted 2 lines

Raspberry Pi 2 Model B has a build-in USB Ethernet adapter using the SMSC LAN9514 chip. But I didn’t see it in the device list for raspi2.

As you noticed on the Raspberry Pi 2 the Ethernet adapter is connected to the BCM2836 cpu via the USB bus.
On this cpu the USB controller is implemented with the "DWC USB2.0 OTG" IP core from Synopsys. This user manual is protected and only available for Synopsys customers.
I believe this is the reason why there is no USB modeled for the raspi2.

See:
https://www.raspberrypi.org/documentation/hardware/raspberrypi/bcm2836/README.md
https://www.synopsys.com/dw/ipdir.php?ds=dwc_usb_2_0_digital_controllers

Quoted 4 lines

The idea is to use host tap device as backend and connected it with guest frontend interface(virtual NIC).

But the problem is, which virtual NIC should I use?

With the announce of Docker running on ARM with the Raspberry Pi 2 example, I see few people trying to emulate the raspi2 to run ARM containers and they have your problem for network access.

If you don't care about which ARM board emulate, I recommend you the "virt" board which is probably the most complete and performant.

See Peter Maydell post:
https://translatedcode.wordpress.com/2016/11/03/installing-debian-on-qemus-32-bit-arm-virt-board/

Now if you really need to emulate a Raspberry Pi 2 you can connect it to an IP network using the SLIP or PPP (recommended) protocol thru the UART (ttyAMA0). You will need to disable the console login shell (install sshd first).

See:
http://www.tldp.org/HOWTO/PPP-HOWTO/direct.html

Regards,

Phil.

#2 lore raw

Thank you so much, Phil !
I’ll try ‘virt’ board.

On 7/4/17, 1:09 PM, "[email protected] on behalf of Philippe Mathieu-Daudé" <[email protected] on behalf of [email protected]> wrote:

Hi Daniel,

On Mon, Jul 3, 2017 at 3:56 AM, Daniel Chang <[email protected]> wrote:
> Recently I’m trying to emulate a Raspberry Pi 2 system on QEMU(host is > X86-64 ubuntu server 17.04).
[...]
> Raspberry Pi 2 Model B has a build-in USB Ethernet adapter using the SMSC > LAN9514 chip. But I didn’t see it in the device list for raspi2.

As you noticed on the Raspberry Pi 2 the Ethernet adapter is connected to the BCM2836 cpu via the USB bus.
On this cpu the USB controller is implemented with the "DWC USB2.0 OTG" IP core from Synopsys. This user manual is protected and only available for Synopsys customers.
I believe this is the reason why there is no USB modeled for the raspi2.

See:
https://www.raspberrypi.org/documentation/hardware/raspberrypi/bcm2836/README.md
https://www.synopsys.com/dw/ipdir.php?ds=dwc_usb_2_0_digital_controllers

> The idea is to use host tap device as backend and connected it with guest > frontend interface(virtual NIC).
>
> But the problem is, which virtual NIC should I use?

With the announce of Docker running on ARM with the Raspberry Pi 2 example, I see few people trying to emulate the raspi2 to run ARM containers and they have your problem for network access.

If you don't care about which ARM board emulate, I recommend you the "virt" board which is probably the most complete and performant.

See Peter Maydell post:
https://translatedcode.wordpress.com/2016/11/03/installing-debian-on-qemus-32-bit-arm-virt-board/

Now if you really need to emulate a Raspberry Pi 2 you can connect it to an IP network using the SLIP or PPP (recommended) protocol thru the UART (ttyAMA0). You will need to disable the console login shell (install sshd first).

See:
http://www.tldp.org/HOWTO/PPP-HOWTO/direct.html

Regards,

Phil.