xref: /openbsd-src/sys/arch/hppa/dev/mongoosereg.h (revision cdaa8b471d5e4ae4ca0988c3be8c62bf8cbad0b1)
1*cdaa8b47Smiod /*	$OpenBSD: mongoosereg.h,v 1.2 2008/08/24 18:53:36 miod Exp $	*/
2a8c1b917Smiod 
3a8c1b917Smiod /*
4a8c1b917Smiod  * Copyright (c) 1998-2003 Michael Shalayeff
5a8c1b917Smiod  * All rights reserved.
6a8c1b917Smiod  *
7a8c1b917Smiod  * Redistribution and use in source and binary forms, with or without
8a8c1b917Smiod  * modification, are permitted provided that the following conditions
9a8c1b917Smiod  * are met:
10a8c1b917Smiod  * 1. Redistributions of source code must retain the above copyright
11a8c1b917Smiod  *    notice, this list of conditions and the following disclaimer.
12a8c1b917Smiod  * 2. Redistributions in binary form must reproduce the above copyright
13a8c1b917Smiod  *    notice, this list of conditions and the following disclaimer in the
14a8c1b917Smiod  *    documentation and/or other materials provided with the distribution.
15a8c1b917Smiod  *
16a8c1b917Smiod  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17a8c1b917Smiod  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18a8c1b917Smiod  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19a8c1b917Smiod  * IN NO EVENT SHALL THE AUTHOR OR HIS RELATIVES BE LIABLE FOR ANY DIRECT,
20a8c1b917Smiod  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21a8c1b917Smiod  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
22a8c1b917Smiod  * SERVICES; LOSS OF MIND, USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23a8c1b917Smiod  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
24a8c1b917Smiod  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
25a8c1b917Smiod  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
26a8c1b917Smiod  * THE POSSIBILITY OF SUCH DAMAGE.
27a8c1b917Smiod  */
28a8c1b917Smiod 
29a8c1b917Smiod /* EISA Bus Adapter registers definitions */
30a8c1b917Smiod #define	MONGOOSE_MONGOOSE	0x10000
31a8c1b917Smiod struct mongoose_regs {
32a8c1b917Smiod 	u_int8_t	version;
33a8c1b917Smiod 	u_int8_t	lock;
34a8c1b917Smiod 	u_int8_t	liowait;
35a8c1b917Smiod 	u_int8_t	clock;
36a8c1b917Smiod 	u_int8_t	reserved[0xf000 - 4];
37a8c1b917Smiod 	u_int8_t	intack;
38a8c1b917Smiod };
39a8c1b917Smiod 
40a8c1b917Smiod #define	MONGOOSE_CTRL		0x00000
41a8c1b917Smiod #define	MONGOOSE_NINTS		16
42a8c1b917Smiod struct mongoose_ctrl {
43a8c1b917Smiod 	struct dma0 {
44a8c1b917Smiod 		struct {
45*cdaa8b47Smiod 			u_int16_t	addr : 8;
46*cdaa8b47Smiod 			u_int16_t	count: 8;
47a8c1b917Smiod 		} ch[4];
48a8c1b917Smiod 		u_int8_t	command;
49a8c1b917Smiod 		u_int8_t	request;
50a8c1b917Smiod 		u_int8_t	mask_channel;
51a8c1b917Smiod 		u_int8_t	mode;
52a8c1b917Smiod 		u_int8_t	clr_byte_ptr;
53a8c1b917Smiod 		u_int8_t	master_clear;
54a8c1b917Smiod 		u_int8_t	mask_clear;
55a8c1b917Smiod 		u_int8_t	master_write;
56*cdaa8b47Smiod 		u_int8_t	pad[15];
57a8c1b917Smiod 	}	dma0;
58a8c1b917Smiod 
59a8c1b917Smiod 	u_int8_t	irr0;		/* 0x20 */
60a8c1b917Smiod 	u_int8_t	imr0;
61a8c1b917Smiod 	u_int8_t	iack;		/* 0x22 -- 2 b2b reads generate
62a8c1b917Smiod 					(e)isa Iack cycle & returns int level */
63a8c1b917Smiod 	u_int8_t	pad0[29];
64a8c1b917Smiod 
65a8c1b917Smiod 	struct timers {
66a8c1b917Smiod 		u_int8_t	sysclk;
67a8c1b917Smiod 		u_int8_t	refresh;
68a8c1b917Smiod 		u_int8_t	spkr;
69a8c1b917Smiod 		u_int8_t	ctrl;
70a8c1b917Smiod 		u_int32_t	pad;
71a8c1b917Smiod 	}	tmr[2];			/* 0x40 -- timers control */
72a8c1b917Smiod 	u_int8_t	pad1[16];
73a8c1b917Smiod 
74a8c1b917Smiod 	u_int16_t	inmi;		/* 0x60 NMI control */
75a8c1b917Smiod 	u_int8_t	pad2[30];
76a8c1b917Smiod 	struct {
77a8c1b917Smiod 		u_int8_t	pad0;
78a8c1b917Smiod 		u_int8_t	ch2;
79a8c1b917Smiod 		u_int8_t	ch3;
80a8c1b917Smiod 		u_int8_t	ch1;
81a8c1b917Smiod 		u_int8_t	pad1;
82a8c1b917Smiod 		u_int8_t	pad2[3];
83a8c1b917Smiod 		u_int8_t	ch0;
84a8c1b917Smiod 		u_int8_t	pad4;
85a8c1b917Smiod 		u_int8_t	ch6;
86a8c1b917Smiod 		u_int8_t	ch7;
87a8c1b917Smiod 		u_int8_t	ch5;
88a8c1b917Smiod 		u_int8_t	pad5[3];
89a8c1b917Smiod 		u_int8_t	pad6[16];
90a8c1b917Smiod 	} pr;				/* 0x80 */
91a8c1b917Smiod 
92a8c1b917Smiod 	u_int8_t	irr1;		/* 0xa0 */
93a8c1b917Smiod 	u_int8_t	imr1;
94a8c1b917Smiod 	u_int8_t	pad3[30];
95a8c1b917Smiod 
96a8c1b917Smiod 	struct dma1 {
97a8c1b917Smiod 		struct {
98*cdaa8b47Smiod 			u_int32_t	addr : 16;
99*cdaa8b47Smiod 			u_int32_t	count: 16;
100a8c1b917Smiod 		} ch[4];
101*cdaa8b47Smiod 		u_int16_t	command;
102*cdaa8b47Smiod 		u_int16_t	request;
103*cdaa8b47Smiod 		u_int16_t	mask_channel;
104*cdaa8b47Smiod 		u_int16_t	mode;
105*cdaa8b47Smiod 		u_int16_t	clr_byte_ptr;
106*cdaa8b47Smiod 		u_int16_t	master_clear;
107*cdaa8b47Smiod 		u_int16_t	mask_clear;
108*cdaa8b47Smiod 		u_int16_t	master_write;
109a8c1b917Smiod 	}	dma1;			/* 0xc0 */
110a8c1b917Smiod 
111a8c1b917Smiod 	u_int8_t	master_req;	/* 0xe0 master request register */
112a8c1b917Smiod 	u_int8_t	pad4[31];
113a8c1b917Smiod 
114a8c1b917Smiod 	u_int8_t	pad5[0x3d0];	/* 0x4d0 */
115a8c1b917Smiod 	u_int8_t	pic0;		/* 0 - edge, 1 - level */
116a8c1b917Smiod 	u_int8_t	pic1;
117a8c1b917Smiod 	u_int8_t	pad6[0x460];
118a8c1b917Smiod 	u_int8_t	nmi;
119a8c1b917Smiod 	u_int8_t	nmi_ext;
120a8c1b917Smiod #define	MONGOOSE_NMI_BUSRESET	0x01
121a8c1b917Smiod #define	MONGOOSE_NMI_IOPORT_EN	0x02
122a8c1b917Smiod #define	MONGOOSE_NMI_EN		0x04
123a8c1b917Smiod #define	MONGOOSE_NMI_MTMO_EN	0x08
124a8c1b917Smiod #define	MONGOOSE_NMI_RES4	0x10
125a8c1b917Smiod #define	MONGOOSE_NMI_IOPORT_INT	0x20
126a8c1b917Smiod #define	MONGOOSE_NMI_MASTER_INT	0x40
127a8c1b917Smiod #define	MONGOOSE_NMI_INT	0x80
128a8c1b917Smiod };
129a8c1b917Smiod 
130a8c1b917Smiod #define	MONGOOSE_IOMAP	0x100000
131