Skip to content

Commit c334bc1

Browse files
author
Rob Herring
committed
ARM: make mach/io.h include optional
Add a kconfig option NEED_MACH_IO_H to conditionally include mach/io.h. Basing this on CONFIG_PCI and CONFIG_ISA doesn't quite work. Most ISA platforms don't need mach/io.h, but ebsa110 does. Most PCI platforms need mach/io.h for now, but ks8695 doesn't which means i/o accesses are broken. Signed-off-by: Rob Herring <[email protected]> Cc: Russell King <[email protected]> Acked-by: H Hartley Sweeten <[email protected]> Acked-by: Nicolas Pitre <[email protected]>
1 parent 41e32c9 commit c334bc1

File tree

2 files changed

+28
-0
lines changed

2 files changed

+28
-0
lines changed

arch/arm/Kconfig

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,13 @@ config ARM_PATCH_PHYS_VIRT
217217
this feature (eg, building a kernel for a single machine) and
218218
you need to shrink the kernel to the minimal size.
219219

220+
config NEED_MACH_IO_H
221+
bool
222+
help
223+
Select this when mach/io.h is required to provide special
224+
definitions for this platform. The need for mach/io.h should
225+
be avoided when possible.
226+
220227
config NEED_MACH_MEMORY_H
221228
bool
222229
help
@@ -268,6 +275,7 @@ config ARCH_INTEGRATOR
268275
select GENERIC_CLOCKEVENTS
269276
select PLAT_VERSATILE
270277
select PLAT_VERSATILE_FPGA_IRQ
278+
select NEED_MACH_IO_H
271279
select NEED_MACH_MEMORY_H
272280
help
273281
Support for ARM's Integrator platform.
@@ -403,6 +411,7 @@ config ARCH_EBSA110
403411
select ISA
404412
select NO_IOPORT
405413
select ARCH_USES_GETTIMEOFFSET
414+
select NEED_MACH_IO_H
406415
select NEED_MACH_MEMORY_H
407416
help
408417
This is an evaluation board for the StrongARM processor available
@@ -429,6 +438,7 @@ config ARCH_FOOTBRIDGE
429438
select FOOTBRIDGE
430439
select GENERIC_CLOCKEVENTS
431440
select HAVE_IDE
441+
select NEED_MACH_IO_H
432442
select NEED_MACH_MEMORY_H
433443
help
434444
Support for systems based on the DC21285 companion chip
@@ -481,6 +491,7 @@ config ARCH_IOP13XX
481491
select PCI
482492
select ARCH_SUPPORTS_MSI
483493
select VMSPLIT_1G
494+
select NEED_MACH_IO_H
484495
select NEED_MACH_MEMORY_H
485496
select NEED_RET_TO_USER
486497
help
@@ -490,6 +501,7 @@ config ARCH_IOP32X
490501
bool "IOP32x-based"
491502
depends on MMU
492503
select CPU_XSCALE
504+
select NEED_MACH_IO_H
493505
select NEED_RET_TO_USER
494506
select PLAT_IOP
495507
select PCI
@@ -502,6 +514,7 @@ config ARCH_IOP33X
502514
bool "IOP33x-based"
503515
depends on MMU
504516
select CPU_XSCALE
517+
select NEED_MACH_IO_H
505518
select NEED_RET_TO_USER
506519
select PLAT_IOP
507520
select PCI
@@ -515,6 +528,7 @@ config ARCH_IXP23XX
515528
select CPU_XSC3
516529
select PCI
517530
select ARCH_USES_GETTIMEOFFSET
531+
select NEED_MACH_IO_H
518532
select NEED_MACH_MEMORY_H
519533
help
520534
Support for Intel's IXP23xx (XScale) family of processors.
@@ -525,6 +539,7 @@ config ARCH_IXP2000
525539
select CPU_XSCALE
526540
select PCI
527541
select ARCH_USES_GETTIMEOFFSET
542+
select NEED_MACH_IO_H
528543
select NEED_MACH_MEMORY_H
529544
help
530545
Support for Intel's IXP2400/2800 (XScale) family of processors.
@@ -538,6 +553,7 @@ config ARCH_IXP4XX
538553
select GENERIC_CLOCKEVENTS
539554
select HAVE_SCHED_CLOCK
540555
select MIGHT_HAVE_PCI
556+
select NEED_MACH_IO_H
541557
select DMABOUNCE if PCI
542558
help
543559
Support for Intel's IXP4XX (XScale) family of processors.
@@ -548,6 +564,7 @@ config ARCH_DOVE
548564
select PCI
549565
select ARCH_REQUIRE_GPIOLIB
550566
select GENERIC_CLOCKEVENTS
567+
select NEED_MACH_IO_H
551568
select PLAT_ORION
552569
help
553570
Support for the Marvell Dove SoC 88AP510
@@ -558,6 +575,7 @@ config ARCH_KIRKWOOD
558575
select PCI
559576
select ARCH_REQUIRE_GPIOLIB
560577
select GENERIC_CLOCKEVENTS
578+
select NEED_MACH_IO_H
561579
select PLAT_ORION
562580
help
563581
Support for the following Marvell Kirkwood series SoCs:
@@ -582,6 +600,7 @@ config ARCH_MV78XX0
582600
select PCI
583601
select ARCH_REQUIRE_GPIOLIB
584602
select GENERIC_CLOCKEVENTS
603+
select NEED_MACH_IO_H
585604
select PLAT_ORION
586605
help
587606
Support for the following Marvell MV78xx0 series SoCs:
@@ -651,6 +670,7 @@ config ARCH_TEGRA
651670
select HAVE_SCHED_CLOCK
652671
select HAVE_SMP
653672
select MIGHT_HAVE_CACHE_L2X0
673+
select NEED_MACH_IO_H if PCI
654674
select ARCH_HAS_CPUFREQ
655675
help
656676
This enables support for NVIDIA Tegra based systems (Tegra APX,
@@ -745,6 +765,7 @@ config ARCH_RPC
745765
select ARCH_SPARSEMEM_ENABLE
746766
select ARCH_USES_GETTIMEOFFSET
747767
select HAVE_IDE
768+
select NEED_MACH_IO_H
748769
select NEED_MACH_MEMORY_H
749770
help
750771
On the Acorn Risc-PC, Linux can support the internal IDE disk and
@@ -777,6 +798,7 @@ config ARCH_S3C2410
777798
select CLKDEV_LOOKUP
778799
select ARCH_USES_GETTIMEOFFSET
779800
select HAVE_S3C2410_I2C if I2C
801+
select NEED_MACH_IO_H
780802
help
781803
Samsung S3C2410X CPU based systems, such as the Simtec Electronics
782804
BAST (<http://www.simtec.co.uk/products/EB110ITX/>), the IPAQ 1940 or
@@ -883,6 +905,7 @@ config ARCH_SHARK
883905
select PCI
884906
select ARCH_USES_GETTIMEOFFSET
885907
select NEED_MACH_MEMORY_H
908+
select NEED_MACH_IO_H
886909
help
887910
Support for the StrongARM based Digital DNARD machine, also known
888911
as "Shark" (<http://www.shark-linux.de/shark.html>).

arch/arm/include/asm/io.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,12 @@ static inline void __iomem *__typesafe_io(unsigned long addr)
114114
/*
115115
* Now, pick up the machine-defined IO definitions
116116
*/
117+
#ifdef CONFIG_NEED_MACH_IO_H
117118
#include <mach/io.h>
119+
#else
120+
#define __io(a) ({ (void)(a); __typesafe_io(0); })
121+
#define __mem_pci(a) (a)
122+
#endif
118123

119124
/*
120125
* This is the limit of PC card/PCI/ISA IO space, which is by default

0 commit comments

Comments
 (0)