[comp.arch] Am7990 LANCE chip

arneme@sfd.uit.no (Arne Munch-Ellingsen) (01/13/90)

I am trying to write a device driver for the Am 7990 LANCE chip. The driver
is going to be a part of a small standalone kernel for the MC68030. The on
board (We are using the MVME 147 boards) MC68851 MMU is not activated.

After setting up the exeption/trap vectors, initiating the tick timer 1 to
give interrupts at a 10 HZ rate at level 6 the LANCE itself is initialized.

The mode part of the initialization block is set to 0x0000, the physical
adress is set to my address which is 8:0:3E:20:1:99. The logical adress
filter is set to all zeros, and the Receive Descriptor Ring Pointer (RDRP)
(bits 0-23) is set to the adress of the first of 8 receive descriptors
allocated contigiously in memory. (the rlen part of the RDRP is set to
0x3). The TRDP is set accordingly (also have 8 transmit descriptors). RMD0 and
RMD1 is set to reflect the address where the receive descriptors are, and
the OWN bit is set to 0. RMD2 (bcnt) is set to -1518. TMD0 and TMD1 is set
to the address of the transmit descriptor entries.

Everything seems to work fine, but the LANCE misses all packets. By
toggling the PROMISCIOUS bit I can verify that the initblock address the
LANCE is using is OK. (number of interrupts generated indicates this)

According to the documentation the MISS error should only occur if the
LANCE doesn't own any buffers. I have inspected the DMA area in detail, and
everything seems to be OK (right offset from the start, and correctly
initialized)

Have I overlooked some crusial detail ??

Arne Munch-Ellingsen (arneme@sfd.uit.no)
 ____________________________________________________________
|     Arne Munch-Ellingsen                                   |
|     Department of Computer Science, University of Tromsoe  |
|     Postboks 953, N-9000 TROMSOE, NORWAY.                  |

jtv@kampi.hut.fi (Jukka Virtanen) (01/13/90)

	Hi. 

> I am trying to write a device driver for the Am 7990 LANCE chip. The driver
> is going to be a part of a small standalone kernel for the MC68030. The on
> board (We are using the MVME 147 boards) MC68851 MMU is not activated.

	I am writing a bsd 4.3 driver for the Lance chip
	on the uVax-3300 cpu board (VAX_650)...

> The mode part of the initialization block is set to 0x0000, the physical
> adress is set to my address which is 8:0:3E:20:1:99. The logical adress
> filter is set to all zeros, and the Receive Descriptor Ring Pointer (RDRP)
> (bits 0-23) is set to the adress of the first of 8 receive descriptors
> allocated contigiously in memory. (the rlen part of the RDRP is set to
> 0x3).The TRDP is set accordingly (also have 8 transmit descriptors). RMD0 and
> RMD1 is set to reflect the address where the receive descriptors are, and
> the OWN bit is set to 0. RMD2 (bcnt) is set to -1518. TMD0 and TMD1 is set
> to the address of the transmit descriptor entries.

	I do not get it... If you set the OWN bit of the receive
	descriptors to 0, it means that the LANCE can not use them.
	Try setting the OWN bit to 1 and watch it fly. Of course,
	the OWN bit of the transmit buffers need to be 0 until you
	fill them with something.

	Also check the ring-pointer alignment (needs to be 8)
	and that you set the csr[1,2,3] values after setting the
	STOP bit before you START it again.
	
					Juki
					jtv@hut.fi