/* Global SEB State Register */ #define GREG_SEBSTATE_ARB 0x00000003 /* State of Arbiter */ #define GREG_SEBSTATE_RXWON 0x00000004 /* RX won internal arbitration */
/* Global Configuration Register */ #define GREG_CFG_IBURST 0x00000001 /* Infinite Burst */ #define GREG_CFG_TXDMALIM 0x0000003e /* TX DMA grant limit */ #define GREG_CFG_RXDMALIM 0x000007c0 /* RX DMA grant limit */ #define GREG_CFG_RONPAULBIT 0x00000800 /* Use mem read multiple for PCI read
* after infinite burst (Apple) */ #define GREG_CFG_ENBUG2FIX 0x00001000 /* Fix Rx hang after overflow */
/* Global Interrupt Status Register. * *Readingthisregisterautomaticallyclearsbits0through6. *Thisauto-clearingdoesnotoccurwhenthealiasatGREG_STAT2 *isreadinstead.Therestoftheinterruptbitsonlyclearwhen *thesecondaryinterruptstatusregistercorrespondingtothat *bitisread(ie.ifGREG_STAT_PCSisset,itwillbeclearedby *readingPCS_ISTAT).
*/ #define GREG_STAT_TXINTME 0x00000001 /* TX INTME frame transferred */ #define GREG_STAT_TXALL 0x00000002 /* All TX frames transferred */ #define GREG_STAT_TXDONE 0x00000004 /* One TX frame transferred */ #define GREG_STAT_RXDONE 0x00000010 /* One RX frame arrived */ #define GREG_STAT_RXNOBUF 0x00000020 /* No free RX buffers available */ #define GREG_STAT_RXTAGERR 0x00000040 /* RX tag framing is corrupt */ #define GREG_STAT_PCS 0x00002000 /* PCS signalled interrupt */ #define GREG_STAT_TXMAC 0x00004000 /* TX MAC signalled interrupt */ #define GREG_STAT_RXMAC 0x00008000 /* RX MAC signalled interrupt */ #define GREG_STAT_MAC 0x00010000 /* MAC Control signalled irq */ #define GREG_STAT_MIF 0x00020000 /* MIF signalled interrupt */ #define GREG_STAT_PCIERR 0x00040000 /* PCI Error interrupt */ #define GREG_STAT_TXNR 0xfff80000 /* == TXDMA_TXDONE reg val */ #define GREG_STAT_TXNR_SHIFT 19
/* The layout of GREG_IMASK and GREG_IACK is identical to GREG_STAT. *BitssetinGREG_IMASKwillpreventthatinterrupttypefrombeing *signalledtothecpu.GREG_IACKcanbeusedtoclearspecifictop-level *interruptconditionsinGREG_STAT,ie.itonlyworksforbits0through6. *Settingthebitwillclearthatinterrupt,clearbitswillhavenoeffect *onGREG_STAT.
*/
/* Global PCI Error Status Register */ #define GREG_PCIESTAT_BADACK 0x00000001 /* No ACK64# during ABS64 cycle */ #define GREG_PCIESTAT_DTRTO 0x00000002 /* Delayed transaction timeout */ #define GREG_PCIESTAT_OTHER 0x00000004 /* Other PCI error, check cfg space */
/* The layout of the GREG_PCIEMASK is identical to that of GREG_PCIESTAT. *BitssetinGREG_PCIEMASKwillpreventthatinterrupttypefrombeing *signalledtothecpu.
*/
/* Global BIF Configuration Register */ #define GREG_BIFCFG_SLOWCLK 0x00000001 /* Set if PCI runs < 25Mhz */ #define GREG_BIFCFG_B64DIS 0x00000002 /* Disable 64bit wide data cycle*/ #define GREG_BIFCFG_M66EN 0x00000004 /* Set if on 66Mhz PCI segment */
/* Global BIF Diagnostics Register */ #define GREG_BIFDIAG_BURSTSM 0x007f0000 /* PCI Burst state machine */ #define GREG_BIFDIAG_BIFSM 0xff000000 /* BIF state machine */
/* Global Software Reset Register. * *ThisregisterisusedtoperformaglobalresetoftheRXandTXportions *oftheGEMasic.SettingtheRXorTXresetbitwillstartthereset. *Thedriver_MUST_pollthesebitsuntiltheyclear.Onemaynotattempt *toprogramanyotherpartofGEMuntilthebitsclear.
*/ #define GREG_SWRST_TXRST 0x00000001 /* TX Software Reset */ #define GREG_SWRST_RXRST 0x00000002 /* RX Software Reset */ #define GREG_SWRST_RSTOUT 0x00000004 /* Force RST# pin active */ #define GREG_SWRST_CACHESIZE 0x00ff0000 /* RIO only: cache line size */ #define GREG_SWRST_CACHE_SHIFT 16
/* Send Pause Command. */ #define MAC_SNDPAUSE_TS 0x0000ffff /* The pause_time operand used in *Send_Pauseandflow-control *handshakes.
*/ #define MAC_SNDPAUSE_SP 0x00010000 /* Setting this bit instructs the MAC *tosendaPauseFlowControl *frameontothenetwork.
*/
/* MAC Control Status Register. */ #define MAC_CSTAT_PRCV 0x00000001 /* Pause Received */ #define MAC_CSTAT_PS 0x00000002 /* Paused State */ #define MAC_CSTAT_NPS 0x00000004 /* Not Paused State */ #define MAC_CSTAT_PTR 0xffff0000 /* Pause Time Received */
/* The layout of the MAC_{TX,RX,C}MASK registers is identical to that *ofMAC_{TX,RX,C}STAT.BitssetinMAC_{TX,RX,C}MASKwillprevent *thatinterrupttypefrombeingsignalledtofrontendofGEM.For *theinterrupttoactuallygetsenttothecpu,itisnecessaryto *properlysettheappropriateGREG_IMASK_{TX,RX,}MACbitsaswell.
*/
/* TX MAC Configuration Register. * *NOTE:TheTXMACEnablebitmustbeclearedandpolleduntil *zerobeforeanyotherbitsinthisregisterarechanged. * *Also,enablingtheCarrierExtensionfeatureofGEMis *a3stepprocess1)SetTXCarrierExtension2)Set *RXCarrierExtension3)SetSlotTimeto0x200.This *modemustbeenabledwheninhalf-duplexat1Gbps,else *itmustbedisabled.
*/ #define MAC_TXCFG_ENAB 0x00000001 /* TX MAC Enable */ #define MAC_TXCFG_ICS 0x00000002 /* Ignore Carrier Sense */ #define MAC_TXCFG_ICOLL 0x00000004 /* Ignore Collisions */ #define MAC_TXCFG_EIPG0 0x00000008 /* Enable IPG0 */ #define MAC_TXCFG_NGU 0x00000010 /* Never Give Up */ #define MAC_TXCFG_NGUL 0x00000020 /* Never Give Up Limit */ #define MAC_TXCFG_NBO 0x00000040 /* No Backoff */ #define MAC_TXCFG_SD 0x00000080 /* Slow Down */ #define MAC_TXCFG_NFCS 0x00000100 /* No FCS */ #define MAC_TXCFG_TCE 0x00000200 /* TX Carrier Extension */
/* MAC Control Config Register. */ #define MAC_MCCFG_SPE 0x00000001 /* Send Pause Enable */ #define MAC_MCCFG_RPE 0x00000002 /* Receive Pause Enable */ #define MAC_MCCFG_PMC 0x00000004 /* Pass MAC Control */
/* XIF Configuration Register. * *NOTE:Whenleavingorenteringloopbackmode,aglobalhardware *initofGEMshouldbeperformed.
*/ #define MAC_XIFCFG_OE 0x00000001 /* MII TX Output Driver Enable */ #define MAC_XIFCFG_LBCK 0x00000002 /* Loopback TX to RX */ #define MAC_XIFCFG_DISE 0x00000004 /* Disable RX path during TX */ #define MAC_XIFCFG_GMII 0x00000008 /* Use GMII clocks + datapath */ #define MAC_XIFCFG_MBOE 0x00000010 /* Controls MII_BUF_EN pin */ #define MAC_XIFCFG_LLED 0x00000020 /* Force LINKLED# active (low) */ #define MAC_XIFCFG_FLED 0x00000040 /* Force FDPLXLED# active (low) */
/* InterPacketGap0 Register. This 8-bit value is used as an extension *totheInterPacketGap1Register.Specificallyitcontributestothe *timingoftheRX-to-TXIPG.Thisvalueisignoredandpresumedto *bezeroforTX-to-TXIPGcalculationsand/orwhentheEnableIPG0bit *isclearedintheTXMACConfigurationRegister. * *Thisvalueinthisregisterintermsofmediabytetime. * *Recommendedvalue:0x00
*/
/* InterPacketGap1 Register. This 8-bit value defines the first 2/3 *portionoftheInterPacketGap. * *Thisvalueinthisregisterintermsofmediabytetime. * *Recommendedvalue:0x08
*/
/* InterPacketGap2 Register. This 8-bit value defines the second 1/3 *portionoftheInterPacketGap. * *Thisvalueinthisregisterintermsofmediabytetime. * *Recommendedvalue:0x04
*/
/* Slot Time Register. This 10-bit value specifies the slot time *parameterinunitsofmediabytetime.Itdeterminesthephysical *spanofthenetwork. * *Recommendedvalue:0x40
*/
/* Minimum Frame Size Register. This 10-bit register specifies the *smallestsizedframetheTXMACwillsendontothemedium,andthe *RXMACwillreceivefromthemedium. * *Recommendedvalue:0x40
*/
/* Maximum Frame and Burst Size Register. * *Thisregisterspecifiestwothings.Firstitspecifiesthemaximum *sizedframetheTXMACwillsendandtheRXMACwillrecognizeas *valid.Second,itspecifiesthemaximumrunlengthofaburstof *packetssentinhalf-duplexgigabitmodes. * *Recommendedvalue:0x200005ee
*/ #define MAC_MAXFSZ_MFS 0x00007fff /* Max Frame Size */ #define MAC_MAXFSZ_MBS 0x7fff0000 /* Max Burst Size */
/* PA Size Register. This 10-bit register specifies the number of preamble *byteswhichwillbetransmittedatthebeginningofeachframe.A *valueoftwoorgreatershouldbeprogrammedhere. * *Recommendedvalue:0x07
*/
/* Jam Size Register. This 4-bit register specifies the duration of *thejaminunitsofmediabytetime. * *Recommendedvalue:0x04
*/
/* Attempts Limit Register. This 8-bit register specifies the number *ofattemptsthattheTXMACwillmaketotransmitaframe,beforeit *resetsitsAttemptsCounter.AfterreachingtheAttemptsLimitthe *TXMACmayormaynotdroptheframe,asdeterminedbytheNGU *(NeverGiveUp)andNGUL(NeverGiveUpLimit)bitsintheTXMAC *ConfigurationRegister. * *Recommendedvalue:0x10
*/
/* MAX Control Type Register. This 16-bit register specifies the *"type"fieldofaMACControlframe.TheTXMACusesthisfieldto *encapsulatetheMACControlframefortransmission,andtheRXMAC *usesitfordecodingvalidMACControlframesreceivedfromthe *network. * *Recommendedvalue:0x8808
*/
/* MAC Address Registers. Each of these registers specify the *ethernetMACoftheinterface,16-bitsatatime.Register *0specifiesbits[47:32],register1bits[31:16],andregister *2bits[15:0]. * *Registers3throughandincluding5specifyanalternate *MACaddressfortheinterface. * *Registers6throughandincluding8specifytheMACControl *Address,whichmustbethereservedmulticastaddressforMAC *Controlframes. * *Example:Toprogramprimarystationaddressa:b:c:d:e:finto *thechip. *MAC_Address_2=(a<<8)|b *MAC_Address_1=(c<<8)|d *MAC_Address_0=(e<<8)|f
*/
/* Address Filter Registers. Registers 0 through 2 specify bit *fields[47:32]through[15:0],respectively,oftheaddress *filter.TheAddressFilter2&1MaskRegisterdenotesthe8-bit *nibblemaskforAddressFilterRegisters2and1.TheAddress *Filter0MaskRegisterdenotesthe16-bitmaskfortheAddress *FilterRegister0.
*/
/* Hash Table Registers. Registers 0 through 15 specify bit fields *[255:240]through[15:0],respectively,ofthehashtable.
*/
/* Statistics Registers. All of these registers are 16-bits and *trackoccurrencesofaspecificevent.GEMcanbeconfigured *tointerruptthehostcpuwhenanyofthesecountersoverflow. *Theyshouldallbeexplicitlyinitializedtozerowhentheinterface *isbroughtup.
*/
/* Random Number Seed Register. This 10-bit value is used as the *RNGseedinsideGEMfortheCSMA/CDbackoffalgorithm.Itis *recommendedtoprogramthisregistertothe10LSBofthe *interfacesMACaddress.
*/
/* Pause Timer, read-only. This 16-bit timer is used to time the pause *intervalasindicatedbyareceivedpauseflowcontrolframe. *Anon-zerovalueinthistimerindicatesthattheMACiscurrentlyin *thepausedstate.
*/
/* MIF Bit-Bang Clock. This 1-bit register is used to generate the *MDCclockwaveformontheMIIManagementInterfacewhentheMIFis *programmedinthe"Bit-Bang"mode.Writinga'1'aftera'0'into *thisregisterwillcreatearisingedgeontheMDC,whilewriting *a'0'aftera'1'willcreateafallingedge.Foreverybitthat *istransferredonthemanagementinterface,bothedgeshavetobe *generated.
*/
/* MIF Bit-Bang Data. This 1-bit register is used to generate the *outgoingdata(MDO)ontheMIIManagementInterfacewhentheMIF *isprogrammedinthe"Bit-Bang"mode.Thedaawillbesteeredtothe *appropriateMDIObasedonthestateofthePHY_SelectbitintheMIF *ConfigurationRegister.
*/
/* MIF Big-Band Output Enable. THis 1-bit register is used to enable *('1')ordisable('0')theI-directionaldriverontheMIIwhenthe *MIFisprogrammedinthe"Bit-Bang"mode.TheMDIOshouldbeenabled *whendatabitsaretransferredfromtheMIFtothetransceiver,andit *shouldbedisabledwhentheinterfaceisidleorwhendatabitsare *transferredfromthetransceivertotheMIF(dataportionofaread *instruction).OnlyoneMDIOwillbeenabledatagiventime,depending *onthestateofthePHY_SelectbitintheMIFConfigurationRegister.
*/
/* MIF Status Register. This register reports status when the MIF is *operatinginthepollmode.Thepollstatusfieldisauto-clearing *onread.
*/ #define MIF_STATUS_DATA 0xffff0000 /* Live image of XCVR reg */ #define MIF_STATUS_STAT 0x0000ffff /* Which bits have changed */
/* MIF Mask Register. This 16-bit register is used when in poll mode *tosaywhichbitsofthepolledregisterwillcauseaninterrupt *whenchanged.
*/
/* PCS/Serialink Registers */ #define PCS_MIICTRL 0x9000UL /* PCS MII Control Register */ #define PCS_MIISTAT 0x9004UL /* PCS MII Status Register */ #define PCS_MIIADV 0x9008UL /* PCS MII Advertisement Reg */ #define PCS_MIILP 0x900CUL /* PCS MII Link Partner Ability */ #define PCS_CFG 0x9010UL /* PCS Configuration Register */ #define PCS_SMACHINE 0x9014UL /* PCS State Machine Register */ #define PCS_ISTAT 0x9018UL /* PCS Interrupt Status Reg */ #define PCS_DMODE 0x9050UL /* Datapath Mode Register */ #define PCS_SCTRL 0x9054UL /* Serialink Control Register */ #define PCS_SOS 0x9058UL /* Shared Output Select Reg */ #define PCS_SSTATE 0x905CUL /* Serialink State Register */
/* PCD MII Control Register. */ #define PCS_MIICTRL_SPD 0x00000040 /* Read as one, writes ignored */ #define PCS_MIICTRL_CT 0x00000080 /* Force COL signal active */ #define PCS_MIICTRL_DM 0x00000100 /* Duplex mode, forced low */ #define PCS_MIICTRL_RAN 0x00000200 /* Restart auto-neg, self clear */ #define PCS_MIICTRL_ISO 0x00000400 /* Read as zero, writes ignored */ #define PCS_MIICTRL_PD 0x00000800 /* Read as zero, writes ignored */ #define PCS_MIICTRL_ANE 0x00001000 /* Auto-neg enable */ #define PCS_MIICTRL_SS 0x00002000 /* Read as zero, writes ignored */ #define PCS_MIICTRL_WB 0x00004000 /* Wrapback, loopback at 10-bit *inputsideofSerialink
*/ #define PCS_MIICTRL_RST 0x00008000 /* Resets PCS, self clearing */
/* PCS MII Status Register. */ #define PCS_MIISTAT_EC 0x00000001 /* Ext Capability: Read as zero */ #define PCS_MIISTAT_JD 0x00000002 /* Jabber Detect: Read as zero */ #define PCS_MIISTAT_LS 0x00000004 /* Link Status: 1=up 0=down */ #define PCS_MIISTAT_ANA 0x00000008 /* Auto-neg Ability, always 1 */ #define PCS_MIISTAT_RF 0x00000010 /* Remote Fault */ #define PCS_MIISTAT_ANC 0x00000020 /* Auto-neg complete */ #define PCS_MIISTAT_ES 0x00000100 /* Extended Status, always 1 */
/* PCS MII Link Partner Ability Register. This register is equivalent *totheLinkPartnetAbilityRegisterofthestandardMIIregisterset. *It'slayoutcorrespondstothePCSMIIAdvertisementRegister.
*/
/* PCS Configuration Register. */ #define PCS_CFG_ENABLE 0x00000001 /* Must be zero while changing *PCSMIIadvertisementreg.
*/ #define PCS_CFG_SDO 0x00000002 /* Signal detect override */ #define PCS_CFG_SDL 0x00000004 /* Signal detect active low */ #define PCS_CFG_JS 0x00000018 /* Jitter-study: *0=normaloperation *1=high-frequencytestpattern *2=low-frequencytestpattern *3=reserved
*/ #define PCS_CFG_TO 0x00000020 /* 10ms auto-neg timer override */
/* PCS Interrupt Status Register. This register is self-clearing *whenread.
*/ #define PCS_ISTAT_LSC 0x00000004 /* Link Status Change */
/* Shared Output Select Register. For test and debug, allows multiplexing *testoutputsintothePROMaddresspins.Settozerofornormal *operation.
*/ #define PCS_SOS_PADDR 0x00000003 /* PROM Address */
/* PROM Image Space */ #define PROM_START 0x100000UL /* Expansion ROM run time access*/ #define PROM_SIZE 0x0fffffUL /* Size of ROM */ #define PROM_END 0x200000UL /* End of ROM */
enum link_state {
link_down = 0, /* No link, will retry */
link_aneg, /* Autoneg in progress */
link_force_try, /* Try Forced link speed */
link_force_ret, /* Forced mode worked, retrying autoneg */
link_force_ok, /* Stay in forced mode */
link_up /* Link is up */
};
struct gem { void __iomem *regs; int rx_new, rx_old; int tx_new, tx_old;
unsignedint has_wol : 1; /* chip supports wake-on-lan */ unsignedint asleep_wol : 1; /* was asleep with WOL enabled */
int cell_enabled;
u32 msg_enable;
u32 status;
struct napi_struct napi;
int tx_fifo_sz; int rx_fifo_sz; int rx_pause_off; int rx_pause_on; int rx_buf_sz;
u64 pause_entered;
u16 pause_last_time_recvd;
u32 mac_rx_cfg;
u32 swrst_base;
int want_autoneg; int last_forced_speed; enum link_state lstate; struct timer_list link_timer; int timer_ticks; int wake_on_lan; struct work_struct reset_task; volatileint reset_task_pending;
enum gem_phy_type phy_type; struct mii_phy phy_mii; int mii_phy_addr;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.