Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/x68k/dev Probe not only ctrl address but also bank ...



details:   https://anonhg.NetBSD.org/src/rev/4b99b0507e7a
branches:  trunk
changeset: 756939:4b99b0507e7a
user:      isaki <isaki%NetBSD.org@localhost>
date:      Sun Aug 08 09:30:29 2010 +0000

description:
Probe not only ctrl address but also bank window address.
This prevents the wrong matching when other boards like
Neptune-X exist.  Reported by Yasushi Oshima.

diffstat:

 sys/arch/x68k/dev/bmd.c |  16 ++++++++++++++--
 1 files changed, 14 insertions(+), 2 deletions(-)

diffs (53 lines):

diff -r d7374fd3a68a -r 4b99b0507e7a sys/arch/x68k/dev/bmd.c
--- a/sys/arch/x68k/dev/bmd.c   Sun Aug 08 09:00:15 2010 +0000
+++ b/sys/arch/x68k/dev/bmd.c   Sun Aug 08 09:30:29 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bmd.c,v 1.16 2008/12/18 05:56:42 isaki Exp $   */
+/*     $NetBSD: bmd.c,v 1.17 2010/08/08 09:30:29 isaki Exp $   */
 
 /*
  * Copyright (c) 2002 Tetsuya Isaki. All rights reserved.
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bmd.c,v 1.16 2008/12/18 05:56:42 isaki Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bmd.c,v 1.17 2010/08/08 09:30:29 isaki Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -124,6 +124,8 @@
        struct intio_attach_args *ia = aux;
        bus_space_tag_t iot = ia->ia_bst;
        bus_space_handle_t ioh;
+       int window;
+       int r;
 
        if (ia->ia_addr == INTIOCF_ADDR_DEFAULT)
                ia->ia_addr = BMD_ADDR1;
@@ -132,6 +134,7 @@
        if (ia->ia_addr != BMD_ADDR1 && ia->ia_addr != BMD_ADDR2)
                return (0);
 
+       /* Check CTRL addr */
        if (badaddr((void *)IIOV(ia->ia_addr)))
                return (0);
 
@@ -139,8 +142,17 @@
        if (bus_space_map(iot, ia->ia_addr, ia->ia_size, 0, &ioh))
                return (0);
 
+       /* Check window addr */
+       r = bus_space_read_1(iot, ioh, BMD_CTRL);
        bus_space_unmap(iot, ioh, ia->ia_size);
 
+       if ((r & BMD_CTRL_WINDOW))
+               window = 0xef0000;
+       else
+               window = 0xee0000;
+       if (badaddr((void *)IIOV(window)))
+               return (0);
+
        return (1);
 }
 



Home | Main Index | Thread Index | Old Index