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.

DP83867IR: Unable to Ping External System from the AM3359 processor

Part Number: DP83867IR
Other Parts Discussed in Thread: AM3359

Hi All,

We have custom board based on the ICE-V2 Eval board having two DP83867sPhy Chips. One of the DP83867 Phy (Phy Addr 3) is interfaced on the RGMII1 lines of the AM3359 Processor and the o/p is connected directly to an RJ45 Jack through a transformer . The Other DP83867 Phy (Phy Addr 0) is Interfaced on the RGMII2 lines of the AM3359 Processor and the O/P of this Phy is connected to a Ethernet port on the VSC7422 Ethernet Switch. We are able to ping to the external system through the first Phy which is directly connected through the RJ45 Jack.

I am having problem when I am trying to ping to the external system from the AM3359 processor using the second DP83867 Phy through the VSC7422 Ethernet switch. The Link status on the Ethtool shows Link is UP at 100Mbps, But I'm unable to ping to the external system connected on the other port of the VSC7422 Ethernet Switch. The VSC7422 switch is working properly as I'm able to ping from one external system to the other system through the same VSC7422 Ethernet Switch. I have printed out some of the Registry Values of the DP83867 Phy as shown below.

root@am335x-evm:~# ifconfig eth0 down
[ 4293.128371] cpsw 4a100000.ethernet eth0: Link is Down
root@am335x-evm:~# ifconfig eth0 up  
[ 4296.455233] net eth0: initializing cpsw version 1.12 (0)
[ 4296.466112] 
[ 4296.466112] Strap configuration STS1 is 3700
[ 4296.467196] 
[ 4296.467196] RGMIICTL default value 53
[ 4296.480428] 
[ 4296.480428] RGMIICTL register value: d3
[ 4296.486504] 
[ 4296.486504] RGMIIDCTL register value: ff
[ 4296.494081] 
[ 4296.494081]  0 register value: 1040
[ 4296.501114] 
[ 4296.501114]  1 register value: 7949
[ 4296.506997] 
[ 4296.506997]  2 register value: 2000
[ 4296.513945] 
[ 4296.513945]  3 register value: a231
[ 4296.520164] 
[ 4296.520164]  4 register value: a1
[ 4296.526031] 
[ 4296.526031]  5 register value: 0
[ 4296.532648] 
[ 4296.532648]  6 register value: 64
[ 4296.538254] 
[ 4296.538254]  7 register value: 2001
[ 4296.544806] 
[ 4296.544806]  8 register value: 0
[ 4296.551231] 
[ 4296.551231]  9 register value: 100
[ 4296.556833] 
[ 4296.556833]  a register value: 0
[ 4296.563458] 
[ 4296.563458]  b register value: 0
[ 4296.569067] 
[ 4296.569067]  c register value: 0
[ 4296.575587] 
[ 4296.575587]  d register value: 401f
[ 4296.581758] 
[ 4296.581758]  e register value: 0
[ 4296.587627] 
[ 4296.587627]  f register value: 3000
[ 4296.594111] 
[ 4296.594111]  10 register value: d028
[ 4296.600353] 
[ 4296.600353]  11 register value: 302
[ 4296.606309] 
[ 4296.606309]  12 register value: 0
[ 4296.613025] 
[ 4296.613025]  13 register value: 0
[ 4296.618716] 
[ 4296.618716]  14 register value: 29c7
[ 4296.625281] 
[ 4296.625281]  15 register value: 0
[ 4296.631758] 
[ 4296.631758]  16 register value: 0
[ 4296.637447] 
[ 4296.637447]  17 register value: 40
[ 4296.643985] 
[ 4296.643985]  18 register value: 6150
[ 4296.650158] 
[ 4296.650158]  19 register value: 4444
[ 4296.656117] 
[ 4296.656117]  1a register value: 2
[ 4296.663044] 
[ 4296.663044]  1b register value: 0
[ 4296.668737] 
[ 4296.668737]  1c register value: 0
[ 4296.675320] 
[ 4296.675320]  1d register value: 0
[ 4296.681595] 
[ 4296.681595]  1e register value: 2
[ 4296.687288] 
[ 4296.687288]  1f register value: 0
[ 4296.695973] 
[ 4296.695973] Strap configuration STS1 is 3700
[ 4296.702410] 
[ 4296.702410] RGMIICTL default value 53
[ 4296.713002] 
[ 4296.713002] RGMIICTL register value: d3
[ 4296.719043] 
[ 4296.719043] RGMIIDCTL register value: ff
[ 4296.726307] 
[ 4296.726307]  0 register value: 1040
[ 4296.733173] 
[ 4296.733173]  1 register value: 7949
[ 4296.739045] 
[ 4296.739045]  2 register value: 2000
[ 4296.745884] 
[ 4296.745884]  3 register value: a231
[ 4296.752308] 
[ 4296.752308]  4 register value: a1
[ 4296.758174] 
[ 4296.758174]  5 register value: 0
[ 4296.764676] 
[ 4296.764676]  6 register value: 64
[ 4296.770824] 
[ 4296.770824]  7 register value: 2001
[ 4296.776514] 
[ 4296.776514]  8 register value: 0
[ 4296.783248] 
[ 4296.783248]  9 register value: 100
[ 4296.788852] 
[ 4296.788852]  a register value: 0
[ 4296.795544] 
[ 4296.795544]  b register value: 0
[ 4296.801695] 
[ 4296.801695]  c register value: 0
[ 4296.807301] 
[ 4296.807301]  d register value: 401f
[ 4296.813752] 
[ 4296.813752]  e register value: 0
[ 4296.819915] 
[ 4296.819915]  f register value: 3000
[ 4296.825526] 
[ 4296.825526]  10 register value: d028
[ 4296.832303] 
[ 4296.832303]  11 register value: 302
[ 4296.838257] 
[ 4296.838257]  12 register value: 0
[ 4296.845066] 
[ 4296.845066]  13 register value: 0
[ 4296.851296] 
[ 4296.851296]  14 register value: 29c7
[ 4296.856985] 
[ 4296.856985]  15 register value: 0
[ 4296.863786] 
[ 4296.863786]  16 register value: 0
[ 4296.869891] 
[ 4296.869891]  17 register value: 40
[ 4296.875585] 
[ 4296.875585]  18 register value: 6150
[ 4296.882297] 
[ 4296.882297]  19 register value: 4444
[ 4296.888253] 
[ 4296.888253]  1a register value: 2
[ 4296.895081] 
[ 4296.895081]  1b register value: 0
[ 4296.901332] 
[ 4296.901332]  1c register value: 0
[ 4296.907023] 
[ 4296.907023]  1d register value: 0
[ 4296.913587] 
[ 4296.913587]  1e register value: 2
[ 4296.919692] 
[ 4296.919692]  1f register value: 0
[ 4296.925005] TI DP83867 4a101000.mdio:00: Chinmay: Phy Id is 536912433
[ 4296.938968] TI DP83867 4a101000.mdio:00: Chinmay: attached PHY driver [TI DP83867] (mii_bus:phy_addr=4a101000.mdio:00, irq=POLL)
[ 4296.952804] libphy: PHY  not found
[ 4296.956316] net eth0: phy "" not found on slave 1, err -19
[ 4296.973229] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
root@am335x-evm:~# [ 4299.039902] cpsw 4a100000.ethernet eth0: Link is Up - 100Mbps/Full - flow control off
[ 4299.047954] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready

root@am335x-evm:~# 
root@am335x-evm:~# ifconfig 
eth0      Link encap:Ethernet  HWaddr 68:47:49:7C:9C:1E  
          inet addr:192.168.2.11  Bcast:192.168.255.255  Mask:255.255.0.0
          inet6 addr: fe80::6a47:49ff:fe7c:9c1e/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:285 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:51052 (49.8 KiB)
          Interrupt:47 

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

root@am335x-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 Receive-only
        Supports auto-negotiation: Yes
        Supported FEC modes: Not reported
        Advertised link modes:  100baseT/Full 
        Advertised pause frame use: No
        Advertised auto-negotiation: No
        Advertised FEC modes: Not reported
        Speed: 100Mb/s
        Duplex: Full
        Port: MII
        PHYAD: 0
        Transceiver: internal
        Auto-negotiation: off
        Supports Wake-on: d
        Wake-on: d
        Current message level: 0x00000000 (0)
                               
        Link detected: yes
root@am335x-evm:~# ping 192.168.2.11
PING 192.168.2.11 (192.168.2.11): 56 data bytes
64 bytes from 192.168.2.11: seq=0 ttl=64 time=0.491 ms
64 bytes from 192.168.2.11: seq=1 ttl=64 time=0.428 ms
^C
--- 192.168.2.11 ping statistics ---
2 packets transmitted, 2 packets received, 0% packet loss
round-trip min/avg/max = 0.428/0.459/0.491 ms
root@am335x-evm:~# 
root@am335x-evm:~# ping 192.168.2.10
PING 192.168.2.10 (192.168.2.10): 56 data bytes
^C
--- 192.168.2.10 ping statistics ---
3 packets transmitted, 0 packets received, 100% packet loss
root@am335x-evm:~# ping 192.168.2.10
PING 192.168.2.10 (192.168.2.10): 56 data bytes
^C
--- 192.168.2.10 ping statistics ---
20 packets transmitted, 0 packets received, 100% packet loss
root@am335x-evm:~# 
root@am335x-evm:~# 

Unable to pinpoint the exact problem causing this issue. Kindly help me in resolving this issue at the earliest.

Thanks in Advance.

Regards

Chinmay

  • Hi Chinmay,

    We are looking into this issue, reviewing the register dump, and will provide an update by the end of the week.

    Thank you,

    Nikhil

  • Hi Chinmay, 

    It looks like the device is being strapped into half-duplex mode. Was this intentional? Can you provide a read of register 6E?

    Can you also provide a schematic?

    Thank you,

    Nikhil

  • Dear Nikhil,

    We want the DP83867 to connect to the VSC7422 Switch in 100 Mbps Full duplex mode. Can you let me know what should be the pull-up and pull down values for the strap pins to make this setting. The Strap value for the 6E Registry is 0x3700

    [   17.712242] STRAP_STS1 0x6E register value: 3700

    Regards

    Chinmay

  • Dear Nikhil,

    Attaching PDF of the DP83867 SCH as the screen shot may not be clear.

    2703.dp83867_SCH.pdf

    Regards

    Chinmay

  • Hi Chinmay,

    Based on the register 0x6E value, it looks like the device is being strapped into half duplex mode. Please review section 8.5 of the datasheet for proper strap selection and resistor values. I see incorrect pull-up/pull-down resistors being used. Make sure the "Half-Duplex Enable" strap is disabled. Can you confirm whether the RGZ or PAP is being used? Strap settings are slightly different for the two packages and I can advise in more detail based on the device package.

    Thank you,

    Nikhil 

  • Hi Nikhil,

    We are using the PAP package. Can you suggest the strap settings in hardware for this package in detail. We have also modified the dp83867 driver code. Sharing the same for you to verify and let me know if there is any thing wrong :

    /*
     * Driver for the Texas Instruments DP83867 PHY
     *
     * Copyright (C) 2015 Texas Instruments Inc.
     *
     * This program is free software; you can redistribute it and/or modify
     * it under the terms of the GNU General Public License as published by
     * the Free Software Foundation; either version 2 of the License.
     *
     * This program is distributed in the hope that it will be useful,
     * but WITHOUT ANY WARRANTY; without even the implied warranty of
     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     * GNU General Public License for more details.
     */
    
    #include <linux/ethtool.h>
    #include <linux/kernel.h>
    #include <linux/mii.h>
    #include <linux/module.h>
    #include <linux/of.h>
    #include <linux/phy.h>
    
    #include <dt-bindings/net/ti-dp83867.h>
    /*Modified by Chinmay*/
    /*#define DP83867_PHY_ID                0xf337f337*/
    #define DP83867_PHY_ID		0x2000a231
    #define DP83867_DEVADDR		0x1f
    /*added by astra*/
    /*#define DP83867_DEVADDR		0x0*/
    #define DP83867_DEBUG 		1
    #define MII_DP83867_PHYCTRL	0x10
    #define MII_DP83867_MICR	0x12
    #define MII_DP83867_ISR		0x13
    #define DP83867_CTRL		0x1f
    #define DP83867_CFG3		0x1e
    
    /* Extended Registers */
    #define DP83867_CFG4            0x0031
    #define DP83867_RGMIICTL	0x0032
    #define DP83867_STRAP_STS1	0x006E
    #define DP83867_RGMIIDCTL	0x0086
    #define DP83867_IO_MUX_CFG	0x0170
    
    #define DP83867_SW_RESET	BIT(15)
    #define DP83867_SW_RESTART	BIT(14)
    
    /* MICR Interrupt bits */
    #define MII_DP83867_MICR_AN_ERR_INT_EN		BIT(15)
    #define MII_DP83867_MICR_SPEED_CHNG_INT_EN	BIT(14)
    #define MII_DP83867_MICR_DUP_MODE_CHNG_INT_EN	BIT(13)
    #define MII_DP83867_MICR_PAGE_RXD_INT_EN	BIT(12)
    #define MII_DP83867_MICR_AUTONEG_COMP_INT_EN	BIT(11)
    #define MII_DP83867_MICR_LINK_STS_CHNG_INT_EN	BIT(10)
    #define MII_DP83867_MICR_FALSE_CARRIER_INT_EN	BIT(8)
    #define MII_DP83867_MICR_SLEEP_MODE_CHNG_INT_EN	BIT(4)
    #define MII_DP83867_MICR_WOL_INT_EN		BIT(3)
    #define MII_DP83867_MICR_XGMII_ERR_INT_EN	BIT(2)
    #define MII_DP83867_MICR_POL_CHNG_INT_EN	BIT(1)
    #define MII_DP83867_MICR_JABBER_INT_EN		BIT(0)
    
    /* RGMIICTL bits */
    #define DP83867_RGMII_TX_CLK_DELAY_EN		BIT(1)
    #define DP83867_RGMII_RX_CLK_DELAY_EN		BIT(0)
    
    /* STRAP_STS1 bits */
    #define DP83867_STRAP_STS1_RESERVED		BIT(11)
    
    /* PHY CTRL bits */
    #define DP83867_PHYCR_FIFO_DEPTH_SHIFT		14
    #define DP83867_PHYCR_FIFO_DEPTH_MASK		(3 << 14)
    #define DP83867_PHYCR_RESERVED_MASK		BIT(11)
    
    /* RGMIIDCTL bits */
    #define DP83867_RGMII_TX_CLK_DELAY_SHIFT	4
    
    /* IO_MUX_CFG bits */
    #define DP83867_IO_MUX_CFG_IO_IMPEDANCE_CTRL	0x1f
    
    #define DP83867_IO_MUX_CFG_IO_IMPEDANCE_MAX	0x0
    #define DP83867_IO_MUX_CFG_IO_IMPEDANCE_MIN	0x1f
    
    /* CFG4 bits */
    #define DP83867_CFG4_PORT_MIRROR_EN              BIT(0)
    
    enum {
    	DP83867_PORT_MIRROING_KEEP,
    	DP83867_PORT_MIRROING_EN,
    	DP83867_PORT_MIRROING_DIS,
    };
    
    struct dp83867_private {
    	int rx_id_delay;
    	int tx_id_delay;
    	int fifo_depth;
    	int io_impedance;
    	int port_mirroring;
    	bool rxctrl_strap_quirk;
    };
    
    static int dp83867_ack_interrupt(struct phy_device *phydev)
    {
    	int err = phy_read(phydev, MII_DP83867_ISR);
    
    	if (err < 0)
    		return err;
    
    	return 0;
    }
    
    static int dp83867_config_intr(struct phy_device *phydev)
    {
    	int micr_status;
    
    	if (phydev->interrupts == PHY_INTERRUPT_ENABLED) {
    		micr_status = phy_read(phydev, MII_DP83867_MICR);
    		if (micr_status < 0)
    			return micr_status;
    
    		micr_status |=
    			(MII_DP83867_MICR_AN_ERR_INT_EN |
    			MII_DP83867_MICR_SPEED_CHNG_INT_EN |
    			MII_DP83867_MICR_AUTONEG_COMP_INT_EN |
    			MII_DP83867_MICR_LINK_STS_CHNG_INT_EN |
    			MII_DP83867_MICR_DUP_MODE_CHNG_INT_EN |
    			MII_DP83867_MICR_SLEEP_MODE_CHNG_INT_EN);
    
    		return phy_write(phydev, MII_DP83867_MICR, micr_status);
    	}
    
    	micr_status = 0x0;
    	return phy_write(phydev, MII_DP83867_MICR, micr_status);
    }
    
    static int dp83867_config_port_mirroring(struct phy_device *phydev)
    {
    	struct dp83867_private *dp83867 =
    		(struct dp83867_private *)phydev->priv;
    	u16 val;
    
    	val = phy_read_mmd(phydev, DP83867_DEVADDR, DP83867_CFG4);
    
    	if (dp83867->port_mirroring == DP83867_PORT_MIRROING_EN)
    		val |= DP83867_CFG4_PORT_MIRROR_EN;
    	else
    		val &= ~DP83867_CFG4_PORT_MIRROR_EN;
    
    	phy_write_mmd(phydev, DP83867_DEVADDR, DP83867_CFG4, val);
    
    	return 0;
    }
    
    #ifdef CONFIG_OF_MDIO
    static int dp83867_of_init(struct phy_device *phydev)
    {
    	struct dp83867_private *dp83867 = phydev->priv;
    	struct device *dev = &phydev->mdio.dev;
    	struct device_node *of_node = dev->of_node;
    	int ret;
    
    	if (!of_node)
    		return -ENODEV;
    
    	dp83867->io_impedance = -EINVAL;
    
    	/* Optional configuration */
    	if (of_property_read_bool(of_node, "ti,max-output-impedance"))
    		dp83867->io_impedance = DP83867_IO_MUX_CFG_IO_IMPEDANCE_MAX;
    	else if (of_property_read_bool(of_node, "ti,min-output-impedance"))
    		dp83867->io_impedance = DP83867_IO_MUX_CFG_IO_IMPEDANCE_MIN;
    
    	dp83867->rxctrl_strap_quirk = of_property_read_bool(of_node,
    					"ti,dp83867-rxctrl-strap-quirk");
    
    	ret = of_property_read_u32(of_node, "ti,rx-internal-delay",
    				   &dp83867->rx_id_delay);
    	if (ret &&
    	    (phydev->interface == PHY_INTERFACE_MODE_RGMII_ID ||
    	     phydev->interface == PHY_INTERFACE_MODE_RGMII_RXID))
    		return ret;
    
    	ret = of_property_read_u32(of_node, "ti,tx-internal-delay",
    				   &dp83867->tx_id_delay);
    	if (ret &&
    	    (phydev->interface == PHY_INTERFACE_MODE_RGMII_ID ||
    	     phydev->interface == PHY_INTERFACE_MODE_RGMII_TXID))
    		return ret;
    
    	if (of_property_read_bool(of_node, "enet-phy-lane-swap"))
    		dp83867->port_mirroring = DP83867_PORT_MIRROING_EN;
    
    	if (of_property_read_bool(of_node, "enet-phy-lane-no-swap"))
    		dp83867->port_mirroring = DP83867_PORT_MIRROING_DIS;
    
    	return of_property_read_u32(of_node, "ti,fifo-depth",
    				   &dp83867->fifo_depth);
    }
    #else
    static int dp83867_of_init(struct phy_device *phydev)
    {
    	return 0;
    }
    #endif /* CONFIG_OF_MDIO */
    
    static int dp83867_config_init(struct phy_device *phydev)
    {
    	struct dp83867_private *dp83867;
    	int ret, val, bs,i=0;
    	u16 delay;
    
    	if (!phydev->priv) {
    		dp83867 = devm_kzalloc(&phydev->mdio.dev, sizeof(*dp83867),
    				       GFP_KERNEL);
    		if (!dp83867)
    			return -ENOMEM;
    
    		phydev->priv = dp83867;
    		ret = dp83867_of_init(phydev);
    		if (ret)
    			return ret;
    	} else {
    		dp83867 = (struct dp83867_private *)phydev->priv;
    	}
    
    		phy_write(phydev, DP83867_CTRL, DP83867_SW_RESET);/*added by astra*/
    
    	/* RX_DV/RX_CTRL strapped in mode 1 or mode 2 workaround */
    	if (dp83867->rxctrl_strap_quirk) {
    		val = phy_read_mmd(phydev, DP83867_DEVADDR, DP83867_CFG4);
    		val &= ~BIT(7);
    		phy_write_mmd(phydev, DP83867_DEVADDR, DP83867_CFG4, val);
    	}
    
    	if (phy_interface_is_rgmii(phydev)) {
    		val = phy_read(phydev, MII_DP83867_PHYCTRL);
    		if (val < 0)
    			return val;
    		val &= ~DP83867_PHYCR_FIFO_DEPTH_MASK;
    		val |= (dp83867->fifo_depth << DP83867_PHYCR_FIFO_DEPTH_SHIFT);
    
    		/* The code below checks if "port mirroring" N/A MODE4 has been
    		 * enabled during power on bootstrap.
    		 *
    		 * Such N/A mode enabled by mistake can put PHY IC in some
    		 * internal testing mode and disable RGMII transmission.
    		 *
    		 * In this particular case one needs to check STRAP_STS1
    		 * register's bit 11 (marked as RESERVED).
    		 */
    
    		bs = phy_read_mmd(phydev, DP83867_DEVADDR, DP83867_STRAP_STS1);
    		pr_info("\nStrap configuration STS1 is %x",bs);
    		if (bs & DP83867_STRAP_STS1_RESERVED)
    			val &= ~DP83867_PHYCR_RESERVED_MASK;
    
    		ret = phy_write(phydev, MII_DP83867_PHYCTRL, val);
    		if (ret)
    			return ret;
    	}
    
    	if ((phydev->interface >= PHY_INTERFACE_MODE_RGMII_ID) &&
    	    (phydev->interface <= PHY_INTERFACE_MODE_RGMII_RXID)) {
    		val = phy_read_mmd(phydev, DP83867_DEVADDR, DP83867_RGMIICTL);
    		pr_info("\nRGMIICTL default value %x",val);
    
    		if (phydev->interface == PHY_INTERFACE_MODE_RGMII_ID)
    			val |= (DP83867_RGMII_TX_CLK_DELAY_EN | DP83867_RGMII_RX_CLK_DELAY_EN);
    
    		if (phydev->interface == PHY_INTERFACE_MODE_RGMII_TXID)
    			val |= DP83867_RGMII_TX_CLK_DELAY_EN;
    
    		if (phydev->interface == PHY_INTERFACE_MODE_RGMII_RXID)
    			val |= DP83867_RGMII_RX_CLK_DELAY_EN;
    
    			val |= 0xD0;/*added by astra*/
    
    		phy_write_mmd(phydev, DP83867_DEVADDR, DP83867_RGMIICTL, val);/*astra*/
    
    		delay = (dp83867->rx_id_delay |
    			(dp83867->tx_id_delay << DP83867_RGMII_TX_CLK_DELAY_SHIFT));
    
    		phy_write_mmd(phydev, DP83867_DEVADDR, DP83867_RGMIIDCTL,
    			      delay);
    
    		if (dp83867->io_impedance >= 0) {
    			val = phy_read_mmd(phydev, DP83867_DEVADDR,
    					   DP83867_IO_MUX_CFG);
    
    			val &= ~DP83867_IO_MUX_CFG_IO_IMPEDANCE_CTRL;
    			val |= dp83867->io_impedance &
    			       DP83867_IO_MUX_CFG_IO_IMPEDANCE_CTRL;
    
    			phy_write_mmd(phydev, DP83867_DEVADDR,
    				      DP83867_IO_MUX_CFG, val);
    		}
    	}
    #if DP83867_DEBUG
    //		pr_info("i\nphydev %x",phydev);
    		val = phy_read_mmd(phydev, DP83867_DEVADDR, DP83867_RGMIICTL);
    		pr_info("\nRGMIICTL register value: %x",val);
    		val = phy_read_mmd(phydev, DP83867_DEVADDR, DP83867_RGMIIDCTL);
    		pr_info("\nRGMIIDCTL register value: %x",val);
    		for(i=0x0;i<=0x1F;i++)
    		{
    		val = phy_read_mmd(phydev, DP83867_DEVADDR, i);
    		pr_info("\n %x register value: %x",i,val);
    		}
    
    		val = phy_read_mmd(phydev, DP83867_DEVADDR,0x6E);
                    pr_info("\n\nSTRAP_STS1 0x6E register value: %x\n\n",val);
    #endif
    
    	/* Enable Interrupt output INT_OE in CFG3 register */
    	if (phy_interrupt_is_valid(phydev)) {
    		val = phy_read(phydev, DP83867_CFG3);
    		val |= BIT(7);
    		phy_write(phydev, DP83867_CFG3, val);
    	}
    
    	if (dp83867->port_mirroring != DP83867_PORT_MIRROING_KEEP)
    		dp83867_config_port_mirroring(phydev);
    
    	return 0;
    }
    
    static int dp83867_phy_reset(struct phy_device *phydev)
    {
    	int err;
    
    	err = phy_write(phydev, DP83867_CTRL, DP83867_SW_RESET);
    	if (err < 0)
    		return err;
    
    	return dp83867_config_init(phydev);
    }
    
    static struct phy_driver dp83867_driver[] = {
    	{
    		.phy_id		= DP83867_PHY_ID,
    		.phy_id_mask	= 0xfffffff0,
    		.name		= "TI DP83867",
    		.features	= PHY_GBIT_FEATURES,
    		.flags		= PHY_HAS_INTERRUPT,
    
    		.config_init	= dp83867_config_init,
    		.soft_reset	= dp83867_phy_reset,
    
    		/* IRQ related */
    		.ack_interrupt	= dp83867_ack_interrupt,
    		.config_intr	= dp83867_config_intr,
    
    		.config_aneg	= genphy_config_aneg,
    		.read_status	= genphy_read_status,
    		.suspend	= genphy_suspend,
    		.resume		= genphy_resume,
    	},
    };
    module_phy_driver(dp83867_driver);
    
    static struct mdio_device_id __maybe_unused dp83867_tbl[] = {
    	{ DP83867_PHY_ID, 0xfffffff0 },
    	{ }
    };
    
    MODULE_DEVICE_TABLE(mdio, dp83867_tbl);
    
    MODULE_DESCRIPTION("Texas Instruments DP83867 PHY driver");
    MODULE_AUTHOR("Dan Murphy <dmurphy@ti.com");
    MODULE_LICENSE("GPL");
    

    Let me know if any changes have to be made in this driver code also.

    Regards,

    Chinmay

  • Hi Chinmay,

    Can you kindly confirm the following and I will provide appropriate strap settings:

    1. MAC interface: RGMII confirmed. 

    2. Auto-negotiation all speeds or advertise10/100, 100/1000, etc? If not auto-neg, do you want to force only 100M?

    3. Auto MDIX or force either MDI or MDIX?

    4. Full duplex vs half duplex: full duplex confirmed.

    5. Enable mirror mode?

    6. Any RGMII clock skew needed?

    Thank you,

    Nikhil

  • Dear Nikhil,

    Kindly let us know the strap setting for the following configuration:

    1. MAC interface: RGMII confirmed. 

    RGMII

    2. Auto-negotiation all speeds or advertise10/100, 100/1000, etc? If not auto-neg, do you want to force only 100M?

    We need auto negotiation with 10/100/1000

    3. Auto MDIX or force either MDI or MDIX?

    Auto MDIX

    4. Full duplex vs half duplex: full duplex confirmed.

    Full Duplex

    5. Enable mirror mode?

    Mirror disabled

    6. Any RGMII clock skew needed?

    No RGMII clock skew. Skew is 0

  • Hi Chinmay,

    Thanks for the information. You may use the following strap settings:

    • LED 1: Mode 1 (auto-neg select)
    • LED0: Mode 0 (disable mirror mode)
    • RX_D4: Mode 1 or Mode 2 (auto-neg select, mode 1 or mode 2 changes PHY address)
    • RX_D5: Mode 0 (auto-neg select)
    • RX_D6: Mode 0 (RGMII enable, auto-MDIX enable)
    • RX_DV: Mode 3 (auto-neg enable)

    Additionally, CRS pin must be strapped to mode 1 or mode 2. RX_D0 and RX_D2 may be strapped to adjust the PHY ID. Please review section 8.5 of the datasheet for recommended resistor values for each mode.

    Thank you,

    Nikhil