[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-arm-kernel
Subject:    Re: Direct-mapped Compact Flash on ARM9
From:       Greg Ungerer <gerg () snapgear ! com>
Date:       2004-07-05 4:37:56
Message-ID: 40E8DB24.7000408 () snapgear ! com
[Download RAW message or body]

Hi Rob, Deepak,

Ranslam, Robert E wrote:
>>Behalf Of Deepak Saxena
>>To: Greg Ungerer
>>>The one thing that has caused me grief though is that I need to use 
>>>appropriate in/out calls now, for different drivers. For example the 
>>>default in/out on the ixp425 architecture platforms point at the PCI 
>>>bus. I want that for PCI drivers. But now I need the in/out 
>>>functions 
>>>for any pcmcia/pccard drivers to point at the expansion bus space 
>>>mapped in my simple pcmcia driver. Anyone have any comments 
>>>on a clean way to handle this?
>>
>>Unfortunately the whole read/write API is a mess b/c it is 
>>supposedly ther only for PCI drivers but everthing from flash 
>>to 8250.c uses it. :( I had a similar situation with the 
>>IXDP2801 board where the serial driver does readl/writel and I 
>>didn't want to swap the words. The only way to do this that I 
>>could really think of was to static-map the serial ports and 
>>then have my read/write macros check the address range of the 
>>incoming address to determine how to handle it.  Since there 
>>is no device context associated with the incoming address, it 
>>seemed like the only way to really do it.  
> 
> I'm just chiming in because I think that there are a lot of folks 
> that could benefit.  This would be a similar issue with handing
> the CF connection on the Gateworks IXP425-based board. Connecting
> the IDE Subsystem required replacing the io routines. 
> 
> I did spend a little time last year looking at this and concluded
> that PCI is the sole focus in linux, a general solution for the
> expansion bus probably deserved a new subsystem, but - at the time
>  - was not worth the Effort.  I did not have the time or a project
> To try it on either.  Although if I had at least Hacked something
> to gether it may have ecouraged others.
> 
> You two guys are the best ones to maybe formulate a solution/less
> ugly hack(IMHO).   Do we want to try to address it in this forum?

This is actually not even ARM specific. I have run into this
problem on a number of different architectures. Anything not
x86 really :-)  It might make sense to move it to the lkml.

I deal with a lot of custom hardware platforms and I have
seen all maner of off-the-shelf peripherals hooked up to
CPU busses in all sorts of weird ways. As soon as the address
or register layout is mapped in some way, or just isn't
directly mapped, you tend to hit this problem. If you only have
a single device to deal with that needs to in/out or readl/writel
then no problem. Once you have more it gets ugly.

Regards
Greg



------------------------------------------------------------------------
Greg Ungerer  --  Chief Software Dude       EMAIL:     gerg@snapgear.com
SnapGear -- a CyberGuard Company            PHONE:       +61 7 3435 2888
825 Stanley St,                             FAX:         +61 7 3891 3630
Woolloongabba, QLD, 4102, Australia         WEB: http://www.SnapGear.com

-------------------------------------------------------------------
Subscription options: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm-kernel
FAQ:       http://www.arm.linux.org.uk/armlinux/mlfaq.php
Etiquette: http://www.arm.linux.org.uk/armlinux/mletiquette.php
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic