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
386 for_each_compatible_node(np, "serial", "ns16550") { in find_legacy_serial_ports()
387 struct device_node *parent = of_get_parent(np); in find_legacy_serial_ports()
391 if (of_device_is_available(np)) { in find_legacy_serial_ports()
392 index = add_legacy_soc_port(np, np); in find_legacy_serial_ports()
393 if (index >= 0 && np == stdout) in find_legacy_serial_ports()
401 for_each_node_by_type(np, "serial") { in find_legacy_serial_ports()
402 struct device_node *isa = of_get_parent(np); in find_legacy_serial_ports()
404 if (of_device_is_available(np)) { in find_legacy_serial_ports()
405 index = add_legacy_isa_port(np, isa); in find_legacy_serial_ports()
406 if (index >= 0 && np == stdout) in find_legacy_serial_ports()
415 for (np = NULL; (np = of_find_all_nodes(np));) { in find_legacy_serial_ports()
416 struct device_node *pci, *parent = of_get_parent(np); in find_legacy_serial_ports()
421 if (!of_node_name_eq(np, "serial") && in find_legacy_serial_ports()
422 !of_node_is_type(np, "serial")) { in find_legacy_serial_ports()
429 if (of_device_is_compatible(np, "pciclass,0700") || in find_legacy_serial_ports()
430 of_device_is_compatible(np, "pciclass,070002")) in find_legacy_serial_ports()
431 pci = np; in find_legacy_serial_ports()
439 index = add_legacy_pci_port(np, pci); in find_legacy_serial_ports()
440 if (index >= 0 && np == stdout) in find_legacy_serial_ports()
461 struct device_node *np, in fixup_port_irq() argument
468 virq = irq_of_parse_and_map(np, 0); in fixup_port_irq()
470 np = of_get_parent(np); in fixup_port_irq()
471 if (np == NULL) in fixup_port_irq()
473 virq = irq_of_parse_and_map(np, 0); in fixup_port_irq()
474 of_node_put(np); in fixup_port_irq()
482 if (of_device_is_compatible(np, "fsl,ns16550")) { in fixup_port_irq()
490 struct device_node *np, in fixup_port_pio() argument
498 hose = pci_find_hose_for_OF_device(np); in fixup_port_pio()
514 struct device_node *np, in fixup_port_mmio() argument
550 struct device_node *np = legacy_serial_infos[i].np; in serial_dev_init() local
553 fixup_port_irq(i, np, port); in serial_dev_init()
555 fixup_port_pio(i, np, port); in serial_dev_init()
557 fixup_port_mmio(i, np, port); in serial_dev_init()
629 if (prom_stdout != legacy_serial_infos[i].np) in check_legacy_serial_console()