blob: 1c89611e0e0634aec1f64c62d99637f4ee709bc0 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Paul Mundt96de1a82008-02-26 14:52:45 +09002#ifndef __LINUX_SERIAL_SCI_H
3#define __LINUX_SERIAL_SCI_H
Paul Mundtecd95612006-09-27 17:32:30 +09004
Geert Uytterhoevend94a0a32015-04-30 18:21:29 +02005#include <linux/bitops.h>
Paul Mundtecd95612006-09-27 17:32:30 +09006#include <linux/serial_core.h>
Paul Mundt14baf9d2010-05-24 16:31:08 +09007#include <linux/sh_dma.h>
Paul Mundtecd95612006-09-27 17:32:30 +09008
9/*
Guenter Roeck4b084782013-08-30 06:01:49 -070010 * Generic header for SuperH (H)SCI(F) (used by sh/sh64 and related parts)
Paul Mundtecd95612006-09-27 17:32:30 +090011 */
12
Geert Uytterhoeven26de4f12014-03-11 11:11:19 +010013/* Serial Control Register (@ = not supported by all parts) */
Geert Uytterhoevend94a0a32015-04-30 18:21:29 +020014#define SCSCR_TIE BIT(7) /* Transmit Interrupt Enable */
15#define SCSCR_RIE BIT(6) /* Receive Interrupt Enable */
16#define SCSCR_TE BIT(5) /* Transmit Enable */
17#define SCSCR_RE BIT(4) /* Receive Enable */
18#define SCSCR_REIE BIT(3) /* Receive Error Interrupt Enable @ */
19#define SCSCR_TOIE BIT(2) /* Timeout Interrupt Enable @ */
20#define SCSCR_CKE1 BIT(1) /* Clock Enable 1 */
21#define SCSCR_CKE0 BIT(0) /* Clock Enable 0 */
Geert Uytterhoeven26de4f12014-03-11 11:11:19 +010022
Ulrich Hechtf303b362013-05-31 17:57:01 +020023
Paul Mundt61a69762011-06-14 12:40:19 +090024enum {
25 SCIx_PROBE_REGTYPE,
26
27 SCIx_SCI_REGTYPE,
28 SCIx_IRDA_REGTYPE,
29 SCIx_SCIFA_REGTYPE,
30 SCIx_SCIFB_REGTYPE,
Phil Edworthy3af1f8a2011-10-03 15:16:47 +010031 SCIx_SH2_SCIF_FIFODATA_REGTYPE,
Paul Mundt61a69762011-06-14 12:40:19 +090032 SCIx_SH3_SCIF_REGTYPE,
33 SCIx_SH4_SCIF_REGTYPE,
Geert Uytterhoevenb8bbd6b2015-11-12 13:36:06 +010034 SCIx_SH4_SCIF_BRG_REGTYPE,
Paul Mundt61a69762011-06-14 12:40:19 +090035 SCIx_SH4_SCIF_NO_SCSPTR_REGTYPE,
36 SCIx_SH4_SCIF_FIFODATA_REGTYPE,
37 SCIx_SH7705_SCIF_REGTYPE,
Ulrich Hechtf303b362013-05-31 17:57:01 +020038 SCIx_HSCIF_REGTYPE,
Geert Uytterhoeven10653022018-08-30 14:54:03 +020039 SCIx_RZ_SCIFA_REGTYPE,
Paul Mundt61a69762011-06-14 12:40:19 +090040
41 SCIx_NR_REGTYPES,
42};
43
Paul Mundt61a69762011-06-14 12:40:19 +090044struct plat_sci_port_ops {
45 void (*init_pins)(struct uart_port *, unsigned int cflag);
46};
47
Paul Mundtecd95612006-09-27 17:32:30 +090048/*
49 * Platform device specific platform_data struct
50 */
51struct plat_sci_port {
Ulrich Hechtf303b362013-05-31 17:57:01 +020052 unsigned int type; /* SCI / SCIF / IRDA / HSCIF */
Paul Mundtecd95612006-09-27 17:32:30 +090053 upf_t flags; /* UPF_* flags */
Paul Mundt00b9de92009-06-24 17:53:33 +090054
Laurent Pinchartec09c5e2013-12-06 10:59:20 +010055 unsigned int sampling_rate;
Paul Mundt00b9de92009-06-24 17:53:33 +090056 unsigned int scscr; /* SCSCR initialization */
Paul Mundtf43dc232011-01-13 15:06:28 +090057
Paul Mundtdebf9502011-06-08 18:19:37 +090058 /*
59 * Platform overrides if necessary, defaults otherwise.
60 */
Paul Mundt61a69762011-06-14 12:40:19 +090061 unsigned char regtype;
62
63 struct plat_sci_port_ops *ops;
Paul Mundtecd95612006-09-27 17:32:30 +090064};
65
Paul Mundt96de1a82008-02-26 14:52:45 +090066#endif /* __LINUX_SERIAL_SCI_H */