[U-Boot-Users] [PATCH] pciauto setup bridge

Ed Swarthout Ed.Swarthout at freescale.com
Wed Mar 7 08:33:28 CET 2007


The P2P bridge bus numbers programmed into the device are relative to
hose->first_busno.

Signed-off-by: Ed Swarthout <Ed.Swarthout at freescale.com>
---

This patch is associated with Kumar's commit dffb70f3 to pci_indirect.c

 drivers/pci_auto.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/pci_auto.c b/drivers/pci_auto.c
index 9691675..ba97e5c 100644
--- a/drivers/pci_auto.c
+++ b/drivers/pci_auto.c
@@ -160,8 +160,10 @@ static void pciauto_prescan_setup_bridge(struct pci_controller *hose,
 	pci_hose_read_config_dword(hose, dev, PCI_COMMAND, &cmdstat);
 
 	/* Configure bus number registers */
-	pci_hose_write_config_byte(hose, dev, PCI_PRIMARY_BUS, PCI_BUS(dev));
-	pci_hose_write_config_byte(hose, dev, PCI_SECONDARY_BUS, sub_bus);
+	pci_hose_write_config_byte(hose, dev, PCI_PRIMARY_BUS,
+				   PCI_BUS(dev) - hose->first_busno);
+	pci_hose_write_config_byte(hose, dev, PCI_SECONDARY_BUS,
+				   sub_bus - hose->first_busno);
 	pci_hose_write_config_byte(hose, dev, PCI_SUBORDINATE_BUS, 0xff);
 
 	if (pci_mem) {
@@ -214,7 +216,8 @@ static void pciauto_postscan_setup_bridge(struct pci_controller *hose,
 	struct pci_region *pci_io = hose->pci_io;
 
 	/* Configure bus number registers */
-	pci_hose_write_config_byte(hose, dev, PCI_SUBORDINATE_BUS, sub_bus);
+	pci_hose_write_config_byte(hose, dev, PCI_SUBORDINATE_BUS,
+				   sub_bus - hose->first_busno);
 
 	if (pci_mem) {
 		/* Round memory allocator to 1MB boundary */
-- 
1.5.0.2.279.g4808





More information about the U-Boot mailing list