8250.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /*
  2. * linux/drivers/char/8250.h
  3. *
  4. * Driver for 8250/16550-type serial ports
  5. *
  6. * Based on drivers/char/serial.c, by Linus Torvalds, Theodore Ts'o.
  7. *
  8. * Copyright (C) 2001 Russell King.
  9. *
  10. * This program is free software; you can redistribute it and/or modify
  11. * it under the terms of the GNU General Public License as published by
  12. * the Free Software Foundation; either version 2 of the License, or
  13. * (at your option) any later version.
  14. */
  15. #include <linux/serial_8250.h>
  16. struct old_serial_port {
  17. unsigned int uart;
  18. unsigned int baud_base;
  19. unsigned int port;
  20. unsigned int irq;
  21. unsigned int flags;
  22. unsigned char hub6;
  23. unsigned char io_type;
  24. unsigned char *iomem_base;
  25. unsigned short iomem_reg_shift;
  26. };
  27. /*
  28. * This replaces serial_uart_config in include/linux/serial.h
  29. */
  30. struct serial8250_config {
  31. const char *name;
  32. unsigned short fifo_size;
  33. unsigned short tx_loadsz;
  34. unsigned char fcr;
  35. unsigned int flags;
  36. };
  37. #define UART_CAP_FIFO (1 << 8) /* UART has FIFO */
  38. #define UART_CAP_EFR (1 << 9) /* UART has EFR */
  39. #define UART_CAP_SLEEP (1 << 10) /* UART has IER sleep */
  40. #define UART_CAP_AFE (1 << 11) /* MCR-based hw flow control */
  41. #define UART_CAP_UUE (1 << 12) /* UART needs IER bit 6 set (Xscale) */
  42. #define UART_BUG_QUOT (1 << 0) /* UART has buggy quot LSB */
  43. #define UART_BUG_TXEN (1 << 1) /* UART has buggy TX IIR status */
  44. #define UART_BUG_NOMSR (1 << 2) /* UART has buggy MSR status bits (Au1x00) */
  45. #define UART_BUG_THRE (1 << 3) /* UART has buggy THRE reassertion */
  46. #define PROBE_RSA (1 << 0)
  47. #define PROBE_ANY (~0)
  48. #define HIGH_BITS_OFFSET ((sizeof(long)-sizeof(int))*8)
  49. #ifdef CONFIG_SERIAL_8250_SHARE_IRQ
  50. #define SERIAL8250_SHARE_IRQS 1
  51. #else
  52. #define SERIAL8250_SHARE_IRQS 0
  53. #endif
  54. #if defined(__alpha__) && !defined(CONFIG_PCI)
  55. /*
  56. * Digital did something really horribly wrong with the OUT1 and OUT2
  57. * lines on at least some ALPHA's. The failure mode is that if either
  58. * is cleared, the machine locks up with endless interrupts.
  59. */
  60. #define ALPHA_KLUDGE_MCR (UART_MCR_OUT2 | UART_MCR_OUT1)
  61. #elif defined(CONFIG_SBC8560)
  62. /*
  63. * WindRiver did something similarly broken on their SBC8560 board. The
  64. * UART tristates its IRQ output while OUT2 is clear, but they pulled
  65. * the interrupt line _up_ instead of down, so if we register the IRQ
  66. * while the UART is in that state, we die in an IRQ storm. */
  67. #define ALPHA_KLUDGE_MCR (UART_MCR_OUT2)
  68. #else
  69. #define ALPHA_KLUDGE_MCR 0
  70. #endif