Lines Matching refs:np
32 struct device_node *np; member
73 static int __init add_legacy_port(struct device_node *np, int want_index, in add_legacy_port() argument
84 clk = of_get_property(np, "clock-frequency", NULL); in add_legacy_port()
89 spd = of_get_property(np, "current-speed", NULL); in add_legacy_port()
92 rs = of_get_property(np, "reg-shift", NULL); in add_legacy_port()
112 if (legacy_serial_infos[index].np != NULL) { in add_legacy_port()
141 legacy_serial_infos[index].np = of_node_get(np); in add_legacy_port()
152 index, np); in add_legacy_port()
162 static int __init add_legacy_soc_port(struct device_node *np, in add_legacy_soc_port() argument
167 struct device_node *tsi = of_get_parent(np); in add_legacy_soc_port()
172 if (of_get_property(np, "clock-frequency", NULL) == NULL) in add_legacy_soc_port()
176 if ((of_get_property(np, "reg-offset", NULL) != NULL)) in add_legacy_soc_port()
180 if (of_get_property(np, "used-by-rtas", NULL) != NULL) in add_legacy_soc_port()
196 return add_legacy_port(np, -1, UPIO_TSI, addr, addr, in add_legacy_soc_port()
199 return add_legacy_port(np, -1, UPIO_MEM, addr, addr, in add_legacy_soc_port()
203 static int __init add_legacy_isa_port(struct device_node *np, in add_legacy_isa_port() argument
211 DBG(" -> add_legacy_isa_port(%pOF)\n", np); in add_legacy_isa_port()
214 reg = of_get_property(np, "reg", NULL); in add_legacy_isa_port()
225 typep = of_get_property(np, "ibm,aix-loc", NULL); in add_legacy_isa_port()
239 taddr = of_translate_address(np, reg); in add_legacy_isa_port()
246 return add_legacy_port(np, index, UPIO_PORT, be32_to_cpu(reg[1]), in add_legacy_isa_port()
252 static int __init add_legacy_pci_port(struct device_node *np, in add_legacy_pci_port() argument
260 DBG(" -> add_legacy_pci_port(%pOF)\n", np); in add_legacy_pci_port()
269 if (of_get_property(np, "clock-frequency", NULL) == NULL) in add_legacy_pci_port()
294 if (np != pci_dev) { in add_legacy_pci_port()
295 const __be32 *reg = of_get_property(np, "reg", NULL); in add_legacy_pci_port()
319 return add_legacy_port(np, index, iotype, base, addr, 0, in add_legacy_pci_port()
320 legacy_port_flags, np != pci_dev); in add_legacy_pci_port()
367 struct device_node *np, *stdout = NULL; in find_legacy_serial_ports() local
384 for_each_compatible_node(np, "serial", "ns16550") { in find_legacy_serial_ports()
385 struct device_node *parent = of_get_parent(np); in find_legacy_serial_ports()
389 if (of_device_is_available(np)) { in find_legacy_serial_ports()
390 index = add_legacy_soc_port(np, np); in find_legacy_serial_ports()
391 if (index >= 0 && np == stdout) in find_legacy_serial_ports()
399 for_each_node_by_type(np, "serial") { in find_legacy_serial_ports()
400 struct device_node *isa = of_get_parent(np); in find_legacy_serial_ports()
403 if (of_device_is_available(np)) { in find_legacy_serial_ports()
404 index = add_legacy_isa_port(np, isa); in find_legacy_serial_ports()
405 if (index >= 0 && np == stdout) in find_legacy_serial_ports()
414 for (np = NULL; (np = of_find_all_nodes(np));) { in find_legacy_serial_ports()
415 struct device_node *pci, *parent = of_get_parent(np); in find_legacy_serial_ports()
420 if (strcmp(np->name, "serial") && strcmp(np->type, "serial")) { in find_legacy_serial_ports()
427 if (of_device_is_compatible(np, "pciclass,0700") || in find_legacy_serial_ports()
428 of_device_is_compatible(np, "pciclass,070002")) in find_legacy_serial_ports()
429 pci = np; in find_legacy_serial_ports()
437 index = add_legacy_pci_port(np, pci); in find_legacy_serial_ports()
438 if (index >= 0 && np == stdout) in find_legacy_serial_ports()
459 struct device_node *np, in fixup_port_irq() argument
466 virq = irq_of_parse_and_map(np, 0); in fixup_port_irq()
468 np = of_get_parent(np); in fixup_port_irq()
469 if (np == NULL) in fixup_port_irq()
471 virq = irq_of_parse_and_map(np, 0); in fixup_port_irq()
472 of_node_put(np); in fixup_port_irq()
480 if (of_device_is_compatible(np, "fsl,ns16550")) in fixup_port_irq()
486 struct device_node *np, in fixup_port_pio() argument
494 hose = pci_find_hose_for_OF_device(np); in fixup_port_pio()
510 struct device_node *np, in fixup_port_mmio() argument
546 struct device_node *np = legacy_serial_infos[i].np; in serial_dev_init() local
549 fixup_port_irq(i, np, port); in serial_dev_init()
551 fixup_port_pio(i, np, port); in serial_dev_init()
553 fixup_port_mmio(i, np, port); in serial_dev_init()
623 if (prom_stdout != legacy_serial_infos[i].np) in check_legacy_serial_console()