==========================================================================================
=                                                                                        =
=                  SUNIX Multi-I/O Board Driver Installation Guide                       =
=                                                                                        =
=                                 For Kernel 2.4 & 2.6                                   =
=             Copyright 2006 - 2010  SUNIX Co., Ltd. all right reserved                  =
=                                                                   Version: 1.3.3.0     =
=                                                                   Date: 2011/07/29     =
==========================================================================================

Item

A. Release note

B. Introduction

C. Installation

   C.1 Driver install
   C.2 Device node creation
	
D. Loading driver automatic after system bootup
   
   D.1 
    RedHat 8
    Fedora Core 1
    Fedora Core 8
    Fedora Core 10
    Fedora Core 11
    Mandriva 2008
       		
   D.2 
    Suse 9.3
    SuSE 11.2 Milestone 4

   D.3 
    Ubutu 8.04 Destop
	
   D.4 
    Turbo Liunx 10
    Red Hat Enterprise Liunx 4.0 	
       
   D.5 
    Others	

E. Utility

   E.1  snxdump
   E.2	snxterm

==========================================================================================

A. Release note

	Support kernel 2.4 and 2.6 on x86 machine only.  
	Before driver installation. Make sure system with c compiler/kernel development/ncurses package.
	
	2006/07/10 - Ver:1.0.2.0
		1) Add snxterm program into driver package
		2) Fix read fcr register in driver and backup a fcr register value in struct
		3) Test RedHat Enterprise Linux AS 4.0 and ES 4.0
		
	2006/10/02 - Ver:1.0.3.0
		1) Add GNU information in driver
		2) Test SlackWare 10.2 (kernel 2.6.13)
		3) Support 4027D, 4037D and 4056D

	2006/10/12 - Ver:1.0.4.0
		1) Fix system hanged. Modem interrupt can't be cleared by reading iir and msr
		   register for SUN1699 chip

	2006/12/01 - Ver:1.0.5.0
		1) Fix system hanged. Data coming but device node didn't opened, when open, system 
		   maybe crash
		2) Add version information in /var/log/messages
		3) Test TurboLinux 10
	
	2007/03/31 - Ver:1.0.6.0
		1) Fix data receiving function
		2) Modify ioctl function for dump port informations

	2007/08/08 - Ver:1.0.7.0
		1) Support kernel up to 2.6.22
		2) Add driver version information in snxdump
		3) snxterm upgrade to V1.0.1.0, make snxterm simply

	2007/09/14 - Ver:1.0.8.0
		1) Support kernel 2.6 and 2.4 both
		2) snxterm upgrade to V1.0.2.0
		
	2008/05/12 - Ver:1.0.9.0
		1) Fix setserial command fail
		2) Support sunix series multi I/O board
		
	2008/09/05 - Ver:1.1.0.0
		1) snxdump upgrade to V1.0.2.0
	
	2009/03/24 - Ver:1.1.1.0
		1) Support kernel up to 2.6.27		

	2009/04/03 - Ver:1.2.0.0
		1) Support both golden and matrix series
		2) Support kernel up to 2.6.28 and 2.4.37
		3) snxdump upgrade to V1.2.0.0	
		4) snxmknod upgrade to V1.2.0.0
		
	2009/04/06 - Ver:1.2.1.0
		1) snxdump upgrade to V1.2.1.0	
		2) snxterm upgrade to V1.0.3.0		
		
	2009/08/30 - Ver:1.3.0.0
		1) Support golden / matrix / sun1999 series
		2) Support kernel up to 2.6.30 and 2.4.37
     		3) Delete #include<form.h> in /snxterm/snxterm.c 
  
  2009/12/01 - Ver:1.3.1.0
		1) Support kernel up to 2.6.31 
		
	2010/12/15 - Ver:1.3.2.0
		1) Support Cash Drawer / 3-in-1 / DIO series   
		2) snxmknod upgrade to V1.3.1.0
		3) snxdump upgrade to Version: 1.2.2.0
		4) Support kernel up to 2.6.36 
		
	2011/07/29 - Ver:1.3.3.0
		1) Support kernel up to 2.6.38  
		2) Upgrade SNX_UART_GET_TYPE function
		3) Upgrade SNX_UART_SET_TYPE function
		4) Support SNX_UART_GET_ACS function	
		4) Support SNX_UART_SET_ACS function 
				
------------------------------------------------------------------------------------------

B. Introduction

	Maximum 4 boards can be installed in combination(up to 32 serial port and 2 parallel port), 
	support sunix multi i/o boards as list below.

	(S - serial port, P - parallel port)

	Golden series
	
	1S -
		4027T
		4027A
		4027AL
		4027D
		4027DL
		4027P

	2S -
		4037T
		4037A
		4037AL
		4037D
		4037U
		4037P
		4037PL	
		
	4S -
		4056A
		4056A3
		4056A4
		4056AL
		4056D
		4056J
		4056U
		4056UE
		4056P
		4056PL
		4056PM		
		4055WN
		
		4056DW
		4056AM
		4056LM
		4056LL
		4056JM
		4056LV
		4000A
		4000AL
		4000P
		4000PL	

	8S -
		4066R
		4066U
		4066UE

		4066WM
		4066RM
		4066JM
		8000A
		8000AL		
		
	2S1P -
		4079AT		
				
				
	2S2P -
		4089AM
		
		
	4S2P - 
		4096A
				
	
	Matrix series
	
	2S -
		P1002
		P2002
		
	4S -
		P1004
		P2004
		P3004
		
	8S -
		P1008
		P2008
		P3008								
		
	16S -
		P1016

	
	SUN1999 series 
		
	1S -
		5027A
		5027AL
		5027H
		5027HL
		5027P
		5027PL
		5027PH
		5027PHL
	
	2S -
		5037A
		5037H
		5037AL
		5037HL
		5037P
		5037PH
		5037PL
		5037PHL
		
	4S -
		5056A
		5056AL
		5056H
		5056HL
		5056P
		5056PL
		5056PH
		5056PHL
		5056U
		5056UL
		5056UH
		5056UHL
		
	8S -
		5066A
		5066H
		5066AL
		5066HL
		5066U
		5066UL
		5066UH
		5066UHL
		
	16S -	
		5016H		
					
	1P -
		5008A	
	
	1S1P -
		5069A
		5069H
		5069P
		5069PH
		
	2S1P -
		5079A
		5079H
		5079AL
				
	4S1P - 
		5099A
		5099H	
	
	2S -
		IPC-P2102
		IPC-P2102SI
	
	4S -
		IPC-P2104
		IPC-P2104SI
		IPC-P3104
	
	8S -
		IPC-P2108
		IPC-P2108SI
		IPC-P3108
	
	16S -	
		IPC-P2116			
		
	Cash Drawer -
		
		CDK1037A
		CDK1037P
		CDK1037H
		CDK1037L
		
		CDK1056A
		CDK1056P
		CDK1056H
		CDK1056L
		
	DIO -
		DIO0802
		DIO1604
		DIO3204

------------------------------------------------------------------------------------------

C. Installation
	
	C.1 Driver install
		Please create a directory under root directory,  e.g /temp, do commands:

		# cd /
		# mkdir temp

		After get driver file "snx_Vx.x.x.x.tar.gz". Copy file to /temp
		directory, then extract and install, do commands:

		# cp snx_Vx.x.x.x.tar.gz /temp 
		# cd /temp
		# tar xvf snx_Vx.x.x.x.tar.gz
		# cd /temp/snx
		# make clean ; make install

		*************************************************************
		* If system is Suse 9.0 and errors occur when               *
		* "make clean ; make install", do commands:                 *
		*                                                           *
		* # cd /usr/src/linux/                                      *
		* # make cloneconfig                                        *
		* # make dep                                                * 
		*                                                           *
		* then do "make clean ; make install" again in /temp/snx    *
		*************************************************************

		Load driver module, do command:

		# modprobe snx
		or
		# insmod /temp/snx/driver/snx.ko (snx.o for kernel 2.4)


		Check driver module, do command:
		# lsmod | grep snx


		Unload driver, do command:
		# rmmod snx


	C.2 Device node creation 
		Each serial port has one device node which is named "ttySNX?",
		maximum up to 32 serial ports.
		
		Each parallel port has two device node which is name "lp?" and
		"parport?". This step will backup lp2~lp3 and parport2~parport3 
		to lp?.bak and parport?.bak in /dev for your system first. Then,
		create lp2~lp3 and parport2~parport3 in /dev for sunix driver,
		maximum up tp 2 parallel ports.
		
		This setp will be done when do "make clean ; make install", if
		device nodes aren't in /dev, do commands:
				
		# cd /temp/snx/snxmknod
		# ./snxmknod

		This will create device nodes in /dev.

		If there are more than two boards installed, serial port device
		nameing convention please refer to E1.

------------------------------------------------------------------------------------------

D. Loading driver automatic after system bootup

  	
	D.1 
	    After finish item C. Edit /etc/rc.d/rc.local for loading driver 
	    automatic after system bootup. Use vi or other editor to open rc.local, 
	    and add "modprobe snx" in last line.


	D.2 
	    After finish item C.
	    Edit /etc/rc.d/boot.local for loading driver automatic after system bootup. 
	    Use vi or other	editor to open boot.local, and add "modprobe snx" in last line.
	    Edit /etc/rc.d/halt.lAfter finish item D. Edit /etc/rc.d/rc.local for loading driver 
	    automatic after system bootup. Use vi or other editor to open rc.local, 
	    and add "modprobe snx" in last line.ocal for unloading driver when system halt. 
	    Use vi or other editor to open halt.local, and add "rmmod snx" in last line.
	    
	    
	D.3 
	    After finish item C. Edit /etc/init.d/rc.local for loading driver 
	    automatic after system bootup. Use vi or other editor to open rc.local, 
	    and add words as below in last line.

			mv /dev/lp2 /dev/lp2.bak
			mv /dev/lp3 /dev/lp3.bak
			mknod /dev/lp2 c 246 2
			mknod /dev/lp3 c 246 3
			chmod a+w /dev/lp2
			chmod a+w /dev/lp3
	
			mv /dev/parport2 /dev/parport2.bak
			mv /dev/parport3 /dev/parport3.bak
			mknod /dev/parport2 c 247 2
			mknod /dev/parport3 c 247 3
			chmod a+w /dev/parport2
			chmod a+w /dev/parport3
				
			modprobe snx

		
	D.4 
	    After finish item C. Edit /etc/rc.d/rc.local for loading driver 
	    automatic after system bootup. Use vi or other editor to open rc.local, 
	    and add words as below in last lien. 

			
			mv /dev/lp2 /dev/lp2.bak
			mv /dev/lp3 /dev/lp3.bak
			mknod /dev/lp2 c 246 2
			mknod /dev/lp3 c 246 3
			
			mv /dev/parport2 /dev/parport2.bak
			mv /dev/parport3 /dev/parport3.bak
			mknod /dev/parport2 c 247 2
			mknod /dev/parport3 c 247 3
		
			modprobe snx
		
		
	D.5 
	    In general, other distributions will loading driver automatic after system bootup.		
	    If it doesn't, please refer to item D.1 or D.2. or D.3 or D.4
				
				
------------------------------------------------------------------------------------------

E. Utility

	E1. snxdump - dump port informations, do command:

		# snxdump

		the informations should be like this

		================ Found  4 SUNIX port , list informations ====================
        		                                     SUNIX driver ver -- 1.3.3.0

		ttySNX0 --
		SUNIX 4089 Series (bus:2 device: 2) , base address = a000,    irq = 16

		ttySNX1 --
		SUNIX 4089 Series (bus:2 device: 2) , base address = a008,    irq = 16

		lp2, parport2 --
		SUNIX 4089 Series (bus:2 device: 2) , base addr = a400, extd addr = a800

		lp3, parport3 --
		SUNIX 4089 Series (bus:2 device: 2) , base addr = ac00, extd addr = b000

		=============================================================================


		In this case, 

		Driver version is 1.3.3.0

		ttySNX0 is the 1st serial port on sunix 4089 series board, 
		base address is 0xa000 and irq is 16.

		ttySNX1 is the 2nd serial port on sunix 4089 series board, 
		base address is 0xa008 and irq is 16.

		lp2, parport2 is the 1st parallel port on sunix 4089 series board, 
		base address is 0xa400 and extended address is 0xa800.  

		lp3, parport3 is the 2nd parallel port on sunix 4089 series board, 
		base address is 0xac00 and extended address is 0xb000.

		bus:2 means the bus number of board is 2.
		device:2 means the device number of board is 2.


		If no information print on screen. Make sure the device node
		exist in /dev and driver module loaded.

		
		
	E2. snxterm - dumb terminal for test tty device node data transmitting and receiving
		      , do command:

		# snxterm

------------------------------------------------------------------------------------------

