From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/3 v3] ARM Realview PCIX map include file changes
Date: Mon, 5 Sep 2011 16:35:59 +0200 [thread overview]
Message-ID: <201109051635.59927.arnd@arndb.de> (raw)
In-Reply-To: <20110822130942.23830.4767.stgit@e102602-lin.cambridge.arm.com>
On Monday 22 August 2011, Colin Tuckley wrote:
> This patch adds the memory map PCI support to the include
> files for the Realview Northbridge based boards.
>
> Signed-off-by: Colin Tuckley <colin.tuckley@arm.com>
> Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Hi Colin,
I think we've discussed this before. I think it's good to
have PCI support enabled in realview, but please do the
PIO window properly.
> diff --git a/arch/arm/mach-realview/include/mach/hardware.h b/arch/arm/mach-realview/include/mach/hardware.h
> index 8a638d1..dcc64f2 100644
> --- a/arch/arm/mach-realview/include/mach/hardware.h
> +++ b/arch/arm/mach-realview/include/mach/hardware.h
> +/*
> + * PCI space physical addresses and sizes
> + */
> +#define REALVIEW_PB_PCI_BASE 0x90040000 /* PCI-X Unit base */
> +#define REALVIEW_PB_PCI_BASE_SIZE 0x00010000 /* 4 Kb + 60Kb reserved */
> +#define REALVIEW_PB_PCI_IO_BASE 0x90050000 /* IO Region on AHB */
> +#define REALVIEW_PB_PCI_IO_SIZE 0x00010000 /* 64 Kb */
> +#define REALVIEW_PB_PCI_IO_LIMIT (REALVIEW_PB_PCI_IO_BASE + REALVIEW_PB_PCI_IO_SIZE - 1)
> +#define REALVIEW_PB_PCI_MEM_BASE 0xA0000000 /* MEM Region on AHB */
> +#define REALVIEW_PB_PCI_MEM_SIZE 0x20000000 /* 512 MB */
> +
> +#define REALVIEW_ISSP_REG_BASE 0x100E3000
As you write here, the I/O window size is 64KB, which is totally normal
for PCI buses.
> +#ifdef CONFIG_PCI
> +#if !defined(__ASSEMBLY__)
> +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;
> +}
pcibios_min_io should be 0x1000 as a constant, in order to get the
ISA addresses out of the way, but there is no need to make it
board dependent.
> +static inline unsigned int pcibios_min_mem(void)
> +{
> + if (machine_is_realview_pb11mp() || machine_is_realview_pba8() ||
> + machine_is_realview_pbx())
> + return REALVIEW_PB_PCI_MEM_BASE;
> + else
> + return 0;
> +}
> +#endif
Just hardcode this to REALVIEW_PB_PCI_MEM_BASE
> diff --git a/arch/arm/mach-realview/include/mach/io.h b/arch/arm/mach-realview/include/mach/io.h
> index f05bcdf..aa97d18 100644
> --- a/arch/arm/mach-realview/include/mach/io.h
> +++ b/arch/arm/mach-realview/include/mach/io.h
> @@ -20,9 +20,25 @@
> #ifndef __ASM_ARM_ARCH_IO_H
> #define __ASM_ARM_ARCH_IO_H
>
> +#include <asm/mach-types.h>
> +#include <mach/hardware.h>
> +
> #define IO_SPACE_LIMIT 0xffffffff
The IO_SPACE_LIMIT should match the REALVIEW_PB_PCI_IO_BASE above.
> -#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
> +}
And there is no need to do these tricks when you only have a single
PCI bus. Just define the PIO window to be based on zero and 64K
in size, and hardcode that, to end up with
#define __io(a) (REALVIEW_PCI_IO_VBASE + (a & IO_SPACE_LIMIT))
Arnd
next prev parent reply other threads:[~2011-09-05 14:35 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-22 13:09 [PATCH 0/3 v3] ARM Realview PCIX preparation Colin Tuckley
2011-08-22 13:09 ` [PATCH 1/3 v3] ARM Realview PCIX map include file changes Colin Tuckley
2011-09-05 14:35 ` Arnd Bergmann [this message]
2011-09-05 15:06 ` Arnd Bergmann
2011-09-08 9:09 ` Russell King - ARM Linux
2011-09-08 10:06 ` Colin Tuckley
2011-10-06 14:00 ` Colin Tuckley
2011-10-06 14:23 ` Russell King - ARM Linux
2011-10-06 14:50 ` Colin Tuckley
2011-10-06 15:57 ` Arnd Bergmann
2011-10-07 11:25 ` Catalin Marinas
2011-10-07 12:26 ` Arnd Bergmann
2011-08-22 13:10 ` [PATCH 2/3 v3] ARM Realview PCIX IRQ " Colin Tuckley
2011-08-22 13:10 ` [PATCH 3/3 v3] RM Realview PCIX board " Colin Tuckley
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=201109051635.59927.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.