All of lore.kernel.org
 help / color / mirror / Atom feed
From: robherring2@gmail.com (Rob Herring)
To: linux-arm-kernel@lists.infradead.org
Subject: mach/io.h cleanup and removal question
Date: Fri, 08 Jun 2012 09:10:17 -0500	[thread overview]
Message-ID: <4FD207C9.5010006@gmail.com> (raw)
In-Reply-To: <20120608114316.GC15555@n2100.arm.linux.org.uk>

On 06/08/2012 06:43 AM, Russell King - ARM Linux wrote:
> On Fri, Jun 08, 2012 at 12:20:40PM +0200, Andrew Lunn wrote:
>> Your patchset for mach/io.h cleanup and remove, causes problems on
>> Orion5x.
>>
>> mach/io.h for orion5x had a:
>>
>> #define IO_SPACE_LIMIT		0xffffffff
>>
>> which got removed. This results in a panic at boot:
>>
>>         /*
>>          * IORESOURCE_IO
>>          */
>>         sys->io_offset = 0;
>>         res[0].name = "PCIe I/O Space";
>>         res[0].flags = IORESOURCE_IO;
>>         res[0].start = ORION5X_PCIE_IO_BUS_BASE;
>>         res[0].end = res[0].start + ORION5X_PCIE_IO_SIZE - 1;
>>         if (request_resource(&ioport_resource, &res[0]))
>>                 panic("Request PCIe IO resource failed\n");
>>
>> ORION5X_PCIE_IO_SIZE is 1MB, so the allocation fails because of the
>> 64K default.
>>
>> arch/arm/include/asm/io.h has the comment:
>>
>> /*
>>  * This is the limit of PC card/PCI/ISA IO space, which is by default
>>  * 64K if we have PC card, PCI or ISA support.  Otherwise, default to
>>  * zero to prevent ISA/PCI drivers claiming IO space (and potentially
>>  * oopsing.)
>>  *
>>  * Only set this larger if you really need inb() et.al. to operate over
>>  * a larger address space.  Note that SOC_COMMON ioremaps each sockets
>>  * IO space area, and so inb() et.al. must be defined to operate as per
>>  * readb() et.al. on such platforms.
>>  */
>>
>> Now, i know nothing about how PCI works... So i have a question:
>>
>> Which is better, put back parts of io.h so allowing the 1MB
>> request_resource, or reduce ORION5X_PCIE_IO_SIZE to 64KB, since from
>> the comment it is unlikely an PCI card needs more than 64KB?
> 
> Well, the comment about SOC_COMMON doesn't apply as you're not using that.
> 
> Probably shrinking ORION5X_PCIE_IO_SIZE to 64K, unless we really have a
> requirement to support a larger IO space.

Agreed. The next step is moving all i/o space to a fixed virtual address
and for this we want to make i/o windows 64K.

However, I think you may also have a problem with
ORION5X_PCIE_IO_BUS_BASE and the resource start. The i/o resource start
should really be 0 and then the __io() macro should add the virtual i/o
base address. However, Russell has mentioned previously that some chips
may not work correctly with i/o space at 0 (PCI bus addresses, not host).

Do you have cards with i/o that you can test or know what devices are
used with this platform?

Rob

  reply	other threads:[~2012-06-08 14:10 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-08 10:20 mach/io.h cleanup and removal question Andrew Lunn
2012-06-08 11:43 ` Russell King - ARM Linux
2012-06-08 14:10   ` Rob Herring [this message]
2012-06-08 14:35     ` Andrew Lunn
2012-06-18  7:59     ` Andrew Lunn
2012-06-18 18:29       ` Nicolas Pitre
2012-06-18 10:18     ` 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=4FD207C9.5010006@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.