serial_sci.h 1.6 KB

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