Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-or-later */
0002 /******************************************************************************
0003  *
0004  *  (C)Copyright 1998,1999 SysKonnect,
0005  *  a business unit of Schneider & Koch & Co. Datensysteme GmbH.
0006  *
0007  *  The information in this file is provided "AS IS" without warranty.
0008  *
0009  ******************************************************************************/
0010 
0011 /*
0012     defines for AMD Supernet II chip set
0013     the chips are referred to as
0014         FPLUS   Formac Plus
0015         PLC Physical Layer
0016 
0017     added defines for AMD Supernet III chip set
0018     added comments on differences between Supernet II and Supernet III
0019     added defines for the Motorola ELM (MOT_ELM)
0020 */
0021 
0022 #ifndef _SUPERNET_
0023 #define _SUPERNET_
0024 
0025 /*
0026  * Define Supernet 3 when used
0027  */
0028 #ifdef  PCI
0029 #ifndef SUPERNET_3
0030 #define SUPERNET_3
0031 #endif
0032 #define TAG
0033 #endif
0034 
0035 #define MB  0xff
0036 #define MW  0xffff
0037 #define MD  0xffffffff
0038 
0039 /*
0040  * FORMAC frame status (rx_msext)
0041  */
0042 #define FS_EI       (1<<2)
0043 #define FS_AI       (1<<1)
0044 #define FS_CI       (1<<0)
0045 
0046 #define FS_MSVALID  (1<<15)     /* end of queue */
0047 #define FS_MSRABT   (1<<14)     /* frame was aborted during reception*/
0048 #define FS_SSRCRTG  (1<<12)     /* if SA has set MSB (source-routing)*/
0049 #define FS_SEAC2    (FS_EI<<9)  /* error indicator */
0050 #define FS_SEAC1    (FS_AI<<9)  /* address indicator */
0051 #define FS_SEAC0    (FS_CI<<9)  /* copy indicator */
0052 #define FS_SFRMERR  (1<<8)      /* error detected (CRC or length) */
0053 #define FS_SADRRG   (1<<7)      /* address recognized */
0054 #define FS_SFRMTY2  (1<<6)      /* frame-class bit */
0055 #define FS_SFRMTY1  (1<<5)      /* frame-type bit (impementor) */
0056 #define FS_SFRMTY0  (1<<4)      /* frame-type bit (LLC) */
0057 #define FS_ERFBB1   (1<<1)      /* byte offset (depends on LSB bit) */
0058 #define FS_ERFBB0   (1<<0)      /*  - " - */
0059 
0060 /*
0061  * status frame type
0062  */
0063 #define FRM_SMT     (0) /* asynchr. frames */
0064 #define FRM_LLCA    (1)
0065 #define FRM_IMPA    (2) 
0066 #define FRM_MAC     (4) /* synchr. frames */
0067 #define FRM_LLCS    (5)
0068 #define FRM_IMPS    (6)
0069 
0070 /*
0071  * bits in rx_descr.i   (receive frame status word)
0072  */
0073 #define RX_MSVALID  ((long)1<<31)   /* memory status valid */
0074 #define RX_MSRABT   ((long)1<<30)   /* memory status receive abort */
0075 #define RX_FS_E     ((long)FS_SEAC2<<16)    /* error indicator */
0076 #define RX_FS_A     ((long)FS_SEAC1<<16)    /* address indicator */
0077 #define RX_FS_C     ((long)FS_SEAC0<<16)    /* copy indicator */
0078 #define RX_FS_CRC   ((long)FS_SFRMERR<<16)/* error detected */
0079 #define RX_FS_ADDRESS   ((long)FS_SADRRG<<16)   /* address recognized */
0080 #define RX_FS_MAC   ((long)FS_SFRMTY2<<16)/* MAC frame */
0081 #define RX_FS_SMT   ((long)0<<16)       /* SMT frame */
0082 #define RX_FS_IMPL  ((long)FS_SFRMTY1<<16)/* implementer frame */
0083 #define RX_FS_LLC   ((long)FS_SFRMTY0<<16)/* LLC frame */
0084 
0085 /*
0086  * receive frame descriptor
0087  */
0088 union rx_descr {
0089     struct {
0090 #ifdef  LITTLE_ENDIAN
0091     unsigned int    rx_length :16 ; /* frame length lower/upper byte */
0092     unsigned int    rx_erfbb  :2 ;  /* received frame byte boundary */
0093     unsigned int    rx_reserv2:2 ;  /* reserved */
0094     unsigned int    rx_sfrmty :3 ;  /* frame type bits */
0095     unsigned int    rx_sadrrg :1 ;  /* DA == MA or broad-/multicast */
0096     unsigned int    rx_sfrmerr:1 ;  /* received frame not valid */
0097     unsigned int    rx_seac0  :1 ;  /* frame-copied  C-indicator */
0098     unsigned int    rx_seac1  :1 ;  /* address-match A-indicator */
0099     unsigned int    rx_seac2  :1 ;  /* frame-error   E-indicator */
0100     unsigned int    rx_ssrcrtg:1 ;  /* == 1 SA has MSB set */
0101     unsigned int    rx_reserv1:1 ;  /* reserved */
0102     unsigned int    rx_msrabt :1 ;  /* memory status receive abort */
0103     unsigned int    rx_msvalid:1 ;  /* memory status valid */
0104 #else
0105     unsigned int    rx_msvalid:1 ;  /* memory status valid */
0106     unsigned int    rx_msrabt :1 ;  /* memory status receive abort */
0107     unsigned int    rx_reserv1:1 ;  /* reserved */
0108     unsigned int    rx_ssrcrtg:1 ;  /* == 1 SA has MSB set */
0109     unsigned int    rx_seac2  :1 ;  /* frame-error   E-indicator */
0110     unsigned int    rx_seac1  :1 ;  /* address-match A-indicator */
0111     unsigned int    rx_seac0  :1 ;  /* frame-copied  C-indicator */
0112     unsigned int    rx_sfrmerr:1 ;  /* received frame not valid */
0113     unsigned int    rx_sadrrg :1 ;  /* DA == MA or broad-/multicast */
0114     unsigned int    rx_sfrmty :3 ;  /* frame type bits */
0115     unsigned int    rx_erfbb  :2 ;  /* received frame byte boundary */
0116     unsigned int    rx_reserv2:2 ;  /* reserved */
0117     unsigned int    rx_length :16 ; /* frame length lower/upper byte */
0118 #endif
0119     } r ;
0120     long    i ;
0121 } ;
0122 
0123 /* defines for Receive Frame Descriptor access */
0124 #define RD_S_ERFBB  0x00030000L /* received frame byte boundary */
0125 #define RD_S_RES2   0x000c0000L /* reserved */
0126 #define RD_S_SFRMTY 0x00700000L /* frame type bits */
0127 #define RD_S_SADRRG 0x00800000L /* DA == MA or broad-/multicast */
0128 #define RD_S_SFRMERR    0x01000000L /* received frame not valid */
0129 #define RD_S_SEAC   0x0e000000L /* frame status indicators */
0130 #define RD_S_SEAC0  0x02000000L /* frame-copied  case-indicator */
0131 #define RD_S_SEAC1  0x04000000L /* address-match A-indicator */
0132 #define RD_S_SEAC2  0x08000000L /* frame-error   E-indicator */
0133 #define RD_S_SSRCRTG    0x10000000L /* == 1 SA has MSB set */
0134 #define RD_S_RES1   0x20000000L /* reserved */
0135 #define RD_S_MSRABT 0x40000000L /* memory status receive abort */
0136 #define RD_S_MSVALID    0x80000000L /* memory status valid */
0137 
0138 #define RD_STATUS   0xffff0000L
0139 #define RD_LENGTH   0x0000ffffL
0140 
0141 /* defines for Receive Frames Status Word values */
0142 /*RD_S_SFRMTY*/
0143 #define RD_FRM_SMT  (unsigned long)(0<<20)     /* asynchr. frames */
0144 #define RD_FRM_LLCA (unsigned long)(1<<20)
0145 #define RD_FRM_IMPA (unsigned long)(2<<20)
0146 #define RD_FRM_MAC  (unsigned long)(4<<20)     /* synchr. frames */
0147 #define RD_FRM_LLCS (unsigned long)(5<<20)
0148 #define RD_FRM_IMPS (unsigned long)(6<<20)
0149 
0150 #define TX_DESCRIPTOR   0x40000000L
0151 #define TX_OFFSET_3 0x18000000L
0152 
0153 #define TXP1    2
0154 
0155 /*
0156  * transmit frame descriptor
0157  */
0158 union tx_descr {
0159     struct {
0160 #ifdef  LITTLE_ENDIAN
0161     unsigned int    tx_length:16 ;  /* frame length lower/upper byte */
0162     unsigned int    tx_res   :8 ;   /* reserved      (bit 16..23) */
0163     unsigned int    tx_xmtabt:1 ;   /* transmit abort */
0164     unsigned int    tx_nfcs  :1 ;   /* no frame check sequence */
0165     unsigned int    tx_xdone :1 ;   /* give up token */
0166     unsigned int    tx_rpxm  :2 ;   /* byte offset */
0167     unsigned int    tx_pat1  :2 ;   /* must be TXP1 */
0168     unsigned int    tx_more  :1 ;   /* more frame in chain */
0169 #else
0170     unsigned int    tx_more  :1 ;   /* more frame in chain */
0171     unsigned int    tx_pat1  :2 ;   /* must be TXP1 */
0172     unsigned int    tx_rpxm  :2 ;   /* byte offset */
0173     unsigned int    tx_xdone :1 ;   /* give up token */
0174     unsigned int    tx_nfcs  :1 ;   /* no frame check sequence */
0175     unsigned int    tx_xmtabt:1 ;   /* transmit abort */
0176     unsigned int    tx_res   :8 ;   /* reserved      (bit 16..23) */
0177     unsigned int    tx_length:16 ;  /* frame length lower/upper byte */
0178 #endif
0179     } t ;
0180     long    i ;
0181 } ;
0182 
0183 /* defines for Transmit Descriptor access */
0184 #define TD_C_MORE   0x80000000L /* more frame in chain */
0185 #define TD_C_DESCR  0x60000000L /* must be TXP1 */
0186 #define TD_C_TXFBB  0x18000000L /* byte offset */
0187 #define TD_C_XDONE  0x04000000L /* give up token */
0188 #define TD_C_NFCS   0x02000000L /* no frame check sequence */
0189 #define TD_C_XMTABT 0x01000000L /* transmit abort */
0190 
0191 #define TD_C_LNCNU  0x0000ff00L 
0192 #define TD_C_LNCNL  0x000000ffL
0193 #define TD_C_LNCN   0x0000ffffL /* frame length lower/upper byte */
0194  
0195 /*
0196  * transmit pointer
0197  */
0198 union tx_pointer {
0199     struct t {
0200 #ifdef  LITTLE_ENDIAN
0201     unsigned int    tp_pointer:16 ; /* pointer to tx_descr (low/high) */
0202     unsigned int    tp_res    :8 ;  /* reserved      (bit 16..23) */
0203     unsigned int    tp_pattern:8 ;  /* fixed pattern (bit 24..31) */
0204 #else
0205     unsigned int    tp_pattern:8 ;  /* fixed pattern (bit 24..31) */
0206     unsigned int    tp_res    :8 ;  /* reserved      (bit 16..23) */
0207     unsigned int    tp_pointer:16 ; /* pointer to tx_descr (low/high) */
0208 #endif
0209     } t ;
0210     long    i ;
0211 } ;
0212 
0213 /* defines for Nontag Mode Pointer access */
0214 #define TD_P_CNTRL  0xff000000L
0215 #define TD_P_RPXU   0x0000ff00L
0216 #define TD_P_RPXL   0x000000ffL
0217 #define TD_P_RPX    0x0000ffffL
0218 
0219 
0220 #define TX_PATTERN  0xa0
0221 #define TX_POINTER_END  0xa0000000L
0222 #define TX_INT_PATTERN  0xa0000000L
0223 
0224 struct tx_queue {
0225     struct tx_queue *tq_next ;
0226     u_short tq_pack_offset ;    /* offset buffer memory */
0227     u_char  tq_pad[2] ;
0228 } ;
0229 
0230 /*
0231     defines for FORMAC Plus (Am79C830)
0232 */
0233 
0234 /*
0235  *  FORMAC+ read/write (r/w) registers
0236  */
0237 #define FM_CMDREG1  0x00        /* write command reg 1 instruction */
0238 #define FM_CMDREG2  0x01        /* write command reg 2 instruction */
0239 #define FM_ST1U     0x00        /* read upper 16-bit of status reg 1 */
0240 #define FM_ST1L     0x01        /* read lower 16-bit of status reg 1 */
0241 #define FM_ST2U     0x02        /* read upper 16-bit of status reg 2 */
0242 #define FM_ST2L     0x03        /* read lower 16-bit of status reg 2 */
0243 #define FM_IMSK1U   0x04        /* r/w upper 16-bit of IMSK 1 */
0244 #define FM_IMSK1L   0x05        /* r/w lower 16-bit of IMSK 1 */
0245 #define FM_IMSK2U   0x06        /* r/w upper 16-bit of IMSK 2 */
0246 #define FM_IMSK2L   0x07        /* r/w lower 16-bit of IMSK 2 */
0247 #define FM_SAID     0x08        /* r/w short addr.-individual */
0248 #define FM_LAIM     0x09        /* r/w long addr.-ind. (MSW of LAID) */
0249 #define FM_LAIC     0x0a        /* r/w long addr.-ind. (middle)*/
0250 #define FM_LAIL     0x0b        /* r/w long addr.-ind. (LSW) */
0251 #define FM_SAGP     0x0c        /* r/w short address-group */
0252 #define FM_LAGM     0x0d        /* r/w long addr.-gr. (MSW of LAGP) */
0253 #define FM_LAGC     0x0e        /* r/w long addr.-gr. (middle) */
0254 #define FM_LAGL     0x0f        /* r/w long addr.-gr. (LSW) */
0255 #define FM_MDREG1   0x10        /* r/w 16-bit mode reg 1 */
0256 #define FM_STMCHN   0x11        /* read state-machine reg */
0257 #define FM_MIR1     0x12        /* read upper 16-bit of MAC Info Reg */
0258 #define FM_MIR0     0x13        /* read lower 16-bit of MAC Info Reg */
0259 #define FM_TMAX     0x14        /* r/w 16-bit TMAX reg */
0260 #define FM_TVX      0x15        /* write 8-bit TVX reg with NP7-0
0261                        read TVX on NP7-0, timer on NP15-8*/
0262 #define FM_TRT      0x16        /* r/w upper 16-bit of TRT timer */
0263 #define FM_THT      0x17        /* r/w upper 16-bit of THT timer */
0264 #define FM_TNEG     0x18        /* read upper 16-bit of TNEG (TTRT) */
0265 #define FM_TMRS     0x19        /* read lower 5-bit of TNEG,TRT,THT */
0266             /* F E D C  B A 9 8  7 6 5 4  3 2 1 0
0267                x |-TNEG4-0| |-TRT4-0-| |-THT4-0-| (x-late count) */
0268 #define FM_TREQ0    0x1a        /* r/w 16-bit TREQ0 reg (LSW of TRT) */
0269 #define FM_TREQ1    0x1b        /* r/w 16-bit TREQ1 reg (MSW of TRT) */
0270 #define FM_PRI0     0x1c        /* r/w priority r. for asyn.-queue 0 */
0271 #define FM_PRI1     0x1d        /* r/w priority r. for asyn.-queue 1 */
0272 #define FM_PRI2     0x1e        /* r/w priority r. for asyn.-queue 2 */
0273 #define FM_TSYNC    0x1f        /* r/w 16-bit of the TSYNC register */
0274 #define FM_MDREG2   0x20        /* r/w 16-bit mode reg 2 */
0275 #define FM_FRMTHR   0x21        /* r/w the frame threshold register */
0276 #define FM_EACB     0x22        /* r/w end addr of claim/beacon area */
0277 #define FM_EARV     0x23        /* r/w end addr of receive queue */
0278 /* Supernet 3 */
0279 #define FM_EARV1    FM_EARV
0280 
0281 #define FM_EAS      0x24        /* r/w end addr of synchr. queue */
0282 #define FM_EAA0     0x25        /* r/w end addr of asyn. queue 0 */
0283 #define FM_EAA1     0x26        /* r/w end addr of asyn. queue 1 */
0284 #define FM_EAA2     0x27        /* r/w end addr of asyn. queue 2 */
0285 #define FM_SACL     0x28        /* r/w start addr of claim frame */
0286 #define FM_SABC     0x29        /* r/w start addr of beacon frame */
0287 #define FM_WPXSF    0x2a        /* r/w the write ptr. for special fr.*/
0288 #define FM_RPXSF    0x2b        /* r/w the read ptr. for special fr. */
0289 #define FM_RPR      0x2d        /* r/w the read ptr. for receive qu. */
0290 #define FM_WPR      0x2e        /* r/w the write ptr. for receive qu.*/
0291 #define FM_SWPR     0x2f        /* r/w the shadow wr.-ptr. for rec.q.*/
0292 /* Supernet 3 */ 
0293 #define FM_RPR1         FM_RPR   
0294 #define FM_WPR1         FM_WPR 
0295 #define FM_SWPR1        FM_SWPR
0296 
0297 #define FM_WPXS     0x30        /* r/w the write ptr. for synchr. qu.*/
0298 #define FM_WPXA0    0x31        /* r/w the write ptr. for asyn. qu.0 */
0299 #define FM_WPXA1    0x32        /* r/w the write ptr. for asyn. qu.1 */
0300 #define FM_WPXA2    0x33        /* r/w the write ptr. for asyn. qu.2 */
0301 #define FM_SWPXS    0x34        /* r/w the shadow wr.-ptr. for syn.q.*/
0302 #define FM_SWPXA0   0x35        /* r/w the shad. wr.-ptr. for asyn.q0*/
0303 #define FM_SWPXA1   0x36        /* r/w the shad. wr.-ptr. for asyn.q1*/
0304 #define FM_SWPXA2   0x37        /* r/w the shad. wr.-ptr. for asyn.q2*/
0305 #define FM_RPXS     0x38        /* r/w the read ptr. for synchr. qu. */
0306 #define FM_RPXA0    0x39        /* r/w the read ptr. for asyn. qu. 0 */
0307 #define FM_RPXA1    0x3a        /* r/w the read ptr. for asyn. qu. 1 */
0308 #define FM_RPXA2    0x3b        /* r/w the read ptr. for asyn. qu. 2 */
0309 #define FM_MARR     0x3c        /* r/w the memory read addr register */
0310 #define FM_MARW     0x3d        /* r/w the memory write addr register*/
0311 #define FM_MDRU     0x3e        /* r/w upper 16-bit of mem. data reg */
0312 #define FM_MDRL     0x3f        /* r/w lower 16-bit of mem. data reg */
0313 
0314 /* following instructions relate to MAC counters and timer */
0315 #define FM_TMSYNC   0x40        /* r/w upper 16 bits of TMSYNC timer */
0316 #define FM_FCNTR    0x41        /* r/w the 16-bit frame counter */
0317 #define FM_LCNTR    0x42        /* r/w the 16-bit lost counter */
0318 #define FM_ECNTR    0x43        /* r/w the 16-bit error counter */
0319 
0320 /* Supernet 3:  extensions to old register block */
0321 #define FM_FSCNTR   0x44        /* r/? Frame Strip Counter */
0322 #define FM_FRSELREG 0x45        /* r/w Frame Selection Register */
0323 
0324 /* Supernet 3:  extensions for 2. receive queue etc. */
0325 #define FM_MDREG3   0x60        /* r/w Mode Register 3 */
0326 #define FM_ST3U     0x61        /* read upper 16-bit of status reg 3 */
0327 #define FM_ST3L     0x62        /* read lower 16-bit of status reg 3 */
0328 #define FM_IMSK3U   0x63        /* r/w upper 16-bit of IMSK reg 3 */
0329 #define FM_IMSK3L   0x64        /* r/w lower 16-bit of IMSK reg 3 */
0330 #define FM_IVR      0x65        /* read Interrupt Vector register */
0331 #define FM_IMR      0x66        /* r/w Interrupt mask register */
0332 /* 0x67 Hidden */
0333 #define FM_RPR2     0x68        /* r/w the read ptr. for rec. qu. 2 */
0334 #define FM_WPR2     0x69        /* r/w the write ptr. for rec. qu. 2 */
0335 #define FM_SWPR2    0x6a        /* r/w the shadow wptr. for rec. q. 2 */
0336 #define FM_EARV2    0x6b        /* r/w end addr of rec. qu. 2 */
0337 #define FM_UNLCKDLY 0x6c        /* r/w Auto Unlock Delay register */
0338                     /* Bit 15-8: RECV2 unlock threshold */
0339                     /* Bit  7-0: RECV1 unlock threshold */
0340 /* 0x6f-0x73    Hidden */
0341 #define FM_LTDPA1   0x79        /* r/w Last Trans desc ptr for A1 qu. */
0342 /* 0x80-0x9a    PLCS registers of built-in PLCS  (Supernet 3 only) */
0343 
0344 /* Supernet 3: Adderss Filter Registers */
0345 #define FM_AFCMD    0xb0        /* r/w Address Filter Command Reg */
0346 #define FM_AFSTAT   0xb2        /* r/w Address Filter Status Reg */
0347 #define FM_AFBIST   0xb4        /* r/w Address Filter BIST signature */
0348 #define FM_AFCOMP2  0xb6        /* r/w Address Filter Comparand 2 */
0349 #define FM_AFCOMP1  0xb8        /* r/w Address Filter Comparand 1 */
0350 #define FM_AFCOMP0  0xba        /* r/w Address Filter Comparand 0 */
0351 #define FM_AFMASK2  0xbc        /* r/w Address Filter Mask 2 */
0352 #define FM_AFMASK1  0xbe        /* r/w Address Filter Mask 1 */
0353 #define FM_AFMASK0  0xc0        /* r/w Address Filter Mask 0 */
0354 #define FM_AFPERS   0xc2        /* r/w Address Filter Personality Reg */
0355 
0356 /* Supernet 3: Orion (PDX?) Registers */
0357 #define FM_ORBIST   0xd0        /* r/w Orion BIST signature */
0358 #define FM_ORSTAT   0xd2        /* r/w Orion Status Register */
0359 
0360 
0361 /*
0362  * Mode Register 1 (MDREG1)
0363  */
0364 #define FM_RES0     0x0001      /* reserved */
0365                     /* SN3: other definition */
0366 #define FM_XMTINH_HOLD  0x0002      /* transmit-inhibit/hold bit */
0367                     /* SN3: other definition */
0368 #define FM_HOFLXI   0x0003      /* SN3: Hold / Flush / Inhibit */
0369 #define FM_FULL_HALF    0x0004      /* full-duplex/half-duplex bit */
0370 #define FM_LOCKTX   0x0008      /* lock-transmit-asynchr.-queues bit */
0371 #define FM_EXGPA0   0x0010      /* extended-group-addressing bit 0 */
0372 #define FM_EXGPA1   0x0020      /* extended-group-addressing bit 1 */
0373 #define FM_DISCRY   0x0040      /* disable-carry bit */
0374                     /* SN3: reserved */
0375 #define FM_SELRA    0x0080      /* select input from PHY (1=RA,0=RB) */
0376 
0377 #define FM_ADDET    0x0700      /* address detection */
0378 #define FM_MDAMA    (0<<8)      /* address detection : DA = MA */
0379 #define FM_MDASAMA  (1<<8)      /* address detection : DA=MA||SA=MA */
0380 #define FM_MRNNSAFNMA   (2<<8)      /* rec. non-NSA frames DA=MA&&SA!=MA */
0381 #define FM_MRNNSAF  (3<<8)      /* rec. non-NSA frames DA = MA */
0382 #define FM_MDISRCV  (4<<8)      /* disable receive function */
0383 #define FM_MRES0    (5<<8)      /* reserve */
0384 #define FM_MLIMPROM (6<<8)      /* limited-promiscuous mode */
0385 #define FM_MPROMISCOUS  (7<<8)      /* address detection : promiscuous */
0386 
0387 #define FM_SELSA    0x0800      /* select-short-address bit */
0388 
0389 #define FM_MMODE    0x7000      /* mode select */
0390 #define FM_MINIT    (0<<12)     /* initialize */
0391 #define FM_MMEMACT  (1<<12)     /* memory activate */
0392 #define FM_MONLINESP    (2<<12)     /* on-line special */
0393 #define FM_MONLINE  (3<<12)     /* on-line (FDDI operational mode) */
0394 #define FM_MILOOP   (4<<12)     /* internal loopback */
0395 #define FM_MRES1    (5<<12)     /* reserved */
0396 #define FM_MRES2    (6<<12)     /* reserved */
0397 #define FM_MELOOP   (7<<12)     /* external loopback */
0398 
0399 #define FM_SNGLFRM  0x8000      /* single-frame-receive mode */
0400                     /* SN3: reserved */
0401 
0402 #define MDR1INIT    (FM_MINIT | FM_MDAMA)
0403 
0404 /*
0405  * Mode Register 2 (MDREG2)
0406  */
0407 #define FM_AFULL    0x000f      /* 4-bit value (empty loc.in txqueue)*/
0408 #define FM_RCVERR   0x0010      /* rec.-errored-frames bit */
0409 #define FM_SYMCTL   0x0020      /* sysmbol-control bit */
0410                     /* SN3: reserved */
0411 #define FM_SYNPRQ   0x0040      /* synchron.-NP-DMA-request bit */
0412 #define FM_ENNPRQ   0x0080      /* enable-NP-DMA-request bit */
0413 #define FM_ENHSRQ   0x0100      /* enable-host-request bit */
0414 #define FM_RXFBB01  0x0600      /* rec. frame byte boundary bit0 & 1 */
0415 #define FM_LSB      0x0800      /* determ. ordering of bytes in buffer*/
0416 #define FM_PARITY   0x1000      /* 1 = even, 0 = odd */
0417 #define FM_CHKPAR   0x2000      /* 1 = parity of 32-bit buffer BD-bus*/
0418 #define FM_STRPFCS  0x4000      /* 1 = strips FCS field of rec.frame */
0419 #define FM_BMMODE   0x8000      /* Buffer-Memory-Mode (1 = tag mode) */
0420                     /* SN3: 1 = tag, 0 = modified tag */
0421 
0422 /*
0423  * Status Register 1, Upper 16 Bits (ST1U)
0424  */
0425 #define FM_STEFRMS  0x0001      /* transmit end of frame: synchr. qu.*/
0426 #define FM_STEFRMA0 0x0002      /* transmit end of frame: asyn. qu.0 */
0427 #define FM_STEFRMA1 0x0004      /* transmit end of frame: asyn. qu.1 */
0428 #define FM_STEFRMA2 0x0008      /* transmit end of frame: asyn. qu.2 */
0429                     /* SN3: reserved */
0430 #define FM_STECFRMS 0x0010      /* transmit end of chain of syn. qu. */
0431                     /* SN3: reserved */
0432 #define FM_STECFRMA0    0x0020      /* transmit end of chain of asyn. q0 */
0433                     /* SN3: reserved */
0434 #define FM_STECFRMA1    0x0040      /* transmit end of chain of asyn. q1 */
0435                     /* SN3: STECMDA1 */
0436 #define FM_STECMDA1 0x0040      /* SN3: 'no description' */
0437 #define FM_STECFRMA2    0x0080      /* transmit end of chain of asyn. q2 */
0438                     /* SN3: reserved */
0439 #define FM_STEXDONS 0x0100      /* transmit until XDONE in syn. qu. */
0440 #define FM_STBFLA   0x0200      /* asynchr.-queue trans. buffer full */
0441 #define FM_STBFLS   0x0400      /* synchr.-queue transm. buffer full */
0442 #define FM_STXABRS  0x0800      /* synchr. queue transmit-abort */
0443 #define FM_STXABRA0 0x1000      /* asynchr. queue 0 transmit-abort */
0444 #define FM_STXABRA1 0x2000      /* asynchr. queue 1 transmit-abort */
0445 #define FM_STXABRA2 0x4000      /* asynchr. queue 2 transmit-abort */
0446                     /* SN3: reserved */
0447 #define FM_SXMTABT  0x8000      /* transmit abort */
0448 
0449 /*
0450  * Status Register 1, Lower 16 Bits (ST1L)
0451  */
0452 #define FM_SQLCKS   0x0001      /* queue lock for synchr. queue */
0453 #define FM_SQLCKA0  0x0002      /* queue lock for asynchr. queue 0 */
0454 #define FM_SQLCKA1  0x0004      /* queue lock for asynchr. queue 1 */
0455 #define FM_SQLCKA2  0x0008      /* queue lock for asynchr. queue 2 */
0456                     /* SN3: reserved */
0457 #define FM_STXINFLS 0x0010      /* transmit instruction full: syn. */
0458                     /* SN3: reserved */
0459 #define FM_STXINFLA0    0x0020      /* transmit instruction full: asyn.0 */
0460                     /* SN3: reserved */
0461 #define FM_STXINFLA1    0x0040      /* transmit instruction full: asyn.1 */
0462                     /* SN3: reserved */
0463 #define FM_STXINFLA2    0x0080      /* transmit instruction full: asyn.2 */
0464                     /* SN3: reserved */
0465 #define FM_SPCEPDS  0x0100      /* parity/coding error: syn. queue */
0466 #define FM_SPCEPDA0 0x0200      /* parity/coding error: asyn. queue0 */
0467 #define FM_SPCEPDA1 0x0400      /* parity/coding error: asyn. queue1 */
0468 #define FM_SPCEPDA2 0x0800      /* parity/coding error: asyn. queue2 */
0469                     /* SN3: reserved */
0470 #define FM_STBURS   0x1000      /* transmit buffer underrun: syn. q. */
0471 #define FM_STBURA0  0x2000      /* transmit buffer underrun: asyn.0 */
0472 #define FM_STBURA1  0x4000      /* transmit buffer underrun: asyn.1 */
0473 #define FM_STBURA2  0x8000      /* transmit buffer underrun: asyn.2 */
0474                     /* SN3: reserved */
0475 
0476 /*
0477  * Status Register 2, Upper 16 Bits (ST2U)
0478  */
0479 #define FM_SOTRBEC  0x0001      /* other beacon received */
0480 #define FM_SMYBEC   0x0002      /* my beacon received */
0481 #define FM_SBEC     0x0004      /* beacon state entered */
0482 #define FM_SLOCLM   0x0008      /* low claim received */
0483 #define FM_SHICLM   0x0010      /* high claim received */
0484 #define FM_SMYCLM   0x0020      /* my claim received */
0485 #define FM_SCLM     0x0040      /* claim state entered */
0486 #define FM_SERRSF   0x0080      /* error in special frame */
0487 #define FM_SNFSLD   0x0100      /* NP and FORMAC+ simultaneous load */
0488 #define FM_SRFRCTOV 0x0200      /* receive frame counter overflow */
0489                     /* SN3: reserved */
0490 #define FM_SRCVFRM  0x0400      /* receive frame */
0491                     /* SN3: reserved */
0492 #define FM_SRCVOVR  0x0800      /* receive FIFO overflow */
0493 #define FM_SRBFL    0x1000      /* receive buffer full */
0494 #define FM_SRABT    0x2000      /* receive abort */
0495 #define FM_SRBMT    0x4000      /* receive buffer empty */
0496 #define FM_SRCOMP   0x8000      /* receive complete. Nontag mode */
0497 
0498 /*
0499  * Status Register 2, Lower 16 Bits (ST2L)
0500  * Attention: SN3 docu shows these bits the other way around
0501  */
0502 #define FM_SRES0    0x0001      /* reserved */
0503 #define FM_SESTRIPTK    0x0001      /* SN3: 'no description' */
0504 #define FM_STRTEXR  0x0002      /* TRT expired in claim | beacon st. */
0505 #define FM_SDUPCLM  0x0004      /* duplicate claim received */
0506 #define FM_SSIFG    0x0008      /* short interframe gap */
0507 #define FM_SFRMCTR  0x0010      /* frame counter overflow */
0508 #define FM_SERRCTR  0x0020      /* error counter overflow */
0509 #define FM_SLSTCTR  0x0040      /* lost counter overflow */
0510 #define FM_SPHINV   0x0080      /* PHY invalid */
0511 #define FM_SADET    0x0100      /* address detect */
0512 #define FM_SMISFRM  0x0200      /* missed frame */
0513 #define FM_STRTEXP  0x0400      /* TRT expired and late count > 0 */
0514 #define FM_STVXEXP  0x0800      /* TVX expired */
0515 #define FM_STKISS   0x1000      /* token issued */
0516 #define FM_STKERR   0x2000      /* token error */
0517 #define FM_SMULTDA  0x4000      /* multiple destination address */
0518 #define FM_SRNGOP   0x8000      /* ring operational */
0519 
0520 /*
0521  * Supernet 3:
0522  * Status Register 3, Upper 16 Bits (ST3U)
0523  */
0524 #define FM_SRQUNLCK1    0x0001      /* receive queue unlocked queue 1 */
0525 #define FM_SRQUNLCK2    0x0002      /* receive queue unlocked queue 2 */
0526 #define FM_SRPERRQ1 0x0004      /* receive parity error rx queue 1 */
0527 #define FM_SRPERRQ2 0x0008      /* receive parity error rx queue 2 */
0528                     /* Bit 4-10: reserved */
0529 #define FM_SRCVOVR2 0x0800      /* receive FIFO overfull rx queue 2 */
0530 #define FM_SRBFL2   0x1000      /* receive buffer full rx queue 2 */
0531 #define FM_SRABT2   0x2000      /* receive abort rx queue 2 */
0532 #define FM_SRBMT2   0x4000      /* receive buf empty rx queue 2 */
0533 #define FM_SRCOMP2  0x8000      /* receive comp rx queue 2 */
0534 
0535 /*
0536  * Supernet 3:
0537  * Status Register 3, Lower 16 Bits (ST3L)
0538  */
0539 #define FM_AF_BIST_DONE     0x0001  /* Address Filter BIST is done */
0540 #define FM_PLC_BIST_DONE    0x0002  /* internal PLC Bist is done */
0541 #define FM_PDX_BIST_DONE    0x0004  /* PDX BIST is done */
0542                     /* Bit  3: reserved */
0543 #define FM_SICAMDAMAT       0x0010  /* Status internal CAM DA match */
0544 #define FM_SICAMDAXACT      0x0020  /* Status internal CAM DA exact match */
0545 #define FM_SICAMSAMAT       0x0040  /* Status internal CAM SA match */
0546 #define FM_SICAMSAXACT      0x0080  /* Status internal CAM SA exact match */
0547 
0548 /*
0549  * MAC State-Machine Register FM_STMCHN
0550  */
0551 #define FM_MDRTAG   0x0004      /* tag bit of long word read */
0552 #define FM_SNPPND   0x0008      /* r/w from buffer mem. is pending */
0553 #define FM_TXSTAT   0x0070      /* transmitter state machine state */
0554 #define FM_RCSTAT   0x0380      /* receiver state machine state */
0555 #define FM_TM01     0x0c00      /* indicate token mode */
0556 #define FM_SIM      0x1000      /* indicate send immediate-mode */
0557 #define FM_REV      0xe000      /* FORMAC Plus revision number */
0558 
0559 /*
0560  * Supernet 3
0561  * Mode Register 3
0562  */
0563 #define FM_MENRS    0x0001      /* Ena enhanced rec status encoding */
0564 #define FM_MENXS    0x0002      /* Ena enhanced xmit status encoding */
0565 #define FM_MENXCT   0x0004      /* Ena EXACT/INEXACT matching */
0566 #define FM_MENAFULL 0x0008      /* Ena enh QCTRL encoding for AFULL */
0567 #define FM_MEIND    0x0030      /* Ena enh A,C indicator settings */
0568 #define FM_MENQCTRL 0x0040      /* Ena enh QCTRL encoding */
0569 #define FM_MENRQAUNLCK  0x0080      /* Ena rec q auto unlock */
0570 #define FM_MENDAS   0x0100      /* Ena DAS connections by cntr MUX */
0571 #define FM_MENPLCCST    0x0200      /* Ena Counter Segm test in PLC blck */
0572 #define FM_MENSGLINT    0x0400      /* Ena Vectored Interrupt reading */
0573 #define FM_MENDRCV  0x0800      /* Ena dual receive queue operation */
0574 #define FM_MENFCLOC 0x3000      /* Ena FC location within frm data */
0575 #define FM_MENTRCMD 0x4000      /* Ena ASYNC1 xmit only after command */
0576 #define FM_MENTDLPBK    0x8000      /* Ena TDAT to RDAT lkoopback */
0577 
0578 /*
0579  * Supernet 3
0580  * Frame Selection Register
0581  */
0582 #define FM_RECV1    0x000f      /* options for receive queue 1 */
0583 #define FM_RCV1_ALL (0<<0)      /* receive all frames */
0584 #define FM_RCV1_LLC (1<<0)      /* rec all LLC frames */
0585 #define FM_RCV1_SMT (2<<0)      /* rec all SMT frames */
0586 #define FM_RCV1_NSMT    (3<<0)      /* rec non-SMT frames */
0587 #define FM_RCV1_IMP (4<<0)      /* rec Implementor frames */
0588 #define FM_RCV1_MAC (5<<0)      /* rec all MAC frames */
0589 #define FM_RCV1_SLLC    (6<<0)      /* rec all sync LLC frames */
0590 #define FM_RCV1_ALLC    (7<<0)      /* rec all async LLC frames */
0591 #define FM_RCV1_VOID    (8<<0)      /* rec all void frames */
0592 #define FM_RCV1_ALSMT   (9<<0)      /* rec all async LLC & SMT frames */
0593 #define FM_RECV2    0x00f0      /* options for receive queue 2 */
0594 #define FM_RCV2_ALL (0<<4)      /* receive all other frames */
0595 #define FM_RCV2_LLC (1<<4)      /* rec all LLC frames */
0596 #define FM_RCV2_SMT (2<<4)      /* rec all SMT frames */
0597 #define FM_RCV2_NSMT    (3<<4)      /* rec non-SMT frames */
0598 #define FM_RCV2_IMP (4<<4)      /* rec Implementor frames */
0599 #define FM_RCV2_MAC (5<<4)      /* rec all MAC frames */
0600 #define FM_RCV2_SLLC    (6<<4)      /* rec all sync LLC frames */
0601 #define FM_RCV2_ALLC    (7<<4)      /* rec all async LLC frames */
0602 #define FM_RCV2_VOID    (8<<4)      /* rec all void frames */
0603 #define FM_RCV2_ALSMT   (9<<4)      /* rec all async LLC & SMT frames */
0604 #define FM_ENXMTADSWAP  0x4000      /* enh rec addr swap (phys -> can) */
0605 #define FM_ENRCVADSWAP  0x8000      /* enh tx addr swap (can -> phys) */
0606 
0607 /*
0608  * Supernet 3:
0609  * Address Filter Command Register (AFCMD)
0610  */
0611 #define FM_INST     0x0007      /* Address Filter Operation */
0612 #define FM_IINV_CAM (0<<0)      /* Invalidate CAM */
0613 #define FM_IWRITE_CAM   (1<<0)      /* Write CAM */
0614 #define FM_IREAD_CAM    (2<<0)      /* Read CAM */
0615 #define FM_IRUN_BIST    (3<<0)      /* Run BIST */
0616 #define FM_IFIND    (4<<0)      /* Find */
0617 #define FM_IINV     (5<<0)      /* Invalidate */
0618 #define FM_ISKIP    (6<<0)      /* Skip */
0619 #define FM_ICL_SKIP (7<<0)      /* Clear all SKIP bits */
0620 
0621 /*
0622  * Supernet 3:
0623  * Address Filter Status Register (AFSTAT)
0624  */
0625                     /* Bit  0-4: reserved */
0626 #define FM_REV_NO   0x00e0      /* Revision Number of Address Filter */
0627 #define FM_BIST_DONE    0x0100      /* BIST complete */
0628 #define FM_EMPTY    0x0200      /* CAM empty */
0629 #define FM_ERROR    0x0400      /* Error (improper operation) */
0630 #define FM_MULT     0x0800      /* Multiple Match */
0631 #define FM_EXACT    0x1000      /* Exact Match */
0632 #define FM_FOUND    0x2000      /* Comparand found in CAM */
0633 #define FM_FULL     0x4000      /* CAM full */
0634 #define FM_DONE     0x8000      /* DONE indicator */
0635 
0636 /*
0637  * Supernet 3:
0638  * BIST Signature Register (AFBIST)
0639  */
0640 #define AF_BIST_SIGNAT  0x0553      /* Address Filter BIST Signature */
0641 
0642 /*
0643  * Supernet 3:
0644  * Personality Register (AFPERS)
0645  */
0646 #define FM_VALID    0x0001      /* CAM Entry Valid */
0647 #define FM_DA       0x0002      /* Destination Address */
0648 #define FM_DAX      0x0004      /* Destination Address Exact */
0649 #define FM_SA       0x0008      /* Source Address */
0650 #define FM_SAX      0x0010      /* Source Address Exact */
0651 #define FM_SKIP     0x0020      /* Skip this entry */
0652 
0653 /*
0654  * instruction set for command register 1 (NPADDR6-0 = 0x00)
0655  */
0656 #define FM_IRESET   0x01        /* software reset */
0657 #define FM_IRMEMWI  0x02        /* load Memory Data Reg., inc MARR */
0658 #define FM_IRMEMWO  0x03        /* load MDR from buffer memory, n.i. */
0659 #define FM_IIL      0x04        /* idle/listen */
0660 #define FM_ICL      0x05        /* claim/listen */
0661 #define FM_IBL      0x06        /* beacon/listen */
0662 #define FM_ILTVX    0x07        /* load TVX timer from TVX reg */
0663 #define FM_INRTM    0x08        /* nonrestricted token mode */
0664 #define FM_IENTM    0x09        /* enter nonrestricted token mode */
0665 #define FM_IERTM    0x0a        /* enter restricted token mode */
0666 #define FM_IRTM     0x0b        /* restricted token mode */
0667 #define FM_ISURT    0x0c        /* send unrestricted token */
0668 #define FM_ISRT     0x0d        /* send restricted token */
0669 #define FM_ISIM     0x0e        /* enter send-immediate mode */
0670 #define FM_IESIM    0x0f        /* exit send-immediate mode */
0671 #define FM_ICLLS    0x11        /* clear synchronous queue lock */
0672 #define FM_ICLLA0   0x12        /* clear asynchronous queue 0 lock */
0673 #define FM_ICLLA1   0x14        /* clear asynchronous queue 1 lock */
0674 #define FM_ICLLA2   0x18        /* clear asynchronous queue 2 lock */
0675                     /* SN3: reserved */
0676 #define FM_ICLLR    0x20        /* clear receive queue (SN3:1) lock */
0677 #define FM_ICLLR2   0x21        /* SN3: clear receive queue 2 lock */
0678 #define FM_ITRXBUS  0x22        /* SN3: Tristate X-Bus (SAS only) */
0679 #define FM_IDRXBUS  0x23        /* SN3: drive X-Bus */
0680 #define FM_ICLLAL   0x3f        /* clear all queue locks */
0681 
0682 /*
0683  * instruction set for command register 2 (NPADDR6-0 = 0x01)
0684  */
0685 #define FM_ITRS     0x01        /* transmit synchronous queue */
0686                     /* SN3: reserved */
0687 #define FM_ITRA0    0x02        /* transmit asynchronous queue 0 */
0688                     /* SN3: reserved */
0689 #define FM_ITRA1    0x04        /* transmit asynchronous queue 1 */
0690                     /* SN3: reserved */
0691 #define FM_ITRA2    0x08        /* transmit asynchronous queue 2 */
0692                     /* SN3: reserved */
0693 #define FM_IACTR    0x10        /* abort current transmit activity */
0694 #define FM_IRSTQ    0x20        /* reset transmit queues */
0695 #define FM_ISTTB    0x30        /* set tag bit */
0696 #define FM_IERSF    0x40        /* enable receive single frame */
0697                     /* SN3: reserved */
0698 #define FM_ITR      0x50        /* SN3: Transmit Command */
0699 
0700 
0701 /*
0702  *  defines for PLC (Am79C864)
0703  */
0704 
0705 /*
0706  *  PLC read/write (r/w) registers
0707  */
0708 #define PL_CNTRL_A  0x00        /* control register A (r/w) */
0709 #define PL_CNTRL_B  0x01        /* control register B (r/w) */
0710 #define PL_INTR_MASK    0x02        /* interrupt mask (r/w) */
0711 #define PL_XMIT_VECTOR  0x03        /* transmit vector register (r/w) */
0712 #define PL_VECTOR_LEN   0x04        /* transmit vector length (r/w) */
0713 #define PL_LE_THRESHOLD 0x05        /* link error event threshold (r/w) */
0714 #define PL_C_MIN    0x06        /* minimum connect state time (r/w) */
0715 #define PL_TL_MIN   0x07        /* min. line state transmit t. (r/w) */
0716 #define PL_TB_MIN   0x08        /* minimum break time (r/w) */
0717 #define PL_T_OUT    0x09        /* signal timeout (r/w) */
0718 #define PL_CNTRL_C  0x0a        /* control register C (r/w) */
0719 #define PL_LC_LENGTH    0x0b        /* link confidence test time (r/w) */
0720 #define PL_T_SCRUB  0x0c        /* scrub time = MAC TVX (r/w) */
0721 #define PL_NS_MAX   0x0d        /* max. noise time before break (r/w)*/
0722 #define PL_TPC_LOAD_V   0x0e        /* TPC timer load value (write only) */
0723 #define PL_TNE_LOAD_V   0x0f        /* TNE timer load value (write only) */
0724 #define PL_STATUS_A 0x10        /* status register A (read only) */
0725 #define PL_STATUS_B 0x11        /* status register B (read only) */
0726 #define PL_TPC      0x12        /* timer for PCM (ro) [20.48 us] */
0727 #define PL_TNE      0x13        /* time of noise event [0.32 us] */
0728 #define PL_CLK_DIV  0x14        /* TNE clock divider (read only) */
0729 #define PL_BIST_SIGNAT  0x15        /* built in self test signature (ro)*/
0730 #define PL_RCV_VECTOR   0x16        /* receive vector reg. (read only) */
0731 #define PL_INTR_EVENT   0x17        /* interrupt event reg. (read only) */
0732 #define PL_VIOL_SYM_CTR 0x18        /* violation symbol count. (read o) */
0733 #define PL_MIN_IDLE_CTR 0x19        /* minimum idle counter (read only) */
0734 #define PL_LINK_ERR_CTR 0x1a        /* link error event ctr.(read only) */
0735 #ifdef  MOT_ELM
0736 #define PL_T_FOT_ASS    0x1e        /* FOTOFF Assert Timer */
0737 #define PL_T_FOT_DEASS  0x1f        /* FOTOFF Deassert Timer */
0738 #endif  /* MOT_ELM */
0739 
0740 #ifdef  MOT_ELM
0741 /*
0742  * Special Quad-Elm Registers.
0743  * A Quad-ELM consists of for ELMs and these additional registers.
0744  */
0745 #define QELM_XBAR_W 0x80        /* Crossbar Control ELM W */
0746 #define QELM_XBAR_X 0x81        /* Crossbar Control ELM X */
0747 #define QELM_XBAR_Y 0x82        /* Crossbar Control ELM Y */
0748 #define QELM_XBAR_Z 0x83        /* Crossbar Control ELM Z */
0749 #define QELM_XBAR_P 0x84        /* Crossbar Control Bus P */
0750 #define QELM_XBAR_S 0x85        /* Crossbar Control Bus S */
0751 #define QELM_XBAR_R 0x86        /* Crossbar Control Bus R */
0752 #define QELM_WR_XBAR    0x87        /* Write the Crossbar now (write) */
0753 #define QELM_CTR_W  0x88        /* Counter W */
0754 #define QELM_CTR_X  0x89        /* Counter X */
0755 #define QELM_CTR_Y  0x8a        /* Counter Y */
0756 #define QELM_CTR_Z  0x8b        /* Counter Z */
0757 #define QELM_INT_MASK   0x8c        /* Interrupt mask register */
0758 #define QELM_INT_DATA   0x8d        /* Interrupt data (event) register */
0759 #define QELM_ELMB   0x00        /* Elm base */
0760 #define QELM_ELM_SIZE   0x20        /* ELM size */
0761 #endif  /* MOT_ELM */
0762 /*
0763  * PLC control register A (PL_CNTRL_A: log. addr. 0x00)
0764  * It is used for timer configuration, specification of PCM MAINT state option,
0765  * counter interrupt frequency, PLC data path config. and Built In Self Test.
0766  */
0767 #define PL_RUN_BIST 0x0001      /* begin running its Built In Self T.*/
0768 #define PL_RF_DISABLE   0x0002      /* disable the Repeat Filter state m.*/
0769 #define PL_SC_REM_LOOP  0x0004      /* remote loopback path */
0770 #define PL_SC_BYPASS    0x0008      /* by providing a physical bypass */
0771 #define PL_LM_LOC_LOOP  0x0010      /* loop path just after elastic buff.*/
0772 #define PL_EB_LOC_LOOP  0x0020      /* loop path just prior to PDT/PDR IF*/
0773 #define PL_FOT_OFF  0x0040      /* assertion of /FOTOFF pin of PLC */
0774 #define PL_LOOPBACK 0x0080      /* it cause the /LPBCK pin ass. low */
0775 #define PL_MINI_CTR_INT 0x0100      /* partially contr. when bit is ass. */
0776 #define PL_VSYM_CTR_INT 0x0200      /* controls when int bit is asserted */
0777 #define PL_ENA_PAR_CHK  0x0400      /* enable parity check */
0778 #define PL_REQ_SCRUB    0x0800      /* limited access to scrub capability*/
0779 #define PL_TPC_16BIT    0x1000      /* causes the TPC as a 16 bit timer */
0780 #define PL_TNE_16BIT    0x2000      /* causes the TNE as a 16 bit timer */
0781 #define PL_NOISE_TIMER  0x4000      /* allows the noise timing function */
0782 
0783 /*
0784  * PLC control register B (PL_CNTRL_B: log. addr. 0x01)
0785  * It contains signals and requeste to direct the process of PCM and it is also
0786  * used to control the Line State Match interrupt.
0787  */
0788 #define PL_PCM_CNTRL    0x0003      /* control PCM state machine */
0789 #define PL_PCM_NAF  (0)     /* state is not affected */
0790 #define PL_PCM_START    (1)     /* goes to the BREAK state */
0791 #define PL_PCM_TRACE    (2)     /* goes to the TRACE state */
0792 #define PL_PCM_STOP (3)     /* goes to the OFF state */
0793 
0794 #define PL_MAINT    0x0004      /* if OFF state --> MAINT state */
0795 #define PL_LONG     0x0008      /* perf. a long Link Confid.Test(LCT)*/
0796 #define PL_PC_JOIN  0x0010      /* if NEXT state --> JOIN state */
0797 
0798 #define PL_PC_LOOP  0x0060      /* loopback used in the LCT */
0799 #define PL_NOLCT    (0<<5)      /* no LCT is performed */
0800 #define PL_TPDR     (1<<5)      /* PCM asserts transmit PDR */
0801 #define PL_TIDLE    (2<<5)      /* PCM asserts transmit idle */
0802 #define PL_RLBP     (3<<5)      /* trans. PDR & remote loopb. path */
0803 
0804 #define PL_CLASS_S  0x0080      /* signif. that single att. station */
0805 
0806 #define PL_MAINT_LS 0x0700      /* line state while in the MAINT st. */
0807 #define PL_M_QUI0   (0<<8)      /* transmit QUIET line state */
0808 #define PL_M_IDLE   (1<<8)      /* transmit IDLE line state */
0809 #define PL_M_HALT   (2<<8)      /* transmit HALT line state */
0810 #define PL_M_MASTR  (3<<8)      /* transmit MASTER line state */
0811 #define PL_M_QUI1   (4<<8)      /* transmit QUIET line state */
0812 #define PL_M_QUI2   (5<<8)      /* transmit QUIET line state */
0813 #define PL_M_TPDR   (6<<8)      /* tr. PHY_DATA requ.-symbol is tr.ed*/
0814 #define PL_M_QUI3   (7<<8)      /* transmit QUIET line state */
0815 
0816 #define PL_MATCH_LS 0x7800      /* line state to be comp. with curr.*/
0817 #define PL_I_ANY    (0<<11)     /* Int. on any change in *_LINE_ST */
0818 #define PL_I_IDLE   (1<<11)     /* Interrupt on IDLE line state */
0819 #define PL_I_HALT   (2<<11)     /* Interrupt on HALT line state */
0820 #define PL_I_MASTR  (4<<11)     /* Interrupt on MASTER line state */
0821 #define PL_I_QUIET  (8<<11)     /* Interrupt on QUIET line state */
0822 
0823 #define PL_CONFIG_CNTRL 0x8000      /* control over scrub, byp. & loopb.*/
0824 
0825 /*
0826  * PLC control register C (PL_CNTRL_C: log. addr. 0x0a)
0827  * It contains the scrambling control registers (PLC-S only)
0828  */
0829 #define PL_C_CIPHER_ENABLE  (1<<0)  /* enable scrambler */
0830 #define PL_C_CIPHER_LPBCK   (1<<1)  /* loopback scrambler */
0831 #define PL_C_SDOFF_ENABLE   (1<<6)  /* enable SDOFF timer */
0832 #define PL_C_SDON_ENABLE    (1<<7)  /* enable SDON timer */
0833 #ifdef  MOT_ELM
0834 #define PL_C_FOTOFF_CTRL    (3<<2)  /* FOTOFF timer control */
0835 #define PL_C_FOTOFF_TIM     (0<<2)  /* FOTOFF use timer for (de)-assert */
0836 #define PL_C_FOTOFF_INA     (2<<2)  /* FOTOFF forced inactive */
0837 #define PL_C_FOTOFF_ACT     (3<<2)  /* FOTOFF forced active */
0838 #define PL_C_FOTOFF_SRCE    (1<<4)  /* FOTOFF source is PCM state != OFF */
0839 #define PL_C_RXDATA_EN      (1<<5)  /* Rec scr data forced to 0 */
0840 #define PL_C_SDNRZEN        (1<<8)  /* Monitor rec descr. data for act */
0841 #else   /* nMOT_ELM */
0842 #define PL_C_FOTOFF_CTRL    (3<<8)  /* FOTOFF timer control */
0843 #define PL_C_FOTOFF_0       (0<<8)  /* timer off */
0844 #define PL_C_FOTOFF_30      (1<<8)  /* 30uS */
0845 #define PL_C_FOTOFF_50      (2<<8)  /* 50uS */
0846 #define PL_C_FOTOFF_NEVER   (3<<8)  /* never */
0847 #define PL_C_SDON_TIMER     (3<<10) /* SDON timer control */
0848 #define PL_C_SDON_084       (0<<10) /* 0.84 uS */
0849 #define PL_C_SDON_132       (1<<10) /* 1.32 uS */
0850 #define PL_C_SDON_252       (2<<10) /* 2.52 uS */
0851 #define PL_C_SDON_512       (3<<10) /* 5.12 uS */
0852 #define PL_C_SOFF_TIMER     (3<<12) /* SDOFF timer control */
0853 #define PL_C_SOFF_076       (0<<12) /* 0.76 uS */
0854 #define PL_C_SOFF_132       (1<<12) /* 1.32 uS */
0855 #define PL_C_SOFF_252       (2<<12) /* 2.52 uS */
0856 #define PL_C_SOFF_512       (3<<12) /* 5.12 uS */
0857 #define PL_C_TSEL       (3<<14) /* scrambler path select */
0858 #endif  /* nMOT_ELM */
0859 
0860 /*
0861  * PLC status register A (PL_STATUS_A: log. addr. 0x10)
0862  * It is used to report status information to the Node Processor about the 
0863  * Line State Machine (LSM).
0864  */
0865 #ifdef  MOT_ELM
0866 #define PLC_INT_MASK    0xc000      /* ELM integration bits in status A */
0867 #define PLC_INT_C   0x0000      /* ELM Revision Band C */
0868 #define PLC_INT_CAMEL   0x4000      /* ELM integrated into CAMEL */
0869 #define PLC_INT_QE  0x8000      /* ELM integrated into Quad ELM */
0870 #define PLC_REV_MASK    0x3800      /* revision bits in status A */
0871 #define PLC_REVISION_B  0x0000      /* rev bits for ELM Rev B */
0872 #define PLC_REVISION_QA 0x0800      /* rev bits for ELM core in QELM-A */
0873 #else   /* nMOT_ELM */
0874 #define PLC_REV_MASK    0xf800      /* revision bits in status A */
0875 #define PLC_REVISION_A  0x0000      /* revision bits for PLC */
0876 #define PLC_REVISION_S  0xf800      /* revision bits for PLC-S */
0877 #define PLC_REV_SN3 0x7800      /* revision bits for PLC-S in IFCP */
0878 #endif  /* nMOT_ELM */
0879 #define PL_SYM_PR_CTR   0x0007      /* contains the LSM symbol pair Ctr. */
0880 #define PL_UNKN_LINE_ST 0x0008      /* unknown line state bit from LSM */
0881 #define PL_LSM_STATE    0x0010      /* state bit of LSM */
0882 
0883 #define PL_LINE_ST  0x00e0      /* contains recogn. line state of LSM*/
0884 #define PL_L_NLS    (0<<5)      /* noise line state */
0885 #define PL_L_ALS    (1<<5)      /* activ line state */
0886 #define PL_L_UND    (2<<5)      /* undefined */
0887 #define PL_L_ILS4   (3<<5)      /* idle l. s. (after 4 idle symbols) */
0888 #define PL_L_QLS    (4<<5)      /* quiet line state */
0889 #define PL_L_MLS    (5<<5)      /* master line state */
0890 #define PL_L_HLS    (6<<5)      /* halt line state */
0891 #define PL_L_ILS16  (7<<5)      /* idle line state (after 16 idle s.)*/
0892 
0893 #define PL_PREV_LINE_ST 0x0300      /* value of previous line state */
0894 #define PL_P_QLS    (0<<8)      /* quiet line state */
0895 #define PL_P_MLS    (1<<8)      /* master line state */
0896 #define PL_P_HLS    (2<<8)      /* halt line state */
0897 #define PL_P_ILS16  (3<<8)      /* idle line state (after 16 idle s.)*/
0898 
0899 #define PL_SIGNAL_DET   0x0400      /* 1=that signal detect is deasserted*/
0900 
0901 
0902 /*
0903  * PLC status register B (PL_STATUS_B: log. addr. 0x11)
0904  * It contains signals and status from the repeat filter and PCM state machine.
0905  */
0906 #define PL_BREAK_REASON 0x0007      /* reason for PCM state mach.s to br.*/
0907 #define PL_B_NOT    (0)     /* PCM SM has not gone to BREAK state*/
0908 #define PL_B_PCS    (1)     /* PC_Start issued */
0909 #define PL_B_TPC    (2)     /* TPC timer expired after T_OUT */
0910 #define PL_B_TNE    (3)     /* TNE timer expired after NS_MAX */
0911 #define PL_B_QLS    (4)     /* quit line state detected */
0912 #define PL_B_ILS    (5)     /* idle line state detected */
0913 #define PL_B_HLS    (6)     /* halt line state detected */
0914 
0915 #define PL_TCF      0x0008      /* transmit code flag (start exec.) */
0916 #define PL_RCF      0x0010      /* receive code flag (start exec.) */
0917 #define PL_LSF      0x0020      /* line state flag (l.s. has been r.)*/
0918 #define PL_PCM_SIGNAL   0x0040      /* indic. that XMIT_VECTOR hb.written*/
0919 
0920 #define PL_PCM_STATE    0x0780      /* state bits of PCM state machine */
0921 #define PL_PC0      (0<<7)      /* OFF     - when /RST or PCM_CNTRL */
0922 #define PL_PC1      (1<<7)      /* BREAK   - entry point in start PCM*/
0923 #define PL_PC2      (2<<7)      /* TRACE   - to localize stuck Beacon*/
0924 #define PL_PC3      (3<<7)      /* CONNECT - synchronize ends of conn*/
0925 #define PL_PC4      (4<<7)      /* NEXT    - to separate the signalng*/
0926 #define PL_PC5      (5<<7)      /* SIGNAL  - PCM trans/rec. bit infos*/
0927 #define PL_PC6      (6<<7)      /* JOIN    - 1. state to activ conn. */
0928 #define PL_PC7      (7<<7)      /* VERIFY  - 2. - " - (3. ACTIVE) */
0929 #define PL_PC8      (8<<7)      /* ACTIVE  - PHY has been incorporated*/
0930 #define PL_PC9      (9<<7)      /* MAINT   - for test purposes or so 
0931                        that PCM op. completely in softw. */
0932 
0933 #define PL_PCI_SCRUB    0x0800      /* scrubbing function is being exec. */
0934 
0935 #define PL_PCI_STATE    0x3000      /* Physical Connect. Insertion SM */
0936 #define PL_CI_REMV  (0<<12)     /* REMOVED */
0937 #define PL_CI_ISCR  (1<<12)     /* INSERT_SCRUB */
0938 #define PL_CI_RSCR  (2<<12)     /* REMOVE_SCRUB */
0939 #define PL_CI_INS   (3<<12)     /* INSERTED */
0940 
0941 #define PL_RF_STATE 0xc000      /* state bit of repeate filter SM */
0942 #define PL_RF_REPT  (0<<14)     /* REPEAT */
0943 #define PL_RF_IDLE  (1<<14)     /* IDLE */
0944 #define PL_RF_HALT1 (2<<14)     /* HALT1 */
0945 #define PL_RF_HALT2 (3<<14)     /* HALT2 */
0946 
0947 
0948 /*
0949  * PLC interrupt event register (PL_INTR_EVENT: log. addr. 0x17)
0950  * It is read only and is clearde whenever it is read!
0951  * It is used by the PLC to report events to the node processor.
0952  */
0953 #define PL_PARITY_ERR   0x0001      /* p. error h.b.detected on TX9-0 inp*/
0954 #define PL_LS_MATCH 0x0002      /* l.s.== l.s. PLC_CNTRL_B's MATCH_LS*/
0955 #define PL_PCM_CODE 0x0004      /* transmit&receive | LCT complete */
0956 #define PL_TRACE_PROP   0x0008      /* master l.s. while PCM ACTIV|TRACE */
0957 #define PL_SELF_TEST    0x0010      /* QUIET|HALT while PCM in TRACE st. */
0958 #define PL_PCM_BREAK    0x0020      /* PCM has entered the BREAK state */
0959 #define PL_PCM_ENABLED  0x0040      /* asserted SC_JOIN, scrub. & ACTIV */
0960 #define PL_TPC_EXPIRED  0x0080      /* TPC timer reached zero */
0961 #define PL_TNE_EXPIRED  0x0100      /* TNE timer reached zero */
0962 #define PL_EBUF_ERR 0x0200      /* elastic buff. det. over-|underflow*/
0963 #define PL_PHYINV   0x0400      /* physical layer invalid signal */
0964 #define PL_VSYM_CTR 0x0800      /* violation symbol counter has incr.*/
0965 #define PL_MINI_CTR 0x1000      /* dep. on PLC_CNTRL_A's MINI_CTR_INT*/
0966 #define PL_LE_CTR   0x2000      /* link error event counter */
0967 #define PL_LSDO     0x4000      /* SDO input pin changed to a 1 */
0968 #define PL_NP_ERR   0x8000      /* NP has requested to r/w an inv. r.*/
0969 
0970 /*
0971  * The PLC interrupt mask register (PL_INTR_MASK: log. addr. 0x02) constr. is
0972  * equal PL_INTR_EVENT register.
0973  * For each set bit, the setting of corresponding bit generate an int to NP. 
0974  */
0975 
0976 #ifdef  MOT_ELM
0977 /*
0978  * Quad ELM Crosbar Control register values (QELM_XBAR_?)
0979  */
0980 #define QELM_XOUT_IDLE  0x0000      /* Idles/Passthrough */
0981 #define QELM_XOUT_P 0x0001      /* Output to: Bus P */
0982 #define QELM_XOUT_S 0x0002      /* Output to: Bus S */
0983 #define QELM_XOUT_R 0x0003      /* Output to: Bus R */
0984 #define QELM_XOUT_W 0x0004      /* Output to: ELM W */
0985 #define QELM_XOUT_X 0x0005      /* Output to: ELM X */
0986 #define QELM_XOUT_Y 0x0006      /* Output to: ELM Y */
0987 #define QELM_XOUT_Z 0x0007      /* Output to: ELM Z */
0988 
0989 /*
0990  * Quad ELM Interrupt data and event registers.
0991  */
0992 #define QELM_NP_ERR (1<<15)     /* Node Processor Error */
0993 #define QELM_COUNT_Z    (1<<7)      /* Counter Z Interrupt */
0994 #define QELM_COUNT_Y    (1<<6)      /* Counter Y Interrupt */
0995 #define QELM_COUNT_X    (1<<5)      /* Counter X Interrupt */
0996 #define QELM_COUNT_W    (1<<4)      /* Counter W Interrupt */
0997 #define QELM_ELM_Z  (1<<3)      /* ELM Z Interrupt */
0998 #define QELM_ELM_Y  (1<<2)      /* ELM Y Interrupt */
0999 #define QELM_ELM_X  (1<<1)      /* ELM X Interrupt */
1000 #define QELM_ELM_W  (1<<0)      /* ELM W Interrupt */
1001 #endif  /* MOT_ELM */
1002 /*
1003  * PLC Timing Parameters
1004  */
1005 #define TP_C_MIN    0xff9c  /*   2    ms */
1006 #define TP_TL_MIN   0xfff0  /*   0.3  ms */
1007 #define TP_TB_MIN   0xff10  /*   5    ms */
1008 #define TP_T_OUT    0xd9db  /* 200    ms */
1009 #define TP_LC_LENGTH    0xf676  /*  50    ms */
1010 #define TP_LC_LONGLN    0xa0a2  /* 500    ms */
1011 #define TP_T_SCRUB  0xff6d  /*   3.5  ms */
1012 #define TP_NS_MAX   0xf021  /*   1.3   ms */
1013 
1014 /*
1015  * BIST values
1016  */
1017 #define PLC_BIST    0x6ecd      /* BIST signature for PLC */
1018 #define PLCS_BIST   0x5b6b      /* BIST signature for PLC-S */
1019 #define PLC_ELM_B_BIST  0x6ecd      /* BIST signature of ELM Rev. B */
1020 #define PLC_ELM_D_BIST  0x5b6b      /* BIST signature of ELM Rev. D */
1021 #define PLC_CAM_A_BIST  0x9e75      /* BIST signature of CAMEL Rev. A */
1022 #define PLC_CAM_B_BIST  0x5b6b      /* BIST signature of CAMEL Rev. B */
1023 #define PLC_IFD_A_BIST  0x9e75      /* BIST signature of IFDDI Rev. A */
1024 #define PLC_IFD_B_BIST  0x5b6b      /* BIST signature of IFDDI Rev. B */
1025 #define PLC_QELM_A_BIST 0x5b6b      /* BIST signature of QELM Rev. A */
1026 
1027 /*
1028     FDDI board recources
1029  */
1030 
1031 /*
1032  * request register array (log. addr: RQA_A + a<<1 {a=0..7}) write only.
1033  * It specifies to FORMAC+ the type of buffer memory access the host requires.
1034  */
1035 #define RQ_NOT      0       /* not request */
1036 #define RQ_RES      1       /* reserved */
1037 #define RQ_SFW      2       /* special frame write */
1038 #define RQ_RRQ      3       /* read request: receive queue */
1039 #define RQ_WSQ      4       /* write request: synchronous queue */
1040 #define RQ_WA0      5       /* write requ.: asynchronous queue 0 */
1041 #define RQ_WA1      6       /* write requ.: asynchronous queue 1 */
1042 #define RQ_WA2      7       /* write requ.: asynchronous queue 2 */
1043 
1044 #define SZ_LONG     (sizeof(long))
1045 
1046 /*
1047  * FDDI defaults
1048  * NOTE : In the ANSI docs, times are specified in units of "symbol time".
1049  *    AMD chips use BCLK as unit. 1 BCKL == 2 symbols
1050  */
1051 #define COMPLREF    ((u_long)32*256*256)    /* two's complement 21 bit */
1052 #define MSTOBCLK(x) ((u_long)(x)*12500L)
1053 #define MSTOTVX(x)  (((u_long)(x)*1000L)/80/255)
1054 
1055 #endif  /* _SUPERNET_ */