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/DP83630: Ethernet driver issue

Part Number: DP83630
Other Parts Discussed in Thread: AM3359, DP83640

Tool/software: Linux

SDK 5.00.00.15, linux RT.

Am3359 аnd DP83630.

I have finalized a dp83640.c module like a module dp83640.c from SDK 3 (add the dp83640_features_reconfig() function, and run it from dp83640_probe() ).

So, it works, but: if the optic cable switch on/off, the linux RT does not show any echo like a "link is up/down".

Why?

P.S. In SDK 3, it works fine.

  • Hi VLeshka,

    This appears to be an SDK issue if it works in SDK 3 and not SDK 5. I will move your thread to the Sitara for better visibility for the experts.

    Best Regards,
  • Thanks great!

    I'm waiting for answer.

  • Hi,

    Can I am assume this PHY is connected with fiber? What were the changes you performed on the driver and why were the changes needed? Could you post them here?

    One thing to note is that we only support the TI SDK on TI EVMs, currently none of the TI EVMs have a fiber optic link.

    Best Regards,
    Schuyler
  • Hi,

    Of course, the am3359 connected with fiber via DP83630. The frames are transfer good.

    The changes are in SDK 3 and 5 (from e2e.ti.com/.../2175135

    1. Compile kernel with dp83640 driver 
     - added "config DP83640_PHY" into /drivers/net/phy/Kconfig 
     - added "CONFIG_DP83640_PHY=y" into .config

    2. Add to dp83640.c:

    static int ext_read(struct phy_device *phydev, int page, u32 regnum);
    #define PCSR 0x16
    #define FX_EN 0x40
    static void dp83640_features_reconfig(struct phy_device *phydev)
    {
    //        u16 pcsr;
    //        struct dp83640_private *dp83640 = phydev->priv;
    
    //        mutex_lock(&dp83640->clock->extreg_lock);
    //        pcsr = ext_read(phydev, PAGE0, PCSR); /* PCSR */
    //        mutex_unlock(&dp83640->clock->extreg_lock);
    
    //        if (pcsr & FX_EN) {
    //                pr_info("fiber mode detected\n");
    //                phydev->autoneg = AUTONEG_DISABLE;
    //                phydev->speed = SPEED_100;
    //                phydev->duplex = DUPLEX_FULL;
    //		  pr_err("UAU! Custom config for DP83640");
    //        }  
    
    
    	u16 pcsr;
    	struct dp83640_private *dp83640 = phydev->priv;
    	struct dp83640_clock *clock = dp83640->clock;
    
            mutex_lock(&clock->extreg_lock);
    	pcsr = ext_read(phydev, PAGE0, PCSR); 
    	mutex_unlock(&clock->extreg_lock);
    
    	if (pcsr & FX_EN) {
                    pr_info("fiber mode detected\n");
                    phydev->autoneg = AUTONEG_DISABLE;
                    phydev->speed = SPEED_100;
                    phydev->duplex = DUPLEX_FULL;
    		pr_err("UAU! Custom config for DP83640");
            }  
    }

    3. run the dp83640_features_reconfig() from from dp83640_probe() in dp83640.c:

    ...
    	dp83640_clock_put(clock);
    
    	//from ez.analog.com/.../49703
    	dp83640_features_reconfig(phydev);
    
    	return 0;
    
    no_register:
    ...
    ______________________________

    The am3359 have a fiber optic link via DP83630, and works in SDK 3 nicely.
  • Hi,
    Thank you for posting the changes. Could please post the PHY node from the DTS file that you are using? Also please attach the full source file. Also please note that TI does not have an EVM (board ) running Linux that uses fiber so we will not be able to fully support this question.
    Best Regards,
    Schuyler
  • I hope for the best.

    In zip atach: the dts file (from device by command dtc) and the full source file.atach.zip