Home | History | Annotate | Line # | Download | only in include
vsbus.h revision 1.18.38.1
      1  1.18.38.1      yamt /*	$NetBSD: vsbus.h,v 1.18.38.1 2012/10/30 17:20:29 yamt Exp $ */
      2        1.1     ragge /*
      3        1.1     ragge  * Copyright (c) 1996 Ludd, University of Lule}, Sweden.
      4        1.1     ragge  * All rights reserved.
      5        1.1     ragge  *
      6        1.1     ragge  * This code is derived from software contributed to Ludd by Bertram Barth.
      7        1.1     ragge  *
      8        1.1     ragge  * Redistribution and use in source and binary forms, with or without
      9        1.1     ragge  * modification, are permitted provided that the following conditions
     10        1.1     ragge  * are met:
     11        1.1     ragge  * 1. Redistributions of source code must retain the above copyright
     12        1.1     ragge  *    notice, this list of conditions and the following disclaimer.
     13        1.1     ragge  * 2. Redistributions in binary form must reproduce the above copyright
     14        1.1     ragge  *    notice, this list of conditions and the following disclaimer in the
     15        1.1     ragge  *    documentation and/or other materials provided with the distribution.
     16        1.1     ragge  * 3. All advertising materials mentioning features or use of this software
     17        1.1     ragge  *    must display the following acknowledgement:
     18        1.1     ragge  *      This product includes software developed at Ludd, University of
     19        1.1     ragge  *      Lule}, Sweden and its contributors.
     20        1.1     ragge  * 4. The name of the author may not be used to endorse or promote products
     21        1.1     ragge  *    derived from this software without specific prior written permission
     22        1.1     ragge  *
     23        1.1     ragge  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     24        1.1     ragge  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     25        1.1     ragge  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     26        1.1     ragge  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
     27        1.1     ragge  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
     28        1.1     ragge  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     29        1.1     ragge  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     30        1.1     ragge  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     31        1.1     ragge  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
     32        1.1     ragge  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     33        1.1     ragge  */
     34        1.1     ragge 
     35        1.1     ragge /*
     36        1.1     ragge  * Generic definitions for the (virtual) vsbus. contains common info
     37        1.1     ragge  * used by all VAXstations.
     38        1.1     ragge  */
     39        1.1     ragge 
     40        1.8     ragge #ifndef _VAX_VSBUS_H_
     41        1.8     ragge #define _VAX_VSBUS_H_
     42        1.8     ragge 
     43        1.8     ragge #include <machine/bus.h>
     44       1.11      matt #include <machine/sgmap.h>
     45        1.8     ragge 
     46        1.2     ragge struct	vsbus_attach_args {
     47        1.7     ragge 	vaddr_t	va_addr;		/* virtual CSR address */
     48        1.7     ragge 	paddr_t	va_paddr;		/* physical CSR address */
     49        1.7     ragge 	short	va_br;			/* Interrupt level */
     50        1.7     ragge 	short	va_cvec;		/* Interrupt vector address */
     51        1.7     ragge 	u_char	va_maskno;		/* Interrupt vector in mask */
     52       1.13     ragge 	vaddr_t	va_dmaaddr;		/* DMA area address */
     53       1.13     ragge 	vsize_t	va_dmasize;		/* DMA area size */
     54       1.17      matt 	bus_space_tag_t va_memt;
     55        1.8     ragge 	bus_dma_tag_t va_dmat;
     56        1.2     ragge };
     57        1.2     ragge 
     58        1.2     ragge /*
     59        1.2     ragge  * Some chip addresses and constants, same on all VAXstations.
     60        1.2     ragge  */
     61        1.7     ragge #define VS_CFGTST	0x20020000      /* config register */
     62       1.14       wiz #define VS_REGS         0x20080000      /* Misc CPU internal regs */
     63  1.18.38.1      yamt #define VS_REGS_KA49	0x25c00000      /* ... same, on 512KB ROM systems */
     64        1.2     ragge #define NI_ADDR         0x20090000      /* Ethernet address */
     65        1.2     ragge #define DZ_CSR          0x200a0000      /* DZ11-compatible chip csr */
     66  1.18.38.1      yamt #define DZ_CSR_KA49	0x25000000      /* ... same, on 512KB ROM systems */
     67        1.2     ragge #define VS_CLOCK        0x200b0000      /* clock chip address */
     68        1.6     ragge #define SCA_REGS        0x200c0000      /* disk device addresses */
     69  1.18.38.1      yamt #define SCA_REGS_KA49	0x26000000      /* ... same, on 512KB ROM systems */
     70        1.2     ragge #define NI_BASE         0x200e0000      /* LANCE CSRs */
     71        1.5     ragge #define NI_IOSIZE       (128 * VAX_NBPG)    /* IO address size */
     72        1.2     ragge 
     73       1.12      matt #define	KA49_SCSIMAP	0x27000000	/* KA49 SCSI SGMAP */
     74        1.2     ragge /*
     75        1.3     ragge  * Small monochrome graphics framebuffer, present on all machines.
     76        1.3     ragge  */
     77        1.3     ragge #define	SMADDR		0x30000000
     78        1.3     ragge #define	SMSIZE		0x20000		/* Actually 256k, only 128k used */
     79        1.3     ragge 
     80       1.11      matt struct	vsbus_softc {
     81       1.18      matt 	device_t sc_dev;
     82       1.11      matt 	u_char	*sc_intmsk;	/* Mask register */
     83       1.11      matt 	u_char	*sc_intclr;	/* Clear interrupt register */
     84       1.11      matt 	u_char	*sc_intreq;	/* Interrupt request register */
     85       1.11      matt 	u_char	sc_mask;	/* Interrupts to enable after autoconf */
     86       1.12      matt 	vaddr_t	sc_vsregs;	/* Where the VS_REGS are mapped */
     87       1.13     ragge 	vaddr_t sc_dmaaddr;	/* Mass storage virtual DMA area */
     88       1.13     ragge 	vsize_t sc_dmasize;	/* Size of the DMA area */
     89       1.13     ragge 
     90       1.18      matt 	bus_space_tag_t sc_iot;
     91       1.11      matt 	struct vax_bus_dma_tag sc_dmatag;
     92       1.11      matt 	struct vax_sgmap sc_sgmap;
     93       1.11      matt };
     94       1.11      matt 
     95       1.13     ragge struct vsbus_dma {
     96       1.13     ragge 	SIMPLEQ_ENTRY(vsbus_dma) vd_q;
     97       1.13     ragge 	void (*vd_go)(void *);
     98       1.13     ragge 	void *vd_arg;
     99       1.13     ragge };
    100       1.13     ragge 
    101       1.10      matt #ifdef _KERNEL
    102       1.13     ragge void	vsbus_dma_init(struct vsbus_softc *, unsigned ptecnt);
    103       1.13     ragge u_char	vsbus_setmask(int);
    104       1.13     ragge void	vsbus_clrintr(int);
    105       1.16  christos void	vsbus_copytoproc(struct proc *, void *, void *, int);
    106       1.16  christos void	vsbus_copyfromproc(struct proc *, void *, void *, int);
    107       1.13     ragge void	vsbus_dma_start(struct vsbus_dma *);
    108       1.13     ragge void	vsbus_dma_intr(void);
    109       1.10      matt #endif
    110        1.8     ragge #endif /* _VAX_VSBUS_H_ */
    111