linux/drivers/tty/serial/8250/8250_early.c

// SPDX-License-Identifier: GPL-2.0
/*
 * Early serial console for 8250/16550 devices
 *
 * (c) Copyright 2004 Hewlett-Packard Development Company, L.P.
 *	Bjorn Helgaas <[email protected]>
 *
 * Based on the 8250.c serial driver, Copyright (C) 2001 Russell King,
 * and on early_printk.c by Andi Kleen.
 *
 * This is for use before the serial driver has initialized, in
 * particular, before the UARTs have been discovered and named.
 * Instead of specifying the console device as, e.g., "ttyS0",
 * we locate the device directly by its MMIO or I/O port address.
 *
 * The user can specify the device directly, e.g.,
 *	earlycon=uart8250,io,0x3f8,9600n8
 *	earlycon=uart8250,mmio,0xff5e0000,115200n8
 *	earlycon=uart8250,mmio32,0xff5e0000,115200n8
 * or
 *	console=uart8250,io,0x3f8,9600n8
 *	console=uart8250,mmio,0xff5e0000,115200n8
 *	console=uart8250,mmio32,0xff5e0000,115200n8
 */

#include <linux/tty.h>
#include <linux/init.h>
#include <linux/console.h>
#include <linux/of.h>
#include <linux/serial_reg.h>
#include <linux/serial.h>
#include <linux/serial_8250.h>
#include <asm/io.h>
#include <asm/serial.h>

static unsigned int serial8250_early_in(struct uart_port *port, int offset)
{}

static void serial8250_early_out(struct uart_port *port, int offset, int value)
{}

static void serial_putc(struct uart_port *port, unsigned char c)
{}

static void early_serial8250_write(struct console *console,
					const char *s, unsigned int count)
{}

#ifdef CONFIG_CONSOLE_POLL
static int early_serial8250_read(struct console *console,
				 char *s, unsigned int count)
{}
#else
#define early_serial8250_read
#endif

static void __init init_port(struct earlycon_device *device)
{}

int __init early_serial8250_setup(struct earlycon_device *device,
					 const char *options)
{}
EARLYCON_DECLARE();
EARLYCON_DECLARE();
OF_EARLYCON_DECLARE();
OF_EARLYCON_DECLARE();
OF_EARLYCON_DECLARE();
OF_EARLYCON_DECLARE();

static int __init early_serial8250_rs2_setup(struct earlycon_device *device,
					     const char *options)
{}
OF_EARLYCON_DECLARE();
OF_EARLYCON_DECLARE();
OF_EARLYCON_DECLARE();

#ifdef CONFIG_SERIAL_8250_OMAP

static int __init early_omap8250_setup(struct earlycon_device *device,
				       const char *options)
{}

OF_EARLYCON_DECLARE();
OF_EARLYCON_DECLARE();
OF_EARLYCON_DECLARE();
OF_EARLYCON_DECLARE();

#endif