Lines Matching refs:pdev
22 struct pci_dev *pdev = pci_dev_b(walk); in pci_fixup_host_bridge_self() local
24 if (pdev->class >> 8 == PCI_CLASS_BRIDGE_HOST) { in pci_fixup_host_bridge_self()
25 pbus->self = pdev; in pci_fixup_host_bridge_self()
40 struct pci_dev *pdev, in find_device_prom_node() argument
53 if ((pdev->bus->number == pbm->pci_bus->number) && (pdev->devfn == 0) && in find_device_prom_node()
54 (pdev->vendor == PCI_VENDOR_ID_SUN) && in find_device_prom_node()
55 (pdev->device == PCI_DEVICE_ID_SUN_PBM || in find_device_prom_node()
56 pdev->device == PCI_DEVICE_ID_SUN_SCHIZO || in find_device_prom_node()
57 pdev->device == PCI_DEVICE_ID_SUN_TOMATILLO || in find_device_prom_node()
58 pdev->device == PCI_DEVICE_ID_SUN_SABRE || in find_device_prom_node()
59 pdev->device == PCI_DEVICE_ID_SUN_HUMMINGBIRD)) { in find_device_prom_node()
71 if (((pregs[0].phys_hi >> 8) & 0xff) == pdev->devfn) { in find_device_prom_node()
87 static void pci_device_delete(struct pci_dev *pdev) in pci_device_delete() argument
89 list_del(&pdev->global_list); in pci_device_delete()
90 list_del(&pdev->bus_list); in pci_device_delete()
93 kfree(pdev); in pci_device_delete()
101 static void __init fixup_obp_assignments(struct pci_dev *pdev, in fixup_obp_assignments() argument
106 if (pdev->vendor == PCI_VENDOR_ID_AL && in fixup_obp_assignments()
107 (pdev->device == PCI_DEVICE_ID_AL_M7101 || in fixup_obp_assignments()
108 pdev->device == PCI_DEVICE_ID_AL_M1533)) { in fixup_obp_assignments()
119 pdev->resource[i].start = in fixup_obp_assignments()
120 pdev->resource[i].end = in fixup_obp_assignments()
121 pdev->resource[i].flags = 0; in fixup_obp_assignments()
123 pdev->resource[PCI_ROM_RESOURCE].start = in fixup_obp_assignments()
124 pdev->resource[PCI_ROM_RESOURCE].end = in fixup_obp_assignments()
125 pdev->resource[PCI_ROM_RESOURCE].flags = 0; in fixup_obp_assignments()
149 struct pci_dev *pdev, in pdev_cookie_fillin() argument
156 device_prom_node = find_device_prom_node(pbm, pdev, bus_prom_node, in pdev_cookie_fillin()
168 pci_device_delete(pdev); in pdev_cookie_fillin()
225 fixup_obp_assignments(pdev, pcp); in pdev_cookie_fillin()
227 pdev->sysdata = pcp; in pdev_cookie_fillin()
241 struct pci_dev *pdev = pci_dev_b(walk); in pci_fill_in_pbm_cookies() local
244 pdev_cookie_fillin(pbm, pdev, prom_node); in pci_fill_in_pbm_cookies()
262 static void __init bad_assignment(struct pci_dev *pdev, in bad_assignment() argument
268 pdev->bus->number, pdev->devfn); in bad_assignment()
316 struct pci_dev *pdev) in get_device_resource() argument
334 bad_assignment(pdev, ap, NULL, 0); in get_device_resource()
337 res = &pdev->resource[PCI_ROM_RESOURCE]; in get_device_resource()
346 res = &pdev->resource[(breg - PCI_BASE_ADDRESS_0) / 4]; in get_device_resource()
350 bad_assignment(pdev, ap, NULL, 0); in get_device_resource()
358 static int __init pdev_resource_collisions_expected(struct pci_dev *pdev) in pdev_resource_collisions_expected() argument
360 if (pdev->vendor != PCI_VENDOR_ID_SUN) in pdev_resource_collisions_expected()
363 if (pdev->device == PCI_DEVICE_ID_SUN_RIO_EBUS || in pdev_resource_collisions_expected()
364 pdev->device == PCI_DEVICE_ID_SUN_RIO_1394 || in pdev_resource_collisions_expected()
365 pdev->device == PCI_DEVICE_ID_SUN_RIO_USB) in pdev_resource_collisions_expected()
372 struct pci_dev *pdev) in pdev_record_assignments() argument
374 struct pcidev_cookie *pcp = pdev->sysdata; in pdev_record_assignments()
386 res = get_device_resource(ap, pdev); in pdev_record_assignments()
395 bad_assignment(pdev, ap, res, 1); in pdev_record_assignments()
404 bad_assignment(pdev, ap, res, 1); in pdev_record_assignments()
406 bad_assignment(pdev, ap, res, 1); in pdev_record_assignments()
417 res->start, (res - &pdev->resource[0]), pdev->name); in pdev_record_assignments()
425 pbm->parent->resource_adjust(pdev, res, root); in pdev_record_assignments()
434 if (!pdev_resource_collisions_expected(pdev)) { in pdev_record_assignments()
437 (res - &pdev->resource[0]), in pdev_record_assignments()
439 pdev->name); in pdev_record_assignments()
462 static int __init has_implicit_io(struct pci_dev *pdev) in has_implicit_io() argument
464 int class = pdev->class >> 8; in has_implicit_io()
469 (pdev->class >> 16) == PCI_BASE_CLASS_DISPLAY) in has_implicit_io()
476 struct pci_dev *pdev) in pdev_assign_unassigned() argument
487 res = &pdev->resource[i]; in pdev_assign_unassigned()
516 i, pdev->name); in pdev_assign_unassigned()
521 pbm->parent->base_address_update(pdev, i); in pdev_assign_unassigned()
529 pci_read_config_dword(pdev, PCI_ROM_ADDRESS, ®); in pdev_assign_unassigned()
531 pci_write_config_dword(pdev, PCI_ROM_ADDRESS, reg); in pdev_assign_unassigned()
537 pci_read_config_word(pdev, PCI_COMMAND, &cmd); in pdev_assign_unassigned()
538 if (io_seen || has_implicit_io(pdev)) in pdev_assign_unassigned()
542 pci_write_config_word(pdev, PCI_COMMAND, cmd); in pdev_assign_unassigned()
549 if (((pdev->class >> 8) == PCI_CLASS_BRIDGE_PCI) || in pdev_assign_unassigned()
550 (((pdev->class >> 8) == PCI_CLASS_STORAGE_IDE) && in pdev_assign_unassigned()
551 ((pdev->class & 0x80) != 0))) { in pdev_assign_unassigned()
552 pci_read_config_word(pdev, PCI_COMMAND, &cmd); in pdev_assign_unassigned()
554 pci_write_config_word(pdev, PCI_COMMAND, cmd); in pdev_assign_unassigned()
556 if ((pdev->class >> 8) == PCI_CLASS_BRIDGE_PCI) in pdev_assign_unassigned()
557 pci_write_config_byte(pdev, in pdev_assign_unassigned()
576 static int __init pci_intmap_match(struct pci_dev *pdev, unsigned int *interrupt) in pci_intmap_match() argument
580 struct pcidev_cookie *dev_pcp = pdev->sysdata; in pci_intmap_match()
610 if (pdev->bus->number != pbm->pci_first_busno) { in pci_intmap_match()
615 bus_dev = pdev->bus->self; in pci_intmap_match()
616 regs_dev = pdev; in pci_intmap_match()
651 if (pdev->bus->self != bus_dev) in pci_intmap_match()
662 + PCI_SLOT(pdev->devfn)) & 0x3) + 1; in pci_intmap_match()
677 pdev->bus->number, PCI_SLOT(pdev->devfn), in pci_intmap_match()
692 pdev->bus->number, pdev->devfn); in pci_intmap_match()
698 pdev->bus->number, pdev->devfn); in pci_intmap_match()
707 static void __init pdev_fixup_irq(struct pci_dev *pdev) in pdev_fixup_irq() argument
709 struct pcidev_cookie *pcp = pdev->sysdata; in pdev_fixup_irq()
724 if (pdev->vendor == PCI_VENDOR_ID_SUN && in pdev_fixup_irq()
725 pdev->device == PCI_DEVICE_ID_SUN_EBUS && in pdev_fixup_irq()
727 pdev->irq = 0; in pdev_fixup_irq()
734 pdev->irq = 0; in pdev_fixup_irq()
740 pdev->irq = p->irq_build(pbm, pdev, prom_irq); in pdev_fixup_irq()
746 pdev->irq = p->irq_build(pbm, pdev, (portid << 6 | prom_irq)); in pdev_fixup_irq()
751 if (pci_intmap_match(pdev, &prom_irq)) { in pdev_fixup_irq()
752 pdev->irq = p->irq_build(pbm, pdev, (portid << 6) | prom_irq); in pdev_fixup_irq()
771 pci_read_config_byte(pdev, PCI_INTERRUPT_PIN, &pci_irq_line); in pdev_fixup_irq()
784 if (pdev->bus->number == pbm->pci_first_busno) { in pdev_fixup_irq()
785 slot = PCI_SLOT(pdev->devfn) - pbm->pci_first_slot; in pdev_fixup_irq()
792 bus_dev = pdev->bus->self; in pdev_fixup_irq()
801 pdev->irq = p->irq_build(pbm, pdev, in pdev_fixup_irq()
807 pci_write_config_byte(pdev, PCI_INTERRUPT_LINE, in pdev_fixup_irq()
808 pdev->irq & PCI_IRQ_INO); in pdev_fixup_irq()
824 static void pdev_setup_busmastering(struct pci_dev *pdev, int is_66mhz) in pdev_setup_busmastering() argument
829 pci_read_config_word(pdev, PCI_COMMAND, &cmd); in pdev_setup_busmastering()
831 pci_write_config_word(pdev, PCI_COMMAND, cmd); in pdev_setup_busmastering()
837 pci_read_config_word(pdev, PCI_COMMAND, &cmd); in pdev_setup_busmastering()
845 pci_write_config_byte(pdev, PCI_CACHE_LINE_SIZE, in pdev_setup_busmastering()
848 pci_read_config_byte(pdev, PCI_HEADER_TYPE, &hdr_type); in pdev_setup_busmastering()
857 pci_read_config_byte(pdev, PCI_LATENCY_TIMER, <imer); in pdev_setup_busmastering()
879 pci_read_config_byte(pdev, PCI_MIN_GNT, &min_gnt); in pdev_setup_busmastering()
908 pci_write_config_byte(pdev, PCI_LATENCY_TIMER, ltimer); in pdev_setup_busmastering()
926 struct pci_dev *pdev = pci_dev_b(walk); in pci_determine_66mhz_disposition() local
928 pci_read_config_word(pdev, PCI_STATUS, &status); in pci_determine_66mhz_disposition()
1007 struct pci_dev *pdev = pci_dev_b(walk); in pci_scan_for_target_abort() local
1010 pci_read_config_word(pdev, PCI_STATUS, &status); in pci_scan_for_target_abort()
1015 pci_write_config_word(pdev, PCI_STATUS, error_bits); in pci_scan_for_target_abort()
1018 pdev->name, status); in pci_scan_for_target_abort()
1034 struct pci_dev *pdev = pci_dev_b(walk); in pci_scan_for_master_abort() local
1037 pci_read_config_word(pdev, PCI_STATUS, &status); in pci_scan_for_master_abort()
1041 pci_write_config_word(pdev, PCI_STATUS, error_bits); in pci_scan_for_master_abort()
1044 pdev->name, status); in pci_scan_for_master_abort()
1060 struct pci_dev *pdev = pci_dev_b(walk); in pci_scan_for_parity_error() local
1063 pci_read_config_word(pdev, PCI_STATUS, &status); in pci_scan_for_parity_error()
1068 pci_write_config_word(pdev, PCI_STATUS, error_bits); in pci_scan_for_parity_error()
1071 pdev->name, status); in pci_scan_for_parity_error()