Subject: Re: writing a driver for a serial board
To: None <jmarin@pyy.jmp.fi, plunky@skate.demon.co.uk>
From: Paul Kranenburg <pk@cs.few.eur.nl>
List: port-sparc
Date: 01/30/1997 10:18:50
> in the match function, how do I know if I got a Magma serial board?
>

Since it's an Sbus adapter, you'll find it hanging off the sbus node.
The sparc auto-configuration code will present a name to you, probably
"MAGMA_Sp", which is all the match routine need to check.

So, in files.sparc:
	device magma at sbus

and in the magma driver (or better, the MD specific attachment front-end):

	magmamatch() {
		if (strcmp(ca->ca_ra.ra_name, "MAGMA_Sp") == 0)
			return (1);
		...
	}


> its all very well knowing how to program the CD1400, but how do I find 
> out where it is?

This is one of the other items handed to you by the prom. You'll get the
location of the device registers (which you possibly have to map into
kernel VA space) and interrupt level info.

-pk