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