Lines Matching +full:used +full:- +full:by +full:- +full:rtas
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()
181 /* if rtas uses this device, don't try to use it as well */ 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()
235 * port later by the serial driver 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()
266 * else can't be used that early and will be normally probed by 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
390 * console to be initialized, that list is also used later to provide 8250 with
391 * the machine non-PCI ports and to properly pick the default console port
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()
404 path = of_get_property(of_chosen, "stdout-path", NULL); in find_legacy_serial_ports()
410 DBG(" no linux,stdout-path !\n"); 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()
566 * registers all those platform ports for use by the 8250 driver when it
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()
607 * been probed earlier by find_legacy_serial_ports()
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()
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()
645 return -ENODEV; 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()