Commit 1ac02d795889d1828a66d4b3a3fd66492d1d7cf2

Authored by Rob Herring
Committed by Olof Johansson
1 parent 00bd60fe33

ARM: fix __io macro for PCMCIA

With commit c334bc1 (ARM: make mach/io.h include optional), PCMCIA was
broken. PCMCIA depends on __io() returning a valid i/o address, and most
ARM platforms require IO_SPACE_LIMIT be set to 0xffffffff for PCMCIA. This
needs a better fix with a fixed i/o address mapping, but for now we just
restore things to the previous behavior.

This fixes at91, omap1, pxa and sa11xx. pxa needs io.h if PCI is enabled,
but PCMCIA is not. sa11xx already has IO_SPACE_LIMIT set to 0xffffffff,
so it doesn't need an io.h.

Signed-off-by: Rob Herring <rob.herring@calxeda.com>
Cc: Joachim Eastwood <joachim.eastwood@jotron.com>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Andrew Victor <linux@maxim.org.za>
Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>
Tested-by: Paul Parsons <lost.distance@yahoo.com> (pxa270)
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Olof Johansson <olof@lixom.net>

Showing 7 changed files with 93 additions and 1 deletions Side-by-side Diff

... ... @@ -338,6 +338,7 @@
338 338 select HAVE_CLK
339 339 select CLKDEV_LOOKUP
340 340 select IRQ_DOMAIN
  341 + select NEED_MACH_IO_H if PCCARD
341 342 help
342 343 This enables support for systems based on the Atmel AT91RM9200,
343 344 AT91SAM9 processors.
arch/arm/include/asm/io.h
... ... @@ -119,7 +119,7 @@
119 119 #ifdef CONFIG_NEED_MACH_IO_H
120 120 #include <mach/io.h>
121 121 #else
122   -#define __io(a) ({ (void)(a); __typesafe_io(0); })
  122 +#define __io(a) __typesafe_io((a) & IO_SPACE_LIMIT)
123 123 #endif
124 124  
125 125 /*
arch/arm/mach-at91/include/mach/io.h
  1 +/*
  2 + * arch/arm/mach-at91/include/mach/io.h
  3 + *
  4 + * Copyright (C) 2003 SAN People
  5 + *
  6 + * This program is free software; you can redistribute it and/or modify
  7 + * it under the terms of the GNU General Public License as published by
  8 + * the Free Software Foundation; either version 2 of the License, or
  9 + * (at your option) any later version.
  10 + *
  11 + * This program is distributed in the hope that it will be useful,
  12 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14 + * GNU General Public License for more details.
  15 + *
  16 + * You should have received a copy of the GNU General Public License
  17 + * along with this program; if not, write to the Free Software
  18 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  19 + */
  20 +
  21 +#ifndef __ASM_ARCH_IO_H
  22 +#define __ASM_ARCH_IO_H
  23 +
  24 +#define IO_SPACE_LIMIT 0xFFFFFFFF
  25 +#define __io(a) __typesafe_io(a)
  26 +
  27 +#endif
arch/arm/mach-omap1/include/mach/io.h
  1 +/*
  2 + * arch/arm/mach-omap1/include/mach/io.h
  3 + *
  4 + * IO definitions for TI OMAP processors and boards
  5 + *
  6 + * Copied from arch/arm/mach-sa1100/include/mach/io.h
  7 + * Copyright (C) 1997-1999 Russell King
  8 + *
  9 + * This program is free software; you can redistribute it and/or modify it
  10 + * under the terms of the GNU General Public License as published by the
  11 + * Free Software Foundation; either version 2 of the License, or (at your
  12 + * option) any later version.
  13 + *
  14 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
  15 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  16 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
  17 + * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  18 + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  19 + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  20 + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
  21 + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  22 + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  23 + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  24 + *
  25 + * You should have received a copy of the GNU General Public License along
  26 + * with this program; if not, write to the Free Software Foundation, Inc.,
  27 + * 675 Mass Ave, Cambridge, MA 02139, USA.
  28 + *
  29 + * Modifications:
  30 + * 06-12-1997 RMK Created.
  31 + * 07-04-1999 RMK Major cleanup
  32 + */
  33 +
  34 +#ifndef __ASM_ARM_ARCH_IO_H
  35 +#define __ASM_ARM_ARCH_IO_H
  36 +
  37 +#define IO_SPACE_LIMIT 0xffffffff
  38 +
  39 +/*
  40 + * We don't actually have real ISA nor PCI buses, but there is so many
  41 + * drivers out there that might just work if we fake them...
  42 + */
  43 +#define __io(a) __typesafe_io(a)
  44 +
  45 +#endif
arch/arm/mach-pxa/Kconfig
... ... @@ -113,6 +113,7 @@
113 113 select IWMMXT
114 114 select PXA25x
115 115 select MIGHT_HAVE_PCI
  116 + select NEED_MACH_IO_H if PCI
116 117  
117 118 config MACH_EM_X270
118 119 bool "CompuLab EM-x270 platform"
arch/arm/mach-pxa/include/mach/io.h
  1 +/*
  2 + * arch/arm/mach-pxa/include/mach/io.h
  3 + *
  4 + * Copied from asm/arch/sa1100/io.h
  5 + */
  6 +#ifndef __ASM_ARM_ARCH_IO_H
  7 +#define __ASM_ARM_ARCH_IO_H
  8 +
  9 +#define IO_SPACE_LIMIT 0xffffffff
  10 +
  11 +/*
  12 + * We don't actually have real ISA nor PCI buses, but there is so many
  13 + * drivers out there that might just work if we fake them...
  14 + */
  15 +#define __io(a) __typesafe_io(a)
  16 +
  17 +#endif
arch/arm/plat-omap/Kconfig
... ... @@ -17,6 +17,7 @@
17 17 select IRQ_DOMAIN
18 18 select HAVE_IDE
19 19 select NEED_MACH_MEMORY_H
  20 + select NEED_MACH_IO_H if PCCARD
20 21 help
21 22 "Systems based on omap7xx, omap15xx or omap16xx"
22 23