[Top][All Lists]

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


From: Jean-Christophe DUBOIS
Subject: Re: MCIMX6UL EVK QEMU Ethernet
Date: Tue, 2 Jun 2020 19:44:09 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0

Hello Sean,

I believe that one problem might be that the Ethernet PHY implementation is not "complete" in Qemu.

Actually the i.MX FEC driver implement a PHY (LAN911x from SMSC borrowed from another Qemu Ethernet emulator) that is not present on the i.MX6UL EVK board (it has a micrel PHY)

With your actual device tree the linux kernel is certainly expecting that when a link state changes, it get notified by the PHY through some GPIO/interrupt and then can react to this (as most PHY do today).

The wiring between the Ethernet PHY device and the processor GPIO is not implemented in Qemu (even if the LAN911X would be able to raise an interrupt on event, but anyway this particular PHY is not even in your device tree).

Therefore your linux kernel never get notified when the PHY get the link up (and it does get to this state by default).

So I believe you would have a better chance if you were disabling the interrupt from the PHY inside the kernel (through the DTS tree) to get to poling mode.

As a matter of fact, for an embedded application using µCOS (not linux), I recently had to use the generic µCOS PHY driver (limited to IEEE defined registers) that run in polling mode to get it working on Qemu.

So I think you should tweak your device tree to change the way linux handle the PHY so that it default to polling mode.

On a related note, the imx_fec emulator expect the PHY to be the first device (0) on the MDIO bus (and ignore any request for other devices on the MDIO bus). But in the actual linux DTS tree the 2 PHY devices are at location (1) and (2). I have a patch lying around to address this point.


Le 02/06/2020 à 12:45, Sean Nyekjaer a écrit :

I'm very new to QEMU and having trouble with the iMX6ul EVK QEMU variant.

We are starting QEMU with:

% qemu-system-arm \

-d trace:usb_port_attach \

-machine mcimx6ul-evk \

-m 256 \

-no-reboot \

-nographic \

-serial mon:stdio \

-kernel ./zImage \

-drive if=sd,id=sd0,format=raw,file=./cc-image-dev-iwg26-20200505081306.rootfs.wic \

-device sd-card,id=sd0 \

-dtb ./imx6ul-14x14-evk.dtb \

-append "root=/dev/mmcblk0p3 ro quiet systemd.setenv=SYSTEMD_FSTAB=/etc/fstab.qemu ip=::::qemu::none" \

-nic user,mac=02:ca:fe:f0:0d:01,id=u1,net=,dhcpstart= \

-nic user,mac=02:ca:fe:f0:0d:02,id=u2,net=,dhcpstart=

But the Ethernet devices never gets a "link up"

root@qemu:/data/root# ip link

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000

    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00

2: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN mode DEFAULT group default qlen 1000

    link/ether 02:ca:fe:f0:0d:02 brd ff:ff:ff:ff:ff:ff

3: eth1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN mode DEFAULT group default qlen 1000

    link/ether 02:ca:fe:f0:0d:01 brd ff:ff:ff:ff:ff:ff

I have tried with a 4.19.x and a 5.6 kernel.

Qemu v4.2 and v5.0

Can you steer me in the correct direction?

Best regards,
Sean Nyekjaer

reply via email to

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