From dk@snark.ukma.kiev.ua  Wed Dec 20 12:54:28 1995
Received: from logrus.rada.kiev.ua (root@logrus.rada.kiev.ua [194.44.144.1])
          by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id MAA15052
          for <FreeBSD-gnats-submit@freebsd.org>; Wed, 20 Dec 1995 12:53:32 -0800 (PST)
Received: from knight.ukma.kiev.ua (knight.ukma.kiev.ua [194.44.142.22]) by logrus.rada.kiev.ua (8.6.12/0418) with ESMTP id XAA02864 for <FreeBSD-gnats-submit@freebsd.org>; Wed, 20 Dec 1995 23:47:57 +0200
Received: from snark.ukma.kiev.ua (snark.ukma.kiev.ua [194.44.142.83]) by knight.ukma.kiev.ua (8.6.11/dk01) with ESMTP id WAA01582 for <FreeBSD-gnats-submit@freebsd.org>; Wed, 20 Dec 1995 22:51:11 +0200
Received: (from dk@localhost) by snark.ukma.kiev.ua (8.6.11/8.6.9) id WAA03820; Wed, 20 Dec 1995 22:40:41 +0200
Message-Id: <199512202040.WAA03820@snark.ukma.kiev.ua>
Date: Wed, 20 Dec 1995 22:40:41 +0200
From: Dmitry Kohmanyuk <dk@snark.ukma.kiev.ua>
Reply-To: dk+@ua.net
To: FreeBSD-gnats-submit@freebsd.org
Subject: netboot ca't find NE2000-compat card (DP83905 chip, Dauphin notebook)
X-Send-Pr-Version: 3.2

>Number:         906
>Category:       i386
>Synopsis:       /sys/i386/boot/netboot/nb8390.com cannot recognize NE2000-comp. card
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    davidg
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Dec 20 13:00:02 PST 1995
>Closed-Date:    Sun Mar 22 15:37:34 PST 1998
>Last-Modified:  Sun Mar 22 15:40:05 PST 1998
>Originator:     Dmitry Kohmanyuk
>Release:        FreeBSD snark.ukma.kiev.ua 2.0.5-RELEASE
>Organization:
FARM Computing Association
>Environment:

	
	I have Douphin DTR-1 notebook (bought it yesterday).
	It is 486SLC (no coprocessor), has 6 megs of RAM, small HD,
	and built-in Ethernet card.  

	The documentation claims that the card is NE-2000 compatible,
	based on DP83905 chip from NS, controller is AT/LANTIC,
	connection is TP, RJ-45,
	and it has 8K x 8 static RAM buffer (so, should be fast),
	256 bit EEPROM (for port/irq/etc setup), 16 byte FIFO.
	Then, doc says:  "Mode:  I/O Port mode, 
		compatible with 8BIT Mode offered by Novell NE2000" 

>Description:

	I try to setup my notebook to be a diskless FreeBSD workstation
	(I think it should work fine at least in text mode).

	I boot bare-bones DOS (F5 on boot), run the supplied "lanon"
	program (it enables the card); the light on hub goes on after that).
	I run the setup/diagnostic program in "packet sniffer" mode and it 
	indeed shows all my rwho packets flowing on the wire (and some others, too).
	The setup/diag program, when tests reading NIC regs, says: "8 bit slot found",
	so I assume card should work in 8-bit mode.

	I already have 2 diskless PCs running FreeBSD (2.0.5 and 2.1) here.
	Then, I run nb8390.com program (from floppy).
	I know there can be some problems with supplied nb8390.com since it's configured
	to probe for both WD and NE, so I built a custom version which probes only for NE.  

	the stock version says, "No adapter found".  My version (that same file
	which boots 2 other boxes) hangs.

	The card is set to port 0x300, irq 5.  The boot program is set to port 0x300.
	I have patched source to insert some debug printf's, and found that it
	fails testing for 8-bit card, and hangs when testing for 16-bit card.
	I have read the if_ed.c from 2.0.5 (it seems 2.1 is the same for NE2000s),
	and copied the ed_probe_generic8390() code to test the board. it succeeds!
	This is a relevant piece of code from /sys/i386/boot/netboot/ns8390.c
	(DPRINTF() and DELAY() are mine, as well as long if() followed by goto):

	[ the last thing printed is ne-3, so it hangs before ne-3.1 ]
	[ note that bcompare() returns 1 on memory equal, unlike bcmp() ]

	[...]
                DPRINTF(("NE*000 card... "));
                eth_bmem = (char *)0;           /* No shared memory */
                eth_asic_base = NE_BASE + NE_ASIC_OFFSET;
                eth_nic_base = NE_BASE;
                eth_vendor = VENDOR_NOVELL;
                eth_flags = FLAG_PIO;
                eth_memsize = MEM_16384;
                eth_tx_start = 32;
                c = inb(eth_asic_base + NE_RESET);
                outb(eth_asic_base + NE_RESET, c);
                DELAY(5000);
                inb(0x84);
                outb(eth_nic_base + D8390_P0_COMMAND, D8390_COMMAND_STP |
                        D8390_COMMAND_RD2);
                DELAY(5000);
                DPRINTF(("ne-1 "));
                /* dk: test for 8390 chip, from 2.0.5's driver */
                if ((inb(eth_nic_base + D8390_P0_COMMAND) &
                     (D8390_COMMAND_RD2 | D8390_COMMAND_TXP |
                      D8390_COMMAND_STA | D8390_COMMAND_STP)) !=
                     (D8390_COMMAND_RD2 | D8390_COMMAND_STP) ||
                    (inb(eth_nic_base + D8390_P0_ISR) & D8390_ISR_RST) != D8390_ISR_RST)
                        goto no_novell;
                DPRINTF(("ne-1.2 "));
                outb(eth_nic_base + D8390_P0_RCR, D8390_RCR_MON);
                outb(eth_nic_base + D8390_P0_DCR, D8390_DCR_FT1 | D8390_DCR_LS);
                outb(eth_nic_base + D8390_P0_PSTART, MEM_8192);
                outb(eth_nic_base + D8390_P0_PSTOP, MEM_16384);
                DPRINTF(("ne-2 "));
                eth_pio_write(test, 8192, sizeof(test));
                eth_pio_read(8192, testbuf, sizeof(test));
                if (!bcompare(test, testbuf, sizeof(test))) {
                        DPRINTF(("ne-3 "));
                        eth_flags |= FLAG_16BIT;
                        eth_memsize = MEM_32768;
                        eth_tx_start = 64;
                        outb(eth_nic_base + D8390_P0_DCR, D8390_DCR_WTS |
                                D8390_DCR_FT1 | D8390_DCR_LS);
                        outb(eth_nic_base + D8390_P0_PSTART, MEM_16384);
                        outb(eth_nic_base + D8390_P0_PSTOP, MEM_32768);
                        eth_pio_write(test, 16384, sizeof(test));
                        eth_pio_read(16384, testbuf, sizeof(test));
                        DPRINTF(("ne-3.1 "));
                        if (!bcompare(testbuf, test, sizeof(test))) return (0);
                }
                DPRINTF(("ne-4 "));
                eth_pio_read(0, romdata, 16);
                DPRINTF(("ne-5 "));
                printf("\r\nNE1000/NE2000 base 0x%x, addr ", eth_nic_base);
	[...]

	I have tried to enable shared memory mode.
	I have tried to set 64K mode instead of 16K ("Novell-compatible" as setup prog
		says)

	I have "CHRDY after BALE high", "IO16 after strobe", "read cycles enhanced",
	"TPI link integrity checking enabled" settings, but I haven't touched them.

	I have written down the NIC registers (thanks great diag program
	which comes with board!)
	CR	22
	TSK	83
	ISR	15
	IMR	00
	RSR	11
	RCR	1C
	TCR	00
	DCR	58
	although I doubt this is relevant here.

>How-To-Repeat:

	just run the nb8390.com program.

>Fix:
	
	none known ;-( 

	sorry for this long report, I have tried to provide _ALL_ the info 
	which can help.

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->davidg 
Responsible-Changed-By: scrappy 
Responsible-Changed-When: Wed Apr 17 16:46:01 PDT 1996 
Responsible-Changed-Why:  
State-Changed-From-To: open->closed 
State-Changed-By: steve 
State-Changed-When: Sun Mar 22 15:37:34 PST 1998 
State-Changed-Why:  
Originator says the hardware in question is no longer used. 

From: Dmitry Kohmanyuk =?KOI8-R?B?5M3J1NLJyiDrz8jNwc7Ayw==?= <dk@farm.org>
To: freebsd-gnats-submit@freebsd.org
Cc:  Subject: Re: i386/906 /sys/i386/boot/netboot/nb8390.com cannot recognize NE2000-comp. card
Date: Sun, 22 Mar 1998 15:36:32 -0800

 On Sun, Mar 22, 1998 at 01:43:41PM -0800, Studded wrote:
 > Greetings, :)
 > 
 > 	I am writing to you in regards to your FreeBSD Problem
 > Report. The FreeBSD project is currently conducting a beta test on
 > version 2.2.6 and feedback as to whether you are still experiencing
 > your problem would be very valuable. 
 > 
 > 	If you are still experiencing the problem you reported, it
 > would help the project track the problem if you could upgrade to the
 > latest snapshot of 2.2.6-Beta (located at releng22.freebsd.org) and
 > test your problem again. 
 
 the problem was for obscure piece of hardware which I no longer have
 access to (a 16-bit NE2000 card in 8-bit ISA slot, in Dauphin DTR-1 
 notebook).
 
 Perhaps it's best just to close this PR as `not important to submitter'.
 
 Thanks for your attention...
 
 > 	If you have any feedback regarding this Problem Report,
 > whether you are still experiencing the problem or whether the PR can
 > be closed, please mail your response to
 > freebsd-gnats-submit@freebsd.org. Please do not respond directly to
 > me. I am merely a humble volunteer and have no official connection to
 > the FreeBSD project. Therefore I cannot make any changes to the status
 > of your Problem Report. It is also very important that you include 
 > the category and number of your Problem Report (i386/906)
 > in the subject line of your response.
 > 
 > 	Another option if you need a refresher on the details of your
 > problem or would like to submit a followup is to use the web page
 > interface and look up your PR by number.
 > http://www.freebsd.org/cgi/query-pr-summary.cgi
 > 
 > 	Thank you for helping to make this the greatest release of
 > FreeBSD ever.
>Unformatted:
