Home | History | Annotate | Line # | Download | only in dev
pccreg.h revision 1.1
      1  1.1  chuck /* $Id: pccreg.h,v 1.1 1995/07/25 23:12:08 chuck Exp $ */
      2  1.1  chuck 
      3  1.1  chuck /*
      4  1.1  chuck  *
      5  1.1  chuck  * Copyright (c) 1995 Charles D. Cranor
      6  1.1  chuck  * All rights reserved.
      7  1.1  chuck  *
      8  1.1  chuck  * Redistribution and use in source and binary forms, with or without
      9  1.1  chuck  * modification, are permitted provided that the following conditions
     10  1.1  chuck  * are met:
     11  1.1  chuck  * 1. Redistributions of source code must retain the above copyright
     12  1.1  chuck  *    notice, this list of conditions and the following disclaimer.
     13  1.1  chuck  * 2. Redistributions in binary form must reproduce the above copyright
     14  1.1  chuck  *    notice, this list of conditions and the following disclaimer in the
     15  1.1  chuck  *    documentation and/or other materials provided with the distribution.
     16  1.1  chuck  * 3. All advertising materials mentioning features or use of this software
     17  1.1  chuck  *    must display the following acknowledgement:
     18  1.1  chuck  *      This product includes software developed by Charles D. Cranor.
     19  1.1  chuck  * 4. The name of the author may not be used to endorse or promote products
     20  1.1  chuck  *    derived from this software without specific prior written permission.
     21  1.1  chuck  *
     22  1.1  chuck  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     23  1.1  chuck  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     24  1.1  chuck  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     25  1.1  chuck  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
     26  1.1  chuck  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
     27  1.1  chuck  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     28  1.1  chuck  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     29  1.1  chuck  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     30  1.1  chuck  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
     31  1.1  chuck  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     32  1.1  chuck  */
     33  1.1  chuck 
     34  1.1  chuck /*
     35  1.1  chuck  * peripheral channel controller (at pa fffe1000)
     36  1.1  chuck  */
     37  1.1  chuck 
     38  1.1  chuck struct pcc {
     39  1.1  chuck   volatile u_long dma_taddr;		/* dma table address */
     40  1.1  chuck   volatile u_long dma_daddr;		/* dma data address */
     41  1.1  chuck   volatile u_long dma_bcnt;		/* dma byte count */
     42  1.1  chuck   volatile u_long dma_hold;		/* dma data hold register */
     43  1.1  chuck   volatile u_short t1_pload;		/* timer1 preload */
     44  1.1  chuck   volatile u_short t1_count;		/* timer1 count */
     45  1.1  chuck   volatile u_short t2_pload;		/* timer2 preload */
     46  1.1  chuck   volatile u_short t2_count;		/* timer2 count */
     47  1.1  chuck   volatile u_char t1_int;		/* timer1 interrupt ctrl */
     48  1.1  chuck   volatile u_char t1_cr;		/* timer1 ctrl reg */
     49  1.1  chuck   volatile u_char t2_int;		/* timer2 interrupt ctrl */
     50  1.1  chuck   volatile u_char t2_cr;		/* timer2 ctrl reg */
     51  1.1  chuck   volatile u_char acf_int;		/* acfail intr reg */
     52  1.1  chuck   volatile u_char dog_int;		/* watchdog intr reg */
     53  1.1  chuck   volatile u_char pr_int;		/* printer intr reg */
     54  1.1  chuck   volatile u_char pr_cr;		/* printer ctrl */
     55  1.1  chuck   volatile u_char dma_int;		/* dma interrupt control */
     56  1.1  chuck   volatile u_char dma_csr;		/* dma csr */
     57  1.1  chuck   volatile u_char bus_int;		/* bus error interrupt */
     58  1.1  chuck   volatile u_char dma_sr;		/* dma status register */
     59  1.1  chuck   volatile u_char abrt_int;		/* abort interrupt control reg */
     60  1.1  chuck   volatile u_char ta_fcr;		/* table address function code reg */
     61  1.1  chuck   volatile u_char zs_int;		/* serial interrupt reg */
     62  1.1  chuck   volatile u_char gen_cr;		/* general control register */
     63  1.1  chuck   volatile u_char le_int;		/* ethernet interrupt */
     64  1.1  chuck   volatile u_char gen_sr;		/* general status */
     65  1.1  chuck   volatile u_char scsi_int;		/* scsi interrupt reg */
     66  1.1  chuck   volatile u_char slave_ba;		/* slave base addr reg */
     67  1.1  chuck   volatile u_char sw1_int;		/* software interrupt #1 cr */
     68  1.1  chuck   volatile u_char int_vectr;		/* interrupt base vector register */
     69  1.1  chuck   volatile u_char sw2_int;		/* software interrupt #2 cr */
     70  1.1  chuck   volatile u_char pcc_rev;		/* revision level */
     71  1.1  chuck };
     72  1.1  chuck 
     73  1.1  chuck 
     74  1.1  chuck /*
     75  1.1  chuck  * points to system's PCC
     76  1.1  chuck  */
     77  1.1  chuck 
     78  1.1  chuck extern struct pcc *sys_pcc;
     79  1.1  chuck 
     80  1.1  chuck /*
     81  1.1  chuck  * we lock off our interrupt vector at 0x40.  if this is changed
     82  1.1  chuck  * we'll need to change vector.s
     83  1.1  chuck  */
     84  1.1  chuck 
     85  1.1  chuck #define PCC_VECBASE 0x40
     86  1.1  chuck #define PCC_NVEC 12
     87  1.1  chuck 
     88  1.1  chuck /*
     89  1.1  chuck  * vectors we use
     90  1.1  chuck  */
     91  1.1  chuck 
     92  1.1  chuck #define PCCV_ACFAIL	0
     93  1.1  chuck #define PCCV_BERR	1
     94  1.1  chuck #define PCCV_ABORT	2
     95  1.1  chuck #define PCCV_ZS		3
     96  1.1  chuck #define PCCV_LE		4
     97  1.1  chuck #define PCCV_SCSIP	5
     98  1.1  chuck #define PCCV_SCSID	6
     99  1.1  chuck #define PCCV_PRINTER	7
    100  1.1  chuck #define PCCV_TIMER1	8
    101  1.1  chuck #define PCCV_TIMER2	9
    102  1.1  chuck #define PCCV_SOFT1	10
    103  1.1  chuck #define PCCV_SOFT2	11
    104  1.1  chuck 
    105  1.1  chuck /*
    106  1.1  chuck  * enable interrupt
    107  1.1  chuck  */
    108  1.1  chuck 
    109  1.1  chuck #define PCC_IENABLE 0x08
    110  1.1  chuck 
    111  1.1  chuck /*
    112  1.1  chuck  * interrupt mask
    113  1.1  chuck  */
    114  1.1  chuck 
    115  1.1  chuck #define PCC_IMASK 0x7
    116  1.1  chuck 
    117  1.1  chuck /*
    118  1.1  chuck  * clock/timer
    119  1.1  chuck  */
    120  1.1  chuck 
    121  1.1  chuck #define PCC_TIMERACK 0x80	/* ack intr */
    122  1.1  chuck #define PCC_TIMER100HZ 63936	/* load value for 100Hz */
    123  1.1  chuck #define PCC_TIMERCLEAR 0x0	/* reset and clear timer */
    124  1.1  chuck #define PCC_TIMERSTART 0x3      /* start timer */
    125  1.1  chuck 
    126  1.1  chuck /*
    127  1.1  chuck  * serial control
    128  1.1  chuck  */
    129  1.1  chuck 
    130  1.1  chuck #define PCC_ZSEXTERN 0x10	/* let PCC supply vector */
    131