isa_machdep.h revision 1.10
1/*	$NetBSD: isa_machdep.h,v 1.6 1996/05/03 19:14:56 christos Exp $	*/
2
3/*-
4 * Copyright (c) 1990 The Regents of the University of California.
5 * All rights reserved.
6 *
7 * This code is derived from software contributed to Berkeley by
8 * William Jolitz.
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 * 1. Redistributions of source code must retain the above copyright
14 *    notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 *    notice, this list of conditions and the following disclaimer in the
17 *    documentation and/or other materials provided with the distribution.
18 * 3. All advertising materials mentioning features or use of this software
19 *    must display the following acknowledgement:
20 *	This product includes software developed by the University of
21 *	California, Berkeley and its contributors.
22 * 4. Neither the name of the University nor the names of its contributors
23 *    may be used to endorse or promote products derived from this software
24 *    without specific prior written permission.
25 *
26 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
27 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
30 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 * SUCH DAMAGE.
37 *
38 *	@(#)isa.h	5.7 (Berkeley) 5/9/91
39 */
40
41/*
42 * Various pieces of the i386 port want to include this file without
43 * or in spite of using isavar.h, and should be fixed.
44 */
45
46#ifndef _I386_ISA_MACHDEP_H_			/* XXX */
47#define _I386_ISA_MACHDEP_H_			/* XXX */
48
49/*
50 * XXX THIS FILE IS A MESS.  copyright: berkeley's probably.
51 * contents from isavar.h and isareg.h, mostly the latter.
52 * perhaps charles's?
53 *
54 * copyright from berkeley's isa.h which is now dev/isa/isareg.h.
55 */
56
57/*
58 * Types provided to machine-independent ISA code.
59 */
60typedef void *isa_chipset_tag_t;
61
62struct device;			/* XXX */
63struct isabus_attach_args;	/* XXX */
64
65/*
66 * Functions provided to machine-independent ISA code.
67 */
68void	isa_attach_hook __P((struct device *, struct device *,
69	    struct isabus_attach_args *));
70void	*isa_intr_establish __P((isa_chipset_tag_t ic, int irq, int type,
71	    int level, int (*ih_fun)(void *), void *ih_arg, char *ih_what));
72void	isa_intr_disestablish __P((isa_chipset_tag_t ic, void *handler));
73
74/*
75 * ALL OF THE FOLLOWING ARE MACHINE-DEPENDENT, AND SHOULD NOT BE USED
76 * BY PORTABLE CODE.
77 */
78/*
79 * XXX Various seemingly PC-specific constants, some of which may be
80 * unnecessary anyway.
81 */
82
83/*
84 * RAM Physical Address Space (ignoring the above mentioned "hole")
85 */
86#define	RAM_BEGIN	0x0000000	/* Start of RAM Memory */
87#define	RAM_END		0x1000000	/* End of RAM Memory */
88#define	RAM_SIZE	(RAM_END - RAM_BEGIN)
89
90/*
91 * Oddball Physical Memory Addresses
92 */
93#define	COMPAQ_RAMRELOC	0x80c00000	/* Compaq RAM relocation/diag */
94#define	COMPAQ_RAMSETUP	0x80c00002	/* Compaq RAM setup */
95#define	WEITEK_FPU	0xC0000000	/* WTL 2167 */
96#define	CYRIX_EMC	0xC0000000	/* Cyrix EMC */
97
98/*
99 * stuff that used to be in pccons.c
100 */
101#define	MONO_BUF	0xB0000
102#define	CGA_BUF		0xB8000
103#define	IOPHYSMEM	0xA0000
104
105
106/*
107 * ISA DMA bounce buffers.
108 * XXX should be made partially machine- and bus-mapping-independent.
109 *
110 * DMA_BOUNCE is the number of pages of low-addressed physical memory
111 * to acquire for ISA bounce buffers. If physical memory below 16 MB
112 * then DMA_BOUNCE_LOW will be used.
113 */
114
115#ifndef DMA_BOUNCE
116#define	DMA_BOUNCE      48		/* number of pages if memory > 16M */
117#endif
118
119#ifndef DMA_BOUNCE_LOW
120#define	DMA_BOUNCE_LOW  16		/* number of pages if memory <= 16M */
121#endif
122
123/*
124 * Variables and macros to deal with the ISA I/O hole.
125 * XXX These should be converted to machine- and bus-mapping-independent
126 * function definitions, invoked through the softc.
127 */
128
129extern u_long atdevbase;           /* kernel virtual address of "hole" */
130
131/*
132 * Given a kernel virtual address for some location
133 * in the "hole" I/O space, return a physical address.
134 */
135#define ISA_PHYSADDR(v) ((void *) ((u_long)(v) - atdevbase + IOM_BEGIN))
136
137/*
138 * Given a physical address in the "hole",
139 * return a kernel virtual address.
140 */
141#define ISA_HOLE_VADDR(p)  ((void *) ((u_long)(p) - IOM_BEGIN + atdevbase))
142
143
144/*
145 * Miscellanous functions.
146 */
147void sysbeep __P((int, int));		/* beep with the system speaker */
148void isadma_init __P((void));
149
150#endif /* _I386_ISA_MACHDEP_H_ XXX */
151