Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 3199
b: refs/heads/master
c: 321ab6a
h: refs/heads/master
i:
  3197: 9af6976
  3195: 35235b2
  3191: 9268d20
  3183: 75a82d1
  3167: 8075c60
  3135: 92b0b65
  3071: 13184a5
v: v3
  • Loading branch information
Lennert Buytenhek authored and Russell King committed Jun 25, 2005
1 parent a7997c2 commit 243006f
Show file tree
Hide file tree
Showing 10 changed files with 42 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3cd9e19ebc91593c9f076410d6f979be188f01a0
refs/heads/master: 321ab6a5fab812658626aee6bce2617f8cfb3a55
1 change: 1 addition & 0 deletions trunk/arch/arm/configs/enp2611_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ CONFIG_ARCH_ENP2611=y
# CONFIG_ARCH_IXDP2800 is not set
# CONFIG_ARCH_IXDP2401 is not set
# CONFIG_ARCH_IXDP2801 is not set
# CONFIG_IXP2000_SUPPORT_BROKEN_PCI_IO is not set

#
# Processor Type
Expand Down
1 change: 1 addition & 0 deletions trunk/arch/arm/configs/ixdp2400_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ CONFIG_ARCH_IXDP2400=y
CONFIG_ARCH_IXDP2X00=y
# CONFIG_ARCH_IXDP2401 is not set
# CONFIG_ARCH_IXDP2801 is not set
# CONFIG_IXP2000_SUPPORT_BROKEN_PCI_IO is not set

#
# Processor Type
Expand Down
1 change: 1 addition & 0 deletions trunk/arch/arm/configs/ixdp2401_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ CONFIG_ARCH_SUPPORTS_BIG_ENDIAN=y
CONFIG_ARCH_IXDP2401=y
# CONFIG_ARCH_IXDP2801 is not set
CONFIG_ARCH_IXDP2X01=y
# CONFIG_IXP2000_SUPPORT_BROKEN_PCI_IO is not set

#
# Processor Type
Expand Down
1 change: 1 addition & 0 deletions trunk/arch/arm/configs/ixdp2800_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ CONFIG_ARCH_IXDP2800=y
CONFIG_ARCH_IXDP2X00=y
# CONFIG_ARCH_IXDP2401 is not set
# CONFIG_ARCH_IXDP2801 is not set
# CONFIG_IXP2000_SUPPORT_BROKEN_PCI_IO is not set

#
# Processor Type
Expand Down
1 change: 1 addition & 0 deletions trunk/arch/arm/configs/ixdp2801_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ CONFIG_ARCH_SUPPORTS_BIG_ENDIAN=y
# CONFIG_ARCH_IXDP2401 is not set
CONFIG_ARCH_IXDP2801=y
CONFIG_ARCH_IXDP2X01=y
# CONFIG_IXP2000_SUPPORT_BROKEN_PCI_IO is not set

#
# Processor Type
Expand Down
8 changes: 8 additions & 0 deletions trunk/arch/arm/mach-ixp2000/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,14 @@ config ARCH_IXDP2X01
depends on ARCH_IXDP2401 || ARCH_IXDP2801
default y

config IXP2000_SUPPORT_BROKEN_PCI_IO
bool "Support broken PCI I/O on older IXP2000s"
default y
help
Say 'N' here if you only intend to run your kernel on an
IXP2000 B0 or later model and do not need the PCI I/O
byteswap workaround. Say 'Y' otherwise.

endmenu

endif
13 changes: 13 additions & 0 deletions trunk/arch/arm/mach-ixp2000/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,19 @@ clear_master_aborts(void)
void __init
ixp2000_pci_preinit(void)
{
#ifndef CONFIG_IXP2000_SUPPORT_BROKEN_PCI_IO
/*
* Configure the PCI unit to properly byteswap I/O transactions,
* and verify that it worked.
*/
ixp2000_reg_write(IXP2000_PCI_CONTROL,
(*IXP2000_PCI_CONTROL | PCI_CONTROL_IEE));

if ((*IXP2000_PCI_CONTROL & PCI_CONTROL_IEE) == 0)
panic("IXP2000: PCI I/O is broken on this ixp model, and "
"the needed workaround has not been configured in");
#endif

hook_fault_code(16+6, ixp2000_pci_abort_handler, SIGBUS,
"PCI config cycle to non-existent device");
}
Expand Down
20 changes: 14 additions & 6 deletions trunk/include/asm-arm/arch-ixp2000/io.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,21 @@

#define IO_SPACE_LIMIT 0xffffffff
#define __mem_pci(a) (a)
#define ___io(p) ((void __iomem *)((p)+IXP2000_PCI_IO_VIRT_BASE))

/*
* The IXP2400 before revision B0 asserts byte lanes for PCI I/O
* The A? revisions of the IXP2000s assert byte lanes for PCI I/O
* transactions the other way round (MEM transactions don't have this
* issue), so we need to override the standard functions. B0 and later
* have a bit that can be set to 1 to get the 'proper' behavior, but
* since that isn't available on the A? revisions we just keep doing
* things manually.
* issue), so if we want to support those models, we need to override
* the standard I/O functions.
*
* B0 and later have a bit that can be set to 1 to get the proper
* behavior for I/O transactions, which then allows us to use the
* standard I/O functions. This is what we do if the user does not
* explicitly ask for support for pre-B0.
*/
#ifdef CONFIG_IXP2000_SUPPORT_BROKEN_PCI_IO
#define ___io(p) ((void __iomem *)((p)+IXP2000_PCI_IO_VIRT_BASE))

#define alignb(addr) (void __iomem *)((unsigned long)(addr) ^ 3)
#define alignw(addr) (void __iomem *)((unsigned long)(addr) ^ 2)

Expand Down Expand Up @@ -119,6 +124,9 @@
#define ioport_map(port, nr) ___io(port)

#define ioport_unmap(addr)
#else
#define __io(p) ((void __iomem *)((p)+IXP2000_PCI_IO_VIRT_BASE))
#endif


#ifdef CONFIG_ARCH_IXDP2X01
Expand Down
2 changes: 1 addition & 1 deletion trunk/include/asm-arm/arch-ixp2000/ixp2000-regs.h
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@
#define PCI_CONTROL_BE_DEI (1 << 21) /* Big Endian Data Enable In */
#define PCI_CONTROL_BE_BEO (1 << 20) /* Big Endian Byte Enable Out */
#define PCI_CONTROL_BE_BEI (1 << 19) /* Big Endian Byte Enable In */
#define PCI_CONTROL_PNR (1 << 17) /* PCI Not Reset bit */
#define PCI_CONTROL_IEE (1 << 17) /* I/O cycle Endian swap Enable */

#define IXP2000_PCI_RST_REL (1 << 2)
#define CFG_RST_DIR (*IXP2000_PCI_CONTROL & IXP2000_PCICNTL_PCF)
Expand Down

0 comments on commit 243006f

Please sign in to comment.