Post Go back to editing

U-Boot and Fixed PHY Support

Hi,

We' are trying to add support for fixed phy in u-boot.

We removed all ethernet PHY from config in this case generic phy should be used.

With this change we cannot make any network communication although the interface seems to be available with the incorrect link speed a duplex setting (as per the below).

sc # ping $serverip
Speed: 10, half duplex
Using dwmac.3100c000 device
ping failed; host 192.168.0.2 is not alive


sc # mdio list
dwmac.3100c000:
0 - Generic PHY <--> dwmac.3100c000

Do you have any suggestions on how to make this work under uboot?

Once we boot to linux we have it working by changes in the devicetree.

Regards,

Mark

  • Hi Mark,

    Can you please share your changes in u-boot to reproduce the issue from my end.

    Thanks
    Vignesh R

  • Hi Vignesh,

    Thank you for your reply.

    Please see the below, if you need anything further please let me know.

    Regards,
    Mark

    Date: Fri, 14 Jan 2022 16:34:09 +0100
    Subject: [PATCH] Remove phy handling
    
    ---
     board/adi/sc589-mini/sc589-mini.c | 19 -------------------
     include/configs/sc589-mini.h      |  1 -
     2 files changed, 20 deletions(-)
    
    diff --git a/board/adi/sc589-mini/sc589-mini.c b/board/adi/sc589-mini/sc589-mini.c
    index 61aaf62..8959f9f 100644
    --- a/board/adi/sc589-mini/sc589-mini.c
    +++ b/board/adi/sc589-mini/sc589-mini.c
    @@ -96,25 +96,6 @@ int board_eth_init(bd_t *bis)
     
     int board_phy_config(struct phy_device *phydev)
     {
    -	int  phy_data = 0;
    -
    -	/* enable RGMII mode */
    -	phy_data = phy_read(phydev, MDIO_DEVAD_NONE, 0x32);
    -	phy_write(phydev, MDIO_DEVAD_NONE, 0x32, (1 << 7) | phy_data);
    -#ifdef CONFIG_PHY_TI
    -	int cfg3 = 0;
    -	#define MII_DP83867_CFG3    (0x1e)
    -	/*
    -	 * Pin INT/PWDN on DP83867 should be configured as an Interrupt Output
    -	 * instead of a Power-Down Input on ADI SC5XX boards in order to
    -	 * prevent the signal interference from other peripherals during they
    -	 * are running at the same time.
    -	 */
    -	 cfg3 = phy_read(phydev, MDIO_DEVAD_NONE, MII_DP83867_CFG3);
    -	 cfg3 |= (1 << 7);
    -	 phy_write(phydev, MDIO_DEVAD_NONE, MII_DP83867_CFG3, cfg3);
    -#endif
    -
     	if (phydev->drv->config)
     		phydev->drv->config(phydev);
     
    diff --git a/include/configs/sc589-mini.h b/include/configs/sc589-mini.h
    index 304012f..3f8644e 100644
    --- a/include/configs/sc589-mini.h
    +++ b/include/configs/sc589-mini.h
    @@ -123,7 +123,6 @@
     #define CONFIG_DW_AXI_BURST_LEN 16
     #define CONFIG_MII
     #define CONFIG_PHYLIB
    -#define CONFIG_PHY_TI
     #define CONFIG_ETHADDR	02:80:ad:20:31:e8
     
     /*
    -- 
    2.7.4
    
    

    Date: Mon, 13 Sep 2021 11:26:23 +0200
    Subject: [PATCH] Update dtb name for fixed phy model
    
    
    ---
     include/configs/sc589-mini.h | 2 +-
     1 file changed, 1 insertion(+), 1 deletion(-)
    
    diff --git a/include/configs/sc589-mini.h b/include/configs/sc589-mini.h
    index 3f8644e..12f735b 100644
    --- a/include/configs/sc589-mini.h
    +++ b/include/configs/sc589-mini.h
    @@ -115,7 +115,7 @@
     #define ADI_CMDS_NETWORK
     #define CONFIG_NETCONSOLE
     #define CONFIG_NET_MULTI
    -#define CONFIG_DTBNAME		"sc589-mini.dtb"
    +#define CONFIG_DTBNAME		"sc589-mini-fixed-phy.dtb"
     #define CONFIG_HOSTNAME		"sc58x"
     #define CONFIG_DESIGNWARE_ETH
     #define CONFIG_DW_AUTONEG
    -- 
    2.7.4
    
    

    Date: Tue, 7 Sep 2021 09:11:56 +0200
    Subject: [PATCH] Disable TI phy
    
    ---
     include/configs/sc589-mini.h | 1 -
     1 file changed, 1 deletion(-)
    
    diff --git a/include/configs/sc589-mini.h b/include/configs/sc589-mini.h
    index 304012f..3f8644e 100644
    --- a/include/configs/sc589-mini.h
    +++ b/include/configs/sc589-mini.h
    @@ -123,7 +123,6 @@
     #define CONFIG_DW_AXI_BURST_LEN 16
     #define CONFIG_MII
     #define CONFIG_PHYLIB
    -#define CONFIG_PHY_TI
     #define CONFIG_ETHADDR	02:80:ad:20:31:e8
     
     /*
    -- 
    2.7.4
    
    

  • Hi Mark,

    I have removed the TI phy handling as below and I could ping another machine from sc589-mini board.

    Please find the below changes and log.

    diff --git a/board/adi/sc589-mini/sc589-mini.c b/board/adi/sc589-mini/sc589-mini.c
    index 61aaf62..95f5b23 100644
    --- a/board/adi/sc589-mini/sc589-mini.c
    +++ b/board/adi/sc589-mini/sc589-mini.c
    @@ -96,24 +96,6 @@ int board_eth_init(bd_t *bis)
     
     int board_phy_config(struct phy_device *phydev)
     {
    -       int  phy_data = 0;
    -
    -       /* enable RGMII mode */
    -       phy_data = phy_read(phydev, MDIO_DEVAD_NONE, 0x32);
    -       phy_write(phydev, MDIO_DEVAD_NONE, 0x32, (1 << 7) | phy_data);
    -#ifdef CONFIG_PHY_TI
    -       int cfg3 = 0;
    -       #define MII_DP83867_CFG3    (0x1e)
    -       /*
    -        * Pin INT/PWDN on DP83867 should be configured as an Interrupt Output
    -        * instead of a Power-Down Input on ADI SC5XX boards in order to
    -        * prevent the signal interference from other peripherals during they
    -        * are running at the same time.
    -        */
    -        cfg3 = phy_read(phydev, MDIO_DEVAD_NONE, MII_DP83867_CFG3);
    -        cfg3 |= (1 << 7);
    -        phy_write(phydev, MDIO_DEVAD_NONE, MII_DP83867_CFG3, cfg3);
    -#endif
     
            if (phydev->drv->config)
                    phydev->drv->config(phydev);
    diff --git a/include/configs/sc589-mini.h b/include/configs/sc589-mini.h
    index 304012f..3f8644e 100644
    --- a/include/configs/sc589-mini.h
    +++ b/include/configs/sc589-mini.h
    @@ -123,7 +123,6 @@
     #define CONFIG_DW_AXI_BURST_LEN 16
     #define CONFIG_MII
     #define CONFIG_PHYLIB
    -#define CONFIG_PHY_TI
     #define CONFIG_ETHADDR 02:80:ad:20:31:e8
     
     /*

    resetting ...
    
    
    U-Boot 2015.01 ADI-YOCTO-1.0.0 (Feb 04 2022 - 12:52:16)
    
    CPU:   ADSP ADSP-SC589-0.1 (Detected Rev: 1.1) (spi flash boot)
    VCO: 450 MHz, Cclk0: 450 MHz, Sclk0: 112.500 MHz, Sclk1: 112.500 MHz, DCLK: 450 MHz
    OCLK: 150 MHz
           Watchdog enabled
    I2C:   ready
    DRAM:  224 MiB
    MMC:   SC5XX SDH: 0
    SF: Detected IS25LP512 with page size 256 Bytes, erase size 64 KiB, total 64 MiB
    In:    serial
    Out:   serial
    Err:   serial
    other init
    Net:   dwmac.3100c000
    Hit any key to stop autoboot:  0 
    
    sc # mdio list
    dwmac.3100c000:
    0 - Generic PHY <--> dwmac.3100c000
    
    sc # ping $serverip 
    Speed: 1000, full duplex
    Using dwmac.3100c000 device
    host xxx.xx.10.76 is alive

    Thanks

    Vignesh R

  • Hi Vignesh, 

    Thank you for your replay, Does your board have a PHY attached?  I think it is auto negotiating and allowing the port to be enabled, in our design there is no PHY so we need to force it to 1000/FULL.

    Can you please advise how this is possible or another solution for a fixed PHY option (direct link to switch).

    Regards,

    Mark

  • Hi, we managed to fix this by fixing the link to 1000/full in the driver.