Port-amiga archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: Clockport devices programming
Radek Kujawa wrote:
>> see dev/a2kbbc.c
>
> This source is of some use to me, but clock drivers are relatively
> simple and don't have proper probe procedure. Driver just assumes that
> clock is there and tries to attach. And I guess there's nothing wrong
> with it, as it's just a clock.
But it checks whether the values read are within expected limits. When they
are not, the clock won't be attached.
You would have to do the same for your device. Maybe you also have to write
to some registers and check if that produces the expected result in another
register.
>> > e.g. va = ztwomap(pa)
>
> Ok, but this marco returns base address only. Length of used bus space
> doesn't need to be specified?
No. The bus_space(9) functions are not used in Amiga drivers.
I guess it made not much sense, as most drivers for Amiga are not portable?
The length is not needed. You can always access any location from va to
va+(0xf80000-pa).
> How does kernel know which addresses I am going to use?
Not needed. All drivers run on the same mapping, which is already
established in amiga_init.c.
> What happens when two drivers want to use adress spaces
> that overlap?
Nothing. It just works.
> Such circumstances may actually arise with clockport
> devices... As I see, ztwomap just returns physical address that was
> already translated into VA (contrary to its name, this marco does not
> do any mapping?).
Exactly. :)
> There is also zbusmap(pa, size) function defined, but it is not used
> anywhere outside of zbus.c. I guess this is used only for VA=PA mapping
> for real Zorro cards.
It creates a new MMU mapping for Zorro address space which is not within
the above mentioned 0xd80000-0xf80000 area (which means Z3 memory?).
You don't have to care about that.
--
_ Frank Wille (frank%phoenix.owl.de@localhost)
_ // http://sun.hasenbraten.de/~frank/
\X/ Phx @ #AmigaGer
Home |
Main Index |
Thread Index |
Old Index