Lines Matching refs:dn
34 static void pnv_php_register(struct device_node *dn);
35 static void pnv_php_unregister_one(struct device_node *dn);
36 static void pnv_php_unregister(struct device_node *dn);
91 static struct pnv_php_slot *pnv_php_match(struct device_node *dn,
96 if (php_slot->dn == dn) {
102 target = pnv_php_match(dn, tmp);
110 struct pnv_php_slot *pnv_php_find_slot(struct device_node *dn)
117 php_slot = pnv_php_match(dn, tmp);
133 static void pnv_php_rmv_pdns(struct device_node *dn)
137 for_each_child_of_node(dn, child) {
157 struct device_node *dn;
159 for_each_child_of_node(parent, dn) {
160 pnv_php_detach_device_nodes(dn);
162 of_node_put(dn);
163 of_detach_node(dn);
169 pnv_php_rmv_pdns(php_slot->dn);
177 pnv_php_detach_device_nodes(php_slot->dn);
183 php_slot->dn->child = NULL;
214 struct device_node *dn)
219 for_each_child_of_node(dn, child) {
236 static void *pnv_php_add_one_pdn(struct device_node *dn, void *data)
241 pdn = pci_add_device_node_info(hose, dn);
252 pci_traverse_device_nodes(slot->dn, pnv_php_add_one_pdn, hose);
270 ret = pnv_pci_get_device_tree(php_slot->dn->phandle, fdt1, 0x10000);
283 dt = of_fdt_unflatten_tree(fdt, php_slot->dn, NULL);
292 pnv_php_reverse_nodes(php_slot->dn);
293 ret = pnv_php_populate_changeset(&php_slot->ocs, php_slot->dn);
295 pnv_php_reverse_nodes(php_slot->dn);
301 php_slot->dn->child = NULL;
319 php_slot->dn->child = NULL;
342 if (be64_to_cpu(msg.params[1]) != php_slot->dn->phandle ||
522 pnv_php_register(php_slot->dn);
588 pnv_php_unregister(php_slot->dn);
621 static struct pnv_php_slot *pnv_php_alloc_slot(struct device_node *dn)
629 ret = of_property_read_string(dn, "ibm,slot-label", &label);
633 if (pnv_pci_get_slot_id(dn, &id))
636 bus = pci_find_bus_by_node(dn);
650 if (dn->child && PCI_DN(dn->child))
651 php_slot->slot_no = PCI_SLOT(PCI_DN(dn->child)->devfn);
657 php_slot->dn = dn;
673 struct device_node *dn = php_slot->dn;
678 parent = pnv_php_find_slot(php_slot->dn);
693 while ((dn = of_get_parent(dn))) {
694 if (!PCI_DN(dn)) {
695 of_node_put(dn);
699 parent = pnv_php_find_slot(dn);
701 of_node_put(dn);
705 of_node_put(dn);
855 ret = of_property_read_u32(php_slot->dn, "ibm,slot-broken-pdc",
933 static int pnv_php_register_one(struct device_node *dn)
940 ret = of_property_read_u32(dn, "ibm,slot-pluggable", &prop32);
944 ret = of_property_read_u32(dn, "ibm,reset-by-firmware", &prop32);
948 php_slot = pnv_php_alloc_slot(dn);
961 ret = of_property_read_u32(dn, "ibm,slot-surprise-pluggable", &prop32);
968 pnv_php_unregister_one(php_slot->dn);
974 static void pnv_php_register(struct device_node *dn)
982 for_each_child_of_node(dn, child) {
988 static void pnv_php_unregister_one(struct device_node *dn)
992 php_slot = pnv_php_find_slot(dn);
1002 static void pnv_php_unregister(struct device_node *dn)
1007 for_each_child_of_node(dn, child) {
1015 struct device_node *dn;
1018 for_each_compatible_node(dn, NULL, "ibm,ioda2-phb")
1019 pnv_php_register(dn);
1021 for_each_compatible_node(dn, NULL, "ibm,ioda3-phb")
1022 pnv_php_register(dn);
1024 for_each_compatible_node(dn, NULL, "ibm,ioda2-npu2-opencapi-phb")
1025 pnv_php_register_one(dn); /* slot directly under the PHB */
1031 struct device_node *dn;
1033 for_each_compatible_node(dn, NULL, "ibm,ioda2-phb")
1034 pnv_php_unregister(dn);
1036 for_each_compatible_node(dn, NULL, "ibm,ioda3-phb")
1037 pnv_php_unregister(dn);
1039 for_each_compatible_node(dn, NULL, "ibm,ioda2-npu2-opencapi-phb")
1040 pnv_php_unregister_one(dn); /* slot directly under the PHB */