Ignore:
Timestamp:
Jun 12, 2000, 3:00:15 PM (20 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
edeed26
Parents:
0ab65474
Message:

Merged from 4.5.0-beta3a

File:
1 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/m68k/mvme167/network/uti596.h

    r0ab65474 rdf49c60  
    44/*
    55 * EII: March 11: Created v. 0.0
    6  *      Jan 12/98 Added STAT bits, s11-=s5 and max_colls.
    76 *
    87 *  $Id$
     
    5655};
    5756
    58 #define UTI596_MUTEX   1
    59 
    60 
    6157#define CMD_EOL                                         0x8000          /* The last command of the list, stop. */
    6258#define CMD_SUSP                                        0x4000          /* Suspend after doing cmd.                                      */
    6359#define CMD_INTR                                        0x2000          /* Interrupt after doing cmd.                            */
    6460
    65 #define CMD_FLEX                                        0x0008          /* Enable flexible memory model */
     61#define CMD_FLEX                                        0x0008          /* Enable flexible memory model   */
    6662
    6763#define SCB_STAT_CX             0x8000          /* Cmd completes with 'I' bit set */
     
    7268#define SCB_CUS_SUSPENDED 0x0100
    7369#define SCB_CUS_ACTIVE    0x0200
    74 
    7570
    7671#define STAT_C                                          0x8000          /* Set to 1 after execution              */
     
    8883#define STAT_MAX_COLLS          0x000F
    8984
    90 
    91 
    9285#define RBD_STAT_P              0x4000          /* prefetch */
    9386#define RBD_STAT_F              0x4000          /* used */
     
    10699#define RU_READY                0x0040
    107100
    108 
    109 #define IO_ADDR                 0x360
    110 #define PORT_ADDR               IO_ADDR
    111 #define CHAN_ATTN               PORT_ADDR + 4
    112 #define NIC_ADDR                PORT_ADDR + 8
    113 
    114101#define I596_NULL ( ( void * ) 0xffffffff)
    115102#define UTI_596_END_OF_FRAME 0x8000
    116 #define SIZE_MASK       0x3fff
    117 
    118 struct i596_tbd;
     103
     104
     105struct i596_tbd;  /* necessary forward declaration */
    119106
    120107enum commands {
     
    129116};
    130117
     118/*
     119 * 82596 Dump Command Result
     120 */
     121typedef volatile struct i596_dump_result {
     122  unsigned char bf;
     123  unsigned char config_bytes[11];
     124  unsigned char reserved1[2];
     125  unsigned char ia_bytes[6];
     126  unsigned short last_tx_status;
     127  unsigned short tx_crc_byte01;
     128  unsigned short tx_crc_byte23;
     129  unsigned short rx_crc_byte01;
     130  unsigned short rx_crc_byte23; 
     131  unsigned short rx_temp_mem01;
     132  unsigned short rx_temp_mem23;
     133  unsigned short rx_temp_mem45;
     134  unsigned short last_rx_status;
     135  unsigned short hash_reg01;
     136  unsigned short hash_reg23;
     137  unsigned short hash_reg45;
     138  unsigned short hash_reg67;
     139  unsigned short slot_time_counter;
     140  unsigned short wait_time_counter;
     141  unsigned short rx_frame_length;
     142  unsigned long reserved2;
     143  unsigned long cb_in3;
     144  unsigned long cb_in2;
     145  unsigned long cb_in1;
     146  unsigned long la_cb_addr;
     147  unsigned long rdb_pointer;
     148  unsigned long int_memory;
     149  unsigned long rfd_size;
     150  unsigned long tbd_pointer;
     151  unsigned long base_addr;
     152  unsigned long ru_temp_reg;
     153  unsigned long tcb_count;
     154  unsigned long next_rb_size;
     155  unsigned long next_rb_addr;
     156  unsigned long curr_rb_size;
     157  unsigned long la_rbd_addr;
     158  unsigned long next_rbd_addr;
     159  unsigned long curr_rbd_addr;
     160  unsigned long curr_rb_count;
     161  unsigned long next_fd_addr;
     162  unsigned long curr_fd_add;
     163  unsigned long temp_cu_reg;
     164  unsigned long next_tb_count;
     165  unsigned long buffer_addr;
     166  unsigned long la_tbd_addr;
     167  unsigned long next_tbd_addr;
     168  unsigned long cb_command;
     169  unsigned long next_cb_addr;
     170  unsigned long curr_cb_addr;
     171  unsigned long scb_cmd_word;
     172  unsigned long scb_pointer;
     173  unsigned long cb_stat_word;
     174  unsigned long mm_lfsr;
     175  unsigned char micro_machine_bit_array[28];
     176  unsigned char cu_port[16];
     177  unsigned long mm_alu;
     178  unsigned long reserved3;
     179  unsigned long mm_temp_a_rr;
     180  unsigned long mm_temp_a;
     181  unsigned long tx_dma_b_cnt;
     182  unsigned long mm_input_port_addr_reg;
     183  unsigned long tx_dma_addr;
     184  unsigned long mm_port_reg1;
     185  unsigned long rx_dma_b_cnt;
     186  unsigned long mm_port_reg2;
     187  unsigned long rx_dma_addr;
     188  unsigned long reserved4;
     189  unsigned long bus_t_timers;
     190  unsigned long diu_cntrl_reg;
     191  unsigned long reserved5;
     192  unsigned long sysbus;
     193  unsigned long biu_cntrl_reg;
     194  unsigned long mm_disp_reg;
     195  unsigned long mm_status_reg;
     196  unsigned short dump_status;
     197} i596_dump_result;
     198
     199typedef volatile struct i596_selftest {
     200  unsigned long rom_signature;
     201  unsigned long results;
     202} i596_selftest;
     203
    131204/*
    132205 * Action commands
    133206 *   (big endian, linear mode)
    134  */
     207 */ 
    135208typedef volatile struct i596_cmd {
    136   volatile unsigned short status;
    137   volatile unsigned short command;
    138   volatile struct i596_cmd *next;
     209  unsigned short status;
     210  unsigned short command;
     211  struct i596_cmd *next;
    139212} i596_cmd;
    140213
     
    145218typedef volatile struct i596_set_add {
    146219  i596_cmd cmd;
    147   char   data[8];
     220  char data[8];
    148221} i596_set_add;
    149222
    150223typedef volatile struct i596_configure {
    151224  i596_cmd cmd;
    152   char   data[16];
     225  char data[16];
    153226} i596_configure;
    154227
    155228typedef volatile struct i596_tx {
    156     i596_cmd cmd;
    157     volatile struct i596_tbd *pTbd;
    158     unsigned short count;
    159     unsigned short pad;
    160     char data[6];
    161     unsigned short length;
     229  i596_cmd cmd;
     230  struct i596_tbd *pTbd;
     231  unsigned short count;
     232  unsigned short pad;
     233  char data[6];
     234  unsigned short length;
    162235} i596_tx;
    163236
     
    169242typedef volatile struct i596_dump {
    170243  i596_cmd cmd;
    171   char   *pData;
     244  char *pData;
    172245} i596_dump;
    173246
     
    176249 */
    177250typedef volatile struct i596_tbd {
    178     unsigned short size;
    179     unsigned short pad;
    180     volatile struct i596_tbd *next;
    181     char *data;
     251          unsigned short size;
     252          unsigned short pad;
     253          struct i596_tbd *next;
     254          char *data;
    182255} i596_tbd;
    183256
     
    187260 */
    188261typedef volatile struct i596_rbd {
    189     unsigned short count;
    190     unsigned short offset;
    191     volatile struct i596_rbd *next;
    192     char *data;
    193     unsigned short size;
    194     unsigned short pad;
     262          unsigned short count;
     263          unsigned short offset;
     264          struct i596_rbd *next;
     265          char *data;
     266          unsigned short size;
     267          unsigned short pad;
    195268} i596_rbd;
    196269
     
    199272 */
    200273typedef volatile struct i596_rfd {
    201     volatile unsigned short stat;
    202     volatile unsigned short cmd;
    203     volatile struct i596_rfd *next;
    204     i596_rbd *pRbd;
    205     unsigned short count;
    206     unsigned short size;
    207     char data [1532];   
     274          unsigned short stat;
     275          unsigned short cmd;
     276          struct i596_rfd *next;
     277          i596_rbd *pRbd;
     278          unsigned short count;
     279          unsigned short size;
     280          char data [1532];   
    208281} i596_rfd;
    209282
    210 #define RX_RING_SIZE 8
    211 
    212283/*
    213284 * System Control Block
    214285 */
    215286typedef volatile struct i596_scb {
    216     volatile unsigned short status;
    217     volatile unsigned short command;
    218     volatile unsigned long Cmd_val;
    219     volatile unsigned long Rfd_val;
    220     volatile unsigned long crc_err;
    221     volatile unsigned long align_err;
    222     volatile unsigned long resource_err;
    223     volatile unsigned long over_err;
    224     volatile unsigned long rcvdt_err;
    225     volatile unsigned long short_err;
    226     volatile unsigned short t_off;
    227     volatile unsigned short t_on;
    228     i596_cmd *pCmd;
    229     i596_rfd *pRfd;
     287          unsigned short status;
     288          unsigned short command;
     289          unsigned long cmd_pointer;
     290          unsigned long rfd_pointer;
     291          unsigned long crc_err;
     292          unsigned long align_err;
     293          unsigned long resource_err;
     294          unsigned long over_err;
     295          unsigned long rcvdt_err;
     296          unsigned long short_err;
     297          unsigned short t_off;
     298          unsigned short t_on;
     299          i596_cmd *pCmd;
     300          i596_rfd *pRfd;
    230301} i596_scb;
    231302
     
    234305 */
    235306typedef volatile struct i596_iscp {
    236     volatile unsigned long stat;
    237     volatile unsigned long scb_val;
    238     i596_scb *scb;
     307    unsigned8 null1;                                    /* Always zero */
     308    unsigned8 busy;                                                                             /* Busy byte */
     309    unsigned short scb_offset;                          /* Not used in linear mode */
     310    unsigned long scb_pointer;          /* Swapped pointer to scb */
     311    i596_scb *scb;                                                                              /* Real pointer to scb */
    239312} i596_iscp;
    240313
     
    243316 */
    244317typedef volatile struct i596_scp {
    245     unsigned long sysbus;
    246     unsigned long pad;
    247     unsigned long iscp_val;
    248     i596_iscp *iscp;
     318    unsigned long sysbus;                                                       /* Only low 8 bits are used */
     319    unsigned long pad;                                                          /* Must be zero */
     320    unsigned long iscp_pointer;       /* Swapped pointer to iscp */
     321    i596_iscp *iscp;                                                                    /* Real pointer to iscp */
    249322} i596_scp;
    250323
     324/*
     325 * Device Dependent Data Structure
     326 */
    251327typedef volatile struct uti596_softc {
    252   struct arpcom          arpcom;
    253   i596_scp              *pScp;
    254   i596_iscp              iscp;
    255   i596_scb               scb;
    256   i596_set_add           set_add;
    257   i596_configure         set_conf;
    258   i596_tdr               tdr;
    259   i596_nop               nop;               
    260   unsigned long          stat;
    261   i596_tx               *pTxCmd;
    262   i596_tbd              *pTbd;
    263 
    264   int                   ioAddr;
    265 
    266   i596_rfd     *pBeginRFA;
    267   i596_rfd     *pEndRFA;
    268   i596_rfd     *pLastUnkRFD;
    269   i596_rbd     *pLastUnkRBD;
    270   i596_rfd     *pEndSavedQueue;
    271   i596_cmd     *pCmdHead;
    272   i596_cmd     *pCmdTail;  /* unneeded, as chaining not used, but implemented */
    273 
    274   rtems_id              rxDaemonTid;
    275   rtems_id              txDaemonTid;
    276   rtems_id              resetDaemonTid;
     328  struct arpcom arpcom;
     329  i596_scp *pScp;                                                                                       /* Block aligned on 16 byte boundary */
     330  i596_scp *base_scp;                 /* Unaligned block. Need for free() */
     331  i596_iscp iscp;
     332  i596_scb scb;
     333  i596_set_add set_add;
     334  i596_configure set_conf;
     335  i596_tdr tdr;
     336  i596_nop nop;               
     337  i596_tx  *pTxCmd;
     338  i596_tbd *pTbd;
     339
     340  i596_rfd *pBeginRFA;
     341  i596_rfd *pEndRFA;
     342  i596_rfd *pLastUnkRFD;
     343  i596_rbd *pLastUnkRBD;
     344  i596_rfd *pEndSavedQueue;
     345  i596_cmd *pCmdHead;
     346  i596_cmd *pCmdTail;                           /* unneeded, as chaining not used, but implemented */
     347
     348  rtems_id rxDaemonTid;
     349  rtems_id txDaemonTid;
     350  rtems_id resetDaemonTid;
    277351
    278352  struct enet_statistics stats;
    279   int                  started;
    280   unsigned long        rxInterrupts;
    281   unsigned long        txInterrupts;
    282   volatile int         cmdOk;
    283   int                  resetDone;
    284   unsigned long        txRawWait;
    285   i596_rfd            *pInboundFrameQueue;
    286   short int            rxBdCount;
    287   short int            txBdCount;
    288   short int            countRFD;
    289   short int            savedCount;
    290   i596_rfd            *pSavedRfdQueue;
    291   rtems_name           semaphore_name;
    292   rtems_id             semaphore_id;
    293   char                 zeroes[64];
    294   unsigned long        rawsndcnt;
    295   int                  nic_reset; /* flag is for requesting that ISR issue a reset quest */
     353  int started;
     354  unsigned long rxInterrupts;
     355  unsigned long txInterrupts;
     356  volatile int cmdOk;
     357  unsigned short * pCurrent_command_status;
     358  int resetDone;
     359  unsigned long txRawWait;
     360  i596_rfd *pInboundFrameQueue;
     361  short int rxBdCount;
     362  short int txBdCount;
     363  short int countRFD;
     364  short int savedCount;
     365  i596_rfd *pSavedRfdQueue;
     366  rtems_name semaphore_name;
     367  rtems_id semaphore_id;
     368  char zeroes[64];
     369  unsigned long rawsndcnt;
     370  int nic_reset;  /* flag for requesting that ISR issue a reset quest */
    296371} uti596_softc_;
    297372
Note: See TracChangeset for help on using the changeset viewer.