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/AM4376: RGMII2 interface no clocks

Part Number: AM4376

Tool/software: Linux

Hi,

we have custom board with am4376 cpu and we have micrel phy connected via mdio + rgmii2. We're using mainline 4.12 kernel. Setup in dts is following:

rgmii2_pins_default: rgmii2_pins_default {
		pinctrl-single,pins = <
		AM4372_IOPAD(0x858, PIN_OUTPUT | MUX_MODE2)	/* gpmc_a6.rgmii2_tclk */
			AM4372_IOPAD(0x840, PIN_OUTPUT | MUX_MODE2)	/* gpmc_a0.rgmii2_tctl */
			AM4372_IOPAD(0x854, PIN_OUTPUT | MUX_MODE2)	/* gpmc_a5.rgmii2_td0 */
			AM4372_IOPAD(0x850, PIN_OUTPUT | MUX_MODE2)	/* gpmc_a4.rgmii2_td1 */
			AM4372_IOPAD(0x84c, PIN_OUTPUT | MUX_MODE2)	/* gpmc_a3.rgmii2_td2 */
			AM4372_IOPAD(0x848, PIN_OUTPUT | MUX_MODE2)	/* gpmc_a2.rgmii2_td3 */
			AM4372_IOPAD(0x85c, PIN_INPUT | MUX_MODE2)	/* gpmc_a7.rgmii2_rclk */
			AM4372_IOPAD(0x844, PIN_INPUT | MUX_MODE2)	/* gpmc_a1.rgmii2_rtcl */
			AM4372_IOPAD(0x86c, PIN_INPUT | MUX_MODE2)	/* gpmc_a11.rgmii2_rd0 */
			AM4372_IOPAD(0x868, PIN_INPUT | MUX_MODE2)	/* gpmc_a10.rgmii2_rd1 */
			AM4372_IOPAD(0x864, PIN_INPUT | MUX_MODE2)	/* gpmc_a9.rgmii2_rd2 */
			AM4372_IOPAD(0x860, PIN_INPUT | MUX_MODE2)	/* gpmc_a8.rgmii2_rd3 */


		>;
	};
&mac {
	slaves = <1>;
	pinctrl-names = "default";
	pinctrl-0 = <&rgmii2_pins_default>;
	status = "okay";
};

&davinci_mdio {
	pinctrl-names = "default";
	pinctrl-0 = <&mdio_pins_default>;
	status = "okay";
};

&cpsw_emac0 {
	phy_id = <&davinci_mdio>, <0>;
	phy-mode = "rgmii";
};

We can see that phy is probed :

[   84.510076] net eth0: initializing cpsw version 1.15 (0)
[   84.516615] cpsw 4a100000.ethernet: initialized cpsw ale version 1.4
[   84.523560] cpsw 4a100000.ethernet: ALE Table size 1024
[   84.897922] Micrel KSZ9031 Gigabit PHY 4a101000.mdio:00: attached PHY driver [Micrel KSZ9031 Gigabit PHY] (mii_bus:phy_addr=4a101000.mdio:00, irq=-1)
[   85.176816] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready

but when measure clocks on CPU side like RGMII_TCLK we cannot see anything and interface is not working. Any idea what else we can check? Thanks.

marek

  • Hi,

    Please complete this checklist and post the results here: processors.wiki.ti.com/.../5x_CPSW
  • Hi,

    more info below:

    [    2.923381] davinci_mdio 4a101000.mdio: davinci mdio revision 1.6
    [    2.930185] davinci_mdio 4a101000.mdio: detected phy mask fffffffa
    [    2.959017] Micrel KSZ9031 Gigabit PHY 4a101000.mdio:00: no of_node; not parsing pinctrl DT
    [    2.971892] Micrel KSZ9031 Gigabit PHY 4a101000.mdio:02: no of_node; not parsing pinctrl DT
    [    2.974268] libphy: 4a101000.mdio: probed
    [    2.978780] davinci_mdio 4a101000.mdio: phy[0]: device 4a101000.mdio:00, driver Micrel KSZ9031 Gigabit PHY
    [    2.989497] davinci_mdio 4a101000.mdio: phy[2]: device 4a101000.mdio:02, driver Micrel KSZ9031 Gigabit PHY
    [    3.007308] cpsw 4a100000.ethernet: Detected MACID = 50:65:83:e3:20:38
    [    3.018605] cpsw 4a100000.ethernet: cpts: overflow check period 500 (jiffies)
    [   84.510076] net eth0: initializing cpsw version 1.15 (0)
    [   84.516615] cpsw 4a100000.ethernet: initialized cpsw ale version 1.4
    [   84.523560] cpsw 4a100000.ethernet: ALE Table size 1024
    [   84.897922] Micrel KSZ9031 Gigabit PHY 4a101000.mdio:00: attached PHY driver [Micrel KSZ9031 Gigabit PHY] (mii_bus:phy_addr=4a101000.mdio:00, irq=-1)

    ethtool eth0:

    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 Receive-only
            Supports auto-negotiation: Yes
            Advertised link modes:  10baseT/Half 10baseT/Full 
                                    100baseT/Half 100baseT/Full 
                                    1000baseT/Half 1000baseT/Full 
            Advertised pause frame use: No
            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: 0
            Transceiver: internal
            Auto-negotiation: on
            Supports Wake-on: d
            Wake-on: d
            Current message level: 0x00000000 (0)
                                   
            Link detected: yes
    

    ethtool -S eth0

    ethtool -S eth0
    NIC statistics:
         Good Rx Frames: 0
         Broadcast Rx Frames: 0
         Multicast Rx Frames: 0
         Pause Rx Frames: 0
         Rx CRC Errors: 0
         Rx Align/Code Errors: 0
         Oversize Rx Frames: 0
         Rx Jabbers: 0
         Undersize (Short) Rx Frames: 0
         Rx Fragments: 0
         Rx Octets: 0
         Good Tx Frames: 34
         Broadcast Tx Frames: 19
         Multicast Tx Frames: 15
         Pause Tx Frames: 0
         Deferred Tx Frames: 0
         Collisions: 0
         Single Collision Tx Frames: 0
         Multiple Collision Tx Frames: 0
         Excessive Collisions: 0
         Late Collisions: 0
         Tx Underrun: 0
         Carrier Sense Errors: 0
         Tx Octets: 7826
         Rx + Tx 64 Octet Frames: 0
         Rx + Tx 65-127 Octet Frames: 15
         Rx + Tx 128-255 Octet Frames: 0
         Rx + Tx 256-511 Octet Frames: 19
         Rx + Tx 512-1023 Octet Frames: 0
         Rx + Tx 1024-Up Octet Frames: 0
         Net Octets: 7826
         Rx Start of Frame Overruns: 0
         Rx Middle of Frame Overruns: 0
         Rx DMA Overruns: 0
         Rx DMA chan 0: head_enqueue: 1
         Rx DMA chan 0: tail_enqueue: 127
         Rx DMA chan 0: pad_enqueue: 0
         Rx DMA chan 0: misqueued: 0
         Rx DMA chan 0: desc_alloc_fail: 0
         Rx DMA chan 0: pad_alloc_fail: 0
         Rx DMA chan 0: runt_receive_buf: 0
         Rx DMA chan 0: runt_transmit_bu: 0
         Rx DMA chan 0: empty_dequeue: 0
         Rx DMA chan 0: busy_dequeue: 0
         Rx DMA chan 0: good_dequeue: 0
         Rx DMA chan 0: requeue: 0
         Rx DMA chan 0: teardown_dequeue: 0
         Tx DMA chan 0: head_enqueue: 34
         Tx DMA chan 0: tail_enqueue: 0
         Tx DMA chan 0: pad_enqueue: 0
         Tx DMA chan 0: misqueued: 0
         Tx DMA chan 0: desc_alloc_fail: 0
         Tx DMA chan 0: pad_alloc_fail: 0
         Tx DMA chan 0: runt_receive_buf: 0
         Tx DMA chan 0: runt_transmit_bu: 0
         Tx DMA chan 0: empty_dequeue: 34
         Tx DMA chan 0: busy_dequeue: 0
         Tx DMA chan 0: good_dequeue: 34
         Tx DMA chan 0: requeue: 0
         Tx DMA chan 0: teardown_dequeue: 0
    

    ifconfig eth0:

    ifconfig eth0
    eth0      Link encap:Ethernet  HWaddr 50:65:83:E3:20:38  
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:0 errors:0 dropped:0 overruns:0 frame:0
              TX packets:35 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000 
              RX bytes:0 (0.0 B)  TX bytes:8026 (7.8 KiB)
              Interrupt:206 
    

    IP address is not assigned as interface cannot communicate (send dhcp requests IMHO).

  • Hi,

    I will assume based on the DTS snippets you are using the second RGMII interface as the primary Ethernet interface.  Unless this property is set like below in the  mac node the primary Ethernet port will be rgmii1.

    &mac {

       active_slave=<1>;      <-- add this line in this appended mac node in your DTS.

    };

    Here is link describing the above property:

    Primary Interface on Second Interface Port

    One other thing I need to point out is that TI only  tests and supports kernels from a TI SDK.  The reason I point out the kernel in use here is that TI bases the kernel for the SDK on an LTS kernel and the 4.12 kernel is not an LTS kernel.

    Best Regards,

    Schuyler

  • Hi,

    thanks for additional info but we still have an issue. Now it looks like that some input pins on RGMII@ interface produce some signals (which shouldn't). Anything else we can try? Thanks.

    BR,

    marek

  • Issue resolved. There was typo and use emac0 instead of emac1 in dts. Thanks for any help.