Subject: Faulty podulebus code? AND/OR EtherN
To: None <port-arm@netbsd.org>
From: Reinoud Zandijk <reinoud@netbsd.org>
List: port-arm
Date: 09/20/2001 03:28:21
Hi hi,

I must admit i am not a podulebus expert but the following patch looks good 
to me :

Index: podulebus_io_asm.S
===================================================================
RCS file: /cvsroot/syssrc/sys/arch/arm32/podulebus/podulebus_io_asm.S,v
retrieving revision 1.9
diff -u -r1.9 podulebus_io_asm.S
--- podulebus_io_asm.S	1999/10/26 06:53:44	1.9
+++ podulebus_io_asm.S	2001/09/20 01:13:29
@@ -102,10 +102,23 @@
 
 ENTRY(podulebus_bs_rm_2)
 	add	r0, r1, r2, lsl r0
-	mov	r1, r3
 	ldr	r2, [sp, #0]
-	b	_C_LABEL(insw)
 
+	/* Make sure that we have a positive length */
+	cmp	r2, #0x00000000
+	movle	pc, lr
+
+podulebus_rm_2_loop:
+	ldr	r1, [r0]
+	strb	r1, [r3], #0x001
+	mov	r1, r1, lsl#8
+	strb	r1, [r3], #0x001
+	subs	r2, r2, #0x00000001
+	bgt	podulebus_rm_2_loop
+
+	mov	pc, lr
+
+
 /*
  * write multiple
  */
@@ -128,6 +141,20 @@
 
 ENTRY(podulebus_bs_wm_2)
 	add	r0, r1, r2, lsl r0
-	mov	r1, r3
 	ldr	r2, [sp, #0]
-	b	_C_LABEL(outsw)
+
+	/* Make sure that we have a positive length */
+	cmp	r2, #0x00000000
+	movle	pc, lr
+
+podulebus_wm_2_loop:
+	ldr	r1, [r3], #0x0002
+	mov	r1, r1, lsl #16 
+	orr	r1, r1, r1, lsr #16
+
+	str	r1, [r0]
+	subs	r2, r2, #0x00000001
+	bgt	podulebus_wm_2_loop
+
+	mov	pc, lr
+


==========================

But ... it is only performing worse :(( ... the reason i re-implemented it 
was that i suspected that the multiple writing on the podulebus was 
faulted.... since the EtherN doesnt work.

The problem with the EtherN is narowed to this: pinging with `ping -s213
a.b.c.d' works fine but `ping -s214 a.b.c.d' faults.... with the error :
"ne0: remote transmit DMA failed to complete" .... given the packet length
this indicates that transfers bigger than 255 bytes go wrong... why??

As an expiriment i already updated the timeout constant in 
../dev/ic/ne2000.c but that didnt help ... maybe it needs to be 1e9 or so 
but normal values don't help :( .... I allready tried 100000.

Another thing is that the fowllowing has the wrong spacing:
        /* Set up DMA byte count. */
        bus_space_write_1(nict, nich, ED_P0_RBCR0, savelen);
        bus_space_write_1(nict, nich, ED_P0_RBCR1, savelen >> 8);

with :
        struct dp8390_softc *sc; 
        bus_space_tag_t nict = sc->sc_regt; 
        bus_space_handle_t nich = sc->sc_regh;

.... any ideas will be welcome !!! this might be only hurdle to get full NC 
support.

Cheers,
Reinoud