All of lore.kernel.org
 help / color / mirror / Atom feed
From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [RFC] dove: fix __io() definition to use bus based offset
Date: Thu, 29 Jul 2010 17:49:04 +0200	[thread overview]
Message-ID: <201007291749.04181.arnd@arndb.de> (raw)
In-Reply-To: <AANLkTikeoQf=WC8M9daA=O+tgPdMbDeQdMTWoT8U=CpK@mail.gmail.com>

On Thursday 29 July 2010, Eric Miao wrote:
> On Thu, Jul 29, 2010 at 11:26 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> >>  #include "dove.h"
> >>
> >> -#define IO_SPACE_LIMIT         0xffffffff
> >> -
> >> -#define __io(a)  ((void __iomem *)(((a) - DOVE_PCIE0_IO_PHYS_BASE) +\
> >> -                                  DOVE_PCIE0_IO_VIRT_BASE))
> >> -#define __mem_pci(a)           (a)
> >> +#define IO_SPACE_LIMIT 0xffffffff
> >> +#define __io(a)                __typesafe_io((a) - DOVE_PCIE0_IO_BUS_BASE + \
> >> +                                           DOVE_PCIE0_IO_VIRT_BASE)
> >> +#define __mem_pci(a)   (a)
> >>
> >>  #endif
> >>
> >
> > The IO_SPACE_LIMIT still looks wrong, AFAICT it should be
> >
> > #define IO_SPACE_LIMIT (DOVE_PCIE0_IO_SIZE + DOVE_PCIE1_IO_SIZE - 1)
> >
> 
> And it looks like PCIE1_IO space is not used as indicated in its __io() macro.

DOVE_PCIE1_IO_VIRT_BASE directly follows (DOVE_PCIE0_IO_VIRT_BASE +
DOVE_PCIE0_IO_SIZE), so the macro is the same, isn't it?

However, I believe you also need the patch below to make thinks like
PCI-ISA bridges and VGA adapters as well as /dev/port access work.

Not-at-all-tested-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
 
--- a/arch/arm/mach-dove/pcie.c
+++ b/arch/arm/mach-dove/pcie.c
@@ -59,10 +59,10 @@ static int __init dove_pcie_setup(int nr, struct pci_sys_data *sys)
 	pp->io_space_name[sizeof(pp->io_space_name) - 1] = 0;
 	pp->res[0].name = pp->io_space_name;
 	if (pp->index == 0) {
-		pp->res[0].start = DOVE_PCIE0_IO_PHYS_BASE;
+		pp->res[0].start = DOVE_PCIE0_IO_BUS_BASE;
 		pp->res[0].end = pp->res[0].start + DOVE_PCIE0_IO_SIZE - 1;
 	} else {
-		pp->res[0].start = DOVE_PCIE1_IO_PHYS_BASE;
+		pp->res[0].start = DOVE_PCIE1_IO_BUS_BASE;
 		pp->res[0].end = pp->res[0].start + DOVE_PCIE1_IO_SIZE - 1;
 	}
 	pp->res[0].flags = IORESOURCE_IO;

  reply	other threads:[~2010-07-29 15:49 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-29  5:45 [RFC] dove: fix __io() definition to use bus based offset Eric Miao
2010-07-29 15:26 ` Arnd Bergmann
2010-07-29 15:34   ` Eric Miao
2010-07-29 15:49     ` Arnd Bergmann [this message]
2010-08-01 11:39       ` Saeed Bishara
2010-07-31 11:08 ` Russell King - ARM Linux
2010-07-31 19:21   ` Arnd Bergmann
2010-07-31 20:47     ` Russell King - ARM Linux
2010-08-02 10:59       ` Arnd Bergmann
2010-08-02 11:24         ` Russell King - ARM Linux
2010-08-02 15:44           ` Arnd Bergmann
2010-08-03  9:08             ` 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=201007291749.04181.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.