Annotation of kernel/bsd/dev/ppc/drvCuda/via6522.h, revision 1.1.1.1

1.1       root        1: /*
                      2:  * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
                      3:  *
                      4:  * @APPLE_LICENSE_HEADER_START@
                      5:  * 
                      6:  * Portions Copyright (c) 1999 Apple Computer, Inc.  All Rights
                      7:  * Reserved.  This file contains Original Code and/or Modifications of
                      8:  * Original Code as defined in and that are subject to the Apple Public
                      9:  * Source License Version 1.1 (the "License").  You may not use this file
                     10:  * except in compliance with the License.  Please obtain a copy of the
                     11:  * License at http://www.apple.com/publicsource and read it before using
                     12:  * this file.
                     13:  * 
                     14:  * The Original Code and all software distributed under the License are
                     15:  * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
                     16:  * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
                     17:  * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
                     18:  * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT.  Please see the
                     19:  * License for the specific language governing rights and limitations
                     20:  * under the License.
                     21:  * 
                     22:  * @APPLE_LICENSE_HEADER_END@
                     23:  */
                     24: 
                     25: /*
                     26:  * Copyright 1996 1995 by Open Software Foundation, Inc. 1997 1996 1995 1994 1993 1992 1991  
                     27:  *              All Rights Reserved 
                     28:  *  
                     29:  * Permission to use, copy, modify, and distribute this software and 
                     30:  * its documentation for any purpose and without fee is hereby granted, 
                     31:  * provided that the above copyright notice appears in all copies and 
                     32:  * that both the copyright notice and this permission notice appear in 
                     33:  * supporting documentation. 
                     34:  *  
                     35:  * OSF DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE 
                     36:  * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
                     37:  * FOR A PARTICULAR PURPOSE. 
                     38:  *  
                     39:  * IN NO EVENT SHALL OSF BE LIABLE FOR ANY SPECIAL, INDIRECT, OR 
                     40:  * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 
                     41:  * LOSS OF USE, DATA OR PROFITS, WHETHER IN ACTION OF CONTRACT, 
                     42:  * NEGLIGENCE, OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION 
                     43:  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 
                     44:  * 
                     45:  */
                     46: /*
                     47:  * Copyright 1996 1995 by Apple Computer, Inc. 1997 1996 1995 1994 1993 1992 1991  
                     48:  *              All Rights Reserved 
                     49:  *  
                     50:  * Permission to use, copy, modify, and distribute this software and 
                     51:  * its documentation for any purpose and without fee is hereby granted, 
                     52:  * provided that the above copyright notice appears in all copies and 
                     53:  * that both the copyright notice and this permission notice appear in 
                     54:  * supporting documentation. 
                     55:  *  
                     56:  * APPLE COMPUTER DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE 
                     57:  * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 
                     58:  * FOR A PARTICULAR PURPOSE. 
                     59:  *  
                     60:  * IN NO EVENT SHALL APPLE COMPUTER BE LIABLE FOR ANY SPECIAL, INDIRECT, OR 
                     61:  * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 
                     62:  * LOSS OF USE, DATA OR PROFITS, WHETHER IN ACTION OF CONTRACT, 
                     63:  * NEGLIGENCE, OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION 
                     64:  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 
                     65:  */
                     66: /*
                     67:  * MKLINUX-1.0DR2
                     68:  */
                     69: /*
                     70:     File:       via6522.h
                     71: 
                     72:     Contains:   xxx put contents here xxx
                     73: 
                     74:     Written by: xxx put writers here xxx
                     75: 
                     76:     Copyright:  � 1993, 1995 by Apple Computer, Inc., all rights reserved.
                     77: 
                     78:     Change History (most recent first):
                     79: 
                     80:          <1>     2/22/95    AM      First checked in.
                     81:          <1>    04/04/94    MRN     First checked in.
                     82: 
                     83: */
                     84: 
                     85: /*
                     86:  * Copyright 1987-91 Apple Computer, Inc.
                     87:  * All Rights Reserved.
                     88:  */
                     89: 
                     90: #ifndef __VIA6522_H__
                     91: #define __VIA6522_H__
                     92: 
                     93: /*
                     94:  *   Synertek SY6522 VIA Versatile Interface Adapter
                     95:  */
                     96: 
                     97: /*
                     98:  * This has been modified to address BOTH the via and RBV registers,
                     99:  * because we know that both chips ignore part of the address, thus
                    100:  * only responding correctly.  It's ugly, but the ROM does it...
                    101:  */
                    102: 
                    103: #if defined(powerc) || defined (__powerc)
                    104: #pragma options align=mac68k
                    105: #endif
                    106:  
                    107: typedef struct via6522Regs                      /* VIA / RBV address */
                    108:     {
                    109:     volatile unsigned char  vBufB;              /* 0000/0000 register b */  
                    110:     volatile unsigned char  RvExp;              /* 0001 RBV future expansion */
                    111:     volatile unsigned char  RvSlotIFR;          /* 0002 RBV Slot interrupts reg. */
                    112:     volatile unsigned char  RvIFR;              /* 0003 RBV interrupt flag reg. */
                    113:     unsigned char           jnk0[ 12 ];
                    114: 
                    115:     volatile unsigned char  RvMonP;             /* xxxx/0010 RBV video monitor type */
                    116:     volatile unsigned char  RvChpT;             /* xxxx/0011 RBV test mode register */
                    117:     volatile unsigned char  RvSlotIER;          /* xxxx/0012 RBV slot interrupt enables */
                    118:     volatile unsigned char  RvIER;              /* xxxx/0013 RBV interrupt flag enable reg */
                    119:     unsigned char           jnk1[ 0x1FF - 0x13 ];
                    120: 
                    121:     volatile unsigned char  vBufAH;             /* 0200 buffer a (with handshake). */
                    122:     unsigned char           jnk2[ 0x1FF ];      /* Dont use! Here only for completeness */
                    123: 
                    124:     volatile unsigned char  vDIRB;              /* 0400 data direction register B */
                    125:     unsigned char           jnk25[ 0x1FF ];
                    126: 
                    127:     volatile unsigned char  vDIRA;              /* 0600 data direction register A */
                    128:     unsigned char           jnk3[ 0x1FF ];
                    129: 
                    130:     volatile unsigned char  vT1C;               /* 0800 timer one low */
                    131:     unsigned char           jnk4[ 0x1FF ];
                    132: 
                    133:     volatile unsigned char  vT1CH;              /* 0A00 timer one high */
                    134:     unsigned char           jnk5[ 0x1FF ];
                    135: 
                    136:     volatile unsigned char  vT1L;               /* 0C00 timer one latches low */
                    137:     unsigned char           jnk6[ 0x1FF ];
                    138: 
                    139:     volatile unsigned char  vT1LH;              /* 0E00 timer one latches high */
                    140:     unsigned char           jnk7[ 0x1FF ];
                    141: 
                    142:     volatile unsigned char  vT2C;               /* 1000 timer 2 low */
                    143:     unsigned char           jnk8[ 0x1FF ];
                    144: 
                    145:     volatile unsigned char  vT2CH;              /* 1200 timer two counter high */
                    146:     unsigned char           jnk9[ 0x1FF ];
                    147: 
                    148:     volatile unsigned char  vSR;                /* 1400 shift register */   
                    149:     unsigned char           jnka[ 0x1FF ];
                    150: 
                    151:     volatile unsigned char  vACR;               /* 1600 auxilary control register */    
                    152:     unsigned char           jnkb[ 0x1FF ];
                    153: 
                    154:     volatile unsigned char  vPCR;               /* 1800 peripheral control register */
                    155:     unsigned char           jnkc[ 0x1FF ];
                    156: 
                    157:     volatile unsigned char  vIFR;               /* 1A00 interrupt flag register */
                    158:     unsigned char           jnkd[ 0x1FF ];
                    159: 
                    160:     volatile unsigned char  vIER;               /* 1C00 interrupt enable register */    
                    161:     unsigned char           jnkf[ 0x1FF ];
                    162: 
                    163:     volatile unsigned char  vBufA;              /* 1E00 register A, read and write */
                    164:     } via6522Regs;
                    165: 
                    166: #if defined(powerc) || defined(__powerc)
                    167: #pragma options align=reset
                    168: #endif
                    169: 
                    170: 
                    171: /*  Register B contents */
                    172: 
                    173: #define VRB_POWEROFF    0x04            /* disk head select */
                    174: #define RBV_POWEROFF    VRB_POWEROFF
                    175: #define VRB_BUSLOCK     0x02            /* NuBus Transactions are locked */
                    176: 
                    177: 
                    178: /*  Register A contents */
                    179: 
                    180: #define VRA_DRIVE       0x10            /* drive select */
                    181: #define VRA_HEAD        0x20            /* disk head select */
                    182: 
                    183: 
                    184: /*  Auxillary control register contents */
                    185: 
                    186: #define VAC_PAENL       0x01            /* Enable latch for PA */
                    187: #define VAC_PADISL      0x00            /* Disable latch for PA */
                    188: #define VAC_PBENL       0x02            /* Enable latch for PA */
                    189: #define VAC_PBDISL      0x00            /* Disable latch for PA */
                    190: #define VAC_SRDIS       0x00            /* Shift Reg Disabled */
                    191: #define VAC_SRMD1       0x04            /* Shift In under control of T2 */
                    192: #define VAC_SRMD2       0x08            /* Shift In under control of Phase 2 */
                    193: #define VAC_SRMD3       0x0C            /* Shift in under control of Ext Clk */
                    194: #define VAC_SRMD4       0x10            /* Shift Out free running at T2 rate */
                    195: #define VAC_SRMD5       0x14            /* Shift Out under control of T2 */
                    196: #define VAC_SRMD6       0x18            /* Shift Out under control of theta2 */
                    197: #define VAC_SRMD7       0x1C            /* Shift Out under control of Ext Clk */
                    198: #define VAC_T2CTL       0x20            /* Timer two, control */
                    199: #define VAC_T2TI        0x00            /* Timer Two, Timed Interrupt */
                    200: #define VAC_T2CD        0x20            /* Timer Two, count down with pulses on PB6 */
                    201: #define VAC_T1CONT      0x40            /* Timer one, continous counting */
                    202: #define VAC_T11SHOT     0x00            /* Timer One, one shot output */
                    203: #define VAC_T1PB7       0x80            /* Timer one, drives PB7 */
                    204: #define VAC_T1PB7DIS    0x00            /* Timer one, drives PB7 disabled */
                    205: 
                    206: 
                    207: /*  Interrupt enable register contents */
                    208: 
                    209: #define VIE_CA2         0x01            /* interrupt on CA2 */
                    210: #define VIE_CA1         0x02            /* interrupt on CA1 */
                    211: #define VIE_SR          0x04            /* Shift Register */
                    212: #define VIE_CB2         0x08            /* interrupt on CB2 */
                    213: #define VIE_CB1         0x10            /* interrupt on CB1 */
                    214: #define VIE_TIM2        0x20            /* timer 2 interrupt */
                    215: #define VIE_TIM1        0x40            /* timer 1 interrupt */
                    216: #define VIE_SET         0x80            /* Set interrupt bits if this is on */
                    217: #define VIE_CLEAR       0x00            /* Clear bits if used */
                    218: 
                    219: #define VIE_ALL         ( VIE_TIM1 | VIE_TIM2 | VIE_CB1 | VIE_CB2 | VIE_SR | VIE_CA1 | VIE_CA2 )
                    220: 
                    221: 
                    222: /*  VIA Data Direction Register Contents */
                    223: 
                    224: #define VDR_P7_O        0x80            /* P7 is output */
                    225: #define VDR_P7_I        0x00            /* P7 is input */
                    226: #define VDR_P6_O        0x40            /* P6 is output */
                    227: #define VDR_P6_I        0x00            /* P6 is input */
                    228: #define VDR_P5_O        0x20            /* P5 is output */
                    229: #define VDR_P5_I        0x00            /* P5 is input */
                    230: #define VDR_P4_O        0x10            /* P4 is output */
                    231: #define VDR_P4_I        0x00            /* P4 is input */
                    232: #define VDR_P3_O        0x08            /* P3 is output */
                    233: #define VDR_P3_I        0x00            /* P3 is input */
                    234: #define VDR_P2_O        0x04            /* P2 is output */
                    235: #define VDR_P2_I        0x00            /* P2 is input */
                    236: #define VDR_P1_O        0x02            /* P1 is output */
                    237: #define VDR_P1_I        0x00            /* P1 is input */
                    238: #define VDR_P0_O        0x01            /* P0 is output */
                    239: #define VDR_P0_I        0x00            /* P0 is input */
                    240: 
                    241: 
                    242: /*  VIA1 Register A contents where they differ from standard VIA1 */
                    243: 
                    244: #define RBV_BURNIN      0x01            /* burnin flag */
                    245: #define RBV_CPUID0      0x02            /* CPU id bit 0 */
                    246: #define RBV_CPUID1      0x04            /* CPU id bit 1 */
                    247: #define RBV_CPUID2      0x10            /* CPU id bit 2 */
                    248: #define RBV_CPUID3      0x40            /* CPU id bit 3 */
                    249: 
                    250: 
                    251: /*  VIA1 Register B contents where they differ from standard VIA1 */
                    252: 
                    253: #define RBV_PARDIS      0x40            /* disable parity */
                    254: #define RBV_PAROK       0x80            /* parity OK */
                    255: 
                    256: #define EVRB_XCVR       0x08            /* XCVR_SESSION* */
                    257: #define EVRB_FULL       0x10            /* VIA_FULL */
                    258: #define EVRB_SYSES      0x20            /* SYS_SESSION */
                    259: #define EVRB_AUXIE      0x00            /* Enable A/UX Interrupt Scheme */
                    260: #define EVRB_AUXID      0x40            /* Disable A/UX Interrupt Scheme */
                    261: #define EVRB_SFTWRIE    0x00            /* Software Interrupt ReQuest */
                    262: #define EVRB_SFTWRID    0x80            /* Software Interrupt ReQuest */
                    263: 
                    264: 
                    265: /*  VIA2 Register A contents where they differ from standard VIA2 */
                    266: 
                    267: #define RBV_SZEROIRQ    0x40            /* slot 0 irq */
                    268: #define EVRA_ENETIRQ    0x01            /* Ethernet irq */
                    269: #define EVRA_VIDIRQ     0x40            /* Video irq */
                    270: 
                    271: 
                    272: /*  VIA2 Register B contents where they differ from standard VIA2 */
                    273: 
                    274: #define RBV_CDIS        0x01            /* disable external cache */
                    275: #define RBV_CFLUSH      0x08            /* flush external cache */
                    276: #define EVRB_LED        0x10            /* LED */
                    277: #define RBV_PARODD      0x80            /* 1 for odd, 0 for even */
                    278: 
                    279: 
                    280: /*  Video monitor parameters: */
                    281: #define RBV_DEPTH       0x07            /* bits per pixel: 000=1,001=2,010=4,011=8 */
                    282: #define RBV_MONID       0x38            /* monitor type as below */
                    283: #define RBV_VIDOFF      0x40            /* 1 turns off onboard video */
                    284: 
                    285: 
                    286: /*  Supported video monitor types: */
                    287: 
                    288: #define MON_15BW        ( 1 << 3 )      /* 15" BW  portrait */
                    289: #define MON_IIGS        ( 2 << 3 )      /* modified IIGS monitor */
                    290: #define MON_15RGB       ( 5 << 3 )      /* 15" RGB portrait */
                    291: #define MON_12OR13      ( 6 << 3 )      /* 12" BW or 13" RGB */
                    292: #define MON_NONE        ( 7 << 3 )      /* No monitor attached */
                    293: 
                    294: #endif /* __VIA6522_H__ */

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.