]> git.sur5r.net Git - u-boot/commitdiff
pciauto setup bridge
authorEd Swarthout <Ed.Swarthout@freescale.com>
Wed, 11 Jul 2007 19:52:08 +0000 (14:52 -0500)
committerWolfgang Denk <wd@denx.de>
Wed, 11 Jul 2007 21:43:30 +0000 (23:43 +0200)
The P2P bridge bus numbers programmed into the device are relative to
hose->first_busno.

Signed-off-by: Ed Swarthout <Ed.Swarthout@freescale.com>
drivers/pci_auto.c

index 9fa18e54276726524db1896108ca7bd766dc9673..f16f8d3c84a22c39be1b978f3524c5ac4aa80acb 100644 (file)
@@ -165,8 +165,10 @@ 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) {
@@ -219,7 +221,8 @@ 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 */