Subject: Re: podulebus communication functions
To: Andrew McMurry <a.mcmurry1@physics.oxford.ac.uk>
From: Mark Brinicombe <mark@causality.com>
List: port-arm32
Date: 03/09/1998 18:54:01
On Mon, 9 Mar 1998, Andrew McMurry wrote:

> Can anyone explain to me what the registers are meant to be on entry
> to the various *bus_wm_* assembly functions, or tell me where I can
> find out?
> 
> The Atomwide/Serial Port Multiple Serial Port Podule does not work with
> the driver in 1.3 current. It crashes the system whenever any data is
> received on one of the ports. The reason for this crash appears to be that
> the podulebus_wm_1 function is not implemented. The internal serial port
> works, and the mainbus_wm_1 function is implemented. The NetBSD NS16550
> com drivers use bus_space_write_multi_1.

Hi again,
       What you need is something like

The wm_? routines take 5 arguments so the first 4 are in r0-r3 and the
5th is on the stack.

ENTRY(podulebus_wm_1)
	add	r0, r1, r2, lsl r0
	ldr	r2, [sp, #0]

	/* Make sure that we have a positive length */
	cmp	r2, #0x00000000
	movle	pc, lr

podulebus_wm_1_loop:
	ldrb	r1, [r3], #0x0001
	strb	r1, [r0]
	subs	r2, r2, #0x00000001
	bgt	podulebus_wm_1_loop

	mov	pc, lr


Cheers,
				Mark