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 register access in U-boot

Part Number: AM5728

On my custom AM5728 board, running TI Linux SDK 5.02, which includes TI U-Boot 2018.01, I am trying to follow Ethernet PHY (TI DP83867) I/O delay tuning guide from here

The guide lists these 5 steps:

  1. write 0x0040 to register 0x0000 // Force 1000BASE speed
  2. write 0x0c01 to register 0x0170 // Adjust IO pad impedance
  3. write 0xd001 to register 0x0016 // Start PRBS generation and loopback to RGMII
  4. write 0x0077 to register 0x0086 // Set RX & TX RGMII clock delay to 2.0 ns
  5. write 0x00d3 to register 0x0032 // Enable RX & TX clock delay

U-Boot can detect the Phy without issue:

=> mii device 
MII devices: 'ethernet@48484000' 
Current device: 'ethernet@48484000'
=> mii info 0
PHY 0x00: OUI = 0x80028, Model = 0x23, Rev = 0x01, 1000baseT, FDX

And can also read the control register using mdio and mii commands:

=> mdio read 0
Reading from bus ethernet@48484000
PHY at address 0:
0 - 0x40
=> mii dump 0 0
0. (0040) -- 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:0000) 0.12 = 0 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)


However, I can't seem to access ass register 0x1F:

=> mdio read 0x1f

Reading from bus ethernet@48484000

PHY at address 0:

31 - 0x0

=> mdio read 0x20

Reading from bus ethernet@48484000

PHY at address 0:

Error


And the mdio command mentions this limitation:

mdio - MDIO utility commands

Usage:
mdio list - List MDIO buses
mdio read <phydev> [<devad>.]<reg> - read PHY's register at <devad>.<reg>
mdio write <phydev> [<devad>.]<reg> <data> - write PHY's register at <devad>.<reg>
mdio rx <phydev> [<devad>.]<reg> - read PHY's extended register at <devad>.<reg>
mdio wx <phydev> [<devad>.]<reg> <data> - write PHY's extended register at <devad>.<reg>
<phydev> may be:
<busname> <addr>
<addr>
<eth name>
<addr> <devad>, and <reg> may be ranges, e.g. 1-5.4-0x1f.

 


So how do I access registers at 0x170 to run the Phy IO delay tuning?

  • Hello,

    I am assuming you are trying to access an extended register and here are the steps I used on my AM5728 GPEVM:

    => mdio list                                                                                                                                                                                                
    ethernet@48484000:     <====== Bus Name                                                                                                                                                                          
    1 - Micrel ksz9031 <--> ethernet@48484000 
    
    => mii info                                                                                                                                                                                                 
    PHY 0x01: OUI = 0x0885, Model = 0x22, Rev = 0x02, 1000baseT, FDX    <====== Confirm Phy. Address                                                                                                                                        
    PHY 0x02: OUI = 0x0885, Model = 0x22, Rev = 0x02,  10baseT, HDX  
    
    => mdio rx ethernet@48484000 1.15                                                                                                                                                                           
    Reading from bus ethernet@48484000                                                                                                                                                                          
    PHY at address 1:                                                                                                                                                                                           
    1.21 - 0x0

    Regards,
    Krunal

  • Thanks Krunal. 

    Does DP83867 support extended register access?

    I am seeing this trying to read register 0x20 from Phy 0:

    => mii info
    PHY 0x00: OUI = 0x80028, Model = 0x23, Rev = 0x01, 1000baseT, FDX
    PHY 0x03: OUI = 0x80028, Model = 0x23, Rev = 0x01, 10baseT, HDX

    mdio rx ethernet@48484000 0.20
    PHY does not have extended functions
    mdio - MDIO utility commands

    Usage:
    mdio list - List MDIO buses
    mdio read <phydev> [<devad>.]<reg> - read PHY's register at <devad>.<reg>
    mdio write <phydev> [<devad>.]<reg> <data> - write PHY's register at <devad>.<reg>
    mdio rx <phydev> [<devad>.]<reg> - read PHY's extended register at <devad>.<reg>
    mdio wx <phydev> [<devad>.]<reg> <data> - write PHY's extended register at <devad>.<reg>
    <phydev> may be:
    <busname> <addr>
    <addr>
    <eth name>
    <addr> <devad>, and <reg> may be ranges, e.g. 1-5.4-0x1f.

  • Hello,

    Could you please run the following command to see if the phy supports extended register: mii dump 0 1?

    Regards,
    Krunal

  • Here it is:

    => mii dump 0 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

    It appears to support extended status..?

  • Hello,

    Based on my discussion with our expert, this not an expected behavior and I will file an internal ticket for further investigation.

    Regards,
    Krunal

  • Thanks Krunal. Keep me posted.

  • Can someone please suggest DP83867 on AM5728 custom board? It looks like the extended address range for DP83867 isn't available via U-Boot.

    How else can I tune the PHY for 1Gbps connection speed?

  • Hi,

    The development team has confirmed that the PHY driver does not have the functions necessary for accessing the extended registers. They are evaluating on how to add the extended register support to the driver. We don't have a timeline at the moment on when the support will be added and available to customers. The app note that you have referenced is from a different team that supports the PHY. Our team only supports the processor. I will contact them and see if there is another method they can recommend for accessing the extended mode registers.

    Best Regards,

    Schuyler

  • Hi,

    As an intermediate step the PHY team is suggesting the following technique to access the PHY registers with the mii  tool and not the mdio tool in U-Boot.

    Access would be using these two instructions:

    mii read <addr>  <reg>      

    mii write <addr>  <reg>  <data>

    So an example would be like this to access register 0x462 please do the following:

                    mii write <addr>  0xd  0x1F 

                    mii write <addr>  0xe 0x462 

                    mii write <addr>  0xd 0x401F 

                    mii read  <addr> 0xd                           // value in 0xD is actually the value in 0x462

    Please give this a try and let us know if it works.

    Best Regards,

    Schuyler

  • Hi,

    Since we have heard back we will assume that you were able to move past the issue and I will close the thread. If that is not the case you can re-open this thread or you can file a new thread based on this thread.

    Best Regards,

    Schuyler

  • An update to the thread is that the extended register access will be fixed in the normal quarterly TI Processors SDK Linux release in 2020.