Exemple #1
0
int serial8250_find_port_for_earlycon(void)
{
	struct early_serial8250_device *device = &early_device;
	struct uart_port *port = &device->port;
	int line;
	int ret;

	if (!device->port.membase && !device->port.iobase)
		return -ENODEV;

	line = serial8250_find_port(port);
	if (line < 0)
		return -ENODEV;

	ret = update_console_cmdline("uart", 8250,
			     "ttyS", line, device->options);
	if (ret < 0)
		ret = update_console_cmdline("uart", 0,
				     "ttyS", line, device->options);

	return ret;
}
Exemple #2
0
int serial8250_find_port_for_earlycon(void)
{
	struct earlycon_device *device = early_device;
	struct uart_port *port = device ? &device->port : NULL;
	int line;
	int ret;

	if (!port || (!port->membase && !port->iobase))
		return -ENODEV;

	line = serial8250_find_port(port);
	if (line < 0)
		return -ENODEV;

	ret = update_console_cmdline("uart", 8250,
			     "ttyS", line, device->options);
	if (ret < 0)
		ret = update_console_cmdline("uart", 0,
				     "ttyS", line, device->options);

	return ret;
}
static int __init pnx_pc_detection_init(void)
{
	struct uart_port port;
	int baud = 115200;

	memset(&port, 0, sizeof(port));

	/* configure UART port to 115200n8 */
	port.iotype = UPIO_MEM;
	port.uartclk = BASE_BAUD;
	port.mapbase = UART1_BASE_ADDR;
	port.membase = (void __iomem*)UART1_BASE;
	port.regshift = 2;
	port.irq = IRQ_UART1;
	port.line = 0;

	/* enable UART IP clock*/
	serial8250_enable_clock(&port);

	early_serial_setup(&port);
	init_port(&port, baud);

	/* send request code and check synchronization byte */
	pnx_pctool_status = pnx_pctooldetect(&port);

	/* disable UART IP clock*/
	serial8250_disable_clock(&port);

	/* if pc tool detected disable console over uart */
	if(pnx_pctool_status != 0xFF)
	{
		pcdetect_serial8250_write(&port,&pnx_pctool_status, 1);
		update_console_cmdline("ttyS", 0, "tty", 0, NULL);

		// MJA patch 
		tatonuart=0;
	}
	return 0;
}