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>
41 {.type = "tsi-bridge",},
44 {.compatible = "simple-bus",},
45 {.compatible = "wrs,epld-localbus",},
50 static int legacy_serial_console = -1;
58 offset = offset << p->regshift; in tsi_serial_in()
60 tmp = readl(p->membase + (UART_IIR & ~3)); in tsi_serial_in()
63 return readb(p->membase + offset); in tsi_serial_in()
68 offset = offset << p->regshift; in tsi_serial_out()
70 writeb(value, p->membase + offset); in tsi_serial_out()
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()
107 return -1; in add_legacy_port()
115 printk(KERN_DEBUG "Moved legacy port %d -> %d\n", in add_legacy_port()
170 * encoded in the device-tree. in add_legacy_soc_port()
172 if (of_get_property(np, "clock-frequency", NULL) == NULL) in add_legacy_soc_port()
173 return -1; in add_legacy_soc_port()
175 /* if reg-offset don't try to use it */ in add_legacy_soc_port()
176 if ((of_get_property(np, "reg-offset", NULL) != NULL)) in add_legacy_soc_port()
177 return -1; in add_legacy_soc_port()
180 if (of_get_property(np, "used-by-rtas", NULL) != NULL) in add_legacy_soc_port()
181 return -1; in add_legacy_soc_port()
186 return -1; in add_legacy_soc_port()
190 return -1; in add_legacy_soc_port()
195 if (of_node_is_type(tsi, "tsi-bridge")) 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()
208 int index = -1; in add_legacy_isa_port()
211 DBG(" -> add_legacy_isa_port(%pOF)\n", np); in add_legacy_isa_port()
216 return -1; in add_legacy_isa_port()
220 return -1; in add_legacy_isa_port()
222 /* Now look for an "ibm,aix-loc" property that gives us ordering in add_legacy_isa_port()
225 typep = of_get_property(np, "ibm,aix-loc", NULL); in add_legacy_isa_port()
229 index = simple_strtol(typep+1, NULL, 0) - 1; in add_legacy_isa_port()
237 if (!of_device_is_compatible(isa_brg, "ibm,power8-lpc") || in add_legacy_isa_port()
258 int iotype, index = -1, lindex = 0; in add_legacy_pci_port()
260 DBG(" -> add_legacy_pci_port(%pOF)\n", np); in add_legacy_pci_port()
263 * encoded in the device-tree (that is have an fcode). Anything in add_legacy_pci_port()
269 if (of_get_property(np, "clock-frequency", NULL) == NULL) in add_legacy_pci_port()
270 return -1; in add_legacy_pci_port()
275 return -1; in add_legacy_pci_port()
281 return -1; in add_legacy_pci_port()
331 stride = 1 << port->regshift; in setup_legacy_serial_console()
334 if (info->taddr) { in setup_legacy_serial_console()
335 addr = ioremap(info->taddr, 0x1000); in setup_legacy_serial_console()
341 if (port->iotype == UPIO_PORT && isa_io_special) in setup_legacy_serial_console()
342 udbg_uart_init_pio(port->iobase, stride); in setup_legacy_serial_console()
348 if (info->speed == 0) in setup_legacy_serial_console()
349 info->speed = udbg_probe_uart_speed(info->clock); in setup_legacy_serial_console()
352 DBG("default console speed = %d\n", info->speed); in setup_legacy_serial_console()
353 udbg_uart_setup(info->speed, info->clock); in setup_legacy_serial_console()
359 * will try to build a list of all the available 8250-compatible serial ports
360 * in the machine using the Open Firmware device-tree. It currently only deals
363 * the machine non-PCI ports and to properly pick the default console port
367 struct device_node *np, *stdout = NULL; in find_legacy_serial_ports() local
368 const char *path; in find_legacy_serial_ports() local
371 DBG(" -> find_legacy_serial_port()\n"); in find_legacy_serial_ports()
374 path = of_get_property(of_chosen, "linux,stdout-path", NULL); in find_legacy_serial_ports()
375 if (path == NULL) in find_legacy_serial_ports()
376 path = of_get_property(of_chosen, "stdout-path", NULL); in find_legacy_serial_ports()
377 if (path != NULL) { in find_legacy_serial_ports()
378 stdout = of_find_node_by_path(path); in find_legacy_serial_ports()
379 if (stdout) in find_legacy_serial_ports()
380 DBG("stdout is %pOF\n", stdout); in find_legacy_serial_ports()
382 DBG(" no linux,stdout-path !\n"); in find_legacy_serial_ports()
393 if (index >= 0 && np == stdout) in find_legacy_serial_ports()
406 if (index >= 0 && np == stdout) in find_legacy_serial_ports()
440 if (index >= 0 && np == stdout) in find_legacy_serial_ports()
449 DBG(" <- find_legacy_serial_port()\n"); in find_legacy_serial_ports()
479 port->irq = virq; in fixup_port_irq()
483 port->handle_irq = fsl8250_handle_irq; in fixup_port_irq()
484 port->has_sysrq = IS_ENABLED(CONFIG_SERIAL_8250_CONSOLE); in fixup_port_irq()
500 unsigned long offset = (unsigned long)hose->io_base_virt - in fixup_port_pio()
506 DBG("port %d, IO %lx -> %lx\n", in fixup_port_pio()
507 index, port->iobase, port->iobase + offset); in fixup_port_pio()
508 port->iobase += offset; in fixup_port_pio()
519 port->membase = ioremap(port->mapbase, 0x100); in fixup_port_mmio()
540 return -ENODEV; in serial_dev_init()
552 if (!port->irq) in serial_dev_init()
554 if (port->iotype == UPIO_PORT) in serial_dev_init()
556 if ((port->iotype == UPIO_MEM) || (port->iotype == UPIO_TSI)) in serial_dev_init()
582 DBG(" -> check_legacy_serial_console()\n"); in check_legacy_serial_console()
587 return -EBUSY; in check_legacy_serial_console()
592 return -ENODEV; in check_legacy_serial_console()
597 return -ENODEV; in check_legacy_serial_console()
600 /* ... So use the full path instead */ in check_legacy_serial_console()
601 name = of_get_property(of_chosen, "linux,stdout-path", NULL); in check_legacy_serial_console()
603 name = of_get_property(of_chosen, "stdout-path", NULL); in check_legacy_serial_console()
605 DBG(" no stdout-path !\n"); in check_legacy_serial_console()
606 return -ENODEV; in check_legacy_serial_console()
610 DBG(" can't find stdout package %s !\n", name); in check_legacy_serial_console()
611 return -ENODEV; in check_legacy_serial_console()
613 DBG("stdout is %pOF\n", prom_stdout); in check_legacy_serial_console()
617 DBG(" stdout package has no name !\n"); in check_legacy_serial_console()
620 spd = of_get_property(prom_stdout, "current-speed", NULL); in check_legacy_serial_console()
652 return -ENODEV; in check_legacy_serial_console()