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 | |
| 4 | #include <linux/serial_core.h> |
| 5 | |
| 6 | /* |
Paul Mundt | 96de1a8 | 2008-02-26 14:52:45 +0900 | [diff] [blame] | 7 | * Generic header for SuperH SCI(F) (used by sh/sh64/h8300 and related parts) |
Paul Mundt | ecd9561 | 2006-09-27 17:32:30 +0900 | [diff] [blame] | 8 | */ |
| 9 | |
Paul Mundt | 26c92f3 | 2009-06-24 18:23:52 +0900 | [diff] [blame^] | 10 | enum { |
| 11 | SCBRR_ALGO_1, /* ((clk + 16 * bps) / (16 * bps) - 1) */ |
| 12 | SCBRR_ALGO_2, /* ((clk + 16 * bps) / (32 * bps) - 1) */ |
| 13 | SCBRR_ALGO_3, /* (((clk * 2) + 16 * bps) / (16 * bps) - 1) */ |
| 14 | SCBRR_ALGO_4, /* (((clk * 2) + 16 * bps) / (32 * bps) - 1) */ |
| 15 | SCBRR_ALGO_5, /* (((clk * 1000 / 32) / bps) - 1) */ |
| 16 | }; |
| 17 | |
Paul Mundt | 00b9de9 | 2009-06-24 17:53:33 +0900 | [diff] [blame] | 18 | #define SCSCR_TIE (1 << 7) |
| 19 | #define SCSCR_RIE (1 << 6) |
| 20 | #define SCSCR_TE (1 << 5) |
| 21 | #define SCSCR_RE (1 << 4) |
| 22 | #define SCSCR_REIE (1 << 3) |
| 23 | #define SCSCR_TOIE (1 << 2) /* not supported by all parts */ |
| 24 | #define SCSCR_CKE1 (1 << 1) |
| 25 | #define SCSCR_CKE0 (1 << 0) |
| 26 | |
Paul Mundt | ecd9561 | 2006-09-27 17:32:30 +0900 | [diff] [blame] | 27 | /* Offsets into the sci_port->irqs array */ |
| 28 | enum { |
| 29 | SCIx_ERI_IRQ, |
| 30 | SCIx_RXI_IRQ, |
| 31 | SCIx_TXI_IRQ, |
| 32 | SCIx_BRI_IRQ, |
| 33 | SCIx_NR_IRQS, |
| 34 | }; |
| 35 | |
| 36 | /* |
| 37 | * Platform device specific platform_data struct |
| 38 | */ |
| 39 | struct plat_sci_port { |
| 40 | void __iomem *membase; /* io cookie */ |
| 41 | unsigned long mapbase; /* resource base */ |
| 42 | unsigned int irqs[SCIx_NR_IRQS]; /* ERI, RXI, TXI, BRI */ |
| 43 | unsigned int type; /* SCI / SCIF / IRDA */ |
| 44 | upf_t flags; /* UPF_* flags */ |
Magnus Damm | 501b825 | 2009-01-21 15:14:30 +0000 | [diff] [blame] | 45 | char *clk; /* clock string */ |
Paul Mundt | 00b9de9 | 2009-06-24 17:53:33 +0900 | [diff] [blame] | 46 | |
Paul Mundt | 26c92f3 | 2009-06-24 18:23:52 +0900 | [diff] [blame^] | 47 | unsigned int scbrr_algo_id; /* SCBRR calculation algo */ |
Paul Mundt | 00b9de9 | 2009-06-24 17:53:33 +0900 | [diff] [blame] | 48 | unsigned int scscr; /* SCSCR initialization */ |
Paul Mundt | ecd9561 | 2006-09-27 17:32:30 +0900 | [diff] [blame] | 49 | }; |
| 50 | |
Paul Mundt | 96de1a8 | 2008-02-26 14:52:45 +0900 | [diff] [blame] | 51 | #endif /* __LINUX_SERIAL_SCI_H */ |