Lines Matching refs:dev
208 struct pci_dev *dev) in pci_parse_of_addrs() argument
218 pci_info(dev, " parse addresses (%d bytes) @ %p\n", in pci_parse_of_addrs()
231 pci_info(dev, " start: %llx, end: %llx, i: %x\n", in pci_parse_of_addrs()
235 res = &dev->resource[(i - PCI_BASE_ADDRESS_0) >> 2]; in pci_parse_of_addrs()
236 } else if (i == dev->rom_base_reg) { in pci_parse_of_addrs()
237 res = &dev->resource[PCI_ROM_RESOURCE]; in pci_parse_of_addrs()
240 pci_err(dev, "bad cfg reg num 0x%x\n", i); in pci_parse_of_addrs()
246 res->name = pci_name(dev); in pci_parse_of_addrs()
248 pci_info(dev, "reg 0x%x: %pR\n", i, res); in pci_parse_of_addrs()
270 struct pci_dev *dev; in of_create_pci_dev() local
273 dev = pci_alloc_dev(bus); in of_create_pci_dev()
274 if (!dev) in of_create_pci_dev()
278 sd = &dev->dev.archdata; in of_create_pci_dev()
281 sd = &op->dev.archdata; in of_create_pci_dev()
293 dev->sysdata = node; in of_create_pci_dev()
294 dev->dev.parent = bus->bridge; in of_create_pci_dev()
295 dev->dev.bus = &pci_bus_type; in of_create_pci_dev()
296 dev->dev.of_node = of_node_get(node); in of_create_pci_dev()
297 dev->devfn = devfn; in of_create_pci_dev()
298 dev->multifunction = 0; /* maybe a lie? */ in of_create_pci_dev()
299 set_pcie_port_type(dev); in of_create_pci_dev()
301 pci_dev_assign_slot(dev); in of_create_pci_dev()
302 dev->vendor = of_getintprop_default(node, "vendor-id", 0xffff); in of_create_pci_dev()
303 dev->device = of_getintprop_default(node, "device-id", 0xffff); in of_create_pci_dev()
304 dev->subsystem_vendor = in of_create_pci_dev()
306 dev->subsystem_device = in of_create_pci_dev()
309 dev->cfg_size = pci_cfg_space_size(dev); in of_create_pci_dev()
317 pci_read_config_dword(dev, PCI_CLASS_REVISION, &class); in of_create_pci_dev()
318 dev->class = class >> 8; in of_create_pci_dev()
319 dev->revision = class & 0xff; in of_create_pci_dev()
321 dev_set_name(&dev->dev, "%04x:%02x:%02x.%d", pci_domain_nr(bus), in of_create_pci_dev()
322 dev->bus->number, PCI_SLOT(devfn), PCI_FUNC(devfn)); in of_create_pci_dev()
328 if ((dev->class >> 8) == PCI_CLASS_STORAGE_IDE) in of_create_pci_dev()
329 pci_set_master(dev); in of_create_pci_dev()
331 dev->current_state = PCI_UNKNOWN; /* unknown power state */ in of_create_pci_dev()
332 dev->error_state = pci_channel_io_normal; in of_create_pci_dev()
333 dev->dma_mask = 0xffffffff; in of_create_pci_dev()
337 dev->hdr_type = PCI_HEADER_TYPE_BRIDGE; in of_create_pci_dev()
338 dev->rom_base_reg = PCI_ROM_ADDRESS1; in of_create_pci_dev()
340 dev->hdr_type = PCI_HEADER_TYPE_CARDBUS; in of_create_pci_dev()
342 dev->hdr_type = PCI_HEADER_TYPE_NORMAL; in of_create_pci_dev()
343 dev->rom_base_reg = PCI_ROM_ADDRESS; in of_create_pci_dev()
345 dev->irq = sd->op->archdata.irqs[0]; in of_create_pci_dev()
346 if (dev->irq == 0xffffffff) in of_create_pci_dev()
347 dev->irq = PCI_IRQ_NONE; in of_create_pci_dev()
350 pci_info(dev, "[%04x:%04x] type %02x class %#08x\n", in of_create_pci_dev()
351 dev->vendor, dev->device, dev->hdr_type, dev->class); in of_create_pci_dev()
353 pci_parse_of_addrs(sd->op, node, dev); in of_create_pci_dev()
356 pci_info(dev, " adding to system ...\n"); in of_create_pci_dev()
358 pci_device_add(dev, bus); in of_create_pci_dev()
360 return dev; in of_create_pci_dev()
385 static void apb_fake_ranges(struct pci_dev *dev, in apb_fake_ranges() argument
394 pci_read_config_byte(dev, APB_IO_ADDRESS_MAP, &map); in apb_fake_ranges()
400 pcibios_bus_to_resource(dev->bus, res, ®ion); in apb_fake_ranges()
402 pci_read_config_byte(dev, APB_MEM_ADDRESS_MAP, &map); in apb_fake_ranges()
408 pcibios_bus_to_resource(dev->bus, res, ®ion); in apb_fake_ranges()
419 struct pci_dev *dev) in of_scan_pci_bridge() argument
430 pci_info(dev, "of_scan_pci_bridge(%pOF)\n", node); in of_scan_pci_bridge()
435 pci_info(dev, "Can't get bus-range for PCI-PCI bridge %pOF\n", in of_scan_pci_bridge()
441 pci_info(dev, " Bridge bus range [%u --> %u]\n", in of_scan_pci_bridge()
452 bus = pci_add_new_bus(dev->bus, dev, busrange[0]); in of_scan_pci_bridge()
454 pci_err(dev, "Failed to create pci bus for %pOF\n", in of_scan_pci_bridge()
459 bus->primary = dev->bus->number; in of_scan_pci_bridge()
464 pci_info(dev, " Bridge ranges[%p] simba[%d]\n", in of_scan_pci_bridge()
469 res = &dev->resource[PCI_BRIDGE_RESOURCES]; in of_scan_pci_bridge()
476 apb_fake_ranges(dev, bus, pbm); in of_scan_pci_bridge()
487 pci_info(dev, " RAW Range[%08x:%08x:%08x:%08x:%08x:%08x:" in of_scan_pci_bridge()
510 pci_err(dev, "ignoring extra I/O range" in of_scan_pci_bridge()
516 pci_err(dev, "too many memory ranges" in of_scan_pci_bridge()
529 pci_info(dev, " Using flags[%08x] start[%016llx] size[%016llx]\n", in of_scan_pci_bridge()
532 pcibios_bus_to_resource(dev->bus, res, ®ion); in of_scan_pci_bridge()
538 pci_info(dev, " bus name: %s\n", bus->name); in of_scan_pci_bridge()
550 struct pci_dev *dev; in pci_of_scan_bus() local
576 dev = of_create_pci_dev(pbm, child, bus, devfn); in pci_of_scan_bus()
577 if (!dev) in pci_of_scan_bus()
580 pci_info(dev, "dev header type: %x\n", dev->hdr_type); in pci_of_scan_bus()
582 if (pci_is_bridge(dev)) in pci_of_scan_bus()
583 of_scan_pci_bridge(pbm, child, dev); in pci_of_scan_bus()
588 show_pciobppath_attr(struct device * dev, struct device_attribute * attr, char * buf) in show_pciobppath_attr() argument
593 pdev = to_pci_dev(dev); in show_pciobppath_attr()
594 dp = pdev->dev.of_node; in show_pciobppath_attr()
603 struct pci_dev *dev; in pci_bus_register_of_sysfs() local
607 list_for_each_entry(dev, &bus->devices, bus_list) { in pci_bus_register_of_sysfs()
615 err = sysfs_create_file(&dev->dev.kobj, &dev_attr_obppath.attr); in pci_bus_register_of_sysfs()
622 static void pci_claim_legacy_resources(struct pci_dev *dev) in pci_claim_legacy_resources() argument
627 if ((dev->class >> 8) != PCI_CLASS_DISPLAY_VGA) in pci_claim_legacy_resources()
639 pcibios_bus_to_resource(dev->bus, p, ®ion); in pci_claim_legacy_resources()
641 root = pci_find_parent_resource(dev, p); in pci_claim_legacy_resources()
643 pci_info(dev, "can't claim VGA legacy %pR: no compatible bridge window\n", p); in pci_claim_legacy_resources()
649 pci_info(dev, "can't claim VGA legacy %pR: address conflict with %s %pR\n", in pci_claim_legacy_resources()
654 pci_info(dev, "VGA legacy framebuffer %pR\n", p); in pci_claim_legacy_resources()
664 struct pci_dev *dev; in pci_claim_bus_resources() local
666 list_for_each_entry(dev, &bus->devices, bus_list) { in pci_claim_bus_resources()
670 pci_dev_for_each_resource(dev, r, i) { in pci_claim_bus_resources()
675 pci_info(dev, "Claiming Resource %d: %pR\n", in pci_claim_bus_resources()
678 pci_claim_resource(dev, i); in pci_claim_bus_resources()
681 pci_claim_legacy_resources(dev); in pci_claim_bus_resources()
692 struct device_node *node = pbm->op->dev.of_node; in pci_scan_one_pbm()
725 int pcibios_enable_device(struct pci_dev *dev, int mask) in pcibios_enable_device() argument
731 pci_read_config_word(dev, PCI_COMMAND, &cmd); in pcibios_enable_device()
734 pci_dev_for_each_resource(dev, res, i) { in pcibios_enable_device()
746 pci_info(dev, "enabling device (%04x -> %04x)\n", oldcmd, cmd); in pcibios_enable_device()
747 pci_write_config_word(dev, PCI_COMMAND, cmd); in pcibios_enable_device()
755 struct pci_pbm_info *pbm = pdev->dev.archdata.host_controller; in pci_iobar_pfn()
796 struct pci_pbm_info *pbm = pdev->dev.archdata.host_controller; in arch_setup_msi_irq()
809 struct pci_pbm_info *pbm = pdev->dev.archdata.host_controller; in arch_teardown_msi_irq()
819 int ali_sound_dma_hack(struct device *dev, u64 device_mask) in ali_sound_dma_hack() argument
821 struct iommu *iommu = dev->archdata.iommu; in ali_sound_dma_hack()
825 if (!dev_is_pci(dev)) in ali_sound_dma_hack()
828 if (to_pci_dev(dev)->vendor != PCI_VENDOR_ID_AL || in ali_sound_dma_hack()
829 to_pci_dev(dev)->device != PCI_DEVICE_ID_AL_M5451 || in ali_sound_dma_hack()
865 void pcibios_set_master(struct pci_dev *dev) in pcibios_set_master() argument
871 int pcibios_device_add(struct pci_dev *dev) in pcibios_device_add() argument
878 if (dev->is_virtfn) { in pcibios_device_add()
881 pdev = dev->physfn; in pcibios_device_add()
882 psd = &pdev->dev.archdata; in pcibios_device_add()
883 pci_init_dev_archdata(&dev->dev.archdata, psd->iommu, in pcibios_device_add()
913 slot_num = of_get_property(pdev->dev.of_node, in pcie_bus_slot_names()
994 node = pbus->self->dev.of_node; in of_pci_slot_init()
1000 node = pbm->op->dev.of_node; in of_pci_slot_init()