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

// SPDX-License-Identifier: GPL-2.0+
/*
 * Copyright (C) 2015 Masahiro Yamada <[email protected]>
 */

#include <linux/clk.h>
#include <linux/console.h>
#include <linux/io.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>

#include "8250.h"

/*
 * This hardware is similar to 8250, but its register map is a bit different:
 *   - MMIO32 (regshift = 2)
 *   - FCR is not at 2, but 3
 *   - LCR and MCR are not at 3 and 4, they share 4
 *   - No SCR (Instead, CHAR can be used as a scratch register)
 *   - Divisor latch at 9, no divisor latch access bit
 */

#define UNIPHIER_UART_REGSHIFT

/* bit[15:8] = CHAR, bit[7:0] = FCR */
#define UNIPHIER_UART_CHAR_FCR
/* bit[15:8] = LCR, bit[7:0] = MCR */
#define UNIPHIER_UART_LCR_MCR
/* Divisor Latch Register */
#define UNIPHIER_UART_DLR

struct uniphier8250_priv {};

#ifdef CONFIG_SERIAL_8250_CONSOLE
static int __init uniphier_early_console_setup(struct earlycon_device *device,
					       const char *options)
{}
OF_EARLYCON_DECLARE();
#endif

/*
 * The register map is slightly different from that of 8250.
 * IO callbacks must be overridden for correct access to FCR, LCR, MCR and SCR.
 */
static unsigned int uniphier_serial_in(struct uart_port *p, int offset)
{}

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

/*
 * This hardware does not have the divisor latch access bit.
 * The divisor latch register exists at different address.
 * Override dl_read/write callbacks.
 */
static u32 uniphier_serial_dl_read(struct uart_8250_port *up)
{}

static void uniphier_serial_dl_write(struct uart_8250_port *up, u32 value)
{}

static int uniphier_uart_probe(struct platform_device *pdev)
{}

static void uniphier_uart_remove(struct platform_device *pdev)
{}

static int __maybe_unused uniphier_uart_suspend(struct device *dev)
{}

static int __maybe_unused uniphier_uart_resume(struct device *dev)
{}

static const struct dev_pm_ops uniphier_uart_pm_ops =;

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

static struct platform_driver uniphier_uart_platform_driver =;
module_platform_driver();

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