; ; File: PDMMaceEqu.a ; ; Contains: Equates for accessing the Ethernet Media Access ; Controller (MACE) for the PDM ENET driver ; ; Written by: Dave Calvert ; ; Copyright: © 1992-1993 by Apple Computer, Inc. All rights reserved. ; ; This file is used in these builds: ROM RISC (PDM ENET) ; ; Change History (most recent first): ; ; 6/2/93 GMR Changed some of the init parameters (back to Mark's equates), ; modified the receive record/status definitions. ; 5/27/93 dwc Added support for AMIC work-around code. ; 5/25/93 dwc Clean up for Alpha. ; 5/4/93 dwc Added debug code to work around AMIC's returning FF's on the ; first read. ; 4/6/93 dwc Added status/packet logging equate. ; 3/24/93 dwc Remove obsolete code and added code to try to recover from ; lowered interrupt level during packet handling. ; 3/5/93 dwc Removed some more debugging code. ; 2/25/93 dwc Enable receive, remove some debug equates. ; 2/24/93 dwc Cleaned up some debug equates, added some more debug equates, ; disabled receive for the PDM D5 ROM build. ; 2/4/93 dwc first checked in ; ; ; --------------------------------------------------------- ; MACE Registers ; --------------------------------------------------------- MACERegBase EQU $50F1C000 ; Mace Reg Base on Cyclone MACERegs RECORD 0 MACE_RX_FIFO DS.W 1 ;RD RXData -Read Status first ORG *+$e MACE_XMIT_FIFO DS.W 1 ;TX TXData ORG *+$e MACE_TX_FRM_CNTRL DS.B 1 ;RD/WR 01=Retry,XMTFCS,AUTOPAD ORG *+$f MACE_TX_FRM_STAT DS.B 1 ;RD ORG *+$f MACE_TX_RETRY_CNT DS.B 1 ;RD ORG *+$f MACE_RX_FRM_CNTRL DS.B 1 ;RD/WR 00 = Not_AutoStripPad ORG *+$f MACE_RX_FRM_STAT DS.B 1 ;RD Read 4x to get RX Status of packet ORG *+$f MACE_FIFO_FRM_CNT DS.B 1 ;RD Number of frames in FIFO ORG *+$f MACE_INT DS.B 1 ;RD_1 Interupt Source bits ORG *+$f MACE_INT_MSK DS.B 1 ;RD/WR Interupt Enables ORG *+$f MACE_POLL DS.B 1 ;RD Yet another status location ORG *+$f MACE_BIU_CNFG DS.B 1 ;RD/WR 20 = normal mode 01 = Soft Reset ORG *+$f MACE_FIFO_CNFG DS.B 1 ORG *+$f MACE_MAC_CNFG DS.B 1 ;Enables ORG *+$f MACE_PLS_CNFG DS.B 1 ;RD/WR 0=Normal Mode ORG *+$f MACE_PHY_CNFG DS.B 1 ;RD/WR Reserved,Dude. ORG *+$f MACE_CHIP_ID_LOW DS.B 1 ;RD Just Reads ID ORG *+$f MACE_CHIP_ID_HIGH DS.B 1 ;RD Just Reads ID ORG *+$f MACE_ADDR_CNFG DS.B 1 ;RD/WR 04=Phy_Addr, 02=Log_Addr ORG *+$1f MACE_LOG_ADDR DS.B 1 ;Load with 6 Zeros ORG *+$f MACE_PHY_ADDR DS.B 1 ;Load with Address ORG *+$2f MACE_MISSED_PKT_CNT DS.B 1 ;RD ORG *+$4f MACE_USER_TEST_REG DS.B 1 ; ENDR ; ; MACE Interrupt Reg. & Int. Reg. Mask Bit defines ; MACE Int. Reg - Read/Clear; MACE Int. Mask Reg. - Read/Write ; BABL EQU 6 ; Babble, Xmit timeout error CERR EQU 5 ; Signal Quality Error (SQE), xmit RCVCO EQU 4 ; Receive Collision Cnt Overflow MPCO EQU 2 ; Missed Pkt Cnt Overflow RCVINT EQU 1 ; Rcv int XMTINT EQU 0 ; Xmit int ; mask to disable all MACE ints ; ; MACE Poll register bits ; TDTREQ EQU 6 ; Transmit data request RTDREQ EQU 5 ; Receive data request ;========================================================================================== ; _SETTHEINTMASK ; ; Macro for setting the interrupt level to an arbitrary level. Pass the level in ; a Data register. ;========================================================================================== MACRO _SETTHEINTMASK &sReg move.w SR,-(SP) or.w &sReg,(SP) move.w (SP)+,SR ENDM MaceIntMask EQU (1< max pkt, used for Recv DMA cnt AddrPROM EQU $50F08000 ; 32 bit address of address PROM CntRegMask EQU $0001ffff ; Ignore upper 15 bits nobuff EQU -2 ; no xmit buffer available ;•••••••••••••••• Network Statistics NetStats RECORD 0 ; network management stats. TxOK DS.L 1 ; frames transmitted OK sCollFrame DS.L 1 ; single collision frames mCollFrame DS.L 1 ; multiple collision frames CollFrame DS.L 1 ; collision frames DefTx DS.L 1 ; deferred transmissions LateColl DS.L 1 ; late collisions ExcessColl DS.L 1 ; excessive collisions ExcessDef DS.L 1 ; excessive defferals InMACTxErr DS.L 1 ; internal MAC transmit errors RxOK DS.L 1 ; frames received OK MultiRxOK DS.L 1 ; multicast frames recd OK BroadRxOK DS.L 1 ; broadcast frames recd OK FCSerr DS.L 1 ; frame check sequence errors FAerr DS.L 1 ; frame alignment errors MPerr DS.L 1 ; missed packet errors Size EQU * ENDR ;•••••••••••••••• General Equates TalliesPerSec EQU 5000000 ; number of timer ticks/second TxMaxRetries EQU 4 ; max attempts to retry aborted xmits Max_Tx_Packets EQU 16 ; maximum # of chained Tx packets Min_Pkt_Size EQU 60 ; minimum packet size Min_Rx_Buffs EQU 2 ; minimum # of recv descriptors/buffers Max_Pkt_Size EQU 1518 ; maximum packet size (inc. CRC) EOL_Bit EQU 0 ; end-of-link bit ;•••••••••••••••• For GetMemory call Locked EQU 0 ; want locked memory Contig EQU 1 ; want contiguous memory CacheOff EQU 2 ; want non-cacheable memory ;•••••••••••••••• Initialization Parameters MACEInitParms RECORD 0 RecvRtn DS.l 1 ; address of Ethernet receive routine RecvPrms DS.l 1 ; parms to pass @ receive XmitRtn DS.l 1 ; address of Ethernet xmit complete routine XmitPrms DS.l 1 ; parms to pass @ xmit complete MACECfgPtr DS.l 1 ; ptr to MACE config record Dot3NetStats DS.l 1 ; ptr to 802.3 statistics array LAPMIBNetStats DS.l 1 ; ptr to LAP MIB statistics array EnetAddr DS.l 1 ; ptr to ethernet address FastMoveRtn DS.l 1 ; ->proc to move memory FAST IPSize EQU * ENDR ;•••• Parms passed to .ENET "RecvRtn" RcvParms RECORD {A6Link} Size EQU * ; no local vars A6Link DS.L 2 ; saved A6 and return addr Parm DS.L 1 ; parm passed to MaceInit PktLen DS.L 1 ; pkt length PktStat DS.L 1 ; pkt status PktData DS.L 1 ; ptr to packet data ; Byte 0-1: Receive Status (Bits 15-0) ; Bits 15-7,3-0 : reserved, read as 0's ; Bits 6-4 : Recv Message Status bits ; RcvCLSN EQU 6 ; late collision during recv ; RcvFRAM EQU 5 ; frame error, non-integer # of bytes ; RcvFCS EQU 4 ; frame check sequence error ParmsSz EQU * - Parm ; len of passed parms ENDR Configrsrc EQU 'ecfg' ; rsrc type for MACE config data rsrc ; Mace Configuration Record MACECfg RECORD 0 ; Config values from config rsrc MACECfgVers DS.w 1 ; record version MACEBase DS.l 1 ; Base address of MACE EnetPROM DS.l 1 ; base address of Address Prom XmitFrmCtl DS.b 1 ; MACE transmit frame control register value RecvFrmCtl DS.b 1 ; MACE receive frame control register value FIFOCfgCtl DS.b 1 ; MACE xmit/recv fifo config control register value MACCfgCtl DS.b 1 ; MACE MAC config control register value ; The following are optional values; ignored if zero EnetAddr DS.b 6 ; Alternate Ethernet Address, overrides Address PROM XmitBuffs DS.w 1 ; Alternate number of transmit buffers RecvBuffs DS.w 1 ; Alternate number of receive buffers RecvChains DS.w 1 ; Alternate number of receive "chains" CfgSize EQU * ENDR