cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
jcruchaga
Participant
Participant
2,955 Views
Registered: ‎08-25-2017

Secondary eth1 ethernet port not working

We are having trouble getting a second Ethernet port working with Zynq and Petalinux 2017.3 We are using two Marvell 88E1512 phys. The device tree is attached (system.dts).

 

The device tree contains next interfaces:

 

        gem1: ethernet@ff0c0000 {
            compatible = "cdns,zynqmp-gem";
            status = "disabled";
            interrupt-parent = <&gic>;
            interrupts = <0 59 4>, <0 59 4>;
            reg = <0x0 0xff0c0000 0x0 0x1000>;
            clock-names = "pclk", "hclk", "tx_clk";
            #address-cells = <1>;
            #size-cells = <0>;
            #stream-id-cells = <1>;
            iommus = <&smmu 0x875>;
            power-domains = <&pd_eth1>;
        };

        gem3: ethernet@ff0e0000 {
            compatible = "cdns,zynqmp-gem";
            status = "disabled";
            interrupt-parent = <&gic>;
            interrupts = <0 63 4>, <0 63 4>;
            reg = <0x0 0xff0e0000 0x0 0x1000>;
            clock-names = "pclk", "hclk", "tx_clk";
            #address-cells = <1>;
            #size-cells = <0>;
            #stream-id-cells = <1>;
            iommus = <&smmu 0x877>;
            power-domains = <&pd_eth3>;
        };

 

It seems these interfaces are well configured.When we execute the kernel and execute ifconfig command only the eth0 interface is showed:

 

root@tyr_mpsoc2:~# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:0A:35:00:20:18  
          inet6 addr: fe80::20a:35ff:fe00:2018%4879720/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:12 errors:0 dropped:0 overruns:0 frame:0
          TX packets:22 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:3936 (3.8 KiB)  TX bytes:4892 (4.7 KiB)
          Interrupt:30

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1%4879720/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

 

But we can find that eth1 is well defined into /etc/network/interfaces:

 

# Wired or wireless interfaces
auto eth0
iface eth0 inet dhcp
iface eth1 inet dhcp

 

But when I try to launch the eth1 interface:

 

root@tyr_mpsoc2:/etc/network# ifconfig eth1 up  

Only shows a unique lo:

[ 7230.410790] IPv6: ADDRCONF(NETDEV_UP): eth1: link is not ready

 

Instead of a well behaviour:

 

root@tyr_mpsoc2:/etc/network# ifconfig eth0 down

root@tyr_mpsoc2:/etc/network# [ 7202.154929] macb ff0c0000.ethernet eth0: link down

 

root@tyr_mpsoc2:/etc/network# ifconfig eth0 up

[ 7219.010840] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready

[ 7219.017017] macb ff0c0000.ethernet eth0: link up (1000/Full)

[ 7219.022631] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready

 

As result we have no communication through eth1, trying a ping no packages are sended through such interface. It seems like something between phisycal and logical layer is not working well.

 

Somebody could help me?

 

 

 

0 Kudos
10 Replies
ottob
Explorer
Explorer
2,915 Views
Registered: ‎05-26-2017

What does the boot log say ?

 

dmesg | grep 'macb\|phy'

 

My guess is that this is a problem with the second PHY's MDIO

 

0 Kudos
sandeepg
Moderator
Moderator
2,898 Views
Registered: ‎04-24-2017

Hi @jcruchaga,

 

Can you decompile the dtb to dts and attach here.

 

$ dtc -I dtb -O dts -o system.dts system.dtb
Thanks,
Sandeep
PetaLinux Yocto | Embedded SW Support

---------------------------------------------------------------------------
Don’t forget to Reply, Kudo, and Accept as Solution.
---------------------------------------------------------------------------
0 Kudos
jcruchaga
Participant
Participant
2,868 Views
Registered: ‎08-25-2017

I @ottob here my boot log:

 

root@tyr_mpsoc2:~# dmesg | grep 'macb\|phy'
[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] arm_arch_timer: Architected cp15 timer(s) running at 33.33MHz (phys).
[    2.669640] libphy: Fixed MDIO Bus: probed
[    2.689976] macb ff0c0000.ethernet: Not enabling partial store and forward
[    2.697168] libphy: MACB_mii_bus: probed
[    2.775213] macb ff0c0000.ethernet eth0: Cadence GEM rev 0x50070106 at 0xff0c0000 irq 30 (00:0a:35:00:22:01)
[    2.784975] Marvell 88E1510 ff0c0000.etherne:01: attached PHY driver [Marvell 88E1510] (mii_bus:phy_addr=ff0c0000.etherne:01, irq=-1)
[    2.797175] macb ff0e0000.ethernet: Not enabling partial store and forward
[    2.804350] libphy: MACB_mii_bus: probed
[    2.883148] macb ff0e0000.ethernet eth1: Cadence GEM rev 0x50070106 at 0xff0e0000 irq 31 (00:0a:35:00:22:01)
[    2.892911] Marvell 88E1510 ff0e0000.etherne:01: attached PHY driver [Marvell 88E1510] (mii_bus:phy_addr=ff0e0000.etherne:01, irq=-1)
[    7.627351] macb ff0c0000.ethernet eth0: link up (1000/Full)

 

0 Kudos
jcruchaga
Participant
Participant
2,867 Views
Registered: ‎08-25-2017

Hi @sandeepg here my system.dts.

 

Thanks.

 

 

0 Kudos
jcruchaga
Participant
Participant
2,854 Views
Registered: ‎08-25-2017

Hi,

 

We are using macb driver (http://www.wiki.xilinx.com/Macb+Driver) in our Petalinux build.

We need to change the state of some phy registers through mdio interface. As far as I know the driver supports for mdio access, but it is not very clear to me how. Can somebody tell me how that can be done? Is there any documentation about how to use the interfaces of MDIO support for PHY layer management?

 

Thanks,

 

Julen.

0 Kudos
ottob
Explorer
Explorer
2,831 Views
Registered: ‎05-26-2017

We use phytool for this 

 

phytool write eth1/0xF/0x18 0x0d0b #Green Link / Act. Amber = Error
phytool write eth1/0xF/0x19 0x0000 #Fix LED polarity

 

 

0 Kudos
jcruchaga
Participant
Participant
2,819 Views
Registered: ‎08-25-2017

Hi @ottob,

 

How do you install such tool into petalinux build? Is there any options into petalinux-config?

 

Thanks,

 

Julen

0 Kudos
sandeepg
Moderator
Moderator
2,799 Views
Registered: ‎04-24-2017

Hi @jcruchaga,

 

In <plnx-proj-root>/project-spec/meta-user/conf/petalinuxbsp.conf add this

IMAGE_INSTALL_append += "\
    phytool \
    "

We will check your dts

Thanks,
Sandeep
PetaLinux Yocto | Embedded SW Support

---------------------------------------------------------------------------
Don’t forget to Reply, Kudo, and Accept as Solution.
---------------------------------------------------------------------------
0 Kudos
jcruchaga
Participant
Participant
2,786 Views
Registered: ‎08-25-2017

Hi @ottob,

 

How do you read the different pages of PHY registers? Do you need to write into pages register the number of current page or something like this?

 

Thanks,

Julen.

0 Kudos
ottob
Explorer
Explorer
2,309 Views
Registered: ‎05-26-2017

Hi Julen !

 

The PHY's I've dealt with have just been straight forward register writes. i.e.

 

phytool write eth1/0xF/0x18 0x0d0b #Green Link / Act. Amber = Error
phytool write [interface]/[MDIO/PHY Address]/[Register] [Value] 

 

For anything more complicated see the PHY datasheet or possibly the kernel driver for hints on how to access it

 

/Otto

0 Kudos