linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <bh40@calva.net>
To: Gabriel Paubert <paubert@iram.es>
Cc: linuxppc-dev@lists.linuxppc.org, linux-fbdev@vuser.vu.union.edu
Subject: Re: [linux-fbdev] Retrace
Date: Tue, 8 Feb 2000 15:56:37 +0100	[thread overview]
Message-ID: <20000208155637.001939@mailhost.mipsys.com> (raw)
In-Reply-To: <Pine.HPX.4.10.10002081020040.1866-100000@gra-ux1.iram.es>


On Tue, Feb 8, 2000, Gabriel Paubert <paubert@iram.es> wrote:

>On x86 you have /dev/port which is disabled on PPC. I once or twice
>suggested (but was greeted with a deafening silence) that we could
>resurrect it and add an mmap method so that privileged programs may access
>I/O ports with:
>
>	io_fd= open("/dev/port", O_RDWR);
>	iobase=mmap(0, device_size, PROT_READ|PROT_WRITE, MAP_SHARED,
>			io_fd, device_base);
>
>
>> Unfortunately, with weird host bridges like Apple Uni-N (that has 3
>> busses with 3 different io bases but the same bus number), it's almost
>> impossible to get it correct, or eventually by parsing /proc/device-tree.
>
>Not a problem if device_base is unique, you have to check that
>device_base+device_size fits within one area. It must be unique at one
>point to distinguish them from the processor perspective.

device_base may not be unique. Actually, that depends what is device_base
and how it's retreived. But for example, reading the BARs can give you
identical io base for devices on different sub-bridges, the distinction
beeing done by the iobase of the bridge itself.

The fact is that macos don't care, since it's completely based on the
device-tree, MacOS-drivers call in/out functions that use the base
address of the parent bridge.

I have in mind the possibility of defining fake bridges in the kernel to
work around the Uni-N problem as a whole, but this leads to a bunch of
other problems (like desynchro with the device-tree, which can be
annoying for other things) and I'm not familiar enough with 2.3.x PCI
layer yet.

What's the usual method used by X-like apps to get the base of a device ?
/proc/pci ?

We could also have /proc/pci export "fixed" bases that already take into
account the iobase of the bridge.

We are in a realm where I lack experience with Linux to be able to tell
which solution is better (and have more chances of beeing accepted ;)


** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/

  reply	other threads:[~2000-02-08 14:56 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <Pine.LNX.4.10.10002071812050.1142-100000@cassiopeia.home>
2000-02-07 19:02 ` [linux-fbdev] Retrace Benjamin Herrenschmidt
2000-02-08  9:29   ` Gabriel Paubert
2000-02-08 14:56     ` Benjamin Herrenschmidt [this message]
2000-02-08 16:47       ` Gabriel Paubert
2000-02-08 16:51       ` Geert Uytterhoeven
2000-02-08 17:09         ` Gabriel Paubert
2000-02-08 21:30         ` Benjamin Herrenschmidt
2000-02-08 21:39           ` Geert Uytterhoeven
2000-02-08 10:02 Geert Uytterhoeven
2000-02-09  2:45 ` Paul Mackerras
  -- strict thread matches above, loose matches on Subject: below --
2000-02-08 16:00 Andy
2000-02-08 21:29 Benjamin Herrenschmidt
2000-02-09  9:57 ` Gabriel Paubert
2000-02-09 13:45 Patrick Lerda
2000-02-09 14:09 ` Gabriel Paubert

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=20000208155637.001939@mailhost.mipsys.com \
    --to=bh40@calva.net \
    --cc=linux-fbdev@vuser.vu.union.edu \
    --cc=linuxppc-dev@lists.linuxppc.org \
    --cc=paubert@iram.es \
    /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;
as well as URLs for NNTP newsgroup(s).