示例#1
0
int __init setup_early_serial8250_console(char *cmdline)
{
	char *options;
	int err;

	options = strstr(cmdline, "uart8250,");
	if (!options) {
		options = strstr(cmdline, "uart,");
		if (!options)
			return 0;
	}

	options = strchr(cmdline, ',') + 1;
	err = early_serial8250_setup(options);
	if (err < 0)
		return err;

	register_console(&early_serial8250_console);

#ifdef	CONFIG_KDB
	/*
	 * Remember the line number of the first serial
	 * console.  We'll make this the kdb serial console too.
	 */
	if (kdb_serial_line == -1) {
		kdb_serial_line = early_serial8250_console.index;
		kdb_serial.io_type = early_device.port.iotype;
		switch (early_device.port.iotype) {
		case SERIAL_IO_MEM:
#ifdef  SERIAL_IO_MEM32
		case SERIAL_IO_MEM32:
#endif
			kdb_serial.iobase = (unsigned long)(early_device.port.membase);
			kdb_serial.ioreg_shift = early_device.port.regshift;
			break;
		default:
			kdb_serial.iobase = early_device.port.iobase;
			kdb_serial.ioreg_shift = 0;
			break;
		}
	}
#endif	/* CONFIG_KDB */

	return 0;
}
示例#2
0
static int __init uniphier_early_console_setup(struct earlycon_device *device,
					       const char *options)
{
	if (!device->port.membase)
		return -ENODEV;

	/* This hardware always expects MMIO32 register interface. */
	device->port.iotype = UPIO_MEM32;
	device->port.regshift = 2;

	/*
	 * Do not touch the divisor register in early_serial8250_setup();
	 * we assume it has been initialized by a boot loader.
	 */
	device->baud = 0;

	return early_serial8250_setup(device, options);
}
示例#3
0
int __init setup_early_serial8250_console(char *cmdline)
{
	char *options;
	int err;

	options = strstr(cmdline, "uart8250,");
	if (!options) {
		options = strstr(cmdline, "uart,");
		if (!options)
			return 0;
	}

	options = strchr(cmdline, ',') + 1;
	if ((err = early_serial8250_setup(options)) < 0)
		return err;

	register_console(&early_serial8250_console);

	return 0;
}