Home | History | Annotate | Line # | Download | only in pci
mcpciavar.h revision 1.2.2.1
      1  1.2.2.1  thorpej /* $NetBSD: mcpciavar.h,v 1.2.2.1 1999/04/16 23:41:30 thorpej Exp $ */
      2      1.1   mjacob 
      3      1.1   mjacob /*
      4      1.1   mjacob  * Copyright (c) 1998 by Matthew Jacob
      5      1.1   mjacob  * NASA AMES Research Center.
      6      1.1   mjacob  * All rights reserved.
      7      1.1   mjacob  *
      8      1.1   mjacob  * Redistribution and use in source and binary forms, with or without
      9      1.1   mjacob  * modification, are permitted provided that the following conditions
     10      1.1   mjacob  * are met:
     11      1.1   mjacob  * 1. Redistributions of source code must retain the above copyright
     12      1.1   mjacob  *    notice immediately at the beginning of the file, without modification,
     13      1.1   mjacob  *    this list of conditions, and the following disclaimer.
     14      1.1   mjacob  * 2. Redistributions in binary form must reproduce the above copyright
     15      1.1   mjacob  *    notice, this list of conditions and the following disclaimer in the
     16      1.1   mjacob  *    documentation and/or other materials provided with the distribution.
     17      1.1   mjacob  * 3. The name of the author may not be used to endorse or promote products
     18      1.1   mjacob  *    derived from this software without specific prior written permission.
     19      1.1   mjacob  *
     20      1.1   mjacob  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
     21      1.1   mjacob  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     22      1.1   mjacob  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     23      1.1   mjacob  * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
     24      1.1   mjacob  * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     25      1.1   mjacob  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     26      1.1   mjacob  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     27      1.1   mjacob  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     28      1.1   mjacob  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     29      1.1   mjacob  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     30      1.1   mjacob  * SUCH DAMAGE.
     31      1.1   mjacob  */
     32      1.1   mjacob 
     33      1.1   mjacob #include <dev/pci/pcivar.h>
     34      1.1   mjacob #include <sys/extent.h>
     35      1.1   mjacob 
     36      1.1   mjacob #include <alpha/pci/pci_sgmap_pte64.h>
     37      1.1   mjacob 
     38      1.1   mjacob #define	_FSTORE	(EXTENT_FIXED_STORAGE_SIZE(8) / sizeof(long))
     39      1.1   mjacob 
     40      1.1   mjacob /*
     41      1.2   mjacob  * MPCIA configuration.
     42      1.1   mjacob  */
     43      1.1   mjacob struct mcpcia_config {
     44  1.2.2.1  thorpej 	int				cc_gid;	/* GID of this MCbus */
     45  1.2.2.1  thorpej 	int				cc_mid;	/* MCbus Module ID */
     46      1.1   mjacob 	int				cc_initted;
     47  1.2.2.1  thorpej 	int				cc_mallocsafe;
     48      1.1   mjacob 	struct alpha_bus_space		cc_iot;
     49      1.1   mjacob 	struct alpha_bus_space		cc_memt;
     50      1.1   mjacob 	struct extent *			cc_io_ex;
     51      1.1   mjacob 	struct extent *			cc_d_mem_ex;
     52      1.1   mjacob 	struct extent *			cc_s_mem_ex;
     53      1.1   mjacob 	struct alpha_pci_chipset	cc_pc;
     54      1.1   mjacob 	struct mcpcia_softc *		cc_sc;	/* back pointer */
     55      1.1   mjacob 	long				cc_io_exstorage[_FSTORE];
     56      1.1   mjacob 	long				cc_dmem_exstorage[_FSTORE];
     57      1.1   mjacob 	long				cc_smem_exstorage[_FSTORE];
     58      1.1   mjacob 	unsigned long			cc_sysbase;	/* shorthand */
     59      1.1   mjacob 	struct alpha_bus_dma_tag	cc_dmat_direct;
     60  1.2.2.1  thorpej 	struct alpha_bus_dma_tag	cc_dmat_pci_sgmap;
     61  1.2.2.1  thorpej 	struct alpha_bus_dma_tag	cc_dmat_isa_sgmap;
     62  1.2.2.1  thorpej 	struct alpha_sgmap		cc_pci_sgmap;
     63  1.2.2.1  thorpej 	struct alpha_sgmap		cc_isa_sgmap;
     64      1.1   mjacob };
     65      1.1   mjacob 
     66      1.1   mjacob struct mcpcia_softc {
     67      1.1   mjacob 	struct device		mcpcia_dev;
     68  1.2.2.1  thorpej 	struct mcpcia_config	*mcpcia_cc;	/* config info */
     69      1.1   mjacob };
     70      1.1   mjacob 
     71  1.2.2.1  thorpej void	mcpcia_init __P((void));
     72  1.2.2.1  thorpej void	mcpcia_config_cleanup __P((void));
     73      1.1   mjacob 
     74      1.1   mjacob void	mcpcia_pci_init __P((pci_chipset_tag_t, void *));
     75      1.1   mjacob void	mcpcia_dma_init __P((struct mcpcia_config *));
     76      1.1   mjacob 
     77      1.1   mjacob void	mcpcia_bus_io_init __P((bus_space_tag_t, void *));
     78      1.1   mjacob void	mcpcia_bus_mem_init __P((bus_space_tag_t, void *));
     79      1.1   mjacob 
     80      1.1   mjacob /*
     81      1.1   mjacob  * IO Interrupt handler.
     82      1.1   mjacob  */
     83      1.1   mjacob void 	mcpcia_iointr __P((void *, unsigned long));
     84      1.1   mjacob 
     85      1.1   mjacob /*
     86      1.1   mjacob  * There are four PCI slots per MCPCIA PCI bus here, but some are 'hidden'-
     87      1.1   mjacob  * none seems to be higher than 6 though.
     88      1.1   mjacob  */
     89      1.1   mjacob #define	MCPCIA_MAXDEV	6
     90      1.1   mjacob #define	MCPCIA_MAXSLOT	8
     91      1.1   mjacob 
     92      1.1   mjacob /*
     93      1.1   mjacob  * Interrupt Stuff for MCPCIA systems.
     94      1.1   mjacob  *
     95      1.1   mjacob  * EISA interrupts (at vector 0x800) have to be shared interrupts-
     96      1.1   mjacob  * and that can be easily managed. All the PCI interrupts are deterministic
     97      1.1   mjacob  * in that they start at vector 0x900, 0x40 per PCI slot, 0x200 per
     98      1.1   mjacob  * MCPCIA, 4 MCPCIAs per GCBUS....
     99      1.1   mjacob  */
    100      1.1   mjacob #define MCPCIA_EISA_KEYB_IRQ	1
    101      1.1   mjacob #define MCPCIA_EISA_MOUSE_IRQ	12
    102      1.1   mjacob #define MCPCIA_VEC_EISA		0x800
    103      1.1   mjacob #define MCPCIA_VEC_PCI		0x900
    104      1.1   mjacob 
    105      1.1   mjacob /*
    106      1.1   mjacob  * Special Vectors
    107      1.1   mjacob  */
    108      1.1   mjacob #define	MCPCIA_I2C_CVEC		0xA90
    109      1.1   mjacob #define	MCPCIA_I2C_BVEC		0xAA0
    110