aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLennert Buytenhek <buytenh@wantstofly.org>2005-06-25 14:30:04 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2005-06-25 14:30:04 -0400
commit321ab6a5fab812658626aee6bce2617f8cfb3a55 (patch)
tree4e8d828a52bba4c3ab30413f51eedbb50c86b7c5
parent3cd9e19ebc91593c9f076410d6f979be188f01a0 (diff)
[PATCH] ARM: 2752/1: disable ixp2000 PCI I/O software workaround on chips that don't need it
Patch from Lennert Buytenhek The later ixp2000 models don't need the PCI I/O workaround that we currently perform. Add a config option to disable the workaround, and panic on boot if a kernel without the workaround is booted on a buggy chip. As only pre-production ixp2000s need the workaround, the default is for it not to be configured in. Signed-off-by: Lennert Buytenhek <buytenh@wantstofly.org> Signed-off-by: Deepak Saxena Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r--arch/arm/configs/enp2611_defconfig1
-rw-r--r--arch/arm/configs/ixdp2400_defconfig1
-rw-r--r--arch/arm/configs/ixdp2401_defconfig1
-rw-r--r--arch/arm/configs/ixdp2800_defconfig1
-rw-r--r--arch/arm/configs/ixdp2801_defconfig1
-rw-r--r--arch/arm/mach-ixp2000/Kconfig8
-rw-r--r--arch/arm/mach-ixp2000/pci.c13
-rw-r--r--include/asm-arm/arch-ixp2000/io.h20
-rw-r--r--include/asm-arm/arch-ixp2000/ixp2000-regs.h2
9 files changed, 41 insertions, 7 deletions
diff --git a/arch/arm/configs/enp2611_defconfig b/arch/arm/configs/enp2611_defconfig
index af2153424560..b8c51ee7f1bb 100644
--- a/arch/arm/configs/enp2611_defconfig
+++ b/arch/arm/configs/enp2611_defconfig
@@ -99,6 +99,7 @@ CONFIG_ARCH_ENP2611=y
99# CONFIG_ARCH_IXDP2800 is not set 99# CONFIG_ARCH_IXDP2800 is not set
100# CONFIG_ARCH_IXDP2401 is not set 100# CONFIG_ARCH_IXDP2401 is not set
101# CONFIG_ARCH_IXDP2801 is not set 101# CONFIG_ARCH_IXDP2801 is not set
102# CONFIG_IXP2000_SUPPORT_BROKEN_PCI_IO is not set
102 103
103# 104#
104# Processor Type 105# Processor Type
diff --git a/arch/arm/configs/ixdp2400_defconfig b/arch/arm/configs/ixdp2400_defconfig
index a7ee1a442f34..3cfbe2ec29ca 100644
--- a/arch/arm/configs/ixdp2400_defconfig
+++ b/arch/arm/configs/ixdp2400_defconfig
@@ -100,6 +100,7 @@ CONFIG_ARCH_IXDP2400=y
100CONFIG_ARCH_IXDP2X00=y 100CONFIG_ARCH_IXDP2X00=y
101# CONFIG_ARCH_IXDP2401 is not set 101# CONFIG_ARCH_IXDP2401 is not set
102# CONFIG_ARCH_IXDP2801 is not set 102# CONFIG_ARCH_IXDP2801 is not set
103# CONFIG_IXP2000_SUPPORT_BROKEN_PCI_IO is not set
103 104
104# 105#
105# Processor Type 106# Processor Type
diff --git a/arch/arm/configs/ixdp2401_defconfig b/arch/arm/configs/ixdp2401_defconfig
index 2da48fca5c1c..5c87e8e6969b 100644
--- a/arch/arm/configs/ixdp2401_defconfig
+++ b/arch/arm/configs/ixdp2401_defconfig
@@ -100,6 +100,7 @@ CONFIG_ARCH_SUPPORTS_BIG_ENDIAN=y
100CONFIG_ARCH_IXDP2401=y 100CONFIG_ARCH_IXDP2401=y
101# CONFIG_ARCH_IXDP2801 is not set 101# CONFIG_ARCH_IXDP2801 is not set
102CONFIG_ARCH_IXDP2X01=y 102CONFIG_ARCH_IXDP2X01=y
103# CONFIG_IXP2000_SUPPORT_BROKEN_PCI_IO is not set
103 104
104# 105#
105# Processor Type 106# Processor Type
diff --git a/arch/arm/configs/ixdp2800_defconfig b/arch/arm/configs/ixdp2800_defconfig
index 7ba867f751fd..3cb561a551cb 100644
--- a/arch/arm/configs/ixdp2800_defconfig
+++ b/arch/arm/configs/ixdp2800_defconfig
@@ -100,6 +100,7 @@ CONFIG_ARCH_IXDP2800=y
100CONFIG_ARCH_IXDP2X00=y 100CONFIG_ARCH_IXDP2X00=y
101# CONFIG_ARCH_IXDP2401 is not set 101# CONFIG_ARCH_IXDP2401 is not set
102# CONFIG_ARCH_IXDP2801 is not set 102# CONFIG_ARCH_IXDP2801 is not set
103# CONFIG_IXP2000_SUPPORT_BROKEN_PCI_IO is not set
103 104
104# 105#
105# Processor Type 106# Processor Type
diff --git a/arch/arm/configs/ixdp2801_defconfig b/arch/arm/configs/ixdp2801_defconfig
index c4df0ec34b08..b1e162f29cb9 100644
--- a/arch/arm/configs/ixdp2801_defconfig
+++ b/arch/arm/configs/ixdp2801_defconfig
@@ -100,6 +100,7 @@ CONFIG_ARCH_SUPPORTS_BIG_ENDIAN=y
100# CONFIG_ARCH_IXDP2401 is not set 100# CONFIG_ARCH_IXDP2401 is not set
101CONFIG_ARCH_IXDP2801=y 101CONFIG_ARCH_IXDP2801=y
102CONFIG_ARCH_IXDP2X01=y 102CONFIG_ARCH_IXDP2X01=y
103# CONFIG_IXP2000_SUPPORT_BROKEN_PCI_IO is not set
103 104
104# 105#
105# Processor Type 106# Processor Type
diff --git a/arch/arm/mach-ixp2000/Kconfig b/arch/arm/mach-ixp2000/Kconfig
index 9361e05f6fa3..ecb58d83478e 100644
--- a/arch/arm/mach-ixp2000/Kconfig
+++ b/arch/arm/mach-ixp2000/Kconfig
@@ -54,6 +54,14 @@ config ARCH_IXDP2X01
54 depends on ARCH_IXDP2401 || ARCH_IXDP2801 54 depends on ARCH_IXDP2401 || ARCH_IXDP2801
55 default y 55 default y
56 56
57config IXP2000_SUPPORT_BROKEN_PCI_IO
58 bool "Support broken PCI I/O on older IXP2000s"
59 default y
60 help
61 Say 'N' here if you only intend to run your kernel on an
62 IXP2000 B0 or later model and do not need the PCI I/O
63 byteswap workaround. Say 'Y' otherwise.
64
57endmenu 65endmenu
58 66
59endif 67endif
diff --git a/arch/arm/mach-ixp2000/pci.c b/arch/arm/mach-ixp2000/pci.c
index 5ff2f2718c58..0788fb2b5c10 100644
--- a/arch/arm/mach-ixp2000/pci.c
+++ b/arch/arm/mach-ixp2000/pci.c
@@ -198,6 +198,19 @@ clear_master_aborts(void)
198void __init 198void __init
199ixp2000_pci_preinit(void) 199ixp2000_pci_preinit(void)
200{ 200{
201#ifndef CONFIG_IXP2000_SUPPORT_BROKEN_PCI_IO
202 /*
203 * Configure the PCI unit to properly byteswap I/O transactions,
204 * and verify that it worked.
205 */
206 ixp2000_reg_write(IXP2000_PCI_CONTROL,
207 (*IXP2000_PCI_CONTROL | PCI_CONTROL_IEE));
208
209 if ((*IXP2000_PCI_CONTROL & PCI_CONTROL_IEE) == 0)
210 panic("IXP2000: PCI I/O is broken on this ixp model, and "
211 "the needed workaround has not been configured in");
212#endif
213
201 hook_fault_code(16+6, ixp2000_pci_abort_handler, SIGBUS, 214 hook_fault_code(16+6, ixp2000_pci_abort_handler, SIGBUS,
202 "PCI config cycle to non-existent device"); 215 "PCI config cycle to non-existent device");
203} 216}
diff --git a/include/asm-arm/arch-ixp2000/io.h b/include/asm-arm/arch-ixp2000/io.h
index 5e56b47446e0..3241cd6f0778 100644
--- a/include/asm-arm/arch-ixp2000/io.h
+++ b/include/asm-arm/arch-ixp2000/io.h
@@ -17,16 +17,21 @@
17 17
18#define IO_SPACE_LIMIT 0xffffffff 18#define IO_SPACE_LIMIT 0xffffffff
19#define __mem_pci(a) (a) 19#define __mem_pci(a) (a)
20#define ___io(p) ((void __iomem *)((p)+IXP2000_PCI_IO_VIRT_BASE))
21 20
22/* 21/*
23 * The IXP2400 before revision B0 asserts byte lanes for PCI I/O 22 * The A? revisions of the IXP2000s assert byte lanes for PCI I/O
24 * transactions the other way round (MEM transactions don't have this 23 * transactions the other way round (MEM transactions don't have this
25 * issue), so we need to override the standard functions. B0 and later 24 * issue), so if we want to support those models, we need to override
26 * have a bit that can be set to 1 to get the 'proper' behavior, but 25 * the standard I/O functions.
27 * since that isn't available on the A? revisions we just keep doing 26 *
28 * things manually. 27 * B0 and later have a bit that can be set to 1 to get the proper
28 * behavior for I/O transactions, which then allows us to use the
29 * standard I/O functions. This is what we do if the user does not
30 * explicitly ask for support for pre-B0.
29 */ 31 */
32#ifdef CONFIG_IXP2000_SUPPORT_BROKEN_PCI_IO
33#define ___io(p) ((void __iomem *)((p)+IXP2000_PCI_IO_VIRT_BASE))
34
30#define alignb(addr) (void __iomem *)((unsigned long)(addr) ^ 3) 35#define alignb(addr) (void __iomem *)((unsigned long)(addr) ^ 3)
31#define alignw(addr) (void __iomem *)((unsigned long)(addr) ^ 2) 36#define alignw(addr) (void __iomem *)((unsigned long)(addr) ^ 2)
32 37
@@ -119,6 +124,9 @@
119#define ioport_map(port, nr) ___io(port) 124#define ioport_map(port, nr) ___io(port)
120 125
121#define ioport_unmap(addr) 126#define ioport_unmap(addr)
127#else
128#define __io(p) ((void __iomem *)((p)+IXP2000_PCI_IO_VIRT_BASE))
129#endif
122 130
123 131
124#ifdef CONFIG_ARCH_IXDP2X01 132#ifdef CONFIG_ARCH_IXDP2X01
diff --git a/include/asm-arm/arch-ixp2000/ixp2000-regs.h b/include/asm-arm/arch-ixp2000/ixp2000-regs.h
index a1d9e181b10f..5eb47d4bfbf6 100644
--- a/include/asm-arm/arch-ixp2000/ixp2000-regs.h
+++ b/include/asm-arm/arch-ixp2000/ixp2000-regs.h
@@ -241,7 +241,7 @@
241#define PCI_CONTROL_BE_DEI (1 << 21) /* Big Endian Data Enable In */ 241#define PCI_CONTROL_BE_DEI (1 << 21) /* Big Endian Data Enable In */
242#define PCI_CONTROL_BE_BEO (1 << 20) /* Big Endian Byte Enable Out */ 242#define PCI_CONTROL_BE_BEO (1 << 20) /* Big Endian Byte Enable Out */
243#define PCI_CONTROL_BE_BEI (1 << 19) /* Big Endian Byte Enable In */ 243#define PCI_CONTROL_BE_BEI (1 << 19) /* Big Endian Byte Enable In */
244#define PCI_CONTROL_PNR (1 << 17) /* PCI Not Reset bit */ 244#define PCI_CONTROL_IEE (1 << 17) /* I/O cycle Endian swap Enable */
245 245
246#define IXP2000_PCI_RST_REL (1 << 2) 246#define IXP2000_PCI_RST_REL (1 << 2)
247#define CFG_RST_DIR (*IXP2000_PCI_CONTROL & IXP2000_PCICNTL_PCF) 247#define CFG_RST_DIR (*IXP2000_PCI_CONTROL & IXP2000_PCICNTL_PCF)