hayes-esp.txt 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. HAYES ESP DRIVER VERSION 2.1
  2. A big thanks to the people at Hayes, especially Alan Adamson. Their support
  3. has enabled me to provide enhancements to the driver.
  4. Please report your experiences with this driver to me (arobinso@nyx.net). I
  5. am looking for both positive and negative feedback.
  6. *** IMPORTANT CHANGES FOR 2.1 ***
  7. Support for PIO mode. Five situations will cause PIO mode to be used:
  8. 1) A multiport card is detected. PIO mode will always be used. (8 port cards
  9. do not support DMA).
  10. 2) The DMA channel is set to an invalid value (anything other than 1 or 3).
  11. 3) The DMA buffer/channel could not be allocated. The port will revert to PIO
  12. mode until it is reopened.
  13. 4) Less than a specified number of bytes need to be transferred to/from the
  14. FIFOs. PIO mode will be used for that transfer only.
  15. 5) A port needs to do a DMA transfer and another port is already using the
  16. DMA channel. PIO mode will be used for that transfer only.
  17. Since the Hayes ESP seems to conflict with other cards (notably sound cards)
  18. when using DMA, DMA is turned off by default. To use DMA, it must be turned
  19. on explicitly, either with the "dma=" option described below or with
  20. setserial. A multiport card can be forced into DMA mode by using setserial;
  21. however, most multiport cards don't support DMA.
  22. The latest version of setserial allows the enhanced configuration of the ESP
  23. card to be viewed and modified.
  24. ***
  25. This package contains the files needed to compile a module to support the Hayes
  26. ESP card. The drivers are basically a modified version of the serial drivers.
  27. Features:
  28. - Uses the enhanced mode of the ESP card, allowing a wider range of
  29. interrupts and features than compatibility mode
  30. - Uses DMA and 16 bit PIO mode to transfer data to and from the ESP's FIFOs,
  31. reducing CPU load
  32. - Supports primary and secondary ports
  33. If the driver is compiled as a module, the IRQs to use can be specified by
  34. using the irq= option. The format is:
  35. irq=[0x100],[0x140],[0x180],[0x200],[0x240],[0x280],[0x300],[0x380]
  36. The address in brackets is the base address of the card. The IRQ of
  37. nonexistent cards can be set to 0. If an IRQ of a card that does exist is set
  38. to 0, the driver will attempt to guess at the correct IRQ. For example, to set
  39. the IRQ of the card at address 0x300 to 12, the insmod command would be:
  40. insmod esp irq=0,0,0,0,0,0,12,0
  41. The custom divisor can be set by using the divisor= option. The format is the
  42. same as for the irq= option. Each divisor value is a series of hex digits,
  43. with each digit representing the divisor to use for a corresponding port. The
  44. divisor value is constructed RIGHT TO LEFT. Specifying a nonzero divisor value
  45. will automatically set the spd_cust flag. To calculate the divisor to use for
  46. a certain baud rate, divide the port's base baud (generally 921600) by the
  47. desired rate. For example, to set the divisor of the primary port at 0x300 to
  48. 4 and the divisor of the secondary port at 0x308 to 8, the insmod command would
  49. be:
  50. insmod esp divisor=0,0,0,0,0,0,0x84,0
  51. The dma= option can be used to set the DMA channel. The channel can be either
  52. 1 or 3. Specifying any other value will force the driver to use PIO mode.
  53. For example, to set the DMA channel to 3, the insmod command would be:
  54. insmod esp dma=3
  55. The rx_trigger= and tx_trigger= options can be used to set the FIFO trigger
  56. levels. They specify when the ESP card should send an interrupt. Larger
  57. values will decrease the number of interrupts; however, a value too high may
  58. result in data loss. Valid values are 1 through 1023, with 768 being the
  59. default. For example, to set the receive trigger level to 512 bytes and the
  60. transmit trigger level to 700 bytes, the insmod command would be:
  61. insmod esp rx_trigger=512 tx_trigger=700
  62. The flow_off= and flow_on= options can be used to set the hardware flow off/
  63. flow on levels. The flow on level must be lower than the flow off level, and
  64. the flow off level should be higher than rx_trigger. Valid values are 1
  65. through 1023, with 1016 being the default flow off level and 944 being the
  66. default flow on level. For example, to set the flow off level to 1000 bytes
  67. and the flow on level to 935 bytes, the insmod command would be:
  68. insmod esp flow_off=1000 flow_on=935
  69. The rx_timeout= option can be used to set the receive timeout value. This
  70. value indicates how long after receiving the last character that the ESP card
  71. should wait before signalling an interrupt. Valid values are 0 though 255,
  72. with 128 being the default. A value too high will increase latency, and a
  73. value too low will cause unnecessary interrupts. For example, to set the
  74. receive timeout to 255, the insmod command would be:
  75. insmod esp rx_timeout=255
  76. The pio_threshold= option sets the threshold (in number of characters) for
  77. using PIO mode instead of DMA mode. For example, if this value is 32,
  78. transfers of 32 bytes or less will always use PIO mode.
  79. insmod esp pio_threshold=32
  80. Multiple options can be listed on the insmod command line by separating each
  81. option with a space. For example:
  82. insmod esp dma=3 trigger=512
  83. The esp module can be automatically loaded when needed. To cause this to
  84. happen, add the following lines to /etc/modprobe.conf (replacing the last line
  85. with options for your configuration):
  86. alias char-major-57 esp
  87. alias char-major-58 esp
  88. options esp irq=0,0,0,0,0,0,3,0 divisor=0,0,0,0,0,0,0x4,0
  89. You may also need to run 'depmod -a'.
  90. Devices must be created manually. To create the devices, note the output from
  91. the module after it is inserted. The output will appear in the location where
  92. kernel messages usually appear (usually /var/adm/messages). Create two devices
  93. for each 'tty' mentioned, one with major of 57 and the other with major of 58.
  94. The minor number should be the same as the tty number reported. The commands
  95. would be (replace ? with the tty number):
  96. mknod /dev/ttyP? c 57 ?
  97. mknod /dev/cup? c 58 ?
  98. For example, if the following line appears:
  99. Oct 24 18:17:23 techno kernel: ttyP8 at 0x0140 (irq = 3) is an ESP primary port
  100. ...two devices should be created:
  101. mknod /dev/ttyP8 c 57 8
  102. mknod /dev/cup8 c 58 8
  103. You may need to set the permissions on the devices:
  104. chmod 666 /dev/ttyP*
  105. chmod 666 /dev/cup*
  106. The ESP module and the serial module should not conflict (they can be used at
  107. the same time). After the ESP module has been loaded the ports on the ESP card
  108. will no longer be accessible by the serial driver.
  109. If I/O errors are experienced when accessing the port, check for IRQ and DMA
  110. conflicts ('cat /proc/interrupts' and 'cat /proc/dma' for a list of IRQs and
  111. DMAs currently in use).
  112. Enjoy!
  113. Andrew J. Robinson <arobinso@nyx.net>