Subject: ae driver probing max. 32k RAM -- why?
To: None <port-mac68k@netbsd.org>
From: Hauke Fath <hauke@Espresso.Rhein-Neckar.DE>
List: port-mac68k
Date: 12/14/1999 22:34:26
Hi,

after looking at my ethernet card for quite some time and wondering about
the discrepancy between

espresso /netbsd: ae0 at nubus0 slot c: Ethernet A-Series, 32KB memory
espresso /netbsd: ae0: Ethernet address 00:40:10:02:0f:26

and what the fine print on the RAM chips says (2x 32k) I finally UTSL'd.
Patching if_ae.c like...


[hauke@espresso] ~/<5>mac68k/dev > cvs diff -u if_ae.c
Index: if_ae.c
===================================================================
RCS file: /f/archive/cvs/netbsd/1_4/sys/arch/mac68k/dev/if_ae.c,v
retrieving revision 1.1.1.1
diff -u -u -r1.1.1.1 if_ae.c
--- if_ae.c     1999/06/13 21:54:10     1.1.1.1
+++ if_ae.c     1999/12/14 21:08:46
@@ -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
@@ -47,11 +47,20 @@
        i2 = (8192 * 1);
        i3 = (8192 * 2);
        i4 = (8192 * 3);
+       i8 = (8192 * 7);

        bus_space_write_2(bst, bsh, ofs + i1, 0x1111);
        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 + i8, 0x8888);
+
+       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 &&
[hauke@espresso] ~/<5>mac68k/dev >


...gave me...

espresso /netbsd: ae0 at nubus0 slot c: Ethernet A-Series, 64KB memory
espresso /netbsd: ae0: Ethernet address 00:40:10:02:0f:26

-- Does anybody see any problems with the change?

	hauke


--
"It's never straight up and down"     (DEVO)