Usenet comp.os.linux.alpha (1997-2013)
 help / color / mirror / Atom feed
From: "Måns Rullgård" <mru@inprovide.com>
Subject: Re: User mode IO acces - PCI A/D card - Alpha station XP900
Date: Tue, 11 Oct 2005 19:13:01 +0100	[thread overview]
Message-ID: <yw1x3bn7vs5u.fsf@ford.inprovide.com> (raw)
In-Reply-To: 1129046640.719784.48750@o13g2000cwo.googlegroups.com

"lpgl" <patrice.lespagnol@obs-nancay.fr> writes:

> Isn't accessing I/O ports, from user space, using outb/inb/outw/inw/
> after an initial  ioperm() or iopl(), an i386 only  feature ?
> I thought everything was memory mapped on alpha, and so were PCI
> devices.

The PCI I/O space is mapped to some high memory regions on Alpha.  The
outb/inb functions simply access these memory addresses.  These
functions are used for at least two reasons: 1) different machine
types map the I/O space at different addresses, and 2) for portability
to other architectures.

Another thing to be aware of on the Alpha is that the PCI memory is
mapped at a high offset as well.  You need to add a large number to
values listed by lspci to get the real address where a card can be
found, and use that when accessing /dev/mem.  Again, this offset
varies between machine types.  The function bus_base(), declared in
sys/io.h, will return the correct value.

It gets even more complicated.  Both PCI memory and I/O are mapped
to several CPU address regions.  Some of these are sparse, meaning
that a 32-bit write in that region will perform an 8-bit or 16-bit
write to the PCI bus.  The reason for this is that the first Alpha
models only had instructions to access memory 32 or 64 bits at a
time.

Then there's the IOMMU, but that's a different story, involving bus
mastering.

-- 
M�ns Rullg�rd
mru@inprovide.com


  parent reply	other threads:[~2005-10-11 18:13 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-11 12:07 User mode IO acces - PCI A/D card - Alpha station XP900 patrice.lespagnol
2005-10-11 12:53 ` Mathieu Chouquet-Stringer
2005-10-11 12:55   ` Mathieu Chouquet-Stringer
2005-10-11 14:10   ` lpgl
2005-10-11 14:57     ` Mathieu Chouquet-Stringer
2005-10-11 16:04       ` lpgl
2005-10-11 16:22         ` Mathieu Chouquet-Stringer
2005-10-11 18:03           ` lpgl
2005-10-11 18:16             ` Mathieu Chouquet-Stringer
2005-10-11 19:43               ` Måns Rullgård
2005-10-12  8:11                 ` lpgl
2005-10-12 12:29                   ` Mathieu Chouquet-Stringer
2005-10-13  7:24                     ` lpgl
2005-10-12  7:56               ` lpgl
2005-10-11 18:13         ` Måns Rullgård [this message]
2005-10-12  8:34           ` lpgl
2005-10-12 20:49             ` Måns Rullgård
2005-10-13  7:53               ` lpgl
2005-10-13  8:23                 ` Måns Rullgård
2005-10-13 10:40                   ` lpgl
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox