neoreg.h revision 1.1 1 1.1 thorpej /* $NetBSD: neoreg.h,v 1.1 2000/11/05 06:43:46 thorpej Exp $ */
2 1.1 thorpej
3 1.1 thorpej /*
4 1.1 thorpej * Copyright (c) 1999 Cameron Grant <gandalf (at) vilnya.demon.co.uk>
5 1.1 thorpej * All rights reserved.
6 1.1 thorpej *
7 1.1 thorpej * Derived from the public domain Linux driver
8 1.1 thorpej *
9 1.1 thorpej * Redistribution and use in source and binary forms, with or without
10 1.1 thorpej * modification, are permitted provided that the following conditions
11 1.1 thorpej * are met:
12 1.1 thorpej * 1. Redistributions of source code must retain the above copyright
13 1.1 thorpej * notice, this list of conditions and the following disclaimer.
14 1.1 thorpej * 2. Redistributions in binary form must reproduce the above copyright
15 1.1 thorpej * notice, this list of conditions and the following disclaimer in the
16 1.1 thorpej * documentation and/or other materials provided with the distribution.
17 1.1 thorpej *
18 1.1 thorpej * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
19 1.1 thorpej * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 1.1 thorpej * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 1.1 thorpej * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
22 1.1 thorpej * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 1.1 thorpej * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 1.1 thorpej * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 1.1 thorpej * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHERIN CONTRACT, STRICT
26 1.1 thorpej * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 1.1 thorpej * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THEPOSSIBILITY OF
28 1.1 thorpej * SUCH DAMAGE.
29 1.1 thorpej *
30 1.1 thorpej * OpenBSD: neoreg.h,v 1.1 2000/04/13 00:10:52 csapuntz Exp
31 1.1 thorpej */
32 1.1 thorpej
33 1.1 thorpej #ifndef _DEV_PCI_NEOREG_H_
34 1.1 thorpej #define _DEV_PCI_NEOREG_H_
35 1.1 thorpej
36 1.1 thorpej /* The BIOS signature. */
37 1.1 thorpej #define NM_SIGNATURE 0x4e4d0000
38 1.1 thorpej /* Signature mask. */
39 1.1 thorpej #define NM_SIG_MASK 0xffff0000
40 1.1 thorpej
41 1.1 thorpej /* Size of the second memory area. */
42 1.1 thorpej #define NM_PORT2_SIZE 4096
43 1.1 thorpej
44 1.1 thorpej /* The base offset of the mixer in the second memory area. */
45 1.1 thorpej #define NM_MIXER_OFFSET 0x600
46 1.1 thorpej
47 1.1 thorpej /* The maximum size of a coefficient entry. */
48 1.1 thorpej #define NM_MAX_COEFFICIENT 0x5000
49 1.1 thorpej
50 1.1 thorpej /* The interrupt register. */
51 1.1 thorpej #define NM_INT_REG 0xa04
52 1.1 thorpej /* And its bits. */
53 1.1 thorpej #define NM_PLAYBACK_INT 0x40
54 1.1 thorpej #define NM_RECORD_INT 0x100
55 1.1 thorpej #define NM_MISC_INT_1 0x4000
56 1.1 thorpej #define NM_MISC_INT_2 0x1
57 1.1 thorpej
58 1.1 thorpej /* The AV's "mixer ready" status bit and location. */
59 1.1 thorpej #define NM_MIXER_STATUS_OFFSET 0xa04
60 1.1 thorpej #define NM_MIXER_READY_MASK 0x0800
61 1.1 thorpej
62 1.1 thorpej /*
63 1.1 thorpej * For the ZX. It uses the same interrupt register, but it holds 32
64 1.1 thorpej * bits instead of 16.
65 1.1 thorpej */
66 1.1 thorpej #define NM2_PLAYBACK_INT 0x10000
67 1.1 thorpej #define NM2_RECORD_INT 0x80000
68 1.1 thorpej #define NM2_MISC_INT_1 0x8
69 1.1 thorpej #define NM2_MISC_INT_2 0x2
70 1.1 thorpej
71 1.1 thorpej /* The ZX's "mixer ready" status bit and location. */
72 1.1 thorpej #define NM2_MIXER_STATUS_OFFSET 0xa06
73 1.1 thorpej #define NM2_MIXER_READY_MASK 0x0800
74 1.1 thorpej
75 1.1 thorpej /* The playback registers start from here. */
76 1.1 thorpej #define NM_PLAYBACK_REG_OFFSET 0x0
77 1.1 thorpej /* The record registers start from here. */
78 1.1 thorpej #define NM_RECORD_REG_OFFSET 0x200
79 1.1 thorpej
80 1.1 thorpej /* The rate register is located 2 bytes from the start of the register area. */
81 1.1 thorpej #define NM_RATE_REG_OFFSET 2
82 1.1 thorpej
83 1.1 thorpej /* Mono/stereo flag, number of bits on playback, and rate mask. */
84 1.1 thorpej #define NM_RATE_STEREO 1
85 1.1 thorpej #define NM_RATE_BITS_16 2
86 1.1 thorpej #define NM_RATE_MASK 0xf0
87 1.1 thorpej
88 1.1 thorpej /* Playback enable register. */
89 1.1 thorpej #define NM_PLAYBACK_ENABLE_REG (NM_PLAYBACK_REG_OFFSET + 0x1)
90 1.1 thorpej #define NM_PLAYBACK_ENABLE_FLAG 1
91 1.1 thorpej #define NM_PLAYBACK_ONESHOT 2
92 1.1 thorpej #define NM_PLAYBACK_FREERUN 4
93 1.1 thorpej
94 1.1 thorpej /* Mutes the audio output. */
95 1.1 thorpej #define NM_AUDIO_MUTE_REG (NM_PLAYBACK_REG_OFFSET + 0x18)
96 1.1 thorpej #define NM_AUDIO_MUTE_LEFT 0x8000
97 1.1 thorpej #define NM_AUDIO_MUTE_RIGHT 0x0080
98 1.1 thorpej #define NM_AUDIO_MUTE_BOTH 0x8080
99 1.1 thorpej
100 1.1 thorpej /* Recording enable register. */
101 1.1 thorpej #define NM_RECORD_ENABLE_REG (NM_RECORD_REG_OFFSET + 0)
102 1.1 thorpej #define NM_RECORD_ENABLE_FLAG 1
103 1.1 thorpej #define NM_RECORD_FREERUN 2
104 1.1 thorpej
105 1.1 thorpej #define NM_RBUFFER_START (NM_RECORD_REG_OFFSET + 0x4)
106 1.1 thorpej #define NM_RBUFFER_END (NM_RECORD_REG_OFFSET + 0x10)
107 1.1 thorpej #define NM_RBUFFER_WMARK (NM_RECORD_REG_OFFSET + 0xc)
108 1.1 thorpej #define NM_RBUFFER_CURRP (NM_RECORD_REG_OFFSET + 0x8)
109 1.1 thorpej
110 1.1 thorpej #define NM_PBUFFER_START (NM_PLAYBACK_REG_OFFSET + 0x4)
111 1.1 thorpej #define NM_PBUFFER_END (NM_PLAYBACK_REG_OFFSET + 0x14)
112 1.1 thorpej #define NM_PBUFFER_WMARK (NM_PLAYBACK_REG_OFFSET + 0xc)
113 1.1 thorpej #define NM_PBUFFER_CURRP (NM_PLAYBACK_REG_OFFSET + 0x8)
114 1.1 thorpej
115 1.1 thorpej #endif /* _DEV_PCI_NEOREG_H_ */
116