2009-01-08 06:35:27

by Dick Hollenbeck

[permalink] [raw]
Subject: New true IDE compact flash driver starting point?

On a new ARM9 board with memory mapped interface to a compact flash
socket, I need to implement an IDE or ATA driver that will support TRUE
IDE mode.

Am using kernel version 2.6.26

What is the best starting point, i.e. example driver in the tree?


Please respond to my personal email address also as I do not subscribe.

TIA



2009-01-08 12:18:59

by Arnd Bergmann

[permalink] [raw]
Subject: Re: New true IDE compact flash driver starting point?

On Thursday 08 January 2009, Dick Hollenbeck wrote:
> On a new ARM9 board with memory mapped interface to a compact flash
> socket, I need to implement an IDE or ATA driver that will support TRUE
> IDE mode.
>
> Am using kernel version 2.6.26
>
> What is the best starting point, i.e. example driver in the tree?

You should not need to write a new driver, but rather use the existing
drivers/ata/pata_platform.c driver by registering the MMIO registers
and IRQ number as a platform device.

Arnd <><

2009-01-08 15:20:11

by Dick Hollenbeck

[permalink] [raw]
Subject: Re: New true IDE compact flash driver starting point?

Arnd Bergmann wrote:
> On Thursday 08 January 2009, Dick Hollenbeck wrote:
>
>> On a new ARM9 board with memory mapped interface to a compact flash
>> socket, I need to implement an IDE or ATA driver that will support TRUE
>> IDE mode.
>>
>> Am using kernel version 2.6.26
>>
>> What is the best starting point, i.e. example driver in the tree?
>>
>
> You should not need to write a new driver, but rather use the existing
> drivers/ata/pata_platform.c driver by registering the MMIO registers
> and IRQ number as a platform device.
>
> Arnd <><
>
Thank you Arnd!

Is there some example code in the tree to do this?

I've done something similar to this for 8250 serial ports, but I am
having a difficult time finding out how to do this with pata_platform.c

Thanks,

Dick Hollenbeck

2009-01-09 16:33:30

by Arnd Bergmann

[permalink] [raw]
Subject: Re: New true IDE compact flash driver starting point?

On Thursday 08 January 2009, Dick Hollenbeck wrote:
> I've done something similar to this for 8250 serial ports, but I am
> having a difficult time finding out how to do this with pata_platform.c
>

Just grep for pata_platform_info to find example code.

Arnd <><

2009-01-09 18:23:12

by Dick Hollenbeck

[permalink] [raw]
Subject: Re: New true IDE compact flash driver starting point?

Arnd Bergmann wrote:
> On Thursday 08 January 2009, Dick Hollenbeck wrote:
>
>> I've done something similar to this for 8250 serial ports, but I am
>> having a difficult time finding out how to do this with pata_platform.c
>>
>>
>
> Just grep for pata_platform_info to find example code.
>
> Arnd <><
>
Thanks again Arnd. I did that yesterday and got it working last night!
The only thing I have questions about are:


1) Since this is for a quasi realtime application, is there any
advantage to using the interrupt line regarding how the CPU spends its
idle time waiting for the flash? (I have an interrupt line I can use.)
Currently I am not sending in the IRQ resource, resource array length of
2, not 3.


2) I am getting this message during boot up: "Driver 'sd' needs
updating - please use bus_type methods". Again this is kernel 2.6.26.
It seems like this can be safely ignored, but if its easy to get rid of
that I would be happy to back port a patch.



I really appreciate your help.

Dick Hollenbeck

2009-01-09 18:29:31

by Alan

[permalink] [raw]
Subject: Re: New true IDE compact flash driver starting point?

> 1) Since this is for a quasi realtime application, is there any
> advantage to using the interrupt line regarding how the CPU spends its
> idle time waiting for the flash? (I have an interrupt line I can use.)
> Currently I am not sending in the IRQ resource, resource array length of
> 2, not 3.

For real time you may actually be better with the IRQless polling
behaviour as the driver and ATA library currently stands.

2009-01-09 18:37:27

by David Daney

[permalink] [raw]
Subject: Re: New true IDE compact flash driver starting point?

Dick Hollenbeck wrote:
> On a new ARM9 board with memory mapped interface to a compact flash
> socket, I need to implement an IDE or ATA driver that will support TRUE
> IDE mode.
>
> Am using kernel version 2.6.26
>
> What is the best starting point, i.e. example driver in the tree?
>
>
> Please respond to my personal email address also as I do not subscribe.
>

Not that it is a piece of art, but this is my implementation of a
similar driver that I am trying to get merged.

http://marc.info/?l=linux-ide&m=122895233817240&w=4

David Daney