ARM: fix __io macro for PCMCIA
Subsystems (5)
PATCH 1/1 ARM: fix __io macro for PCMCIA
From: Rob Herring <[email protected]>
With commit c334bc1 (ARM: make mach/io.h include optional), PCMCIA was broken as PCMCIA depends on __io() being just a cast. This needs a better fix with a fixed i/o address mapping, but for now we just restore things to the previous behavior.
--- arch/arm/include/asm/io.h | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-)
arch/arm/include/asm/io.h +4 -2
@@ -118,6 +118,8 @@ static inline void __iomem *__typesafe_io(unsigned long addr)*/ #ifdef CONFIG_NEED_MACH_IO_H #include <mach/io.h> +#elif defined(CONFIG_PCCARD ) +#define __io (a) __typesafe_io(a)#else #define __io (a) ({ (void)(a); __typesafe_io(0); })#endif
@@ -134,9 +136,9 @@ static inline void __iomem *__typesafe_io(unsigned long addr)* readb() et.al. on such platforms. */ #ifndef IO_SPACE_LIMIT -#if defined(CONFIG_PCMCIA_SOC_COMMON ) || defined(CONFIG_PCMCIA_SOC_COMMON_MODULE ) +#if defined(CONFIG_PCCARD )#define IO_SPACE_LIMIT ((resource_size_t)0xffffffff) -#elif defined(CONFIG_PCI ) || defined(CONFIG_ISA ) || defined(CONFIG_PCCARD ) +#elif defined(CONFIG_PCI ) || defined(CONFIG_ISA )#define IO_SPACE_LIMIT ((resource_size_t)0xffff)#else #define IO_SPACE_LIMIT ((resource_size_t)0)
Signature · 1 line
1.7.5.4
PATCH 1/1 ARM: fix __io macro for PCMCIA
Quoted 10 lines · Rob Herring
From: Rob Herring <[email protected]>
With commit c334bc1 (ARM: make
mach/io.hinclude optional), PCMCIA was broken as PCMCIA depends on__io()being just a cast. This needs a better fix with a fixed i/o address mapping, but for now we just restore things to the previous behavior.Signed-off-by Rob Herring <[email protected]>Cc Joachim Eastwood <[email protected]>Cc Paul Parsons <[email protected]>
Yes, I suppose it's the only sane way for v3.4.
Russell, do you want to take it in your tree? Otherwise I'll put it into arm-soc since that is where things broke.
Arnd
PATCH 1/1 ARM: fix __io macro for PCMCIA
In reply to Rob HerringQuoted 4 lines · Rob Herring
With commit c334bc1 (ARM: make
mach/io.hinclude optional), PCMCIA was broken as PCMCIA depends on__io()being just a cast. This needs a better fix with a fixed i/o address mapping, but for now we just restore things to the previous behavior.
And what about systems with PCI IO at non-zero offsets with cardbus/pcmcia? This is broken and your assumption above is wrong.
PATCH 1/1 ARM: fix __io macro for PCMCIA
Quoted 8 lines · Russell King - ARM Linux
Quoted 4 lines · Rob Herring
With commit c334bc1 (ARM: make
mach/io.hinclude optional), PCMCIA was broken as PCMCIA depends on__io()being just a cast. This needs a better fix with a fixed i/o address mapping, but for now we just restore things to the previous behavior.And what about systems with PCI IO at non-zero offsets with cardbus/pcmcia? This is broken and your assumption above is wrong.
I would think they all still use their own mach/io.h. Which ones are you thinking of?
Arnd
PATCH 1/1 ARM: fix __io macro for PCMCIA
Quoted 7 lines · Arnd Bergmann
Quoted 6 lines · Russell King - ARM Linux
Quoted 4 lines · Rob Herring
With commit c334bc1 (ARM: make
mach/io.hinclude optional), PCMCIA was broken as PCMCIA depends on__io()being just a cast. This needs a better fix with a fixed i/o address mapping, but for now we just restore things to the previous behavior.
Quoted 5 lines
Quoted 2 lines
And what about systems with PCI IO at non-zero offsets with cardbus/pcmcia? This is broken and your assumption above is wrong.
I would think they all still use their own
mach/io.h. Which ones are you thinking of?
But they don't need the IO_SPACE_LIMIT messed around with - it should remain at 64K not 4GB.
PATCH 1/1 ARM: fix __io macro for PCMCIA
Quoted 8 lines · Russell King - ARM Linux
Quoted 7 lines · Arnd Bergmann
Quoted 6 lines · Russell King - ARM Linux
Quoted 4 lines · Rob Herring
With commit c334bc1 (ARM: make
mach/io.hinclude optional), PCMCIA was broken as PCMCIA depends on__io()being just a cast. This needs a better fix with a fixed i/o address mapping, but for now we just restore things to the previous behavior.
Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
And what about systems with PCI IO at non-zero offsets with cardbus/pcmcia? This is broken and your assumption above is wrong.
I would think they all still use their own
mach/io.h. Which ones are you thinking of?But they don't need the
IO_SPACE_LIMITmessed around with - it should remain at 64K not 4GB.
Actually, we've done the whole io.h removal in totally the wrong bloody order - because in removing all these so-called unnecessary io.h headers, we've removed all those IO_SPACE_LIMIT definitions which overrode the generic ones.
What we should have done is sorted out the PCMCIA/PCI/ISA IO space _first_ before removing any mach/io.h headers.
The fix for this is to restore those io.h headers which defined IO_SPACE_LIMIT to something else other than the asm/io.h default until the proper process in the above paragraph has been followed, and not to work around it by buggering with the generic - and correct - definition.
PATCH 1/1 ARM: fix __io macro for PCMCIA
Quoted 23 lines · Russell King - ARM Linux
Quoted 8 lines · Russell King - ARM Linux
Quoted 7 lines · Arnd Bergmann
Quoted 6 lines · Russell King - ARM Linux
Quoted 4 lines · Rob Herring
With commit c334bc1 (ARM: make
mach/io.hinclude optional), PCMCIA was broken as PCMCIA depends on__io()being just a cast. This needs a better fix with a fixed i/o address mapping, but for now we just restore things to the previous behavior.Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
And what about systems with PCI IO at non-zero offsets with cardbus/pcmcia? This is broken and your assumption above is wrong.
I would think they all still use their own
mach/io.h. Which ones are you thinking of?But they don't need the
IO_SPACE_LIMITmessed around with - it should remain at 64K not 4GB.Actually, we've done the whole
io.hremoval in totally the wrong bloody order - because in removing all these so-called unnecessaryio.hheaders, we've removed all thoseIO_SPACE_LIMITdefinitions which overrode the generic ones.
Quoted 9 lines
What we should have done is sorted out the PCMCIA/PCI/ISA IO space _first_ before removing any
mach/io.hheaders.The fix for this is to restore those
io.hheaders which definedIO_SPACE_LIMITto something else other than theasm/io.hdefault until the proper process in the above paragraph has been followed, and not to work around it by buggering with the generic - and correct - definition.
If you look at who defined IO_SPACE_LIMIT, you'll see most were just wrong (i.e. 0xffffffff and no PCMCIA/ISA/PCI). Is there any PCMCIA enabled ARM platform that doesn't require IO_SPACE_LIMIT to be 0xffffffff?
CONFIG_PCMCIA_SOC_COMMON is pretty much specific to PXA and SA11xx and we already have a special case for it in asm/io.h. I'm simply extending that to the few other platforms using PCMCIA. So it's not really any more buggered than it already was.
Also, with this patch, building a PCMCIA enabled platform and non-PCMCIA platform together are compatible. Adding io.h will mean any PCMCIA platform could not be part of a single kernel build (other issues aside).
Rob
PATCH 1/1 ARM: fix __io macro for PCMCIA
Quoted 34 lines · Rob Herring
Quoted 23 lines · Russell King - ARM Linux
Quoted 8 lines · Russell King - ARM Linux
Quoted 7 lines · Arnd Bergmann
Quoted 6 lines · Russell King - ARM Linux
Quoted 4 lines · Rob Herring
With commit c334bc1 (ARM: make
mach/io.hinclude optional), PCMCIA was broken as PCMCIA depends on__io()being just a cast. This needs a better fix with a fixed i/o address mapping, but for now we just restore things to the previous behavior.Quoted 8 lines
Quoted 5 lines
Quoted 2 lines
And what about systems with PCI IO at non-zero offsets with cardbus/pcmcia? This is broken and your assumption above is wrong.
I would think they all still use their own
mach/io.h. Which ones are you thinking of?But they don't need the
IO_SPACE_LIMITmessed around with - it should remain at 64K not 4GB.Actually, we've done the whole
io.hremoval in totally the wrong bloody order - because in removing all these so-called unnecessaryio.hheaders, we've removed all thoseIO_SPACE_LIMITdefinitions which overrode the generic ones.Quoted 9 lines
What we should have done is sorted out the PCMCIA/PCI/ISA IO space _first_ before removing any
mach/io.hheaders.The fix for this is to restore those
io.hheaders which definedIO_SPACE_LIMITto something else other than theasm/io.hdefault until the proper process in the above paragraph has been followed, and not to work around it by buggering with the generic - and correct - definition.
Quoted 3 lines
If you look at who defined
IO_SPACE_LIMIT, you'll see most were just wrong (i.e.0xffffffffand no PCMCIA/ISA/PCI). Is there any PCMCIA enabled ARM platform that doesn't requireIO_SPACE_LIMITto be0xffffffff?
I thought I'd pointed that out already and why you're wrong above.
Think: what if you have PCI IO space at 0x7c000000 and you have a cardbus bridge on your PCI bus. Hint: ARM platforms have exactly this.
You're going to end up setting their IO_SPACE_LIMIT to 4GB instead of the _correct_ 64K which they've had for _years_.
You're not making this better with this stuff, you're making things worse in the name of 'less files, oh that must be good'. No, it isn't good if you end up breaking stuff in the process.
Quoted 4 lines
CONFIG_PCMCIA_SOC_COMMONis pretty much specific to PXA and SA11xx and we already have a special case for it inasm/io.h. I'm simply extending that to the few other platforms using PCMCIA. So it's not really any more buggered than it already was.
Which is wrong, as I've already pointed out in this thread.
The generic definitions in asm/io.h are _correct_. PCMCIA without soc-common is standard PCMCIA, which has a single 64K IO window unless the platform is using some special code.
PCMCIA with soc-common is indeterminant, and we default to a 4GB _until_ the platforms are all fixed to use proper IO windows.
Quoted 3 lines
Also, with this patch, building a PCMCIA enabled platform and non-PCMCIA platform together are compatible. Adding
io.hwill mean any PCMCIA platform could not be part of a single kernel build (other issues aside).
Look, it's pretty simple. The kernel was working just fine before your conversion. Your conversion happened. The kernel stops working on certain platforms. That means your conversion to remove mach/io.h was incorrect and your analysis of what was required was wrong.
If that wasn't the case, there wouldn't be this fundamental issue that's caused this breakage.
PATCH 1/1 ARM: fix __io macro for PCMCIA
In reply to Rob HerringQuoted 36 lines · Rob Herring
From: Rob Herring <[email protected]>
With commit c334bc1 (ARM: make
mach/io.hinclude optional), PCMCIA was broken as PCMCIA depends on__io()being just a cast. This needs a better fix with a fixed i/o address mapping, but for now we just restore things to the previous behavior.Signed-off-by Rob Herring <[email protected]>Cc Joachim Eastwood <[email protected]>Cc Paul Parsons <[email protected]>---
?arch/arm/include/asm/io.h | ? ?6 ++++--
?1 files changed, 4 insertions(+), 2 deletions(-)arch/arm/include/asm/io.h +0
-0@@ -118,6 +118,8 @@ static inline void __iomem *__typesafe_io(unsigned long addr)?*/
?#ifdefCONFIG_NEED_MACH_IO_H
?#include <mach/io.h>arch/arm/include/asm/io.h +2
-0+#elif defined(CONFIG_PCCARD ) +#define __io (a) ? ? ? ? ? ? ? ?__typesafe_io(a)?#else
?#define__io(a)? ? ? ? ? ? ? ?({ (void)(a);__typesafe_io(0); }) ?#endifarch/arm/include/asm/io.h +0
-0@@ -134,9 +136,9 @@ static inline void __iomem *__typesafe_io(unsigned long addr)?*
readb()et.al. on such platforms.
?*/
?#ifndefIO_SPACE_LIMITarch/arm/include/asm/io.h +1
-1-#if defined(CONFIG_PCMCIA_SOC_COMMON ) || defined(CONFIG_PCMCIA_SOC_COMMON_MODULE ) +#if defined(CONFIG_PCCARD )?#define
IO_SPACE_LIMIT((resource_size_t)0xffffffff)arch/arm/include/asm/io.h +1
-1-#elif defined(CONFIG_PCI ) || defined(CONFIG_ISA ) || defined(CONFIG_PCCARD ) +#elif defined(CONFIG_PCI ) || defined(CONFIG_ISA )
Quoted 5 lines
?#define
IO_SPACE_LIMIT((resource_size_t)0xffff)
?#else
?#defineIO_SPACE_LIMIT((resource_size_t)0)
--
1.7.5.4
This doesn't work on my AT91RM9200 board. It still fails with the same error as without this patch.
[ 80.500000] pata_pcmcia: probe of 0.0 failed with error -12
regards
Joachim Eastwood
Quoted 4 lines
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH 1/1 ARM: fix __io macro for PCMCIA
Quoted 45 lines · Joachim Eastwood
Quoted 40 lines · Rob Herring
From: Rob Herring <[email protected]>
With commit c334bc1 (ARM: make
mach/io.hinclude optional), PCMCIA was broken as PCMCIA depends on__io()being just a cast. This needs a better fix with a fixed i/o address mapping, but for now we just restore things to the previous behavior.Signed-off-by Rob Herring <[email protected]>Cc Joachim Eastwood <[email protected]>Cc Paul Parsons <[email protected]>--- arch/arm/include/asm/io.h | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-)arch/arm/include/asm/io.h +4
-3@@ -118,6 +118,8 @@ static inline void __iomem *__typesafe_io(unsigned long addr)*/ #ifdef CONFIG_NEED_MACH_IO_H #include <mach/io.h> +#elif defined(CONFIG_PCCARD ) +#define __io (a) __typesafe_io(a)#else #define __io (a) ({ (void)(a); __typesafe_io(0); })#endif @@ -134,9 +136,9 @@ static inline void __iomem *__typesafe_io(unsigned long addr)* readb() et.al. on such platforms. */ #ifndef IO_SPACE_LIMIT -#if defined(CONFIG_PCMCIA_SOC_COMMON ) || defined(CONFIG_PCMCIA_SOC_COMMON_MODULE ) +#if defined(CONFIG_PCCARD )#define IO_SPACE_LIMIT ((resource_size_t)0xffffffff) -#elif defined(CONFIG_PCI ) || defined(CONFIG_ISA ) || defined(CONFIG_PCCARD ) +#elif defined(CONFIG_PCI ) || defined(CONFIG_ISA )#define IO_SPACE_LIMIT ((resource_size_t)0xffff)#else #define IO_SPACE_LIMIT ((resource_size_t)0) --Quoted 1 line
1.7.5.4
This doesn't work on my AT91RM9200 board. It still fails with the same error as without this patch.
Quoted 2 lines
[ 80.500000] pata_pcmcia: probe of 0.0 failed with error -12
Are you building as a module? I need to add the module variant of the define.
Otherwise, that doesn't make sense as this should be the same definitions as the at91 io.h header. Can you add some #warning lines to make sure you are picking up the correct definitions.
Rob
Quoted 7 lines
regards
Joachim EastwoodQuoted 4 lines
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH 1/1 ARM: fix __io macro for PCMCIA
Quoted 49 lines · Rob Herring
Quoted 38 lines · Joachim Eastwood
Quoted 37 lines · Rob Herring
From: Rob Herring <[email protected]>
With commit c334bc1 (ARM: make
mach/io.hinclude optional), PCMCIA was broken as PCMCIA depends on__io()being just a cast. This needs a better fix with a fixed i/o address mapping, but for now we just restore things to the previous behavior.Signed-off-by Rob Herring <[email protected]>Cc Joachim Eastwood <[email protected]>Cc Paul Parsons <[email protected]>---
?arch/arm/include/asm/io.h | ? ?6 ++++--
?1 files changed, 4 insertions(+), 2 deletions(-)arch/arm/include/asm/io.h +0
-0@@ -118,6 +118,8 @@ static inline void __iomem *__typesafe_io(unsigned long addr)?*/
?#ifdefCONFIG_NEED_MACH_IO_H
?#include <mach/io.h>arch/arm/include/asm/io.h +2
-0+#elif defined(CONFIG_PCCARD ) +#define __io (a) ? ? ? ? ? ? ? ?__typesafe_io(a)?#else
?#define__io(a)? ? ? ? ? ? ? ?({ (void)(a);__typesafe_io(0); }) ?#endifarch/arm/include/asm/io.h +0
-0@@ -134,9 +136,9 @@ static inline void __iomem *__typesafe_io(unsigned long addr)?*
readb()et.al. on such platforms.
?*/
?#ifndefIO_SPACE_LIMITarch/arm/include/asm/io.h +1
-1-#if defined(CONFIG_PCMCIA_SOC_COMMON ) || defined(CONFIG_PCMCIA_SOC_COMMON_MODULE ) +#if defined(CONFIG_PCCARD )?#define
IO_SPACE_LIMIT((resource_size_t)0xffffffff)arch/arm/include/asm/io.h +1
-1-#elif defined(CONFIG_PCI ) || defined(CONFIG_ISA ) || defined(CONFIG_PCCARD ) +#elif defined(CONFIG_PCI ) || defined(CONFIG_ISA )?#define
IO_SPACE_LIMIT((resource_size_t)0xffff)Quoted 9 lines
Quoted 4 lines
?#else
?#defineIO_SPACE_LIMIT((resource_size_t)0)
--
1.7.5.4This doesn't work on my AT91RM9200 board. It still fails with the same error as without this patch.
? [ ? 80.500000]pata_pcmcia: probe of 0.0 failed with error -12
Quoted 2 lines
Are you building as a module? I need to add the module variant of the define.
That explains it I guess. Yes, I am building it as a module.
regards
Joachim Eastwood
Quoted 14 lines
Otherwise, that doesn't make sense as this should be the same definitions as the at91
io.hheader. Can you add some #warning lines to make sure you are picking up the correct definitions.Rob
Quoted 7 lines
regards
Joachim EastwoodQuoted 4 lines
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
PATCH 1/1 ARM: fix __io macro for PCMCIA
In reply to Rob HerringQuoted 42 lines · Rob Herring
With commit c334bc1 (ARM: make
mach/io.hinclude optional), PCMCIA was
broken as PCMCIA depends on__io()being just a cast. This needs a better
fix with a fixed i/o address mapping, but for now we just restore things
to the previous behavior.Signed-off-by Rob Herring <[email protected]>Cc Joachim Eastwood <[email protected]>Cc Paul Parsons <[email protected]>---
arch/arm/include/asm/io.h|? ? 6 ++++--1 files changed, 4 insertions(+), 2 deletions(-)arch/arm/include/asm/io.h +0
-0@@ -118,6 +118,8 @@ static inline void __iomem *__typesafe_io(unsigned long addr)? */
#ifdefCONFIG_NEED_MACH_IO_H
#include <mach/io.h>arch/arm/include/asm/io.h +2
-0+#elif defined(CONFIG_PCCARD ) +#define __io (a)??? ???
__typesafe_io(a)
#else
#define__io(a)??? ??? ({
(void)(a);__typesafe_io(0); })
#endifarch/arm/include/asm/io.h +0
-0@@ -134,9 +136,9 @@ static inline void __iomem *__typesafe_io(unsigned long addr)? *
readb()et.al. on such platforms.
? */
#ifndefIO_SPACE_LIMIT
-#ifdefined(CONFIG_PCMCIA_SOC_COMMON)||defined(CONFIG_PCMCIA_SOC_COMMON_MODULE)arch/arm/include/asm/io.h +1
-1+#if defined(CONFIG_PCCARD )#define IO_SPACE_LIMIT ((resource_size_t)0xffffffff) -#elif defined(CONFIG_PCI) || defined(CONFIG_ISA) ||
Quoted 6 lines
defined(CONFIG_PCCARD)
+#elifdefined(CONFIG_PCI)||defined(CONFIG_ISA)
#defineIO_SPACE_LIMIT((resource_size_t)0xffff)
#else
#defineIO_SPACE_LIMIT((resource_size_t)0)
This works for me on my hx4700 (PXA270) running linux-3.4-rc1.
PATCH 1/1 ARM: fix __io macro for PCMCIA
In reply to Rob Herringarch/arm/include/asm/io.h static inline void __iomem *__typesafe_io(unsigned long addr) · line 144
Quoted 12 lines · Rob Herring
arch/arm/include/asm/io.h +2
-2@@ -134,9 +136,9 @@ static inline void __iomem *__typesafe_io(unsigned long addr)* readb() et.al. on such platforms. */ #ifndef IO_SPACE_LIMIT -#if defined(CONFIG_PCMCIA_SOC_COMMON ) || defined(CONFIG_PCMCIA_SOC_COMMON_MODULE ) +#if defined(CONFIG_PCCARD )#define IO_SPACE_LIMIT ((resource_size_t)0xffffffff) -#elif defined(CONFIG_PCI ) || defined(CONFIG_ISA ) || defined(CONFIG_PCCARD ) +#elif defined(CONFIG_PCI ) || defined(CONFIG_ISA )#define IO_SPACE_LIMIT ((resource_size_t)0xffff)#else #define IO_SPACE_LIMIT ((resource_size_t)0)
Now that we have a better understanding of the PCMCIA implementation on HX4700, I'm NAKing at least the above part on the grounds its totally wrong and bogus - the original unpatched is correct, and the modified version is likely to introduce further problems for platforms which do things properly.
PATCH v2 1/1 ARM: fix __io macro for PCMCIA
In reply to Rob HerringFrom: Rob Herring <[email protected]>
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.
--- arch/arm/Kconfig | 1 + arch/arm/include/asm/io.h | 2 +- arch/arm/mach-at91/include/mach/io.h | 27 +++++++++++++++++++ arch/arm/mach-omap1/include/mach/io.h | 45 +++++++++++++++++++++++++++++++++ arch/arm/mach-pxa/Kconfig | 1 + arch/arm/mach-pxa/include/mach/io.h | 17 ++++++++++++ arch/arm/plat-omap/Kconfig | 1 + 7 files changed, 93 insertions(+), 1 deletions(-) create mode 100644 arch/arm/mach-at91/include/mach/io.h create mode 100644 arch/arm/mach-omap1/include/mach/io.h create mode 100644 arch/arm/mach-pxa/include/mach/io.h
arch/arm/Kconfig +1 -0
@@ -338,6 +338,7 @@ config ARCH_AT91 select HAVE_CLK select CLKDEV_LOOKUP select IRQ_DOMAIN + select NEED_MACH_IO_H if PCCARD help This enables support for systems based on the Atmel AT91RM9200, AT91SAM9 processors.
arch/arm/include/asm/io.h +1 -1
@@ -119,7 +119,7 @@ static inline void __iomem *__typesafe_io(unsigned long addr)#ifdef CONFIG_NEED_MACH_IO_H #include <mach/io.h> #else -#define __io (a) ({ (void)(a); __typesafe_io(0); }) +#define __io (a) __typesafe_io((a) & IO_SPACE_LIMIT)#endif /*
arch/arm/mach-at91/include/mach/io.h new file +27 -0
@@ -0,0 +1,27 @@ +/* +* arch/arm/mach-at91/include/mach/io.h +* +* Copyright (C) 2003 SAN People +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#ifndef __ASM_ARCH_IO_H +#define __ASM_ARCH_IO_H + +#define IO_SPACE_LIMIT 0xFFFFFFFF +#define __io (a) __typesafe_io(a) + +#endif
arch/arm/mach-omap1/include/mach/io.h new file +45 -0
45 lines not on this page · raw message
arch/arm/mach-pxa/Kconfig +1 -0
@@ -113,6 +113,7 @@ config MACH_ARMCORE select IWMMXT select PXA25x select MIGHT_HAVE_PCI + select NEED_MACH_IO_H if PCI config MACH_EM_X270 bool "CompuLab EM-x270 platform"
arch/arm/mach-pxa/include/mach/io.h new file +17 -0
@@ -0,0 +1,17 @@ +/* +* arch/arm/mach-pxa/include/mach/io.h +* +* Copied from asm/arch/sa1100/io.h +*/ +#ifndef __ASM_ARM_ARCH_IO_H +#define __ASM_ARM_ARCH_IO_H + +#define IO_SPACE_LIMIT 0xffffffff + +/* +* We don't actually have real ISA nor PCI buses, but there is so many +* drivers out there that might just work if we fake them... +*/ +#define __io (a) __typesafe_io(a) + +#endif
arch/arm/plat-omap/Kconfig +1 -0
@@ -17,6 +17,7 @@ config ARCH_OMAP1 select IRQ_DOMAIN select HAVE_IDE select NEED_MACH_MEMORY_H + select NEED_MACH_IO_H if PCCARD help "Systems based on omap7xx, omap15xx or omap16xx"
Signature · 1 line
1.7.5.4
PATCH v2 1/1 ARM: fix __io macro for PCMCIA
Quoted 245 lines · Rob Herring
From: Rob Herring <[email protected]>
With commit c334bc1 (ARM: make
mach/io.hinclude optional), PCMCIA was
broken. PCMCIA depends on__io()returning a valid i/o address, and most
ARM platforms requireIO_SPACE_LIMITbe set to0xfffffffffor 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.hif PCI is enabled,
but PCMCIA is not. sa11xx already hasIO_SPACE_LIMITset to0xffffffff,
so it doesn't need anio.h.Signed-off-by Rob Herring <[email protected]>Cc Joachim Eastwood <[email protected]>Cc Paul Parsons <[email protected]>Cc Russell King <[email protected]>Cc Andrew Victor <[email protected]>Cc Nicolas Ferre <[email protected]>Cc Jean-Christophe Plagniol-Villard <[email protected]>Cc Tony Lindgren <[email protected]>---
arch/arm/Kconfig? ? ? ? ? ?
? ? ? ? ? |? ? 1 +
arch/arm/include/asm/io.h? ? ? ? ?
???|? ? 2 +-
arch/arm/mach-at91/include/mach/io.h?
|???27 +++++++++++++++++++
arch/arm/mach-omap1/include/mach/io.h|???45
+++++++++++++++++++++++++++++++++
arch/arm/mach-pxa/Kconfig? ? ? ? ?
???|? ? 1 +
arch/arm/mach-pxa/include/mach/io.h???|???17
++++++++++++
arch/arm/plat-omap/Kconfig? ? ? ?
? ? |? ? 1 +7 files changed, 93 insertions(+), 1 deletions(-) create mode 100644 arch/arm/mach-at91/include/mach/io.h create mode 100644 arch/arm/mach-omap1/include/mach/io.h create mode 100644 arch/arm/mach-pxa/include/mach/io.harch/arm/Kconfig +1
-0@@ -338,6 +338,7 @@ config ARCH_AT91 ??? select HAVE_CLK ??? select CLKDEV_LOOKUP ??? select IRQ_DOMAIN +??? select NEED_MACH_IO_H if PCCARD ??? help ??? ? This enables support for systems based on the Atmel AT91RM9200,??? ? AT91SAM9 processors.
arch/arm/include/asm/io.h +1
-1@@ -119,7 +119,7 @@ static inline void __iomem *__typesafe_io(unsigned long addr)#ifdef CONFIG_NEED_MACH_IO_H #include <mach/io.h> #else -#define __io (a)??? ??? ({ (void)(a); __typesafe_io(0); }) +#define __io (a)??? ???__typesafe_io ((a) &IO_SPACE_LIMIT )#endif
/*
arch/arm/mach-at91/include/mach/io.h new file +6
-0@@ -0,0 +1,27 @@ +/* +* arch/arm/mach-at91/include/mach/io.h +* +*? Copyright (C) 2003 SAN People +* +* This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.? See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA? 02111-1307? USA
+ */arch/arm/mach-at91/include/mach/io.h new file +5
-0+ +#ifndef __ASM_ARCH_IO_H +#define __ASM_ARCH_IO_H + +#define IO_SPACE_LIMIT ??? ???
0xFFFFFFFF
+#define__io(a)??? ???
???__typesafe_io(a)arch/arm/mach-at91/include/mach/io.h new file +2
-0+ +#endif arch/arm/mach-omap1/include/mach/io.h new file +9
-0@@ -0,0 +1,45 @@ +/* +* arch/arm/mach-omap1/include/mach/io.h +* +* IO definitions for TI OMAP processors and boards +* +* Copied from arch/arm/mach-sa1100/include/mach/io.h +* Copyright (C) 1997-1999 Russell King +* +* This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
+ *
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
+ * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
+ * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * Modifications:
+ *? 06-12-1997??? RMK???
Created.
+ *? 07-04-1999??? RMK???
Major cleanup
+ */arch/arm/mach-omap1/include/mach/io.h new file +8
-0+ +#ifndef __ASM_ARM_ARCH_IO_H +#define __ASM_ARM_ARCH_IO_H + +#define IO_SPACE_LIMIT 0xffffffff + +/* +* We don't actually have real ISA nor PCI buses, but there is so many
+ * drivers out there that might just work if we fake them...
+ */
+#define__io(a)??? ???__typesafe_io(a)arch/arm/mach-omap1/include/mach/io.h new file +2
-0+ +#endif arch/arm/mach-pxa/Kconfig +1
-0@@ -113,6 +113,7 @@ config MACH_ARMCORE ??? select IWMMXT ??? select PXA25x ??? select MIGHT_HAVE_PCI +??? select NEED_MACH_IO_H if PCI config MACH_EM_X270 ??? bool "CompuLab EM-x270 platform"arch/arm/mach-pxa/include/mach/io.h new file +12
-0@@ -0,0 +1,17 @@ +/* +* arch/arm/mach-pxa/include/mach/io.h +* +* Copied from asm/arch/sa1100/io.h +*/ +#ifndef __ASM_ARM_ARCH_IO_H +#define __ASM_ARM_ARCH_IO_H + +#define IO_SPACE_LIMIT 0xffffffff + +/* +* We don't actually have real ISA nor PCI buses, but there is so many
+ * drivers out there that might just work if we fake them...
+ */
+#define__io(a)??? ???__typesafe_io(a)arch/arm/mach-pxa/include/mach/io.h new file +2
-0+ +#endif arch/arm/plat-omap/Kconfig +1
-0@@ -17,6 +17,7 @@ config ARCH_OMAP1 ??? select IRQ_DOMAIN ??? select HAVE_IDE ??? select NEED_MACH_MEMORY_H +??? select NEED_MACH_IO_H if PCCARD ??? help ??? ? "Systems based on omap7xx,
Quoted 4 lines
omap15xx or omap16xx"
Signature · 1 line
1.7.5.4
This works for me on my hx4700 (PXA270) running linux-3.4-rc1.
Tony Lindgren
reviewerPATCH v2 1/1 ARM: fix __io macro for PCMCIA
In reply to Rob HerringQuoted 11 lines · Rob Herring
From: Rob Herring <[email protected]>
With commit c334bc1 (ARM: make
mach/io.hinclude optional), PCMCIA was broken. PCMCIA depends on__io()returning a valid i/o address, and most ARM platforms requireIO_SPACE_LIMITbe set to0xfffffffffor 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.hif PCI is enabled, but PCMCIA is not. sa11xx already hasIO_SPACE_LIMITset to0xffffffff, so it doesn't need anio.h.
PATCH v2 1/1 ARM: fix __io macro for PCMCIA
In reply to Rob HerringQuoted 12 lines · Rob Herring
From: Rob Herring <[email protected]>
With commit c334bc1 (ARM: make
mach/io.hinclude optional), PCMCIA was broken. PCMCIA depends on__io()returning a valid i/o address, and most ARM platforms requireIO_SPACE_LIMITbe set to0xfffffffffor 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.hif PCI is enabled, but PCMCIA is not. sa11xx already hasIO_SPACE_LIMITset to0xffffffff, so it doesn't need anio.h.
Quoted 8 lines
Signed-off-by Rob Herring <[email protected]>Cc Joachim Eastwood <[email protected]>Cc Paul Parsons <[email protected]>Cc Russell King <[email protected]>Cc Andrew Victor <[email protected]>Cc Nicolas Ferre <[email protected]>Cc Jean-Christophe Plagniol-Villard <[email protected]>Cc Tony Lindgren <[email protected]>
Works for me on AT91RM9200 using at91_cf and pata_pcmcia.
Quoted 5 lines
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Olof Johansson
AppliedPATCH v2 1/1 ARM: fix __io macro for PCMCIA
In reply to Rob HerringQuoted 12 lines · Rob Herring
From: Rob Herring <[email protected]>
With commit c334bc1 (ARM: make
mach/io.hinclude optional), PCMCIA was broken. PCMCIA depends on__io()returning a valid i/o address, and most ARM platforms requireIO_SPACE_LIMITbe set to0xfffffffffor 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.hif PCI is enabled, but PCMCIA is not. sa11xx already hasIO_SPACE_LIMITset to0xffffffff, so it doesn't need anio.h.
Quoted 8 lines
Signed-off-by Rob Herring <[email protected]>Cc Joachim Eastwood <[email protected]>Cc Paul Parsons <[email protected]>Cc Russell King <[email protected]>Cc Andrew Victor <[email protected]>Cc Nicolas Ferre <[email protected]>Cc Jean-Christophe Plagniol-Villard <[email protected]>Cc Tony Lindgren <[email protected]>
Thanks, applied to fixes.
-Olof