Thread (52 messages) 52 messages, 9 authors, 2007-06-04

RE: [PATCH 3/5] Float the pci bus number on MPC8641HPCN board.

flat view

From: Zhang Wei-r63237 <hidden>
Date: 2007-05-23 03:35:58

Hi, Wade,

That's a good question.

The ppc_md.exclude_device() function will be called before PCI config
access in indirect_read/write_config() of the file
arch/powerpc/sysdev/indirect_pci.c. If the hose->bus_offset value is 0,
the primary bus number register of the host must be hose->first_busno.
Otherwise, if the host primary bus number register is 0, the
hose->bus_offset must be the same value of hose->first_buseno.

When the pci scan bus, the bridge will be scaned twice. When the second
scan is finished, the host primary bus number register will be write to
hose->first_busno. The PCI bus(not the first PCI host) access will be
wrong in the later access. I'll check it and correct the
hose->bus_offset value in these codes.

Thanks!
Wei
-----Original Message-----
From: Wade Farnsworth [mailto:<redacted>]=20
Subject: Re: [PATCH 3/5] Float the pci bus number on=20
MPC8641HPCN board.
=20
On Tue, 2007-05-22 at 11:38 +0800, Zhang Wei wrote:
quoted
 int mpc86xx_exclude_device(u_char bus, u_char devfn)
 {
+	struct pci_controller *hose;
+
+	hose =3D 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) =3D=3D 0xffffffff))
+		hose->bus_offset =3D hose->bus_offset ? 0 :=20
hose->first_busno;
quoted
+
 	return PCIBIOS_SUCCESSFUL;
 }
=20
What is the purpose of this code and why put it in
mpc86xx_exclude_device?
=20
--Wade
=20
=20
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help