]> git.sur5r.net Git - u-boot/blobdiff - drivers/pci_auto.c
Add simple agent/end-point configuration in PCI AutoConfig for PCI_CLASS_PROCESSOR_PO...
[u-boot] / drivers / pci_auto.c
index 9fa18e54276726524db1896108ca7bd766dc9673..a3c609ba49ccd9f7abbc00522f4784dae85d95a9 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 */
@@ -328,6 +331,12 @@ int pciauto_config_device(struct pci_controller *hose, pci_dev_t dev)
        pci_hose_read_config_word(hose, dev, PCI_CLASS_DEVICE, &class);
 
        switch(class) {
+       case PCI_CLASS_PROCESSOR_POWERPC: /* an agent or end-point */
+               DEBUGF("PCI AutoConfig: Found PowerPC device\n");
+               pciauto_setup_device(hose, dev, 6, hose->pci_mem,
+                                    hose->pci_prefetch, hose->pci_io);
+               break;
+
        case PCI_CLASS_BRIDGE_PCI:
                hose->current_busno++;
                pciauto_setup_device(hose, dev, 2, hose->pci_mem, hose->pci_prefetch, hose->pci_io);