From: Michel Lanners <mlan@cpu.lu>
To: geert@linux-m68k.org
Cc: bh40@calva.net, linuxppc-dev@lists.linuxppc.org
Subject: Re: __ioremap_at() in 2.4.0-test9-pre2
Date: Fri, 29 Sep 2000 23:35:07 +0200 (CEST) [thread overview]
Message-ID: <200009292135.XAA00900@piglet.grunz.lu> (raw)
In-Reply-To: <Pine.LNX.4.10.10009291319510.383-100000@cassiopeia.home>
On 29 Sep, this message from Geert Uytterhoeven echoed through cyberspace:
> On Thu, 28 Sep 2000, Michel Lanners wrote:
>> On 28 Sep, this message from Geert Uytterhoeven echoed through cyberspace:
>> >> I'm not sure it would help. It would probably allow a kind of "mapping on
>> >> demand" of the IO region on memory mapped IOs platforms, but unless we
>> >> add another parameter to ioportremap telling it the pci_dev (or at least
>> >> the bus number), we can't "guess" on which IO bus the device is and which
>> >> physical base we must use.
>> >
>> > But we can find out the IO bus by looking in which region the physical address
>> > is located, right? Or do we have the same region on different IO busses?
>> > That would be really weird! Different IO busses should decode different
>> > regions.
>>
>> No, they map the same bus-view IO space (bus addr. 0x0 - 0xsomething) to
>> different windows in the processor's memory space.
>>
>> In other words, you can have IO port 0x3f8 on each of the PCI buses, but
>> it will be accessed at different addresses from the processor's point of
>> view.
>
> Hence you have to fixup any pci_dev on the non-primary bus so its resources
> reflect the `real' I/O addresses, as seen from the CPU.
Yes, you will have to correct the pci_dev IO resources of all devices on
buses other than what you assign as being bus 0. In fact, the way Paul
and Ben intend to do it, is adding a fixed offset in inb() and friends,
and having a MMU mappung such that all IO regions appear as a single
consecutive region within the processor's virtual space.
In other words, IO on bus 1 needs to be offset (in pci_dev) by the size
of bus 0's IO space, and so on.
> So I/O address 0x3f8 (CPU view) is decoded by the first bus and accesses 0x3f8
> on the first bus.
> Say the second bus decodes, 0x1000-0x1fff. Then I/O address 0x13f8 (CPU view)
> is decoded by the second bus and accesses 0x3f8 on the second bus.
Yes, except that the offset to bus 1 will more likely be something like
0x10000 or more, i.e inb(0x103f8) gives you 0x3f8 on bus 1. Remember we
don't want to overlap the IO spaces of the different buses, rather
concatenate them. This saves the hassle of 'correcting' the firmware's
IO resource asignments.
> [ I think I really need the output of lspci -vv on a PC with PCI, AGP and a
> PCI-PCI bridge (and lots of cards) to bring some clarity... ]
Sure you want to see that? ;-)
Michel
-------------------------------------------------------------------------
Michel Lanners | " Read Philosophy. Study Art.
23, Rue Paul Henkes | Ask Questions. Make Mistakes.
L-1710 Luxembourg |
email mlan@cpu.lu |
http://www.cpu.lu/~mlan | Learn Always. "
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
next prev parent reply other threads:[~2000-09-29 21:35 UTC|newest]
Thread overview: 74+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-09-17 18:59 __ioremap_at() in 2.4.0-test9-pre2 Geert Uytterhoeven
2000-09-19 3:59 ` Paul Mackerras
2000-09-19 5:56 ` Michel Lanners
2000-09-19 14:28 ` Dan Malek
2000-09-19 18:31 ` Roman Zippel
2000-09-19 20:09 ` Dan Malek
2000-09-19 23:42 ` Roman Zippel
2000-09-20 0:10 ` Dan Malek
2000-09-20 17:18 ` Roman Zippel
2000-09-20 18:11 ` Dan Malek
2000-09-20 20:22 ` Roman Zippel
2000-09-20 20:41 ` David Edelsohn
2000-09-21 2:16 ` Dan Malek
2000-09-21 2:26 ` David Edelsohn
2000-09-21 2:40 ` Dan Malek
2000-09-21 3:53 ` David Edelsohn
2000-09-19 22:06 ` Matt Porter
2000-09-19 22:58 ` Paul Mackerras
2000-09-20 6:12 ` Matt Porter
2000-09-20 12:15 ` Geert Uytterhoeven
2000-09-20 23:08 ` Paul Mackerras
2000-09-21 20:12 ` Matt Porter
2000-09-20 8:34 ` Roman Zippel
2000-09-20 22:54 ` Paul Mackerras
2000-09-20 15:56 ` Dan Malek
2000-09-20 23:22 ` Paul Mackerras
2000-09-21 2:13 ` Dan Malek
2000-09-21 2:35 ` Paul Mackerras
2000-09-21 3:57 ` Dan Malek
2000-09-21 5:06 ` Paul Mackerras
2000-09-21 6:51 ` Dan Malek
2000-09-21 14:03 ` Geert Uytterhoeven
2000-09-21 22:40 ` Benjamin Herrenschmidt
2000-09-22 3:53 ` Dan Malek
2000-09-22 11:58 ` Geert Uytterhoeven
2000-09-22 18:46 ` Dan Malek
2000-09-22 20:06 ` Frank Rowand
2000-09-23 21:38 ` Matt Porter
2000-09-21 20:22 ` Matt Porter
2000-09-22 3:49 ` Paul Mackerras
2000-09-22 4:16 ` Dan Malek
2000-09-23 12:34 ` Geert Uytterhoeven
2000-09-27 10:37 ` Benjamin Herrenschmidt
2000-09-28 9:59 ` Geert Uytterhoeven
2000-09-28 19:19 ` Benjamin Herrenschmidt
2000-09-28 23:33 ` Benjamin Herrenschmidt
2000-09-29 5:08 ` Dan Malek
2000-09-29 11:37 ` Geert Uytterhoeven
2000-09-29 17:12 ` Kostas Gewrgiou
2000-09-29 17:18 ` Benjamin Herrenschmidt
2000-09-29 21:35 ` Michel Lanners [this message]
2000-09-30 0:11 ` Matt Porter
2000-09-29 0:22 ` Paul Mackerras
2000-09-29 0:40 ` Benjamin Herrenschmidt
2000-09-29 1:17 ` Paul Mackerras
2000-09-29 4:22 ` Dan Malek
2000-09-29 4:29 ` Dan Malek
2000-09-29 4:36 ` Paul Mackerras
2000-09-29 5:40 ` Dan Malek
2000-09-29 19:07 ` Frank Rowand
2000-09-30 1:39 ` Paul Mackerras
2000-09-30 22:50 ` Frank Rowand
2000-10-01 1:09 ` Dan Malek
2000-10-01 8:16 ` Paul Mackerras
2000-10-01 21:30 ` Dan Malek
2000-10-01 22:50 ` Paul Mackerras
2000-10-02 9:04 ` Dan Malek
2000-09-28 23:24 ` Frank Rowand
2000-09-21 13:44 ` Geert Uytterhoeven
2000-09-21 22:41 ` Benjamin Herrenschmidt
2000-09-22 21:59 ` Michel Lanners
2000-09-20 12:08 ` Geert Uytterhoeven
2000-09-20 16:31 ` Matt Porter
-- strict thread matches above, loose matches on Subject: below --
2000-09-21 7:30 Iain Sandoe
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=200009292135.XAA00900@piglet.grunz.lu \
--to=mlan@cpu.lu \
--cc=bh40@calva.net \
--cc=geert@linux-m68k.org \
--cc=linuxppc-dev@lists.linuxppc.org \
/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).