Port-amiga archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: Clockport devices programming
On Tue, 28 Sep 2010 17:07:27 +0200
Radek Kujawa <radoslaw.kujawa%c0ff33.net@localhost> wrote:
> Today I wondered, how one should program devices connected to
> Amiga 1200 clockport. There are many popular expansion cards available,
> but I found no drivers for such devices in NetBSD source tree. Is there
> any example source code I can read?
AFAIK no clockport devices are supported yet.
> As I understand, clockport devices are connected
> directly to 68k bus. So matching and attachment must work by "probing"
> for a card. For example by writing some values into bus space where it
> expects the device, and reading values back. Am I right?
Yes, that's the way to do it.
But poking in the bus space may be dangerous and anything can happen.
So when you finish your driver, I wouldn't enable it by default in a
GENERIC config file, but let the user enable the driver when she or he
really needs it.
> If that is true,
> how would example probe procedure look? Most NetBSD/Amiga drivers either
> use zbus, or matchname(). Both of these methods seems wrong for
> clockport. I'm really not sure how should I probe for clockport stuff.
AFAIK the NetBSD/amiga kernel doesn't use a VA=PA mapping, so you cannot
access the hardware address directly in your probe functions.
It depends which address you have to probe for the clockport device.
For example the following three regions are mapped:
CHIPMEMBASE (0x000000) to CHIPMEMTOP (0x200000) at CHIPMEMADDR.
CIABASE (0xbfc000) to CIATOP (0xc00000) at CIAADDR.
ZTWOROMBASE (0xd80000) to ZTWOROMTOP (0xf80000) at ZTWOROMADR.
When it is the last region you can also use the ztwomap() macro, e.g.
va = ztwomap(pa)
--
_ Frank Wille (frank%phoenix.owl.de@localhost)
_ // http://sun.hasenbraten.de/~frank/
\X/ Phx @ #AmigaGer
Home |
Main Index |
Thread Index |
Old Index