Lines Matching refs:pdn
231 static int pnv_eeh_find_cap(struct pci_dn *pdn, int cap)
237 if (!pdn)
241 pnv_pci_cfg_read(pdn, PCI_STATUS, 2, &status);
246 pnv_pci_cfg_read(pdn, pos, 1, &pos);
251 pnv_pci_cfg_read(pdn, pos + PCI_CAP_LIST_ID, 1, &id);
266 static int pnv_eeh_find_ecap(struct pci_dn *pdn, int cap)
268 struct eeh_dev *edev = pdn_to_eeh_dev(pdn);
274 if (pnv_pci_cfg_read(pdn, pos, 4, &header) != PCIBIOS_SUCCESSFUL)
287 if (pnv_pci_cfg_read(pdn, pos, 4, &header) != PCIBIOS_SUCCESSFUL)
324 struct pci_dn *pdn = pci_get_pdn(pdev);
325 struct pci_controller *hose = pdn->phb;
327 struct eeh_dev *edev = pdn_to_eeh_dev(pdn);
331 int config_addr = (pdn->busno << 8) | (pdn->devfn);
358 edev->pcix_cap = pnv_eeh_find_cap(pdn, PCI_CAP_ID_PCIX);
359 edev->pcie_cap = pnv_eeh_find_cap(pdn, PCI_CAP_ID_EXP);
360 edev->af_cap = pnv_eeh_find_cap(pdn, PCI_CAP_ID_AF);
361 edev->aer_cap = pnv_eeh_find_ecap(pdn, PCI_EXT_CAP_ID_ERR);
365 pnv_pci_cfg_read(pdn, edev->pcie_cap + PCI_EXP_FLAGS,
404 if ((pdn->vendor_id == PCI_VENDOR_ID_BROADCOM &&
405 pdn->device_id == 0x1656) ||
406 (pdn->vendor_id == PCI_VENDOR_ID_BROADCOM &&
407 pdn->device_id == 0x1657) ||
408 (pdn->vendor_id == PCI_VENDOR_ID_BROADCOM &&
409 pdn->device_id == 0x168a) ||
410 (pdn->vendor_id == PCI_VENDOR_ID_BROADCOM &&
411 pdn->device_id == 0x168e))
422 pdn->busno);
804 struct pci_dn *pdn = pci_get_pdn_by_devfn(dev->bus, dev->devfn);
805 struct eeh_dev *edev = pdn_to_eeh_dev(pdn);
908 static void pnv_eeh_wait_for_pending(struct pci_dn *pdn, const char *type,
911 struct eeh_dev *edev = pdn->edev;
925 pdn->phb->global_number, pdn->busno,
926 PCI_SLOT(pdn->devfn), PCI_FUNC(pdn->devfn));
929 static int pnv_eeh_do_flr(struct pci_dn *pdn, int option)
931 struct eeh_dev *edev = pdn_to_eeh_dev(pdn);
944 pnv_eeh_wait_for_pending(pdn, "",
967 static int pnv_eeh_do_af_flr(struct pci_dn *pdn, int option)
969 struct eeh_dev *edev = pdn_to_eeh_dev(pdn);
987 pnv_eeh_wait_for_pending(pdn, "AF",
1006 struct pci_dn *pdn;
1011 pdn = eeh_dev_to_pdn(edev);
1012 if (!pdn)
1015 ret = pnv_eeh_do_flr(pdn, option);
1019 return pnv_eeh_do_af_flr(pdn, option);
1208 static inline bool pnv_eeh_cfg_blocked(struct pci_dn *pdn)
1210 struct eeh_dev *edev = pdn_to_eeh_dev(pdn);
1232 struct pci_dn *pdn = eeh_dev_to_pdn(edev);
1234 if (!pdn)
1237 if (pnv_eeh_cfg_blocked(pdn)) {
1242 return pnv_pci_cfg_read(pdn, where, size, val);
1248 struct pci_dn *pdn = eeh_dev_to_pdn(edev);
1250 if (!pdn)
1253 if (pnv_eeh_cfg_blocked(pdn))
1256 return pnv_pci_cfg_write(pdn, where, size, val);