xref: /onnv-gate/usr/src/uts/common/io/audio/drv/audioens/audioens.h (revision 9484:fbd5ddc28e96)
1*9484Sgarrett.damore@Sun.COM /*
2*9484Sgarrett.damore@Sun.COM  * CDDL HEADER START
3*9484Sgarrett.damore@Sun.COM  *
4*9484Sgarrett.damore@Sun.COM  * The contents of this file are subject to the terms of the
5*9484Sgarrett.damore@Sun.COM  * Common Development and Distribution License (the "License").
6*9484Sgarrett.damore@Sun.COM  * You may not use this file except in compliance with the License.
7*9484Sgarrett.damore@Sun.COM  *
8*9484Sgarrett.damore@Sun.COM  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*9484Sgarrett.damore@Sun.COM  * or http://www.opensolaris.org/os/licensing.
10*9484Sgarrett.damore@Sun.COM  * See the License for the specific language governing permissions
11*9484Sgarrett.damore@Sun.COM  * and limitations under the License.
12*9484Sgarrett.damore@Sun.COM  *
13*9484Sgarrett.damore@Sun.COM  * When distributing Covered Code, include this CDDL HEADER in each
14*9484Sgarrett.damore@Sun.COM  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*9484Sgarrett.damore@Sun.COM  * If applicable, add the following below this CDDL HEADER, with the
16*9484Sgarrett.damore@Sun.COM  * fields enclosed by brackets "[]" replaced with your own identifying
17*9484Sgarrett.damore@Sun.COM  * information: Portions Copyright [yyyy] [name of copyright owner]
18*9484Sgarrett.damore@Sun.COM  *
19*9484Sgarrett.damore@Sun.COM  * CDDL HEADER END
20*9484Sgarrett.damore@Sun.COM  */
21*9484Sgarrett.damore@Sun.COM /*
22*9484Sgarrett.damore@Sun.COM  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
23*9484Sgarrett.damore@Sun.COM  * Use is subject to license terms.
24*9484Sgarrett.damore@Sun.COM  */
25*9484Sgarrett.damore@Sun.COM /*
26*9484Sgarrett.damore@Sun.COM  * Purpose: Definitions for the Creative/Ensoniq AudioPCI97 driver.
27*9484Sgarrett.damore@Sun.COM  */
28*9484Sgarrett.damore@Sun.COM /*
29*9484Sgarrett.damore@Sun.COM  * This file is part of Open Sound System
30*9484Sgarrett.damore@Sun.COM  *
31*9484Sgarrett.damore@Sun.COM  * Copyright (C) 4Front Technologies 1996-2008.
32*9484Sgarrett.damore@Sun.COM  *
33*9484Sgarrett.damore@Sun.COM  * This software is released under CDDL 1.0 source license.
34*9484Sgarrett.damore@Sun.COM  * See the COPYING file included in the main directory of this source
35*9484Sgarrett.damore@Sun.COM  * distribution for the license terms and conditions.
36*9484Sgarrett.damore@Sun.COM  */
37*9484Sgarrett.damore@Sun.COM 
38*9484Sgarrett.damore@Sun.COM #ifndef	_AUDIOENS_H
39*9484Sgarrett.damore@Sun.COM #define	_AUDIOENS_H
40*9484Sgarrett.damore@Sun.COM 
41*9484Sgarrett.damore@Sun.COM /* CONCERT PCI-SIG defines */
42*9484Sgarrett.damore@Sun.COM #define	CONC_PCI_VENDID		0x1274U
43*9484Sgarrett.damore@Sun.COM #define	CONC_PCI_DEVID		0x1371U
44*9484Sgarrett.damore@Sun.COM 
45*9484Sgarrett.damore@Sun.COM /* Concert97 direct register offset defines */
46*9484Sgarrett.damore@Sun.COM #define	CONC_bDEVCTL_OFF	0x00	/* Device control/enable */
47*9484Sgarrett.damore@Sun.COM #define	CONC_bMISCCTL_OFF	0x01	/* Miscellaneous control */
48*9484Sgarrett.damore@Sun.COM #define	CONC_bGPIO_OFF		0x02	/* General purpose I/O control */
49*9484Sgarrett.damore@Sun.COM #define	CONC_bJOYCTL_OFF	0x03	/* Joystick control (decode) */
50*9484Sgarrett.damore@Sun.COM #define	CONC_dSTATUS_OFF	0x04	/* long status register */
51*9484Sgarrett.damore@Sun.COM #define	CONC_bINTSUMM_OFF	0x07	/* Interrupt summary status */
52*9484Sgarrett.damore@Sun.COM #define	CONC_bUARTDATA_OFF	0x08	/* UART data R/W - read clears RX int */
53*9484Sgarrett.damore@Sun.COM #define	CONC_bUARTCSTAT_OFF	0x09	/* UART control and status */
54*9484Sgarrett.damore@Sun.COM #define	CONC_bUARTTEST_OFF	0x0a	/* UART test control reg */
55*9484Sgarrett.damore@Sun.COM #define	CONC_bMEMPAGE_OFF	0x0c	/* Memory page select */
56*9484Sgarrett.damore@Sun.COM #define	CONC_dSRCIO_OFF		0x10	/* I/O ctl/stat/data for SRC RAM */
57*9484Sgarrett.damore@Sun.COM #define	CONC_dCODECCTL_OFF	0x14	/* CODEC control - dword read/write */
58*9484Sgarrett.damore@Sun.COM #define	CONC_wNMISTAT_OFF	0x18	/* Legacy NMI status */
59*9484Sgarrett.damore@Sun.COM #define	CONC_bNMIENA_OFF	0x1a	/* Legacy NMI enable */
60*9484Sgarrett.damore@Sun.COM #define	CONC_bNMICTL_OFF	0x1b	/* Legacy control */
61*9484Sgarrett.damore@Sun.COM #define	CONC_dSPDIF_OFF		0x1c	/* SPDIF status control */
62*9484Sgarrett.damore@Sun.COM #define	CONC_bSERFMT_OFF	0x20	/* Serial device control */
63*9484Sgarrett.damore@Sun.COM #define	CONC_bSERCTL_OFF	0x21	/* Serial device format */
64*9484Sgarrett.damore@Sun.COM #define	CONC_bSKIPC_OFF		0x22	/* DAC skip count reg */
65*9484Sgarrett.damore@Sun.COM #define	CONC_wDAC1IC_OFF	0x24	/* Synth int count in sample frames */
66*9484Sgarrett.damore@Sun.COM #define	CONC_wDAC1CIC_OFF	0x26	/* Synth current int count */
67*9484Sgarrett.damore@Sun.COM #define	CONC_wDAC2IC_OFF	0x28	/* DAC int count in sample frames */
68*9484Sgarrett.damore@Sun.COM #define	CONC_wDAC2CIC_OFF	0x2a	/* DAC current int count */
69*9484Sgarrett.damore@Sun.COM #define	CONC_wADCIC_OFF		0x2c	/* ADC int count in sample frames */
70*9484Sgarrett.damore@Sun.COM #define	CONC_wADCCIC_OFF	0x2e	/* ADC current int count */
71*9484Sgarrett.damore@Sun.COM #define	CONC_MEMBASE_OFF	0x30 /* Memory window base - 16 byte window */
72*9484Sgarrett.damore@Sun.COM 
73*9484Sgarrett.damore@Sun.COM /* Concert memory page-banked register offset defines */
74*9484Sgarrett.damore@Sun.COM #define	CONC_dDAC1PADDR_OFF	0x30	/* Synth host frame PCI phys addr */
75*9484Sgarrett.damore@Sun.COM #define	CONC_wDAC1FC_OFF	0x34	/* Synth host frame count in DWORDS */
76*9484Sgarrett.damore@Sun.COM #define	CONC_wDAC1CFC_OFF	0x36	/* Synth host current frame count */
77*9484Sgarrett.damore@Sun.COM #define	CONC_dDAC2PADDR_OFF	0x38	/* DAC host frame PCI phys addr */
78*9484Sgarrett.damore@Sun.COM #define	CONC_wDAC2FC_OFF	0x3c	/* DAC host frame count in DWORDS */
79*9484Sgarrett.damore@Sun.COM #define	CONC_wDAC2CFC_OFF	0x3e	/* DAC host current frame count */
80*9484Sgarrett.damore@Sun.COM #define	CONC_dADCPADDR_OFF	0x30	/* ADC host frame PCI phys addr */
81*9484Sgarrett.damore@Sun.COM #define	CONC_wADCFC_OFF		0x34	/* ADC host frame count in DWORDS */
82*9484Sgarrett.damore@Sun.COM #define	CONC_wADCCFC_OFF	0x36	/* ADC host current frame count */
83*9484Sgarrett.damore@Sun.COM 
84*9484Sgarrett.damore@Sun.COM /* Concert memory page number defines */
85*9484Sgarrett.damore@Sun.COM #define	CONC_DAC1RAM_PAGE	0x00	/* Synth host/serial I/F RAM */
86*9484Sgarrett.damore@Sun.COM #define	CONC_DAC2RAM_PAGE	0x04	/* DAC host/serial I/F RAM */
87*9484Sgarrett.damore@Sun.COM #define	CONC_ADCRAM_PAGE	0x08	/* ADC host/serial I/F RAM */
88*9484Sgarrett.damore@Sun.COM #define	CONC_DAC1CTL_PAGE	0x0c	/* Page bank for synth host control */
89*9484Sgarrett.damore@Sun.COM #define	CONC_DAC2CTL_PAGE	0x0c	/* Page bank for DAC host control */
90*9484Sgarrett.damore@Sun.COM #define	CONC_ADCCTL_PAGE	0x0d	/* Page bank for ADC host control */
91*9484Sgarrett.damore@Sun.COM #define	CONC_FIFO0_PAGE		0x0e	/* page 0 of UART "FIFO" (rx stash) */
92*9484Sgarrett.damore@Sun.COM #define	CONC_FIFO1_PAGE		0x0f	/* page 1 of UART "FIFO" (rx stash) */
93*9484Sgarrett.damore@Sun.COM 
94*9484Sgarrett.damore@Sun.COM /* SPDIF defines - only newer chips */
95*9484Sgarrett.damore@Sun.COM #define	CONC_SPDIF_CLKACCURACY	0x00000000U	/* normal mode */
96*9484Sgarrett.damore@Sun.COM #define	CONC_SPDIF_SR48KHZ	0x02000000U	/* 48KHZ clock, must be set */
97*9484Sgarrett.damore@Sun.COM #define	CONC_SPDIF_CHNO_MASK	0x00f00000U	/* channel number */
98*9484Sgarrett.damore@Sun.COM #define	CONC_SPDIF_SRCNO_MASK	0x000f0000U	/* source number */
99*9484Sgarrett.damore@Sun.COM #define	CONC_SPDIF_L		0x00008000U	/* 0 = commercial original */
100*9484Sgarrett.damore@Sun.COM #define	CONC_SPDIF_CATCODE	0x00007f00U	/* category code */
101*9484Sgarrett.damore@Sun.COM #define	CONC_SPDIF_EMPHASIS	0x00000008U	/* 2 ch, 50/15 usec preemph */
102*9484Sgarrett.damore@Sun.COM #define	CONC_SPDIF_COPY		0x00000004U	/* copy permitted */
103*9484Sgarrett.damore@Sun.COM #define	CONC_SPDIF_AC3		0x00000002U	/* data is not pcm (AC3) */
104*9484Sgarrett.damore@Sun.COM 
105*9484Sgarrett.damore@Sun.COM /* PCM format defines */
106*9484Sgarrett.damore@Sun.COM #define	CONC_PCM_DAC1_STEREO	0x01
107*9484Sgarrett.damore@Sun.COM #define	CONC_PCM_DAC1_16BIT	0x02
108*9484Sgarrett.damore@Sun.COM #define	CONC_PCM_DAC2_STEREO	0x04
109*9484Sgarrett.damore@Sun.COM #define	CONC_PCM_DAC2_16BIT	0x08
110*9484Sgarrett.damore@Sun.COM #define	CONC_PCM_ADC_STEREO	0x10
111*9484Sgarrett.damore@Sun.COM #define	CONC_PCM_ADC_16BIT	0x20
112*9484Sgarrett.damore@Sun.COM 
113*9484Sgarrett.damore@Sun.COM /* Device Control defines */
114*9484Sgarrett.damore@Sun.COM #define	CONC_DEVCTL_PCICLK_DS	0x01	/* PCI Clock Disable */
115*9484Sgarrett.damore@Sun.COM #define	CONC_DEVCTL_XTALCLK_DS	0x02	/* Crystal Clock Disable */
116*9484Sgarrett.damore@Sun.COM #define	CONC_DEVCTL_JSTICK_EN	0x04	/* Joystick Enable */
117*9484Sgarrett.damore@Sun.COM #define	CONC_DEVCTL_UART_EN	0x08	/* UART Enable  */
118*9484Sgarrett.damore@Sun.COM #define	CONC_DEVCTL_ADC_EN	0x10	/* ADC Enable (record) */
119*9484Sgarrett.damore@Sun.COM #define	CONC_DEVCTL_DAC2_EN	0x20	/* DAC2 Enable (playback) */
120*9484Sgarrett.damore@Sun.COM #define	CONC_DEVCTL_DAC1_EN	0x40	/* DAC1 Enabale (synth) */
121*9484Sgarrett.damore@Sun.COM 
122*9484Sgarrett.damore@Sun.COM /* Misc Control defines */
123*9484Sgarrett.damore@Sun.COM #define	CONC_MISCCTL_PDLEV_D0	0x00	/* These bits reflect the */
124*9484Sgarrett.damore@Sun.COM #define	CONC_MISCCTL_PDLEV_D1	0x01	/* power down state of  */
125*9484Sgarrett.damore@Sun.COM #define	CONC_MISCCTL_PDLEV_D2	0x02	/* the part */
126*9484Sgarrett.damore@Sun.COM #define	CONC_MISCCTL_PDLEV_D3	0x03	/* */
127*9484Sgarrett.damore@Sun.COM #define	CONC_MISCCTL_CCBINTRM_EN	0x04	/* CCB module interrupt mask */
128*9484Sgarrett.damore@Sun.COM 
129*9484Sgarrett.damore@Sun.COM #define	CONC_MISCCTL_SYNC_RES	0x40	/* for AC97 warm reset */
130*9484Sgarrett.damore@Sun.COM 
131*9484Sgarrett.damore@Sun.COM /* Serial Control defines */
132*9484Sgarrett.damore@Sun.COM #define	CONC_SERCTL_DAC1IE	0x01 /* playback interrupt enable P1_INT_EN */
133*9484Sgarrett.damore@Sun.COM #define	CONC_SERCTL_DAC2IE	0x02 /* playback interrupt enable P2_INT_EN */
134*9484Sgarrett.damore@Sun.COM #define	CONC_SERCTL_ADCIE	0x04	/* record interrupt enable R1_INT_EN */
135*9484Sgarrett.damore@Sun.COM #define	CONC_SERCTL_DAC1PAUSE	0x08	/* playback pause */
136*9484Sgarrett.damore@Sun.COM #define	CONC_SERCTL_DAC2PAUSE	0x10	/* playback pause */
137*9484Sgarrett.damore@Sun.COM #define	CONC_SERCTL_ADCLOOP	0x80
138*9484Sgarrett.damore@Sun.COM #define	CONC_SERCTL_DAC2LOOP	0x40
139*9484Sgarrett.damore@Sun.COM #define	CONC_SERCTL_DAC1LOOP	0x20
140*9484Sgarrett.damore@Sun.COM 
141*9484Sgarrett.damore@Sun.COM /* Interrupt Status defines */
142*9484Sgarrett.damore@Sun.COM #define	CONC_STATUS_ADCINT	0x00000001	/* A/D interrupt pending */
143*9484Sgarrett.damore@Sun.COM #define	CONC_STATUS_DAC2INT	0x00000002	/* DAC2 interrupt pending */
144*9484Sgarrett.damore@Sun.COM #define	CONC_STATUS_DAC1INT	0x00000004	/* DAC1 interrupt pending */
145*9484Sgarrett.damore@Sun.COM #define	CONC_STATUS_UARTINT	0x00000008	/* UART interrupt pending */
146*9484Sgarrett.damore@Sun.COM #define	CONC_STATUS_PENDING	0x80000000	/* any interrupt pending */
147*9484Sgarrett.damore@Sun.COM #define	CONC_STATUS_SPDIF_MASK	0x18000000
148*9484Sgarrett.damore@Sun.COM #define	CONC_STATUS_SPDIF_P1P2	0x00000000
149*9484Sgarrett.damore@Sun.COM #define	CONC_STATUS_SPDIF_P1	0x08000000
150*9484Sgarrett.damore@Sun.COM #define	CONC_STATUS_SPDIF_P2	0x10000000
151*9484Sgarrett.damore@Sun.COM #define	CONC_STATUS_SPDIF_REC	0x18000000
152*9484Sgarrett.damore@Sun.COM #define	CONC_STATUS_ECHO	0x04000000
153*9484Sgarrett.damore@Sun.COM #define	CONC_STATUS_SPKR_MASK	0x03000000
154*9484Sgarrett.damore@Sun.COM #define	CONC_STATUS_SPKR_2CH	0x00000000
155*9484Sgarrett.damore@Sun.COM #define	CONC_STATUS_SPKR_4CH	0x01000000
156*9484Sgarrett.damore@Sun.COM #define	CONC_STATUS_SPKR_P1	0x02000000
157*9484Sgarrett.damore@Sun.COM #define	CONC_STATUS_SPKR_P2	0x03000000
158*9484Sgarrett.damore@Sun.COM #define	CONC_STATUS_EN_SPDIF	0x00040000
159*9484Sgarrett.damore@Sun.COM 
160*9484Sgarrett.damore@Sun.COM /* JOYCTL register defines */
161*9484Sgarrett.damore@Sun.COM #define	CONC_JOYCTL_200		0x00
162*9484Sgarrett.damore@Sun.COM #define	CONC_JOYCTL_208		0x01
163*9484Sgarrett.damore@Sun.COM #define	CONC_JOYCTL_210		0x02
164*9484Sgarrett.damore@Sun.COM #define	CONC_JOYCTL_218		0x03
165*9484Sgarrett.damore@Sun.COM #define	CONC_JOYCTL_SPDIFEN_B	0x04
166*9484Sgarrett.damore@Sun.COM #define	CONC_JOYCTL_RECEN_B	0x08
167*9484Sgarrett.damore@Sun.COM 
168*9484Sgarrett.damore@Sun.COM /* UARTCSTAT register masks */
169*9484Sgarrett.damore@Sun.COM #define	CONC_UART_RXRDY		0x01
170*9484Sgarrett.damore@Sun.COM #define	CONC_UART_TXRDY		0x02
171*9484Sgarrett.damore@Sun.COM #define	CONC_UART_TXINT		0x04
172*9484Sgarrett.damore@Sun.COM #define	CONC_UART_RXINT		0x80
173*9484Sgarrett.damore@Sun.COM 
174*9484Sgarrett.damore@Sun.COM #define	CONC_UART_CTL		0x03
175*9484Sgarrett.damore@Sun.COM #define	CONC_UART_TXINTEN	0x20
176*9484Sgarrett.damore@Sun.COM #define	CONC_UART_RXINTEN	0x80
177*9484Sgarrett.damore@Sun.COM 
178*9484Sgarrett.damore@Sun.COM /* defines for the CONCERT97 Sample Rate Converters */
179*9484Sgarrett.damore@Sun.COM 
180*9484Sgarrett.damore@Sun.COM /* register/base equates for the SRC RAM */
181*9484Sgarrett.damore@Sun.COM #define	SRC_DAC1_FIFO		0x00
182*9484Sgarrett.damore@Sun.COM #define	SRC_DAC2_FIFO		0x20
183*9484Sgarrett.damore@Sun.COM #define	SRC_ADC_FIFO		0x40
184*9484Sgarrett.damore@Sun.COM #define	SRC_ADC_VOL_L		0x6c
185*9484Sgarrett.damore@Sun.COM #define	SRC_ADC_VOL_R		0x6d
186*9484Sgarrett.damore@Sun.COM #define	SRC_DAC1_BASE		0x70
187*9484Sgarrett.damore@Sun.COM #define	SRC_DAC2_BASE		0x74
188*9484Sgarrett.damore@Sun.COM #define	SRC_ADC_BASE		0x78
189*9484Sgarrett.damore@Sun.COM #define	SRC_DAC1_VOL_L		0x7c
190*9484Sgarrett.damore@Sun.COM #define	SRC_DAC1_VOL_R		0x7d
191*9484Sgarrett.damore@Sun.COM #define	SRC_DAC2_VOL_L		0x7e
192*9484Sgarrett.damore@Sun.COM #define	SRC_DAC2_VOL_R		0x7f
193*9484Sgarrett.damore@Sun.COM 
194*9484Sgarrett.damore@Sun.COM #define	SRC_TRUNC_N_OFF		0x00
195*9484Sgarrett.damore@Sun.COM #define	SRC_INT_REGS_OFF	0x01
196*9484Sgarrett.damore@Sun.COM #define	SRC_ACCUM_FRAC_OFF	0x02
197*9484Sgarrett.damore@Sun.COM #define	SRC_VFREQ_FRAC_OFF	0x03
198*9484Sgarrett.damore@Sun.COM 
199*9484Sgarrett.damore@Sun.COM 
200*9484Sgarrett.damore@Sun.COM /* miscellaneous control defines */
201*9484Sgarrett.damore@Sun.COM #define	SRC_IOPOLL_COUNT	0x20000UL
202*9484Sgarrett.damore@Sun.COM #define	SRC_WENABLE		(1UL << 24)
203*9484Sgarrett.damore@Sun.COM #define	SRC_BUSY		(1UL << 23)
204*9484Sgarrett.damore@Sun.COM #define	SRC_DISABLE		(1UL << 22)
205*9484Sgarrett.damore@Sun.COM #define	SRC_DAC1FREEZE		(1UL << 21)
206*9484Sgarrett.damore@Sun.COM #define	SRC_DAC2FREEZE		(1UL << 20)
207*9484Sgarrett.damore@Sun.COM #define	SRC_ADCFREEZE		(1UL << 19)
208*9484Sgarrett.damore@Sun.COM #define	SRC_CTLMASK		0x00780000UL
209*9484Sgarrett.damore@Sun.COM 
210*9484Sgarrett.damore@Sun.COM #endif /* _AUDIOENS_H */
211