This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux/AM5728: PRU Ethernet doesn't work

Part Number: AM5728
Other Parts Discussed in Thread: TLK105,

Tool/software: Linux

on our custom board, we want to use prueth ports as general 100Mbps ethernet interfaces. We have modified the device-tree,pinmux and the pru_rproc.c driver . Now it can generate the eth2 and eth3 and the firmware (am57xx-pru0-prueth-fw.elf,am57xx-pru1-prueth-fw.elf) can also be loaded successfully. However we can not ping another ip address using eth2 or eth3, and the pc host can not ping eth2 or eth3 ip address,at the same time we get the pru2_mii0_rxctl signal changed only, the pru2_mii0_txctl always stay on "0".   when we use 'ifup eth2', the output is stop at 'send discover..' as follows, it seems the emac_ndo_open function is not called.  

What wrong with it ? Could some one give me some advices, please?

root@am57xx-evm:~# ifup eth2
udhcpc (v1.24.1) started
Sending discover...
Sending discover...
^C
root@am57xx-evm:~#

the boot messages related to PRU is:

root@am57xx-evm:~# dmesg |grep pru
[    8.183248] ti-pruss 4b280000.pruss: creating PRU cores and other child platform devices
[    8.220098] of_get_named_gpiod_flags: parsed 'reset-gpios' property of node '/ocp/pruss@4b280000/mdio@4b2b2400[0]' - status (0)
[    8.579299]  remoteproc2: 4b2b4000.pru0 is available
[    8.662804] pru-rproc 4b2b4000.pru0: PRU rproc node /ocp/pruss@4b280000/pru0@4b2b4000 probed successfully
[    8.676090]  remoteproc3: 4b2b8000.pru1 is available
[    8.734207] pru-rproc 4b2b8000.pru1: PRU rproc node /ocp/pruss@4b280000/pru1@4b2b8000 probed successfully
[    8.801613] prueth pruss2_eth: port 1: using random MAC addr: f2:99:72:32:e4:15
[    8.971744] prueth pruss2_eth: port 2: using random MAC addr: 2a:8e:bd:58:e1:f0
[    9.198300] prueth pruss2_eth: TI PRU ethernet driver initialized
[   10.524458]  remoteproc3: powering up 4b2b8000.pru1
[   10.524767]  remoteproc3: Booting fw image am57xx-pru2_1-fw, size 76004
[   10.524947] ti-pruss 4b280000.pruss: configured system_events = 0x00000000000c0000 intr_channels = 0x0000000a host_intr = 0x0000000a
[   10.533844]  remoteproc3: remote processor 4b2b8000.pru1 is now up
[   10.609410]  remoteproc2: powering up 4b2b4000.pru0
[   10.609676]  remoteproc2: Booting fw image am57xx-pru2_0-fw, size 76004
[   10.609833] ti-pruss 4b280000.pruss: configured system_events = 0x0000000000030000 intr_channels = 0x00000005 host_intr = 0x00000005
[   10.627875]  remoteproc2: remote processor 4b2b4000.pru0 is now up
[   11.228039] virtio_rpmsg_bus virtio2: creating channel rpmsg-pru addr 0x20
[   11.254469] virtio_rpmsg_bus virtio3: creating channel rpmsg-pru addr 0x21
[   11.550919] rpmsg_pru rpmsg2: new rpmsg_pru device: /dev/rpmsg_pru32
[   11.565268] rpmsg_pru rpmsg3: new rpmsg_pru device: /dev/rpmsg_pru33
root@am57xx-evm:~# ethtool eth2                                                                                                                        
Settings for eth2:
        Supported ports: [ TP MII ]
        Supported link modes:   10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
        Supported pause frame use: Symmetric
        Supports auto-negotiation: Yes
        Advertised link modes:  10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
        Advertised pause frame use: Symmetric
        Advertised auto-negotiation: Yes
        Link partner advertised link modes:  10baseT/Half 10baseT/Full
                                             100baseT/Half 100baseT/Full
        Link partner advertised pause frame use: Symmetric Receive-only
        Link partner advertised auto-negotiation: Yes
        Speed: 100Mb/s
        Duplex: Full
        Port: MII
        PHYAD: 1
        Transceiver: external
        Auto-negotiation: on
        Link detected: yes
root@am57xx-evm:~# ifconfig eth2 192.168.2.3
root@am57xx-evm:~# ping 192.168.2.2
PING 192.168.2.2 (192.168.2.2): 56 data bytes

^C
--- 192.168.2.2 ping statistics ---
12 packets transmitted, 0 packets received, 100% packet loss

Best Regards

  • Hi,

    Which TI Linux SDK are you using? Also could you please attach the following to this post:

    - The network topology that you are setting up, where is the device with the ip address of 192.168.2.2 located?
    - The results of ifconfig -a
    - A writeshark capture of port eth2

    Best Regards,
    Schuyler
  • hi, Schuyler
    Thank you for the reply! The linux SDK is ' linux-rt-4.4.41+gitAUTOINC+968d071ce9-g968d071ce9'.
    The pc host connect to custom board by Ethermet cables directly, the pc host ip address is 192.168.2.2.
    the pc host can ping eth0 , that 1000Mbps ethernet interfaces.

    at the pc host when we  insert  the cable ,the wireshark  get the two  infor as below.

     sources                       Destination  protocol length Info

       fe80::62a4:4cff:fed5:87ee    ff02::16    ICMPv6    110    Multicast Listener Report Message v2

       fe80::62a4:4cff:fed5:87ee    ff02::fb    MDNS    111    Standard query 0x0000 SRV am57xx-evm._sftp-ssh._tcp.local, "QM" question


    The results of ifconfig -a is:
    root@am57xx-evm:~# ifconfig -a
    eth0 Link encap:Ethernet HWaddr 94:E3:6D:43:36:EE
    inet addr:192.168.2.10 Bcast:192.168.2.255 Mask:255.255.255.0
    UP BROADCAST MULTICAST MTU:1500 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:1000
    RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
    Interrupt:102

    eth1 Link encap:Ethernet HWaddr 94:E3:6D:43:36:EF
    inet addr:192.168.2.20 Bcast:192.168.2.255 Mask:255.255.255.0
    UP BROADCAST MULTICAST MTU:1500 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:1000
    RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

    eth2      Link encap:Ethernet  HWaddr A6:09:30:26:88:A6  
              inet addr:192.168.2.3  Bcast:192.168.2.255  Mask:255.255.255.0
              inet6 addr: fe80::a409:30ff:fe26:88a6%3068322584/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:0 errors:0 dropped:0 overruns:0 frame:0
              TX packets:16 errors:0 dropped:503048215 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:0 (0.0 B)  TX bytes:2796 (2.7 KiB)



    eth3 Link encap:Ethernet HWaddr 6E:0A:BC:9F:9A:FE
    UP BROADCAST MULTICAST MTU:1500 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:1000
    RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

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

    sit0 Link encap:IPv6-in-IPv4
    NOARP MTU:1480 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)

  • Hi,

    I believe the issue is that you have several ports connected to the same subnet. eth0, eth1 and eth2 are all connected to the same subnet, 192.168.2.x. If you disconnect eth0 and eth1 I expect eth2 should be able to ping the 192.168.2.2 address. Essentially the issue is that the ARP message sequence is being processed by the kernel on a different than eth2 in this case.

    This presentation has a section concerning why ethernet ports on the same subnet came be an issue. Starting about slide 51 will be the section that covers this topic.

    training.ti.com/.../ETH_System_SW_on_AMClass_Devices.pdf


    Best Regards,
    Schuyler
  • Hi,Schuyler,

           Thank you for your help. We have four ports, but the topology of network is point to point when we test,  that is, only the eth2 port connect to  pc host. moreover, we put the other eth down, the eth2 not work as before and get messg like below:

        at the same time, the wireshark  on the pc host does not get the message " fe80::62a4:4cff:fed5:87ee    ff02::fb    MDNS    111    Standard query 0x0000 SRV am57xx-evm._sftp-ssh._tcp.local, "QM" question"

         On our custom board the prueth phy chip is ksz8081 different that Am572XIDK board use tlk105. Where maybe  the problem?

    root@am57xx-evm:~# ifconfig eth0 down                                                                                                                    
    root@am57xx-evm:~# ifconfig eth1 down                                                                                                                    
    root@am57xx-evm:~# ifconfig eth3 down                                                                                                                    
    [  292.828104] net eth3: stopped                                                                                                                         
    root@am57xx-evm:~# ifconfig eth2 192.168.2.3                                                                                                             
    root@am57xx-evm:~# [  312.742193] eth2: Link is Down                                                                                                     
    [  317.696822] eth2: Link is Up - 100Mbps/Full - flow control off                                                                                        
    ifconfig -a eth2                                                                                                                                         
    eth2      Link encap:Ethernet  HWaddr BE:81:9B:20:72:34                                                                                                  
              inet addr:192.168.2.3  Bcast:192.168.2.255  Mask:255.255.255.0                                                                                 
              inet6 addr: fe80::bc81:9bff:fe20:7234%3068687128/64 Scope:Link                                                                                 
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1                                                                                             
              RX packets:0 errors:0 dropped:0 overruns:0 frame:0                                                                                             
              TX packets:16 errors:0 dropped:122043054 overruns:0 carrier:0                                                                                  
              collisions:0 txqueuelen:1000                                                                                                                   
              RX bytes:0 (0.0 B)  TX bytes:2816 (2.7 KiB)                                                                                                    
                                                                                                                                                             
    root@am57xx-evm:~# ping 192.168.2.2                                                                                                                      
    PING 192.168.2.2 (192.168.2.2): 56 data bytes                                                                                                            
    ^C                                                                                                                                                       
    ^C                                                                                                                                                       
                                                                                                                                                             
    --- 192.168.2.2 ping statistics ---                                                                                                                      
    1 packets transmitted, 0 packets received, 100% packet loss                                                                                              
    root@am57xx-evm:~#                                                                                                                                       
    root@am57xx-evm:~# [  624.386914] systemd[1]: systemd-timesyncd.service: Watchdog timeout (limit 3min)!                                                  
    [  624.401141] systemd[1]: systemd-journald.service: Main process exited, code=dumped, status=6/ABRT                                                     
    [  624.414920] systemd[1]: systemd-journald.service: Unit entered failed state.                                                                          
    [  624.422665] systemd[1]: systemd-journald.service: Failed with result 'core-dump'.                                                                     
    [  624.443788] systemd[1]: systemd-journald.service: Service has no hold-off time, scheduling restart.                                                   
    [  624.459536] systemd[1]: Stopped Flush Journal to Persistent Storage.                                                                                  
    [  624.465956] systemd[1]: Stopping Flush Journal to Persistent Storage...                                                                               
    [  624.472677] systemd[1]: Stopped Journal Service.                                                                                                      
    [  624.558238] systemd[1]: Starting Journal Service...                                                                                                   
    [  624.578230] systemd-journald[1257]: File /run/log/journal/c0d1b4c7c3304180ace2cc329fbd590c/system.journal corrupted or uncleanly shut down, renaming .
    [  624.590786] systemd[1]: systemd-timesyncd.service: Main process exited, code=killed, status=6/ABRT                                                    
    [  624.593298] systemd[1]: systemd-timesyncd.service: Unit entered failed state.                                                                         
    [  624.593317] systemd[1]: systemd-timesyncd.service: Failed with result 'signal'.                                                                       
    [  624.621116] systemd[1]: systemd-timesyncd.service: Service has no hold-off time, scheduling restart.                                                  
    [  624.670744] systemd[1]: Stopped Network Time Synchronization.                                                                                         
    [  624.676013] systemd[1]: Starting Network Time Synchronization...                                                                                      
    [  624.746772] systemd[1]: Started Journal Service.     

    Best Regards

  • Hi,

    There could be phy issue.

    Lets just work on eth2 alone, no other ports connected with network cables. So please unplug all the network cables from all the ports.

    Please perform these steps:
    - Perform ethtool eth2 to make sure link is reported down
    - Plug in the cable on eth2, there should be a message printed on the console about the link being established
    - Perform ethtool eth2 and make sure the link is established, above the link was reported as detected
    - Since you have wireshark start capturing packets on the line going to eth2. Do you any packets being sent from eth2? ones that have the MAC address reported by ifconfig eth2? If you don't have packets coming this might be a phy issue to be resolved.
    - If you see packets coming from eth2 then perform the ping, you should see arp packets coming from eth2.

    Best Regards,
    Schuyler
  • hi, Schuyler
        Thank you for the reply! we do the step as your mention. At the fourth step we get nothing from eth2 by wireshark. we ever suspected the hardware of phy. but the intial message show that the phy is ok(msg:"davinci_mdio 4b2b2400.mdio: phy[1]: device 4b2b2400.mdio:01, driver Micrel KSZ8081 or KSZ8091, davinci_mdio 4b2b2400.mdio: phy[3]: device 4b2b2400.mdio:03, driver Micrel KSZ8081 or KSZ8091"). when we plug in cable, the connect can be recognized. what's more when we ping form pc host, the pru2_mii0_rxctl signal become active, just pru2_mii0_txctl always stay on "0", the  pru2_mii0_txctl never change too, even if we ping form custom board. so it seems  the kenerl or driver do not transmit and do not response the rx signal, the phy is working well?  what should we do next? could you give us some advise? thank you !

    the mesg is :

     Starting Permit User Sessions...[    8.489057] libphy: 4b2b2400.mdio: probed
    [    8.690838] davinci_mdio 4b2b2400.mdio: phy[1]: device 4b2b2400.mdio:01, driver Micrel KSZ8081 or KSZ8091
    [    8.723958] davinci_mdio 4b2b2400.mdio: phy[3]: device 4b2b2400.mdio:03, driver Micrel KSZ8081 or KSZ8091


    root@am57xx-evm:~# ifconfig eth0 down
    root@am57xx-evm:~# ifconfig eth1 down                                                                                                                       
    root@am57xx-evm:~# ifconfig eth2 down                                                                                                                       
    [   77.188263] net eth2: stopped
    root@am57xx-evm:~# ifconfig eth3 down                                                                                                                       
    [   83.078235] net eth3: stopped
    root@am57xx-evm:~# ifconfig
    lo        Link encap:Local Loopback  
              inet addr:127.0.0.1  Mask:255.0.0.0
              inet6 addr: ::1%131536/128 Scope:Host
              UP LOOPBACK RUNNING  MTU:65536  Metric:1
              RX packets:160 errors:0 dropped:0 overruns:0 frame:0
              TX packets:160 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1
              RX bytes:12160 (11.8 KiB)  TX bytes:12160 (11.8 KiB)

    root@am57xx-evm:~# ethtool eth2
    Settings for eth2:
            Supported ports: [ TP MII ]
            Supported link modes:   10baseT/Half 10baseT/Full
                                    100baseT/Half 100baseT/Full
            Supported pause frame use: Symmetric
            Supports auto-negotiation: Yes
            Advertised link modes:  10baseT/Half 10baseT/Full
                                    100baseT/Half 100baseT/Full
            Advertised pause frame use: Symmetric
            Advertised auto-negotiation: Yes
            Speed: 10Mb/s
            Duplex: Half
            Port: MII
            PHYAD: 1
            Transceiver: external
            Auto-negotiation: on
            Link detected: no

    root@am57xx-evm:~# ifconfig eth2 up
    [  341.521198] net eth2: started
    [  341.525324] IPv6: ADDRCONF(NETDEV_UP): eth2: link is not ready
    root@am57xx-evm:~# [  341.748317] eth2: Link is Up - 100Mbps/Full - flow control off
    [  341.754193] IPv6: ADDRCONF(NETDEV_CHANGE): eth2: link becomes ready

    root@am57xx-evm:~# ifconfig
    eth2      Link encap:Ethernet  HWaddr B6:7B:FA:67:6F:14  
              inet6 addr: fe80::b47b:faff:fe67:6f14%131536/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:0 errors:0 dropped:0 overruns:0 frame:0
              TX packets:16 errors:0 dropped:55109112 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:0 (0.0 B)  TX bytes:2570 (2.5 KiB)

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

    Best Regards,

    guoping-yang

       

  • Hi,

    This link not detected has to be fixed first, but I see something from earlier in this thread that is raising a question.

    ethtool eth2
    .......
    Link detected: no

    Without a link detected the interface will not send packets.
    From earlier in this thread the ethtool command showed the link was up:

    ethtool eth2
    .......
    Link detected: yes

    So this question of why the link is reporting up when it is not needs to be resolved. This might be a PHY addressing problem.

    Please remove the cable plugged into eth2. Then, one at a time for each port, plug in a network cable to the ethernet port and perform the ethtool eth2 command and look at the link detected field. We are looking to see if plugging in a cable makes eth2 get a link detected. Please note that only one cable should be plugged in at a time.

    Best Regards,
    Schuyler
  • hi, Schuyler:

          Thank for your patient!   There is only one cable when we test, so all the test result above metioned  base on  one cable be plugged. It just change the cable port form eth0 to eth2, so sometime it seems link or not link. The PHY addressing  recognized by driver is match to the hardware design, and we can sure the phy can detect the status of cable changed according to the console print message.  The pru2_mii0_rxctl signal  by  PHY output is valid when we ping form pc host, but the  pru2_mii0_txctl by am5728 output always stay on "0" . It seems the pru-driver do not response the rx signal. But we don't know how does the rx or tx  work in pru-mii-rt?  Could you give us some help? Thank you!   

    .[    8.489057] libphy: 4b2b2400.mdio: probed
    [    8.690838] davinci_mdio 4b2b2400.mdio: phy[1]: device 4b2b2400.mdio:01, driver Micrel KSZ8081 or KSZ8091
    [    8.723958] davinci_mdio 4b2b2400.mdio: phy[3]: device 4b2b2400.mdio:03, driver Micrel KSZ8081 or KSZ8091

    the phy address and type is matching to the hardware.

    Best Regards

  • Hi,
    If I understand correctly what you are describing, eth2 will show a link status detected occasionally? But in both cases of link detected and not detected no traffic is being passed? Earlier in the post you mentioned that wireshark is not showing any traffic, is that true with the link status shows detected?

    This issue could be that the PHY is not getting a good reset. Could you attach the section that shows the PHY and PRU ETH connection? This should be something you can review with the PHY manufacturer about how to debug if the PHY has not received a good reset.

    Best Regards,
    Schuyler
  • hi, Schuyler
        Thank you for the reply! I am sorry for that's  make you confused. The eth2 link can right detected always(according to mesg 'eth2: Link is Up - 100Mbps/Full - flow control off  '. ),and wireshark is not showing any traffic. we don't know the link status mesg is  true, but the phy can receive package according to the 'pru2_mii0_rxctl' signal  by  PHY output is valid when we ping form pc host.

        The reset generate used GPIO,  we grab the reset  by oscilloscope that is ok.

       We do the following test:

    1) reboot(only connect eth2);

    2)remove eht2 then pluge eth0 ;

    3)remove eht0 then pluge eth2;

    4) poweroff,then poweron(only connect eth2);

    5) remove eht2 then pluge eth0;
    6) remove eht0 then pluge eth2

        According to the mesg, the eth2 cannot detect the link change after poweroff, but the PHY status that read from PHY register by MDIO is right(phy register bit 8=link is up, bit4 =Signal present on receive differential pair) .   it seems the link status shows detected is not true. What matter with it?  Where maybe the wrong? Thank you!

    ************************************************

    The test mesg:

    1) reboot(only connect eth2)

    am57xx-evm login: root                                                          
    root@am57xx-evm:~# ethtool eth2                                                 
    Settings for eth2:                                                              
            Supported ports: [ TP MII ]                                             
            Supported link modes:   10baseT/Half 10baseT/Full                       
                                    100baseT/Half 100baseT/Full                     
            Supported pause frame use: Symmetric                                    
            Supports auto-negotiation: Yes                                          
            Advertised link modes:  10baseT/Half 10baseT/Full                       
                                    100baseT/Half 100baseT/Full                     
            Advertised pause frame use: Symmetric                                   
            Advertised auto-negotiation: Yes                                        
            Link partner advertised link modes:  10baseT/Half 10baseT/Full          
                                                 100baseT/Half 100baseT/Full        
            Link partner advertised pause frame use: No                             
            Link partner advertised auto-negotiation: Yes                           
            Speed: 100Mb/s                                                          
            Duplex: Full                                                            
            Port: MII                                                               
            PHYAD: 1                                                                
            Transceiver: external                                                   
            Auto-negotiation: on                                                    
            Link detected: yes  

    2)remove eht2 then pluge eth0  

    root@am57xx-evm:~# [   41.048002] NOHZ: local_softirq_pending 80                
    [  117.986582] cpsw 48484000.ethernet eth0: Link is Up - 100Mbps/Full - flow cof
    [  117.998597] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready          
                                                                                    
    root@am57xx-evm:~# ethtool eth0                                                 
    Settings for eth0:                                                              
            Supported ports: [ TP MII ]                                             
            Supported link modes:   10baseT/Half 10baseT/Full                       
                                    100baseT/Half 100baseT/Full                     
                                    1000baseT/Half 1000baseT/Full                   
            Supported pause frame use: Symmetric                                    
            Supports auto-negotiation: Yes                                          
            Advertised link modes:  10baseT/Half 10baseT/Full                       
                                    100baseT/Half 100baseT/Full                     
                                    1000baseT/Half 1000baseT/Full                   
            Advertised pause frame use: Symmetric                                   
            Advertised auto-negotiation: Yes                                        
            Link partner advertised link modes:  10baseT/Half 10baseT/Full          
                                                 100baseT/Half 100baseT/Full        
            Link partner advertised pause frame use: No                             
            Link partner advertised auto-negotiation: Yes                           
            Speed: 100Mb/s                                                          
            Duplex: Full                                                            
            Port: MII                                                               
            PHYAD: 1                                                                
            Transceiver: external                                                   
            Auto-negotiation: on                                                    
            Supports Wake-on: d                                                     
            Wake-on: d                                                              
            Current message level: 0x00000000 (0)                                   
                                                                                    
            Link detected: yes                                                      
    root@am57xx-evm:~# [  129.570701] eth2: Link is Down                            
    [  129.570715] eth2: No link to transmit                                        
    [  129.570723] eth2: No link to transmit                                        
    [  129.570729] eth2: No link to transmit                                        
    [  129.570736] eth2: No link to transmit                                        
    [  129.570742] eth2: No link to transmit                                        
    [  129.570748] eth2: No link to transmit                                        
    [  129.570753] eth2: No link to transmit                                        
    [  129.570758] eth2: No link to transmit                                        
    [  129.570764] eth2: No link to transmit                                        
                                                                                    
    root@am57xx-evm:~# [  145.005552] eth2: No link to transmit  
     
    3)remove eht0 then pluge eth2

    [  145.005553] cpsw 48484000.ethernet eth0: Link is Down                        
    [  146.969188] eth2: Link is Up - 100Mbps/Full - flow control off               
                                                                                    
    root@am57xx-evm:~#                                                              
    root@am57xx-evm:~# [  298.196867] systemd[1]: systemd-journald.service: Main prT
    [  298.210740] systemd[1]: systemd-journald.service: Unit entered failed state.
    [  298.218589] systemd[1]: systemd-journald.service: Failed with result 'core-d.
    [  298.239798] systemd[1]: systemd-journald.service: Service has no hold-off ti.
    [  298.255238] systemd[1]: Stopped Flush Journal to Persistent Storage.         
    [  298.261754] systemd[1]: Stopping Flush Journal to Persistent Storage...      
    [  298.268496] systemd[1]: Stopped Journal Service.                             
    [  298.358546] systemd[1]: Starting Journal Service...                          
    [  298.377027] systemd-journald[1217]: File /run/log/journal/c0d1b4c7c3304180ac.
    [  298.438965] systemd[1]: Started Journal Service.


    4) poweroff,then poweron(only connect eth2)

    root@am57xx-evm:~# ethtool eth2                                                 
    Settings for eth2:                                                              
            Supported ports: [ TP MII ]                                             
            Supported link modes:   10baseT/Half 10baseT/Full                       
                                    100baseT/Half 100baseT/Full                     
            Supported pause frame use: Symmetric                                    
            Supports auto-negotiation: Yes                                          
            Advertised link modes:  10baseT/Half 10baseT/Full                       
                                    100baseT/Half 100baseT/Full                     
            Advertised pause frame use: Symmetric                                   
            Advertised auto-negotiation: Yes                                        
            Link partner advertised link modes:  10baseT/Half 10baseT/Full          
                                                 100baseT/Half 100baseT/Full        
            Link partner advertised pause frame use: No                             
            Link partner advertised auto-negotiation: Yes                           
            Speed: 100Mb/s                                                          
            Duplex: Full                                                            
            Port: MII                                                               
            PHYAD: 1                                                                
            Transceiver: external                                                   
            Auto-negotiation: on                                                    
            Link detected: yes                                                      
    root@am57xx-evm:~# ifconfig eth0 down                                           
    root@am57xx-evm:~# ifconfig eth1 down                                           
    root@am57xx-evm:~# ifconfig eth2 down                                           
    [   55.578460] net eth2: stopped                                                
    root@am57xx-evm:~# [   56.537875] eth2: Link is Down                            
    ifconfig eth3 down                                                              
    [   59.948411] net eth3: stopped                                                
    root@am57xx-evm:~# ifconfig eth2 up                                             
    [   71.411329] net eth2: started                                                
    [   71.415872] IPv6: ADDRCONF(NETDEV_UP): eth2: link is not ready               
    root@am57xx-evm:~# devmem2 0x4b2b2480 w 0x83c10000                              
    /dev/mem opened.                                                                
    Memory mapped at address 0xb6f13000.                                            
    Read at address  0x4B2B2480 (0xb6f13480): 0x208181E1                            
    Write at address 0x4B2B2480 (0xb6f13480): 0x83C10000, readback 0x83C10000       
    root@am57xx-evm:~# devmem2 0x4b2b2480                                           
    /dev/mem opened.                                                                
    Memory mapped at address 0xb6f16000.                                            
    Read at address  0x4B2B2480 (0xb6f16480): 0x23C10116                            
    root@am57xx-evm:~#
    root@am57xx-evm:~# ifconfig eth0 up                                             
    [  491.630805] net eth0: initializing cpsw version 1.15 (0)                     
    [  491.636151] net eth0: initialized cpsw ale version 1.4                       
    [  491.641564] net eth0: ALE Table size 1024                                    
    [  491.648653] ethernet phy attach ok!                                          
    [  491.739906] net eth0: phy found : id is : 0x221622                           
    [  491.753367] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready  

    5) remove eht2 then pluge eth0      
            
    root@am57xx-evm:~# [  515.746501] cpsw 48484000.ethernet eth0: Link is Up - 100f
    [  515.754404] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready   
    root@am57xx-evm:~# devmem2 0x4b2b2480 w 0x83c10000                              
    /dev/mem opened.                                                                
    Memory mapped at address 0xb6f04000.                                            
    Read at address  0x4B2B2480 (0xb6f04480): 0x23C10136                            
    Write at address 0x4B2B2480 (0xb6f04480): 0x83C10000, readback 0x83C10000       
    root@am57xx-evm:~# devmem2 0x4b2b2480                                           
    /dev/mem opened.                                                                
    Memory mapped at address 0xb6fec000.                                            
    Read at address  0x4B2B2480 (0xb6fec480): 0x23C10020
    (phy register bit 8=link is down, bit4 =No signal present on receive differential pair)
     
    6) remove eht0 then pluge eth2         
                                                                                    
    root@am57xx-evm:~# [  575.755448] cpsw 48484000.ethernet eth0: Link is Down     
    root@am57xx-evm:~# ethtool eth2                                                 
    Settings for eth2:                                                              
            Supported ports: [ TP MII ]                                             
            Supported link modes:   10baseT/Half 10baseT/Full                       
                                    100baseT/Half 100baseT/Full                     
            Supported pause frame use: Symmetric                                    
            Supports auto-negotiation: Yes                                          
            Advertised link modes:  10baseT/Half 10baseT/Full                       
                                    100baseT/Half 100baseT/Full                     
            Advertised pause frame use: Symmetric                                   
            Advertised auto-negotiation: Yes                                        
            Speed: 10Mb/s                                                           
            Duplex: Half                                                            
            Port: MII                                                               
            PHYAD: 1                                                                
            Transceiver: external                                                   
            Auto-negotiation: on                                                    
            Link detected: no                                                       
    root@am57xx-evm:~# devmem2 0x4b2b2480 w 0x83c10000                              
    /dev/mem opened.                                                                
    Memory mapped at address 0xb6f28000.                                            
    Read at address  0x4B2B2480 (0xb6f28480): 0x23C10116                            
    Write at address 0x4B2B2480 (0xb6f28480): 0x83C10000, readback 0x83C10000       
    root@am57xx-evm:~# devmem2 0x4b2b2480                                           
    /dev/mem opened.                                                                
    Memory mapped at address 0xb6f2b000.                                            
    Read at address  0x4B2B2480 (0xb6f2b480): 0x23C10136  
    (phy register bit 8=link is up, bit4 =Signal present on receive differential pair)                          




          


  • hi, Schuyler
    We do the following test :
    1) reboot(only connect eth2);
    2)remove eht2 then pluge eth0 ;
    3)remove eht0 then pluge eth2 ;
    4) poweroff, then poweron(only connect eth2), let all the eth down,then let eth2 up;
    5) remove eht2 then pluge eth0
    6) remove eht0 then pluge eth2
    from the test msg, we know that the eth2 link cannot detect after poweroff, but the PHY status that read from phy register by MDIO is right.(phy register bit 8=link is up, bit4 =Signal present on receive differential pair). it seems the PHY working well ,but the pru-mii does not get the right infor. from PHY chip.
    Where maybe the problem? Thank you !

    the test msg:
    *********************************************
    1) reboot(only connect eth2)
    am57xx-evm login: root
    root@am57xx-evm:~# ethtool eth2
    Settings for eth2:
    Supported ports: [ TP MII ]
    Supported link modes: 10baseT/Half 10baseT/Full
    100baseT/Half 100baseT/Full
    Supported pause frame use: Symmetric
    Supports auto-negotiation: Yes
    Advertised link modes: 10baseT/Half 10baseT/Full
    100baseT/Half 100baseT/Full
    Advertised pause frame use: Symmetric
    Advertised auto-negotiation: Yes
    Link partner advertised link modes: 10baseT/Half 10baseT/Full
    100baseT/Half 100baseT/Full
    Link partner advertised pause frame use: No
    Link partner advertised auto-negotiation: Yes
    Speed: 100Mb/s
    Duplex: Full
    Port: MII
    PHYAD: 1
    Transceiver: external
    Auto-negotiation: on
    Link detected: yes

    2)remove eht2 then pluge eth0

    root@am57xx-evm:~# [ 41.048002] NOHZ: local_softirq_pending 80
    [ 117.986582] cpsw 48484000.ethernet eth0: Link is Up - 100Mbps/Full - flow cof
    [ 117.998597] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready

    root@am57xx-evm:~# ethtool eth0
    Settings for eth0:
    Supported ports: [ TP MII ]
    Supported link modes: 10baseT/Half 10baseT/Full
    100baseT/Half 100baseT/Full
    1000baseT/Half 1000baseT/Full
    Supported pause frame use: Symmetric
    Supports auto-negotiation: Yes
    Advertised link modes: 10baseT/Half 10baseT/Full
    100baseT/Half 100baseT/Full
    1000baseT/Half 1000baseT/Full
    Advertised pause frame use: Symmetric
    Advertised auto-negotiation: Yes
    Link partner advertised link modes: 10baseT/Half 10baseT/Full
    100baseT/Half 100baseT/Full
    Link partner advertised pause frame use: No
    Link partner advertised auto-negotiation: Yes
    Speed: 100Mb/s
    Duplex: Full
    Port: MII
    PHYAD: 1
    Transceiver: external
    Auto-negotiation: on
    Supports Wake-on: d
    Wake-on: d
    Current message level: 0x00000000 (0)

    Link detected: yes
    root@am57xx-evm:~# [ 129.570701] eth2: Link is Down
    [ 129.570715] eth2: No link to transmit
    [ 129.570723] eth2: No link to transmit
    [ 129.570729] eth2: No link to transmit
    [ 129.570736] eth2: No link to transmit
    [ 129.570742] eth2: No link to transmit
    [ 129.570748] eth2: No link to transmit
    [ 129.570753] eth2: No link to transmit
    [ 129.570758] eth2: No link to transmit
    [ 129.570764] eth2: No link to transmit

    root@am57xx-evm:~# [ 145.005552] eth2: No link to transmit

    3)remove eht0 then pluge eth2

    [ 145.005553] cpsw 48484000.ethernet eth0: Link is Down
    [ 146.969188] eth2: Link is Up - 100Mbps/Full - flow control off

    root@am57xx-evm:~#
    root@am57xx-evm:~# [ 298.196867] systemd[1]: systemd-journald.service: Main prT
    [ 298.210740] systemd[1]: systemd-journald.service: Unit entered failed state.
    [ 298.218589] systemd[1]: systemd-journald.service: Failed with result 'core-d.
    [ 298.239798] systemd[1]: systemd-journald.service: Service has no hold-off ti.
    [ 298.255238] systemd[1]: Stopped Flush Journal to Persistent Storage.
    [ 298.261754] systemd[1]: Stopping Flush Journal to Persistent Storage...
    [ 298.268496] systemd[1]: Stopped Journal Service.
    [ 298.358546] systemd[1]: Starting Journal Service...
    [ 298.377027] systemd-journald[1217]: File /run/log/journal/c0d1b4c7c3304180ac.
    [ 298.438965] systemd[1]: Started Journal Service.


    4) poweroff, then poweron

    root@am57xx-evm:~# ethtool eth2
    Settings for eth2:
    Supported ports: [ TP MII ]
    Supported link modes: 10baseT/Half 10baseT/Full
    100baseT/Half 100baseT/Full
    Supported pause frame use: Symmetric
    Supports auto-negotiation: Yes
    Advertised link modes: 10baseT/Half 10baseT/Full
    100baseT/Half 100baseT/Full
    Advertised pause frame use: Symmetric
    Advertised auto-negotiation: Yes
    Link partner advertised link modes: 10baseT/Half 10baseT/Full
    100baseT/Half 100baseT/Full
    Link partner advertised pause frame use: No
    Link partner advertised auto-negotiation: Yes
    Speed: 100Mb/s
    Duplex: Full
    Port: MII
    PHYAD: 1
    Transceiver: external
    Auto-negotiation: on
    Link detected: yes
    root@am57xx-evm:~# ifconfig eth0 down
    root@am57xx-evm:~# ifconfig eth1 down
    root@am57xx-evm:~# ifconfig eth2 down
    [ 55.578460] net eth2: stopped
    root@am57xx-evm:~# [ 56.537875] eth2: Link is Down
    ifconfig eth3 down
    [ 59.948411] net eth3: stopped
    root@am57xx-evm:~# ifconfig eth2 up
    [ 71.411329] net eth2: started
    [ 71.415872] IPv6: ADDRCONF(NETDEV_UP): eth2: link is not ready
    root@am57xx-evm:~# devmem2 0x4b2b2480 w 0x83c10000
    /dev/mem opened.
    Memory mapped at address 0xb6f13000.
    Read at address 0x4B2B2480 (0xb6f13480): 0x208181E1
    Write at address 0x4B2B2480 (0xb6f13480): 0x83C10000, readback 0x83C10000
    root@am57xx-evm:~# devmem2 0x4b2b2480
    /dev/mem opened.
    Memory mapped at address 0xb6f16000.
    Read at address 0x4B2B2480 (0xb6f16480): 0x23C10116
    root@am57xx-evm:~#
    root@am57xx-evm:~# ifconfig eth0 up
    [ 491.630805] net eth0: initializing cpsw version 1.15 (0)
    [ 491.636151] net eth0: initialized cpsw ale version 1.4
    [ 491.641564] net eth0: ALE Table size 1024
    [ 491.648653] ethernet phy attach ok!
    [ 491.739906] net eth0: phy found : id is : 0x221622
    [ 491.753367] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready

    5) remove eht2 then pluge eth0

    root@am57xx-evm:~# [ 515.746501] cpsw 48484000.ethernet eth0: Link is Up - 100f
    [ 515.754404] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
    root@am57xx-evm:~# devmem2 0x4b2b2480 w 0x83c10000
    /dev/mem opened.
    Memory mapped at address 0xb6f04000.
    Read at address 0x4B2B2480 (0xb6f04480): 0x23C10136
    Write at address 0x4B2B2480 (0xb6f04480): 0x83C10000, readback 0x83C10000
    root@am57xx-evm:~# devmem2 0x4b2b2480
    /dev/mem opened.
    Memory mapped at address 0xb6fec000.
    Read at address 0x4B2B2480 (0xb6fec480): 0x23C10020
    (phy register bit 8=link is down, bit4 = No signal present on receive differential pair)

    6) remove eht0 then pluge eth2

    root@am57xx-evm:~# [ 575.755448] cpsw 48484000.ethernet eth0: Link is Down
    root@am57xx-evm:~# ethtool eth2
    Settings for eth2:
    Supported ports: [ TP MII ]
    Supported link modes: 10baseT/Half 10baseT/Full
    100baseT/Half 100baseT/Full
    Supported pause frame use: Symmetric
    Supports auto-negotiation: Yes
    Advertised link modes: 10baseT/Half 10baseT/Full
    100baseT/Half 100baseT/Full
    Advertised pause frame use: Symmetric
    Advertised auto-negotiation: Yes
    Speed: 10Mb/s
    Duplex: Half
    Port: MII
    PHYAD: 1
    Transceiver: external
    Auto-negotiation: on
    Link detected: no
    root@am57xx-evm:~# devmem2 0x4b2b2480 w 0x83c10000
    /dev/mem opened.
    Memory mapped at address 0xb6f28000.
    Read at address 0x4B2B2480 (0xb6f28480): 0x23C10116
    Write at address 0x4B2B2480 (0xb6f28480): 0x83C10000, readback 0x83C10000
    root@am57xx-evm:~# devmem2 0x4b2b2480
    /dev/mem opened.
    Memory mapped at address 0xb6f2b000.
    Read at address 0x4B2B2480 (0xb6f2b480): 0x23C10136
    (phy register bit 8=link is up, bit4 =Signal present on receive differential pair)
    root@am57xx-evm:~#
  • Hi,

    The PHY link status detection should not be dependent on board powering state or plugging the cable in state. Plugging in the cable the Ethernet link is not established, but when powering up there is a link established. Though, since traffic is not present can indicate the PHY is not in a good state even though the link status is detected. I think there is a PHY issue that will need to be worked out with the PHY manufacturer.

    Discussing with a colleague both the TX and RX CLK are sourced from the PHY to MAC. In the test case of powering up with the cable connected and the link is detected are both TX and RX clocks active? Does data go out on the TX data line with the clock active in this instance when the dhcp command is issued? If the clocks are not active the data will not transmit.

    Also please review the reset pulse to the PHY with either the datasheet or manufacturer to make sure the lines that the PHY is latching are in a known state so the correct features are latched.

    Best Regards,
    Schuyler
  • hi,Schuyler

         Thank you for the reply!  the tx_clk and rx_clk is active when we ping from host pc or custom board. the tx_ctrl is always inactive, the rx_ctrl is active only when we ping from host pc.  we have confirmed that the reset was fitted for the datasheet, and the phy status that read form MDIO is match to the hardware design. what should we do next? Thank you!

    the PHY and PRU ETH connection as following:

  • hi,Schuyler

               Could you give me some help? We do the next testing :

           1)remove the cable, power on. we read the data of PRUSS_INTC_SRSR1.

    root@am57xx-evm:~# devmem2 0x4b2a0204                                                                                             
    /dev/mem opened.                                                                                                                  
    Memory mapped at address 0xb6f5e000.                                                                                              
    Read at address  0x4B2A0204 (0xb6f5e204): 0x00000000

          2)pluge the calbe, read this reg again.

    root@am57xx-evm:~# [  232.841841] eth2: Link is Up - 100Mbps/Full - flow control rx/tx                                            
    [  232.848277] IPv6: ADDRCONF(NETDEV_CHANGE): eth2: link becomes ready                                                            
    devmem2 0x4b2a0204                                                                                                                
    /dev/mem opened.                                                                                                                  
    Memory mapped at address 0xb6fd7000.                                                                                              
    Read at address  0x4B2A0204 (0xb6fd7204): 0x0800041C

       According to the result, the PRUSS generate IRQ34,35,36 and 42(PRU2_RX_SFD,RX_SOF, RX_CRC,RX_EOF),it seems  all the PHY and the PRUSS  get the right status. but why the ethernet doesn't work?

       what's more, we debug the  driver about the prueth.c, the program executed these function ( emac_ndo_open and prueth_tx_enqueue) when we pluge the eth2 cable, but the pr2_mii0_txen is still on '0' .  It seems the  pru_rproc is ok, but  we don't know how  does the PRU cores work? Do you have the PRU raw code for 'PRU_RPMsg_Echo_Interrupt2_0.out' or how does it work? Thank you!

  • who can help me? thank you!

  • Part Number: AM5728

    Tool/software: Linux

    hi,Schuyler

         Could you give me some help?  The link of problem is:  e2e.ti.com/.../634000

         Thank you for the reply!  the tx_clk and rx_clk is active when we ping from host pc or custom board. the tx_ctrl is always inactive, the rx_ctrl is active only when we ping from host pc.  we have confirmed that the reset was fitted for the datasheet, and the phy status that read form MDIO is match to the hardware design. what should we do next? Thank you!

    the PHY and PRU ETH connection as following:

     

    We do the next testing :

           1)remove the cable, power on. we read the data of PRUSS_INTC_SRSR1.

    root@am57xx-evm:~# devmem2 0x4b2a0204                                                                                             
    /dev/mem opened.                                                                                                                  
    Memory mapped at address 0xb6f5e000.                                                                                              
    Read at address  0x4B2A0204 (0xb6f5e204): 0x00000000

          2)pluge the calbe, read this reg again.

    root@am57xx-evm:~# [  232.841841] eth2: Link is Up - 100Mbps/Full - flow control rx/tx                                            
    [  232.848277] IPv6: ADDRCONF(NETDEV_CHANGE): eth2: link becomes ready                                                            
    devmem2 0x4b2a0204                                                                                                                
    /dev/mem opened.                                                                                                                  
    Memory mapped at address 0xb6fd7000.                                                                                              
    Read at address  0x4B2A0204 (0xb6fd7204): 0x0800041C

       According to the result, the PRUSS generate IRQ34,35,36 and 42(PRU2_RX_SFD,RX_SOF, RX_CRC,RX_EOF),it seems  all the PHY and the PRUSS  get the right status. but why the ethernet doesn't work?

       what's more, we debug the  driver about the prueth.c, the program executed these function ( emac_ndo_open and prueth_tx_enqueue) when we pluge the eth2 cable, but the pr2_mii0_txen is still on '0' .  It seems the  pru_rproc is ok, but  we don't know how  does the PRU cores work? Do you have the PRU raw code for 'PRU_RPMsg_Echo_Interrupt2_0.out' or how does it work? Thank you!

  • Hi,
    I will have to consult with the PRU team on this. Have you tried looking at the signals you are discussing on a the TI EVM?

    Best Regards,
    Schuyler
  • thank you ! we reviewed all the signal about the pru-mii-rt module, but nothing to get .
  • Hi,

    What about the PHY signals that you are mentioning? The RX_CTL and TX_CTL and the respective clocks? Are you able to measure this on the TI EVM?

    Best Regards,
    Schuyler
  • Hi, Schuyler:

         The PHY signal is: RST# Power,clk, pru2_mii0_rxctl, pru2_mii0_rxc,pru2_mii0_rxd[3:0],pru2_mii0_txctl,pru2_mii0_txc,pru2_mii0_txd[3:0], pru2_mii0_crs,pru2_mii0_col .  The RX_CTL and TX_CTL is 25MHz. all the signal is right exclude the pru2_mii0_tx* signal.   but we debug pru_core by emulator execute below code the  pru2_mii0_txctl and pru2_mii0_txd[3:0] is right.

    We have not the TI EVM.

    the code fragment is:

     __R30 = 0xffffffff;
     __R30 = 0x0500ffff;
     __R30 = 0xa858615d;
     __R30 = 0x01000608;
    .......
    __R31 = CMD_TX_CRCL|CMD_TX_CRCH|CMD_TX_EOF;
            what's more, could you tell how to know which bits(8/16/32) of TXDATA(R30) pushed according to the code  like'__R30 = 0x0xxxx'?  Thank you!

  • Hi,

    Could you please attach your dts portion that has the network definition and the pin mux definition for the ethernet port here?

    Is ethtool reporting that PHY link is detected? I want to verify that is the case again.

    Best Regards,
    Schuyler
  • hi,Schuyler:

        Thank you for your reply!  Our custom board  detected the PHY link, and recognized the PHY address and  the chip is KSZ8081.

        we debug pru_core use emulator(XDS220U), the wireshark get the same data that eth2 send. it seems the hardware can send the ethernet data, that is work well,  but we don't know how the software is work in pru_core.

    where can we get the code about ethernet of pru_core? 

    What 's problem maybe ?

    what's more, could you tell us how to know which bits(8/16/32) of TXDATA(R30) pushed according to the code  like'__R30 = 0x0xxxx' (when TX32_MODE_EN ==1 )? Thank you !

    the debug code fragment is:

            __R30 = 0xffffffff;
            __R31 = CMD_TX_PUSH16;
            __R30 = 0xffffffff;
            __R31 = CMD_TX_PUSH16;

            __R30 = 0xffffffff;
            __R31 = CMD_TX_PUSH16;
            __R30 = 0xffff0500;
            __R31 = CMD_TX_PUSH16;

          ......
            __R31 = CMD_TX_CRCL|CMD_TX_CRCH|CMD_TX_EOF;

        The dts portion is:

    pruss2_eth {
            compatible = "ti,am57-prueth";
            pruss = <&pruss2>;
            sram = <&ocmcram1>;
            interrupt-parent = <&pruss2_intc>;

            pruss2_emac0: ethernet-mii0 {
                phy-handle = <&pruss2_eth0_phy>;
                phy-mode = "mii";
                interrupts = <20>, <22>;
                interrupt-names = "rx", "tx";
                /* Filled in by bootloader */
                local-mac-address = [00 00 00 00 00 00];
            };

            pruss2_emac1: ethernet-mii1 {
                phy-handle = <&pruss2_eth1_phy>;
                phy-mode = "mii";
                interrupts = <21>, <23>;
                interrupt-names = "rx", "tx";
                /* Filled in by bootloader */
                local-mac-address = [00 00 00 00 00 00];
            };
        };

    &pruss1 {
        status = "okay";
        pru1_0: pru0@4b234000 {
            interrupt-parent = <&pruss1_intc>;
            interrupts = <16>, <17>;
            interrupt-names = "vring", "kick";
            status = "disabled";
        };

        pru1_1: pru1@4b238000 {
            interrupt-parent = <&pruss1_intc>;
            interrupts = <18>, <19>;
            interrupt-names = "vring", "kick";
            status = "disabled";
        };
    };

    &pruss2 {
        status = "okay";
        pru2_0: pru0@4b2b4000 {
            interrupt-parent = <&pruss2_intc>;
            interrupts = <16>, <17>;
            interrupt-names = "vring", "kick";
            status = "okay";
        };
        pru2_1: pru1@4b2b8000 {
            interrupt-parent = <&pruss2_intc>;
            interrupts = <18>, <19>;
            interrupt-names = "vring", "kick";
            status = "okay";
        };

    };
    &pruss2_mdio {
        status = "okay";
        reset-gpios = <&gpio5 17 GPIO_ACTIVE_LOW>;  /*pruss with 1000M share reset signal*/
        reset-delay-us = <12000>;   /* PHY datasheet states 10mS min */
        pruss2_eth0_phy: ethernet-phy@1 {
            reg = <1>;
            interrupt-parent = <&gpio5>;
            interrupts = <7 IRQ_TYPE_EDGE_FALLING>;
        };

        pruss2_eth1_phy: ethernet-phy@3 {
            reg = <3>;
            interrupt-parent = <&gpio5>;
            interrupts = <6 IRQ_TYPE_EDGE_FALLING>;
        };
    };

    pinmux define is:

    {XREF_CLK0, (M11 | PIN_INPUT_PULLDOWN)},    /* xref_clk0.pr2_mii1_col */
    {XREF_CLK1, (M11 | PIN_INPUT_PULLDOWN)},    /* xref_clk1.pr2_mii1_crs */

    {MCASP1_AXR0, (M11 | PIN_INPUT_PULLDOWN | SLEWCONTROL)},    /* mcasp1_axr0.pr2_mii0_rxer */
    {MCASP1_AXR1, (M11 | PIN_INPUT_PULLDOWN | SLEWCONTROL)},    /* mcasp1_axr1.pr2_mii_mt0_clk */
    {MCASP1_AXR4, (M14 | PIN_INPUT_PULLUP)},    /* mcasp1_axr4.gpio5_6 */
    {MCASP1_AXR5, (M14 | PIN_INPUT_PULLUP)},    /* mcasp1_axr5.gpio5_7 */
    {MCASP1_AXR8, (M11 | PIN_OUTPUT_PULLDOWN | SLEWCONTROL)},    /* mcasp1_axr8.pr2_mii0_txen */
    {MCASP1_AXR9, (M11 | PIN_OUTPUT_PULLDOWN | SLEWCONTROL)},    /* mcasp1_axr9.pr2_mii0_txd3 */
    {MCASP1_AXR10, (M11 | PIN_OUTPUT_PULLDOWN | SLEWCONTROL)},    /* mcasp1_axr10.pr2_mii0_txd2 */
    {MCASP1_AXR11, (M11 | PIN_OUTPUT_PULLDOWN | SLEWCONTROL)},    /* mcasp1_axr11.pr2_mii0_txd1 */
    {MCASP1_AXR12, (M11 | PIN_OUTPUT_PULLDOWN | SLEWCONTROL)},    /* mcasp1_axr12.pr2_mii0_txd0 */
    {MCASP1_AXR13, (M11 | PIN_INPUT_PULLDOWN | SLEWCONTROL)},    /* mcasp1_axr13.pr2_mii_mr0_clk */
    {MCASP1_AXR14, (M11 | PIN_INPUT_PULLDOWN | SLEWCONTROL)},    /* mcasp1_axr14.pr2_mii0_rxdv */
    {MCASP1_AXR15, (M11 | PIN_INPUT_PULLUP | SLEWCONTROL)},    /* mcasp1_axr15.pr2_mii0_rxd3 */
    {MCASP2_ACLKX, (M11 | PIN_INPUT_PULLDOWN)},    /* mcasp2_aclkx.pr2_mii0_rxd2 */
    {MCASP2_FSX, (M11 | PIN_INPUT_PULLDOWN | SLEWCONTROL)},    /* mcasp2_fsx.pr2_mii0_rxd1 */
    {MCASP2_AXR2, (M11 | PIN_INPUT_PULLUP | SLEWCONTROL)},    /* mcasp2_axr2.pr2_mii0_rxd0 */
    {MCASP2_AXR3, (M11 | PIN_INPUT_PULLUP | SLEWCONTROL)},    /* mcasp2_axr3.pr2_mii0_rxlink */
    {MCASP3_ACLKX, (M11 | PIN_INPUT_PULLDOWN)},    /* mcasp3_aclkx.pr2_mii0_crs */
    {MCASP3_FSX, (M11 | PIN_INPUT_PULLDOWN | SLEWCONTROL)},    /* mcasp3_fsx.pr2_mii0_col */
    {MCASP3_AXR0, (M11 | PIN_INPUT_PULLDOWN | SLEWCONTROL)},    /* mcasp3_axr0.pr2_mii1_rxer */
    {MCASP3_AXR1, (M11 | PIN_INPUT_PULLUP | SLEWCONTROL)},    /* mcasp3_axr1.pr2_mii1_rxlink */

    {MCASP5_AXR0, (M11 | PIN_OUTPUT_PULLDOWN)},    /* mcasp5_axr0.pr2_mdio_mdclk */
    {MCASP5_AXR1, (M11 | PIN_INPUT)},    /* mcasp5_axr1.pr2_mdio_data */

    {GPIO6_10, (M11 | PIN_INPUT_PULLDOWN)},    /* gpio6_10.pr2_mii_mt1_clk */
    {GPIO6_11, (M11 | PIN_OUTPUT_PULLDOWN)},    /* gpio6_11.pr2_mii1_txen */
    {MMC3_CLK, (M11 | PIN_OUTPUT_PULLDOWN)},    /* mmc3_clk.pr2_mii1_txd3 */
    {MMC3_CMD, (M11 | PIN_OUTPUT_PULLDOWN)},    /* mmc3_cmd.pr2_mii1_txd2 */
    {MMC3_DAT0, (M11 | PIN_OUTPUT_PULLDOWN)},    /* mmc3_dat0.pr2_mii1_txd1 */
    {MMC3_DAT1, (M11 | PIN_OUTPUT_PULLDOWN)},    /* mmc3_dat1.pr2_mii1_txd0 */
    {MMC3_DAT2, (M11 | PIN_INPUT_PULLDOWN)},    /* mmc3_dat2.pr2_mii_mr1_clk */
    {MMC3_DAT3, (M11 | PIN_INPUT_PULLDOWN)},    /* mmc3_dat3.pr2_mii1_rxdv */
    {MMC3_DAT4, (M11 | PIN_INPUT_PULLUP)},    /* mmc3_dat4.pr2_mii1_rxd3 */
    {MMC3_DAT5, (M11 | PIN_INPUT_PULLUP)},    /* mmc3_dat5.pr2_mii1_rxd2 */
    {MMC3_DAT6, (M11 | PIN_INPUT_PULLDOWN)},    /* mmc3_dat6.pr2_mii1_rxd1 */
    {MMC3_DAT7, (M11 | PIN_INPUT_PULLUP)},    /* mmc3_dat7.pr2_mii1_rxd0 */

    The output of ethtool is:

    root@am57xx-evm:~# ethtool eth2                                                 
    Settings for eth2:                                                              
            Supported ports: [ TP MII ]                                             
            Supported link modes:   10baseT/Half 10baseT/Full                       
                                    100baseT/Half 100baseT/Full                     
            Supported pause frame use: Symmetric                                    
            Supports auto-negotiation: Yes                                          
            Advertised link modes:  10baseT/Half 10baseT/Full                       
                                    100baseT/Half 100baseT/Full                     
            Advertised pause frame use: Symmetric                                   
            Advertised auto-negotiation: Yes                                        
            Link partner advertised link modes:  10baseT/Half 10baseT/Full          
                                                 100baseT/Half 100baseT/Full        
            Link partner advertised pause frame use: No                             
            Link partner advertised auto-negotiation: Yes                           
            Speed: 100Mb/s                                                          
            Duplex: Full                                                            
            Port: MII                                                               
            PHYAD: 1                                                                
            Transceiver: external                                                   
            Auto-negotiation: on                                                    
            Link detected: yes     

    dmesg |grep phy
    [    0.000000] Booting Linux on physical CPU 0x0
    [    1.510591] libphy: Fixed MDIO Bus: probed
    [    1.563978] davinci_mdio 48485000.mdio: detected phy mask fffffff9
    [    1.574346] libphy: 48485000.mdio: probed
    [    1.578378] davinci_mdio 48485000.mdio: phy[1]: device 48485000.mdio:01, driver Micrel KSZ9031 Gigabit PHY
    [    1.588077] davinci_mdio 48485000.mdio: phy[2]: device 48485000.mdio:02, driver Micrel KSZ9031 Gigabit PHY
    [    7.804806] libphy: 4b2b2400.mdio: probed
    [    7.924353] davinci_mdio 4b2b2400.mdio: phy[1]: device 4b2b2400.mdio:01, driver Micrel KSZ8081 or KSZ8091
    [    7.985601] davinci_mdio 4b2b2400.mdio: phy[3]: device 4b2b2400.mdio:03, driver Micrel KSZ8081 or KSZ8091

  • Hi,

    Thank you for the pin mux and DTS nodes. I looked through them they are different in reference to the TI IDK design in terms of pull up/pull downs and the addition of slew control. For the moment I will expect that is due to the PHY that you are using.

    You have captured data being sent with Wireshark, is there a response to the data being sent? Is there a reason that you want to debug the PRU firmware this is typically not required to bring up an interface.

    I noticed at the beginning of the thread that you modified the pru_rproc.c file. If this has not been done already the interface needs to be verified for link detection, send and receive of data before any code driver modification. It looks like the link is being detected and sending has been verified but receive should be done as well.

    Best Regards,
    Schuyler
  • hi,Schuyler:

         Thank you for your reply! The one channel prueth2_0 is working on. The am57xx-pru2_0-fw  soft link is wrong. when we change the soft link to '/lib/firmware/ti-pruss/am57xx-pru0-prueth-fw.elf', the prueth2_0 is ok.

         But the other one prueth2_1 can not ping with host PC.  The wireshark captured the  prueth2_1 when power on, but there is no packet to get after login system. what maybe the problem?  Is the  prueth2_1 soft link '/lib/firmware/ti-pruss/am57xx-pru1-prueth-fw.elf' right?  Thank you!

    the dmesg is:

    [    7.541024] ti-pruss 4b280000.pruss: creating PRU cores and other child platform devices
    [    7.574119] of_get_named_gpiod_flags: parsed 'reset-gpios' property of node '/ocp/pruss@4b280000/mdio@4b2b2400[0]' - status (0)
    [    7.729724]  remoteproc1: 4b2b4000.pru0 is available
    [    7.785827] pru-rproc 4b2b4000.pru0: booting the PRU core manually
    [    7.800655]  remoteproc1: powering up 4b2b4000.pru0
    [    7.807820]  remoteproc1: Booting fw image am57xx-pru2_0-fw, size 4350
    [    7.816115] ti-pruss 4b280000.pruss: configured system_events = 0x0000060000500000 intr_channels = 0x00000095 host_intr = 0x00000115
    [    7.828583]  remoteproc1: remote processor 4b2b4000.pru0 is now up
    [    7.835152] pru-rproc 4b2b4000.pru0: PRU rproc node /ocp/pruss@4b280000/pru0@4b2b4000 probed successfully
    [    7.852903]  remoteproc2: 4b2b8000.pru1 is available
    [    7.881319] pru-rproc 4b2b8000.pru1: booting the PRU core manually
    [    7.887626]  remoteproc2: powering up 4b2b8000.pru1
    [    7.893937]  remoteproc2: Booting fw image am57xx-pru2_1-fw, size 4382
    [    7.903491] ti-pruss 4b280000.pruss: configured system_events = 0x0060000000a00000 intr_channels = 0x0000012a host_intr = 0x0000022a
    [    7.915808]  remoteproc2: remote processor 4b2b8000.pru1 is now up
    [    7.922180] pru-rproc 4b2b8000.pru1: PRU rproc node /ocp/pruss@4b280000/pru1@4b2b8000 probed successfully
    [    7.956072] prueth pruss2_eth: port 1: using random MAC addr: 0a:db:9a:d8:3c:31
    [    8.049793] prueth pruss2_eth: port 2: using random MAC addr: 86:bd:59:f3:60:d0
    [    8.226696] prueth pruss2_eth: TI PRU ethernet driver initialized

    root@am57xx-evm:~# ifconfig
    eth0      Link encap:Ethernet  HWaddr 0A:DB:9A:D8:3C:31  
              inet addr:192.168.2.10  Bcast:192.168.2.255  Mask:255.255.255.0
              inet6 addr: fe80::8db:9aff:fed8:3c31%132112/64 Scope:Link
              UP BROADCAST MULTICAST  MTU:1500  Metric:1
              RX packets:86 errors:0 dropped:0 overruns:0 frame:0
              TX packets:95 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:13536 (13.2 KiB)  TX bytes:17852 (17.4 KiB)

    eth1      Link encap:Ethernet  HWaddr 86:BD:59:F3:60:D0  
              inet addr:192.168.2.20  Bcast:192.168.2.255  Mask:255.255.255.0
              inet6 addr: fe80::84bd:59ff:fef3:60d0%132112/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:2 errors:0 dropped:0 overruns:0 frame:0
              TX packets:45 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000
              RX bytes:220 (220.0 B)  TX bytes:7550 (7.3 KiB)

    the wireshark packets are(power on process):

  • Hi,
    These ports cannot be on the same subnet which in this case is 2. Try only port connected at a time, or connect one port to a different PC and make sure the ports are on different subnets.

    Best Regards,
    Schuyler

    eth0 Link encap:Ethernet HWaddr 0A:DB:9A:D8:3C:31
    inet addr:192.168.2.10 Bcast:192.168.2.255 Mask:255.255.255.0

    eth1 Link encap:Ethernet HWaddr 86:BD:59:F3:60:D0
    inet addr:192.168.2.20 Bcast:192.168.2.255 Mask:255.255.255.0
  • Thank you very much!