xref: /OK3568_Linux_fs/kernel/Documentation/driver-api/serial/moxa-smartio.rst (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun=============================================================
2*4882a593SmuzhiyunMOXA Smartio/Industio Family Device Driver Installation Guide
3*4882a593Smuzhiyun=============================================================
4*4882a593Smuzhiyun
5*4882a593Smuzhiyun.. note::
6*4882a593Smuzhiyun
7*4882a593Smuzhiyun   This file is outdated. It needs some care in order to make it
8*4882a593Smuzhiyun   updated to Kernel 5.0 and upper
9*4882a593Smuzhiyun
10*4882a593SmuzhiyunCopyright (C) 2008, Moxa Inc.
11*4882a593Smuzhiyun
12*4882a593SmuzhiyunDate: 01/21/2008
13*4882a593Smuzhiyun
14*4882a593Smuzhiyun.. Content
15*4882a593Smuzhiyun
16*4882a593Smuzhiyun   1. Introduction
17*4882a593Smuzhiyun   2. System Requirement
18*4882a593Smuzhiyun   3. Installation
19*4882a593Smuzhiyun      3.1 Hardware installation
20*4882a593Smuzhiyun      3.2 Driver files
21*4882a593Smuzhiyun      3.3 Device naming convention
22*4882a593Smuzhiyun      3.4 Module driver configuration
23*4882a593Smuzhiyun      3.5 Static driver configuration for Linux kernel 2.4.x and 2.6.x.
24*4882a593Smuzhiyun      3.6 Custom configuration
25*4882a593Smuzhiyun      3.7 Verify driver installation
26*4882a593Smuzhiyun   4. Utilities
27*4882a593Smuzhiyun   5. Setserial
28*4882a593Smuzhiyun   6. Troubleshooting
29*4882a593Smuzhiyun
30*4882a593Smuzhiyun1. Introduction
31*4882a593Smuzhiyun^^^^^^^^^^^^^^^
32*4882a593Smuzhiyun
33*4882a593Smuzhiyun   The Smartio/Industio/UPCI family Linux driver supports following multiport
34*4882a593Smuzhiyun   boards.
35*4882a593Smuzhiyun
36*4882a593Smuzhiyun    - 2 ports multiport board
37*4882a593Smuzhiyun	CP-102U, CP-102UL, CP-102UF
38*4882a593Smuzhiyun	CP-132U-I, CP-132UL,
39*4882a593Smuzhiyun	CP-132, CP-132I, CP132S, CP-132IS,
40*4882a593Smuzhiyun	CI-132, CI-132I, CI-132IS,
41*4882a593Smuzhiyun	(C102H, C102HI, C102HIS, C102P, CP-102, CP-102S)
42*4882a593Smuzhiyun
43*4882a593Smuzhiyun    - 4 ports multiport board
44*4882a593Smuzhiyun	CP-104EL,
45*4882a593Smuzhiyun	CP-104UL, CP-104JU,
46*4882a593Smuzhiyun	CP-134U, CP-134U-I,
47*4882a593Smuzhiyun	C104H/PCI, C104HS/PCI,
48*4882a593Smuzhiyun	CP-114, CP-114I, CP-114S, CP-114IS, CP-114UL,
49*4882a593Smuzhiyun	C104H, C104HS,
50*4882a593Smuzhiyun	CI-104J, CI-104JS,
51*4882a593Smuzhiyun	CI-134, CI-134I, CI-134IS,
52*4882a593Smuzhiyun	(C114HI, CT-114I, C104P),
53*4882a593Smuzhiyun	POS-104UL,
54*4882a593Smuzhiyun	CB-114,
55*4882a593Smuzhiyun	CB-134I
56*4882a593Smuzhiyun
57*4882a593Smuzhiyun    - 8 ports multiport board
58*4882a593Smuzhiyun	CP-118EL, CP-168EL,
59*4882a593Smuzhiyun	CP-118U, CP-168U,
60*4882a593Smuzhiyun	C168H/PCI,
61*4882a593Smuzhiyun	C168H, C168HS,
62*4882a593Smuzhiyun	(C168P),
63*4882a593Smuzhiyun	CB-108
64*4882a593Smuzhiyun
65*4882a593Smuzhiyun   This driver and installation procedure have been developed upon Linux Kernel
66*4882a593Smuzhiyun   2.4.x and 2.6.x. This driver supports Intel x86 hardware platform. In order
67*4882a593Smuzhiyun   to maintain compatibility, this version has also been properly tested with
68*4882a593Smuzhiyun   RedHat, Mandrake, Fedora and S.u.S.E Linux. However, if compatibility problem
69*4882a593Smuzhiyun   occurs, please contact Moxa at support@moxa.com.tw.
70*4882a593Smuzhiyun
71*4882a593Smuzhiyun   In addition to device driver, useful utilities are also provided in this
72*4882a593Smuzhiyun   version. They are:
73*4882a593Smuzhiyun
74*4882a593Smuzhiyun    - msdiag
75*4882a593Smuzhiyun		 Diagnostic program for displaying installed Moxa
76*4882a593Smuzhiyun                 Smartio/Industio boards.
77*4882a593Smuzhiyun    - msmon
78*4882a593Smuzhiyun		 Monitor program to observe data count and line status signals.
79*4882a593Smuzhiyun    - msterm     A simple terminal program which is useful in testing serial
80*4882a593Smuzhiyun	         ports.
81*4882a593Smuzhiyun    - io-irq.exe
82*4882a593Smuzhiyun		 Configuration program to setup ISA boards. Please note that
83*4882a593Smuzhiyun                 this program can only be executed under DOS.
84*4882a593Smuzhiyun
85*4882a593Smuzhiyun   All the drivers and utilities are published in form of source code under
86*4882a593Smuzhiyun   GNU General Public License in this version. Please refer to GNU General
87*4882a593Smuzhiyun   Public License announcement in each source code file for more detail.
88*4882a593Smuzhiyun
89*4882a593Smuzhiyun   In Moxa's Web sites, you may always find latest driver at http://www.moxa.com/.
90*4882a593Smuzhiyun
91*4882a593Smuzhiyun   This version of driver can be installed as Loadable Module (Module driver)
92*4882a593Smuzhiyun   or built-in into kernel (Static driver). You may refer to following
93*4882a593Smuzhiyun   installation procedure for suitable one. Before you install the driver,
94*4882a593Smuzhiyun   please refer to hardware installation procedure in the User's Manual.
95*4882a593Smuzhiyun
96*4882a593Smuzhiyun   We assume the user should be familiar with following documents.
97*4882a593Smuzhiyun
98*4882a593Smuzhiyun   - Serial-HOWTO
99*4882a593Smuzhiyun   - Kernel-HOWTO
100*4882a593Smuzhiyun
101*4882a593Smuzhiyun2. System Requirement
102*4882a593Smuzhiyun^^^^^^^^^^^^^^^^^^^^^
103*4882a593Smuzhiyun
104*4882a593Smuzhiyun   - Hardware platform: Intel x86 machine
105*4882a593Smuzhiyun   - Kernel version: 2.4.x or 2.6.x
106*4882a593Smuzhiyun   - gcc version 2.72 or later
107*4882a593Smuzhiyun   - Maximum 4 boards can be installed in combination
108*4882a593Smuzhiyun
109*4882a593Smuzhiyun3. Installation
110*4882a593Smuzhiyun^^^^^^^^^^^^^^^
111*4882a593Smuzhiyun
112*4882a593Smuzhiyun3.1 Hardware installation
113*4882a593Smuzhiyun=========================
114*4882a593Smuzhiyun
115*4882a593Smuzhiyun   There are two types of buses, ISA and PCI, for Smartio/Industio
116*4882a593Smuzhiyun   family multiport board.
117*4882a593Smuzhiyun
118*4882a593SmuzhiyunISA board
119*4882a593Smuzhiyun---------
120*4882a593Smuzhiyun
121*4882a593Smuzhiyun   You'll have to configure CAP address, I/O address, Interrupt Vector
122*4882a593Smuzhiyun   as well as IRQ before installing this driver. Please refer to hardware
123*4882a593Smuzhiyun   installation procedure in User's Manual before proceed any further.
124*4882a593Smuzhiyun   Please make sure the JP1 is open after the ISA board is set properly.
125*4882a593Smuzhiyun
126*4882a593SmuzhiyunPCI/UPCI board
127*4882a593Smuzhiyun--------------
128*4882a593Smuzhiyun
129*4882a593Smuzhiyun   You may need to adjust IRQ usage in BIOS to avoid from IRQ conflict
130*4882a593Smuzhiyun   with other ISA devices. Please refer to hardware installation
131*4882a593Smuzhiyun   procedure in User's Manual in advance.
132*4882a593Smuzhiyun
133*4882a593SmuzhiyunPCI IRQ Sharing
134*4882a593Smuzhiyun---------------
135*4882a593Smuzhiyun
136*4882a593Smuzhiyun   Each port within the same multiport board shares the same IRQ. Up to
137*4882a593Smuzhiyun   4 Moxa Smartio/Industio PCI Family multiport boards can be installed
138*4882a593Smuzhiyun   together on one system and they can share the same IRQ.
139*4882a593Smuzhiyun
140*4882a593Smuzhiyun
141*4882a593Smuzhiyun3.2 Driver files
142*4882a593Smuzhiyun================
143*4882a593Smuzhiyun
144*4882a593Smuzhiyun   The driver file may be obtained from ftp, CD-ROM or floppy disk. The
145*4882a593Smuzhiyun   first step, anyway, is to copy driver file "mxser.tgz" into specified
146*4882a593Smuzhiyun   directory. e.g. /moxa. The execute commands as below::
147*4882a593Smuzhiyun
148*4882a593Smuzhiyun       # cd /
149*4882a593Smuzhiyun       # mkdir moxa
150*4882a593Smuzhiyun       # cd /moxa
151*4882a593Smuzhiyun       # tar xvf /dev/fd0
152*4882a593Smuzhiyun
153*4882a593Smuzhiyunor::
154*4882a593Smuzhiyun
155*4882a593Smuzhiyun       # cd /
156*4882a593Smuzhiyun       # mkdir moxa
157*4882a593Smuzhiyun       # cd /moxa
158*4882a593Smuzhiyun       # cp /mnt/cdrom/<driver directory>/mxser.tgz .
159*4882a593Smuzhiyun       # tar xvfz mxser.tgz
160*4882a593Smuzhiyun
161*4882a593Smuzhiyun
162*4882a593Smuzhiyun3.3 Device naming convention
163*4882a593Smuzhiyun============================
164*4882a593Smuzhiyun
165*4882a593Smuzhiyun   You may find all the driver and utilities files in /moxa/mxser.
166*4882a593Smuzhiyun   Following installation procedure depends on the model you'd like to
167*4882a593Smuzhiyun   run the driver. If you prefer module driver, please refer to 3.4.
168*4882a593Smuzhiyun   If static driver is required, please refer to 3.5.
169*4882a593Smuzhiyun
170*4882a593SmuzhiyunDialin and callout port
171*4882a593Smuzhiyun-----------------------
172*4882a593Smuzhiyun
173*4882a593Smuzhiyun   This driver remains traditional serial device properties. There are
174*4882a593Smuzhiyun   two special file name for each serial port. One is dial-in port
175*4882a593Smuzhiyun   which is named "ttyMxx". For callout port, the naming convention
176*4882a593Smuzhiyun   is "cumxx".
177*4882a593Smuzhiyun
178*4882a593SmuzhiyunDevice naming when more than 2 boards installed
179*4882a593Smuzhiyun-----------------------------------------------
180*4882a593Smuzhiyun
181*4882a593Smuzhiyun   Naming convention for each Smartio/Industio multiport board is
182*4882a593Smuzhiyun   pre-defined as below.
183*4882a593Smuzhiyun
184*4882a593Smuzhiyun   ============ ===============       ==============
185*4882a593Smuzhiyun   Board Num.	 Dial-in Port	      Callout port
186*4882a593Smuzhiyun   1st board	ttyM0  - ttyM7	      cum0  - cum7
187*4882a593Smuzhiyun   2nd board	ttyM8  - ttyM15       cum8  - cum15
188*4882a593Smuzhiyun   3rd board	ttyM16 - ttyM23       cum16 - cum23
189*4882a593Smuzhiyun   4th board	ttyM24 - ttym31       cum24 - cum31
190*4882a593Smuzhiyun   ============ ===============       ==============
191*4882a593Smuzhiyun
192*4882a593Smuzhiyun.. note::
193*4882a593Smuzhiyun
194*4882a593Smuzhiyun   Under Kernel 2.6 and upper, the cum Device is Obsolete. So use ttyM*
195*4882a593Smuzhiyun   device instead.
196*4882a593Smuzhiyun
197*4882a593SmuzhiyunBoard sequence
198*4882a593Smuzhiyun--------------
199*4882a593Smuzhiyun
200*4882a593Smuzhiyun   This driver will activate ISA boards according to the parameter set
201*4882a593Smuzhiyun   in the driver. After all specified ISA board activated, PCI board
202*4882a593Smuzhiyun   will be installed in the system automatically driven.
203*4882a593Smuzhiyun   Therefore the board number is sorted by the CAP address of ISA boards.
204*4882a593Smuzhiyun   For PCI boards, their sequence will be after ISA boards and C168H/PCI
205*4882a593Smuzhiyun   has higher priority than C104H/PCI boards.
206*4882a593Smuzhiyun
207*4882a593Smuzhiyun3.4 Module driver configuration
208*4882a593Smuzhiyun===============================
209*4882a593Smuzhiyun
210*4882a593Smuzhiyun   Module driver is easiest way to install. If you prefer static driver
211*4882a593Smuzhiyun   installation, please skip this paragraph.
212*4882a593Smuzhiyun
213*4882a593Smuzhiyun
214*4882a593Smuzhiyun   ------------- Prepare to use the MOXA driver --------------------
215*4882a593Smuzhiyun
216*4882a593Smuzhiyun3.4.1 Create tty device with correct major number
217*4882a593Smuzhiyun-------------------------------------------------
218*4882a593Smuzhiyun
219*4882a593Smuzhiyun   Before using MOXA driver, your system must have the tty devices
220*4882a593Smuzhiyun   which are created with driver's major number. We offer one shell
221*4882a593Smuzhiyun   script "msmknod" to simplify the procedure.
222*4882a593Smuzhiyun   This step is only needed to be executed once. But you still
223*4882a593Smuzhiyun   need to do this procedure when:
224*4882a593Smuzhiyun
225*4882a593Smuzhiyun   a. You change the driver's major number. Please refer the "3.7"
226*4882a593Smuzhiyun      section.
227*4882a593Smuzhiyun   b. Your total installed MOXA boards number is changed. Maybe you
228*4882a593Smuzhiyun      add/delete one MOXA board.
229*4882a593Smuzhiyun   c. You want to change the tty name. This needs to modify the
230*4882a593Smuzhiyun      shell script "msmknod"
231*4882a593Smuzhiyun
232*4882a593Smuzhiyun   The procedure is::
233*4882a593Smuzhiyun
234*4882a593Smuzhiyun	 # cd /moxa/mxser/driver
235*4882a593Smuzhiyun	 # ./msmknod
236*4882a593Smuzhiyun
237*4882a593Smuzhiyun   This shell script will require the major number for dial-in
238*4882a593Smuzhiyun   device and callout device to create tty device. You also need
239*4882a593Smuzhiyun   to specify the total installed MOXA board number. Default major
240*4882a593Smuzhiyun   numbers for dial-in device and callout device are 30, 35. If
241*4882a593Smuzhiyun   you need to change to other number, please refer section "3.7"
242*4882a593Smuzhiyun   for more detailed procedure.
243*4882a593Smuzhiyun   Msmknod will delete any special files occupying the same device
244*4882a593Smuzhiyun   naming.
245*4882a593Smuzhiyun
246*4882a593Smuzhiyun3.4.2 Build the MOXA driver and utilities
247*4882a593Smuzhiyun-----------------------------------------
248*4882a593Smuzhiyun
249*4882a593Smuzhiyun   Before using the MOXA driver and utilities, you need compile the
250*4882a593Smuzhiyun   all the source code. This step is only need to be executed once.
251*4882a593Smuzhiyun   But you still re-compile the source code if you modify the source
252*4882a593Smuzhiyun   code. For example, if you change the driver's major number (see
253*4882a593Smuzhiyun   "3.7" section), then you need to do this step again.
254*4882a593Smuzhiyun
255*4882a593Smuzhiyun   Find "Makefile" in /moxa/mxser, then run
256*4882a593Smuzhiyun
257*4882a593Smuzhiyun	 # make clean; make install
258*4882a593Smuzhiyun
259*4882a593Smuzhiyun   ..note::
260*4882a593Smuzhiyun
261*4882a593Smuzhiyun	 For Red Hat 9, Red Hat Enterprise Linux AS3/ES3/WS3 & Fedora Core1:
262*4882a593Smuzhiyun	 # make clean; make installsp1
263*4882a593Smuzhiyun
264*4882a593Smuzhiyun	 For Red Hat Enterprise Linux AS4/ES4/WS4:
265*4882a593Smuzhiyun	 # make clean; make installsp2
266*4882a593Smuzhiyun
267*4882a593Smuzhiyun   The driver files "mxser.o" and utilities will be properly compiled
268*4882a593Smuzhiyun   and copied to system directories respectively.
269*4882a593Smuzhiyun
270*4882a593Smuzhiyun------------- Load MOXA driver--------------------
271*4882a593Smuzhiyun
272*4882a593Smuzhiyun3.4.3 Load the MOXA driver
273*4882a593Smuzhiyun--------------------------
274*4882a593Smuzhiyun
275*4882a593Smuzhiyun   ::
276*4882a593Smuzhiyun
277*4882a593Smuzhiyun	 # modprobe mxser <argument>
278*4882a593Smuzhiyun
279*4882a593Smuzhiyun   will activate the module driver. You may run "lsmod" to check
280*4882a593Smuzhiyun   if "mxser" is activated. If the MOXA board is ISA board, the
281*4882a593Smuzhiyun   <argument> is needed. Please refer to section "3.4.5" for more
282*4882a593Smuzhiyun   information.
283*4882a593Smuzhiyun
284*4882a593Smuzhiyun------------- Load MOXA driver on boot --------------------
285*4882a593Smuzhiyun
286*4882a593Smuzhiyun3.4.4 Load the mxser driver
287*4882a593Smuzhiyun---------------------------
288*4882a593Smuzhiyun
289*4882a593Smuzhiyun
290*4882a593Smuzhiyun   For the above description, you may manually execute
291*4882a593Smuzhiyun   "modprobe mxser" to activate this driver and run
292*4882a593Smuzhiyun   "rmmod mxser" to remove it.
293*4882a593Smuzhiyun
294*4882a593Smuzhiyun   However, it's better to have a boot time configuration to
295*4882a593Smuzhiyun   eliminate manual operation. Boot time configuration can be
296*4882a593Smuzhiyun   achieved by rc file. We offer one "rc.mxser" file to simplify
297*4882a593Smuzhiyun   the procedure under "moxa/mxser/driver".
298*4882a593Smuzhiyun
299*4882a593Smuzhiyun   But if you use ISA board, please modify the "modprobe ..." command
300*4882a593Smuzhiyun   to add the argument (see "3.4.5" section). After modifying the
301*4882a593Smuzhiyun   rc.mxser, please try to execute "/moxa/mxser/driver/rc.mxser"
302*4882a593Smuzhiyun   manually to make sure the modification is ok. If any error
303*4882a593Smuzhiyun   encountered, please try to modify again. If the modification is
304*4882a593Smuzhiyun   completed, follow the below step.
305*4882a593Smuzhiyun
306*4882a593Smuzhiyun   Run following command for setting rc files::
307*4882a593Smuzhiyun
308*4882a593Smuzhiyun	 # cd /moxa/mxser/driver
309*4882a593Smuzhiyun	 # cp ./rc.mxser /etc/rc.d
310*4882a593Smuzhiyun	 # cd /etc/rc.d
311*4882a593Smuzhiyun
312*4882a593Smuzhiyun   Check "rc.serial" is existed or not. If "rc.serial" doesn't exist,
313*4882a593Smuzhiyun   create it by vi, run "chmod 755 rc.serial" to change the permission.
314*4882a593Smuzhiyun
315*4882a593Smuzhiyun   Add "/etc/rc.d/rc.mxser" in last line.
316*4882a593Smuzhiyun
317*4882a593Smuzhiyun   Reboot and check if moxa.o activated by "lsmod" command.
318*4882a593Smuzhiyun
319*4882a593Smuzhiyun3.4.5. specify CAP address
320*4882a593Smuzhiyun--------------------------
321*4882a593Smuzhiyun
322*4882a593Smuzhiyun   If you'd like to drive Smartio/Industio ISA boards in the system,
323*4882a593Smuzhiyun   you'll have to add parameter to specify CAP address of given
324*4882a593Smuzhiyun   board while activating "mxser.o". The format for parameters are
325*4882a593Smuzhiyun   as follows.::
326*4882a593Smuzhiyun
327*4882a593Smuzhiyun	   modprobe mxser ioaddr=0x???,0x???,0x???,0x???
328*4882a593Smuzhiyun				  |  |  |    |
329*4882a593Smuzhiyun				  |  |  |    +- 4th ISA board
330*4882a593Smuzhiyun				  |  |  +------ 3rd ISA board
331*4882a593Smuzhiyun				  |  +------------ 2nd ISA board
332*4882a593Smuzhiyun				  +-------------------1st ISA board
333*4882a593Smuzhiyun
334*4882a593Smuzhiyun3.5 Static driver configuration for Linux kernel 2.4.x and 2.6.x
335*4882a593Smuzhiyun================================================================
336*4882a593Smuzhiyun
337*4882a593Smuzhiyun    Note:
338*4882a593Smuzhiyun          To use static driver, you must install the linux kernel
339*4882a593Smuzhiyun          source package.
340*4882a593Smuzhiyun
341*4882a593Smuzhiyun3.5.1 Backup the built-in driver in the kernel
342*4882a593Smuzhiyun----------------------------------------------
343*4882a593Smuzhiyun
344*4882a593Smuzhiyun    ::
345*4882a593Smuzhiyun
346*4882a593Smuzhiyun       # cd /usr/src/linux/drivers/char
347*4882a593Smuzhiyun       # mv mxser.c mxser.c.old
348*4882a593Smuzhiyun
349*4882a593Smuzhiyun       For Red Hat 7.x user, you need to create link:
350*4882a593Smuzhiyun       # cd /usr/src
351*4882a593Smuzhiyun       # ln -s linux-2.4 linux
352*4882a593Smuzhiyun
353*4882a593Smuzhiyun3.5.2 Create link
354*4882a593Smuzhiyun-----------------
355*4882a593Smuzhiyun    ::
356*4882a593Smuzhiyun
357*4882a593Smuzhiyun	  # cd /usr/src/linux/drivers/char
358*4882a593Smuzhiyun	  # ln -s /moxa/mxser/driver/mxser.c mxser.c
359*4882a593Smuzhiyun
360*4882a593Smuzhiyun3.5.3 Add CAP address list for ISA boards.
361*4882a593Smuzhiyun------------------------------------------
362*4882a593Smuzhiyun
363*4882a593Smuzhiyun    For PCI boards user, please skip this step.
364*4882a593Smuzhiyun
365*4882a593Smuzhiyun    In module mode, the CAP address for ISA board is given by
366*4882a593Smuzhiyun    parameter. In static driver configuration, you'll have to
367*4882a593Smuzhiyun    assign it within driver's source code. If you will not
368*4882a593Smuzhiyun    install any ISA boards, you may skip to next portion.
369*4882a593Smuzhiyun    The instructions to modify driver source code are as
370*4882a593Smuzhiyun    below.
371*4882a593Smuzhiyun
372*4882a593Smuzhiyun    a. run::
373*4882a593Smuzhiyun
374*4882a593Smuzhiyun	# cd /moxa/mxser/driver
375*4882a593Smuzhiyun	# vi mxser.c
376*4882a593Smuzhiyun
377*4882a593Smuzhiyun    b. Find the array mxserBoardCAP[] as below::
378*4882a593Smuzhiyun
379*4882a593Smuzhiyun	  static int mxserBoardCAP[] = {0x00, 0x00, 0x00, 0x00};
380*4882a593Smuzhiyun
381*4882a593Smuzhiyun    c. Change the address within this array using vi. For
382*4882a593Smuzhiyun       example, to driver 2 ISA boards with CAP address
383*4882a593Smuzhiyun       0x280 and 0x180 as 1st and 2nd board. Just to change
384*4882a593Smuzhiyun       the source code as follows::
385*4882a593Smuzhiyun
386*4882a593Smuzhiyun	  static int mxserBoardCAP[] = {0x280, 0x180, 0x00, 0x00};
387*4882a593Smuzhiyun
388*4882a593Smuzhiyun3.5.4 Setup kernel configuration
389*4882a593Smuzhiyun--------------------------------
390*4882a593Smuzhiyun
391*4882a593Smuzhiyun    Configure the kernel::
392*4882a593Smuzhiyun
393*4882a593Smuzhiyun      # cd /usr/src/linux
394*4882a593Smuzhiyun      # make menuconfig
395*4882a593Smuzhiyun
396*4882a593Smuzhiyun    You will go into a menu-driven system. Please select [Character
397*4882a593Smuzhiyun    devices][Non-standard serial port support], enable the [Moxa
398*4882a593Smuzhiyun    SmartIO support] driver with "[*]" for built-in (not "[M]"), then
399*4882a593Smuzhiyun    select [Exit] to exit this program.
400*4882a593Smuzhiyun
401*4882a593Smuzhiyun3.5.5 Rebuild kernel
402*4882a593Smuzhiyun--------------------
403*4882a593Smuzhiyun
404*4882a593Smuzhiyun    The following are for Linux kernel rebuilding, for your
405*4882a593Smuzhiyun    reference only.
406*4882a593Smuzhiyun
407*4882a593Smuzhiyun    For appropriate details, please refer to the Linux document:
408*4882a593Smuzhiyun
409*4882a593Smuzhiyun        a. Run the following commands::
410*4882a593Smuzhiyun
411*4882a593Smuzhiyun	     cd /usr/src/linux
412*4882a593Smuzhiyun	     make clean		     # take a few minutes
413*4882a593Smuzhiyun	     make dep		     # take a few minutes
414*4882a593Smuzhiyun	     make bzImage	     # take probably 10-20 minutes
415*4882a593Smuzhiyun	     make install	     # copy boot image to correct position
416*4882a593Smuzhiyun
417*4882a593Smuzhiyun	f. Please make sure the boot kernel (vmlinuz) is in the
418*4882a593Smuzhiyun	   correct position.
419*4882a593Smuzhiyun	g. If you use 'lilo' utility, you should check /etc/lilo.conf
420*4882a593Smuzhiyun	   'image' item specified the path which is the 'vmlinuz' path,
421*4882a593Smuzhiyun	   or you will load wrong (or old) boot kernel image (vmlinuz).
422*4882a593Smuzhiyun	   After checking /etc/lilo.conf, please run "lilo".
423*4882a593Smuzhiyun
424*4882a593Smuzhiyun	  Note that if the result of "make bzImage" is ERROR, then you have to
425*4882a593Smuzhiyun	  go back to Linux configuration Setup. Type "make menuconfig" in
426*4882a593Smuzhiyun          directory /usr/src/linux.
427*4882a593Smuzhiyun
428*4882a593Smuzhiyun
429*4882a593Smuzhiyun3.5.6 Make tty device and special file
430*4882a593Smuzhiyun--------------------------------------
431*4882a593Smuzhiyun
432*4882a593Smuzhiyun    ::
433*4882a593Smuzhiyun       # cd /moxa/mxser/driver
434*4882a593Smuzhiyun       # ./msmknod
435*4882a593Smuzhiyun
436*4882a593Smuzhiyun3.5.7 Make utility
437*4882a593Smuzhiyun------------------
438*4882a593Smuzhiyun
439*4882a593Smuzhiyun    ::
440*4882a593Smuzhiyun
441*4882a593Smuzhiyun	  # cd /moxa/mxser/utility
442*4882a593Smuzhiyun	  # make clean; make install
443*4882a593Smuzhiyun
444*4882a593Smuzhiyun3.5.8 Reboot
445*4882a593Smuzhiyun------------
446*4882a593Smuzhiyun
447*4882a593Smuzhiyun
448*4882a593Smuzhiyun
449*4882a593Smuzhiyun3.6 Custom configuration
450*4882a593Smuzhiyun========================
451*4882a593Smuzhiyun
452*4882a593Smuzhiyun    Although this driver already provides you default configuration, you
453*4882a593Smuzhiyun    still can change the device name and major number. The instruction to
454*4882a593Smuzhiyun    change these parameters are shown as below.
455*4882a593Smuzhiyun
456*4882a593Smuzhiyuna. Change Device name
457*4882a593Smuzhiyun
458*4882a593Smuzhiyun    If you'd like to use other device names instead of default naming
459*4882a593Smuzhiyun    convention, all you have to do is to modify the internal code
460*4882a593Smuzhiyun    within the shell script "msmknod". First, you have to open "msmknod"
461*4882a593Smuzhiyun    by vi. Locate each line contains "ttyM" and "cum" and change them
462*4882a593Smuzhiyun    to the device name you desired. "msmknod" creates the device names
463*4882a593Smuzhiyun    you need next time executed.
464*4882a593Smuzhiyun
465*4882a593Smuzhiyunb. Change Major number
466*4882a593Smuzhiyun
467*4882a593Smuzhiyun    If major number 30 and 35 had been occupied, you may have to select
468*4882a593Smuzhiyun    2 free major numbers for this driver. There are 3 steps to change
469*4882a593Smuzhiyun    major numbers.
470*4882a593Smuzhiyun
471*4882a593Smuzhiyun3.6.1 Find free major numbers
472*4882a593Smuzhiyun-----------------------------
473*4882a593Smuzhiyun
474*4882a593Smuzhiyun    In /proc/devices, you may find all the major numbers occupied
475*4882a593Smuzhiyun    in the system. Please select 2 major numbers that are available.
476*4882a593Smuzhiyun    e.g. 40, 45.
477*4882a593Smuzhiyun
478*4882a593Smuzhiyun3.6.2 Create special files
479*4882a593Smuzhiyun--------------------------
480*4882a593Smuzhiyun
481*4882a593Smuzhiyun   Run /moxa/mxser/driver/msmknod to create special files with
482*4882a593Smuzhiyun   specified major numbers.
483*4882a593Smuzhiyun
484*4882a593Smuzhiyun3.6.3 Modify driver with new major number
485*4882a593Smuzhiyun-----------------------------------------
486*4882a593Smuzhiyun
487*4882a593Smuzhiyun   Run vi to open /moxa/mxser/driver/mxser.c. Locate the line
488*4882a593Smuzhiyun   contains "MXSERMAJOR". Change the content as below::
489*4882a593Smuzhiyun
490*4882a593Smuzhiyun	  #define	  MXSERMAJOR		  40
491*4882a593Smuzhiyun	  #define	  MXSERCUMAJOR		  45
492*4882a593Smuzhiyun
493*4882a593Smuzhiyun    3.6.4 Run "make clean; make install" in /moxa/mxser/driver.
494*4882a593Smuzhiyun
495*4882a593Smuzhiyun3.7 Verify driver installation
496*4882a593Smuzhiyun==============================
497*4882a593Smuzhiyun
498*4882a593Smuzhiyun    You may refer to /var/log/messages to check the latest status
499*4882a593Smuzhiyun    log reported by this driver whenever it's activated.
500*4882a593Smuzhiyun
501*4882a593Smuzhiyun4. Utilities
502*4882a593Smuzhiyun^^^^^^^^^^^^
503*4882a593Smuzhiyun
504*4882a593Smuzhiyun   There are 3 utilities contained in this driver. They are msdiag, msmon and
505*4882a593Smuzhiyun   msterm. These 3 utilities are released in form of source code. They should
506*4882a593Smuzhiyun   be compiled into executable file and copied into /usr/bin.
507*4882a593Smuzhiyun
508*4882a593Smuzhiyun   Before using these utilities, please load driver (refer 3.4 & 3.5) and
509*4882a593Smuzhiyun   make sure you had run the "msmknod" utility.
510*4882a593Smuzhiyun
511*4882a593Smuzhiyunmsdiag - Diagnostic
512*4882a593Smuzhiyun===================
513*4882a593Smuzhiyun
514*4882a593Smuzhiyun   This utility provides the function to display what Moxa Smartio/Industio
515*4882a593Smuzhiyun   board found by driver in the system.
516*4882a593Smuzhiyun
517*4882a593Smuzhiyunmsmon - Port Monitoring
518*4882a593Smuzhiyun=======================
519*4882a593Smuzhiyun
520*4882a593Smuzhiyun   This utility gives the user a quick view about all the MOXA ports'
521*4882a593Smuzhiyun   activities. One can easily learn each port's total received/transmitted
522*4882a593Smuzhiyun   (Rx/Tx) character count since the time when the monitoring is started.
523*4882a593Smuzhiyun
524*4882a593Smuzhiyun   Rx/Tx throughputs per second are also reported in interval basis (e.g.
525*4882a593Smuzhiyun   the last 5 seconds) and in average basis (since the time the monitoring
526*4882a593Smuzhiyun   is started). You can reset all ports' count by <HOME> key. <+> <->
527*4882a593Smuzhiyun   (plus/minus) keys to change the displaying time interval. Press <ENTER>
528*4882a593Smuzhiyun   on the port, that cursor stay, to view the port's communication
529*4882a593Smuzhiyun   parameters, signal status, and input/output queue.
530*4882a593Smuzhiyun
531*4882a593Smuzhiyunmsterm - Terminal Emulation
532*4882a593Smuzhiyun===========================
533*4882a593Smuzhiyun
534*4882a593Smuzhiyun   This utility provides data sending and receiving ability of all tty ports,
535*4882a593Smuzhiyun   especially for MOXA ports. It is quite useful for testing simple
536*4882a593Smuzhiyun   application, for example, sending AT command to a modem connected to the
537*4882a593Smuzhiyun   port or used as a terminal for login purpose. Note that this is only a
538*4882a593Smuzhiyun   dumb terminal emulation without handling full screen operation.
539*4882a593Smuzhiyun
540*4882a593Smuzhiyun5. Setserial
541*4882a593Smuzhiyun^^^^^^^^^^^^
542*4882a593Smuzhiyun
543*4882a593Smuzhiyun   Supported Setserial parameters are listed as below.
544*4882a593Smuzhiyun
545*4882a593Smuzhiyun   ============== =========================================================
546*4882a593Smuzhiyun   uart		  set UART type(16450-->disable FIFO, 16550A-->enable FIFO)
547*4882a593Smuzhiyun   close_delay	  set the amount of time(in 1/100 of a second) that DTR
548*4882a593Smuzhiyun		  should be kept low while being closed.
549*4882a593Smuzhiyun   closing_wait   set the amount of time(in 1/100 of a second) that the
550*4882a593Smuzhiyun		  serial port should wait for data to be drained while
551*4882a593Smuzhiyun		  being closed, before the receiver is disable.
552*4882a593Smuzhiyun   spd_hi	  Use  57.6kb  when  the application requests 38.4kb.
553*4882a593Smuzhiyun   spd_vhi	  Use  115.2kb	when  the application requests 38.4kb.
554*4882a593Smuzhiyun   spd_shi	  Use  230.4kb	when  the application requests 38.4kb.
555*4882a593Smuzhiyun   spd_warp	  Use  460.8kb	when  the application requests 38.4kb.
556*4882a593Smuzhiyun   spd_normal	  Use  38.4kb  when  the application requests 38.4kb.
557*4882a593Smuzhiyun   spd_cust	  Use  the custom divisor to set the speed when  the
558*4882a593Smuzhiyun		  application requests 38.4kb.
559*4882a593Smuzhiyun   divisor	  This option set the custom division.
560*4882a593Smuzhiyun   baud_base	  This option set the base baud rate.
561*4882a593Smuzhiyun   ============== =========================================================
562*4882a593Smuzhiyun
563*4882a593Smuzhiyun6. Troubleshooting
564*4882a593Smuzhiyun^^^^^^^^^^^^^^^^^^
565*4882a593Smuzhiyun
566*4882a593Smuzhiyun   The boot time error messages and solutions are stated as clearly as
567*4882a593Smuzhiyun   possible. If all the possible solutions fail, please contact our technical
568*4882a593Smuzhiyun   support team to get more help.
569*4882a593Smuzhiyun
570*4882a593Smuzhiyun
571*4882a593Smuzhiyun   Error msg:
572*4882a593Smuzhiyun	      More than 4 Moxa Smartio/Industio family boards found. Fifth board
573*4882a593Smuzhiyun              and after are ignored.
574*4882a593Smuzhiyun
575*4882a593Smuzhiyun   Solution:
576*4882a593Smuzhiyun   To avoid this problem, please unplug fifth and after board, because Moxa
577*4882a593Smuzhiyun   driver supports up to 4 boards.
578*4882a593Smuzhiyun
579*4882a593Smuzhiyun   Error msg:
580*4882a593Smuzhiyun	      Request_irq fail, IRQ(?) may be conflict with another device.
581*4882a593Smuzhiyun
582*4882a593Smuzhiyun   Solution:
583*4882a593Smuzhiyun   Other PCI or ISA devices occupy the assigned IRQ. If you are not sure
584*4882a593Smuzhiyun   which device causes the situation, please check /proc/interrupts to find
585*4882a593Smuzhiyun   free IRQ and simply change another free IRQ for Moxa board.
586*4882a593Smuzhiyun
587*4882a593Smuzhiyun   Error msg:
588*4882a593Smuzhiyun	      Board #: C1xx Series(CAP=xxx) interrupt number invalid.
589*4882a593Smuzhiyun
590*4882a593Smuzhiyun   Solution:
591*4882a593Smuzhiyun   Each port within the same multiport board shares the same IRQ. Please set
592*4882a593Smuzhiyun   one IRQ (IRQ doesn't equal to zero) for one Moxa board.
593*4882a593Smuzhiyun
594*4882a593Smuzhiyun   Error msg:
595*4882a593Smuzhiyun	      No interrupt vector be set for Moxa ISA board(CAP=xxx).
596*4882a593Smuzhiyun
597*4882a593Smuzhiyun   Solution:
598*4882a593Smuzhiyun   Moxa ISA board needs an interrupt vector.Please refer to user's manual
599*4882a593Smuzhiyun   "Hardware Installation" chapter to set interrupt vector.
600*4882a593Smuzhiyun
601*4882a593Smuzhiyun   Error msg:
602*4882a593Smuzhiyun              Couldn't install MOXA Smartio/Industio family driver!
603*4882a593Smuzhiyun
604*4882a593Smuzhiyun   Solution:
605*4882a593Smuzhiyun   Load Moxa driver fail, the major number may conflict with other devices.
606*4882a593Smuzhiyun   Please refer to previous section 3.7 to change a free major number for
607*4882a593Smuzhiyun   Moxa driver.
608*4882a593Smuzhiyun
609*4882a593Smuzhiyun   Error msg:
610*4882a593Smuzhiyun              Couldn't install MOXA Smartio/Industio family callout driver!
611*4882a593Smuzhiyun
612*4882a593Smuzhiyun   Solution:
613*4882a593Smuzhiyun   Load Moxa callout driver fail, the callout device major number may
614*4882a593Smuzhiyun   conflict with other devices. Please refer to previous section 3.7 to
615*4882a593Smuzhiyun   change a free callout device major number for Moxa driver.
616