Skip to content

Commit 1ac02d7

Browse files
Rob Herringolofj
authored andcommitted
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 <[email protected]> Cc: Joachim Eastwood <[email protected]> Cc: Russell King <[email protected]> Cc: Andrew Victor <[email protected]> Cc: Nicolas Ferre <[email protected]> Cc: Jean-Christophe Plagniol-Villard <[email protected]> Tested-by: Paul Parsons <[email protected]> (pxa270) Acked-by: Tony Lindgren <[email protected]> Signed-off-by: Olof Johansson <[email protected]>
1 parent 00bd60f commit 1ac02d7

File tree

7 files changed

+93
-1
lines changed

7 files changed

+93
-1
lines changed

arch/arm/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,7 @@ config ARCH_AT91
338338
select HAVE_CLK
339339
select CLKDEV_LOOKUP
340340
select IRQ_DOMAIN
341+
select NEED_MACH_IO_H if PCCARD
341342
help
342343
This enables support for systems based on the Atmel AT91RM9200,
343344
AT91SAM9 processors.

arch/arm/include/asm/io.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ static inline void __iomem *__typesafe_io(unsigned long addr)
119119
#ifdef CONFIG_NEED_MACH_IO_H
120120
#include <mach/io.h>
121121
#else
122-
#define __io(a) ({ (void)(a); __typesafe_io(0); })
122+
#define __io(a) __typesafe_io((a) & IO_SPACE_LIMIT)
123123
#endif
124124

125125
/*

arch/arm/mach-at91/include/mach/io.h

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
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

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ config MACH_ARMCORE
113113
select IWMMXT
114114
select PXA25x
115115
select MIGHT_HAVE_PCI
116+
select NEED_MACH_IO_H if PCI
116117

117118
config MACH_EM_X270
118119
bool "CompuLab EM-x270 platform"

arch/arm/mach-pxa/include/mach/io.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ config ARCH_OMAP1
1717
select IRQ_DOMAIN
1818
select HAVE_IDE
1919
select NEED_MACH_MEMORY_H
20+
select NEED_MACH_IO_H if PCCARD
2021
help
2122
"Systems based on omap7xx, omap15xx or omap16xx"
2223

0 commit comments

Comments
 (0)