Home | History | Annotate | Line # | Download | only in ic
smc90cx6reg.h revision 1.2
      1 /*	$NetBSD: smc90cx6reg.h,v 1.2 1995/03/01 11:34:10 chopps Exp $ */
      2 
      3 /*
      4  * Copyright (c) 1994, 1995 Ignatios Souvatzis
      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  * 3. All advertising materials mentioning features or use of this software
     16  *    must display the following acknowledgement:
     17  *      This product includes software developed by Ignatios Souvatzis
     18  *      for the NetBSD project.
     19  * 4. The name of the author may not be used to endorse or promote products
     20  *    derived from this software without specific prior written permission
     21  *
     22  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     23  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     24  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     25  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
     26  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
     27  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     28  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     29  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     30  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
     31  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     32  */
     33 
     34 /*
     35  * The A2060/A560 card use the SMC COM90C26 Arcnet chipset.
     36  * First or last 16k segment, resp., write a fifo which drives the reset
     37  * line.
     38  * 2nd 16k segment contains the registers.
     39  * 3rd 16k segment contains the buffer RAM.
     40  * All are only accessible at even addresses.
     41  */
     42 
     43 
     44 /* CBM Arcnet board */
     45 #define MANUFACTURER_1 514
     46 #define PRODUCT_1        9
     47 
     48 /* Ameristar board */
     49 #define MANUFACTURER_2 1053
     50 #define PRODUCT_2         9
     51 
     52 typedef struct {
     53 	u_char volatile kick1;
     54 	u_char pad1[16383];
     55 
     56 	u_char volatile status; /* also intmask */
     57 
     58 	u_char pad2;
     59 	u_char volatile command;
     60 	u_char pad3[16381];
     61 	u_char volatile buffers[4096];	/* even bytes only */
     62 
     63 #define checkbyte	buffers[0]
     64 #define dipswitches	buffers[2]
     65 
     66 	u_char pad4[12228];
     67 	u_char volatile kick2;
     68 	u_char pad5[16383];
     69 } A2060;
     70 
     71 /* calculate address for board b, buffer no n and offset o */
     72 #define BUFPTR(b,n,o) (&(b)->buffers[(n)*512+(o)*2])
     73 
     74 #define ARC_TXDIS	 0x01
     75 #define ARC_RXDIS	 0x02
     76 #define ARC_TX(x)	(0x03 | ((x)<<3))
     77 #define ARC_RX(x)	(0x04 | ((x)<<3))
     78 #define ARC_RXBC(x)	(0x84 | ((x)<<3))
     79 
     80 #define ARC_CONF(x)  	(0x05 | (x))
     81 #define CLR_POR		 0x08
     82 #define CLR_RECONFIG	 0x10
     83 
     84 #define ARC_CLR(x)	(0x06 | (x))
     85 #define CONF_LONG	 0x08
     86 #define CONF_SHORT	 0x00
     87 
     88 /*
     89  * These are not in the COM90C65 docs. Derived from the arcnet.asm
     90  * packet driver by Philippe Prindeville and Russel Nelson.
     91  */
     92 
     93 #define ARC_LDTST(x)	(0x07 | (x))
     94 #define TEST_ON		 0x08
     95 #define TEST_OFF	 0x00
     96 
     97 #define ARC_TA		1	/* int mask also */
     98 #define ARC_TMA		2
     99 #define ARC_RECON	4	/* int mask also */
    100 #define ARC_TEST	8	/* not in the COM90C65 docs (see above) */
    101 #define ARC_POR		0x10	/* non maskable interrupt */
    102 #define ARC_ET1		0x20	/* timeout value bits, normally 1 */
    103 #define ARC_ET2		0x40	/* timeout value bits, normally 1 */
    104 #define ARC_RI		0x80	/* int mask also */
    105 
    106