readme 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. =============================================================================
  2. MaxLinear PCIe Multiport Device Driver Ver 2.6 Installation Guide
  3. for Linux Kernel 2.6.32 and newer (Tested on various kernels from 2.6.32 to 4.15.x)
  4. Copyright (C) 2019, MaxLinear.
  5. =============================================================================
  6. Note: Exar is now part of MaxLinear. All description below will be referred as MaxLinear/Exar.
  7. Revision History
  8. ----------------
  9. Changes from Ver 2.5 to 2.6
  10. - Ensure LCR bit-7 = 0 when accessing RHR/THR/IER/ISR to avoid incorrect register write.
  11. - Remove warning messages when building with gcc 7.4.0 (Ubuntu 18.04).
  12. Changes from Ver 2.4 to 2.5
  13. - Improve baud the accuracy on 12Mbps.
  14. - Add option to select for RS485 control between DTR# and RTS# pin.
  15. - Add timer function patch for Kernel 4.15 and later support
  16. Changes from Ver 2.3 to 2.4
  17. - Add INT0 read for "nobody cares" interrupt issue
  18. Releasing 2.2c as version 2.3 (no changes from 2.2c)
  19. Changes from Ver 2.2b to 2.2c
  20. - Macro XR_17v35x_UART_RHR was not defined. Issue fixed.
  21. Changes from Ver 2.2a to 2.2b
  22. - RS-485 was not getting disabled correctly. Issue Fixed.
  23. Changes from Ver 2.2 to 2.2a
  24. - For receiving data, replaced memcpy_fromio() routine with serial_in(). This was done because the former was dropping data on receive.
  25. Changes from Ver 2.1 to 2.2
  26. - Added support for non standard baud rates
  27. - Configure MPIO's as inputs.
  28. - Added a parameter to enable disable internal loopback
  29. - Fixed bug related to Fractional buad rate generator.
  30. - RS485 disabled by default.
  31. - To enable RS485 configure the parameter ENABLE_RS485
  32. Changes from Ver 2.0 to 2.1
  33. - Added support for Software flow control and Auto Hardware flow control
  34. - Enabled Auto RS 485
  35. - Modified logic for Fractional baud rate generator
  36. - Added Support for XR17D15x devices
  37. Changes from Ver 1.5 to 2.0 (version 1.6 - 1.9 are unofficial versions, never posted on website):
  38. - Fixed issue when un-registering ports (rmmod) that prevented re-registering all of the ports (insmod)
  39. - Added logic in interrupt service to ensure that LCR bit-7 = 0 before reading ISR/IIR
  40. - Added support for 4X Sampling Mode, 8X Sampling Mode, 9-bit (Multidrop) Mode, RS-485 Mode
  41. - Added support for 2.6.32 to 3.17.x (and possibly newer)
  42. -----------------------------------------------------------------------------
  43. 1. Introduction
  44. The PCIe Multiport serial driver Ver 2.2, supports the following multiport
  45. boards.
  46. - XR17V258 PCI Multiport (8 Channels) Boards
  47. - XR17V254 PCI Multiport (4 Channels) Boards
  48. - XR17V252 PCI Multiport (2 Channels) Boards
  49. - XR17V358 & XR17V4354 PCIe Multiport (8 Channels) Boards
  50. - XR17V354 PCIe Multiport (4 Channels) Boards
  51. - XR17V352 PCIe Multiport (2 Channels) Boards
  52. - XR17V4358 & XR17V8354 PCIe Multiport (12 Channels) Boards
  53. - XR17V8358 PCIe Multiport (16 Channels) Boards
  54. This driver and installation procedure have been tested on various
  55. kernel versions from 2.6.32 to 3.17.x.
  56. All the drivers and utilities are published in form of source code under
  57. GNU General Public License in this version. Please refer to GNU General
  58. Public License announcement in each source code file for more detail.
  59. This version of driver can be installed as Loadable Module (Module driver)
  60. or built-in into kernel (Static driver). You may refer to following
  61. installation procedure for suitable one. Before you install the driver,
  62. please refer to hardware installation procedure in the User's Manual.
  63. We assume the user should be familiar with following documents.
  64. - Serial-HOWTO
  65. - Kernel-HOWTO
  66. -----------------------------------------------------------------------------
  67. 2. System Requirement
  68. - Hardware platform: Intel x86
  69. - Kernel version: 2.6.32 or newer
  70. - Maximum of 256 ports can be installed in any PCIe board combination
  71. - This driver has been tested on various kernel versions from 2.6.32 to 3.17.x.
  72. It is strongly recommended that the user do a complete install of all components
  73. to ensure that this driver works correctly.
  74. -----------------------------------------------------------------------------
  75. 3. Installation
  76. 3.1 Hardware installation
  77. You may need to adjust IRQ usage in BIOS to avoid IRQ conflict with legacy ISA devices.
  78. 3.2 Driver Installation
  79. For all the newer kernels the support for MaxLinear/Exar PCI/PCIe UARTs is already integrated in the generic
  80. serial drivers that comes with the kernel source. If you want to use the XR17V35x/XR17D15x PCIe/PCI
  81. UARTs to only send/receive data then you may use the generic serial driver available in the linux
  82. kernel. When using generic driver the XR17V35x device will be listed as "ttyS" instead of "ttyXR"
  83. under /dev/ folder. In order to determine which "ttyS" are assigned to XR17V35x you can open file
  84. "/proc/tty/driver/serial" the PCI/PCIe UARTs will be listed as MMIO devices.
  85. However, if you intend to use the Enhanced features of the device(i.e. Auto RTS/CTS, Auto RS485 etc)
  86. or enable disable MPIO, in that case you will need the custom driver. Follow the steps below for using
  87. the custom driver, in this example we will be using XR17V358:
  88. (MaxLinear/Exar AN-225 Application Note can be referred for installing custom driver)
  89. A.) You will need to unbind the serial driver. Follow the steps below to unbind the serial driver.
  90. root$ lspci -vd 13a8:*
  91. 03:00.0 Serial controller: Exar Corp. Device 0358 (rev 03) (prog-if 02 [16550])
  92. Flags: fast devsel, IRQ 30
  93. Memory at f3ffc000 (32-bit, non-prefetchable) [size=16K]
  94. Capabilities: [50] MSI: Enable- Count=1/1 Maskable- 64bit+
  95. Capabilities: [78] Power Management version 3
  96. Capabilities: [80] Express Endpoint, MSI 01
  97. Capabilities: [100] Virtual Channel
  98. Kernel driver in use: serial
  99. As you can see in the last line above that the kernel is using generic "serial" module.
  100. Note: For newer kernel (i.e.: 4.11 and later), "exar_serial" may be seen.
  101. If so, use "exar_serial" instead of "serial" for the following unbind commands
  102. root$ ls /sys/bus/pci/drivers/serial/
  103. 0000:03:00.0 bind new_id remove_id uevent unbind
  104. root$ echo -n "0000:03:00.0" > /sys/bus/pci/drivers/serial/unbind
  105. This will unbind the generic serial driver from XR17V35x device. Now you can compile and install
  106. the customer driver. After successful installation the device should be listed in /dev folder as
  107. "ttyXR" as mentioned in the README.
  108. B.) Module driver configuration
  109. 1. Find "Makefile" in driver source file path, then run
  110. # make
  111. After the driver file "xr17v35x.ko" is properly compiled, then run
  112. # insmod xr17v35x.ko
  113. or
  114. # insmod ./xr17v35x.ko
  115. This will activate the module driver. You may run "lsmod" to check if "xr17v35x.ko" is activated.
  116. 2. This module registers MaxLinear/Exar ports as "/dev/ttyXR0", "/dev/ttyXR1", etc. You may use "minicom" or
  117. its custom serial application to test the ports
  118. 3. You may refer to /var/log/messages or /var/log/kern.log to check the latest status log reported
  119. by this driver whenever activated to verify driver installation.
  120. C.) Driver files and device naming convention
  121. This driver creates traditional serial device names, "/dev/ttyXR0" onwards.
  122. Device naming when multiple boards are installed
  123. -----------------------------------------------
  124. Naming convention for each multiport board is pre-defined as below, assuming 2 XR17V358 boards,
  125. 1 XR17V354 board and 1 XR17V352 board.
  126. Board Num. Port Name
  127. 1st board (358) ttyXR0 - ttyXR7
  128. 2nd board (358) ttyXR8 - ttyXR15
  129. 3rd board (354) ttyXR16 - ttyXR19
  130. 4th board (352) ttyXR24 - ttyXR25
  131. 4. Troubleshooting
  132. The boot time error mesages and solutions are stated as clearly as
  133. possible. If all the possible solutions fail, please contact our technical
  134. support team (uarttechsupport@exar.com) to get more help.