mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-11 09:50:12 +00:00
Device driver for onboard CS4231 audio controller which is found
on UltraSPARC workstations. The driver is based on OpenBSD's SBus cs4231 driver and heavily modified to incorporate into sound(4) infrastructure. Due to the lack of APCDMA documentation, the DMA code of SBus cs4231 came from OpenBSD's driver. The driver runs without Giant lock and supports both SBus and EBus based CS4231 audio controller. Special thanks to marius for providing feedbacks during the driver writing. His feedback made it possible to write hiccup free playback code under high system loads. Approved by: jake (mentor) Reviewed by: marius (initial version) Tested by: marius, kwm, Julian C. Dunn(jdunn AT opentrend DOT net)
This commit is contained in:
parent
156cb26583
commit
7a7386a3e2
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=136944
@ -1834,6 +1834,7 @@ device sound
|
||||
#
|
||||
# snd_als4000: Avance Logic ALS4000 PCI.
|
||||
# snd_ad1816: Analog Devices AD1816 ISA PnP/non-PnP.
|
||||
# snd_audiocs: Crystal Semiconductor CS4231 SBus/EBus.
|
||||
# snd_cmi: CMedia CMI8338/CMI8738 PCI.
|
||||
# snd_cs4281: Crystal Semiconductor CS4281 PCI.
|
||||
# snd_csa: Crystal Semiconductor CS461x/428x PCI. (except
|
||||
@ -1867,6 +1868,7 @@ device sound
|
||||
device snd_ad1816
|
||||
device snd_als4000
|
||||
#device snd_au88x0
|
||||
#device snd_audiocs
|
||||
device snd_cmi
|
||||
device snd_cs4281
|
||||
device snd_csa
|
||||
|
@ -25,6 +25,8 @@ dev/ofw/ofw_console.c optional ofw_console
|
||||
dev/ofw/openfirm.c standard
|
||||
dev/ofw/openfirmio.c standard
|
||||
dev/ofw/openpromio.c standard
|
||||
dev/sound/sbus/cs4231.c optional snd_audiocs ebus
|
||||
dev/sound/sbus/cs4231.c optional snd_audiocs sbus
|
||||
dev/syscons/scgfbrndr.c optional sc
|
||||
dev/syscons/schistory.c optional sc
|
||||
dev/syscons/scmouse.c optional sc
|
||||
@ -53,6 +55,7 @@ sparc64/fhc/fhc.c optional fhc
|
||||
sparc64/fhc/fhc_central.c optional fhc central
|
||||
sparc64/fhc/fhc_nexus.c optional fhc
|
||||
sparc64/isa/isa.c optional isa
|
||||
sparc64/isa/isa_dma.c optional isa
|
||||
#sparc64/isa/ofw_isa.c optional ebus
|
||||
#sparc64/isa/ofw_isa.c optional isa
|
||||
sparc64/isa/ofw_isa.c standard
|
||||
|
114
sys/dev/sound/sbus/apcdmareg.h
Normal file
114
sys/dev/sound/sbus/apcdmareg.h
Normal file
@ -0,0 +1,114 @@
|
||||
/* $FreeBSD$ */
|
||||
/* $OpenBSD: apcdmareg.h,v 1.2 2003/06/02 18:53:18 jason Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2001 Jason L. Wright (jason@thought.net)
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Definitions for Sun APC DMA controller.
|
||||
*/
|
||||
|
||||
/* APC DMA registers */
|
||||
#define APC_CSR 0x0010 /* control/status */
|
||||
#define APC_CVA 0x0020 /* capture virtual address */
|
||||
#define APC_CC 0x0024 /* capture count */
|
||||
#define APC_CNVA 0x0028 /* capture next virtual address */
|
||||
#define APC_CNC 0x002c /* capture next count */
|
||||
#define APC_PVA 0x0030 /* playback virtual address */
|
||||
#define APC_PC 0x0034 /* playback count */
|
||||
#define APC_PNVA 0x0038 /* playback next virtual address */
|
||||
#define APC_PNC 0x003c /* playback next count */
|
||||
|
||||
/*
|
||||
* APC DMA Register definitions
|
||||
*/
|
||||
#define APC_CSR_RESET 0x00000001 /* reset */
|
||||
#define APC_CSR_CDMA_GO 0x00000004 /* capture dma go */
|
||||
#define APC_CSR_PDMA_GO 0x00000008 /* playback dma go */
|
||||
#define APC_CSR_CODEC_RESET 0x00000020 /* codec reset */
|
||||
#define APC_CSR_CPAUSE 0x00000040 /* capture dma pause */
|
||||
#define APC_CSR_PPAUSE 0x00000080 /* playback dma pause */
|
||||
#define APC_CSR_CMIE 0x00000100 /* capture pipe empty enb */
|
||||
#define APC_CSR_CMI 0x00000200 /* capture pipe empty intr */
|
||||
#define APC_CSR_CD 0x00000400 /* capture nva dirty */
|
||||
#define APC_CSR_CM 0x00000800 /* capture data lost */
|
||||
#define APC_CSR_PMIE 0x00001000 /* pb pipe empty intr enable */
|
||||
#define APC_CSR_PD 0x00002000 /* pb nva dirty */
|
||||
#define APC_CSR_PM 0x00004000 /* pb pipe empty */
|
||||
#define APC_CSR_PMI 0x00008000 /* pb pipe empty interrupt */
|
||||
#define APC_CSR_EIE 0x00010000 /* error interrupt enable */
|
||||
#define APC_CSR_CIE 0x00020000 /* capture intr enable */
|
||||
#define APC_CSR_PIE 0x00040000 /* playback intr enable */
|
||||
#define APC_CSR_GIE 0x00080000 /* general intr enable */
|
||||
#define APC_CSR_EI 0x00100000 /* error interrupt */
|
||||
#define APC_CSR_CI 0x00200000 /* capture interrupt */
|
||||
#define APC_CSR_PI 0x00400000 /* playback interrupt */
|
||||
#define APC_CSR_GI 0x00800000 /* general interrupt */
|
||||
|
||||
#define APC_CSR_PLAY ( \
|
||||
APC_CSR_EI | \
|
||||
APC_CSR_GIE | \
|
||||
APC_CSR_PIE | \
|
||||
APC_CSR_EIE | \
|
||||
APC_CSR_PDMA_GO | \
|
||||
APC_CSR_PMIE )
|
||||
|
||||
#define APC_CSR_CAPTURE ( \
|
||||
APC_CSR_EI | \
|
||||
APC_CSR_GIE | \
|
||||
APC_CSR_CIE | \
|
||||
APC_CSR_EIE | \
|
||||
APC_CSR_CDMA_GO )
|
||||
|
||||
#define APC_CSR_PLAY_PAUSE (~( \
|
||||
APC_CSR_PPAUSE | \
|
||||
APC_CSR_GI | \
|
||||
APC_CSR_PI | \
|
||||
APC_CSR_CI | \
|
||||
APC_CSR_EI | \
|
||||
APC_CSR_PMI | \
|
||||
APC_CSR_PMIE | \
|
||||
APC_CSR_CMI | \
|
||||
APC_CSR_CMIE ) )
|
||||
|
||||
#define APC_CSR_CAPTURE_PAUSE (~( \
|
||||
APC_CSR_PPAUSE | \
|
||||
APC_CSR_GI | \
|
||||
APC_CSR_PI | \
|
||||
APC_CSR_CI | \
|
||||
APC_CSR_EI | \
|
||||
APC_CSR_PMI | \
|
||||
APC_CSR_PMIE | \
|
||||
APC_CSR_CMI | \
|
||||
APC_CSR_CMIE ) )
|
||||
|
||||
#define APC_CSR_INTR_MASK ( \
|
||||
APC_CSR_GI | \
|
||||
APC_CSR_PI | \
|
||||
APC_CSR_CI | \
|
||||
APC_CSR_EI | \
|
||||
APC_CSR_PMI | \
|
||||
APC_CSR_CMI )
|
1573
sys/dev/sound/sbus/cs4231.c
Normal file
1573
sys/dev/sound/sbus/cs4231.c
Normal file
File diff suppressed because it is too large
Load Diff
248
sys/dev/sound/sbus/cs4231.h
Normal file
248
sys/dev/sound/sbus/cs4231.h
Normal file
@ -0,0 +1,248 @@
|
||||
/* $FreeBSD$ */
|
||||
/*-
|
||||
* Copyright (c) 1996 The NetBSD Foundation, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* This code is derived from software contributed to The NetBSD Foundation
|
||||
* by Ken Hornstein and John Kohl.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the NetBSD
|
||||
* Foundation, Inc. and its contributors.
|
||||
* 4. Neither the name of The NetBSD Foundation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
|
||||
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
|
||||
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Register defs for Crystal Semiconductor CS4231 Audio Codec/mixer
|
||||
* chip, used on Gravis UltraSound MAX cards.
|
||||
*
|
||||
* Block diagram:
|
||||
* +----------------------------------------------------+
|
||||
* | |
|
||||
* | +----------------------------------------------+ |
|
||||
* | |mixed in +-+ | |
|
||||
* | +------------>--| | | |
|
||||
* | mic in | | | |
|
||||
* Mic --+-->| --------- GAIN ->-| | | |
|
||||
* | | AUX 1 in |M| | |
|
||||
* GF1 --)-->| -------------+-->-|U| | |
|
||||
* | | Line in | |X|---- GAIN ----------+ | |
|
||||
* Line --)-->| ---------+---)-->-| | | | |
|
||||
* | | | | | | | | |
|
||||
* | | | | +-+ ADC | |
|
||||
* | | | | | | |
|
||||
* | | | | | | |
|
||||
* | | | +--- L/M --\ | | | AMP-->
|
||||
* | | | \ | | | |
|
||||
* | | | \ | | | |
|
||||
* | | +---- L/M -------O-->--+--------)-------+-|--+-> line
|
||||
* | | mono in /| | | |
|
||||
* +---|-->------------ L/M -----/ | | | |
|
||||
* | AUX 2 in | | | |
|
||||
* CD --------|-->------------ L/M -------+ L/M | |
|
||||
* | | v |
|
||||
* | | | |
|
||||
* | DAC | |
|
||||
* | | | |
|
||||
* +----------------------------------------------------+
|
||||
* | |
|
||||
* | |
|
||||
* v v
|
||||
* Pc BUS (DISK) ???
|
||||
*
|
||||
* Documentation for this chip can be found at:
|
||||
* http://www.cirrus.com/products/overviews/cs4231.html
|
||||
*/
|
||||
|
||||
/*
|
||||
* This file was merged from two header files.(ad1848reg.h and cs4231reg.h)
|
||||
* And the suffix AD1848 and SP was changed to CS4231 and CS respectively.
|
||||
*/
|
||||
/* CS4231 direct registers */
|
||||
#define CS4231_IADDR 0x00
|
||||
#define CS4231_IDATA 0x01
|
||||
#define CS4231_STATUS 0x02
|
||||
#define CS4231_PIO 0x03
|
||||
|
||||
/* Index address register */
|
||||
#define CS_IN_INIT 0x80
|
||||
#define MODE_CHANGE_ENABLE 0x40
|
||||
#define TRANSFER_DISABLE 0x20
|
||||
#define ADDRESS_MASK 0xe0
|
||||
|
||||
/* Status bits */
|
||||
#define INTERRUPT_STATUS 0x01
|
||||
#define PLAYBACK_READY 0x02
|
||||
#define PLAYBACK_LEFT 0x04
|
||||
/* pbright is not left */
|
||||
#define PLAYBACK_UPPER 0x08
|
||||
/* bplower is not upper */
|
||||
#define SAMPLE_ERROR 0x10
|
||||
#define CAPTURE_READY 0x20
|
||||
#define CAPTURE_LEFT 0x40
|
||||
/* cpright is not left */
|
||||
#define CAPTURE_UPPER 0x80
|
||||
/* cplower is not upper */
|
||||
|
||||
/* CS4231 indirect mapped registers */
|
||||
#define CS_LEFT_INPUT_CONTROL 0x00
|
||||
#define CS_RIGHT_INPUT_CONTROL 0x01
|
||||
#define CS_LEFT_AUX1_CONTROL 0x02
|
||||
#define CS_RIGHT_AUX1_CONTROL 0x03
|
||||
#define CS_LEFT_AUX2_CONTROL 0x04
|
||||
#define CS_RIGHT_AUX2_CONTROL 0x05
|
||||
#define CS_LEFT_OUTPUT_CONTROL 0x06
|
||||
#define CS_RIGHT_OUTPUT_CONTROL 0x07
|
||||
#define CS_CLOCK_DATA_FORMAT 0x08
|
||||
#define CS_INTERFACE_CONFIG 0x09
|
||||
#define CS_PIN_CONTROL 0x0a
|
||||
#define CS_TEST_AND_INIT 0x0b
|
||||
#define CS_MISC_INFO 0x0c
|
||||
#define CS_DIGITAL_MIX 0x0d
|
||||
#define CS_UPPER_BASE_COUNT 0x0e
|
||||
#define CS_LOWER_BASE_COUNT 0x0f
|
||||
/* CS4231/AD1845 mode2 registers; added to AD1848 registers */
|
||||
#define CS_ALT_FEATURE1 0x10
|
||||
#define CS_ALT_FEATURE2 0x11
|
||||
#define CS_LEFT_LINE_CONTROL 0x12
|
||||
#define CS_RIGHT_LINE_CONTROL 0x13
|
||||
#define CS_TIMER_LOW 0x14
|
||||
#define CS_TIMER_HIGH 0x15
|
||||
#define CS_UPPER_FREQUENCY_SEL 0x16
|
||||
#define CS_LOWER_FREQUENCY_SEL 0x17
|
||||
#define CS_IRQ_STATUS 0x18
|
||||
#define CS_VERSION_ID 0x19
|
||||
#define CS_MONO_IO_CONTROL 0x1a
|
||||
#define CS_POWERDOWN_CONTROL 0x1b
|
||||
#define CS_REC_FORMAT 0x1c
|
||||
#define CS_XTAL_SELECT 0x1d
|
||||
#define CS_UPPER_REC_CNT 0x1e
|
||||
#define CS_LOWER_REC_CNT 0x1f
|
||||
#define CS_REG_NONE 0xff
|
||||
|
||||
#define CS_IN_MASK 0x2f
|
||||
#define CS_IN_LINE 0x00
|
||||
#define CS_IN_AUX1 0x40
|
||||
#define CS_IN_MIC 0x80
|
||||
#define CS_IN_DAC 0xc0
|
||||
#define CS_MIC_GAIN_ENABLE 0x20
|
||||
#define CS_IN_GAIN_MASK 0xf0
|
||||
|
||||
/* ADC input control - registers I0 (channel 1,left); I1 (channel 1,right) */
|
||||
#define ADC_INPUT_ATTEN_BITS 0x0f
|
||||
#define ADC_INPUT_GAIN_ENABLE 0x20
|
||||
|
||||
/* Aux input control - registers I2 (channel 1,left); I3 (channel 1,right)
|
||||
I4 (channel 2,left); I5 (channel 2,right) */
|
||||
#define AUX_INPUT_ATTEN_BITS 0x1f
|
||||
#define AUX_INPUT_ATTEN_MASK 0xe0
|
||||
#define AUX_INPUT_MUTE 0x80
|
||||
|
||||
/* Output bits - registers I6,I7*/
|
||||
#define OUTPUT_MUTE 0x80
|
||||
#define OUTPUT_ATTEN_BITS 0x3f
|
||||
#define OUTPUT_ATTEN_MASK (~OUTPUT_ATTEN_BITS & 0xff)
|
||||
|
||||
/* Clock and Data format reg bits (some also Capture Data format) - reg I8 */
|
||||
#define CS_CLOCK_DATA_FORMAT_MASK 0x0f
|
||||
#define CLOCK_XTAL1 0x00
|
||||
#define CLOCK_XTAL2 0x01
|
||||
#define CLOCK_FREQ_MASK 0xf1
|
||||
#define CS_AFMT_STEREO 0x10
|
||||
#define CS_AFMT_U8 0x00
|
||||
#define CS_AFMT_MU_LAW 0x20
|
||||
#define CS_AFMT_S16_LE 0x40
|
||||
#define CS_AFMT_A_LAW 0x60
|
||||
#define CS_AFMT_IMA_ADPCM 0xa0
|
||||
#define CS_AFMT_S16_BE 0xc0
|
||||
|
||||
/* Interface Configuration reg bits - register I9 */
|
||||
#define PLAYBACK_ENABLE 0x01
|
||||
#define CAPTURE_ENABLE 0x02
|
||||
#define DUAL_DMA 0x00
|
||||
#define SINGLE_DMA 0x04
|
||||
#define AUTO_CAL_ENABLE 0x08
|
||||
#define PLAYBACK_PIO_ENABLE 0x40
|
||||
#define CAPTURE_PIO_ENABLE 0x80
|
||||
|
||||
/* Pin control bits - register I10 */
|
||||
#define INTERRUPT_ENABLE 0x02
|
||||
#define XCTL0_ENABLE 0x40
|
||||
#define XCTL1_ENABLE 0x80
|
||||
|
||||
/* Test and init reg bits - register I11 (read-only) */
|
||||
#define OVERRANGE_LEFT_MASK 0xfc
|
||||
#define OVERRANGE_RIGHT_MASK 0xf3
|
||||
#define DATA_REQUEST_STATUS 0x10
|
||||
#define AUTO_CAL_IN_PROG 0x20
|
||||
#define PLAYBACK_UNDERRUN 0x40
|
||||
#define CAPTURE_OVERRUN 0x80
|
||||
|
||||
/* Miscellaneous Control reg bits - register I12 */
|
||||
#define CS_ID_MASK 0x70
|
||||
#define CS_MODE2 0x40
|
||||
#define CS_CODEC_ID_MASK 0x0f
|
||||
|
||||
/* Digital Mix Control reg bits - register I13 */
|
||||
#define DIGITAL_MIX1_ENABLE 0x01
|
||||
#define MIX_ATTEN_MASK 0x03
|
||||
|
||||
/* Alternate Feature Enable I - register I16 */
|
||||
#define CS_DAC_ZERO 0x01
|
||||
#define CS_PMC_ENABLE 0x10
|
||||
#define CS_CMC_ENABLE 0x20
|
||||
#define CS_OUTPUT_LVL 0x80
|
||||
|
||||
/* Alternate Feature Enable II - register I17 */
|
||||
#define CS_HPF_ENABLE 0x01
|
||||
#define DUAL_XTAL_ENABLE 0x02
|
||||
|
||||
/* alternate feature status(I24) */
|
||||
#define CS_AFS_TI 0x40 /* timer interrupt */
|
||||
#define CS_AFS_CI 0x20 /* capture interrupt */
|
||||
#define CS_AFS_PI 0x10 /* playback interrupt */
|
||||
#define CS_AFS_CU 0x08 /* capture underrun */
|
||||
#define CS_AFS_CO 0x04 /* capture overrun */
|
||||
#define CS_AFS_PO 0x02 /* playback overrun */
|
||||
#define CS_AFS_PU 0x01 /* playback underrun */
|
||||
|
||||
/* Version - register I25 */
|
||||
#define CS_VERSION_NUMBER 0xe0
|
||||
#define CS_VERSION_CHIPID 0x07
|
||||
|
||||
/* Miscellaneous Control reg bits */
|
||||
#define CS_MODE2 0x40
|
||||
|
||||
#define MONO_INPUT_ATTEN_BITS 0x0f
|
||||
#define MONO_INPUT_ATTEN_MASK 0xf0
|
||||
#define MONO_OUTPUT_MUTE 0x40
|
||||
#define MONO_INPUT_MUTE 0x80
|
||||
#define MONO_INPUT_MUTE_MASK 0x7f
|
||||
|
||||
#define LINE_INPUT_ATTEN_BITS 0x1f
|
||||
#define LINE_INPUT_ATTEN_MASK 0xe0
|
||||
#define LINE_INPUT_MUTE 0x80
|
||||
#define LINE_INPUT_MUTE_MASK 0x7f
|
@ -443,6 +443,7 @@ _gem= gem
|
||||
.if ${MACHINE_ARCH} == "sparc64"
|
||||
_auxio= auxio
|
||||
_gem= gem
|
||||
_sound= sound
|
||||
.endif
|
||||
|
||||
.if defined(MODULES_OVERRIDE) && !defined(ALL_MODULES)
|
||||
|
@ -1,8 +1,12 @@
|
||||
# $FreeBSD$
|
||||
|
||||
.if ${MACHINE_ARCH} == "sparc64"
|
||||
SUBDIR = audiocs
|
||||
.else
|
||||
SUBDIR = als4000 ad1816 cmi cs4281 csa ds1 emu10k1 es137x ess
|
||||
SUBDIR += fm801 ich maestro maestro3 mss neomagic sb16 sb8 sbc solo
|
||||
SUBDIR += t4dwave via8233 via82c686 vibes
|
||||
SUBDIR += driver uaudio
|
||||
.endif
|
||||
|
||||
.include <bsd.subdir.mk>
|
||||
|
10
sys/modules/sound/driver/audiocs/Makefile
Normal file
10
sys/modules/sound/driver/audiocs/Makefile
Normal file
@ -0,0 +1,10 @@
|
||||
# $FreeBSD$
|
||||
|
||||
.PATH: ${.CURDIR}/../../../../dev/sound/sbus
|
||||
|
||||
KMOD= snd_audiocs
|
||||
SRCS= device_if.h bus_if.h ofw_bus_if.h
|
||||
SRCS+= channel_if.h feeder_if.h mixer_if.h
|
||||
SRCS+= cs4231.c
|
||||
|
||||
.include <bsd.kmod.mk>
|
@ -70,7 +70,6 @@ nodevice star_saver
|
||||
nodevice bktr
|
||||
nodevice fdc
|
||||
nodevice ppc
|
||||
nodevice sound
|
||||
nodevice "snd_ad1816"
|
||||
nodevice "snd_als4000"
|
||||
nodevice "snd_au88x0"
|
||||
|
91
sys/sparc64/ebus/ebusreg.h
Normal file
91
sys/sparc64/ebus/ebusreg.h
Normal file
@ -0,0 +1,91 @@
|
||||
/* $FreeBSD$ */
|
||||
/* $OpenBSD: ebusreg.h,v 1.4 2001/10/01 18:08:04 jason Exp $ */
|
||||
/* $NetBSD: ebusreg.h,v 1.1 1999/06/04 13:29:13 mrg Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1999 Matthew R. Green
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* UltraSPARC `ebus'
|
||||
*
|
||||
* The `ebus' bus is designed to plug traditional PC-ISA devices into
|
||||
* an SPARC system with as few costs as possible, without sacrificing
|
||||
* to performance. Typically, it is implemented in the PCIO IC from
|
||||
* SME, which also implements a `hme-compatible' PCI network device
|
||||
* (`network'). The ebus has 4 DMA channels, similar to the DMA seen
|
||||
* in the ESP SCSI DMA.
|
||||
*
|
||||
* Typical UltraSPARC systems have a NatSemi SuperIO IC to provide
|
||||
* serial ports for the keyboard and mouse (`se'), floppy disk
|
||||
* controller (`fdthree'), parallel port controller (`bpp') connected
|
||||
* to the ebus, and a PCI-IDE controller (connected directly to the
|
||||
* PCI bus, of course), as well as a Siemens Nixdorf SAB82532 dual
|
||||
* channel serial controller (`su' providing ttya and ttyb), an MK48T59
|
||||
* EEPROM/clock controller (also where the idprom, including the
|
||||
* ethernet address, is located), the audio system (`SUNW,CS4231', same
|
||||
* as other UltraSPARC and some SPARC systems), and other various
|
||||
* internal devices found on traditional SPARC systems such as the
|
||||
* `power', `flashprom', etc., devices.
|
||||
*
|
||||
* The ebus uses an interrupt mapping scheme similar to PCI, though
|
||||
* the actual structures are different.
|
||||
*/
|
||||
|
||||
/* EBUS dma registers */
|
||||
#define EBDMA_DCSR 0x0 /* control/status */
|
||||
#define EBDMA_DADDR 0x4 /* DMA address */
|
||||
#define EBDMA_DCNT 0x8 /* DMA count */
|
||||
|
||||
/* EBUS DMA control/status (EBDMA_DCSR) */
|
||||
#define EBDCSR_INT 0x00000001 /* interrupt pending */
|
||||
#define EBDCSR_ERR 0x00000002 /* error pending */
|
||||
#define EBDCSR_DRAIN 0x00000004 /* drain */
|
||||
#define EBDCSR_INTEN 0x00000010 /* interrupt enable */
|
||||
#define EBDCSR_RESET 0x00000080 /* reset */
|
||||
#define EBDCSR_WRITE 0x00000100 /* write */
|
||||
#define EBDCSR_DMAEN 0x00000200 /* dma enable */
|
||||
#define EBDCSR_CYC 0x00000400 /* cyc pending */
|
||||
#define EBDCSR_DIAGRD 0x00000800 /* diagnostic read done */
|
||||
#define EBDCSR_DIAGWR 0x00001000 /* diagnostic write done */
|
||||
#define EBDCSR_CNTEN 0x00002000 /* count enable */
|
||||
#define EBDCSR_TC 0x00004000 /* terminal count */
|
||||
#define EBDCSR_CSRDRNDIS 0x00010000 /* disable csr drain */
|
||||
#define EBDCSR_BURSTMASK 0x000c0000 /* burst size mask */
|
||||
#define EBDCSR_BURST_1 0x00080000 /* burst 1 */
|
||||
#define EBDCSR_BURST_4 0x00000000 /* burst 4 */
|
||||
#define EBDCSR_BURST_8 0x00040000 /* burst 8 */
|
||||
#define EBDCSR_BURST_16 0x000c0000 /* burst 16 */
|
||||
#define EBDCSR_DIAGEN 0x00100000 /* enable diagnostics */
|
||||
#define EBDCSR_ERRDIS 0x00400000 /* disable error pending */
|
||||
#define EBDCSR_TCIDIS 0x00800000 /* disable TCI */
|
||||
#define EBDCSR_NEXTEN 0x01000000 /* enable next */
|
||||
#define EBDCSR_DMAON 0x02000000 /* dma on */
|
||||
#define EBDCSR_A_LOADED 0x04000000 /* address loaded */
|
||||
#define EBDCSR_NA_LOADED 0x08000000 /* next address loaded */
|
||||
#define EBDCSR_DEVMASK 0xf0000000 /* device id mask */
|
90
sys/sparc64/isa/isa_dma.c
Normal file
90
sys/sparc64/isa/isa_dma.c
Normal file
@ -0,0 +1,90 @@
|
||||
/*-
|
||||
* Copyright (c) 2004 Pyun YongHyeon.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/bus.h>
|
||||
|
||||
#include <isa/isareg.h>
|
||||
#include <isa/isavar.h>
|
||||
|
||||
/*
|
||||
* Glue code to load sound(4). Though fdc(4), ppc(4) don't work on
|
||||
* sparc64 yet, they may need this glue code too.
|
||||
*/
|
||||
|
||||
int
|
||||
isa_dma_init(int chan, u_int bouncebufsize, int flag)
|
||||
{
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
isa_dma_acquire(int chan)
|
||||
{
|
||||
return (0);
|
||||
}
|
||||
|
||||
void
|
||||
isa_dma_release(int chan)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
isa_dmacascade(int chan)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
isa_dmastart(int flags, caddr_t addr, u_int nbytes, int chan)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void
|
||||
isa_dmadone(int flags, caddr_t addr, int nbytes, int chan)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
int
|
||||
isa_dmastatus(int chan)
|
||||
{
|
||||
return (0);
|
||||
}
|
||||
|
||||
int
|
||||
isa_dmastop(int chan)
|
||||
{
|
||||
return (0);
|
||||
}
|
Loading…
Reference in New Issue
Block a user