All of lore.kernel.org
 help / color / mirror / Atom feed
From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 3/6] ARM Realview PCIX map include file changes
Date: Wed, 22 Dec 2010 16:33:20 +0100	[thread overview]
Message-ID: <201012221633.20748.arnd@arndb.de> (raw)
In-Reply-To: <20101222140409.29725.82642.stgit@e102602-lin.cambridge.arm.com>

On Wednesday 22 December 2010 15:04:09 Colin Tuckley wrote:

> #define REALVIEW_PB11MP_PCI_IO_SIZE            0x1000          /* 4 Kb */

Is the I/O space really just 4 kb? This may easily cause problems,
because the first 4 kb of I/O space are usually reserved for PCI-ISA
bridges and the like. At least the public documentation for PB-X
describes a 64 kb space, which is also what everyone else has.

> +static inline unsigned int pcibios_min_io(void)
> +{
> +       if (machine_is_realview_pb11mp() || machine_is_realview_pba8() ||
> +           machine_is_realview_pbx())
> +               return REALVIEW_PB_PCI_IO_BASE;
> +       else
> +               return 0;
> +}
...
> +
>  #define IO_SPACE_LIMIT 0xffffffff
>  
> -#define __io(a)                __typesafe_io(a)
> +static inline void __iomem *__io(unsigned long addr)
> +{
> +#ifdef CONFIG_PCI
> +       /* check for PCI I/O space */
> +       if (addr >= REALVIEW_PB_PCI_IO_BASE && addr <= REALVIEW_PB_PCI_IO_LIMIT)
> +               return (void __iomem *)((addr - REALVIEW_PB_PCI_IO_BASE) + REALVIEW_PCI_IO_VBASE);
> +       else
> +               return (void __iomem *)addr;
> +#else
> +       return (void __iomem *)addr;
> +#endif
> +}

The I/O space handling still looks really wrong. Why not simply do this:

#define PCIBIOS_MIN_IO 0x1000  /* skip the first 4kb */
#define IO_SPACE_LIMIT 0xffff  /* regular 64 kb I/O space */
#define __io(a) (REALVIEW_PCI_IO_VBASE + (a & IO_SPACE_LIMIT)

If you start the I/O space at REALVIEW_PB_PCI_IO_BASE instead of 0x1000
or 0, you get into all sorts of trouble, e.g. when using /dev/ioport.

	Arnd

  reply	other threads:[~2010-12-22 15:33 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-22 14:03 [PATCH 0/6] Series short description Colin Tuckley
2010-12-22 14:03 ` [PATCH 1/6] ARM: enable bridges in pci_common_init Colin Tuckley
2010-12-22 14:04 ` [PATCH 2/6] Realview PCIX support - add main support module code Colin Tuckley
2011-01-19 13:00   ` Russell King - ARM Linux
2010-12-22 14:04 ` [PATCH 3/6] ARM Realview PCIX map include file changes Colin Tuckley
2010-12-22 15:33   ` Arnd Bergmann [this message]
2010-12-22 16:12     ` Colin Tuckley
2010-12-22 16:48     ` Arnd Bergmann
2010-12-22 14:04 ` [PATCH 4/6] ARM Realview PCIX IRQ " Colin Tuckley
2010-12-22 14:04 ` [PATCH 5/6] ARM Realview PCIX board " Colin Tuckley
2010-12-22 14:04 ` [PATCH 6/6] ARM Realview PCIX build " Colin Tuckley
  -- strict thread matches above, loose matches on Subject: below --
2010-10-20 13:02 [PATCH 0/6] Add PCI support for ARM RealView boards Colin Tuckley
2010-10-20 13:03 ` [PATCH 3/6] ARM Realview PCIX map include file changes Colin Tuckley
2010-10-20 21:28   ` Arnd Bergmann

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=201012221633.20748.arnd@arndb.de \
    --to=arnd@arndb.de \
    --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.