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.

TMS570LC4357: Ethernet PHY not accessible.

Part Number: TMS570LC4357


i was using marvel phy with TMS570LC4357 . The marvel PHY is clause 45 type addressable register, it can be accessed using clause 22 through reg 13 and 14 . can any one suggest how to configure the TMS570LC43xx to access the PHY's register.

  • Hi Ramesh,

    Please use MDIO to access the PHY registers. For example:

    #define mdioUSERACCESS0 *( volatile uint32_t* )( MDIO_BASE + MDIO_USERACCESS0 )
    #define mdioCONTROL *( volatile uint32_t* )( MDIO_BASE + MDIO_CONTROL )


    uint16_t phy_getReg( uint16_t phynum, uint16_t regnum )
    {
    uint16_t value;

    mdioUSERACCESS0 = 0 // Read Phy Id 1
    | ( 1 << 31 ) // [31] Go
    | ( 0 << 30 ) // [30] Read
    | ( 0 << 29 ) // [29] Ack
    | ( (regnum & 0x1F) << 21 ) // [25-21] PHY register address
    | ( (phynum & 0x1F) << 16 ) // [20-16] PHY address
    | ( 0 << 0 ); // [15-0] Data

    while( mdioUSERACCESS0 & 0x80000000 ); // Wait for Results

    value = mdioUSERACCESS0;
    return value;
    }

    /* ------------------------------------------------------------------------ *
    * phy_setReg( phynum, regnum, data ) *
    * ------------------------------------------------------------------------ */
    void phy_setReg( uint16_t phynum, uint16_t regnum, uint16_t data )
    {
    mdioUSERACCESS0 = 0 // Read Phy Id 1
    | ( 1 << 31 ) // [31] Go
    | ( 1 << 30 ) // [30] Write
    | ( 0 << 29 ) // [29] Ack
    | ( (regnum & 0x1F) << 21 ) // [25-21] PHY register address
    | ( (phynum & 0x1F) << 16 ) // [20-16] PHY address
    | ( (data & 0xFFFF) << 0 ); // [15-0] Data

    while( mdioUSERACCESS0 & 0x80000000 ); // Wait for Results
    }