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 13/15] ARM: make mach/io.h include optional
Date: Tue, 14 Feb 2012 17:09:01 -0600	[thread overview]
Message-ID: <4F3AE98D.7030104@gmail.com> (raw)
In-Reply-To: <20120214174035.GA29765@n2100.arm.linux.org.uk>

On 02/14/2012 11:40 AM, Russell King - ARM Linux wrote:
> On Tue, Feb 14, 2012 at 05:16:26PM +0000, Arnd Bergmann wrote:
>> On Tuesday 14 February 2012, Rob Herring wrote:
>>> On 02/14/2012 02:04 AM, Arnd Bergmann wrote:
>>>> On Tuesday 14 February 2012, Rob Herring wrote:
>>>>
>>>>> If we use CONFIG_PCI, then we have to move over all PCI enabled
>>>>> platforms at once. With a separate kconfig option, then we can move
>>>>> platforms one by one. Some are legacy and we may not want to move. This
>>>>> also helped with omap, but Tony has now fixed it.
>>>>
>>>> We could also generalize the implementation from tegra, which seems
>>>> reasonable as a start:
>>>>
>>>>
>>>> #define IO_SPACE_LIMIT 0xffff
>>>>
>>>> #if defined(CONFIG_ISA) || defined(CONFIG_PCCARD)
>>>> #include <mach/io.h>
>>>> #elif defined(CONFIG_PCI)
>>>> extern void __iomem *pci_io_base;
>>>>
>>>> static inline void __iomem *__io(unsigned long addr)
>>>> {
>>>>         return pci_io_base + (addr & IO_SPACE_LIMIT);
>>>
>>> But don't we want a constant pci_io_base? This would certainly be a
>>> quicker conversion, but I don't think we want to do it twice.
>>
>> Yes, at least in the long run. Note that this should make no difference
>> at all from a performance point of view, but it does impact code size a bit.
> 
> That depends whether the additional reloads of pci_io_base can be properly
> scheduled by the compiler, and experience shows that you tend to end up
> with the load delay slot _not_ being filled on older processors.
> 
> Not only that, but the compiler _will_ evaluate the entire:
> 
> 	pci_io_base + (addr & IO_SPACE_LIMIT)
> 
> thing every time.  With a 64K mask, that will include _reloading_ the
> mask every single access.
> 
> So, we'll probably end up with about three additional loads per IO
> operation, none of which would be scheduled particularly well.
> 
> "Yuck" and "not in my kernel" comes to mind.

What about something like this:

io.h:
#define PCI_IO_VIRT_BASE 0xfef00000

arch/arm/common/pci.c (new file):
static struct map_desc pci_io_desc[] __initdata = {
	{
		.virtual	= PCI_IO_VIRT_BASE,
		.pfn		= 0,
		.length		= SZ_1M,
		.type		= MT_DEVICE,
	},
};

void __init pci_map_io(unsigned long paddr)
{
	pci_io_desc[0].pfn = __phys_to_pfn(paddr);
	iotable_init(pci_io_desc, ARRAY_SIZE(pci_io_desc));
}


This is using the last 1MB of vmalloc region. This may require some
adjustment of platform's static memory, but most PCI platforms I've
checked don't use this address, so it shouldn't be too painful.

orion5x maps 2 1MB regions for PCI and PCIE. How would you support 2 io
ranges?

BTW, I noticed some static mappings at 0xffxxxxxx. Are those even a
valid address?

Rob

  parent reply	other threads:[~2012-02-14 23:09 UTC|newest]

Thread overview: 74+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-13 21:43 [PATCH 00/15] mach/io.h cleanup and removal Rob Herring
2012-02-13 21:43 ` [PATCH 01/15] usb: ohci-pxa27x: add explicit include of hardware.h Rob Herring
2012-02-13 21:43 ` [PATCH 02/15] ARM: add explicit include of system.h to processor.h Rob Herring
2012-02-13 22:14   ` H Hartley Sweeten
2012-02-13 21:43 ` [PATCH 03/15] ARM: provide runtime hook for ioremap Rob Herring
2012-02-13 22:13   ` H Hartley Sweeten
2012-02-13 22:30   ` Russell King - ARM Linux
2012-02-13 22:48     ` Rob Herring
2012-02-13 21:43 ` [PATCH 04/15] ARM: imx: convert to common runtime ioremap hook Rob Herring
2012-02-16  0:17   ` Shawn Guo
2012-02-13 21:43 ` [PATCH 05/15] ARM: msm: use " Rob Herring
2012-02-13 23:05   ` David Brown
2012-02-13 21:43 ` [PATCH 06/15] ARM: msm: clean-up mach/io.h Rob Herring
2012-02-13 21:43 ` [PATCH 07/15] ARM: at91: " Rob Herring
2012-02-14  9:21   ` Nicolas Ferre
2012-02-14 13:24     ` Rob Herring
2012-02-16  7:43       ` Jean-Christophe PLAGNIOL-VILLARD
2012-02-16 14:08         ` Rob Herring
2012-02-16 14:23           ` Jean-Christophe PLAGNIOL-VILLARD
2012-02-23 17:26             ` Nicolas Ferre
2012-02-27 16:55               ` Rob Herring
2012-02-27 17:27                 ` Jean-Christophe PLAGNIOL-VILLARD
2012-02-13 21:43 ` [PATCH 08/15] ARM: davinci: remove unneeded mach/io.h include Rob Herring
2012-02-13 21:43 ` [PATCH 09/15] ARM: orion5x: clean-up mach/io.h Rob Herring
2012-02-13 21:43 ` [PATCH 10/15] ARM: tegra: " Rob Herring
2012-02-13 21:43 ` [PATCH 11/15] ARM: ep93xx: " Rob Herring
2012-02-13 21:52   ` Ryan Mallon
2012-02-13 22:15     ` Rob Herring
2012-02-13 22:16   ` H Hartley Sweeten
2012-02-27 15:17   ` [PATCH] " Rob Herring
2012-02-13 21:43 ` [PATCH 12/15] ARM: clps711x: remove unneeded include of mach/io.h Rob Herring
2012-02-13 21:43 ` [PATCH 13/15] ARM: make mach/io.h include optional Rob Herring
2012-02-13 22:14   ` H Hartley Sweeten
2012-02-13 22:36   ` Russell King - ARM Linux
2012-02-13 22:55     ` Rob Herring
2012-02-14  2:03     ` Arnd Bergmann
2012-02-14  2:54       ` Rob Herring
2012-02-14  8:04         ` Arnd Bergmann
2012-02-14 14:36           ` Rob Herring
2012-02-14 17:16             ` Arnd Bergmann
2012-02-14 17:40               ` Russell King - ARM Linux
2012-02-14 18:12                 ` Arnd Bergmann
2012-02-14 23:09                 ` Rob Herring [this message]
2012-02-14 23:43                   ` Russell King - ARM Linux
2012-02-15  0:25                     ` Nicolas Pitre
2012-02-15 14:14                       ` Rob Herring
2012-02-15  0:57                     ` Arnd Bergmann
2012-02-27 19:31               ` Rob Herring
2012-02-28 16:10                 ` Arnd Bergmann
2012-02-27 22:31           ` Rob Herring
2012-02-28 16:32             ` Arnd Bergmann
2012-02-13 23:15   ` H Hartley Sweeten
2012-02-14  1:06     ` Arnd Bergmann
2012-02-14 17:38       ` H Hartley Sweeten
2012-02-14 18:20         ` Arnd Bergmann
2012-02-13 21:43 ` [PATCH 14/15] ARM: remove bunch of now unused mach/io.h files Rob Herring
2012-02-13 22:16   ` H Hartley Sweeten
2012-02-16  0:19   ` Shawn Guo
2012-02-16 18:57   ` Linus Walleij
2012-02-13 21:43 ` [PATCH 15/15] ARM: kill off __mem_pci Rob Herring
2012-02-13 22:22 ` [PATCH 00/15] mach/io.h cleanup and removal Tony Lindgren
2012-02-13 23:56   ` Tony Lindgren
2012-02-14  3:09   ` Rob Herring
2012-02-13 23:41 ` Tony Lindgren
2012-02-14  3:20   ` Rob Herring
2012-02-14 17:24     ` Tony Lindgren
2012-02-14 17:57       ` Arnd Bergmann
2012-02-14 18:28         ` Nicolas Pitre
2012-02-14 19:41         ` Rob Herring
2012-02-14 20:43           ` Tony Lindgren
2012-02-14 21:26             ` Arnd Bergmann
2012-02-14 21:54               ` Rob Herring
2012-02-14 22:38                 ` Arnd Bergmann
2012-02-21 22:47 ` Stephen Warren

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=4F3AE98D.7030104@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).