Commit 75f35209 authored by Ira Snyder's avatar Ira Snyder Committed by Kim Phillips
Browse files

83xx: PCI agent mode fixes for multi-board systems



When running a system with 2 or more MPC8349EMDS boards in PCI agent mode,
the boards will lock up the PCI bus by scanning against each other.

The boards lock against each other by trying to access the PCI bus before
clearing their configuration lock bit. Both boards end up in a loop,
sending and receiving "Target Not Ready" messages forever.

When running in PCI agent mode, the scanning now takes place after the
boards have cleared their configuration lock bit.

Also, add a missing declaration to the mpc83xx.h header file, fixing a
build warning.
Signed-off-by: default avatarIra W. Snyder <iws@ovro.caltech.edu>
Signed-off-by: default avatarKim Phillips <kim.phillips@freescale.com>
parent 455a4691
...@@ -118,10 +118,12 @@ static void pci_init_bus(int bus, struct pci_region *reg) ...@@ -118,10 +118,12 @@ static void pci_init_bus(int bus, struct pci_region *reg)
#ifdef CONFIG_PCI_SCAN_SHOW #ifdef CONFIG_PCI_SCAN_SHOW
printf("PCI: Bus Dev VenId DevId Class Int\n"); printf("PCI: Bus Dev VenId DevId Class Int\n");
#endif #endif
#ifndef CONFIG_PCISLAVE
/* /*
* Hose scan. * Hose scan.
*/ */
hose->last_busno = pci_hose_scan(hose); hose->last_busno = pci_hose_scan(hose);
#endif
} }
/* /*
...@@ -190,6 +192,9 @@ void mpc83xx_pcislave_unlock(int bus) ...@@ -190,6 +192,9 @@ void mpc83xx_pcislave_unlock(int bus)
pci_hose_read_config_word (hose, dev, PCI_FUNCTION_CONFIG, &reg16); pci_hose_read_config_word (hose, dev, PCI_FUNCTION_CONFIG, &reg16);
reg16 &= ~(PCI_FUNCTION_CFG_LOCK); reg16 &= ~(PCI_FUNCTION_CFG_LOCK);
pci_hose_write_config_word (hose, dev, PCI_FUNCTION_CONFIG, reg16); pci_hose_write_config_word (hose, dev, PCI_FUNCTION_CONFIG, reg16);
/* The configuration bit is now unlocked, so we can scan the bus */
hose->last_busno = pci_hose_scan(hose);
} }
#endif #endif
......
...@@ -1173,6 +1173,7 @@ ...@@ -1173,6 +1173,7 @@
#ifndef __ASSEMBLY__ #ifndef __ASSEMBLY__
struct pci_region; struct pci_region;
void mpc83xx_pci_init(int num_buses, struct pci_region **reg, int warmboot); void mpc83xx_pci_init(int num_buses, struct pci_region **reg, int warmboot);
void mpc83xx_pcislave_unlock(int bus);
#endif #endif
#endif /* __MPC83XX_H__ */ #endif /* __MPC83XX_H__ */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment