[RFC] arm: versatile: enable PCI I/O space

Russell King - ARM Linux linux at arm.linux.org.uk
Tue Jul 20 05:59:40 EDT 2010


On Tue, Jul 20, 2010 at 11:23:38AM +0200, Arnd Bergmann wrote:
> -/* macro to get at IO space when running virtually */
> +/* macro to get at MMIO space when running virtually */
>  #define IO_ADDRESS(x)		(((x) & 0x0fffffff) + (((x) >> 4) & 0x0f000000) + 0xf0000000)
>  
> -#define __io_address(n)		__io(IO_ADDRESS(n))
> +#define __io_address(n)		__typesafe_io(IO_ADDRESS(n))

Hmm, that's not a scenario that I forsaw __typesafe_io() being used -
I'd prefer it to be restricted to only aliasing __io() to if it's
appropriate.  Either add an IOMEM() definition or open-code the cast
here.

> diff --git a/arch/arm/mach-versatile/include/mach/io.h b/arch/arm/mach-versatile/include/mach/io.h
> index f067c14..a276171 100644
> --- a/arch/arm/mach-versatile/include/mach/io.h
> +++ b/arch/arm/mach-versatile/include/mach/io.h
> @@ -20,9 +20,12 @@
>  #ifndef __ASM_ARM_ARCH_IO_H
>  #define __ASM_ARM_ARCH_IO_H
>  
> -#define IO_SPACE_LIMIT 0xffffffff
> +#include <mach/hardware.h>
> +#include <mach/platform.h>
>  
> -#define __io(a)		__typesafe_io(a)
> +#define IO_SPACE_LIMIT (VERSATILE_PCI_MEM_BASE0_SIZE - 1)
> +
> +#define __io(a)		(a + VERSATILE_PCI_VIRT_MEM_BASE0)

Not quite.  Have a look at arch/arm/mach-footbridge/include/mach/io.h to
see how __io is defined there.



More information about the linux-arm-kernel mailing list