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