compulab-yokneam / meta-bsp-imx8mp

13 stars 13 forks source link

eth0 issue in iot-gate-imx8mp #22

Closed AminSahebi closed 10 months ago

AminSahebi commented 1 year ago

Hi there,

I've been working on iot-gate-imxmp for a while, I just realized eth0 is not working anymore,

I was working on other applications to build a Linux image using Yocto, I didn't touch any network configuration, device-tree or network drivers and I realized now I see this error in u-boot logs:

Net:   Could not get PHY for FEC0: addr -1
Could not get PHY for FEC0: addr -1
eth1: ethernet@30bf0000

I tried to clone and build the u-boot from scratch from the repository https://github.com/compulab-yokneam/u-boot-compulab and I created flash.bin and still, there is the same error.

This is the output of ethtool if helps,

~# ethtool eth0
Settings for eth0:
        Supported ports: [ TP    MII ]
        Supported link modes:   10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Full
                                1000baseX/Full
        Supported pause frame use: Symmetric
        Supports auto-negotiation: Yes
        Supported FEC modes: Not reported
        Advertised link modes:  10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Full
                                1000baseX/Full
        Advertised pause frame use: Symmetric
        Advertised auto-negotiation: Yes
        Advertised FEC modes: Not reported
        Speed: Unknown!
        Duplex: Unknown! (255)
        Auto-negotiation: on
        master-slave cfg: forced master
        master-slave status: unknown
        Port: MII
        PHYAD: 0
        Transceiver: external
        Supports Wake-on: g
        Wake-on: d
        Link detected: no

and here ifconfig output,

:~# ifconfig
eth0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether 00:01:c0:31:e4:56  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

eth1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.16.108  netmask 255.255.255.0  broadcast 192.168.16.255
        inet6 fe80::201:c0ff:fe31:e459  prefixlen 64  scopeid 0x20<link>
        ether 00:01:c0:31:e4:59  txqueuelen 1000  (Ethernet)
        RX packets 14  bytes 2840 (2.7 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 6  bytes 1498 (1.4 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 51

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 374  bytes 22716 (22.1 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 374  bytes 22716 (22.1 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

dmesg output:

~# dmesg | grep eth1
[    7.244114] imx-dwmac 30bf0000.ethernet eth1: PHY [stmmac-1:00] driver [RTL8211E Gigabit Ethernet] (irq=POLL)
[    7.252811] imx-dwmac 30bf0000.ethernet eth1: Register MEM_TYPE_PAGE_POOL RxQ-0
[    7.253177] imx-dwmac 30bf0000.ethernet eth1: Register MEM_TYPE_PAGE_POOL RxQ-1
[    7.253546] imx-dwmac 30bf0000.ethernet eth1: Register MEM_TYPE_PAGE_POOL RxQ-2
[    7.254005] imx-dwmac 30bf0000.ethernet eth1: Register MEM_TYPE_PAGE_POOL RxQ-3
[    7.254381] imx-dwmac 30bf0000.ethernet eth1: Register MEM_TYPE_PAGE_POOL RxQ-4
[    7.255205] imx-dwmac 30bf0000.ethernet eth1: No Safety Features support found
[    7.255239] imx-dwmac 30bf0000.ethernet eth1: IEEE 1588-2008 Advanced Timestamp supported
[    7.256963] imx-dwmac 30bf0000.ethernet eth1: registered PTP clock
[    7.261059] imx-dwmac 30bf0000.ethernet eth1: FPE workqueue start
[    7.261079] imx-dwmac 30bf0000.ethernet eth1: configuring for phy/rgmii-id link mode
[   11.360139] imx-dwmac 30bf0000.ethernet eth1: Link is Up - 1Gbps/Full - flow control rx/tx
[   11.360184] IPv6: ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready

~# dmesg | grep eth0
[    2.132851] fec 30be0000.ethernet eth0: registered PHC device 0
[    7.270440] fec 30be0000.ethernet eth0: Unable to connect to phy
[    7.315498] fec 30be0000.ethernet eth0: Unable to connect to phy

u-boot-env.txt

attached you can find also u-boot env,

any advice is much appreciated,

AminSahebi commented 1 year ago

To avoid any confusion, I made a clean and fresh installation of Ubuntu 18.04 and started the build procedure from scratch,

I have faced the following error in the u-boot :

| make[1]: *** No rule to make target 'arch/arm64/boot/dts/compulab/iot-gate-imx8plus-m2tpm.dtb'.  Stop.
| make: *** [/home/ubuntu/compulab-nxp-bsp/build-iot-gate-imx8plus/tmp/work-shared/iot-gate-imx8plus/kernel-source/Makefile:1430: compulab/iot-gate-imx8plus-m2tpm.dtb] Error 2
| ERROR: oe_runmake failed
| WARNING: exit code 1 from a shell command.
ERROR: Task (/home/ubuntu/compulab-nxp-bsp/sources/meta-bsp-imx8mp/recipes-kernel/linux/linux-compulab_5.15.71.bb:do_compile) failed with exit code '1'
NOTE: Tasks Summary: Attempted 7649 tasks of which 7618 didn't need to be rerun and 1 failed.

Which I bypassed the issue by removing line 12 as indicated "iot-gate-imx8plus-m2tpm.dtb" in the following file:

meta-bsp-imx8mp/conf/machine/iot-gate-imx8plus.conf

the build is successful and deployed image on the device, however, still eth0 behaviour is the same.


[    7.764131] fec 30be0000.ethernet eth0: Unable to connect to phy
[    8.060441] fec 30be0000.ethernet eth0: Unable to connect to phy
vraevsky commented 1 year ago

Please try the latest CompuLab official Linux Debian release. https://www.compulab.com/wp-content/uploads/2023/03/iot-gate-imx8plus_debian-linux_2023-03-20.zip

Make it run from a removable media. While in Linux, issue cl-uboot and update the device bootloader. Reboot the device. Try using the eth0 in U-Boot and in Linux. Let me know about the results.

AminSahebi commented 11 months ago

Hi @vraevsky and thank you for your reply,

I used uuu tool and download recovery u-boot (on your website) plus my customized image, then u-boot worked as expected. now I have eth0 and eth1 both working.

Many thanks

vraevsky commented 11 months ago

Hi @AminSahebi,

Thanks for the update & good luck.