linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* PCI and ioports question
@ 2001-07-17 16:11 daniel sheltraw
  2001-07-17 16:21 ` Jeff Garzik
  2001-07-17 16:47 ` Richard B. Johnson
  0 siblings, 2 replies; 3+ messages in thread
From: daniel sheltraw @ 2001-07-17 16:11 UTC (permalink / raw)
  To: linux-kernel

Hello Kernel listees

I have a question about ioports on PCI devices but first: If
there is a better mailing list for asking these types of questions
would you kindly direct me there.

The question is this. When do I need to use ioremap for ioports
on a PCI device (PC architecture)? Is the answer: always except
when the physical address is within the 64K - 1M ISA region (legacy
ports).

Thanks,
Daniel
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: PCI and ioports question
  2001-07-17 16:11 PCI and ioports question daniel sheltraw
@ 2001-07-17 16:21 ` Jeff Garzik
  2001-07-17 16:47 ` Richard B. Johnson
  1 sibling, 0 replies; 3+ messages in thread
From: Jeff Garzik @ 2001-07-17 16:21 UTC (permalink / raw)
  To: daniel sheltraw; +Cc: linux-kernel

daniel sheltraw wrote:
> I have a question about ioports on PCI devices but first: If
> there is a better mailing list for asking these types of questions
> would you kindly direct me there.
> 
> The question is this. When do I need to use ioremap for ioports
> on a PCI device (PC architecture)? Is the answer: always except
> when the physical address is within the 64K - 1M ISA region (legacy
> ports).

For I/O ports, which have values between 0x0000 and 0xFFFF, you use
inb/inw/inl and outb/outw/outl, and do not use ioremap.

For ISA and PCI memory regions (which are completely different from I/O
ports), you always use ioremap, and talk to the regions use
readb/readw/readl and writeb/writew/writel.

There exist isa_xxx functions but do not use these:  these are only for
outdated drivers which have not yet been converted to use ioremap.

-- 
Jeff Garzik      | "I wouldn't be so judgemental
Building 1024    |  if you weren't such a sick freak."
MandrakeSoft     |             -- goats.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: PCI and ioports question
  2001-07-17 16:11 PCI and ioports question daniel sheltraw
  2001-07-17 16:21 ` Jeff Garzik
@ 2001-07-17 16:47 ` Richard B. Johnson
  1 sibling, 0 replies; 3+ messages in thread
From: Richard B. Johnson @ 2001-07-17 16:47 UTC (permalink / raw)
  To: daniel sheltraw; +Cc: linux-kernel

On Tue, 17 Jul 2001, daniel sheltraw wrote:

> Hello Kernel listees
> 
> I have a question about ioports on PCI devices but first: If
> there is a better mailing list for asking these types of questions
> would you kindly direct me there.
> 
> The question is this. When do I need to use ioremap for ioports
> on a PCI device (PC architecture)? Is the answer: always except
> when the physical address is within the 64K - 1M ISA region (legacy
> ports).
> 
> Thanks,
> Daniel

For PORTS, you use check_region(). If the result is non-zero, there
is a conflict. To get the region, use request_region(). ioremap()
is for memory address-space.

Ports only go from 0 to 0xffff on an Intel machine, even if the
device is on the PCI bus.

cat /dev/ioports
0000-001f : dma1
0020-003f : pic1
0040-005f : timer
0060-006f : keyboard
0070-007f : rtc
0080-008f : dma page reg
00a0-00bf : pic2
00c0-00df : dma2
00f0-00ff : fpu
02f8-02ff : serial(auto)
03c0-03df : vga+
03f8-03ff : serial(auto)
0cf8-0cff : PCI conf1
b400-b403 : PCI device 104b:1040
  b400-b403 : BusLogic BT-958
b800-b87f : PCI device 10b7:9055
  b800-b87f : eth0
d000-d01f : PCI device 1022:2000
d400-d41f : PCI device 8086:7112
d800-d80f : PCI device 8086:7111
e400-e43f : PCI device 8086:7113
e800-e81f : PCI device 8086:7113


Cheers,
Dick Johnson

Penguin : Linux version 2.4.1 on an i686 machine (799.53 BogoMips).

    I was going to compile a list of innovations that could be
    attributed to Microsoft. Once I realized that Ctrl-Alt-Del
    was handled in the BIOS, I found that there aren't any.



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2001-07-17 16:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-07-17 16:11 PCI and ioports question daniel sheltraw
2001-07-17 16:21 ` Jeff Garzik
2001-07-17 16:47 ` Richard B. Johnson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).