18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-or-later */ 28c2ecf20Sopenharmony_ci/* 38c2ecf20Sopenharmony_ci * mace.h - definitions for the registers in the "Big Mac" 48c2ecf20Sopenharmony_ci * Ethernet controller found in PowerMac G3 models. 58c2ecf20Sopenharmony_ci * 68c2ecf20Sopenharmony_ci * Copyright (C) 1998 Randy Gobbel. 78c2ecf20Sopenharmony_ci */ 88c2ecf20Sopenharmony_ci 98c2ecf20Sopenharmony_ci/* The "Big MAC" appears to have some parts in common with the Sun "Happy Meal" 108c2ecf20Sopenharmony_ci * (HME) controller. See sunhme.h 118c2ecf20Sopenharmony_ci */ 128c2ecf20Sopenharmony_ci 138c2ecf20Sopenharmony_ci 148c2ecf20Sopenharmony_ci/* register offsets */ 158c2ecf20Sopenharmony_ci 168c2ecf20Sopenharmony_ci/* global status and control */ 178c2ecf20Sopenharmony_ci#define XIFC 0x000 /* low-level interface control */ 188c2ecf20Sopenharmony_ci# define TxOutputEnable 0x0001 /* output driver enable */ 198c2ecf20Sopenharmony_ci# define XIFLoopback 0x0002 /* Loopback-mode XIF enable */ 208c2ecf20Sopenharmony_ci# define MIILoopback 0x0004 /* Loopback-mode MII enable */ 218c2ecf20Sopenharmony_ci# define MIILoopbackBits 0x0006 228c2ecf20Sopenharmony_ci# define MIIBuffDisable 0x0008 /* MII receive buffer disable */ 238c2ecf20Sopenharmony_ci# define SQETestEnable 0x0010 /* SQE test enable */ 248c2ecf20Sopenharmony_ci# define SQETimeWindow 0x03e0 /* SQE time window */ 258c2ecf20Sopenharmony_ci# define XIFLanceMode 0x0010 /* Lance mode enable */ 268c2ecf20Sopenharmony_ci# define XIFLanceIPG0 0x03e0 /* Lance mode IPG0 */ 278c2ecf20Sopenharmony_ci#define TXFIFOCSR 0x100 /* transmit FIFO control */ 288c2ecf20Sopenharmony_ci# define TxFIFOEnable 0x0001 298c2ecf20Sopenharmony_ci#define TXTH 0x110 /* transmit threshold */ 308c2ecf20Sopenharmony_ci# define TxThreshold 0x0004 318c2ecf20Sopenharmony_ci#define RXFIFOCSR 0x120 /* receive FIFO control */ 328c2ecf20Sopenharmony_ci# define RxFIFOEnable 0x0001 338c2ecf20Sopenharmony_ci#define MEMADD 0x130 /* memory address, unknown function */ 348c2ecf20Sopenharmony_ci#define MEMDATAHI 0x140 /* memory data high, presently unused in driver */ 358c2ecf20Sopenharmony_ci#define MEMDATALO 0x150 /* memory data low, presently unused in driver */ 368c2ecf20Sopenharmony_ci#define XCVRIF 0x160 /* transceiver interface control */ 378c2ecf20Sopenharmony_ci# define COLActiveLow 0x0002 388c2ecf20Sopenharmony_ci# define SerialMode 0x0004 398c2ecf20Sopenharmony_ci# define ClkBit 0x0008 408c2ecf20Sopenharmony_ci# define LinkStatus 0x0100 418c2ecf20Sopenharmony_ci#define CHIPID 0x170 /* chip ID */ 428c2ecf20Sopenharmony_ci#define MIFCSR 0x180 /* ??? */ 438c2ecf20Sopenharmony_ci#define SROMCSR 0x190 /* SROM control */ 448c2ecf20Sopenharmony_ci# define ChipSelect 0x0001 458c2ecf20Sopenharmony_ci# define Clk 0x0002 468c2ecf20Sopenharmony_ci#define TXPNTR 0x1a0 /* transmit pointer */ 478c2ecf20Sopenharmony_ci#define RXPNTR 0x1b0 /* receive pointer */ 488c2ecf20Sopenharmony_ci#define STATUS 0x200 /* status--reading this clears it */ 498c2ecf20Sopenharmony_ci#define INTDISABLE 0x210 /* interrupt enable/disable control */ 508c2ecf20Sopenharmony_ci/* bits below are the same in both STATUS and INTDISABLE registers */ 518c2ecf20Sopenharmony_ci# define FrameReceived 0x00000001 /* Received a frame */ 528c2ecf20Sopenharmony_ci# define RxFrameCntExp 0x00000002 /* Receive frame counter expired */ 538c2ecf20Sopenharmony_ci# define RxAlignCntExp 0x00000004 /* Align-error counter expired */ 548c2ecf20Sopenharmony_ci# define RxCRCCntExp 0x00000008 /* CRC-error counter expired */ 558c2ecf20Sopenharmony_ci# define RxLenCntExp 0x00000010 /* Length-error counter expired */ 568c2ecf20Sopenharmony_ci# define RxOverFlow 0x00000020 /* Receive FIFO overflow */ 578c2ecf20Sopenharmony_ci# define RxCodeViolation 0x00000040 /* Code-violation counter expired */ 588c2ecf20Sopenharmony_ci# define SQETestError 0x00000080 /* Test error in XIF for SQE */ 598c2ecf20Sopenharmony_ci# define FrameSent 0x00000100 /* Transmitted a frame */ 608c2ecf20Sopenharmony_ci# define TxUnderrun 0x00000200 /* Transmit FIFO underrun */ 618c2ecf20Sopenharmony_ci# define TxMaxSizeError 0x00000400 /* Max-packet size error */ 628c2ecf20Sopenharmony_ci# define TxNormalCollExp 0x00000800 /* Normal-collision counter expired */ 638c2ecf20Sopenharmony_ci# define TxExcessCollExp 0x00001000 /* Excess-collision counter expired */ 648c2ecf20Sopenharmony_ci# define TxLateCollExp 0x00002000 /* Late-collision counter expired */ 658c2ecf20Sopenharmony_ci# define TxNetworkCollExp 0x00004000 /* First-collision counter expired */ 668c2ecf20Sopenharmony_ci# define TxDeferTimerExp 0x00008000 /* Defer-timer expired */ 678c2ecf20Sopenharmony_ci# define RxFIFOToHost 0x00010000 /* Data moved from FIFO to host */ 688c2ecf20Sopenharmony_ci# define RxNoDescriptors 0x00020000 /* No more receive descriptors */ 698c2ecf20Sopenharmony_ci# define RxDMAError 0x00040000 /* Error during receive DMA */ 708c2ecf20Sopenharmony_ci# define RxDMALateErr 0x00080000 /* Receive DMA, data late */ 718c2ecf20Sopenharmony_ci# define RxParityErr 0x00100000 /* Parity error during receive DMA */ 728c2ecf20Sopenharmony_ci# define RxTagError 0x00200000 /* Tag error during receive DMA */ 738c2ecf20Sopenharmony_ci# define TxEOPError 0x00400000 /* Tx descriptor did not have EOP set */ 748c2ecf20Sopenharmony_ci# define MIFIntrEvent 0x00800000 /* MIF is signaling an interrupt */ 758c2ecf20Sopenharmony_ci# define TxHostToFIFO 0x01000000 /* Data moved from host to FIFO */ 768c2ecf20Sopenharmony_ci# define TxFIFOAllSent 0x02000000 /* Transmitted all packets in FIFO */ 778c2ecf20Sopenharmony_ci# define TxDMAError 0x04000000 /* Error during transmit DMA */ 788c2ecf20Sopenharmony_ci# define TxDMALateError 0x08000000 /* Late error during transmit DMA */ 798c2ecf20Sopenharmony_ci# define TxParityError 0x10000000 /* Parity error during transmit DMA */ 808c2ecf20Sopenharmony_ci# define TxTagError 0x20000000 /* Tag error during transmit DMA */ 818c2ecf20Sopenharmony_ci# define PIOError 0x40000000 /* PIO access got an error */ 828c2ecf20Sopenharmony_ci# define PIOParityError 0x80000000 /* PIO access got a parity error */ 838c2ecf20Sopenharmony_ci# define DisableAll 0xffffffff 848c2ecf20Sopenharmony_ci# define EnableAll 0x00000000 858c2ecf20Sopenharmony_ci/* # define NormalIntEvents ~(FrameReceived | FrameSent | TxUnderrun) */ 868c2ecf20Sopenharmony_ci# define EnableNormal ~(FrameReceived | FrameSent) 878c2ecf20Sopenharmony_ci# define EnableErrors (FrameReceived | FrameSent) 888c2ecf20Sopenharmony_ci# define RxErrorMask (RxFrameCntExp | RxAlignCntExp | RxCRCCntExp | \ 898c2ecf20Sopenharmony_ci RxLenCntExp | RxOverFlow | RxCodeViolation) 908c2ecf20Sopenharmony_ci# define TxErrorMask (TxUnderrun | TxMaxSizeError | TxExcessCollExp | \ 918c2ecf20Sopenharmony_ci TxLateCollExp | TxNetworkCollExp | TxDeferTimerExp) 928c2ecf20Sopenharmony_ci 938c2ecf20Sopenharmony_ci/* transmit control */ 948c2ecf20Sopenharmony_ci#define TXRST 0x420 /* transmit reset */ 958c2ecf20Sopenharmony_ci# define TxResetBit 0x0001 968c2ecf20Sopenharmony_ci#define TXCFG 0x430 /* transmit configuration control*/ 978c2ecf20Sopenharmony_ci# define TxMACEnable 0x0001 /* output driver enable */ 988c2ecf20Sopenharmony_ci# define TxSlowMode 0x0020 /* enable slow mode */ 998c2ecf20Sopenharmony_ci# define TxIgnoreColl 0x0040 /* ignore transmit collisions */ 1008c2ecf20Sopenharmony_ci# define TxNoFCS 0x0080 /* do not emit FCS */ 1018c2ecf20Sopenharmony_ci# define TxNoBackoff 0x0100 /* no backoff in case of collisions */ 1028c2ecf20Sopenharmony_ci# define TxFullDuplex 0x0200 /* enable full-duplex */ 1038c2ecf20Sopenharmony_ci# define TxNeverGiveUp 0x0400 /* don't give up on transmits */ 1048c2ecf20Sopenharmony_ci#define IPG1 0x440 /* Inter-packet gap 1 */ 1058c2ecf20Sopenharmony_ci#define IPG2 0x450 /* Inter-packet gap 2 */ 1068c2ecf20Sopenharmony_ci#define ALIMIT 0x460 /* Transmit attempt limit */ 1078c2ecf20Sopenharmony_ci#define SLOT 0x470 /* Transmit slot time */ 1088c2ecf20Sopenharmony_ci#define PALEN 0x480 /* Size of transmit preamble */ 1098c2ecf20Sopenharmony_ci#define PAPAT 0x490 /* Pattern for transmit preamble */ 1108c2ecf20Sopenharmony_ci#define TXSFD 0x4a0 /* Transmit frame delimiter */ 1118c2ecf20Sopenharmony_ci#define JAM 0x4b0 /* Jam size */ 1128c2ecf20Sopenharmony_ci#define TXMAX 0x4c0 /* Transmit max pkt size */ 1138c2ecf20Sopenharmony_ci#define TXMIN 0x4d0 /* Transmit min pkt size */ 1148c2ecf20Sopenharmony_ci#define PAREG 0x4e0 /* Count of transmit peak attempts */ 1158c2ecf20Sopenharmony_ci#define DCNT 0x4f0 /* Transmit defer timer */ 1168c2ecf20Sopenharmony_ci#define NCCNT 0x500 /* Transmit normal-collision counter */ 1178c2ecf20Sopenharmony_ci#define NTCNT 0x510 /* Transmit first-collision counter */ 1188c2ecf20Sopenharmony_ci#define EXCNT 0x520 /* Transmit excess-collision counter */ 1198c2ecf20Sopenharmony_ci#define LTCNT 0x530 /* Transmit late-collision counter */ 1208c2ecf20Sopenharmony_ci#define RSEED 0x540 /* Transmit random number seed */ 1218c2ecf20Sopenharmony_ci#define TXSM 0x550 /* Transmit state machine */ 1228c2ecf20Sopenharmony_ci 1238c2ecf20Sopenharmony_ci/* receive control */ 1248c2ecf20Sopenharmony_ci#define RXRST 0x620 /* receive reset */ 1258c2ecf20Sopenharmony_ci# define RxResetValue 0x0000 1268c2ecf20Sopenharmony_ci#define RXCFG 0x630 /* receive configuration control */ 1278c2ecf20Sopenharmony_ci# define RxMACEnable 0x0001 /* receiver overall enable */ 1288c2ecf20Sopenharmony_ci# define RxCFGReserved 0x0004 1298c2ecf20Sopenharmony_ci# define RxPadStripEnab 0x0020 /* enable pad byte stripping */ 1308c2ecf20Sopenharmony_ci# define RxPromiscEnable 0x0040 /* turn on promiscuous mode */ 1318c2ecf20Sopenharmony_ci# define RxNoErrCheck 0x0080 /* disable receive error checking */ 1328c2ecf20Sopenharmony_ci# define RxCRCNoStrip 0x0100 /* disable auto-CRC-stripping */ 1338c2ecf20Sopenharmony_ci# define RxRejectOwnPackets 0x0200 /* don't receive our own packets */ 1348c2ecf20Sopenharmony_ci# define RxGrpPromisck 0x0400 /* enable group promiscuous mode */ 1358c2ecf20Sopenharmony_ci# define RxHashFilterEnable 0x0800 /* enable hash filter */ 1368c2ecf20Sopenharmony_ci# define RxAddrFilterEnable 0x1000 /* enable address filter */ 1378c2ecf20Sopenharmony_ci#define RXMAX 0x640 /* Max receive packet size */ 1388c2ecf20Sopenharmony_ci#define RXMIN 0x650 /* Min receive packet size */ 1398c2ecf20Sopenharmony_ci#define MADD2 0x660 /* our enet address, high part */ 1408c2ecf20Sopenharmony_ci#define MADD1 0x670 /* our enet address, middle part */ 1418c2ecf20Sopenharmony_ci#define MADD0 0x680 /* our enet address, low part */ 1428c2ecf20Sopenharmony_ci#define FRCNT 0x690 /* receive frame counter */ 1438c2ecf20Sopenharmony_ci#define LECNT 0x6a0 /* Receive excess length error counter */ 1448c2ecf20Sopenharmony_ci#define AECNT 0x6b0 /* Receive misaligned error counter */ 1458c2ecf20Sopenharmony_ci#define FECNT 0x6c0 /* Receive CRC error counter */ 1468c2ecf20Sopenharmony_ci#define RXSM 0x6d0 /* Receive state machine */ 1478c2ecf20Sopenharmony_ci#define RXCV 0x6e0 /* Receive code violation */ 1488c2ecf20Sopenharmony_ci 1498c2ecf20Sopenharmony_ci#define BHASH3 0x700 /* multicast hash register */ 1508c2ecf20Sopenharmony_ci#define BHASH2 0x710 /* multicast hash register */ 1518c2ecf20Sopenharmony_ci#define BHASH1 0x720 /* multicast hash register */ 1528c2ecf20Sopenharmony_ci#define BHASH0 0x730 /* multicast hash register */ 1538c2ecf20Sopenharmony_ci 1548c2ecf20Sopenharmony_ci#define AFR2 0x740 /* address filtering setup? */ 1558c2ecf20Sopenharmony_ci#define AFR1 0x750 /* address filtering setup? */ 1568c2ecf20Sopenharmony_ci#define AFR0 0x760 /* address filtering setup? */ 1578c2ecf20Sopenharmony_ci#define AFCR 0x770 /* address filter compare register? */ 1588c2ecf20Sopenharmony_ci# define EnableAllCompares 0x0fff 1598c2ecf20Sopenharmony_ci 1608c2ecf20Sopenharmony_ci/* bits in XIFC */ 161