Port-amiga archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Clockport devices configuration layer [was: Re: USB stack vs bus_dma_tag_t]




Wiadomość napisana w dniu 2010-10-13, o godz. 14:36, przez Frank Wille:
Can it be easily glued together to provide what I need? Ofcourse that
would not bring proper DMA handling to amiga port, because it needs
far more MD code.

When you look at mac68k you just need to define a m68k_bus_dma_tag in
mainbus.c and pass the tag to all attached devices. The dma functions
are all defined in m68k/m68k/bus_dma.c.


I already hacked contents of m68k bus_dma.h into amiga bus.h. It was enough for USB stack to compile. I'll look into bus_dma implementations of other ports later. Though, I would prefer not to mess with it - I don't really understand what is going on in this code.

SUBWAY driver is slowly progressing. I have probe prototype working:
http://c0ff33.net/~rkujawa/subway-probe.txt
It is quite nice, because due to design of SUBWAY it does not need any writes to bus, only series of reads. So I think it would be okay to include driver even in GENERIC kernel.

Speaking of GENERIC kernel. Current autoconf mechanism in amiga port does not work well for clockport cards. Now we can either attach to mainbus by means of autoconf.c (really ugly for anything but mainboards devices), or by zbus which is fine for real Zorro cards, but not for clockport stuff.

There's one problem that makes writing drivers for clockport devices difficult. Clockport is available on many base addresses, and address depends on physical location of clockport. A1200 mainboard clockport has different address than X-Surf clockport, different than ZIV busboard clockport, etc. etc. In current situation, handling this is up to person developing the device driver. SUBWAY driver should work on original clockport and various Zorro clockports. But I don't want to probe all these posible locations inside of my driver... And tomorrow someone may create clockport on other base address.

I propose that we (read: mostly I) implement thin abstration layer, that would simplify writing clockport cards drivers. Clockport layer would provide information on base address to the device driver. It could be configured manually, by setting base address in config file, or automatically by matching known clockport carrier at zbus.

Configuration file could look like this:

clockport0 at mainbus addr 0xd80000 # A1200 mainboard clockport
clockport* at zbus? # various Zorro clockports
tduhc0 at clockport? # E3B SUBWAY USB Controller

If someone bought unofficial clockport adapter (like A603, CPU clockport adapter), that does use other base address, he could just change address in config file. No changes to the driver required! Ofcourse, all of this is against amiga idea of autoconfiguration, but so are clockport cards.

Best regards,
Radoslaw Kujawa



Home | Main Index | Thread Index | Old Index