Skip to contentSkip to conversation

Float the PCi bus number assignments on MPC8641HPCN board.

PATCH Superseded Jon Loeliger 1 participant 1 message Jun 1, 2007 PowerPC

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 4/8 Float the PCi bus number assignments on MPC8641HPCN board.

From: Zhang Wei <[email protected]>

Admittedly this is a non-ideal solution, but fixing it properly might require systemic PCI bus renumbering changes that we are not prepared to do yet.

---

 arch/powerpc/platforms/86xx/mpc86xx_hpcn.c |    1 +
 arch/powerpc/platforms/86xx/pci.c          |   12 ++++++++++++
 2 files changed, 13 insertions(+), 0 deletions(-)
arch/powerpc/platforms/86xx/mpc86xx_hpcn.c +1 -0
index 1051702..9259788 100644
@@ -363,6 +363,7 @@ mpc86xx_hpcn_setup_arch(void)
 	}
 
 #ifdef CONFIG_PCI
+	pci_assign_all_buses = 1;
 	for (np = NULL; (np = of_find_node_by_type(np, "pci")) != NULL;)
 		add_bridge(np);
 
arch/powerpc/platforms/86xx/pci.c +12 -0
index 07ff52c..c80d8f1 100644
@@ -136,6 +136,18 @@ mpc86xx_setup_pcie(struct pci_controller *hose, u32 pcie_offset, u32 pcie_size)
 
 int mpc86xx_exclude_device(u_char bus, u_char devfn)
 {
+	struct pci_controller *hose;
+
+	hose = pci_bus_to_hose(bus);
+	if (unlikely(!hose))
+		return PCIBIOS_DEVICE_NOT_FOUND;
+
+	/* Correcting the hose->bus_offset value. */
+	out_be32(hose->cfg_addr, 0x80000000 | ((hose->first_busno
+					- hose->bus_offset) << 16));
+	if (unlikely(in_le32(hose->cfg_data) == 0xffffffff))
+		hose->bus_offset = hose->bus_offset ? 0 : hose->first_busno;
+
 	return PCIBIOS_SUCCESSFUL;
 }
 
Signature · 1 line
1.5.0.3