AM64x MCU+ SDK  10.00.00

Introduction

This module contains APIs to program and use the MDIO module.

Functions

int32_t MDIO_initClock (uint32_t baseAddr)
 This function initializes the MDIO clock. More...
 
int32_t MDIO_phyRegRead (uint32_t baseAddr, void *pUserGroup, uint32_t phyAddr, uint32_t regNum, uint16_t *pData)
 This API reads an IEEE defined PHY register using MDIO. It should be called only after successful execution of MDIO_initClock(). More...
 
int32_t MDIO_phyRegWrite (uint32_t baseAddr, void *pUserGroup, uint32_t phyAddr, uint32_t regNum, uint16_t wrVal)
 This API writes an IEEE defined PHY register using MDIO. It should be called only after successful execution of MDIO_initClock(). More...
 
int32_t MDIO_phyExtRegRead (uint32_t baseAddr, void *pUserGroup, uint32_t phyAddr, uint32_t regNum, uint16_t *pData)
 This API reads an extended PHY register using MDIO. It should be called only after successful execution of MDIO_initClock(). More...
 
int32_t MDIO_phyExtRegWrite (uint32_t baseAddr, void *pUserGroup, uint32_t phyAddr, uint32_t regNum, uint16_t wrVal)
 This API writes an extended PHY register using MDIO. It should be called only after successful execution of MDIO_initClock(). More...
 
int32_t MDIO_phyLinkStatus (uint32_t baseAddr, uint32_t phyAddr)
 This API reads the link status of all PHY connected to this MDIO. The bit corresponding to the PHY address will be set if the PHY link is active. More...
 
int32_t MDIO_enableLinkInterrupt (uint32_t mdioBaseAddress, uint32_t regInst, uint32_t phyAddr, uint8_t linkSel)
 Function to enable the MDIO Link change interrupt. More...
 

MDIO Link Status Determination Select

#define MDIO_LINKSEL_MDIO_MODE   (0)
 
#define MDIO_LINKSEL_MLINK_MODE   (1)
 

Macro Definition Documentation

◆ MDIO_LINKSEL_MDIO_MODE

#define MDIO_LINKSEL_MDIO_MODE   (0)

Macro to select MDIO mode of Link detection

◆ MDIO_LINKSEL_MLINK_MODE

#define MDIO_LINKSEL_MLINK_MODE   (1)

Macro to select MLINK mode of Link detection

Function Documentation

◆ MDIO_initClock()

int32_t MDIO_initClock ( uint32_t  baseAddr)

This function initializes the MDIO clock.

Parameters
baseAddrBase Address of the MDIO module
Returns
SystemP_SUCCESS in case of success, SystemP_FAILURE otherwise

◆ MDIO_phyRegRead()

int32_t MDIO_phyRegRead ( uint32_t  baseAddr,
void *  pUserGroup,
uint32_t  phyAddr,
uint32_t  regNum,
uint16_t *  pData 
)

This API reads an IEEE defined PHY register using MDIO. It should be called only after successful execution of MDIO_initClock().

Parameters
baseAddrBase Address of the MDIO module
pUserGroupPointer to uint32_t storing user group to be used while accessing PHY registers. Pass NULL for using default value
phyAddrPHY Address
regNumRegister Number to be read.
pDataPointer where the read value shall be written
Returns
SystemP_SUCCESS on success, else failure

◆ MDIO_phyRegWrite()

int32_t MDIO_phyRegWrite ( uint32_t  baseAddr,
void *  pUserGroup,
uint32_t  phyAddr,
uint32_t  regNum,
uint16_t  wrVal 
)

This API writes an IEEE defined PHY register using MDIO. It should be called only after successful execution of MDIO_initClock().

Parameters
baseAddrBase Address of the MDIO module
pUserGroupPointer to uint32_t storing user group to be used while accessing PHY registers. Pass NULL for using default value
phyAddrPHY Address
regNumRegister Number to be written
wrValValue to be written
Returns
SystemP_SUCCESS on success, else failure

◆ MDIO_phyExtRegRead()

int32_t MDIO_phyExtRegRead ( uint32_t  baseAddr,
void *  pUserGroup,
uint32_t  phyAddr,
uint32_t  regNum,
uint16_t *  pData 
)

This API reads an extended PHY register using MDIO. It should be called only after successful execution of MDIO_initClock().

Parameters
baseAddrBase Address of the MDIO module
pUserGroupPointer to uint32_t storing user group to be used while accessing PHY registers. Pass NULL for using default value
phyAddrPHY Address
regNumRegister Number to be read.
pDataPointer where the read value shall be written
Returns
SystemP_SUCCESS on success, else failure

◆ MDIO_phyExtRegWrite()

int32_t MDIO_phyExtRegWrite ( uint32_t  baseAddr,
void *  pUserGroup,
uint32_t  phyAddr,
uint32_t  regNum,
uint16_t  wrVal 
)

This API writes an extended PHY register using MDIO. It should be called only after successful execution of MDIO_initClock().

Parameters
baseAddrBase Address of the MDIO module
pUserGroupPointer to uint32_t storing user group to be used while accessing PHY registers. Pass NULL for using default value
phyAddrPHY Address
regNumRegister Number to be written
wrValValue to be written
Returns
SystemP_SUCCESS on success, else failure

◆ MDIO_phyLinkStatus()

int32_t MDIO_phyLinkStatus ( uint32_t  baseAddr,
uint32_t  phyAddr 
)

This API reads the link status of all PHY connected to this MDIO. The bit corresponding to the PHY address will be set if the PHY link is active.

Parameters
baseAddrBase Address of the MDIO module
phyAddrPHY Address
Returns
SystemP_SUCCESS if link is up, else failure

◆ MDIO_enableLinkInterrupt()

int32_t MDIO_enableLinkInterrupt ( uint32_t  mdioBaseAddress,
uint32_t  regInst,
uint32_t  phyAddr,
uint8_t  linkSel 
)

Function to enable the MDIO Link change interrupt.

Parameters
mdioBaseAddressBase Address of the MDIO module
regInst0/1 to select the MDIO User PHY Select Register
phyAddrPHY Address
linkSelFlag to select to use MDIO mode or MLINK mode. Allowed values are MDIO_LinkSelModes
Returns
SystemP_SUCCESS if link is up, else failure