Skip to contentSkip to conversation

Any guides for adding new IDE chipset drivers?

DISCUSSION Alex Bennee 2 participants 2 messages Feb 16, 2004

lore
Share & tools
lore
#0 lore raw

Hi,

We currently have implemented a simple (PIO) IDE interface on our embedded SH based board. The "driver" is just a simple call from ide_setup() that twiddles the various values in ide_hwifs to set the correct port addresses.

All this is all well and good and works fine. However I'm looking at adding DMA support to the driver to make better use of the hardware. I've been looking around the other arch IDE drivers (e.g. the ppc pmac driver) which seem to hook into the probe_for_hwifs() and then update the hwifs table itself. This makes me wonder am I initialising my driver the "correct" way.

As far as implementing the DMA features is concerned as far as I can tell I just need to code up routines for all the various hwifs[x].ide_dma* functions and be done with it. Am I missing anything?

So my questions boil down to:

Are there any guides for driver writers for what needs doing to add new IDE chipset drivers?

Is there a driver that can be held of as an example of good taste and the "right" way to implement a chipset driver?

Regards,

Signature · 3 lines
Alex, homepage: http://www.bennee.com/~alex/
"I am not sure what this is, but an `F' would only dignify it."
		-- English Professor
#1 lore raw
Quoted 6 lines · Alex Bennee

Hi,

We currently have implemented a simple (PIO) IDE interface on our embedded SH based board. The "driver" is just a simple call from ide_setup() that twiddles the various values in ide_hwifs to set the correct port addresses.

Most embedded people till now just _abused_ ide_init_default_hwifs() :-(.

Quoted 6 lines

All this is all well and good and works fine. However I'm looking at adding DMA support to the driver to make better use of the hardware. I've been looking around the other arch IDE drivers (e.g. the ppc pmac driver) which seem to hook into the probe_for_hwifs() and then update the hwifs table itself. This makes me wonder am I initialising my driver the "correct" way.

No, it is not the "correct" way.

Quoted 8 lines

As far as implementing the DMA features is concerned as far as I can tell I just need to code up routines for all the various hwifs[x].ide_dma* functions and be done with it. Am I missing anything?

So my questions boil down to:

Are there any guides for driver writers for what needs doing to add new IDE chipset drivers?

No, unfortunately.

Quoted 2 lines

Is there a driver that can be held of as an example of good taste and the "right" way to implement a chipset driver?

Yep. Please take a look at drivers/ide/arm/icside.c. It is well written, quite simple and has DMA support.

If you have any questions/issues feel free to ask
on [email protected] mailing list.

Cheers,
--bart