public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jesse Barnes <jbarnes@engr.sgi.com>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Bjorn Helgaas <bjorn.helgaas@hp.com>,
	linux-pci@atrey.karlin.mff.cu, linux-ia64@vger.kernel.org,
	Linux Kernel list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] add legacy I/O and memory access routines to /proc/bus/pci API
Date: Wed, 15 Dec 2004 09:00:18 -0800	[thread overview]
Message-ID: <200412150900.18890.jbarnes@engr.sgi.com> (raw)
In-Reply-To: <1103101057.6246.19.camel@gaston>

On Wednesday, December 15, 2004 12:57 am, Benjamin Herrenschmidt wrote:
> > I think by "legacy I/O space", you mean specifically "legacy
> > I/O *port* space", right?  Maybe there's no current use for it,
> > but I can imagine supporting MMIO accesses this way, too.
>
> Legacy IO ports, there should be one space per PCI domain. There is also
> legacy ISA memory space though on some ppc's, this doesn't exist at all.
> I suspect we want to expose both in a way.

This interface exports both.

> > On i386, anyway ;-)  But on ia64, we support multiple 64k I/O port
> > spaces (one of them being the 0-64K space that corresponds to the
> > i386 "legacy" space).  Shouldn't we be able to access them with this
> > interface, too?
>
> We should imho. On ppc, we have a 64k space per domain. One of the main
> set of HW that has use for these are VGA cards. It's perfectly possible
> to have a Mac with an AGP card in the AGP port and a PCI video card in
> one of hte PCI slots, and those are on 2 different domains with
> different legacy (0...64k) IO spaces.
>
> We defininitely want whatever interface we define to deal with that.

Good, because that's exactly what it does.  The arch is responsible for 
returning the legacy I/O port or legacy ISA memory base address given a 
pci_dev, which is used as a base for the page offset passed into mmap.  So 
e.g. mmap(..., 0xa0000) after doing ioctl(fd, PCIIOC_MMAP_IS_LEGACY_MEM, ...) 
would get you the VGA framebuffer for the device corresponding to 'fd'.

> There is some work done by Jon Smirl in this area (a VGA access
> arbitration driver).

I think Dave Airlie did a version of the vga class driver, and the backend 
used for /proc/bus/pci could be used for both drivers.  I'm 
using /proc/bus/pci because it's available now and nearly good enough (i.e. 
this patch was all I needed to get going).

Anyway, I'll post another version with Bjorn's suggestion about the ioctl for 
choosing config or legacy I/O port read/writes, since it looks like the rest 
of your concerns are dealt with.

Thanks,
Jesse

  reply	other threads:[~2004-12-15 17:00 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-14 17:41 [PATCH] add legacy I/O and memory access routines to /proc/bus/pci API Jesse Barnes
2004-12-14 23:55 ` Bjorn Helgaas
2004-12-15  0:11   ` Jesse Barnes
2004-12-15  3:06     ` Jesse Barnes
2004-12-15  8:57   ` Benjamin Herrenschmidt
2004-12-15 17:00     ` Jesse Barnes [this message]
2004-12-16 14:55       ` Benjamin Herrenschmidt
2004-12-16 16:26         ` Jesse Barnes
2004-12-15 17:27 ` Jesse Barnes
2004-12-15 21:03   ` Andreas Dilger
2004-12-15 23:15     ` Jesse Barnes

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200412150900.18890.jbarnes@engr.sgi.com \
    --to=jbarnes@engr.sgi.com \
    --cc=benh@kernel.crashing.org \
    --cc=bjorn.helgaas@hp.com \
    --cc=linux-ia64@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@atrey.karlin.mff.cu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox