Lines Matching +full:stdout +full:- +full:path

1 // SPDX-License-Identifier: GPL-2.0
16 #include <asm/pci-bridge.h>
17 #include <asm/ppc-pci.h>
43 {.type = "tsi-bridge",},
46 {.compatible = "simple-bus",},
47 {.compatible = "wrs,epld-localbus",},
52 static int legacy_serial_console = -1;
60 offset = offset << p->regshift; in tsi_serial_in()
62 tmp = readl(p->membase + (UART_IIR & ~3)); in tsi_serial_in()
65 return readb(p->membase + offset); in tsi_serial_in()
70 offset = offset << p->regshift; in tsi_serial_out()
72 writeb(value, p->membase + offset); in tsi_serial_out()
86 clk = of_get_property(np, "clock-frequency", NULL); in add_legacy_port()
91 spd = of_get_property(np, "current-speed", NULL); in add_legacy_port()
94 rs = of_get_property(np, "reg-shift", NULL); in add_legacy_port()
109 return -1; in add_legacy_port()
117 printk(KERN_DEBUG "Moved legacy port %d -> %d\n", in add_legacy_port()
172 * encoded in the device-tree. in add_legacy_soc_port()
174 if (!of_property_present(np, "clock-frequency")) in add_legacy_soc_port()
175 return -1; in add_legacy_soc_port()
177 /* if reg-offset don't try to use it */ in add_legacy_soc_port()
178 if (of_property_present(np, "reg-offset")) in add_legacy_soc_port()
179 return -1; in add_legacy_soc_port()
182 if (of_property_read_bool(np, "used-by-rtas")) in add_legacy_soc_port()
183 return -1; in add_legacy_soc_port()
188 return -1; in add_legacy_soc_port()
192 return -1; in add_legacy_soc_port()
197 if (of_node_is_type(tsi, "tsi-bridge")) in add_legacy_soc_port()
198 return add_legacy_port(np, -1, UPIO_TSI, addr, addr, in add_legacy_soc_port()
201 return add_legacy_port(np, -1, UPIO_MEM, addr, addr, in add_legacy_soc_port()
210 int index = -1; in add_legacy_isa_port()
213 DBG(" -> add_legacy_isa_port(%pOF)\n", np); in add_legacy_isa_port()
218 return -1; in add_legacy_isa_port()
222 return -1; in add_legacy_isa_port()
224 /* Now look for an "ibm,aix-loc" property that gives us ordering in add_legacy_isa_port()
227 typep = of_get_property(np, "ibm,aix-loc", NULL); in add_legacy_isa_port()
231 index = simple_strtol(typep+1, NULL, 0) - 1; in add_legacy_isa_port()
239 if (!of_device_is_compatible(isa_brg, "ibm,power8-lpc") || in add_legacy_isa_port()
260 int iotype, index = -1, lindex = 0; in add_legacy_pci_port()
262 DBG(" -> add_legacy_pci_port(%pOF)\n", np); in add_legacy_pci_port()
265 * encoded in the device-tree (that is have an fcode). Anything in add_legacy_pci_port()
271 if (!of_property_present(np, "clock-frequency")) in add_legacy_pci_port()
272 return -1; in add_legacy_pci_port()
277 return -1; in add_legacy_pci_port()
283 return -1; in add_legacy_pci_port()
332 stride = 1 << port->regshift; in setup_legacy_serial_console()
335 if (info->taddr) { in setup_legacy_serial_console()
336 info->early_addr = early_ioremap(info->taddr, 0x1000); in setup_legacy_serial_console()
337 if (info->early_addr == NULL) in setup_legacy_serial_console()
339 udbg_uart_init_mmio(info->early_addr, stride); in setup_legacy_serial_console()
342 if (port->iotype == UPIO_PORT && isa_io_special) in setup_legacy_serial_console()
343 udbg_uart_init_pio(port->iobase, stride); in setup_legacy_serial_console()
349 if (info->speed == 0) in setup_legacy_serial_console()
350 info->speed = udbg_probe_uart_speed(info->clock); in setup_legacy_serial_console()
353 DBG("default console speed = %d\n", info->speed); in setup_legacy_serial_console()
354 udbg_uart_setup(info->speed, info->clock); in setup_legacy_serial_console()
369 if (!info->early_addr) in ioremap_legacy_serial_console()
372 vaddr = ioremap(info->taddr, 0x1000); in ioremap_legacy_serial_console()
374 return -ENOMEM; in ioremap_legacy_serial_console()
376 udbg_uart_init_mmio(vaddr, 1 << port->regshift); in ioremap_legacy_serial_console()
377 early_iounmap(info->early_addr, 0x1000); in ioremap_legacy_serial_console()
378 info->early_addr = NULL; in ioremap_legacy_serial_console()
387 * will try to build a list of all the available 8250-compatible serial ports
388 * in the machine using the Open Firmware device-tree. It currently only deals
391 * the machine non-PCI ports and to properly pick the default console port
395 struct device_node *np, *stdout = NULL; in find_legacy_serial_ports() local
396 const char *path; in find_legacy_serial_ports() local
399 DBG(" -> find_legacy_serial_port()\n"); in find_legacy_serial_ports()
402 path = of_get_property(of_chosen, "linux,stdout-path", NULL); in find_legacy_serial_ports()
403 if (path == NULL) in find_legacy_serial_ports()
404 path = of_get_property(of_chosen, "stdout-path", NULL); in find_legacy_serial_ports()
405 if (path != NULL) { in find_legacy_serial_ports()
406 stdout = of_find_node_by_path(path); in find_legacy_serial_ports()
407 if (stdout) in find_legacy_serial_ports()
408 DBG("stdout is %pOF\n", stdout); in find_legacy_serial_ports()
410 DBG(" no linux,stdout-path !\n"); in find_legacy_serial_ports()
421 if (index >= 0 && np == stdout) in find_legacy_serial_ports()
434 if (index >= 0 && np == stdout) in find_legacy_serial_ports()
468 if (index >= 0 && np == stdout) in find_legacy_serial_ports()
474 of_node_put(stdout); in find_legacy_serial_ports()
479 DBG(" <- find_legacy_serial_port()\n"); in find_legacy_serial_ports()
509 port->irq = virq; in fixup_port_irq()
514 port->handle_irq = fsl8250_handle_irq; in fixup_port_irq()
515 port->has_sysrq = IS_ENABLED(CONFIG_SERIAL_8250_CONSOLE); in fixup_port_irq()
534 unsigned long offset = (unsigned long)hose->io_base_virt - in fixup_port_pio()
540 DBG("port %d, IO %lx -> %lx\n", in fixup_port_pio()
541 index, port->iobase, port->iobase + offset); in fixup_port_pio()
542 port->iobase += offset; in fixup_port_pio()
553 port->membase = ioremap(port->mapbase, 0x100); in fixup_port_mmio()
574 return -ENODEV; in serial_dev_init()
586 if (!port->irq) in serial_dev_init()
588 if (port->iotype == UPIO_PORT) in serial_dev_init()
590 if ((port->iotype == UPIO_MEM) || (port->iotype == UPIO_TSI)) in serial_dev_init()
616 DBG(" -> check_legacy_serial_console()\n"); in check_legacy_serial_console()
621 return -EBUSY; in check_legacy_serial_console()
626 return -ENODEV; in check_legacy_serial_console()
631 return -ENODEV; in check_legacy_serial_console()
634 /* ... So use the full path instead */ in check_legacy_serial_console()
635 name = of_get_property(of_chosen, "linux,stdout-path", NULL); in check_legacy_serial_console()
637 name = of_get_property(of_chosen, "stdout-path", NULL); in check_legacy_serial_console()
639 DBG(" no stdout-path !\n"); in check_legacy_serial_console()
640 return -ENODEV; in check_legacy_serial_console()
644 DBG(" can't find stdout package %s !\n", name); in check_legacy_serial_console()
645 return -ENODEV; in check_legacy_serial_console()
647 DBG("stdout is %pOF\n", prom_stdout); in check_legacy_serial_console()
651 DBG(" stdout package has no name !\n"); in check_legacy_serial_console()
654 spd = of_get_property(prom_stdout, "current-speed", NULL); in check_legacy_serial_console()
686 return -ENODEV; in check_legacy_serial_console()