serial_sci.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #ifndef __LINUX_SERIAL_SCI_H
  2. #define __LINUX_SERIAL_SCI_H
  3. #include <linux/serial_core.h>
  4. /*
  5. * Generic header for SuperH SCI(F) (used by sh/sh64/h8300 and related parts)
  6. */
  7. enum {
  8. SCBRR_ALGO_1, /* ((clk + 16 * bps) / (16 * bps) - 1) */
  9. SCBRR_ALGO_2, /* ((clk + 16 * bps) / (32 * bps) - 1) */
  10. SCBRR_ALGO_3, /* (((clk * 2) + 16 * bps) / (16 * bps) - 1) */
  11. SCBRR_ALGO_4, /* (((clk * 2) + 16 * bps) / (32 * bps) - 1) */
  12. SCBRR_ALGO_5, /* (((clk * 1000 / 32) / bps) - 1) */
  13. };
  14. #define SCSCR_TIE (1 << 7)
  15. #define SCSCR_RIE (1 << 6)
  16. #define SCSCR_TE (1 << 5)
  17. #define SCSCR_RE (1 << 4)
  18. #define SCSCR_REIE (1 << 3)
  19. #define SCSCR_TOIE (1 << 2) /* not supported by all parts */
  20. #define SCSCR_CKE1 (1 << 1)
  21. #define SCSCR_CKE0 (1 << 0)
  22. /* Offsets into the sci_port->irqs array */
  23. enum {
  24. SCIx_ERI_IRQ,
  25. SCIx_RXI_IRQ,
  26. SCIx_TXI_IRQ,
  27. SCIx_BRI_IRQ,
  28. SCIx_NR_IRQS,
  29. };
  30. /*
  31. * Platform device specific platform_data struct
  32. */
  33. struct plat_sci_port {
  34. void __iomem *membase; /* io cookie */
  35. unsigned long mapbase; /* resource base */
  36. unsigned int irqs[SCIx_NR_IRQS]; /* ERI, RXI, TXI, BRI */
  37. unsigned int type; /* SCI / SCIF / IRDA */
  38. upf_t flags; /* UPF_* flags */
  39. char *clk; /* clock string */
  40. unsigned int scbrr_algo_id; /* SCBRR calculation algo */
  41. unsigned int scscr; /* SCSCR initialization */
  42. };
  43. #endif /* __LINUX_SERIAL_SCI_H */