![](https://pdfstore-manualsonline.prod.a.ki/pdfasset/d/b7/db742270-ca8c-4749-a876-e49802fee529/db742270-ca8c-4749-a876-e49802fee529-bg23.png)
2.7.1.2GlobalPHYDetectionandLinkStateMonitoring
2.7.1.3ActivePHYMonitoring
2.7.1.4PHYRegisterUserAccess
2.7.2MDIOModuleOperationalOverview
Architecture
TheMDIOmodulecontinuouslypollsall32MDIOaddressesinordertoenumeratethePHYdevicesinthe
system.ThemoduletrackswhetherornotaPHYonaparticularaddresshasresponded,andwhetheror
notthePHYcurrentlyhasalink.Usingthisinformationallowsthesoftwareapplicationtoquickly
determinewhichMDIOaddressthePHYisusing.
OnceaPHYcandidatehasbeenselectedforuse,theMDIOmoduletransparentlymonitorsitslinkstate
byreadingtheMDIOPHYlinkstatusregister(LINK).LinkchangeeventsarestoredontheMDIOdevice
andcanoptionallyinterrupttheCPU.ThisallowsthesystemtopollthelinkstatusofthePHYdevice
withoutcontinuouslyperformingcostlyMDIOaccesses.
WhentheCPUmustaccessMDIOforconfigurationandnegotiation,thePHYaccessmoduleperforms
theactualMDIOreadorwriteoperationindependentoftheCPU.ThisallowstheCPUtopollfor
completionorreceiveaninterruptwhenthereadorwriteoperationhasbeenperformed.Theuseraccess
registersUSERACCESSnallowsthesoftwaretosubmittheaccessrequestsforthePHYconnectedtothe
device.
TheMDIOmoduleimplementsthe802.3serialmanagementinterfacetointerrogateandcontrolan
EthernetPHY,usingasharedtwo-wiredbus.Itseparatelyperformsautodetectionandrecordsthecurrent
linkstatusofupto32PHYs,pollingall32MDIOaddresses.
ApplicationsoftwareusestheMDIOmoduletoconfiguretheautonegotiationparametersofthePHY
attachedtotheEMAC,retrievethenegotiationresults,andconfigurerequiredparametersintheEMAC.
Inthisdevice,theEthernetPHYattachedtothesystemcanbedirectlycontrolledandqueried.TheMedia
IndependentInterface(MII)addressofthisPHYdeviceisspecifiedinoneofthePHYADRMONbitsinthe
MDIOuserPHYselectregister(USERPHYSELn).TheMDIOmodulecanbeprogrammedtotriggera
CPUinterruptonaPHYlinkchangeevent,bysettingtheLINKINTENBbitinUSERPHYSELn.Readsand
writestoregistersinthisPHYdeviceareperformedusingtheMDIOuseraccessregister
(USERACCESSn).
TheMDIOmodulepowers-upinanidlestateuntilspecificallyenabledbysettingtheENABLEbitinthe
MDIOcontrolregister(CONTROL).Atthistime,theMDIOclockdividerandpreamblemodeselectionare
alsoconfigured.TheMDIOpreambleisenabledbydefault,butcanbedisabledwhentheconnectedPHY
doesnotrequireit.OncetheMDIOmoduleisenabled,theMDIOinterfacestatemachinecontinuously
pollsthePHYlinkstatus(byreadingthegenericstatusregister)ofallpossible32PHYaddressesand
recordstheresultsintheMDIOPHYalivestatusregister(ALIVE)andMDIOPHYlinkstatusregister
(LINK).ThecorrespondingbitfortheconnectedPHY(0-31)issetinALIVE,ifthePHYrespondedtothe
readrequest.ThecorrespondingbitissetinLINK,ifthePHYrespondedandalsoiscurrentlylinked.In
addition,anyPHYregisterreadtransactionsinitiatedbytheapplicationsoftwareusingUSERACCESSn
causesALIVEtobeupdated.
TheUSERPHYSELnisusedtotrackthelinkstatusoftheconnectedPHYaddress.Achangeinthelink
statusofthePHYbeingmonitoredsetstheappropriatebitintheMDIOlinkstatuschangeinterrupt
registers(LINKINTRAWandLINKINTMASKED),ifenabledbytheLINKINTENBbitinUSERPHYSELn.
WhiletheMDIOmoduleisenabled,thehostissuesareadorwritetransactionovertheMIImanagement
interfaceusingtheDATA,PHYADR,REGADR,andWRITEbitsinUSERACCESSn.Whentheapplication
setstheGObitinUSERACCESSn,theMDIOmodulebeginsthetransactionwithoutanyfurther
interventionfromtheCPU.Uponcompletion,theMDIOmoduleclearstheGObitandsetsthe
correspondingUSERINTRAWbit(0or1)intheMDIOusercommandcompleteinterruptregister
(USERINTRAW)correspondingtoUSERACCESSnused.ThecorrespondingUSERINTMASKEDbit(0or
1)intheMDIOusercommandcompleteinterruptregister(USERINTMASKED)mayalsobeset,
dependingonthemasksettingconfiguredintheMDIOusercommandcompleteinterruptmaskset
register(USERINTMASKSET)andtheMDIOuserinterruptmaskclearregister(USERINTMASKCLEAR).
SPRUEQ6–December2007EthernetMediaAccessController(EMAC)/ManagementDataInput/Output(MDIO)35
SubmitDocumentationFeedback