2001-11-06 09:12:53

by Robert Schwebel

[permalink] [raw]
Subject: ioport range of 8259 aka pic1

Hi,

is there a reason why the kernel (tested with 2.4.13) picks up the io port
region from 0020-003f for pic1? All I could find on the net lets me assume
that only 0020-0021 are used by the interrupt controllers (may be wrong
here - hints for literature are welcome). Same problem with pic2.

I'm currently working with an AMD Elan SC410 (x86 embedded system on chip)
which has it's private registers at 0022 and following, which makes it
impossible to write "correct" drivers that request_region() their ports
before using them.

Robert
--
+--------------------------------------------------------+
| Dipl.-Ing. Robert Schwebel |
| Pengutronix - Linux Solutions for Science and Industry |
| Braunschweiger Stra?e 79, 31134 Hildesheim, Germany |
| Phone: +49-5121-28619-0 Fax: +49-5121-28619-4 |
+--------------------------------------------------------+


2001-11-06 17:48:44

by Randy.Dunlap

[permalink] [raw]
Subject: Re: ioport range of 8259 aka pic1

Robert Schwebel wrote:
>
> is there a reason why the kernel (tested with 2.4.13) picks up the io port
> region from 0020-003f for pic1? All I could find on the net lets me assume
> that only 0020-0021 are used by the interrupt controllers (may be wrong
> here - hints for literature are welcome). Same problem with pic2.
>
> I'm currently working with an AMD Elan SC410 (x86 embedded system on chip)
> which has it's private registers at 0022 and following, which makes it
> impossible to write "correct" drivers that request_region() their ports
> before using them.

The Intel chipset specs say that PIC1 uses:
(all hex:) 20-21, 24-25, 28-29, 2c-2d, 30-31, 34-35, 38-39, 3c-3d.

Some of the older chipset specs say that all of these other than
20-21 are just aliases of 20-21 (like the 440MX spec).
Later specs don't say this (as in all of the 800-model ICH0/ICH2
specs).

In either case, port 0x22 should be available for you. What
do you mean by "and following"? What register range does it use?
What fixed IO addresses does the Elan require (consume)?

So in linux/arch/i386/kernel/setup.c, you could modify the
"standard IO resources" table to match your target system's
requirements.

Current table:
struct resource standard_io_resources[] = {
{ "dma1", 0x00, 0x1f, IORESOURCE_BUSY },
{ "pic1", 0x20, 0x3f, IORESOURCE_BUSY },
{ "timer", 0x40, 0x5f, IORESOURCE_BUSY },
{ "keyboard", 0x60, 0x6f, IORESOURCE_BUSY },
{ "dma page reg", 0x80, 0x8f, IORESOURCE_BUSY },
{ "pic2", 0xa0, 0xbf, IORESOURCE_BUSY },
{ "dma2", 0xc0, 0xdf, IORESOURCE_BUSY },
{ "fpu", 0xf0, 0xff, IORESOURCE_BUSY }
};

Just modify the "pic1" and "pic2" entries to be multiple shorter
entries.

~Randy

2001-11-06 19:40:19

by Maciej W. Rozycki

[permalink] [raw]
Subject: Re: ioport range of 8259 aka pic1

On Tue, 6 Nov 2001, Randy.Dunlap wrote:

> The Intel chipset specs say that PIC1 uses:
> (all hex:) 20-21, 24-25, 28-29, 2c-2d, 30-31, 34-35, 38-39, 3c-3d.
>
> Some of the older chipset specs say that all of these other than
> 20-21 are just aliases of 20-21 (like the 440MX spec).
> Later specs don't say this (as in all of the 800-model ICH0/ICH2
> specs).

These are chipset implementation details (i.e. address decoder's
shortcomings) only. An 8259A only uses two I/O ports; in PC/AT systems,
these are 0x20, 0x21 and 0xa0, 0xa1 for the two PICs, respectively. Since
the 0x00-0xff range is assigned to motherboard devices, there is no
problem with leaving aliases free -- they are never used by Linux. You
still need to verify your extra devices are really present there.

--
+ Maciej W. Rozycki, Technical University of Gdansk, Poland +
+--------------------------------------------------------------+
+ e-mail: [email protected], PGP key available +