pci_bridge: make pci bridge aware of pci multi function bit.
make pci bridge aware of pci multi function property and let pci generic code to set the bit. Cc: Blue Swirl <blauwirbel@gmail.com> Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
This commit is contained in:
		
							parent
							
								
									fecb93c45c
								
							
						
					
					
						commit
						7c7b829e46
					
				@ -350,13 +350,13 @@ PCIBus *pci_apb_init(target_phys_addr_t special_base,
 | 
				
			|||||||
    pci_create_simple(d->bus, 0, "pbm");
 | 
					    pci_create_simple(d->bus, 0, "pbm");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /* APB secondary busses */
 | 
					    /* APB secondary busses */
 | 
				
			||||||
    *bus2 = pci_bridge_init(d->bus, PCI_DEVFN(1, 0),
 | 
					    *bus2 = pci_bridge_init(d->bus, PCI_DEVFN(1, 0), true,
 | 
				
			||||||
                            PCI_VENDOR_ID_SUN, PCI_DEVICE_ID_SUN_SIMBA,
 | 
					                            PCI_VENDOR_ID_SUN, PCI_DEVICE_ID_SUN_SIMBA,
 | 
				
			||||||
                            pci_apb_map_irq,
 | 
					                            pci_apb_map_irq,
 | 
				
			||||||
                            "Advanced PCI Bus secondary bridge 1");
 | 
					                            "Advanced PCI Bus secondary bridge 1");
 | 
				
			||||||
    apb_pci_bridge_init(*bus2);
 | 
					    apb_pci_bridge_init(*bus2);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    *bus3 = pci_bridge_init(d->bus, PCI_DEVFN(1, 1),
 | 
					    *bus3 = pci_bridge_init(d->bus, PCI_DEVFN(1, 1), true,
 | 
				
			||||||
                            PCI_VENDOR_ID_SUN, PCI_DEVICE_ID_SUN_SIMBA,
 | 
					                            PCI_VENDOR_ID_SUN, PCI_DEVICE_ID_SUN_SIMBA,
 | 
				
			||||||
                            pci_apb_map_irq,
 | 
					                            pci_apb_map_irq,
 | 
				
			||||||
                            "Advanced PCI Bus secondary bridge 2");
 | 
					                            "Advanced PCI Bus secondary bridge 2");
 | 
				
			||||||
 | 
				
			|||||||
@ -55,7 +55,7 @@ PCIBus *pci_dec_21154_init(PCIBus *parent_bus, int devfn)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    dev = qdev_create(NULL, "dec-21154");
 | 
					    dev = qdev_create(NULL, "dec-21154");
 | 
				
			||||||
    qdev_init_nofail(dev);
 | 
					    qdev_init_nofail(dev);
 | 
				
			||||||
    ret = pci_bridge_init(parent_bus, devfn,
 | 
					    ret = pci_bridge_init(parent_bus, devfn, false,
 | 
				
			||||||
                          PCI_VENDOR_ID_DEC, PCI_DEVICE_ID_DEC_21154,
 | 
					                          PCI_VENDOR_ID_DEC, PCI_DEVICE_ID_DEC_21154,
 | 
				
			||||||
                          dec_map_irq, "DEC 21154 PCI-PCI bridge");
 | 
					                          dec_map_irq, "DEC 21154 PCI-PCI bridge");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										5
									
								
								hw/pci.c
									
									
									
									
									
								
							
							
						
						
									
										5
									
								
								hw/pci.c
									
									
									
									
									
								
							@ -1580,13 +1580,14 @@ static int pci_bridge_exitfn(PCIDevice *pci_dev)
 | 
				
			|||||||
    return 0;
 | 
					    return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
PCIBus *pci_bridge_init(PCIBus *bus, int devfn, uint16_t vid, uint16_t did,
 | 
					PCIBus *pci_bridge_init(PCIBus *bus, int devfn, bool multifunction,
 | 
				
			||||||
 | 
					                        uint16_t vid, uint16_t did,
 | 
				
			||||||
                        pci_map_irq_fn map_irq, const char *name)
 | 
					                        pci_map_irq_fn map_irq, const char *name)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    PCIDevice *dev;
 | 
					    PCIDevice *dev;
 | 
				
			||||||
    PCIBridge *s;
 | 
					    PCIBridge *s;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    dev = pci_create(bus, devfn, "pci-bridge");
 | 
					    dev = pci_create_multifunction(bus, devfn, multifunction, "pci-bridge");
 | 
				
			||||||
    qdev_prop_set_uint32(&dev->qdev, "vendorid", vid);
 | 
					    qdev_prop_set_uint32(&dev->qdev, "vendorid", vid);
 | 
				
			||||||
    qdev_prop_set_uint32(&dev->qdev, "deviceid", did);
 | 
					    qdev_prop_set_uint32(&dev->qdev, "deviceid", did);
 | 
				
			||||||
    qdev_init_nofail(&dev->qdev);
 | 
					    qdev_init_nofail(&dev->qdev);
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										3
									
								
								hw/pci.h
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								hw/pci.h
									
									
									
									
									
								
							@ -233,7 +233,8 @@ int pci_read_devaddr(Monitor *mon, const char *addr, int *domp, int *busp,
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
void do_pci_info_print(Monitor *mon, const QObject *data);
 | 
					void do_pci_info_print(Monitor *mon, const QObject *data);
 | 
				
			||||||
void do_pci_info(Monitor *mon, QObject **ret_data);
 | 
					void do_pci_info(Monitor *mon, QObject **ret_data);
 | 
				
			||||||
PCIBus *pci_bridge_init(PCIBus *bus, int devfn, uint16_t vid, uint16_t did,
 | 
					PCIBus *pci_bridge_init(PCIBus *bus, int devfn, bool multifunction,
 | 
				
			||||||
 | 
					                        uint16_t vid, uint16_t did,
 | 
				
			||||||
                        pci_map_irq_fn map_irq, const char *name);
 | 
					                        pci_map_irq_fn map_irq, const char *name);
 | 
				
			||||||
PCIDevice *pci_bridge_get_device(PCIBus *bus);
 | 
					PCIDevice *pci_bridge_get_device(PCIBus *bus);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user