Ethernet/PHY problems on SAMA5

This forum is for users of Microchip MPUs and who are interested in using Linux OS.

Moderator: nferre

davidz
Posts: 3
Joined: Thu Jan 24, 2019 10:33 pm

Ethernet/PHY problems on SAMA5

Mon Jan 28, 2019 12:53 pm

if I stop the boot process during u-boot and make
setenv ipaddr XX.XX.XX.XX
ping YY.YY.YY.YY
when XX.XX.XX.XX and YY.YY.YY.YY are real address
then continue the boot process with bootargs ip=XX.XX.XX.XX
Linux start correctly and I have network.
But if I don't stop uboot and the boardargs doesn't include the ip=XX.XX.XX.XX OR if I put ip=dhcp
I don't get ethernet the mii-diag --restart eth0 give me errors:
No MII transceiver present!

Please can you suggest a solution to this problem?
Thanks
blue_z
Location: USA
Posts: 1924
Joined: Thu Apr 19, 2007 10:15 pm

Re: Ethernet/PHY problems on SAMA5

Tue Jan 29, 2019 12:58 am

You have not provided a clear and detailed description of the problem.
At the very least you need to mention your hardware, the Linux kernel version, and a description of the root filesystem and system initialization scheme (e.g. Busybox, SystemV or Systemd).

davidz wrote: if I stop the boot process during u-boot and make
setenv ipaddr XX.XX.XX.XX
ping YY.YY.YY.YY
when XX.XX.XX.XX and YY.YY.YY.YY are real address
then continue the boot process with bootargs ip=XX.XX.XX.XX
Linux start correctly and I have network.
Old versions of the kernel did require/expect U-Boot to perform some of the Ethernet initialization for AT91.
See this topic.

davidz wrote: But if I don't stop uboot and the boardargs doesn't include the ip=XX.XX.XX.XX OR if I put ip=dhcp
I don't get ethernet the mii-diag --restart eth0 give me errors:
No MII transceiver present!
"Boardargs"?
Please put more effort into spelling or word choice, and punctuate your sentences.

Regards
davidz
Posts: 3
Joined: Thu Jan 24, 2019 10:33 pm

Re: Ethernet/PHY problems on SAMA5

Tue Jan 29, 2019 9:53 am

Thanks for the fast reply, this missing details are:
- hardware is sama5d27_som1 evaluation kit configured to boot from sdcard
- bootstrap version 3.8.12
- u-boot version 2018.07-linux4sam_6.0
- Linux 4.7.10

The root filesystem is ramfs using busybox.
As mentioned in the previous post, if u-boot perform Ethernet initialization and pass "ip" via bootargs to kernel, everything work well. But if the Ethernet is not initialized via u-boot, the kernel failed to bring up the Ethernet connection.
The /etc/network/interfaces file looks like:
auto eth0
iface eth0 inet dhcp

I even try to perform the following command:
#mii-diag --restart eth0
which return message: No MII transceiver present!.

Currently I perform Ethernet initialization during u-boot in order have Linux network working correctly, but I'd prefer to initialize Ethernet when Linux start up.
thanks for the following link which point to the same problem
viewtopic.php?f=12&t=21030
Does this problem still exist or do I miss something ?
Do I need to perform some modification in the kernel ?
Thanks in advance
blue_z
Location: USA
Posts: 1924
Joined: Thu Apr 19, 2007 10:15 pm

Re: Ethernet/PHY problems on SAMA5

Wed Jan 30, 2019 3:42 am

davidz wrote: - hardware is sama5d27_som1 evaluation kit configured to boot from sdcard
...
- Linux 4.7.10
So you're using an older mainline kernel rather than a Linux4SAM kernel?
I only have a SAMA5D2C-XULT, and did build a 4.7.10 kernel.
I tried to replicate your circumstances, but cannot duplicate your exact failure.

As the kernel boots, there is incomplete initialization of eth0, so acquisition of an IP address fails:
Starting network: IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
udhcpc: started, v1.27.2
udhcpc: sending discover
udhcpc: sending discover
udhcpc: sending discover
udhcpc: no lease, failing
FAIL
But at the shell prompt:
# mii-diag --restart eth0
Restarting negotiation...
Basic registers of MII PHY #1: 1000 7849 0022 1561 81e1 0000 0004 2001.
Basic mode control register 0x1000: Auto-negotiation enabled.
Basic mode status register 0x7849 ... 7849.
Link status: not established.
End of basic transceiver information.
And then eventual sucess
# udhcpc
udhcpc: started, v1.27.2
udhcpc: sending discover
udhcpc: sending discover
udhcpc: sending select for 192.168.1.90
udhcpc: lease of 192.168.1.90 obtained, lease time 172800
deleting routers
adding dns 192.168.1.1
# ping 192.168.1.1
PING 192.168.1.1 (192.168.1.1): 56 data bytes
64 bytes from 192.168.1.1: seq=0 ttl=64 time=1.316 ms
64 bytes from 192.168.1.1: seq=1 ttl=64 time=1.106 ms
...

When I boot the board with the Linux4SAM_6.0 kernel (based on 4.14.73) (with the same ramfs), the DHCP request is successful during network initialization:
Starting network: IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
macb f8008000.ethernet eth0: link up (100/Full)
IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
udhcpc: started, v1.27.2
udhcpc: sending discover
udhcpc: sending select for 192.168.1.90
udhcpc: lease of 192.168.1.90 obtained, lease time 172800
deleting routers
adding dns 192.168.1.1
OK

Regards
davidz
Posts: 3
Joined: Thu Jan 24, 2019 10:33 pm

Re: Ethernet/PHY problems on SAMA5

Sun Feb 03, 2019 11:48 am

Thanks :D

Return to “LINUX”

Who is online

Users browsing this forum: No registered users and 2 guests