One of the most problematic issues with the whole 16-bit PCMCIA subsystem on
the x86 architecture is the following: cards request iomem or ioport
resources, but the PCMCIA subsystem does and can not know reliably at what
addresses iomem and ioport resources may be used, without interfering with
any third hardware.
Currently, we utilize two approaches to correctly "guess" which iomem and
ioport resource areas are safe to use[*]:
- If the PCMCIA bridge resides behind a PCI-PCI bridge or a PCI root bridge
with specific memory or I/O windows, these resoruces -- if not registered
otherwise -- are made available to PCMCIA devices. This works great on
modern hardware, and hasn't caused us any major hassles since its
introduction in 2.6.13 or so.
- Userspace (pcmcia-cs or pcmciautils) parses /etc/pcmcia/config.opts and
registers a couple of memory and I/O resources.
This latter configuration file most often contains
include port 0x100-0x3af
include memory 0xc0000-0xfffff
include memory 0xa0000000-0xa0ffffff
And so Komuro (CCed) suggested to add these default resource entries to the
kernel, so that it can later use parts of these resource areas to enable
PCMCIA devices without userspace interaction.
Do you think it would be safe to enable these areas by (kernel) default on
x86? Of course, other entries in /proc/io{mem,ports} would be honoured, there
would be a boot option to disable this feature, and some tests are run on the
iomem and ioport resource areas.
Best,
Dominik
[*] In addition, there are some tests which are run on iomem and ioport
resources before marking them as available to PCMCIA devices, but let's
ignore this aspect for the moment.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majo...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
c0000-fffff is option ROM and BIOS land. Maybe every BIOS out there
is being a good boy/girl and actually adds entries to e820 or similar
but I would kindof like to stay away from the region anyway.
0xa0000000 is 2.5GB, so it's doomed on systems with >=2.5GB RAM. :(
//Peter
Which crashes older thinkpads, some ATI chipset systems and
usually anything containing an NE2000 clone in ISA space.
> And so Komuro (CCed) suggested to add these default resource entries to the
> kernel, so that it can later use parts of these resource areas to enable
> PCMCIA devices without userspace interaction.
>
> Do you think it would be safe to enable these areas by (kernel) default on
> x86? Of course, other entries in /proc/io{mem,ports} would be honoured, there
> would be a boot option to disable this feature, and some tests are run on the
> iomem and ioport resource areas.
The problem you have is that you change the ordering.
If you load the ne2k ISA driver before pcmcia (as occurs now because of
it being done from user space) the resources get claimed first. If you do
it the other way around and test then merely reading an I/O register
mapped to an NE2K or most NE2K clones crashes the machine.
Are there any modern systems where the PCI based autoconfig is
insufficient, or is this just ancient stuff ?
Alan
>c0000-fffff is option ROM and BIOS land. Maybe every BIOS out there
>is being a good boy/girl and actually adds entries to e820 or similar
>but I would kindof like to stay away from the region anyway.
>
>0xa0000000 is 2.5GB, so it's doomed on systems with >=2.5GB RAM. :(
>
>
>//Peter
(1)
The i82365(ISA-pcmcia controller) and some older card-bus controller
need the c000-fffff area to access the CIS instead of high memory area
(1MB above).
(2)
Most of the PC that need the PCMCIA card is not so new.
and have less than 2.5GB.
Best Regards
Komuro
On Wed, Nov 25, 2009 at 08:56:50PM +0900, Komuro wrote:
> > Do you think it would be safe to enable these areas by (kernel) default on
> > x86? Of course, other entries in /proc/io{mem,ports} would be honoured, there
> > would be a boot option to disable this feature, and some tests are run on the
> > iomem and ioport resource areas.
>
> The problem you have is that you change the ordering.
>
> If you load the ne2k ISA driver before pcmcia (as occurs now because of
> it being done from user space) the resources get claimed first. If you do
> it the other way around and test then merely reading an I/O register
> mapped to an NE2K or most NE2K clones crashes the machine.
... and even adding a late_initcall() has its problems.
> Are there any modern systems where the PCI based autoconfig is
> insufficient, or is this just ancient stuff ?
I'm not familiar with embedded stuff, but usually PCI-based autoconfig
should be sufficient nowadays. Therefore, the only workable way seems to be
an optional module parameter
rsrc_nonstatic.include_io=0x100,0x3af,0x3e0,0x4ff,0x800,0x820,0xc00,0xcf7,0xa00,0xaff
rsrc_nonstatic.include_mem=0xc0000,0xfffff,0xa0000000,0xa0ffffff,0x60000000,0x60ffffff
or something like that. Thanks for the input!
Best,
Dominik