linux/drivers/tty/serial/liteuart.c

// SPDX-License-Identifier: GPL-2.0
/*
 * LiteUART serial controller (LiteX) Driver
 *
 * Copyright (C) 2019-2020 Antmicro <www.antmicro.com>
 */

#include <linux/bits.h>
#include <linux/console.h>
#include <linux/interrupt.h>
#include <linux/litex.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/serial.h>
#include <linux/serial_core.h>
#include <linux/slab.h>
#include <linux/timer.h>
#include <linux/tty_flip.h>
#include <linux/xarray.h>

/*
 * CSRs definitions (base address offsets + width)
 *
 * The definitions below are true for LiteX SoC configured for 8-bit CSR Bus,
 * 32-bit aligned.
 *
 * Supporting other configurations might require new definitions or a more
 * generic way of indexing the LiteX CSRs.
 *
 * For more details on how CSRs are defined and handled in LiteX, see comments
 * in the LiteX SoC Driver: drivers/soc/litex/litex_soc_ctrl.c
 */
#define OFF_RXTX
#define OFF_TXFULL
#define OFF_RXEMPTY
#define OFF_EV_STATUS
#define OFF_EV_PENDING
#define OFF_EV_ENABLE

/* events */
#define EV_TX
#define EV_RX

struct liteuart_port {};

#define to_liteuart_port(port)

static DEFINE_XARRAY_FLAGS(liteuart_array, XA_FLAGS_ALLOC);

#ifdef CONFIG_SERIAL_LITEUART_CONSOLE
static struct console liteuart_console;
#endif

static struct uart_driver liteuart_driver =;

static void liteuart_update_irq_reg(struct uart_port *port, bool set, u8 mask)
{}

static void liteuart_stop_tx(struct uart_port *port)
{}

static void liteuart_start_tx(struct uart_port *port)
{}

static void liteuart_stop_rx(struct uart_port *port)
{}

static void liteuart_rx_chars(struct uart_port *port)
{}

static void liteuart_tx_chars(struct uart_port *port)
{}

static irqreturn_t liteuart_interrupt(int irq, void *data)
{}

static void liteuart_timer(struct timer_list *t)
{}

static unsigned int liteuart_tx_empty(struct uart_port *port)
{}

static void liteuart_set_mctrl(struct uart_port *port, unsigned int mctrl)
{}

static unsigned int liteuart_get_mctrl(struct uart_port *port)
{}

static int liteuart_startup(struct uart_port *port)
{}

static void liteuart_shutdown(struct uart_port *port)
{}

static void liteuart_set_termios(struct uart_port *port, struct ktermios *new,
				 const struct ktermios *old)
{}

static const char *liteuart_type(struct uart_port *port)
{}

static void liteuart_config_port(struct uart_port *port, int flags)
{}

static int liteuart_verify_port(struct uart_port *port,
				struct serial_struct *ser)
{}

static const struct uart_ops liteuart_ops =;

static int liteuart_probe(struct platform_device *pdev)
{}

static void liteuart_remove(struct platform_device *pdev)
{}

static const struct of_device_id liteuart_of_match[] =;
MODULE_DEVICE_TABLE(of, liteuart_of_match);

static struct platform_driver liteuart_platform_driver =;

#ifdef CONFIG_SERIAL_LITEUART_CONSOLE

static void liteuart_putchar(struct uart_port *port, unsigned char ch)
{}

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

static int liteuart_console_setup(struct console *co, char *options)
{}

static struct console liteuart_console =;

static int __init liteuart_console_init(void)
{}
console_initcall(liteuart_console_init);

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

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

OF_EARLYCON_DECLARE();
#endif /* CONFIG_SERIAL_LITEUART_CONSOLE */

static int __init liteuart_init(void)
{}

static void __exit liteuart_exit(void)
{}

module_init();
module_exit(liteuart_exit);

MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();
MODULE_ALIAS();