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.

AM5728: PHY Device configuration in uboot

Part Number: AM5728

Hi,

We are working on a custom board based on AM5728.  

In evm AM5728 we have 2 PHY devices. We have replaced these with a single dual-port PHY device, Microsemi VSC8502, on custom board .

On u-boot prompt, mii command not showing info of phy device. 

=> mii device
MII devices: 'ethernet@48484000'
Current device: 'ethernet@48484000'
=> mii info
=> mii info 0x01
=> mii info 0x02
=> mii dump 1 0
Error reading from the PHY addr=01 reg=00

am57xx-beagle-x15-common.dtsi

--------------------------------------------

&davinci_mdio {
phy0: ethernet-phy@1 {
reg = <1>;
};

phy1: ethernet-phy@2 {
reg = <2>;
};
};

&mac {
status = "okay";
dual_emac;
};

&cpsw_emac0 {
phy-handle = <&phy0>;
phy-mode = "rgmii";
dual_emac_res_vlan = <1>;
};

&cpsw_emac1 {
phy-handle = <&phy1>;
phy-mode = "rgmii";
dual_emac_res_vlan = <2>;
};

What do we need to change for mii command to work ?

  • Hi,

    Which SDK version are you using ? Can you share your other uboot DT changes ?

    Regards

    Vineet

  • Hi Vineet,

    I am using Linux SDK 6.03 on a bare custom board based on AM5728 SoC.

    I have referred to this link: https://software-dl.ti.com/public/hpmp/sitara/eth_sys_sw_am_devices/presentation_html5.html

    and following changes have been done at the u-boot level:

    1.Enabled flags in .config file 

     CONFIG_DRIVER_TI_CPSW=y

     CONFIG_RGMII=y

    CONFIG_PHY_MICREL is not set
    CONFIG_PHY_MICREL_KSZ90X1 is not set
    CONFIG_PHY_MSCC=y

    2. board/ti/am57xx/board.c

    Changed the PHY Address from <1> & <2> to <0> and <1>. This change is told by Microsemi, according to them their devices support start address from even number.

    static struct cpsw_slave_data cpsw_slaves[] = {
    {
    .slave_reg_ofs = 0x208,
    .sliver_reg_ofs = 0xd80,
    .phy_addr = 0,
    },
    {
    .slave_reg_ofs = 0x308,
    .sliver_reg_ofs = 0xdc0,
    .phy_addr = 1,
    },
    };

    3.  board/ti/am57xx/board.c

    As per the video link shared above, the function name should be  [ void set_muxconf_regs_essential(void) ], but in our case :

    void set_muxconf_regs(void)
    {
    do_set_mux32((*ctrl)->control_padconf_core_base,
    early_padconf, ARRAY_SIZE(early_padconf));

    #ifdef CONFIG_SUPPORT_EMMC_BOOT
    do_set_mux32((*ctrl)->control_padconf_core_base,
    emmc_padconf, ARRAY_SIZE(emmc_padconf));
    #endif
    }

    4. arch/arm/dts/am57xx-beagle-x15-common.dtsi

    Changed the PHY Address from <1> & <2> to <0> and <1>.

    &davinci_mdio {
    phy0: ethernet-phy@0 {
    reg = <0>;
    };

    phy1: ethernet-phy@1 {
    reg = <1>;
    };
    };

    After all the changes were done, following commands were tried at u-boot prompt:

    1.  mii device

    MII devices: 'ethernet@48484000'
    Current device: 'ethernet@48484000'

    2. 
    => mii info
    => mii info 0x00
    => mii info 0x01
    => mii dump 1 0

    Error reading from the PHY addr=01 reg=00

    Why no output is being displayed on mii info and error in reading from PHY register?

     

    Regards

    Rohit

  • Hi Vineet,

    This is a gentle reminder. Please reply.

  • Hi Rohit,

    I am checking internally, will get back soon.

    Regards

    Vineet

  • Hi Vineet,

    I would like to bring to your notice the few updates on the trials done while porting VSC8502 PHY device on TI-AM5728 chipset.

    On the u-boot level, I ran few commands, it seems the PHY device is being detected. Please find the attached file for the commands and their corresponding output. However, few issues are still being observed. Please provide a resolution for the same.

    • On running < mii info > command, the following output is coming.

    => mii info

    PHY 0x00: OUI = 0x01C1, Model = 0x23, Rev = 0x01, 10baseT, HDX

    PHY 0x01: OUI = 0x01C1, Model = 0x23, Rev = 0x01, 10baseT, HDX

    As per this link Section 6, one paramtere 10baseT should change to 1000baseT when an ethernet cable is connected. But, the same is not happening at the moment.

    However, on the other hand, On TI-AM5728 Evaluation Module, where Microsemi Micrel PHY device is connected,

    on connecting Ethernet wire to PHY port, 10baseT is changed to 1000baseT, and on removing ethernet wire, it is changed back to 10baseT

    • Also, LEDs on the PHY device should be glowing only when the ethernet wire is connected and should be OFF when no ethernet wire is connected. But, currently, even though no ethernet wire is connected to the PHY port, all the LEDs of the PHY device are glowing.

    • On allocating IP Address at u-boot level through DHCP command, no IP Address is getting allocated

                        ethernet@48484000 Waiting for PHY auto negotiation to complete................. TIMEOUT !

    Regards

    Rohit

    => mii device
    MII devices: 'ethernet@48484000' 
    Current device: 'ethernet@48484000'
    => mii info  
    PHY 0x00: OUI = 0x01C1, Model = 0x23, Rev = 0x01,  10baseT, HDX
    PHY 0x01: OUI = 0x01C1, Model = 0x23, Rev = 0x01,  10baseT, HDX
    => mii dump 0x00 0
    0.     (1040)                 -- PHY control register --
      (8000:0000) 0.15    =     0    reset
      (4000:0000) 0.14    =     0    loopback
      (2040:0040) 0. 6,13 =   b10    speed selection = 1000 Mbps
      (1000:1000) 0.12    =     1    A/N enable
      (0800:0000) 0.11    =     0    power-down
      (0400:0000) 0.10    =     0    isolate
      (0200:0000) 0. 9    =     0    restart A/N
      (0100:0000) 0. 8    =     0    duplex = half
      (0080:0000) 0. 7    =     0    collision test enable
      (003f:0000) 0. 5- 0 =     0    (reserved)
    
    
    => mii dump 0x00 1
    1.     (7949)                 -- PHY status register --
      (8000:0000) 1.15    =     0    100BASE-T4 able
      (4000:4000) 1.14    =     1    100BASE-X  full duplex able
      (2000:2000) 1.13    =     1    100BASE-X  half duplex able
      (1000:1000) 1.12    =     1    10 Mbps    full duplex able
      (0800:0800) 1.11    =     1    10 Mbps    half duplex able
      (0400:0000) 1.10    =     0    100BASE-T2 full duplex able
      (0200:0000) 1. 9    =     0    100BASE-T2 half duplex able
      (0100:0100) 1. 8    =     1    extended status
      (0080:0000) 1. 7    =     0    (reserved)
      (0040:0040) 1. 6    =     1    MF preamble suppression
      (0020:0000) 1. 5    =     0    A/N complete
      (0010:0000) 1. 4    =     0    remote fault
      (0008:0008) 1. 3    =     1    A/N able
      (0004:0000) 1. 2    =     0    link status
      (0002:0000) 1. 1    =     0    jabber detect
      (0001:0001) 1. 0    =     1    extended capabilities
    
    
    => mii dump 0x00 2
    2.     (0007)                 -- PHY ID 1 register --
      (ffff:0007) 2.15- 0 =     7    OUI portion
    
    
    => mii dump 0x00 3
    3.     (0631)                 -- PHY ID 2 register --
      (fc00:0400) 3.15-10 =     1    OUI portion
      (03f0:0230) 3. 9- 4 =    35    manufacturer part number
      (000f:0001) 3. 3- 0 =     1    manufacturer rev. number
    
    
    => mii dump 0x00 4
    4.     (01e1)                 -- Autonegotiation advertisement register --
      (8000:0000) 4.15    =     0    next page able
      (4000:0000) 4.14    =     0    (reserved)
      (2000:0000) 4.13    =     0    remote fault
      (1000:0000) 4.12    =     0    (reserved)
      (0800:0000) 4.11    =     0    asymmetric pause
      (0400:0000) 4.10    =     0    pause enable
      (0200:0000) 4. 9    =     0    100BASE-T4 able
      (0100:0100) 4. 8    =     1    100BASE-TX full duplex able
      (0080:0080) 4. 7    =     1    100BASE-TX able
      (0040:0040) 4. 6    =     1    10BASE-T   full duplex able
      (0020:0020) 4. 5    =     1    10BASE-T   able
      (001f:0001) 4. 4- 0 =     1    selector = IEEE 802.3
    
    
    => mii dump 0x00 5
    5.     (0000)                 -- Autonegotiation partner abilities register --
      (8000:0000) 5.15    =     0    next page able
      (4000:0000) 5.14    =     0    acknowledge
      (2000:0000) 5.13    =     0    remote fault
      (1000:0000) 5.12    =     0    (reserved)
      (0800:0000) 5.11    =     0    asymmetric pause able
      (0400:0000) 5.10    =     0    pause able
      (0200:0000) 5. 9    =     0    100BASE-T4 able
      (0100:0000) 5. 8    =     0    100BASE-X full duplex able
      (0080:0000) 5. 7    =     0    100BASE-TX able
      (0040:0000) 5. 6    =     0    10BASE-T full duplex able
      (0020:0000) 5. 5    =     0    10BASE-T able
      (001f:0000) 5. 4- 0 =     0    selector = ???
    
    
    => mii dump 0x01 0
    0.     (1040)                 -- PHY control register --
      (8000:0000) 0.15    =     0    reset
      (4000:0000) 0.14    =     0    loopback
      (2040:0040) 0. 6,13 =   b10    speed selection = 1000 Mbps
      (1000:1000) 0.12    =     1    A/N enable
      (0800:0000) 0.11    =     0    power-down
      (0400:0000) 0.10    =     0    isolate
      (0200:0000) 0. 9    =     0    restart A/N
      (0100:0000) 0. 8    =     0    duplex = half
      (0080:0000) 0. 7    =     0    collision test enable
      (003f:0000) 0. 5- 0 =     0    (reserved)
    
    
    => mii dump 0x01 1
    1.     (7949)                 -- PHY status register --
      (8000:0000) 1.15    =     0    100BASE-T4 able
      (4000:4000) 1.14    =     1    100BASE-X  full duplex able
      (2000:2000) 1.13    =     1    100BASE-X  half duplex able
      (1000:1000) 1.12    =     1    10 Mbps    full duplex able
      (0800:0800) 1.11    =     1    10 Mbps    half duplex able
      (0400:0000) 1.10    =     0    100BASE-T2 full duplex able
      (0200:0000) 1. 9    =     0    100BASE-T2 half duplex able
      (0100:0100) 1. 8    =     1    extended status
      (0080:0000) 1. 7    =     0    (reserved)
      (0040:0040) 1. 6    =     1    MF preamble suppression
      (0020:0000) 1. 5    =     0    A/N complete
      (0010:0000) 1. 4    =     0    remote fault
      (0008:0008) 1. 3    =     1    A/N able
      (0004:0000) 1. 2    =     0    link status
      (0002:0000) 1. 1    =     0    jabber detect
      (0001:0001) 1. 0    =     1    extended capabilities
    
    => mii dump 0x01 2
    2.     (0007)                 -- PHY ID 1 register --
      (ffff:0007) 2.15- 0 =     7    OUI portion
    
    
    => mii dump 0x01 3
    3.     (0631)                 -- PHY ID 2 register --
      (fc00:0400) 3.15-10 =     1    OUI portion
      (03f0:0230) 3. 9- 4 =    35    manufacturer part number
      (000f:0001) 3. 3- 0 =     1    manufacturer rev. number
    
    
    => mii dump 0x01 4
    4.     (01e1)                 -- Autonegotiation advertisement register --
      (8000:0000) 4.15    =     0    next page able
      (4000:0000) 4.14    =     0    (reserved)
      (2000:0000) 4.13    =     0    remote fault
      (1000:0000) 4.12    =     0    (reserved)
      (0800:0000) 4.11    =     0    asymmetric pause
      (0400:0000) 4.10    =     0    pause enable
      (0200:0000) 4. 9    =     0    100BASE-T4 able
      (0100:0100) 4. 8    =     1    100BASE-TX full duplex able
      (0080:0080) 4. 7    =     1    100BASE-TX able
      (0040:0040) 4. 6    =     1    10BASE-T   full duplex able
      (0020:0020) 4. 5    =     1    10BASE-T   able
      (001f:0001) 4. 4- 0 =     1    selector = IEEE 802.3
    
    
    => mii dump 0x01 5
    5.     (0000)                 -- Autonegotiation partner abilities register --
      (8000:0000) 5.15    =     0    next page able
      (4000:0000) 5.14    =     0    acknowledge
      (2000:0000) 5.13    =     0    remote fault
      (1000:0000) 5.12    =     0    (reserved)
      (0800:0000) 5.11    =     0    asymmetric pause able
      (0400:0000) 5.10    =     0    pause able
      (0200:0000) 5. 9    =     0    100BASE-T4 able
      (0100:0000) 5. 8    =     0    100BASE-X full duplex able
      (0080:0000) 5. 7    =     0    100BASE-TX able
      (0040:0000) 5. 6    =     0    10BASE-T full duplex able
      (0020:0000) 5. 5    =     0    10BASE-T able
      (001f:0000) 5. 4- 0 =     0    selector = ???
    
    

  • Hi Vineet,

     

    This is a gentle reminder. Please reply.

    Regards,

    Rohit

  • Hi Rohit,

    Sorry for the delay. PHY configuration seems to be correct except that you have half-duplex enabled in the PHY control register. Could you try manually updating that to full using the mii write command ?

    I am also wondering if there is something wrong with the RGMII wiring that you have done (since it's a custom board). Can you check the TXC signal on your board and make sure that on link establishment, it's not coming to 2.5Mhz (default) ?

    That would indicate an issue with either pinmuxing or HW.

    Regards

    Vineet