Lines Matching refs:dn
33 static void pnv_php_register(struct device_node *dn);
34 static void pnv_php_unregister_one(struct device_node *dn);
35 static void pnv_php_unregister(struct device_node *dn);
89 static struct pnv_php_slot *pnv_php_match(struct device_node *dn,
94 if (php_slot->dn == dn) {
100 target = pnv_php_match(dn, tmp);
108 struct pnv_php_slot *pnv_php_find_slot(struct device_node *dn)
115 php_slot = pnv_php_match(dn, tmp);
131 static void pnv_php_rmv_pdns(struct device_node *dn)
135 for_each_child_of_node(dn, child) {
155 struct device_node *dn;
157 for_each_child_of_node(parent, dn) {
158 pnv_php_detach_device_nodes(dn);
160 of_node_put(dn);
161 of_detach_node(dn);
167 pnv_php_rmv_pdns(php_slot->dn);
175 pnv_php_detach_device_nodes(php_slot->dn);
181 php_slot->dn->child = NULL;
212 struct device_node *dn)
217 for_each_child_of_node(dn, child) {
234 static void *pnv_php_add_one_pdn(struct device_node *dn, void *data)
239 pdn = pci_add_device_node_info(hose, dn);
250 pci_traverse_device_nodes(slot->dn, pnv_php_add_one_pdn, hose);
268 ret = pnv_pci_get_device_tree(php_slot->dn->phandle, fdt1, 0x10000);
281 dt = of_fdt_unflatten_tree(fdt, php_slot->dn, NULL);
290 pnv_php_reverse_nodes(php_slot->dn);
291 ret = pnv_php_populate_changeset(&php_slot->ocs, php_slot->dn);
293 pnv_php_reverse_nodes(php_slot->dn);
299 php_slot->dn->child = NULL;
317 php_slot->dn->child = NULL;
340 if (be64_to_cpu(msg.params[1]) != php_slot->dn->phandle ||
520 pnv_php_register(php_slot->dn);
586 pnv_php_unregister(php_slot->dn);
619 static struct pnv_php_slot *pnv_php_alloc_slot(struct device_node *dn)
627 ret = of_property_read_string(dn, "ibm,slot-label", &label);
631 if (pnv_pci_get_slot_id(dn, &id))
634 bus = pci_find_bus_by_node(dn);
648 if (dn->child && PCI_DN(dn->child))
649 php_slot->slot_no = PCI_SLOT(PCI_DN(dn->child)->devfn);
655 php_slot->dn = dn;
671 struct device_node *dn = php_slot->dn;
676 parent = pnv_php_find_slot(php_slot->dn);
691 while ((dn = of_get_parent(dn))) {
692 if (!PCI_DN(dn)) {
693 of_node_put(dn);
697 parent = pnv_php_find_slot(dn);
699 of_node_put(dn);
703 of_node_put(dn);
853 ret = of_property_read_u32(php_slot->dn, "ibm,slot-broken-pdc",
931 static int pnv_php_register_one(struct device_node *dn)
938 ret = of_property_read_u32(dn, "ibm,slot-pluggable", &prop32);
942 ret = of_property_read_u32(dn, "ibm,reset-by-firmware", &prop32);
946 php_slot = pnv_php_alloc_slot(dn);
959 ret = of_property_read_u32(dn, "ibm,slot-surprise-pluggable", &prop32);
966 pnv_php_unregister_one(php_slot->dn);
972 static void pnv_php_register(struct device_node *dn)
980 for_each_child_of_node(dn, child) {
986 static void pnv_php_unregister_one(struct device_node *dn)
990 php_slot = pnv_php_find_slot(dn);
1000 static void pnv_php_unregister(struct device_node *dn)
1005 for_each_child_of_node(dn, child) {
1013 struct device_node *dn;
1016 for_each_compatible_node(dn, NULL, "ibm,ioda2-phb")
1017 pnv_php_register(dn);
1019 for_each_compatible_node(dn, NULL, "ibm,ioda3-phb")
1020 pnv_php_register(dn);
1022 for_each_compatible_node(dn, NULL, "ibm,ioda2-npu2-opencapi-phb")
1023 pnv_php_register_one(dn); /* slot directly under the PHB */
1029 struct device_node *dn;
1031 for_each_compatible_node(dn, NULL, "ibm,ioda2-phb")
1032 pnv_php_unregister(dn);
1034 for_each_compatible_node(dn, NULL, "ibm,ioda3-phb")
1035 pnv_php_unregister(dn);
1037 for_each_compatible_node(dn, NULL, "ibm,ioda2-npu2-opencapi-phb")
1038 pnv_php_unregister_one(dn); /* slot directly under the PHB */