specialix.txt
上传用户:jlfgdled
上传日期:2013-04-10
资源大小:33168k
文件大小:15k
源码类别:

Linux/Unix编程

开发平台:

Unix_Linux

  1.       specialix.txt  -- specialix IO8+ multiport serial driver readme.
  2.       Copyright (C) 1997  Roger Wolff (R.E.Wolff@BitWizard.nl)
  3.       Specialix pays for the development and support of this driver.
  4.       Please DO contact io8-linux@specialix.co.uk if you require
  5.       support.
  6.       This driver was developed in the BitWizard linux device
  7.       driver service. If you require a linux device driver for your
  8.       product, please contact devices@BitWizard.nl for a quote.
  9.       This code is firmly based on the riscom/8 serial driver,
  10.       written by Dmitry Gorodchanin. The specialix IO8+ card
  11.       programming information was obtained from the CL-CD1865 Data
  12.       Book, and Specialix document number 6200059: IO8+ Hardware
  13.       Functional Specification, augmented by document number 6200088:
  14.       Merak Hardware Functional Specification. (IO8+/PCI is also 
  15.       called Merak)
  16.       This program is free software; you can redistribute it and/or
  17.       modify it under the terms of the GNU General Public License as
  18.       published by the Free Software Foundation; either version 2 of
  19.       the License, or (at your option) any later version.
  20.       This program is distributed in the hope that it will be
  21.       useful, but WITHOUT ANY WARRANTY; without even the implied
  22.       warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  23.       PURPOSE.  See the GNU General Public License for more details.
  24.       You should have received a copy of the GNU General Public
  25.       License along with this program; if not, write to the Free
  26.       Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
  27.       USA.
  28. Intro
  29. =====
  30.  
  31. This file contains some random information, that I like to have online
  32. instead of in a manual that can get lost. Ever misplace your Linux
  33. kernel sources?  And the manual of one of the boards in your computer?
  34. Addresses and interrupts
  35. ========================
  36. Address dip switch settings:
  37. The dip switch sets bits 2-9 of the IO address. 
  38.        9 8 7 6 5 4 3 2 
  39.      +-----------------+
  40.    0 | X   X X X X X X |
  41.      |                 |    =   IoBase = 0x100 
  42.    1 |   X             |
  43.      +-----------------+          ------ RS232 connectors ---->
  44.          
  45.          |    |    |
  46.        edge connector
  47.          |    |    |
  48.          V    V    V
  49. Base address 0x100 caused a conflict in one of my computers once.  I
  50. haven't the foggiest why. My Specialix card is now at 0x180.  My
  51. other computer runs just fine with the Specialix card at 0x100....
  52. The card occupies 4 addresses, but actually only two are really used.
  53. The PCI version doesn't have any dip switches. The BIOS assigns
  54. an IO address. 
  55. The driver now still autoprobes at 0x100, 0x180, 0x250 and 0x260.  If
  56. that causes trouble for you, please report that. I'll remove
  57. autoprobing then.
  58. The driver will tell the card what IRQ to use, so you don't have to
  59. change any jumpers to change the IRQ. Just use a command line
  60. argument (irq=xx) to the insmod program to set the interrupt.
  61. The BIOS assigns the IRQ on the PCI version. You have no say in what
  62. IRQ to use in that case. 
  63. If your specialix cards are not at the default locations, you can use
  64. the kernel command line argument "specialix=io0,irq0,io1,irq1...".
  65. Here "io0" is the io address for the first card, and "irq0" is the
  66. irq line that the first card should use. And so on. 
  67. Examples. 
  68. You use the driver as a module and have three cards at 0x100, 0x250
  69. and 0x180. And some way or another you want them detected in that
  70. order. Moreover irq 12 is taken (e.g. by your PS/2 mouse).
  71.   insmod specialix.o iobase=0x100,0x250,0x180 irq=9,11,15
  72. The same three cards, but now in the kernel would require you to
  73. add 
  74.    specialix=0x100,9,0x250,11,0x180,15
  75. to the command line. This would become 
  76.    append="specialix=0x100,9,0x250,11,0x180,15" 
  77. in your /etc/lilo.conf file if you use lilo. 
  78. The Specialix driver is slightly odd: It allows you to have the second
  79. or third card detected without having a first card. This has
  80. advantages and disadvantages. A slot that isn't filled by an ISA card,
  81. might be filled if a PCI card is detected. Thus if you have an ISA
  82. card at 0x250 and a PCI card, you would get:
  83. sx0: specialix IO8+ Board at 0x100 not found.
  84. sx1: specialix IO8+ Board at 0x180 not found.
  85. sx2: specialix IO8+ board detected at 0x250, IRQ 12, CD1865 Rev. B.
  86. sx3: specialix IO8+ Board at 0x260 not found.
  87. sx0: specialix IO8+ board detected at 0xd800, IRQ 9, CD1865 Rev. B.
  88. This would happen if you don't give any probe hints to the driver. 
  89. If you would specify:
  90.    specialix=0x250,11
  91. you'd get the following messages:
  92. sx0: specialix IO8+ board detected at 0x250, IRQ 11, CD1865 Rev. B.
  93. sx1: specialix IO8+ board detected at 0xd800, IRQ 9, CD1865 Rev. B.
  94. ISA probing is aborted after the IO address you gave is exhausted, and
  95. the PCI card is now detected as the second card. The ISA card is now
  96. also forced to IRQ11....
  97. Baud rates
  98. ==========
  99. The rev 1.2 and below boards use a CL-CD1864. These chips can only 
  100. do 64kbit. The rev 1.3 and newer boards use a CL-CD1865. These chips
  101. are officially capable of 115k2.
  102. The Specialix card uses a 25MHz crystal (in times two mode, which in
  103. fact is a divided by two mode). This is not enough to reach the rated
  104. 115k2 on all ports at the same time. With this clock rate you can only
  105. do 37% of this rate. This means that at 115k2 on all ports you are
  106. going to lose characters (The chip cannot handle that many incoming
  107. bits at this clock rate.) (Yes, you read that correctly: there is a
  108. limit to the number of -=bits=- per second that the chip can handle.)
  109. If you near the "limit" you will first start to see a graceful
  110. degradation in that the chip cannot keep the transmitter busy at all
  111. times. However with a central clock this slow, you can also get it to
  112. miss incoming characters. The driver will print a warning message when
  113. you are outside the official specs. The messages usually show up in
  114. the file /var/log/messages .
  115. The specialix card cannot reliably do 115k2. If you use it, you have
  116. to do "extensive testing" (*) to verify if it actually works.
  117. When "mgetty" communicates with my modem at 115k2 it reports:
  118. got: +++[0d]ATQ0V1H0[0d][0d][8a]O[cb][0d][8a]
  119.                             ^^^^ ^^^^    ^^^^ 
  120. The three characters that have the "^^^" under them have suffered a
  121. bit error in the highest bit. In conclusion: I've tested it, and found
  122. that it simply DOESN'T work for me. I also suspect that this is also
  123. caused by the baud rate being just a little bit out of tune. 
  124. I upgraded the crystal to 66Mhz on one of my Specialix cards. Works
  125. great! Contact me for details. (Voids warranty, requires a steady hand
  126. and more such restrictions....)
  127. (*) Cirrus logic CD1864 databook, page 40.
  128. Cables for the Specialix IO8+
  129. =============================
  130. The pinout of the connectors on the IO8+ is:
  131.      pin    short    direction    long name
  132.             name
  133.     Pin 1   DCD      input        Data Carrier Detect
  134.     Pin 2   RXD      input        Receive
  135.     Pin 3   DTR/RTS  output       Data Terminal Ready/Ready To Send
  136.     Pin 4   GND      -            Ground
  137.     Pin 5   TXD      output       Transmit
  138.     Pin 6   CTS      input        Clear To Send
  139.         
  140.     
  141.              -- 6  5  4  3  2  1 --
  142.              |                    |
  143.              |                    |
  144.              |                    |
  145.              |                    |
  146.              +-----          -----+
  147.                   |__________|
  148.                       clip
  149.     
  150.     Front view of an RJ12 connector. Cable moves "into" the paper.
  151.     (the plug is ready to plug into your mouth this way...)
  152.     
  153.     NULL cable. I don't know who is going to use these except for
  154.     testing purposes, but I tested the cards with this cable. (It 
  155.     took quite a while to figure out, so I'm not going to delete
  156.     it. So there! :-)
  157.     
  158.     
  159.     This end goes               This end needs
  160.     straight into the           some twists in
  161.     RJ12 plug.                  the wiring.
  162.        IO8+ RJ12                   IO8+ RJ12
  163.         1  DCD       white          -
  164.         -             -             1 DCD
  165.         2  RXD       black          5 TXD
  166.         3  DTR/RTS   red            6 CTS
  167.         4  GND       green          4 GND
  168.         5  TXD       yellow         2 RXD
  169.         6  CTS       blue           3 DTR/RTS
  170.     
  171.     Same NULL cable, but now sorted on the second column.
  172.  
  173.         1  DCD       white          -
  174.         -             -             1 DCD
  175.         5  TXD       yellow         2 RXD
  176.         6  CTS       blue           3 DTR/RTS
  177.         4  GND       green          4 GND
  178.         2  RXD       black          5 TXD
  179.         3  DTR/RTS   red            6 CTS
  180.     
  181.     
  182.     
  183.     This is a modem cable usable for hardware handshaking:
  184.         RJ12                        DB25           DB9
  185.         1   DCD      white          8 DCD          1 DCD
  186.         2   RXD      black          3 RXD          2 RXD
  187.         3   DTR/RTS  red            4 RTS          7 RTS
  188.         4   GND      green          7 GND          5 GND
  189.         5   TXD      yellow         2 TXD          3 TXD
  190.         6   CTS      blue           5 CTS          8 CTS
  191.                             +----   6 DSR          6 DSR
  192.                             +----  20 DTR          4 DTR
  193.     This is a modem cable usable for software handshaking:
  194.     It allows you to reset the modem using the DTR ioctls.
  195.     I (REW) have never tested this, "but xxxxxxxxxxxxx
  196.     says that it works." If you test this, please
  197.     tell me and I'll fill in your name on the xxx's.
  198.         RJ12                        DB25           DB9
  199.         1   DCD      white          8 DCD          1 DCD
  200.         2   RXD      black          3 RXD          2 RXD
  201.         3   DTR/RTS  red           20 DTR          4 DTR
  202.         4   GND      green          7 GND          5 GND
  203.         5   TXD      yellow         2 TXD          3 TXD
  204.         6   CTS      blue           5 CTS          8 CTS
  205.                             +----   6 DSR          6 DSR
  206.                             +----   4 RTS          7 RTS
  207.    I bought a 6 wire flat cable. It was colored as indicated.
  208.    Check that yours is the same before you trust me on this.
  209.    
  210.  
  211. Hardware handshaking issues.
  212. ============================
  213. The driver can be compiled in two different ways. The default
  214. ("Specialix DTR/RTS pin is RTS" is off) the pin behaves as DTR when
  215. hardware handshaking is off. It behaves as the RTS hardware
  216. handshaking signal when hardware handshaking is selected.
  217. When you use this, you have to use the appropriate cable. The
  218. cable will either be compatible with hardware handshaking or with
  219. software handshaking. So switching on the fly is not really an
  220. option.
  221. I actually prefer to use the "Specialix DTR/RTS pin is RTS" option.
  222. This makes the DTR/RTS pin always an RTS pin, and ioctls to
  223. change DTR are always ignored. I have a cable that is configured
  224. for this. 
  225. Ports and devices
  226. =================
  227. Port 0 is the one furthest from the card-edge connector.
  228. Devices:
  229. You should make the devices as follows:
  230. bash
  231. cd /dev
  232. for i in  0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 
  233.          16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
  234. do
  235.   echo -n "$i "
  236.   mknod /dev/ttyW$i c 75 $i
  237.   mknod /dev/cuw$i c 76 $i
  238. done
  239. echo ""
  240. If your system doesn't come with these devices preinstalled, bug your
  241. linux-vendor about this. They have had ample time to get this
  242. implemented by now.
  243. You cannot have more than 4 boards in one computer. The card only
  244. supports 4 different interrupts. If you really want this, contact me
  245. about this and I'll give you a few tips (requires soldering iron)....
  246. If you have enough PCI slots, you can probably use more than 4 PCI
  247. versions of the card though.... 
  248. The PCI version of the card cannot adhere to the mechanical part of
  249. the PCI spec because the 8 serial connectors are simply too large. If
  250. it doesn't fit in your computer, bring back the card.
  251. ------------------------------------------------------------------------
  252.   Fixed bugs and restrictions:
  253.        - During intialization, interrupts are blindly turned on.
  254.             Having a shadow variable would cause an extra memory
  255.             access on every IO instruction. 
  256.        - The interrupt (on the card) should be disabled when we
  257.          don't allocate the Linux end of the interrupt. This allows 
  258.          a different driver/card to use it while all ports are not in
  259.          use..... (a la standard serial port)
  260.        == An extra _off variant of the sx_in and sx_out macros are
  261.           now available. They don't set the interrupt enable bit.
  262.           These are used during initialization. Normal operation uses
  263.           the old variant which enables the interrupt line.
  264.        - RTS/DTR issue needs to be implemented according to 
  265.          specialix' spec.
  266.             I kind of like the "determinism" of the current 
  267.             implementation. Compile time flag?
  268.        == Ok. Compile time flag! Default is how Specialix likes it.
  269.        == Now a config time flag! Gets saved in your config file. Neat!
  270.        - Can you set the IO address from the lilo command line?
  271.             If you need this, bug me about it, I'll make it. 
  272.        == Hah! No bugging needed. Fixed! :-)
  273.        - Cirrus logic hasn't gotten back to me yet why the CD1865 can
  274.             and the CD1864 can't do 115k2. I suspect that this is
  275.             because the CD1864 is not rated for 33MHz operation.
  276.             Therefore the CD1864 versions of the card can't do 115k2 on 
  277.             all ports just like the CD1865 versions. The driver does
  278.             not block 115k2 on CD1864 cards. 
  279.         == I called the Cirrus Logic representative here in Holland.
  280.            The CD1864 databook is identical to the CD1865 databook, 
  281.            except for an extra warning at the end. Similar Bit errors
  282.            have been observed in testing at 115k2 on both an 1865 and
  283.            a 1864 chip. I see no reason why I would prohibit 115k2 on
  284.            1864 chips and not do it on 1865 chips. Actually there is
  285.            reason to prohibit it on BOTH chips. I print a warning.
  286.            If you use 115k2, you're on your own. 
  287.        - A spiky CD may send spurious HUPs. Also in CLOCAL???
  288.          -- A fix for this turned out to be counter productive. 
  289.             Different fix? Current behaviour is acceptable?
  290.          -- Maybe the current implementation is correct. If anybody
  291.             gets bitten by this, please report, and it will get fixed.
  292.          -- Testing revealed that when in CLOCAL, the problem doesn't
  293.             occur. As warned for in the CD1865 manual, the chip may
  294.             send modem intr's on a spike. We could filter those out,
  295.             but that would be a cludge anyway (You'd still risk getting
  296.             a spurious HUP when two spikes occur.).....
  297.  
  298.   Bugs & restrictions:
  299.        - This is a difficult card to autoprobe.
  300.             You have to WRITE to the address register to even 
  301.             read-probe a CD186x register. Disable autodetection?
  302.          -- Specialix: any suggestions?
  303.        - Arbitrary baud rates are not implemented yet. 
  304.             If you need this, bug me about it.