xref: /netbsd-src/sys/arch/i386/include/eisa_machdep.h (revision 519d8d98a181d847a81f5c226832b54b811fb8e6)
1*519d8d98Sknakahara /*	$NetBSD: eisa_machdep.h,v 1.14 2015/04/27 08:30:11 knakahara Exp $	*/
2a12c0565Scgd 
3a12c0565Scgd /*
4a12c0565Scgd  * Copyright (c) 1996 Christopher G. Demetriou.  All rights reserved.
5a12c0565Scgd  *
6a12c0565Scgd  * Redistribution and use in source and binary forms, with or without
7a12c0565Scgd  * modification, are permitted provided that the following conditions
8a12c0565Scgd  * are met:
9a12c0565Scgd  * 1. Redistributions of source code must retain the above copyright
10a12c0565Scgd  *    notice, this list of conditions and the following disclaimer.
11a12c0565Scgd  * 2. Redistributions in binary form must reproduce the above copyright
12a12c0565Scgd  *    notice, this list of conditions and the following disclaimer in the
13a12c0565Scgd  *    documentation and/or other materials provided with the distribution.
14a12c0565Scgd  * 3. All advertising materials mentioning features or use of this software
15a12c0565Scgd  *    must display the following acknowledgement:
16a12c0565Scgd  *      This product includes software developed by Christopher G. Demetriou
17a12c0565Scgd  *	for the NetBSD Project.
18a12c0565Scgd  * 4. The name of the author may not be used to endorse or promote products
19a12c0565Scgd  *    derived from this software without specific prior written permission
20a12c0565Scgd  *
21a12c0565Scgd  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
22a12c0565Scgd  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
23a12c0565Scgd  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
24a12c0565Scgd  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
25a12c0565Scgd  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
26a12c0565Scgd  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27a12c0565Scgd  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28a12c0565Scgd  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29a12c0565Scgd  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
30a12c0565Scgd  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31a12c0565Scgd  */
32a12c0565Scgd 
33a12c0565Scgd /*
34a12c0565Scgd  * Machine-specific definitions for EISA autoconfiguration.
35a12c0565Scgd  */
36a12c0565Scgd 
37a12c0565Scgd /*
38a12c0565Scgd  * i386-specific EISA definitions.
39a12c0565Scgd  * NOT TO BE USED DIRECTLY BY MACHINE INDEPENDENT CODE.
40a12c0565Scgd  */
41a12c0565Scgd #define	EISA_ID			"EISA"
42a12c0565Scgd #define	EISA_ID_LEN		(sizeof(EISA_ID) - 1)
43a12c0565Scgd #define	EISA_ID_PADDR		0xfffd9
44a12c0565Scgd 
45a33bcafdSfvdl extern struct x86_bus_dma_tag eisa_bus_dma_tag;
46a12c0565Scgd 
4726ab868eSfvdl /* EISA Edge/Level trigger control registers */
4826ab868eSfvdl #define ELCR0   0x4d0                   /* eisa irq 0-7 */
4926ab868eSfvdl #define ELCR1   0x4d1                   /* eisa irq 8-15 */
5026ab868eSfvdl 
51*519d8d98Sknakahara #include <machine/intr.h> /* for intr_handle_t */
52a12c0565Scgd /*
53a12c0565Scgd  * Types provided to machine-independent EISA code.
54a12c0565Scgd  */
55a12c0565Scgd typedef void *eisa_chipset_tag_t;
56*519d8d98Sknakahara typedef intr_handle_t eisa_intr_handle_t;
57a12c0565Scgd 
58a12c0565Scgd /*
59a12c0565Scgd  * Functions provided to machine-independent EISA code.
60a12c0565Scgd  */
61c82e679eScegger void		eisa_attach_hook(device_t, device_t,
6247449a63Scgd 		    struct eisabus_attach_args *);
6347449a63Scgd int		eisa_maxslots(eisa_chipset_tag_t);
6447449a63Scgd int		eisa_intr_map(eisa_chipset_tag_t, u_int,
6547449a63Scgd 		    eisa_intr_handle_t *);
66e58a356cSchristos const char	*eisa_intr_string(eisa_chipset_tag_t, eisa_intr_handle_t,
67e58a356cSchristos 		    char *, size_t);
68cffb5808Scgd const struct evcnt *eisa_intr_evcnt(eisa_chipset_tag_t, eisa_intr_handle_t);
6947449a63Scgd void		*eisa_intr_establish(eisa_chipset_tag_t,
7047449a63Scgd 		    eisa_intr_handle_t, int, int, int (*)(void *), void *);
7147449a63Scgd void		eisa_intr_disestablish(eisa_chipset_tag_t, void *);
72e207174eSthorpej 
73e207174eSthorpej int		eisa_conf_read_mem(eisa_chipset_tag_t, int, int, int,
74e207174eSthorpej 		    struct eisa_cfg_mem *);
75e207174eSthorpej int		eisa_conf_read_irq(eisa_chipset_tag_t, int, int, int,
76e207174eSthorpej 		    struct eisa_cfg_irq *);
77e207174eSthorpej int		eisa_conf_read_dma(eisa_chipset_tag_t, int, int, int,
78e207174eSthorpej 		    struct eisa_cfg_dma *);
79e207174eSthorpej int		eisa_conf_read_io(eisa_chipset_tag_t, int, int, int,
80e207174eSthorpej 		    struct eisa_cfg_io *);
81