xref: /openbmc/linux/include/linux/serial_sci.h (revision 3eb66e91a25497065c5322b1268cbc3953642227)
1b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */
296de1a8fSPaul Mundt #ifndef __LINUX_SERIAL_SCI_H
396de1a8fSPaul Mundt #define __LINUX_SERIAL_SCI_H
496de1a8fSPaul Mundt 
5d94a0a38SGeert Uytterhoeven #include <linux/bitops.h>
696de1a8fSPaul Mundt #include <linux/serial_core.h>
714baf9d7SPaul Mundt #include <linux/sh_dma.h>
896de1a8fSPaul Mundt 
996de1a8fSPaul Mundt /*
104b084784SGuenter Roeck  * Generic header for SuperH (H)SCI(F) (used by sh/sh64 and related parts)
1196de1a8fSPaul Mundt  */
1296de1a8fSPaul Mundt 
1326de4f1bSGeert Uytterhoeven /* Serial Control Register (@ = not supported by all parts) */
14d94a0a38SGeert Uytterhoeven #define SCSCR_TIE	BIT(7)	/* Transmit Interrupt Enable */
15d94a0a38SGeert Uytterhoeven #define SCSCR_RIE	BIT(6)	/* Receive Interrupt Enable */
16d94a0a38SGeert Uytterhoeven #define SCSCR_TE	BIT(5)	/* Transmit Enable */
17d94a0a38SGeert Uytterhoeven #define SCSCR_RE	BIT(4)	/* Receive Enable */
18d94a0a38SGeert Uytterhoeven #define SCSCR_REIE	BIT(3)	/* Receive Error Interrupt Enable @ */
19d94a0a38SGeert Uytterhoeven #define SCSCR_TOIE	BIT(2)	/* Timeout Interrupt Enable @ */
20d94a0a38SGeert Uytterhoeven #define SCSCR_CKE1	BIT(1)	/* Clock Enable 1 */
21d94a0a38SGeert Uytterhoeven #define SCSCR_CKE0	BIT(0)	/* Clock Enable 0 */
2226de4f1bSGeert Uytterhoeven 
23f303b364SUlrich Hecht 
2461a6976bSPaul Mundt enum {
2561a6976bSPaul Mundt 	SCIx_PROBE_REGTYPE,
2661a6976bSPaul Mundt 
2761a6976bSPaul Mundt 	SCIx_SCI_REGTYPE,
2861a6976bSPaul Mundt 	SCIx_IRDA_REGTYPE,
2961a6976bSPaul Mundt 	SCIx_SCIFA_REGTYPE,
3061a6976bSPaul Mundt 	SCIx_SCIFB_REGTYPE,
313af1f8a4SPhil Edworthy 	SCIx_SH2_SCIF_FIFODATA_REGTYPE,
3261a6976bSPaul Mundt 	SCIx_SH3_SCIF_REGTYPE,
3361a6976bSPaul Mundt 	SCIx_SH4_SCIF_REGTYPE,
34b8bbd6b2SGeert Uytterhoeven 	SCIx_SH4_SCIF_BRG_REGTYPE,
3561a6976bSPaul Mundt 	SCIx_SH4_SCIF_NO_SCSPTR_REGTYPE,
3661a6976bSPaul Mundt 	SCIx_SH4_SCIF_FIFODATA_REGTYPE,
3761a6976bSPaul Mundt 	SCIx_SH7705_SCIF_REGTYPE,
38f303b364SUlrich Hecht 	SCIx_HSCIF_REGTYPE,
39*10653022SGeert Uytterhoeven 	SCIx_RZ_SCIFA_REGTYPE,
4061a6976bSPaul Mundt 
4161a6976bSPaul Mundt 	SCIx_NR_REGTYPES,
4261a6976bSPaul Mundt };
4361a6976bSPaul Mundt 
4461a6976bSPaul Mundt struct plat_sci_port_ops {
4561a6976bSPaul Mundt 	void (*init_pins)(struct uart_port *, unsigned int cflag);
4661a6976bSPaul Mundt };
4761a6976bSPaul Mundt 
4896de1a8fSPaul Mundt /*
4996de1a8fSPaul Mundt  * Platform device specific platform_data struct
5096de1a8fSPaul Mundt  */
5196de1a8fSPaul Mundt struct plat_sci_port {
52f303b364SUlrich Hecht 	unsigned int	type;			/* SCI / SCIF / IRDA / HSCIF */
5396de1a8fSPaul Mundt 	upf_t		flags;			/* UPF_* flags */
5400b9de9cSPaul Mundt 
55ec09c5ebSLaurent Pinchart 	unsigned int	sampling_rate;
5600b9de9cSPaul Mundt 	unsigned int	scscr;			/* SCSCR initialization */
57f43dc23dSPaul Mundt 
58debf9507SPaul Mundt 	/*
59debf9507SPaul Mundt 	 * Platform overrides if necessary, defaults otherwise.
60debf9507SPaul Mundt 	 */
6161a6976bSPaul Mundt 	unsigned char	regtype;
6261a6976bSPaul Mundt 
6361a6976bSPaul Mundt 	struct plat_sci_port_ops	*ops;
6496de1a8fSPaul Mundt };
6596de1a8fSPaul Mundt 
6696de1a8fSPaul Mundt #endif /* __LINUX_SERIAL_SCI_H */
67