linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: robherring2@gmail.com (Rob Herring)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 03/15] ARM: tegra: use fixed PCI i/o mapping
Date: Sun, 08 Jul 2012 15:33:23 -0500	[thread overview]
Message-ID: <4FF9EE93.3010200@gmail.com> (raw)
In-Reply-To: <201207081635.30864.arnd@arndb.de>

On 07/08/2012 11:35 AM, Arnd Bergmann wrote:
> On Sunday 08 July 2012, Rob Herring wrote:
>>> I'm not very familiar with the inner workings of the iotable and the
>>> mappings initialized by it, but I wonder if this can be done dynamically
>>> at a later stage. The way this is currently done in this patch, the I/O
>>> region is statically mapped from a fixed offset within the PCIe address
>>> range. Part of the patches to add DT support is to allow this region to
>>> be defined by the DT, so that will obviously also create problems.
>>
>> Is the i/o address something you could extract from DT earlier? This can
>> be done separately if it doesn't require information from the driver.
>>
>> I'm sure exactly how to do a fixed virtual mapping other than the
>> io_table mappings. There was some discussion of use fixmap region
>> previously, but doing so will be a bit more complex. I'll look into this
>> some.
> 
> I think you can call ioremap_page_range() to do this.

Thanks for the pointer. But this has to be in 2 steps. First reserve the
virtual space and then map it. For the first part I think something like
this function will work:

void __init pci_reserve_io(void)
{
	struct vm_struct *vm;

	vm = early_alloc_aligned(sizeof(*vm), __alignof__(*vm));

	vm->addr = (void *)PCI_IO_VIRT_BASE;
	vm->size = SZ_1M;
	vm->phys_addr = 0;
	vm->flags = VM_IOREMAP | VM_ARM_STATIC_MAPPING;
	vm->flags |= VM_ARM_MTYPE(MT_DEVICE);
	vm->caller = pci_reserve_io;
	vm_area_add_early(vm++);
}

There's a big fat warning on vm_area_add_early from Nico to not use
unless you know what you're doing. I'll pretend I do...

Rob

  reply	other threads:[~2012-07-08 20:33 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-06 18:40 [PATCH 00/15] PCI io.h cleanups Rob Herring
2012-07-06 18:40 ` [PATCH 01/15] ARM: Add fixed PCI i/o mapping Rob Herring
2012-07-09 16:21   ` Arnd Bergmann
2012-07-06 18:40 ` [PATCH 02/15] ARM: versatile: use " Rob Herring
2012-07-06 18:40 ` [PATCH 03/15] ARM: tegra: " Rob Herring
2012-07-06 19:44   ` Stephen Warren
2012-07-06 20:11     ` Rob Herring
2012-07-06 20:16       ` Stephen Warren
2012-07-06 20:36         ` Stephen Warren
2012-07-06 21:01           ` Stephen Warren
2012-07-08  6:09   ` Thierry Reding
2012-07-08 14:17     ` Rob Herring
2012-07-08 16:35       ` Arnd Bergmann
2012-07-08 20:33         ` Rob Herring [this message]
2012-07-09  2:53           ` Nicolas Pitre
2012-07-06 18:40 ` [PATCH 04/15] ARM: integrator: " Rob Herring
2012-07-06 18:40 ` [PATCH 05/15] ARM: shark: " Rob Herring
2012-07-06 18:40 ` [PATCH 06/15] ARM: footbridge: " Rob Herring
2012-07-06 18:40 ` [PATCH 07/15] ARM: dove: " Rob Herring
2012-07-09 15:50   ` Arnd Bergmann
2012-07-09 18:29     ` Rob Herring
2012-07-09 20:37       ` Arnd Bergmann
2012-07-09 20:47       ` Nicolas Pitre
2012-07-10  7:50         ` Arnd Bergmann
2012-07-06 18:40 ` [PATCH 08/15] ARM: kirkwood: " Rob Herring
2012-07-06 18:40 ` [PATCH 09/15] ARM: orion5x: " Rob Herring
2012-07-06 18:40 ` [PATCH 10/15] iop13xx: use more regular PCI I/O space handling Rob Herring
2012-07-06 18:40 ` [PATCH 11/15] ARM: iop13xx: use fixed PCI i/o mapping Rob Herring
2012-07-06 18:40 ` [PATCH 12/15] ARM: mv78xx0: use fixed pci " Rob Herring
2012-07-06 18:40 ` [PATCH 13/15] i2c: iop3xx: clean-up trailing whitespace Rob Herring
2012-07-06 18:40 ` [PATCH 14/15] i2c: iop3xx: use standard gpiolib functions Rob Herring
2012-07-08 11:29   ` Wolfram Sang
2012-07-08 14:29     ` Rob Herring
2012-07-06 18:40 ` [PATCH 15/15] ARM: iop3xx: use fixed PCI i/o mapping Rob Herring
2012-07-09 16:28 ` [PATCH 00/15] PCI io.h cleanups Arnd Bergmann
2012-07-09 18:42   ` Rob Herring
2012-07-09 20:24     ` Nicolas Pitre

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=4FF9EE93.3010200@gmail.com \
    --to=robherring2@gmail.com \
    --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).