Paul Mundt | 96de1a8 | 2008-02-26 14:52:45 +0900 | [diff] [blame] | 1 | #ifndef __LINUX_SERIAL_SCI_H |
| 2 | #define __LINUX_SERIAL_SCI_H |
Paul Mundt | ecd9561 | 2006-09-27 17:32:30 +0900 | [diff] [blame] | 3 | |
Geert Uytterhoeven | d94a0a3 | 2015-04-30 18:21:29 +0200 | [diff] [blame] | 4 | #include <linux/bitops.h> |
Paul Mundt | ecd9561 | 2006-09-27 17:32:30 +0900 | [diff] [blame] | 5 | #include <linux/serial_core.h> |
Paul Mundt | 14baf9d | 2010-05-24 16:31:08 +0900 | [diff] [blame] | 6 | #include <linux/sh_dma.h> |
Paul Mundt | ecd9561 | 2006-09-27 17:32:30 +0900 | [diff] [blame] | 7 | |
| 8 | /* |
Guenter Roeck | 4b08478 | 2013-08-30 06:01:49 -0700 | [diff] [blame] | 9 | * Generic header for SuperH (H)SCI(F) (used by sh/sh64 and related parts) |
Paul Mundt | ecd9561 | 2006-09-27 17:32:30 +0900 | [diff] [blame] | 10 | */ |
| 11 | |
Paul Mundt | debf950 | 2011-06-08 18:19:37 +0900 | [diff] [blame] | 12 | #define SCIx_NOT_SUPPORTED (-1) |
| 13 | |
Geert Uytterhoeven | 26de4f1 | 2014-03-11 11:11:19 +0100 | [diff] [blame] | 14 | /* Serial Control Register (@ = not supported by all parts) */ |
Geert Uytterhoeven | d94a0a3 | 2015-04-30 18:21:29 +0200 | [diff] [blame] | 15 | #define SCSCR_TIE BIT(7) /* Transmit Interrupt Enable */ |
| 16 | #define SCSCR_RIE BIT(6) /* Receive Interrupt Enable */ |
| 17 | #define SCSCR_TE BIT(5) /* Transmit Enable */ |
| 18 | #define SCSCR_RE BIT(4) /* Receive Enable */ |
| 19 | #define SCSCR_REIE BIT(3) /* Receive Error Interrupt Enable @ */ |
| 20 | #define SCSCR_TOIE BIT(2) /* Timeout Interrupt Enable @ */ |
| 21 | #define SCSCR_CKE1 BIT(1) /* Clock Enable 1 */ |
| 22 | #define SCSCR_CKE0 BIT(0) /* Clock Enable 0 */ |
Geert Uytterhoeven | 26de4f1 | 2014-03-11 11:11:19 +0100 | [diff] [blame] | 23 | |
Ulrich Hecht | f303b36 | 2013-05-31 17:57:01 +0200 | [diff] [blame] | 24 | |
Paul Mundt | 61a6976 | 2011-06-14 12:40:19 +0900 | [diff] [blame] | 25 | enum { |
| 26 | SCIx_PROBE_REGTYPE, |
| 27 | |
| 28 | SCIx_SCI_REGTYPE, |
| 29 | SCIx_IRDA_REGTYPE, |
| 30 | SCIx_SCIFA_REGTYPE, |
| 31 | SCIx_SCIFB_REGTYPE, |
Phil Edworthy | 3af1f8a | 2011-10-03 15:16:47 +0100 | [diff] [blame] | 32 | SCIx_SH2_SCIF_FIFODATA_REGTYPE, |
Paul Mundt | 61a6976 | 2011-06-14 12:40:19 +0900 | [diff] [blame] | 33 | SCIx_SH3_SCIF_REGTYPE, |
| 34 | SCIx_SH4_SCIF_REGTYPE, |
Geert Uytterhoeven | b8bbd6b | 2015-11-12 13:36:06 +0100 | [diff] [blame] | 35 | SCIx_SH4_SCIF_BRG_REGTYPE, |
Paul Mundt | 61a6976 | 2011-06-14 12:40:19 +0900 | [diff] [blame] | 36 | SCIx_SH4_SCIF_NO_SCSPTR_REGTYPE, |
| 37 | SCIx_SH4_SCIF_FIFODATA_REGTYPE, |
| 38 | SCIx_SH7705_SCIF_REGTYPE, |
Ulrich Hecht | f303b36 | 2013-05-31 17:57:01 +0200 | [diff] [blame] | 39 | SCIx_HSCIF_REGTYPE, |
Paul Mundt | 61a6976 | 2011-06-14 12:40:19 +0900 | [diff] [blame] | 40 | |
| 41 | SCIx_NR_REGTYPES, |
| 42 | }; |
| 43 | |
Guennadi Liakhovetski | 73a19e4 | 2010-03-02 11:39:15 +0900 | [diff] [blame] | 44 | struct device; |
| 45 | |
Paul Mundt | 61a6976 | 2011-06-14 12:40:19 +0900 | [diff] [blame] | 46 | struct plat_sci_port_ops { |
| 47 | void (*init_pins)(struct uart_port *, unsigned int cflag); |
| 48 | }; |
| 49 | |
Paul Mundt | ecd9561 | 2006-09-27 17:32:30 +0900 | [diff] [blame] | 50 | /* |
Paul Mundt | faf02f8 | 2011-12-02 17:44:50 +0900 | [diff] [blame] | 51 | * Port-specific capabilities |
| 52 | */ |
Geert Uytterhoeven | d94a0a3 | 2015-04-30 18:21:29 +0200 | [diff] [blame] | 53 | #define SCIx_HAVE_RTSCTS BIT(0) |
Paul Mundt | faf02f8 | 2011-12-02 17:44:50 +0900 | [diff] [blame] | 54 | |
| 55 | /* |
Paul Mundt | ecd9561 | 2006-09-27 17:32:30 +0900 | [diff] [blame] | 56 | * Platform device specific platform_data struct |
| 57 | */ |
| 58 | struct plat_sci_port { |
Ulrich Hecht | f303b36 | 2013-05-31 17:57:01 +0200 | [diff] [blame] | 59 | unsigned int type; /* SCI / SCIF / IRDA / HSCIF */ |
Paul Mundt | ecd9561 | 2006-09-27 17:32:30 +0900 | [diff] [blame] | 60 | upf_t flags; /* UPF_* flags */ |
Paul Mundt | faf02f8 | 2011-12-02 17:44:50 +0900 | [diff] [blame] | 61 | unsigned long capabilities; /* Port features/capabilities */ |
Paul Mundt | 00b9de9 | 2009-06-24 17:53:33 +0900 | [diff] [blame] | 62 | |
Laurent Pinchart | ec09c5e | 2013-12-06 10:59:20 +0100 | [diff] [blame] | 63 | unsigned int sampling_rate; |
Paul Mundt | 00b9de9 | 2009-06-24 17:53:33 +0900 | [diff] [blame] | 64 | unsigned int scscr; /* SCSCR initialization */ |
Paul Mundt | f43dc23 | 2011-01-13 15:06:28 +0900 | [diff] [blame] | 65 | |
Paul Mundt | debf950 | 2011-06-08 18:19:37 +0900 | [diff] [blame] | 66 | /* |
| 67 | * Platform overrides if necessary, defaults otherwise. |
| 68 | */ |
Paul Mundt | 514820e | 2011-06-08 18:51:32 +0900 | [diff] [blame] | 69 | int port_reg; |
Paul Mundt | 61a6976 | 2011-06-14 12:40:19 +0900 | [diff] [blame] | 70 | unsigned char regshift; |
| 71 | unsigned char regtype; |
| 72 | |
| 73 | struct plat_sci_port_ops *ops; |
Paul Mundt | 514820e | 2011-06-08 18:51:32 +0900 | [diff] [blame] | 74 | |
Paul Mundt | 27bd107 | 2011-01-19 15:37:31 +0900 | [diff] [blame] | 75 | unsigned int dma_slave_tx; |
| 76 | unsigned int dma_slave_rx; |
Paul Mundt | ecd9561 | 2006-09-27 17:32:30 +0900 | [diff] [blame] | 77 | }; |
| 78 | |
Paul Mundt | 96de1a8 | 2008-02-26 14:52:45 +0900 | [diff] [blame] | 79 | #endif /* __LINUX_SERIAL_SCI_H */ |