[BACK]Return to if_ie.h CVS log [TXT][DIR] Up to [local] / sys / arch / mvme68k / dev

Annotation of sys/arch/mvme68k/dev/if_ie.h, Revision 1.1.1.1

1.1       nbrk        1: /*     $OpenBSD: if_ie.h,v 1.5 2003/06/02 05:09:14 deraadt Exp $ */
                      2:
                      3: /* Copyright (c) 1998 Steve Murphree, Jr.
                      4:  * Copyright (c) 1995 Theo de Raadt
                      5:  * All rights reserved.
                      6:  *
                      7:  * Redistribution and use in source and binary forms, with or without
                      8:  * modification, are permitted provided that the following conditions
                      9:  * are met:
                     10:  * 1. Redistributions of source code must retain the above copyright
                     11:  *    notice, this list of conditions and the following disclaimer.
                     12:  * 2. Redistributions in binary form must reproduce the above copyright
                     13:  *    notice, this list of conditions and the following disclaimer in the
                     14:  *    documentation and/or other materials provided with the distribution.
                     15:  *
                     16:  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
                     17:  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
                     18:  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
                     19:  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
                     20:  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
                     21:  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
                     22:  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
                     23:  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
                     24:  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
                     25:  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
                     26:  */
                     27:
                     28: /*
                     29:  * XXX where else is this from?
                     30:  * if_sunie.h
                     31:  *
                     32:  * sun's ie interface
                     33:  */
                     34:
                     35: /*
                     36:  * programming notes:
                     37:  *
                     38:  * the ie chip operates in a 24 bit address space.
                     39:  *
                     40:  * most ie interfaces appear to be divided into two parts:
                     41:  *      - generic 586 stuff
                     42:  *      - board specific
                     43:  *
                     44:  * generic:
                     45:  *     the generic stuff of the ie chip is all done with data structures
                     46:  *     that live in the chip's memory address space.   the chip expects
                     47:  *     its main data structure (the sys conf ptr -- SCP) to be at a
                     48:  *     address loaded into the chip at init.
                     49:  *
                     50:  *      the SCP points to another structure called the ISCP.
                     51:  *      the ISCP points to another structure called the SCB.
                     52:  *     the SCB has a status field, a linked list of "commands", and
                     53:  *     a linked list of "receive buffers".   these are data structures that
                     54:  *     live in memory, not registers.
                     55:  *
                     56:  * board:
                     57:  *     to get the chip to do anything, you first put a command in the
                     58:  *     command data structure list.   then you have to signal "attention"
                     59:  *     to the chip to get it to look at the command.   how you
                     60:  *     signal attention depends on what board you have... on PC's
                     61:  *     there is an i/o port number to do this, on sun's there is a
                     62:  *     register bit you toggle.
                     63:  *
                     64:  *     to get data from the chip you program it to interrupt...
                     65:  *
                     66:  *     the VME boards lives in vme16 space.   only 16 and 8 bit accesses
                     67:  *     are allowed, so functions that copy data must be aware of this.
                     68:  *
                     69:  *     the chip is an intel chip.  this means that the byte order
                     70:  *     on all the "short"s in the chip's data structures is wrong.
                     71:  *     so, constants described in the intel docs are swapped for the sun.
                     72:  *     that means that any buffer pointers you give the chip must be
                     73:  *     swapped to intel format.   yuck.
                     74:  *
                     75:  */
                     76:
                     77: /*
                     78:  * PART 1: VME/multibus defs
                     79:  */
                     80: #define IEVME_PAGESIZE 1024    /* bytes */
                     81: #define IEVME_PAGSHIFT 10      /* bits */
                     82: #define IEVME_NPAGES   256     /* number of pages on chip */
                     83: #define IEVME_MAPSZ    1024    /* number of entries in the map */
                     84:
                     85: /*
                     86:  * PTE for the page map
                     87:  */
                     88: #define IEVME_SBORDR 0x8000    /* sun byte order */
                     89: #define IEVME_IBORDR 0x0000    /* intel byte ordr */
                     90:
                     91: #define IEVME_P2MEM  0x2000    /* memory is on P2 */
                     92: #define IEVME_OBMEM  0x0000    /* memory is on board */
                     93:
                     94: #define IEVME_PGMASK 0x0fff    /* gives the physical page frame number */
                     95:
                     96: struct ievme {
                     97:        u_short pgmap[IEVME_MAPSZ];
                     98:        u_short xxx[32];        /* prom */
                     99:        u_short status;         /* see below for bits */
                    100:        u_short xxx2;           /* filler */
                    101:        u_short pectrl;         /* parity control (see below) */
                    102:        u_short peaddr;         /* low 16 bits of address */
                    103: };
                    104:
                    105: /*
                    106:  * status bits
                    107:  */
                    108: #define IEVME_RESET 0x8000     /* reset board */
                    109: #define IEVME_ONAIR 0x4000     /* go out of loopback 'on-air' */
                    110: #define IEVME_ATTEN 0x2000     /* attention */
                    111: #define IEVME_IENAB 0x1000     /* interrupt enable */
                    112: #define IEVME_PEINT 0x0800     /* parity error interrupt enable */
                    113: #define IEVME_PERR  0x0200     /* parity error flag */
                    114: #define IEVME_INT   0x0100     /* interrupt flag */
                    115: #define IEVME_P2EN  0x0020     /* enable p2 bus */
                    116: #define IEVME_256K  0x0010     /* 256kb rams */
                    117: #define IEVME_HADDR 0x000f     /* mask for bits 17-20 of address */
                    118:
                    119: /*
                    120:  * parity control
                    121:  */
                    122: #define IEVME_PARACK 0x0100    /* parity error ack */
                    123: #define IEVME_PARSRC 0x0080    /* parity error source */
                    124: #define IEVME_PAREND 0x0040    /* which end of the data got the error */
                    125: #define IEVME_PARADR 0x000f    /* mask to get bits 17-20 of parity address */
                    126:
                    127:
                    128: /*
                    129:  * PART 2: the on-board interface
                    130:  */
                    131: struct ieob {
                    132:        u_short porthigh;
                    133:        u_short portlow;
                    134:        u_long  attn;
                    135: };
                    136: #define IE_PORT_NEWSCPADDR     0x00000002
                    137: #define        IE_PORT_RESET           0x00000000
                    138:
                    139: #define IEOB_ADBASE 0xff000000  /* KVA base addr of 24 bit address space */
                    140:
                    141: /*
                    142:  * PART 3: the 3E board
                    143:  */
                    144:
                    145: /*
                    146:  * not supported (yet?)
                    147:  */
                    148:

CVSweb