xref: /netbsd-src/sys/arch/hp300/stand/common/apcireg.h (revision 95e1ffb15694e54f29f8baaa4232152b703c2a5a)
1*95e1ffb1Schristos /*	$NetBSD: apcireg.h,v 1.2 2005/12/11 12:17:19 christos Exp $	*/
230f361a0Stsutsui 
330f361a0Stsutsui /*
430f361a0Stsutsui  * Copyright (c) 1997 Michael Smith.  All rights reserved.
530f361a0Stsutsui  *
630f361a0Stsutsui  * Redistribution and use in source and binary forms, with or without
730f361a0Stsutsui  * modification, are permitted provided that the following conditions
830f361a0Stsutsui  * are met:
930f361a0Stsutsui  * 1. Redistributions of source code must retain the above copyright
1030f361a0Stsutsui  *    notice, this list of conditions and the following disclaimer.
1130f361a0Stsutsui  * 2. Redistributions in binary form must reproduce the above copyright
1230f361a0Stsutsui  *    notice, this list of conditions and the following disclaimer in the
1330f361a0Stsutsui  *    documentation and/or other materials provided with the distribution.
1430f361a0Stsutsui  *
1530f361a0Stsutsui  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
1630f361a0Stsutsui  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1730f361a0Stsutsui  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1830f361a0Stsutsui  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
1930f361a0Stsutsui  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2030f361a0Stsutsui  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2130f361a0Stsutsui  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2230f361a0Stsutsui  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2330f361a0Stsutsui  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2430f361a0Stsutsui  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2530f361a0Stsutsui  * SUCH DAMAGE.
2630f361a0Stsutsui  */
2730f361a0Stsutsui 
2830f361a0Stsutsui #include <hp300/dev/iotypes.h>
2930f361a0Stsutsui 
3030f361a0Stsutsui struct apciregs {
3130f361a0Stsutsui 	vu_char		ap_data;
3230f361a0Stsutsui 	u_char		pad0[3];
3330f361a0Stsutsui 	vu_char		ap_ier;
3430f361a0Stsutsui 	u_char		pad1[3];
3530f361a0Stsutsui 	vu_char		ap_iir;
3630f361a0Stsutsui #define	ap_fifo	ap_iir
3730f361a0Stsutsui 	u_char		pad2[3];
3830f361a0Stsutsui 	vu_char		ap_cfcr;
3930f361a0Stsutsui 	u_char		pad3[3];
4030f361a0Stsutsui 	vu_char		ap_mcr;
4130f361a0Stsutsui 	u_char		pad4[3];
4230f361a0Stsutsui 	vu_char		ap_lsr;
4330f361a0Stsutsui 	u_char		pad5[3];
4430f361a0Stsutsui 	vu_char		ap_msr;
4530f361a0Stsutsui 	u_char		pad6[3];
4630f361a0Stsutsui 	vu_char		ap_scratch;
4730f361a0Stsutsui };
4830f361a0Stsutsui 
4930f361a0Stsutsui /* max number of apci ports */
5030f361a0Stsutsui #define	APCI_MAXPORT	4
5130f361a0Stsutsui 
5230f361a0Stsutsui /*
5330f361a0Stsutsui  * baudrate divisor calculations.
5430f361a0Stsutsui  *
5530f361a0Stsutsui  * The input clock frequency appears to be 8.0064MHz, giving a scale
5630f361a0Stsutsui  * factor of 500400.  (Using exactly 8MHz gives framing errors with
5730f361a0Stsutsui  * the Apollo keyboard.)
5830f361a0Stsutsui  */
5930f361a0Stsutsui #define	APCIBRD(x)	(500000 / (x))
60