AM263x MCU+ SDK  10.01.00

Data Fields

struct {
   const char *   name
 Driver name. More...
 
   bool(*   isPhyDevSupported )(EthPhyDrv_Handle hPhy, const
      void *pVersion)
 Check if driver supports a PHY model identified by its version. More...
 
   bool(*   isMacModeSupported )(EthPhyDrv_Handle hPhy,
      Phy_Mii mii)
 Check if driver supports a MII interface type. More...
 
   void(*   bind )(EthPhyDrv_Handle *hPhy,
      uint8_t phyAddr,
      Phy_RegAccessCb_t
      *pRegAccessCb)
 PHY bind. More...
 
   int32_t(*   config )(EthPhyDrv_Handle hPhy, const
      void *pExtCfg, const uint32_t
      extCfgSize, Phy_Mii mii, bool
      loopbackEn)
 PHY specific configuration. More...
 
   void(*   reset )(EthPhyDrv_Handle hPhy)
 PHY specific soft reset. More...
 
   bool(*   isResetComplete )(EthPhyDrv_Handle hPhy)
 PHY specific soft reset status. More...
 
   int32_t(*   readExtReg )(EthPhyDrv_Handle hPhy,
      uint32_t reg, uint16_t *val)
 Read PHY extended register. More...
 
   int32_t(*   writeExtReg )(EthPhyDrv_Handle hPhy,
      uint32_t reg, uint16_t val)
 Write PHY register. More...
 
   int32_t(*   rmwExtReg )(EthPhyDrv_Handle hPhy,
      uint32_t reg, uint16_t mask,
      uint16_t *val)
 Read-modify-write PHY extended register. More...
 
   void(*   printRegs )(EthPhyDrv_Handle hPhy)
 
   int32_t(*   adjPtpFreq )(EthPhyDrv_Handle hPhy,
      int64_t ppb)
 Adjust PHY PTP clock frequency. More...
 
   int32_t(*   adjPtpPhase )(EthPhyDrv_Handle hPhy,
      int64_t offset)
 Adjust PHY PTP clock phase. More...
 
   int32_t(*   getPtpTime )(EthPhyDrv_Handle hPhy,
      uint64_t *ts64)
 Get current PHY PTP clock time. More...
 
   int32_t(*   setPtpTime )(EthPhyDrv_Handle hPhy,
      uint64_t ts64)
 Set PHY PTP clock time. More...
 
   int32_t(*   getPtpTxTime )(EthPhyDrv_Handle hPhy,
      uint32_t domain, uint32_t
      msgType, uint32_t seqId,
      uint64_t *ts64)
 Get PHY PTP TX packet timestamp. More...
 
   int32_t(*   getPtpRxTime )(EthPhyDrv_Handle hPhy,
      uint32_t domain, uint32_t
      msgType, uint32_t seqId,
      uint64_t *ts64)
 Get PHY PTP RX packet timestamp. More...
 
   int32_t(*   waitPtpTxTime )(EthPhyDrv_Handle hPhy,
      uint32_t domain, uint32_t
      msgType, uint32_t seqId)
 Add PHY PTP TX packet info to a waiting TX timestamp list. More...
 
   int32_t(*   procStatusFrame )(EthPhyDrv_Handle hPhy,
      uint8_t *frame, uint32_t size,
      uint32_t *types)
 Process PHY status frame. More...
 
   int32_t(*   getStatusFrameEthHeader )(EthPhyDrv_Handle hPhy,
      uint8_t *ethhdr, uint32_t size)
 Get PHY status frame header. More...
 
   int32_t(*   enablePtp )(EthPhyDrv_Handle hPhy, bool
      on, uint32_t
      srcMacStatusFrameType)
 Enable or disable the PHY PTP module. More...
 
   int32_t(*   tickDriver )(EthPhyDrv_Handle hPhy)
 Provide timer tick to the driver. More...
 
   int32_t(*   enableEventCapture )(EthPhyDrv_Handle hPhy,
      uint32_t eventIdx, bool
      falling, bool on)
 Enable/Disable an event capture on a PHY GPIO pin. More...
 
   int32_t(*   enableTriggerOutput )(EthPhyDrv_Handle hPhy,
      uint32_t triggerIdx, uint64_t
      start, uint64_t period, bool
      repeat)
 Enable/Disable trigger output on a GPIO pin. More...
 
   int32_t(*   getEventTs )(EthPhyDrv_Handle hPhy,
      uint32_t *eventIdx, uint32_t
      *seqId, uint64_t *ts64)
 Get event timestamp. More...
 
fxn
 
EthPhyDrv_Handle hDrv
 

Field Documentation

◆ name

const char* Phy_DrvObj_t::name

Driver name.

Name of the PHY-specific driver.

◆ isPhyDevSupported

bool(* Phy_DrvObj_t::isPhyDevSupported) (EthPhyDrv_Handle hPhy, const void *pVersion)

Check if driver supports a PHY model identified by its version.

PHY-specific function that drivers must implement for upper check if the PHY driver supports a PHY model identified by its version from ID1 and ID2 registers.

Note that a given PHY driver can support multiple PHY models.

Parameters
hPhyPHY device handle
versionPHY version from ID registers
Returns
Whether PHY model is supported or not

◆ isMacModeSupported

bool(* Phy_DrvObj_t::isMacModeSupported) (EthPhyDrv_Handle hPhy, Phy_Mii mii)

Check if driver supports a MII interface type.

PHY-specific function that drivers must implement for upper layer to check whether a MAC mode is supported by the PHY driver or not.

Parameters
hPhyPHY device handle
miiMII interface
Returns
Whether MII interface type is supported or not

◆ bind

void(* Phy_DrvObj_t::bind) (EthPhyDrv_Handle *hPhy, uint8_t phyAddr, Phy_RegAccessCb_t *pRegAccessCb)

PHY bind.

PHY-specific function that binds the driver handle and register access functions to specific PHY device.

Parameters
hPhyPHY device handle
phyAddrPHY address
pRegAccessCbPHY register access function pointers

◆ config

int32_t(* Phy_DrvObj_t::config) (EthPhyDrv_Handle hPhy, const void *pExtCfg, const uint32_t extCfgSize, Phy_Mii mii, bool loopbackEn)

PHY specific configuration.

PHY-specific function that drivers must implement to configure the PHY device. The configuration can be composed of generic and PHY-specific parameter (via extended config).

Parameters
hPhyPHY device handle
cfgPHY configuration parameter
miiMII interface
Returns
EnetPhy_ErrorCodes

◆ reset

void(* Phy_DrvObj_t::reset) (EthPhyDrv_Handle hPhy)

PHY specific soft reset.

PHY-specific function that drivers must implement to start a soft-reset operation.

Parameters
hPhyPHY device handle

◆ isResetComplete

bool(* Phy_DrvObj_t::isResetComplete) (EthPhyDrv_Handle hPhy)

PHY specific soft reset status.

PHY-specific function that drivers must implement to check if soft-reset operation is complete.

Parameters
hPhyPHY device handle
Returns
Whether soft-reset is complete or not.

◆ readExtReg

int32_t(* Phy_DrvObj_t::readExtReg) (EthPhyDrv_Handle hPhy, uint32_t reg, uint16_t *val)

Read PHY extended register.

PHY-specific function that drivers must implement to read extended registers.

Parameters
hPhyPHY device handle
regRegister number
valPointer to the read value
Returns
EnetPhy_ErrorCodes

◆ writeExtReg

int32_t(* Phy_DrvObj_t::writeExtReg) (EthPhyDrv_Handle hPhy, uint32_t reg, uint16_t val)

Write PHY register.

PHY-specific function that drivers must implement to write extended registers.

Parameters
hPhyPHY device handle
regRegister number
valValue to be written
Returns
EnetPhy_ErrorCodes

◆ rmwExtReg

int32_t(* Phy_DrvObj_t::rmwExtReg) (EthPhyDrv_Handle hPhy, uint32_t reg, uint16_t mask, uint16_t *val)

Read-modify-write PHY extended register.

PHY-specific function that drivers must implement to read-write-modify extended registers.

Parameters
groupUser group (use 0 if single group is supported)
phyAddrPHY device address
regRegister address
valValue read from register

◆ printRegs

void(* Phy_DrvObj_t::printRegs) (EthPhyDrv_Handle hPhy)

Print PHY registers

◆ adjPtpFreq

int32_t(* Phy_DrvObj_t::adjPtpFreq) (EthPhyDrv_Handle hPhy, int64_t ppb)

Adjust PHY PTP clock frequency.

Optional PHY function to adjust PTP clock frequency. This function can only be supported when the PHY has a built-in PTP clock.

Parameters
hPhyPHY device handle
ppbPart per billion
Returns
EnetPhy_ErrorCodes

◆ adjPtpPhase

int32_t(* Phy_DrvObj_t::adjPtpPhase) (EthPhyDrv_Handle hPhy, int64_t offset)

Adjust PHY PTP clock phase.

Optional PHY function to adjust PTP clock phase. This function can only be supported when the PHY has a built-in PTP clock.

Parameters
hPhyPHY device handle
offsetOffset to current clock time in nanosec unit.
Returns
EnetPhy_ErrorCodes

◆ getPtpTime

int32_t(* Phy_DrvObj_t::getPtpTime) (EthPhyDrv_Handle hPhy, uint64_t *ts64)

Get current PHY PTP clock time.

Optional PHY function to get current PHY PTP clock time. This function can only be supported when the PHY has a built-in PTP clock.

Parameters
hPhyPHY device handle
ts64Output current PTP clock time in nanosec unit.
Returns
EnetPhy_ErrorCodes

◆ setPtpTime

int32_t(* Phy_DrvObj_t::setPtpTime) (EthPhyDrv_Handle hPhy, uint64_t ts64)

Set PHY PTP clock time.

Optional PHY function to set PHY PTP clock time. This function can only be supported when the PHY has a built-in PTP clock.

Parameters
hPhyPHY device handle
ts64PTP time in nanosec unit will be set.
Returns
EnetPhy_ErrorCodes

◆ getPtpTxTime

int32_t(* Phy_DrvObj_t::getPtpTxTime) (EthPhyDrv_Handle hPhy, uint32_t domain, uint32_t msgType, uint32_t seqId, uint64_t *ts64)

Get PHY PTP TX packet timestamp.

Optional PHY function to get PHY PTP TX packet timestamp. This function can only be supported when the PHY has a built-in PTP clock.

Parameters
hPhyPHY device handle
domainPTP domain (in the packet header)
msgTypePTP message type (in the packet header)
seqIdPTP packet sequence ID (in the packet header)
ts64Output PTP TX packet timestamp in nanosec unit.
Returns
EnetPhy_ErrorCodes

◆ getPtpRxTime

int32_t(* Phy_DrvObj_t::getPtpRxTime) (EthPhyDrv_Handle hPhy, uint32_t domain, uint32_t msgType, uint32_t seqId, uint64_t *ts64)

Get PHY PTP RX packet timestamp.

Optional PHY function to get PHY PTP RX packet timestamp. This function can only be supported when the PHY has a built-in PTP clock.

Parameters
hPhyPHY device handle
domainPTP domain (in the packet header)
msgTypePTP message type (in the packet header)
seqIdPTP packet sequence ID (in the packet header)
ts64Output PTP RX packet timestamp in nanosec unit.
Returns
EnetPhy_ErrorCodes

◆ waitPtpTxTime

int32_t(* Phy_DrvObj_t::waitPtpTxTime) (EthPhyDrv_Handle hPhy, uint32_t domain, uint32_t msgType, uint32_t seqId)

Add PHY PTP TX packet info to a waiting TX timestamp list.

Optional PHY function to get PHY PTP TX packet timestamp. This function can only be supported when the PHY has a built-in PTP clock.

Parameters
hPhyPHY device handle
domainPTP domain (in the packet header)
msgTypePTP message type (in the packet header)
seqIdPTP packet sequence ID (in the packet header)
Returns
EnetPhy_ErrorCodes

◆ procStatusFrame

int32_t(* Phy_DrvObj_t::procStatusFrame) (EthPhyDrv_Handle hPhy, uint8_t *frame, uint32_t size, uint32_t *types)

Process PHY status frame.

Optional PHY function to process PHY status frame. This function can only be supported when the PHY has a built-in PTP clock.

Parameters
hPhyPHY device handle
frameEthernet PHY status frame
sizeFrame size
typesTypes of processed frame
Returns
EnetPhy_ErrorCodes

◆ getStatusFrameEthHeader

int32_t(* Phy_DrvObj_t::getStatusFrameEthHeader) (EthPhyDrv_Handle hPhy, uint8_t *ethhdr, uint32_t size)

Get PHY status frame header.

Optional PHY function to get the Ethernet header of the PHY status frame. This function can only be supported when the PHY has a built-in PTP clock.

Parameters
hPhyPHY device handle
ethhdrBuffer to get the ethernet header of the PHY status frame.
sizeBuffer size (at least 14 bytes)
Returns
EnetPhy_ErrorCodes

◆ enablePtp

int32_t(* Phy_DrvObj_t::enablePtp) (EthPhyDrv_Handle hPhy, bool on, uint32_t srcMacStatusFrameType)

Enable or disable the PHY PTP module.

Optional PHY function to enable or disable the PHY PTP module. This function can only be supported when the PHY has a built-in PTP clock.

Parameters
hPhyPHY device handle
onFlag indicate enable (on=true) or disable(on=false) PTP module
srcMacStatusFrameTypeThe PHY-specific src MAC of the status frame.
Returns
EnetPhy_ErrorCodes

◆ tickDriver

int32_t(* Phy_DrvObj_t::tickDriver) (EthPhyDrv_Handle hPhy)

Provide timer tick to the driver.

Provide timer tick to the driver.

Parameters
hPhyPHY device handle
Returns
EnetPhy_ErrorCodes

◆ enableEventCapture

int32_t(* Phy_DrvObj_t::enableEventCapture) (EthPhyDrv_Handle hPhy, uint32_t eventIdx, bool falling, bool on)

Enable/Disable an event capture on a PHY GPIO pin.

Optional PHY function to enable/disable an event capture on a PHY GPIO pin. This function can only be supported when the PHY has a built-in PTP clock that support event capture.

Parameters
hPhyPHY device handle
eventIdxEvent index
fallingCapture event on falling edge or rising edge if falling is false.
onEnable when on is true, otherwise disable the event.
Returns
EnetPhy_ErrorCodes

◆ enableTriggerOutput

int32_t(* Phy_DrvObj_t::enableTriggerOutput) (EthPhyDrv_Handle hPhy, uint32_t triggerIdx, uint64_t start, uint64_t period, bool repeat)

Enable/Disable trigger output on a GPIO pin.

Optional PHY function to enable/disable trigger output on a GPIO pin. This function can only be supported when the PHY has a built-in PTP clock that support trigger output.

Parameters
hPhyPHY device handle
triggerIdxTrigger index
startStart trigger time in nanosec unit.
periodPeriod of the pulse in nanosec unit. Disable the trigger if the period is equal to 0.
repeatRepeated pulse or one shot pulse if repeat is false.
Returns
EnetPhy_ErrorCodes

◆ getEventTs

int32_t(* Phy_DrvObj_t::getEventTs) (EthPhyDrv_Handle hPhy, uint32_t *eventIdx, uint32_t *seqId, uint64_t *ts64)

Get event timestamp.

Get event timestamp

Parameters
hPhyPHY device handle
eventIdxOutput event index
seqIdOutput event sequence identifier
ts64Output event timestamp
Returns
EnetPhy_ErrorCodes

◆ fxn

struct { ... } Phy_DrvObj_t::fxn

◆ hDrv

EthPhyDrv_Handle Phy_DrvObj_t::hDrv