Re: Auto generation of PCMCIA config.opts file?

David Hinds <[email protected]> Thu, 31 Jul 2003 20:01:54 -0700
Newsgroups gmane.linux.pcmcia.devel
Message-ID <[email protected]>
On Thu, Jul 31, 2003 at 09:22:12PM -0400, Steven J. Hill wrote:
> I am having difficulties with automatically generating an
> '/etc/pcmcia/config.opts' file for my MIPS board. I was curious
> if anyone else had run into this problem on other architectures
> other than x86. Below is the dump for the PCI I/O and memory
> spaces:
> 
>    bash-2.05# cat /proc/iomem
>    00000000-07ffffff : System RAM
>      00100000-002f9c97 : Kernel code
>      00316000-00356fff : Kernel data
>    08000000-0fffffff : PCI Memory space
>      08001000-08400fff : PCI CardBus #01
>      08402000-08801fff : PCI CardBus #05
>      08802000-08802fff : card services
> 
>    bash-2.05# cat /proc/ioports
>    00001000-01000fff : PCI I/O space
>      00001000-00004fff : PCI CardBus #01
>      00005000-000050ff : PCI CardBus #01
>      00005400-000054ff : PCI CardBus #05
>      00005800-000058ff : PCI CardBus #05
> 
> From this I generate, by hand, my '/etc/pcmcia/config.opts' file:
> 
>    exclude port 0x1000-0x4fff
>    exclude port 0x5000-0x50ff
>    exclude port 0x5400-0x54ff
>    exclude port 0x5800-0x58ff
>    include port 0x5100-0x53ff
>    include port 0x5900-0x69ff
>    include memory 0x08802000-0x08802fff
> 
> It works perfectly. This has the problem of PCI bus ordering
> effecting what the addresses are though. My only solution would
> seem to create a quick C program that is called by the the boot
> up script that runs cardmgr and have it go look at the /proc
> entries and create the proper file. Does anyone have a better
> idea than this? Thanks.

Does your config.opts file work better than:

  include port 0x1000-0xffff
  include memory 0x08000000-0x0fffffff

You do not need to manually exclude regions that are marked in-use in
/proc/iomem and /proc/ioports because the PCMCIA modules will never
allocate a region that is already allocated.  You can just specify the
full range of PCI bus addresses and let cardmgr go at it.

-- Dave


-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01