Lines Matching full:pdn
842 struct device_node *dn, *pdn; in pci_dma_bus_setup_pSeriesLP() local
851 pdn = pci_dma_find(dn, &prop); in pci_dma_bus_setup_pSeriesLP()
862 if (!pdn) { in pci_dma_bus_setup_pSeriesLP()
867 ppci = PCI_DN(pdn); in pci_dma_bus_setup_pSeriesLP()
870 pdn, ppci->table_group); in pci_dma_bus_setup_pSeriesLP()
994 static void copy_property(struct device_node *pdn, const char *from, const char *to) in copy_property() argument
998 src = of_find_property(pdn, from, NULL); in copy_property()
1012 if (of_add_property(pdn, dst)) { in copy_property()
1013 pr_err("Unable to add DMA window property for %pOF", pdn); in copy_property()
1062 static bool find_existing_ddw(struct device_node *pdn, u64 *dma_addr, int *window_shift, in find_existing_ddw() argument
1072 if (window->device == pdn) { in find_existing_ddw()
1086 static struct dma_win *ddw_list_new_entry(struct device_node *pdn, in ddw_list_new_entry() argument
1095 window->device = pdn; in ddw_list_new_entry()
1105 struct device_node *pdn; in find_existing_ddw_windows_named() local
1109 for_each_node_with_property(pdn, name) { in find_existing_ddw_windows_named()
1110 dma64 = of_get_property(pdn, name, &len); in find_existing_ddw_windows_named()
1112 remove_dma_window_named(pdn, true, name, true); in find_existing_ddw_windows_named()
1122 window = ddw_list_new_entry(pdn, dma64); in find_existing_ddw_windows_named()
1124 of_node_put(pdn); in find_existing_ddw_windows_named()
1187 struct pci_dn *pdn; in query_ddw() local
1210 pdn = PCI_DN(dn); in query_ddw()
1211 buid = pdn->phb->buid; in query_ddw()
1212 cfg_addr = ((pdn->busno << 16) | (pdn->devfn << 8)); in query_ddw()
1246 struct pci_dn *pdn; in create_ddw() local
1258 pdn = PCI_DN(dn); in create_ddw()
1259 buid = pdn->phb->buid; in create_ddw()
1260 cfg_addr = ((pdn->busno << 16) | (pdn->devfn << 8)); in create_ddw()
1279 struct device_node *pdn; member
1314 struct pci_dn *pdn; in reset_dma_window() local
1321 pdn = PCI_DN(dn); in reset_dma_window()
1322 buid = pdn->phb->buid; in reset_dma_window()
1323 cfg_addr = (pdn->busno << 16) | (pdn->devfn << 8); in reset_dma_window()
1396 * pdn: the parent pe node with the ibm,dma_window property
1401 static bool enable_ddw(struct pci_dev *dev, struct device_node *pdn) in enable_ddw() argument
1418 struct pci_dn *pci = PCI_DN(pdn); in enable_ddw()
1427 if (find_existing_ddw(pdn, &dev->dev.archdata.dma_offset, &len, &direct_mapping)) in enable_ddw()
1438 if (fpdn->pdn == pdn) in enable_ddw()
1450 ret = of_property_read_u32_array(pdn, "ibm,ddw-applicable", in enable_ddw()
1462 ret = query_ddw(dev, ddw_avail, &query, pdn); in enable_ddw()
1482 default_win = of_find_property(pdn, "ibm,dma-window", NULL); in enable_ddw()
1486 reset_win_ext = ddw_read_ext(pdn, DDW_EXT_RESET_DMA_WIN, NULL); in enable_ddw()
1490 remove_dma_window(pdn, ddw_avail, default_win, true); in enable_ddw()
1494 ret = query_ddw(dev, ddw_avail, &query, pdn); in enable_ddw()
1588 ret = of_add_property(pdn, win64); in enable_ddw()
1591 pdn, ret); in enable_ddw()
1595 window = ddw_list_new_entry(pdn, win64->value); in enable_ddw()
1610 clean_dma_window(pdn, win64->value); in enable_ddw()
1662 if (!of_find_property(pdn, "ibm,dma-window-saved", NULL)) in enable_ddw()
1663 copy_property(pdn, "ibm,dma-window", "ibm,dma-window-saved"); in enable_ddw()
1664 of_remove_property(pdn, default_win); in enable_ddw()
1665 dev_info(&dev->dev, "Removed default DMA window for %pOF\n", pdn); in enable_ddw()
1679 of_remove_property(pdn, win64); in enable_ddw()
1688 __remove_dma_window(pdn, ddw_avail, create.liobn); in enable_ddw()
1692 reset_dma_window(dev, pdn); in enable_ddw()
1697 fpdn->pdn = pdn; in enable_ddw()
1731 struct device_node *pdn, in spapr_tce_init_table_group() argument
1734 struct iommu_table_group *table_group = PCI_DN(pdn)->table_group; in spapr_tce_init_table_group()
1752 if (!of_find_property(pdn, "ibm,dma-window", NULL)) in spapr_tce_init_table_group()
1755 ret = of_property_read_u32_array(pdn, "ibm,ddw-applicable", in spapr_tce_init_table_group()
1762 ret = query_ddw(pdev, ddw_avail, &query, pdn); in spapr_tce_init_table_group()
1780 struct device_node *pdn, *dn; in pci_dma_dev_setup_pSeriesLP() local
1796 pdn = pci_dma_find(dn, &prop); in pci_dma_dev_setup_pSeriesLP()
1797 if (!pdn || !PCI_DN(pdn)) { in pci_dma_dev_setup_pSeriesLP()
1803 pr_debug(" parent is %pOF\n", pdn); in pci_dma_dev_setup_pSeriesLP()
1805 pci = PCI_DN(pdn); in pci_dma_dev_setup_pSeriesLP()
1825 spapr_tce_init_table_group(dev, pdn, prop); in pci_dma_dev_setup_pSeriesLP()
1833 struct device_node *dn = pci_device_to_OF_node(pdev), *pdn; in iommu_bypass_supported_pSeriesLP() local
1847 pdn = pci_dma_find(dn, NULL); in iommu_bypass_supported_pSeriesLP()
1848 if (pdn && PCI_DN(pdn)) in iommu_bypass_supported_pSeriesLP()
1849 return enable_ddw(pdev, pdn); in iommu_bypass_supported_pSeriesLP()
1887 static void restore_default_dma_window(struct pci_dev *pdev, struct device_node *pdn) in restore_default_dma_window() argument
1889 reset_dma_window(pdev, pdn); in restore_default_dma_window()
1890 copy_property(pdn, "ibm,dma-window-saved", "ibm,dma-window"); in restore_default_dma_window()
1893 static long remove_dynamic_dma_windows(struct pci_dev *pdev, struct device_node *pdn) in remove_dynamic_dma_windows() argument
1895 struct pci_dn *pci = PCI_DN(pdn); in remove_dynamic_dma_windows()
1900 if (find_existing_ddw(pdn, &pdev->dev.archdata.dma_offset, &len, &direct_mapping)) { in remove_dynamic_dma_windows()
1901 remove_dma_window_named(pdn, true, direct_mapping ? in remove_dynamic_dma_windows()
1917 if (window->device == pdn) { in remove_dynamic_dma_windows()
1935 struct device_node *pdn; in pseries_setup_default_iommu_config() local
1939 pdn = pci_dma_find_parent_node(pdev, table_group); in pseries_setup_default_iommu_config()
1940 if (!pdn || !PCI_DN(pdn)) { in pseries_setup_default_iommu_config()
1941 dev_warn(&pdev->dev, "No table_group configured for the node %pOF\n", pdn); in pseries_setup_default_iommu_config()
1944 pci = PCI_DN(pdn); in pseries_setup_default_iommu_config()
1952 restore_default_dma_window(pdev, pdn); in pseries_setup_default_iommu_config()
1954 default_prop = of_get_property(pdn, "ibm,dma-window", NULL); in pseries_setup_default_iommu_config()
1955 of_parse_dma_window(pdn, default_prop, &liobn, &offset, &size); in pseries_setup_default_iommu_config()
1996 struct device_node *pdn; in spapr_tce_create_table() local
2014 pdn = pci_dma_find_parent_node(pdev, table_group); in spapr_tce_create_table()
2015 if (!pdn || !PCI_DN(pdn)) { /* Niether of 32s|64-bit exist! */ in spapr_tce_create_table()
2016 dev_warn(&pdev->dev, "No dma-windows exist for the node %pOF\n", pdn); in spapr_tce_create_table()
2019 pci = PCI_DN(pdn); in spapr_tce_create_table()
2021 /* If the enable DDW failed for the pdn, dont retry! */ in spapr_tce_create_table()
2023 if (fpdn->pdn == pdn) { in spapr_tce_create_table()
2024 dev_info(&pdev->dev, "%pOF in failed DDW device list\n", pdn); in spapr_tce_create_table()
2039 if (find_existing_ddw(pdn, &pdev->dev.archdata.dma_offset, &len, in spapr_tce_create_table()
2041 dev_warn(&pdev->dev, "%pOF: 64-bit window already present.", pdn); in spapr_tce_create_table()
2049 default_prop = of_get_property(pdn, "ibm,dma-window", NULL); in spapr_tce_create_table()
2051 if (find_existing_ddw(pdn, &pdev->dev.archdata.dma_offset, &len, in spapr_tce_create_table()
2054 pdn); in spapr_tce_create_table()
2059 restore_default_dma_window(pdev, pdn); in spapr_tce_create_table()
2061 default_prop = of_get_property(pdn, "ibm,dma-window", NULL); in spapr_tce_create_table()
2062 of_parse_dma_window(pdn, default_prop, &liobn, &offset, &size); in spapr_tce_create_table()
2079 ret = of_property_read_u32_array(pdn, "ibm,ddw-applicable", in spapr_tce_create_table()
2087 pr_err("%s: Calling query %pOF\n", __func__, pdn); in spapr_tce_create_table()
2088 ret = query_ddw(pdev, ddw_avail, &query, pdn); in spapr_tce_create_table()
2103 pr_err("%s: Create ddw failed %pOF\n", __func__, pdn); in spapr_tce_create_table()
2112 ret = of_add_property(pdn, win64); in spapr_tce_create_table()
2114 dev_err(&pdev->dev, "unable to add DMA window property for %pOF: %ld", pdn, ret); in spapr_tce_create_table()
2119 window = ddw_list_new_entry(pdn, win64->value); in spapr_tce_create_table()
2154 of_remove_property(pdn, win64); in spapr_tce_create_table()
2160 __remove_dma_window(pdn, ddw_avail, create.liobn); in spapr_tce_create_table()
2166 fpdn->pdn = pdn; in spapr_tce_create_table()
2201 struct device_node *dn = pci_device_to_OF_node(pdev), *pdn; in spapr_tce_unset_window() local
2215 pdn = pci_dma_find(dn, NULL); in spapr_tce_unset_window()
2216 if (!pdn || !PCI_DN(pdn)) { /* Niether of 32s|64-bit exist! */ in spapr_tce_unset_window()
2217 dev_warn(&pdev->dev, "No dma-windows exist for the node %pOF\n", pdn); in spapr_tce_unset_window()
2222 if (remove_dma_window_named(pdn, true, win_name, false)) { in spapr_tce_unset_window()
2223 pr_err("%s: The existing DDW removal failed for node %pOF\n", __func__, pdn); in spapr_tce_unset_window()
2230 if (window->device == pdn) { in spapr_tce_unset_window()
2250 fpdn->pdn = pdn; in spapr_tce_unset_window()
2264 struct device_node *pdn; in spapr_tce_take_ownership() local
2274 pdn = pci_dma_find(dn, NULL); in spapr_tce_take_ownership()
2275 if (!pdn || !PCI_DN(pdn)) { /* Niether of 32s|64-bit exist! */ in spapr_tce_take_ownership()
2276 dev_warn(&pdev->dev, "No dma-windows exist for the node %pOF\n", pdn); in spapr_tce_take_ownership()
2290 if (remove_dynamic_dma_windows(pdev, pdn)) { in spapr_tce_take_ownership()
2291 dev_warn(&pdev->dev, "The existing DDW removal failed for node %pOF\n", pdn); in spapr_tce_take_ownership()
2300 remove_dma_window_named(pdn, true, "ibm,dma-window", true); in spapr_tce_take_ownership()
2471 struct device_node *pdn, *dn = pdev->dev.of_node; in pSeries_pci_device_group() local
2475 pdn = pci_dma_find(dn, NULL); in pSeries_pci_device_group()
2476 if (!pdn || !PCI_DN(pdn)) in pSeries_pci_device_group()
2479 pci = PCI_DN(pdn); in pSeries_pci_device_group()