Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/mac68k/dev Now properly probes for cards with 64k o...



details:   https://anonhg.NetBSD.org/src/rev/af39126cff51
branches:  trunk
changeset: 517333:af39126cff51
user:      jklos <jklos%NetBSD.org@localhost>
date:      Sat Nov 10 21:32:33 2001 +0000

description:
Now properly probes for cards with 64k of buffer. Reversed order
of tests in case space isn't fully decoded.

diffstat:

 sys/arch/mac68k/dev/if_ae.c |  29 ++++++++++++++++++++++++-----
 1 files changed, 24 insertions(+), 5 deletions(-)

diffs (51 lines):

diff -r cfffb43dd46e -r af39126cff51 sys/arch/mac68k/dev/if_ae.c
--- a/sys/arch/mac68k/dev/if_ae.c       Sat Nov 10 20:49:52 2001 +0000
+++ b/sys/arch/mac68k/dev/if_ae.c       Sat Nov 10 21:32:33 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_ae.c,v 1.70 2000/09/13 05:21:16 scottr Exp $        */
+/*     $NetBSD: if_ae.c,v 1.71 2001/11/10 21:32:33 jklos Exp $ */
 
 /*
  * Device driver for National Semiconductor DS8390/WD83C690 based ethernet
@@ -37,7 +37,7 @@
        bus_space_handle_t bsh;
        int ofs;
 {
-       int i1, i2, i3, i4;
+       int i1, i2, i3, i4, i8;
 
        /*
         * banks; also assume it will generally mirror in upper banks
@@ -48,10 +48,29 @@
        i3 = (8192 * 2);
        i4 = (8192 * 3);
 
-       bus_space_write_2(bst, bsh, ofs + i1, 0x1111);
+       i8 = (8192 * 4);
+
+       bus_space_write_2(bst, bsh, ofs + i8, 0x8888);
+       bus_space_write_2(bst, bsh, ofs + i4, 0x4444);
+       bus_space_write_2(bst, bsh, ofs + i3, 0x3333);
        bus_space_write_2(bst, bsh, ofs + i2, 0x2222);
-       bus_space_write_2(bst, bsh, ofs + i3, 0x3333);
-       bus_space_write_2(bst, bsh, ofs + i4, 0x4444);
+       bus_space_write_2(bst, bsh, ofs + i1, 0x1111);
+
+       /*
+       * 1) If the memory range is decoded completely, it does not
+       *    matter what we write first: High tags written into
+       *    the void are lost.
+       * 2) If the memory range is not decoded completely (banks are
+       *    mirrored), high tags are overwritten by lower ones.
+       * 3) Lazy implementation of pathological cases - none found yet.
+       */
+
+       if (bus_space_read_2(bst, bsh, ofs + i1) == 0x1111 &&
+           bus_space_read_2(bst, bsh, ofs + i2) == 0x2222 &&
+           bus_space_read_2(bst, bsh, ofs + i3) == 0x3333 &&
+           bus_space_read_2(bst, bsh, ofs + i4) == 0x4444 &&
+           bus_space_read_2(bst, bsh, ofs + i8) == 0x8888)
+               return 8192 * 8;
 
        if (bus_space_read_2(bst, bsh, ofs + i1) == 0x1111 &&
            bus_space_read_2(bst, bsh, ofs + i2) == 0x2222 &&



Home | Main Index | Thread Index | Old Index