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

// SPDX-License-Identifier: GPL-2.0+
/*
 * Synopsys DesignWare 8250 driver.
 *
 * Copyright 2011 Picochip, Jamie Iles.
 * Copyright 2013 Intel Corporation
 *
 * The Synopsys DesignWare 8250 has an extra feature whereby it detects if the
 * LCR is written whilst busy.  If it is, then a busy detect interrupt is
 * raised, the LCR needs to be rewritten and the uart status register read.
 */
#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/device.h>
#include <linux/io.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/notifier.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <linux/property.h>
#include <linux/reset.h>
#include <linux/slab.h>
#include <linux/workqueue.h>

#include <asm/byteorder.h>

#include <linux/serial_8250.h>
#include <linux/serial_reg.h>

#include "8250_dwlib.h"

/* Offsets for the DesignWare specific registers */
#define DW_UART_USR
#define DW_UART_DMASA

#define OCTEON_UART_USR

#define RZN1_UART_TDMACR
#define RZN1_UART_RDMACR

/* DesignWare specific register fields */
#define DW_UART_MCR_SIRE

/* Renesas specific register fields */
#define RZN1_UART_xDMACR_DMA_EN
#define RZN1_UART_xDMACR_1_WORD_BURST
#define RZN1_UART_xDMACR_4_WORD_BURST
#define RZN1_UART_xDMACR_8_WORD_BURST
#define RZN1_UART_xDMACR_BLK_SZ(x)

/* Quirks */
#define DW_UART_QUIRK_OCTEON
#define DW_UART_QUIRK_ARMADA_38X
#define DW_UART_QUIRK_SKIP_SET_RATE
#define DW_UART_QUIRK_IS_DMA_FC
#define DW_UART_QUIRK_APMC0D08
#define DW_UART_QUIRK_CPR_VALUE

struct dw8250_platform_data {};

struct dw8250_data {};

static inline struct dw8250_data *to_dw8250_data(struct dw8250_port_data *data)
{}

static inline struct dw8250_data *clk_to_dw8250_data(struct notifier_block *nb)
{}

static inline struct dw8250_data *work_to_dw8250_data(struct work_struct *work)
{}

static inline int dw8250_modify_msr(struct uart_port *p, int offset, int value)
{}

static void dw8250_force_idle(struct uart_port *p)
{}

static void dw8250_check_lcr(struct uart_port *p, int offset, int value)
{}

/* Returns once the transmitter is empty or we run out of retries */
static void dw8250_tx_wait_empty(struct uart_port *p)
{}

static void dw8250_serial_out(struct uart_port *p, int offset, int value)
{}

static void dw8250_serial_out38x(struct uart_port *p, int offset, int value)
{}

static unsigned int dw8250_serial_in(struct uart_port *p, int offset)
{}

#ifdef CONFIG_64BIT
static unsigned int dw8250_serial_inq(struct uart_port *p, int offset)
{}

static void dw8250_serial_outq(struct uart_port *p, int offset, int value)
{}
#endif /* CONFIG_64BIT */

static void dw8250_serial_out32(struct uart_port *p, int offset, int value)
{}

static unsigned int dw8250_serial_in32(struct uart_port *p, int offset)
{}

static void dw8250_serial_out32be(struct uart_port *p, int offset, int value)
{}

static unsigned int dw8250_serial_in32be(struct uart_port *p, int offset)
{}


static int dw8250_handle_irq(struct uart_port *p)
{}

static void dw8250_clk_work_cb(struct work_struct *work)
{}

static int dw8250_clk_notifier_cb(struct notifier_block *nb,
				  unsigned long event, void *data)
{}

static void
dw8250_do_pm(struct uart_port *port, unsigned int state, unsigned int old)
{}

static void dw8250_set_termios(struct uart_port *p, struct ktermios *termios,
			       const struct ktermios *old)
{}

static void dw8250_set_ldisc(struct uart_port *p, struct ktermios *termios)
{}

/*
 * dw8250_fallback_dma_filter will prevent the UART from getting just any free
 * channel on platforms that have DMA engines, but don't have any channels
 * assigned to the UART.
 *
 * REVISIT: This is a work around for limitation in the DMA Engine API. Once the
 * core problem is fixed, this function is no longer needed.
 */
static bool dw8250_fallback_dma_filter(struct dma_chan *chan, void *param)
{}

static bool dw8250_idma_filter(struct dma_chan *chan, void *param)
{}

static u32 dw8250_rzn1_get_dmacr_burst(int max_burst)
{}

static void dw8250_prepare_tx_dma(struct uart_8250_port *p)
{}

static void dw8250_prepare_rx_dma(struct uart_8250_port *p)
{}

static void dw8250_quirks(struct uart_port *p, struct dw8250_data *data)
{}

static void dw8250_reset_control_assert(void *data)
{}

static int dw8250_probe(struct platform_device *pdev)
{}

static void dw8250_remove(struct platform_device *pdev)
{}

static int dw8250_suspend(struct device *dev)
{}

static int dw8250_resume(struct device *dev)
{}

static int dw8250_runtime_suspend(struct device *dev)
{}

static int dw8250_runtime_resume(struct device *dev)
{}

static const struct dev_pm_ops dw8250_pm_ops =;

static const struct dw8250_platform_data dw8250_dw_apb =;

static const struct dw8250_platform_data dw8250_octeon_3860_data =;

static const struct dw8250_platform_data dw8250_armada_38x_data =;

static const struct dw8250_platform_data dw8250_renesas_rzn1_data =;

static const struct dw8250_platform_data dw8250_starfive_jh7100_data =;

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

static const struct dw8250_platform_data dw8250_apmc0d08 =;

static const struct acpi_device_id dw8250_acpi_match[] =;
MODULE_DEVICE_TABLE(acpi, dw8250_acpi_match);

static struct platform_driver dw8250_platform_driver =;

module_platform_driver();

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