cbus.h revision 16359
116359Sasami/*-
216359Sasami * Copyright (c) 1990 The Regents of the University of California.
316359Sasami * All rights reserved.
416359Sasami *
516359Sasami * This code is derived from software contributed to Berkeley by
616359Sasami * William Jolitz.
716359Sasami *
816359Sasami * Redistribution and use in source and binary forms, with or without
916359Sasami * modification, are permitted provided that the following conditions
1016359Sasami * are met:
1116359Sasami * 1. Redistributions of source code must retain the above copyright
1216359Sasami *    notice, this list of conditions and the following disclaimer.
1316359Sasami * 2. Redistributions in binary form must reproduce the above copyright
1416359Sasami *    notice, this list of conditions and the following disclaimer in the
1516359Sasami *    documentation and/or other materials provided with the distribution.
1616359Sasami * 3. All advertising materials mentioning features or use of this software
1716359Sasami *    must display the following acknowledgement:
1816359Sasami *	This product includes software developed by the University of
1916359Sasami *	California, Berkeley and its contributors.
2016359Sasami * 4. Neither the name of the University nor the names of its contributors
2116359Sasami *    may be used to endorse or promote products derived from this software
2216359Sasami *    without specific prior written permission.
2316359Sasami *
2416359Sasami * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
2516359Sasami * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2616359Sasami * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2716359Sasami * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
2816359Sasami * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2916359Sasami * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
3016359Sasami * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
3116359Sasami * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
3216359Sasami * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
3316359Sasami * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
3416359Sasami * SUCH DAMAGE.
3516359Sasami *
3616359Sasami *	from: @(#)isa.h	5.7 (Berkeley) 5/9/91
3716359Sasami *	$Id: isa.h,v 1.18 1996/01/30 22:55:57 mpp Exp $
3816359Sasami */
3916359Sasami
4016359Sasami#ifndef _PC98_PC98_PC98_H_
4116359Sasami#define	_PC98_PC98_PC98_H_
4216359Sasami
4316359Sasami/* BEWARE:  Included in both assembler and C code */
4416359Sasami
4516359Sasami/*
4616359Sasami * PC98 Bus conventions
4716359Sasami */
4816359Sasami/*
4916359Sasami * PC98 Bus conventions
5016359Sasami * modified for PC9801 by A.Kojima F.Ukai M.Ishii
5116359Sasami *			Kyoto University Microcomputer Club (KMC)
5216359Sasami */
5316359Sasami
5416359Sasami/*
5516359Sasami * Input / Output Port Assignments
5616359Sasami */
5716359Sasami
5816359Sasami#ifndef IO_BEGIN
5916359Sasami#ifndef PC98 /* IBM-PC */
6016359Sasami#define	IO_ISABEGIN	0x000		/* 0x000 - Beginning of I/O Registers */
6116359Sasami#endif
6216359Sasami
6316359Sasami/* PC98 IO address ... very dirty (^_^; */
6416359Sasami
6516359Sasami#define IO_ICU1		0x000		/* 8259A Interrupt Controller #1 */
6616359Sasami#define IO_ICU2		0x008		/* 8259A Interrupt Controller #2 */
6716359Sasami#define IO_DMA		0x001		/* 8237A DMA Controller */
6816359Sasami#define IO_RTC		0x020		/* 4990A RTC */
6916359Sasami#define IO_DMAPG	0x021		/* DMA Page Registers */
7016359Sasami#define IO_COM1		0x030		/* 8251A RS232C serial I/O (int) */
7116359Sasami#define	IO_COM2		0x0b1		/* 8251A RS232C serial I/O (ext) */
7216359Sasami#define	IO_COM3		0x0b9		/* 8251A RS232C serial I/O (ext) */
7316359Sasami#define IO_SYSPORT	0x031		/* 8255A System Port */
7416359Sasami#define IO_LPT		0x040		/* 8255A Printer Port */
7516359Sasami#define IO_KBD		0x041		/* 8251A Keyboard */
7616359Sasami#define IO_PPI		0x035		/* Programmable Peripheral Interface */
7716359Sasami#define IO_NMI		0x050		/* NMI Control */
7816359Sasami#define IO_WAIT		0x05F		/* WAIT 0.6 us */
7916359Sasami#define IO_GDC1		0x060		/* 7220 GDC Text Control */
8016359Sasami#define IO_TIMER	0x071		/* 8253C Timer */
8116359Sasami#define IO_SASI		0x080		/* SASI Hard Disk Controller */
8216359Sasami#define	IO_SOUND	0x188		/* YM2203 FM sound board */
8316359Sasami#define	IO_GDC2		0x0a0		/* 7220 GDC Graphic Control */
8416359Sasami#define	IO_EGC		0x4a0		/* 7220 GDC Graphic Control */
8516359Sasami#define	IO_CGROM	0x0a1		/* Character ROM */
8616359Sasami#define IO_SCSI		0xCC0		/* SCSI Controller */
8716359Sasami#define IO_FD1		0x090		/* 765A 1MB FDC */
8816359Sasami#define IO_FD2		0x0c8		/* 765A 640KB FDC */
8916359Sasami#define IO_FDPORT	0x0be		/* FD I/F port (1M<->640K,EMTON) */
9016359Sasami#define IO_BEEPF	0x3fdb		/* beep frequency */
9116359Sasami#define IO_MOUSE	0x7fd9		/* mouse */
9216359Sasami#define IO_MOUSETM	0xdfbd		/* mouse timer */
9316359Sasami#define IO_REEST	0x0F0		/* CPU FPU reset */
9416359Sasami#define IO_A2OEN	0x0F2		/* A20 enable */
9516359Sasami#define IO_A20CT	0x0F6		/* A20 control enable/disable */
9616359Sasami#define IO_NPX		0x0F8		/* Numeric Coprocessor */
9716359Sasami#define IO_BMS		0x7fd9		/* Bus Mouse */
9816359Sasami#define IO_MSE		0x7fd9		/* Bus Mouse */
9916359Sasami#define IO_SIO1		0x0d0		/* MC16550II ext RS232C */
10016359Sasami#define IO_SIO2		0x8d0		/* MC16550II ext RS232C */
10116359Sasami
10216359Sasami/*#ifdef PC98NS*/
10316359Sasami#if 1
10416359Sasami/* Oct 13, ukai */
10516359Sasami#define IO_WD1_NEC	0x640		/* 98note IDE Hard disk controller */
10616359Sasami#define IO_WD1_EPSON	0x80		/* 386note Hard disk controller */
10716359Sasami#define	IO_WD1		IO_WD1_NEC	/* IDE Hard disk controller */
10816359Sasami#endif
10916359Sasami
11016359Sasami#ifndef PC98 /* IBM-PC */
11116359Sasami#define	IO_ISAEND	0x3FF		/* - 0x3FF End of I/O Registers */
11216359Sasami#endif	IO_ISABEGIN
11316359Sasami#endif
11416359Sasami
11516359Sasami/*
11616359Sasami * Input / Output Port Sizes - these are from several sources, and tend
11716359Sasami * to be the larger of what was found, ie COM ports can be 4, but some
11816359Sasami * boards do not fully decode the address, thus 8 ports are used.
11916359Sasami */
12016359Sasami
12116359Sasami#ifndef	IO_PC98SIZES
12216359Sasami#define	IO_PC98SIZES
12316359Sasami
12416359Sasami#define	IO_COMSIZE	8		/* 8250, 16X50 com controllers (4?) */
12516359Sasami#define	IO_CGASIZE	16		/* CGA controllers */
12616359Sasami#define	IO_DMASIZE	16		/* 8237 DMA controllers */
12716359Sasami#define	IO_DPGSIZE	32		/* 74LS612 DMA page registers */
12816359Sasami#define	IO_FDCSIZE	8		/* Nec765 floppy controllers */
12916359Sasami#define	IO_WDCSIZE	8		/* WD compatible disk controllers */
13016359Sasami#define	IO_GAMSIZE	16		/* AT compatible game controllers */
13116359Sasami#define	IO_ICUSIZE	16		/* 8259A interrupt controllers */
13216359Sasami#define	IO_KBDSIZE	16		/* 8042 Keyboard controllers */
13316359Sasami#define	IO_LPTSIZE	8		/* LPT controllers, some use only 4 */
13416359Sasami#define	IO_MDASIZE	16		/* Monochrome display controllers */
13516359Sasami#define	IO_RTCSIZE	16		/* CMOS real time clock, NMI control */
13616359Sasami#define	IO_TMRSIZE	16		/* 8253 programmable timers */
13716359Sasami#define	IO_NPXSIZE	16		/* 80387/80487 NPX registers */
13816359Sasami#define	IO_VGASIZE	16		/* VGA controllers */
13916359Sasami#define IO_EISASIZE	4096		/* EISA controllers */
14016359Sasami#define	IO_PMPSIZE	2		/* 82347 power management peripheral */
14116359Sasami
14216359Sasami#endif	/* IO_PC98SIZES */
14316359Sasami
14416359Sasami/*
14516359Sasami * Input / Output Memory Physical Addresses
14616359Sasami */
14716359Sasami
14816359Sasami#ifndef	IOM_BEGIN
14916359Sasami#define	IOM_BEGIN	0x0a0000		/* Start of I/O Memory "hole" */
15016359Sasami#define	IOM_END		0x100000		/* End of I/O Memory "hole" */
15116359Sasami#define	IOM_SIZE	(IOM_END - IOM_BEGIN)
15216359Sasami#endif	IOM_BEGIN
15316359Sasami
15416359Sasami/*
15516359Sasami * RAM Physical Address Space (ignoring the above mentioned "hole")
15616359Sasami */
15716359Sasami
15816359Sasami#ifndef	RAM_BEGIN
15916359Sasami#define	RAM_BEGIN	0x0000000	/* Start of RAM Memory */
16016359Sasami#ifdef	EPSON_BOUNCEDMA
16116359Sasami#define	RAM_END		0x0f00000	/* End of EPSON GR?? RAM Memory */
16216359Sasami#else
16316359Sasami#define	RAM_END		0x1000000	/* End of RAM Memory */
16416359Sasami#endif
16516359Sasami#define	RAM_SIZE	(RAM_END - RAM_BEGIN)
16616359Sasami#endif	RAM_BEGIN
16716359Sasami
16816359Sasami#ifndef PC98 /* IBM-PC */
16916359Sasami/*
17016359Sasami * Oddball Physical Memory Addresses
17116359Sasami */
17216359Sasami#ifndef	COMPAQ_RAMRELOC
17316359Sasami#define	COMPAQ_RAMRELOC	0x80c00000	/* Compaq RAM relocation/diag */
17416359Sasami#define	COMPAQ_RAMSETUP	0x80c00002	/* Compaq RAM setup */
17516359Sasami#define	WEITEK_FPU	0xC0000000	/* WTL 2167 */
17616359Sasami#define	CYRIX_EMC	0xC0000000	/* Cyrix EMC */
17716359Sasami#endif	COMPAQ_RAMRELOC
17816359Sasami#endif
17916359Sasami
18016359Sasami/*
18116359Sasami * Obtained from NetBSD/pc98
18216359Sasami */
18316359Sasami#define MADDRUNK -1
18416359Sasami
18516359Sasami#endif /* !_PC98_PC98_PC98_H_ */
186