Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-5]: src/sys/dev/pci Pull up revision 1.1 (new, requested by min...



details:   https://anonhg.NetBSD.org/src/rev/f64e6399a7e3
branches:  netbsd-1-5
changeset: 491499:f64e6399a7e3
user:      he <he%NetBSD.org@localhost>
date:      Tue May 01 11:45:26 2001 +0000

description:
Pull up revision 1.1 (new, requested by minoura):
  Add Yamaha YMF724/740/744/745-based sound driver and
  its subordinates.

diffstat:

 sys/dev/pci/mpu_yds.c |  104 ++++++++++++++++
 sys/dev/pci/opl_yds.c |  105 ++++++++++++++++
 sys/dev/pci/ydsreg.h  |  314 ++++++++++++++++++++++++++++++++++++++++++++++++++
 sys/dev/pci/ydsvar.h  |  115 ++++++++++++++++++
 4 files changed, 638 insertions(+), 0 deletions(-)

diffs (truncated from 654 to 300 lines):

diff -r f5ea96fe5644 -r f64e6399a7e3 sys/dev/pci/mpu_yds.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/dev/pci/mpu_yds.c     Tue May 01 11:45:26 2001 +0000
@@ -0,0 +1,104 @@
+/*     $NetBSD: mpu_yds.c,v 1.1.6.2 2001/05/01 11:45:26 he Exp $       */
+
+/*
+ * Copyright (c) 1998 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Lennart Augustsson (augustss%netbsd.org@localhost).
+ *
+ * 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 FOUNDATION 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/param.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/errno.h>
+#include <sys/device.h>
+#include <sys/proc.h>
+#include <sys/conf.h>
+#include <sys/audioio.h>
+#include <sys/midiio.h>
+
+#include <machine/bus.h>
+
+#include <dev/audio_if.h>
+#include <dev/midi_if.h>
+
+#include <dev/pci/pcireg.h>
+#include <dev/pci/pcivar.h>
+
+#include <dev/ic/mpuvar.h>
+#include <dev/ic/ac97var.h>
+#include <dev/pci/ydsreg.h>
+#include <dev/pci/ydsvar.h>
+
+static int     mpu_yds_match __P((struct device *, struct cfdata *, void *));
+static void    mpu_yds_attach __P((struct device *, struct device *, void *));
+
+struct cfattach mpu_yds_ca = {
+       sizeof (struct mpu_softc), mpu_yds_match, mpu_yds_attach
+};
+
+static int
+mpu_yds_match(parent, match, aux)
+       struct device *parent;
+       struct cfdata *match;
+       void *aux;
+{
+       struct audio_attach_args *aa = (struct audio_attach_args *)aux;
+       struct yds_softc *ysc = (struct yds_softc *)parent;
+       struct mpu_softc sc;
+
+       if (aa->type != AUDIODEV_TYPE_MPU)
+               return (0);
+       memset(&sc, 0, sizeof sc);
+       sc.ioh = ysc->sc_mpu_ioh;
+       sc.iot = ysc->sc_mpu_iot;
+       return (mpu_find(&sc));
+}
+
+static void
+mpu_yds_attach(parent, self, aux)
+       struct device *parent;
+       struct device *self;
+       void *aux;
+{
+       struct yds_softc *ysc = (struct yds_softc *)parent;
+       struct mpu_softc *sc = (struct mpu_softc *)self;
+
+       sc->ioh = ysc->sc_mpu_ioh;
+       sc->iot = ysc->sc_mpu_iot;
+       sc->model = "Yamaha DS-1 MIDI UART";
+#ifndef AUDIO_NO_POWER_CTL
+       sc->powerctl = 0;
+#endif
+
+       mpu_attach(sc);
+}
diff -r f5ea96fe5644 -r f64e6399a7e3 sys/dev/pci/opl_yds.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/dev/pci/opl_yds.c     Tue May 01 11:45:26 2001 +0000
@@ -0,0 +1,105 @@
+/*     $NetBSD: opl_yds.c,v 1.1.6.2 2001/05/01 11:45:26 he Exp $       */
+
+/*
+ * Copyright (c) 1998 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Lennart Augustsson (augustss%netbsd.org@localhost).
+ *
+ * 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 FOUNDATION 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/param.h>
+#include <sys/systm.h>
+#include <sys/kernel.h>
+#include <sys/errno.h>
+#include <sys/device.h>
+#include <sys/malloc.h>
+#include <sys/proc.h>
+#include <sys/conf.h>
+#include <sys/select.h>
+#include <sys/audioio.h>
+#include <sys/midiio.h>
+
+#include <machine/bus.h>
+
+#include <dev/audio_if.h>
+#include <dev/midi_if.h>
+#include <dev/ic/oplreg.h>
+#include <dev/ic/oplvar.h>
+#include <dev/ic/ac97var.h>
+
+#include <dev/pci/pcireg.h>
+#include <dev/pci/pcivar.h>
+
+#include <dev/pci/ydsreg.h>
+#include <dev/pci/ydsvar.h>
+
+int    opl_yds_match __P((struct device *, struct cfdata *, void *));
+void   opl_yds_attach __P((struct device *, struct device *, void *));
+
+struct cfattach opl_yds_ca = {
+       sizeof (struct opl_softc), opl_yds_match, opl_yds_attach
+};
+
+int
+opl_yds_match(parent, match, aux)
+       struct device *parent;
+       struct cfdata *match;
+       void *aux;
+{
+       struct audio_attach_args *aa = (struct audio_attach_args *)aux;
+       struct yds_softc *ssc = (struct yds_softc *)parent;
+       struct opl_softc sc;
+
+       if (aa->type != AUDIODEV_TYPE_OPL)
+               return (0);
+       memset(&sc, 0, sizeof sc);
+       sc.iot = ssc->sc_opl_iot;
+       sc.ioh = ssc->sc_opl_ioh;
+       return (opl_find(&sc));
+}
+
+void
+opl_yds_attach(parent, self, aux)
+       struct device *parent;
+       struct device *self;
+       void *aux;
+{
+       struct yds_softc *ssc = (struct yds_softc *)parent;
+       struct opl_softc *sc = (struct opl_softc *)self;
+
+       sc->ioh = ssc->sc_opl_ioh;
+       sc->iot = ssc->sc_opl_iot;
+       sc->offs = 0;
+       strcpy(sc->syn.name, "DS-1 integrated ");
+
+       opl_attach(sc);
+}
diff -r f5ea96fe5644 -r f64e6399a7e3 sys/dev/pci/ydsreg.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/dev/pci/ydsreg.h      Tue May 01 11:45:26 2001 +0000
@@ -0,0 +1,314 @@
+/*     $NetBSD: ydsreg.h,v 1.1.6.2 2001/05/01 11:45:26 he Exp $        */
+
+/*
+ * Copyright (c) 2000, 2001 Kazuki Sakamoto and Minoura Makoto.
+ * 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.
+ */
+
+/*
+ * YMF724/740/744/754 registers
+ */
+
+#ifndef _DEV_PCI_YDSREG_H_
+#define        _DEV_PCI_YDSREG_H_
+
+/*
+ * PCI Config Registers
+ */
+#define        YDS_PCI_MBA             0x10
+#define        YDS_PCI_LEGACY          0x40
+# define YDS_PCI_LEGACY_SBEN   0x0001
+# define YDS_PCI_LEGACY_FMEN   0x0002
+# define YDS_PCI_LEGACY_JPEN   0x0004
+# define YDS_PCI_LEGACY_MEN    0x0008
+# define YDS_PCI_LEGACY_MIEN   0x0010
+# define YDS_PCI_LEGACY_IO     0x0020
+# define YDS_PCI_LEGACY_SDMA0  0x0000
+# define YDS_PCI_LEGACY_SDMA1  0x0040
+# define YDS_PCI_LEGACY_SDMA3  0x00c0
+# define YDS_PCI_LEGACY_SBIRQ5 0x0000
+# define YDS_PCI_LEGACY_SBIRQ7 0x0100
+# define YDS_PCI_LEGACY_SBIRQ9 0x0200
+# define YDS_PCI_LEGACY_SBIRQ10        0x0300
+# define YDS_PCI_LEGACY_SBIRQ11        0x0400
+# define YDS_PCI_LEGACY_MPUIRQ5        0x0000
+# define YDS_PCI_LEGACY_MPUIRQ7        0x0800
+# define YDS_PCI_LEGACY_MPUIRQ9        0x1000
+# define YDS_PCI_LEGACY_MPUIRQ10 0x1800
+# define YDS_PCI_LEGACY_MPUIRQ11 0x2000
+# define YDS_PCI_LEGACY_SIEN   0x4000
+# define YDS_PCI_LEGACY_LAD    0x8000
+
+# define YDS_PCI_EX_LEGACY_FMIO_388    (0x0000 << 16)
+# define YDS_PCI_EX_LEGACY_FMIO_398    (0x0001 << 16)
+# define YDS_PCI_EX_LEGACY_FMIO_3A0    (0x0002 << 16)
+# define YDS_PCI_EX_LEGACY_FMIO_3A8    (0x0003 << 16)
+# define YDS_PCI_EX_LEGACY_SBIO_220    (0x0000 << 16)
+# define YDS_PCI_EX_LEGACY_SBIO_240    (0x0004 << 16)
+# define YDS_PCI_EX_LEGACY_SBIO_260    (0x0008 << 16)
+# define YDS_PCI_EX_LEGACY_SBIO_280    (0x000c << 16)
+# define YDS_PCI_EX_LEGACY_MPUIO_330   (0x0000 << 16)
+# define YDS_PCI_EX_LEGACY_MPUIO_300   (0x0010 << 16)
+# define YDS_PCI_EX_LEGACY_MPUIO_332   (0x0020 << 16)
+# define YDS_PCI_EX_LEGACY_MPUIO_334   (0x0030 << 16)
+# define YDS_PCI_EX_LEGACY_JSIO_201    (0x0000 << 16)
+# define YDS_PCI_EX_LEGACY_JSIO_202    (0x0040 << 16)
+# define YDS_PCI_EX_LEGACY_JSIO_204    (0x0080 << 16)
+# define YDS_PCI_EX_LEGACY_JSIO_205    (0x00c0 << 16)
+# define YDS_PCI_EX_LEGACY_MAIM                (0x0100 << 16)
+# define YDS_PCI_EX_LEGACY_SBMOD_PCI   (0x0000 << 16)



Home | Main Index | Thread Index | Old Index