Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/mvme A couple of fixes inspired by a recent port-mvm...



details:   https://anonhg.NetBSD.org/src/rev/ed571e5c2b56
branches:  trunk
changeset: 555737:ed571e5c2b56
user:      scw <scw%NetBSD.org@localhost>
date:      Wed Nov 26 14:27:15 2003 +0000

description:
A couple of fixes inspired by a recent port-mvme68k post:

 - Fix the display of VME master ranges such that the address modifier
   is shown correctly.

 - Apply vr_mask to the start/end VME master addresses, and adjust
   the local start address to compensate.

diffstat:

 sys/dev/mvme/mvmebus.c |   8 ++++----
 sys/dev/mvme/vme_two.c |  16 ++++++++--------
 2 files changed, 12 insertions(+), 12 deletions(-)

diffs (89 lines):

diff -r 4cc98487625b -r ed571e5c2b56 sys/dev/mvme/mvmebus.c
--- a/sys/dev/mvme/mvmebus.c    Wed Nov 26 12:42:28 2003 +0000
+++ b/sys/dev/mvme/mvmebus.c    Wed Nov 26 14:27:15 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mvmebus.c,v 1.5 2003/10/28 18:21:49 matt Exp $ */
+/*     $NetBSD: mvmebus.c,v 1.6 2003/11/26 14:27:15 scw Exp $  */
 
 /*-
  * Copyright (c) 2000, 2002 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: mvmebus.c,v 1.5 2003/10/28 18:21:49 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: mvmebus.c,v 1.6 2003/11/26 14:27:15 scw Exp $");
 
 #include <sys/param.h>
 #include <sys/kernel.h>
@@ -915,8 +915,8 @@
        static const char *mode[] = {"BLT64)", "DATA)", "PROG)", "BLT32)"};
        static const char *dsiz[] = {"(", "(D8,", "(D16,", "(D16-D8,",
        "(D32,", "(D32,D8,", "(D32-D16,", "(D32-D8,"};
-       static const char *adrfmt[] = { "A32:%08x-%08x ", "A16:%04x-%04x ",
-           "A24:%06x-%06x ", "USR:%08x-%08x " };
+       static const char *adrfmt[] = { "A32:%08x-%08x ", "USR:%08x-%08x ",
+           "A16:%04x-%04x ", "A24:%06x-%06x " };
        static char mstring[40];
 
        sprintf(mstring,
diff -r 4cc98487625b -r ed571e5c2b56 sys/dev/mvme/vme_two.c
--- a/sys/dev/mvme/vme_two.c    Wed Nov 26 12:42:28 2003 +0000
+++ b/sys/dev/mvme/vme_two.c    Wed Nov 26 14:27:15 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vme_two.c,v 1.2 2003/07/14 15:47:21 lukem Exp $        */
+/*     $NetBSD: vme_two.c,v 1.3 2003/11/26 14:27:15 scw Exp $  */
 
 /*-
  * Copyright (c) 1999, 2002 The NetBSD Foundation, Inc.
@@ -41,7 +41,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vme_two.c,v 1.2 2003/07/14 15:47:21 lukem Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vme_two.c,v 1.3 2003/11/26 14:27:15 scw Exp $");
 
 #include "vmetwo.h"
 
@@ -235,8 +235,11 @@
        reg = vme2_lcsr_read(sc, VME2LCSR_MASTER_ADDRESS(range));
        start = (reg & VME2_MAST_ADDRESS_START_MASK);
        start <<= VME2_MAST_ADDRESS_START_SHIFT;
+       vr->vr_locstart = start & ~vr->vr_mask;
        end = (reg & VME2_MAST_ADDRESS_END_MASK);
        end <<= VME2_MAST_ADDRESS_END_SHIFT;
+       end |= 0xffffu;
+       end += 1;
 
        /*
         * Local->VMEbus map '4' has optional translation bits, so
@@ -245,8 +248,6 @@
        if (range == 3 && (reg = vme2_lcsr_read(sc, VME2LCSR_MAST4_TRANS))!=0) {
                uint32_t addr, sel, len = end - start;
 
-               vr->vr_locstart = start;
-
                reg = vme2_lcsr_read(sc, VME2LCSR_MAST4_TRANS);
                reg &= VME2_MAST4_TRANS_SELECT_MASK;
                sel = reg << VME2_MAST4_TRANS_SELECT_SHIFT;
@@ -258,8 +259,7 @@
                start = (addr & sel) | (start & (~sel));
                end = start + len;
                vr->vr_mask &= len - 1;
-       } else
-               vr->vr_locstart = 0;
+       }
 
        /* XXX Deal with overlap of onboard RAM address space */
        /* XXX Then again, 167-Bug warns about this at setup time ... */
@@ -267,8 +267,8 @@
        /*
         * Fixup the addresses this range corresponds to
         */
-       vr->vr_vmestart = start;
-       vr->vr_vmeend = end - 1;
+       vr->vr_vmestart = start & vr->vr_mask;
+       vr->vr_vmeend = (end - 1) & vr->vr_mask;
 }
 
 void



Home | Main Index | Thread Index | Old Index