Subject: Re: MACE Questions
To: Allen Briggs <briggs@puma.macbsd.com>
From: Stefan Arentz <stefan.arentz@luna.net>
List: port-mac68k
Date: 10/26/1997 13:52:03
On Sat, Oct 25, 1997 at 11:25:15PM -0400, Allen Briggs wrote:
> > Today I started working on a driver for the MACE ethernet controller. I
> > already have a dummy driver up and running (ma0) and I'm ready to start
> > implementing it.
> 
> Excellent!  Please let me know if you have any questions.  I will be
> happy to try and answer.

Okey-Dokey. I'll post those questions on the list since it might also
be interesting to other people.

> > My 660AV uses a Am79C950 chip. I couldn't find that part number on
> > AMD's website, so I'm wondering if it's compatible with the Am97C940
> > for which you can download documentation.
> > 
> > Is 'am*' a good name for this driver?
> 
> I think that 'ma*' would be better, or 'mc*'.  I don't think there's a
> requirement for it to be two letters, though, so why not 'mace*'?  ;-)

Hm. Silly me. That was a typo, i called it ma*.

> I've been wondering what the part number was...  I'm glad you could find
> it.  Expect some small differences from the 97C940, though.  Perhaps
> nothing visible from the programming interface.  I don't know.

I'll contact AMD and see if they can give some info about this. It wasn't
hard to find btw.. just open the machine and look on the chip ;)

> > How do I read and write to it's registers? The
> > same way you access normal memory?
> 
> See the src/sys/arch/mac68k/dev/if_sn* sources.  They show one way to
> initialize bus_space handles and tags and how to use them.  Ideally, you
> should have a two-piece driver--the bulk of the driver should something
> sharable with other platforms, like the ppc, which might come along
> someday.  bus_space_* functions help a lot with that.

I split the code between if_ma.c and if_ma_obio.c. The first contains
common architecture independent code and the second contains code
specific to the on-board mace controller of the AV Macs. I created
an array with pointers to the registers like in the sonic driver. That
should make it portable enough.

Next thing to read about is DMA, but I understand that there's
no documentation available for the controller used in the AV Macs.

 - Stefan