CVS commit: [netbsd-8] src/sys/arch/x68k/dev
Module Name:src Committed By: snj Date: Sat Sep 23 18:16:20 UTC 2017 Modified Files: src/sys/arch/x68k/dev [netbsd-8]: vs.c vsvar.h Log Message: Pull up following revision(s) (requested by isaki in ticket #172): sys/arch/x68k/dev/vs.c: 1.38-1.39, 1.41-1.44, 1.47-1.48 via patch sys/arch/x68k/dev/vsvar.h: 1.12-1.15 via patch Avoid panic when the device is closed when not playing. Catch up vs_set_params() to recent MI audio (after in-kernel mixer). Before that, MD part had to support all encodings I'd like to support, but currently it's no longer necessary. The hardware is 4bit/1ch/15.6kHz ADPCM but it behaves as 16bit/1ch/16.0kHz PCM. For audio.c < 1.362, the device attach succeeded and playback is still working. For audio.c >= 1.363, the device attach fails again. It does not work yet but I commit it for milestone. Update confused vs_set_params(). play and rec are identical but pfil and rfil are independent. XXX I introduce VS_USE_PREC8 option for debugging purposes temporarily. I'll remove it if the problem is solved. Remove temporary VS_USE_PREC8 option. vs(4) now supports slinear16be and slinear8 (but now work yet). vs(4) became to able to play audio again. At the moment the encoding conversion using set_params() does not seem to work for me. So vs(4) uses local conversion to/from ADPCM instead of it. But this should be a temporary work. XXX The playback quality is very poor compared to before... XXX Recording is not tested. Merge prate and rrate. These can not be separated. - Revert temporary local conversion introduced at rev 1.43. - But does not revert to trigger method. trigger method is not suitable for x68k ADPCM+DMA mechanism. - Don't (re)start ADPCM when DMA is running. This solves the noise. From Y.Sugahara. - Cache dmac xfer. - Finally MI audio supports 4bit precision format without null_filter hack! - Fix reusing play/rec argument as local variables. It is in/out parameter. To generate a diff of this commit: cvs rdiff -u -r1.37.2.1 -r1.37.2.2 src/sys/arch/x68k/dev/vs.c cvs rdiff -u -r1.11 -r1.11.42.1 src/sys/arch/x68k/dev/vsvar.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/x68k/dev/vs.c diff -u src/sys/arch/x68k/dev/vs.c:1.37.2.1 src/sys/arch/x68k/dev/vs.c:1.37.2.2 --- src/sys/arch/x68k/dev/vs.c:1.37.2.1 Sat Sep 23 17:55:13 2017 +++ src/sys/arch/x68k/dev/vs.c Sat Sep 23 18:16:20 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: vs.c,v 1.37.2.1 2017/09/23 17:55:13 snj Exp $ */ +/* $NetBSD: vs.c,v 1.37.2.2 2017/09/23 18:16:20 snj Exp $ */ /* * Copyright (c) 2001 Tetsuya Isaki. All rights reserved. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: vs.c,v 1.37.2.1 2017/09/23 17:55:13 snj Exp $"); +__KERNEL_RCSID(0, "$NetBSD: vs.c,v 1.37.2.2 2017/09/23 18:16:20 snj Exp $"); #include "audio.h" #include "vs.h" @@ -78,10 +78,10 @@ static void vs_close(void *); static int vs_query_encoding(void *, struct audio_encoding *); static int vs_set_params(void *, int, int, audio_params_t *, audio_params_t *, stream_filter_list_t *, stream_filter_list_t *); -static int vs_trigger_output(void *, void *, void *, int, - void (*)(void *), void *, const audio_params_t *); -static int vs_trigger_input(void *, void *, void *, int, - void (*)(void *), void *, const audio_params_t *); +static int vs_init_output(void *, void *, int); +static int vs_init_input(void *, void *, int); +static int vs_start_input(void *, void *, int, void (*)(void *), void *); +static int vs_start_output(void *, void *, int, void (*)(void *), void *); static int vs_halt_output(void *); static int vs_halt_input(void *); static int vs_allocmem(struct vs_softc *, size_t, size_t, size_t, @@ -117,10 +117,10 @@ static const struct audio_hw_if vs_hw_if vs_set_params, NULL, /* round_blocksize */ NULL, /* commit_settings */ - NULL, /* init_output */ - NULL, /* init_input */ - NULL, /* start_output */ - NULL, /* start_input */ + vs_init_output, + vs_init_input, + vs_start_output, + vs_start_input, vs_halt_output, vs_halt_input, NULL, /* speaker_ctl */ @@ -134,8 +134,8 @@ static const struct audio_hw_if vs_hw_if vs_round_buffersize, NULL, /* mappage */ vs_get_props, - vs_trigger_output, - vs_trigger_input, + NULL, /* trigger_output */ + NULL, /* trigger_input */ NULL, vs_get_locks, }; @@ -160,19 +160,6 @@ struct { #define NUM_RATE (sizeof(vs_l2r)/sizeof(vs_l2r[0])) -struct { - const char *name; - int encoding; - int precision; -} vs_encodings[] = { - {AudioEadpcm, AUDIO_ENCODING_ADPCM, 4}, - {AudioEslinear,AUDIO_ENCODING_SLINEAR, 8}, - {AudioEulinear,AUDIO_ENCODING_ULINEAR, 8}, - {AudioEmulaw, AUDIO_ENCODING_ULAW, 8}, - {AudioEslinear_be, AUDIO_ENCODING_SLINEAR_BE, 16}, - {AudioEslinear_le, AUDIO_ENCODING_SLINEAR_LE, 16}, -}; - static int vs_match(device_t parent, cfdata_t cf,
CVS commit: [netbsd-8] src/sys/arch/x68k/dev
Module Name:src Committed By: snj Date: Sat Sep 23 18:16:20 UTC 2017 Modified Files: src/sys/arch/x68k/dev [netbsd-8]: vs.c vsvar.h Log Message: Pull up following revision(s) (requested by isaki in ticket #172): sys/arch/x68k/dev/vs.c: 1.38-1.39, 1.41-1.44, 1.47-1.48 via patch sys/arch/x68k/dev/vsvar.h: 1.12-1.15 via patch Avoid panic when the device is closed when not playing. Catch up vs_set_params() to recent MI audio (after in-kernel mixer). Before that, MD part had to support all encodings I'd like to support, but currently it's no longer necessary. The hardware is 4bit/1ch/15.6kHz ADPCM but it behaves as 16bit/1ch/16.0kHz PCM. For audio.c < 1.362, the device attach succeeded and playback is still working. For audio.c >= 1.363, the device attach fails again. It does not work yet but I commit it for milestone. Update confused vs_set_params(). play and rec are identical but pfil and rfil are independent. XXX I introduce VS_USE_PREC8 option for debugging purposes temporarily. I'll remove it if the problem is solved. Remove temporary VS_USE_PREC8 option. vs(4) now supports slinear16be and slinear8 (but now work yet). vs(4) became to able to play audio again. At the moment the encoding conversion using set_params() does not seem to work for me. So vs(4) uses local conversion to/from ADPCM instead of it. But this should be a temporary work. XXX The playback quality is very poor compared to before... XXX Recording is not tested. Merge prate and rrate. These can not be separated. - Revert temporary local conversion introduced at rev 1.43. - But does not revert to trigger method. trigger method is not suitable for x68k ADPCM+DMA mechanism. - Don't (re)start ADPCM when DMA is running. This solves the noise. From Y.Sugahara. - Cache dmac xfer. - Finally MI audio supports 4bit precision format without null_filter hack! - Fix reusing play/rec argument as local variables. It is in/out parameter. To generate a diff of this commit: cvs rdiff -u -r1.37.2.1 -r1.37.2.2 src/sys/arch/x68k/dev/vs.c cvs rdiff -u -r1.11 -r1.11.42.1 src/sys/arch/x68k/dev/vsvar.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: [netbsd-8] src/sys/arch/x68k/dev
Module Name:src Committed By: snj Date: Sat Sep 23 17:55:13 UTC 2017 Modified Files: src/sys/arch/x68k/dev [netbsd-8]: dmacvar.h fd.c intio_dmac.c vs.c Log Message: Pull up following revision(s) (requested by isaki in ticket #290): sys/arch/x68k/dev/dmacvar.h: revision 1.11-1.12 via patch sys/arch/x68k/dev/intio_dmac.c: revision 1.36-1.37 via patch sys/arch/x68k/dev/fd.c: revision 1.120 via patch sys/arch/x68k/dev/vs.c: revision 1.45-1.46 via patch Use dmac_prepare_xfer(). >From Y.Sugahara. -- Allow dmac_alloc_channel() to specify DCR and OCR. FDC uses 'Cycle Steal Mode with Hold' but ADPCM should use 'Cycle Steal Mode without Hold' on x68k. >From Y.Suhagara and it was found by XM6i. -- Fix a Continue Operation. Patch from Y.Sugahara. To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.10.76.1 src/sys/arch/x68k/dev/dmacvar.h cvs rdiff -u -r1.119 -r1.119.8.1 src/sys/arch/x68k/dev/fd.c cvs rdiff -u -r1.35 -r1.35.22.1 src/sys/arch/x68k/dev/intio_dmac.c cvs rdiff -u -r1.37 -r1.37.2.1 src/sys/arch/x68k/dev/vs.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/sys/arch/x68k/dev/dmacvar.h diff -u src/sys/arch/x68k/dev/dmacvar.h:1.10 src/sys/arch/x68k/dev/dmacvar.h:1.10.76.1 --- src/sys/arch/x68k/dev/dmacvar.h:1.10 Wed Jun 25 13:30:24 2008 +++ src/sys/arch/x68k/dev/dmacvar.h Sat Sep 23 17:55:13 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: dmacvar.h,v 1.10 2008/06/25 13:30:24 isaki Exp $ */ +/* $NetBSD: dmacvar.h,v 1.10.76.1 2017/09/23 17:55:13 snj Exp $ */ /*- * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc. @@ -55,8 +55,6 @@ struct dmac_dma_xfer { struct dmac_sg_array *dx_array; /* DMAC array chain */ int dx_done; #endif - int dx_nextoff; /* for continued operation */ - int dx_nextsize; }; /* @@ -99,9 +97,14 @@ struct dmac_softc { #define DMAC_MAXSEGSZ 0xff00 #define DMAC_BOUNDARY 0 -struct dmac_channel_stat *dmac_alloc_channel(device_t, int, const char *, - int, dmac_intr_handler_t, void *, int, dmac_intr_handler_t, void *); - /* ch, name, normalv, normal, errorv, error */ +struct dmac_channel_stat *dmac_alloc_channel(device_t, + int, /* ch */ + const char *, /* name */ + int, dmac_intr_handler_t, void *, /* normal handler */ + int, dmac_intr_handler_t, void *, /* error handler */ + uint8_t, /* dcr */ + uint8_t /* ocr */ +); int dmac_free_channel(device_t, int, void *); /* ch, channel */ struct dmac_dma_xfer *dmac_alloc_xfer(struct dmac_channel_stat *, Index: src/sys/arch/x68k/dev/fd.c diff -u src/sys/arch/x68k/dev/fd.c:1.119 src/sys/arch/x68k/dev/fd.c:1.119.8.1 --- src/sys/arch/x68k/dev/fd.c:1.119 Thu Jan 12 14:24:53 2017 +++ src/sys/arch/x68k/dev/fd.c Sat Sep 23 17:55:13 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: fd.c,v 1.119 2017/01/12 14:24:53 isaki Exp $ */ +/* $NetBSD: fd.c,v 1.119.8.1 2017/09/23 17:55:13 snj Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -64,7 +64,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.119 2017/01/12 14:24:53 isaki Exp $"); +__KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.119.8.1 2017/09/23 17:55:13 snj Exp $"); #include "opt_ddb.h" #include "opt_m68k_arch.h" @@ -487,7 +487,10 @@ fdcattach(device_t parent, device_t self /* Initialize DMAC channel */ fdc->sc_dmachan = dmac_alloc_channel(parent, ia->ia_dma, "fdc", ia->ia_dmaintr, fdcdmaintr, fdc, - ia->ia_dmaintr + 1, fdcdmaerrintr, fdc); + ia->ia_dmaintr + 1, fdcdmaerrintr, fdc, + (DMAC_DCR_XRM_CSWH | DMAC_DCR_OTYP_EASYNC | DMAC_DCR_OPS_8BIT), + (DMAC_OCR_SIZE_BYTE | DMAC_OCR_REQG_EXTERNAL)); + if (bus_dmamap_create(fdc->sc_dmat, FDC_MAXIOSIZE, 1, DMAC_MAXSEGSZ, 0, BUS_DMA_NOWAIT | BUS_DMA_ALLOCNOW, >sc_dmamap)) { aprint_error_dev(self, "can't set up intio DMA map\n"); Index: src/sys/arch/x68k/dev/intio_dmac.c diff -u src/sys/arch/x68k/dev/intio_dmac.c:1.35 src/sys/arch/x68k/dev/intio_dmac.c:1.35.22.1 --- src/sys/arch/x68k/dev/intio_dmac.c:1.35 Wed Mar 26 08:17:59 2014 +++ src/sys/arch/x68k/dev/intio_dmac.c Sat Sep 23 17:55:13 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: intio_dmac.c,v 1.35 2014/03/26 08:17:59 christos Exp $ */ +/* $NetBSD: intio_dmac.c,v 1.35.22.1 2017/09/23 17:55:13 snj Exp $ */ /*- * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc. @@ -36,7 +36,7 @@ #include "opt_m68k_arch.h" #include -__KERNEL_RCSID(0, "$NetBSD: intio_dmac.c,v 1.35 2014/03/26 08:17:59 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: intio_dmac.c,v 1.35.22.1 2017/09/23 17:55:13 snj Exp $"); #include #include @@ -159,9 +159,10 @@ dmac_init_channels(struct dmac_softc *sc * Channel initialization/deinitialization per user device. */ struct dmac_channel_stat * -dmac_alloc_channel(device_t self, int ch, const char *name, int normalv, -dmac_intr_handler_t normal, void *normalarg, int errorv, -dmac_intr_handler_t error, void *errorarg) +dmac_alloc_channel(device_t self, int ch, const char
CVS commit: [netbsd-8] src/sys/arch/x68k/dev
Module Name:src Committed By: snj Date: Sat Sep 23 17:55:13 UTC 2017 Modified Files: src/sys/arch/x68k/dev [netbsd-8]: dmacvar.h fd.c intio_dmac.c vs.c Log Message: Pull up following revision(s) (requested by isaki in ticket #290): sys/arch/x68k/dev/dmacvar.h: revision 1.11-1.12 via patch sys/arch/x68k/dev/intio_dmac.c: revision 1.36-1.37 via patch sys/arch/x68k/dev/fd.c: revision 1.120 via patch sys/arch/x68k/dev/vs.c: revision 1.45-1.46 via patch Use dmac_prepare_xfer(). >From Y.Sugahara. -- Allow dmac_alloc_channel() to specify DCR and OCR. FDC uses 'Cycle Steal Mode with Hold' but ADPCM should use 'Cycle Steal Mode without Hold' on x68k. >From Y.Suhagara and it was found by XM6i. -- Fix a Continue Operation. Patch from Y.Sugahara. To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.10.76.1 src/sys/arch/x68k/dev/dmacvar.h cvs rdiff -u -r1.119 -r1.119.8.1 src/sys/arch/x68k/dev/fd.c cvs rdiff -u -r1.35 -r1.35.22.1 src/sys/arch/x68k/dev/intio_dmac.c cvs rdiff -u -r1.37 -r1.37.2.1 src/sys/arch/x68k/dev/vs.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.