8250.h 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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. * $Id: 8250.h,v 1.8 2002/07/21 21:32:30 rmk Exp $
  16. */
  17. #include <linux/config.h>
  18. int serial8250_register_port(struct uart_port *);
  19. void serial8250_unregister_port(int line);
  20. void serial8250_suspend_port(int line);
  21. void serial8250_resume_port(int line);
  22. struct old_serial_port {
  23. unsigned int uart;
  24. unsigned int baud_base;
  25. unsigned int port;
  26. unsigned int irq;
  27. unsigned int flags;
  28. unsigned char hub6;
  29. unsigned char io_type;
  30. unsigned char *iomem_base;
  31. unsigned short iomem_reg_shift;
  32. };
  33. /*
  34. * This replaces serial_uart_config in include/linux/serial.h
  35. */
  36. struct serial8250_config {
  37. const char *name;
  38. unsigned short fifo_size;
  39. unsigned short tx_loadsz;
  40. unsigned char fcr;
  41. unsigned int flags;
  42. };
  43. #define UART_CAP_FIFO (1 << 8) /* UART has FIFO */
  44. #define UART_CAP_EFR (1 << 9) /* UART has EFR */
  45. #define UART_CAP_SLEEP (1 << 10) /* UART has IER sleep */
  46. #define UART_CAP_AFE (1 << 11) /* MCR-based hw flow control */
  47. #define UART_CAP_UUE (1 << 12) /* UART needs IER bit 6 set (Xscale) */
  48. #define UART_BUG_QUOT (1 << 0) /* UART has buggy quot LSB */
  49. #if defined(__i386__) && (defined(CONFIG_M386) || defined(CONFIG_M486))
  50. #define _INLINE_ inline
  51. #else
  52. #define _INLINE_
  53. #endif
  54. #define PROBE_RSA (1 << 0)
  55. #define PROBE_ANY (~0)
  56. #define HIGH_BITS_OFFSET ((sizeof(long)-sizeof(int))*8)
  57. #ifdef CONFIG_SERIAL_8250_SHARE_IRQ
  58. #define SERIAL8250_SHARE_IRQS 1
  59. #else
  60. #define SERIAL8250_SHARE_IRQS 0
  61. #endif
  62. #if defined(__alpha__) && !defined(CONFIG_PCI)
  63. /*
  64. * Digital did something really horribly wrong with the OUT1 and OUT2
  65. * lines on at least some ALPHA's. The failure mode is that if either
  66. * is cleared, the machine locks up with endless interrupts.
  67. */
  68. #define ALPHA_KLUDGE_MCR (UART_MCR_OUT2 | UART_MCR_OUT1)
  69. #elif defined(CONFIG_SBC8560)
  70. /*
  71. * WindRiver did something similarly broken on their SBC8560 board. The
  72. * UART tristates its IRQ output while OUT2 is clear, but they pulled
  73. * the interrupt line _up_ instead of down, so if we register the IRQ
  74. * while the UART is in that state, we die in an IRQ storm. */
  75. #define ALPHA_KLUDGE_MCR (UART_MCR_OUT2)
  76. #else
  77. #define ALPHA_KLUDGE_MCR 0
  78. #endif