Skip to content
Snippets Groups Projects
pci-uclass.c 24.3 KiB
Newer Older
  • Learn to ignore specific revisions
  • 			break;
    		}
    	}
    
    	return (*iop != NULL) + (*memp != NULL) + (*prefp != NULL);
    }
    
    
    UCLASS_DRIVER(pci) = {
    	.id		= UCLASS_PCI,
    	.name		= "pci",
    
    	.flags		= DM_UC_FLAG_SEQ_ALIAS,
    
    	.post_bind	= pci_uclass_post_bind,
    	.pre_probe	= pci_uclass_pre_probe,
    	.post_probe	= pci_uclass_post_probe,
    	.child_post_bind = pci_uclass_child_post_bind,
    	.per_device_auto_alloc_size = sizeof(struct pci_controller),
    	.per_child_platdata_auto_alloc_size =
    			sizeof(struct pci_child_platdata),
    };
    
    static const struct dm_pci_ops pci_bridge_ops = {
    	.read_config	= pci_bridge_read_config,
    	.write_config	= pci_bridge_write_config,
    };
    
    static const struct udevice_id pci_bridge_ids[] = {
    	{ .compatible = "pci-bridge" },
    	{ }
    };
    
    U_BOOT_DRIVER(pci_bridge_drv) = {
    	.name		= "pci_bridge_drv",
    	.id		= UCLASS_PCI,
    	.of_match	= pci_bridge_ids,
    	.ops		= &pci_bridge_ops,
    };
    
    UCLASS_DRIVER(pci_generic) = {
    	.id		= UCLASS_PCI_GENERIC,
    	.name		= "pci_generic",
    };
    
    static const struct udevice_id pci_generic_ids[] = {
    	{ .compatible = "pci-generic" },
    	{ }
    };
    
    U_BOOT_DRIVER(pci_generic_drv) = {
    	.name		= "pci_generic_drv",
    	.id		= UCLASS_PCI_GENERIC,
    	.of_match	= pci_generic_ids,
    };