From 532bda5d9cd2f94a9e374765c23858c7d8641f66 Mon Sep 17 00:00:00 2001 From: Lennert Buytenhek Date: Sat, 1 Apr 2006 18:33:35 +0100 Subject: [ARM] 3438/1: ixp23xx: add pci slave support Patch from Lennert Buytenhek On the Double Espresso board, the IXP2350s are PCI slave devices and we skip calling pci_common_init() as that enumerates the bus. But even though we are a PCI slave device, there is still some PCI-related setup that has to be done. Create ixp23xx_pci_common_init(), move the common initialisation bits there, and have this function called from both the PCI master and the PCI slave init path. Signed-off-by: Lennert Buytenhek Signed-off-by: Russell King --- arch/arm/mach-ixp23xx/espresso.c | 9 +++++++++ arch/arm/mach-ixp23xx/pci.c | 12 +++++++++++- include/asm-arm/arch-ixp23xx/platform.h | 1 + 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-ixp23xx/espresso.c b/arch/arm/mach-ixp23xx/espresso.c index 2327c979041622..bf688c1286301b 100644 --- a/arch/arm/mach-ixp23xx/espresso.c +++ b/arch/arm/mach-ixp23xx/espresso.c @@ -44,6 +44,15 @@ #include #include +static int __init espresso_pci_init(void) +{ + if (machine_is_espresso()) + ixp23xx_pci_slave_init(); + + return 0; +}; +subsys_initcall(espresso_pci_init); + static void __init espresso_init(void) { physmap_configure(0x90000000, 0x02000000, 2, NULL); diff --git a/arch/arm/mach-ixp23xx/pci.c b/arch/arm/mach-ixp23xx/pci.c index 5330ad78c1bb2d..ba6b4367a1d51b 100644 --- a/arch/arm/mach-ixp23xx/pci.c +++ b/arch/arm/mach-ixp23xx/pci.c @@ -201,7 +201,7 @@ int clear_master_aborts(void) return 0; } -void __init ixp23xx_pci_preinit(void) +static void __init ixp23xx_pci_common_init(void) { #ifdef __ARMEB__ *IXP23XX_PCI_CONTROL |= 0x20000; /* set I/O swapping */ @@ -220,6 +220,11 @@ void __init ixp23xx_pci_preinit(void) } else { *IXP23XX_PCI_CPP_ADDR_BITS |= (1 << 1); } +} + +void __init ixp23xx_pci_preinit(void) +{ + ixp23xx_pci_common_init(); hook_fault_code(16+6, ixp23xx_pci_abort_handler, SIGBUS, "PCI config cycle to non-existent device"); @@ -273,3 +278,8 @@ int ixp23xx_pci_setup(int nr, struct pci_sys_data *sys) return 1; } + +void ixp23xx_pci_slave_init(void) +{ + ixp23xx_pci_common_init(); +} diff --git a/include/asm-arm/arch-ixp23xx/platform.h b/include/asm-arm/arch-ixp23xx/platform.h index f85b4685a491e9..e4d99060a049d7 100644 --- a/include/asm-arm/arch-ixp23xx/platform.h +++ b/include/asm-arm/arch-ixp23xx/platform.h @@ -22,6 +22,7 @@ void ixp23xx_sys_init(void); int ixp23xx_pci_setup(int, struct pci_sys_data *); void ixp23xx_pci_preinit(void); struct pci_bus *ixp23xx_pci_scan_bus(int, struct pci_sys_data*); +void ixp23xx_pci_slave_init(void); extern struct sys_timer ixp23xx_timer; -- cgit 1.2.3-korg