Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/mac68k/obio Exclude Enhanced Apple Sound Chip (EASC...



details:   https://anonhg.NetBSD.org/src/rev/b3c32f4a9999
branches:  trunk
changeset: 827082:b3c32f4a9999
user:      flxd <flxd%NetBSD.org@localhost>
date:      Thu Oct 12 09:48:53 2017 +0000

description:
Exclude Enhanced Apple Sound Chip (EASC) without support for wavetable mode
used by asc(4).

diffstat:

 sys/arch/mac68k/obio/asc.c |  22 ++++++++++++++++++----
 1 files changed, 18 insertions(+), 4 deletions(-)

diffs (58 lines):

diff -r e1827de9c382 -r b3c32f4a9999 sys/arch/mac68k/obio/asc.c
--- a/sys/arch/mac68k/obio/asc.c        Thu Oct 12 09:47:21 2017 +0000
+++ b/sys/arch/mac68k/obio/asc.c        Thu Oct 12 09:48:53 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: asc.c,v 1.57 2014/07/25 08:10:34 dholland Exp $        */
+/*     $NetBSD: asc.c,v 1.58 2017/10/12 09:48:53 flxd Exp $    */
 
 /*
  * Copyright (C) 1997 Scott Reynolds
@@ -64,7 +64,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: asc.c,v 1.57 2014/07/25 08:10:34 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: asc.c,v 1.58 2017/10/12 09:48:53 flxd Exp $");
 
 #include <sys/types.h>
 #include <sys/errno.h>
@@ -135,6 +135,8 @@
        .d_flag = 0
 };
 
+static const uint8_t easc_version_tab[] = { 0xb0 };
+
 static int
 ascmatch(device_t parent, cfdata_t cf, void *aux)
 {
@@ -142,6 +144,7 @@
        bus_addr_t addr;
        bus_space_handle_t bsh;
        int rval = 0;
+       uint8_t ver;
 
        if (oa->oa_addr != (-1))
                addr = (bus_addr_t)oa->oa_addr;
@@ -155,9 +158,20 @@
        if (bus_space_map(oa->oa_tag, addr, MAC68K_ASC_LEN, 0, &bsh))
                return (0);
 
-       if (mac68k_bus_space_probe(oa->oa_tag, bsh, 0, 1))
+       if (mac68k_bus_space_probe(oa->oa_tag, bsh, 0, 1)) {
                rval = 1;
-       else
+
+               /*
+                * Enhanced Apple Sound Chip (EASC) does not support wavetable
+                * mode, exclude it for now.
+                */
+               ver = bus_space_read_1(oa->oa_tag, bsh, 0x800);
+               for (size_t i = 0; i < __arraycount(easc_version_tab); i++)
+                       if (ver == easc_version_tab[i]) {
+                               rval = 0;
+                               break;
+                       }
+       } else
                rval = 0;
 
        bus_space_unmap(oa->oa_tag, bsh, MAC68K_ASC_LEN);



Home | Main Index | Thread Index | Old Index