From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 0/3] [ARM] tegra: PCI Express support
Date: Sun, 19 Sep 2010 17:01:03 +0100 [thread overview]
Message-ID: <20100919160103.GF9098@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <4C962DF0.8060209@compulab.co.il>
On Sun, Sep 19, 2010 at 05:36:16PM +0200, Mike Rapoport wrote:
> Since ARM doesn't have special IO access instructions and all IO is memory
> mapped, from the CPU perspective IO window would be at some arbitrary
> physical address. For Tegra this address can be anywhere between
> 0x80004000 and 0x8fffffff. With sizes and offsets in my implementation
> the IO resources would be defined as follows:
> struct tegra_pcie_io_res[] = {
> [0] = {
> .start = 0x80400000,
> .end = 0x804fffff,
> .flags = IORESOURCE_IO,
> },
> [1] = {
> .start = 0x80500000,
> .end = 0x805fffff,
> .flags = IORESOURCE_IO,
> },
> }
These aren't IO resources - they're describing an area of physical
host memory, so they should be IORESOURCE_MEM.
> And then a call to request_resource(&ioport_resource, &tegra_pcie_io_res)
> fails because Tegra IO resources do not fit into the global
> ioport_resource definition.
And therefore they should not be registered against the ioport resource.
Think about it like this:
iomem_resource (CPU physical
address space view):
+------------+ 0x00000000
| RAM etc |
/ /
/ /
| | ioport_resource
+------------+ 0x80400000 ------> +-----------------+ 0x00000000
| | | PCI peripherals |
| | | |
| | 0x804003f8 +-----------------+ 0x000003f8
| | | Eg, PCI serial |
|PCI IO space| 0x804003ff +-----------------+ 0x000003ff
| | | |
| | | |
| | | PCI peripherals |
| | | |
| | | |
+------------+ 0x805fffff ------> +-----------------+ 0x001fffff
| |
/other stuff /
/ /
| |
+------------+ 0xffffffff
So the iomem resource tree is entirely separate from the ioport resource
tree, and the two never overlap. The iomem resource tree represents the
physical MMIO space, and just contains a reservation for the entire block
of PCI IO space. The ioport resource represents the entirely separate
PCI IO space resource tree.
To illustrate this better, on Footbridge, this is what you see in
/proc/iomem:
00000000-07ffffff : System RAM
0002d000-002a9fff : Kernel text
002aa000-002e7c77 : Kernel data
42000160-4200017f : Footbridge UART
a0000000-bfffffff : Footbridge prefetch
a0000000-a001ffff : 0000:00:07.0
a0020000-a003ffff : 0000:00:08.0
a0040000-a004ffff : 0000:00:09.0
c0000000-ffffffff : Footbridge non-prefetch
c0000000-c3ffffff : 0000:00:09.0
c4000000-c4000fff : 0000:00:06.3
c4001000-c400107f : 0000:00:08.0
Note that 7c000000-7c00ffff is the address range used for PCI IO accesses,
and isn't requested in the above (mainly because we never registered a
separate resource for it.)
and /proc/ioports:
0000-000f : dma1
0020-003f : pic1
0060-006f : i8042
0070-0073 : rtc_cmos
0070-0073 : rtc0
0080-008f : dma low page
00a0-00bf : pic2
00c0-00df : dma2
01f0-01f7 : ide0
0213-0213 : ISAPnP
02f8-02ff : serial8250.0
02f8-02ff : serial
03c0-03df : vga+
03f6-03f6 : ide0
03f8-03ff : serial8250.0
03f8-03ff : serial
0480-048f : dma high page
0a79-0a79 : isapnp write
1000-107f : 0000:00:08.0
1080-108f : 0000:00:06.1
1080-1087 : ide0
1090-109f : 0000:00:07.0
1090-1097 : ide1
1098-109f : ide2
10a0-10a7 : 0000:00:07.0
10a0-10a7 : ide1
10a8-10af : 0000:00:07.0
10a8-10af : ide2
10b0-10b3 : 0000:00:07.0
10b2-10b2 : ide1
10b4-10b7 : 0000:00:07.0
10b6-10b6 : ide2
ff00-ff7f : Footbridge
Note that IO accesses correspond to 0x7c000000 + IO address in iomem space.
next prev parent reply other threads:[~2010-09-19 16:01 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-16 16:53 [PATCH 0/3] [ARM] tegra: PCI Express support Mike Rapoport
2010-09-16 16:53 ` [PATCH 1/3] [ARM] tegra: add PCI Express clocks Mike Rapoport
2010-09-16 21:27 ` Colin Cross
2010-09-16 22:27 ` Mike Rapoport
2010-09-17 0:14 ` Gary King
2010-09-19 7:54 ` Mike Rapoport
2010-09-16 23:53 ` Mogambo Park
2010-09-19 7:52 ` Mike Rapoport
2010-09-16 16:53 ` [PATCH 2/3] [ARM] tegra: add PCI Express support Mike Rapoport
2010-09-16 21:42 ` Colin Cross
2010-09-16 22:16 ` Mike Rapoport
2010-09-16 16:53 ` [PATCH 3/3] [ARM] tegra: harmony: enable PCI Express Mike Rapoport
2010-09-16 21:44 ` Colin Cross
2010-09-16 21:57 ` Mike Rapoport
2010-09-16 17:12 ` [PATCH 0/3] [ARM] tegra: PCI Express support Arnd Bergmann
2010-09-19 14:07 ` Mike Rapoport
2010-09-19 14:39 ` Arnd Bergmann
2010-09-19 15:02 ` Russell King - ARM Linux
2010-09-19 16:34 ` Arnd Bergmann
2010-09-19 16:40 ` Russell King - ARM Linux
2010-09-19 17:09 ` Arnd Bergmann
2010-09-19 15:36 ` Mike Rapoport
2010-09-19 16:01 ` Russell King - ARM Linux [this message]
2010-09-20 7:15 ` Mike Rapoport
2010-09-20 9:13 ` Arnd Bergmann
2010-09-20 9:58 ` Russell King - ARM Linux
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=20100919160103.GF9098@n2100.arm.linux.org.uk \
--to=linux@arm.linux.org.uk \
--cc=linux-arm-kernel@lists.infradead.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).