linux/drivers/tty/serial/sh-sci.h

/* SPDX-License-Identifier: GPL-2.0 */
#include <linux/bitops.h>
#include <linux/serial_core.h>
#include <linux/io.h>

#define SCI_MAJOR
#define SCI_MINOR_START


/*
 * SCI register subset common for all port types.
 * Not all registers will exist on all parts.
 */
enum {};


/* SCSMR (Serial Mode Register) */
#define SCSMR_C_A
#define SCSMR_CSYNC
#define SCSMR_ASYNC
#define SCSMR_CHR
#define SCSMR_PE
#define SCSMR_ODD
#define SCSMR_STOP
#define SCSMR_CKS

/* Serial Mode Register, SCIFA/SCIFB only bits */
#define SCSMR_CKEDG
#define SCSMR_SRC_MASK
#define SCSMR_SRC_16
#define SCSMR_SRC_5
#define SCSMR_SRC_7
#define SCSMR_SRC_11
#define SCSMR_SRC_13
#define SCSMR_SRC_17
#define SCSMR_SRC_19
#define SCSMR_SRC_27

/* Serial Control Register, SCI only bits */
#define SCSCR_TEIE

/* Serial Control Register, SCIFA/SCIFB only bits */
#define SCSCR_TDRQE
#define SCSCR_RDRQE

/* Serial Control Register, HSCIF-only bits */
#define HSSCR_TOT_SHIFT

/* SCxSR (Serial Status Register) on SCI */
#define SCI_TDRE
#define SCI_RDRF
#define SCI_ORER
#define SCI_FER
#define SCI_PER
#define SCI_TEND
#define SCI_RESERVED

#define SCI_DEFAULT_ERROR_MASK

#define SCI_RDxF_CLEAR
#define SCI_ERROR_CLEAR
#define SCI_TDxE_CLEAR
#define SCI_BREAK_CLEAR

/* SCxSR (Serial Status Register) on SCIF, SCIFA, SCIFB, HSCIF */
#define SCIF_ER
#define SCIF_TEND
#define SCIF_TDFE
#define SCIF_BRK
#define SCIF_FER
#define SCIF_PER
#define SCIF_RDF
#define SCIF_DR
/* SCIF only (optional) */
#define SCIF_PERC
#define SCIF_FERC
/*SCIFA/SCIFB and SCIF on SH7705/SH7720/SH7721 only */
#define SCIFA_ORER

#define SCIF_DEFAULT_ERROR_MASK

#define SCIF_RDxF_CLEAR
#define SCIF_ERROR_CLEAR
#define SCIF_TDxE_CLEAR
#define SCIF_BREAK_CLEAR

/* SCFCR (FIFO Control Register) */
#define SCFCR_RTRG1
#define SCFCR_RTRG0
#define SCFCR_TTRG1
#define SCFCR_TTRG0
#define SCFCR_MCE
#define SCFCR_TFRST
#define SCFCR_RFRST
#define SCFCR_LOOP

/* SCLSR (Line Status Register) on (H)SCIF */
#define SCLSR_TO
#define SCLSR_ORER

/* SCSPTR (Serial Port Register), optional */
#define SCSPTR_RTSIO
#define SCSPTR_RTSDT
#define SCSPTR_CTSIO
#define SCSPTR_CTSDT
#define SCSPTR_SCKIO
#define SCSPTR_SCKDT
#define SCSPTR_SPB2IO
#define SCSPTR_SPB2DT

/* HSSRR HSCIF */
#define HSCIF_SRE
#define HSCIF_SRDE

#define HSCIF_SRHP_SHIFT
#define HSCIF_SRHP_MASK

/* SCPCR (Serial Port Control Register), SCIFA/SCIFB only */
#define SCPCR_RTSC
#define SCPCR_CTSC
#define SCPCR_SCKC
#define SCPCR_RXDC
#define SCPCR_TXDC

/* SCPDR (Serial Port Data Register), SCIFA/SCIFB only */
#define SCPDR_RTSD
#define SCPDR_CTSD
#define SCPDR_SCKD
#define SCPDR_RXDD
#define SCPDR_TXDD

/*
 * BRG Clock Select Register (Some SCIF and HSCIF)
 * The Baud Rate Generator for external clock can provide a clock source for
 * the sampling clock. It outputs either its frequency divided clock, or the
 * (undivided) (H)SCK external clock.
 */
#define SCCKS_CKS
#define SCCKS_XIN

#define SCxSR_TEND(port)
#define SCxSR_RDxF(port)
#define SCxSR_TDxE(port)
#define SCxSR_FER(port)
#define SCxSR_PER(port)
#define SCxSR_BRK(port)

#define SCxSR_ERRORS(port)

#define SCxSR_RDxF_CLEAR(port)
#define SCxSR_ERROR_CLEAR(port)
#define SCxSR_TDxE_CLEAR(port)
#define SCxSR_BREAK_CLEAR(port)