1e7751617SMauro Carvalho Chehab===================================
2e7751617SMauro Carvalho ChehabLinux and parallel port IDE devices
3e7751617SMauro Carvalho Chehab===================================
4e7751617SMauro Carvalho Chehab
5*246a1c4cSOndrej ZaryMost of this document describes the old paride driver. For the new libata
6*246a1c4cSOndrej Zarypata_parport drivrer, jump to the section 4 at the end.
7*246a1c4cSOndrej Zary
8e7751617SMauro Carvalho ChehabPARIDE v1.03   (c) 1997-8  Grant Guenther <grant@torque.net>
9e7751617SMauro Carvalho Chehab
10e7751617SMauro Carvalho Chehab1. Introduction
11e7751617SMauro Carvalho Chehab===============
12e7751617SMauro Carvalho Chehab
13e7751617SMauro Carvalho ChehabOwing to the simplicity and near universality of the parallel port interface
14e7751617SMauro Carvalho Chehabto personal computers, many external devices such as portable hard-disk,
15e7751617SMauro Carvalho ChehabCD-ROM, LS-120 and tape drives use the parallel port to connect to their
16e7751617SMauro Carvalho Chehabhost computer.  While some devices (notably scanners) use ad-hoc methods
17e7751617SMauro Carvalho Chehabto pass commands and data through the parallel port interface, most
18e7751617SMauro Carvalho Chehabexternal devices are actually identical to an internal model, but with
19e7751617SMauro Carvalho Chehaba parallel-port adapter chip added in.  Some of the original parallel port
20e7751617SMauro Carvalho Chehabadapters were little more than mechanisms for multiplexing a SCSI bus.
21e7751617SMauro Carvalho Chehab(The Iomega PPA-3 adapter used in the ZIP drives is an example of this
22e7751617SMauro Carvalho Chehabapproach).  Most current designs, however, take a different approach.
23e7751617SMauro Carvalho ChehabThe adapter chip reproduces a small ISA or IDE bus in the external device
24e7751617SMauro Carvalho Chehaband the communication protocol provides operations for reading and writing
25e7751617SMauro Carvalho Chehabdevice registers, as well as data block transfer functions.  Sometimes,
26e7751617SMauro Carvalho Chehabthe device being addressed via the parallel cable is a standard SCSI
27e7751617SMauro Carvalho Chehabcontroller like an NCR 5380.  The "ditto" family of external tape
28e7751617SMauro Carvalho Chehabdrives use the ISA replicator to interface a floppy disk controller,
29e7751617SMauro Carvalho Chehabwhich is then connected to a floppy-tape mechanism.  The vast majority
30e7751617SMauro Carvalho Chehabof external parallel port devices, however, are now based on standard
31e7751617SMauro Carvalho ChehabIDE type devices, which require no intermediate controller.  If one
32e7751617SMauro Carvalho Chehabwere to open up a parallel port CD-ROM drive, for instance, one would
33e7751617SMauro Carvalho Chehabfind a standard ATAPI CD-ROM drive, a power supply, and a single adapter
34e7751617SMauro Carvalho Chehabthat interconnected a standard PC parallel port cable and a standard
35e7751617SMauro Carvalho ChehabIDE cable.  It is usually possible to exchange the CD-ROM device with
36e7751617SMauro Carvalho Chehabany other device using the IDE interface.
37e7751617SMauro Carvalho Chehab
38e7751617SMauro Carvalho ChehabThe document describes the support in Linux for parallel port IDE
39e7751617SMauro Carvalho Chehabdevices.  It does not cover parallel port SCSI devices, "ditto" tape
40e7751617SMauro Carvalho Chehabdrives or scanners.  Many different devices are supported by the
41e7751617SMauro Carvalho Chehabparallel port IDE subsystem, including:
42e7751617SMauro Carvalho Chehab
43e7751617SMauro Carvalho Chehab	- MicroSolutions backpack CD-ROM
44e7751617SMauro Carvalho Chehab	- MicroSolutions backpack PD/CD
45e7751617SMauro Carvalho Chehab	- MicroSolutions backpack hard-drives
46e7751617SMauro Carvalho Chehab	- MicroSolutions backpack 8000t tape drive
47e7751617SMauro Carvalho Chehab	- SyQuest EZ-135, EZ-230 & SparQ drives
48e7751617SMauro Carvalho Chehab	- Avatar Shark
49e7751617SMauro Carvalho Chehab	- Imation Superdisk LS-120
50e7751617SMauro Carvalho Chehab	- Maxell Superdisk LS-120
51e7751617SMauro Carvalho Chehab	- FreeCom Power CD
52e7751617SMauro Carvalho Chehab	- Hewlett-Packard 5GB and 8GB tape drives
53e7751617SMauro Carvalho Chehab	- Hewlett-Packard 7100 and 7200 CD-RW drives
54e7751617SMauro Carvalho Chehab
55e7751617SMauro Carvalho Chehabas well as most of the clone and no-name products on the market.
56e7751617SMauro Carvalho Chehab
57e7751617SMauro Carvalho ChehabTo support such a wide range of devices, PARIDE, the parallel port IDE
58e7751617SMauro Carvalho Chehabsubsystem, is actually structured in three parts.   There is a base
59e7751617SMauro Carvalho Chehabparide module which provides a registry and some common methods for
60e7751617SMauro Carvalho Chehabaccessing the parallel ports.  The second component is a set of
61e7751617SMauro Carvalho Chehabhigh-level drivers for each of the different types of supported devices:
62e7751617SMauro Carvalho Chehab
63e7751617SMauro Carvalho Chehab	===	=============
64e7751617SMauro Carvalho Chehab	pd	IDE disk
65e7751617SMauro Carvalho Chehab	pcd	ATAPI CD-ROM
66e7751617SMauro Carvalho Chehab	pf	ATAPI disk
67e7751617SMauro Carvalho Chehab	pt	ATAPI tape
68e7751617SMauro Carvalho Chehab	pg	ATAPI generic
69e7751617SMauro Carvalho Chehab	===	=============
70e7751617SMauro Carvalho Chehab
71e7751617SMauro Carvalho Chehab(Currently, the pg driver is only used with CD-R drives).
72e7751617SMauro Carvalho Chehab
73e7751617SMauro Carvalho ChehabThe high-level drivers function according to the relevant standards.
74e7751617SMauro Carvalho ChehabThe third component of PARIDE is a set of low-level protocol drivers
75e7751617SMauro Carvalho Chehabfor each of the parallel port IDE adapter chips.  Thanks to the interest
76e7751617SMauro Carvalho Chehaband encouragement of Linux users from many parts of the world,
77e7751617SMauro Carvalho Chehabsupport is available for almost all known adapter protocols:
78e7751617SMauro Carvalho Chehab
79e7751617SMauro Carvalho Chehab	====    ====================================== ====
80e7751617SMauro Carvalho Chehab        aten    ATEN EH-100                            (HK)
81e7751617SMauro Carvalho Chehab        bpck    Microsolutions backpack                (US)
82e7751617SMauro Carvalho Chehab        comm    DataStor (old-type) "commuter" adapter (TW)
83e7751617SMauro Carvalho Chehab        dstr    DataStor EP-2000                       (TW)
84e7751617SMauro Carvalho Chehab        epat    Shuttle EPAT                           (UK)
85e7751617SMauro Carvalho Chehab        epia    Shuttle EPIA                           (UK)
86e7751617SMauro Carvalho Chehab	fit2    FIT TD-2000			       (US)
87e7751617SMauro Carvalho Chehab	fit3    FIT TD-3000			       (US)
88e7751617SMauro Carvalho Chehab	friq    Freecom IQ cable                       (DE)
89e7751617SMauro Carvalho Chehab        frpw    Freecom Power                          (DE)
90e7751617SMauro Carvalho Chehab        kbic    KingByte KBIC-951A and KBIC-971A       (TW)
91e7751617SMauro Carvalho Chehab	ktti    KT Technology PHd adapter              (SG)
92e7751617SMauro Carvalho Chehab        on20    OnSpec 90c20                           (US)
93e7751617SMauro Carvalho Chehab        on26    OnSpec 90c26                           (US)
94e7751617SMauro Carvalho Chehab	====    ====================================== ====
95e7751617SMauro Carvalho Chehab
96e7751617SMauro Carvalho Chehab
97e7751617SMauro Carvalho Chehab2. Using the PARIDE subsystem
98e7751617SMauro Carvalho Chehab=============================
99e7751617SMauro Carvalho Chehab
100e7751617SMauro Carvalho ChehabWhile configuring the Linux kernel, you may choose either to build
101e7751617SMauro Carvalho Chehabthe PARIDE drivers into your kernel, or to build them as modules.
102e7751617SMauro Carvalho Chehab
103e7751617SMauro Carvalho ChehabIn either case, you will need to select "Parallel port IDE device support"
104e7751617SMauro Carvalho Chehabas well as at least one of the high-level drivers and at least one
105e7751617SMauro Carvalho Chehabof the parallel port communication protocols.  If you do not know
106e7751617SMauro Carvalho Chehabwhat kind of parallel port adapter is used in your drive, you could
107e7751617SMauro Carvalho Chehabbegin by checking the file names and any text files on your DOS
108e7751617SMauro Carvalho Chehabinstallation floppy.  Alternatively, you can look at the markings on
109e7751617SMauro Carvalho Chehabthe adapter chip itself.  That's usually sufficient to identify the
110e7751617SMauro Carvalho Chehabcorrect device.
111e7751617SMauro Carvalho Chehab
112e7751617SMauro Carvalho ChehabYou can actually select all the protocol modules, and allow the PARIDE
113e7751617SMauro Carvalho Chehabsubsystem to try them all for you.
114e7751617SMauro Carvalho Chehab
115e7751617SMauro Carvalho ChehabFor the "brand-name" products listed above, here are the protocol
116e7751617SMauro Carvalho Chehaband high-level drivers that you would use:
117e7751617SMauro Carvalho Chehab
118e7751617SMauro Carvalho Chehab	================	============	======	========
119e7751617SMauro Carvalho Chehab	Manufacturer		Model		Driver	Protocol
120e7751617SMauro Carvalho Chehab	================	============	======	========
121e7751617SMauro Carvalho Chehab	MicroSolutions		CD-ROM		pcd	bpck
122e7751617SMauro Carvalho Chehab	MicroSolutions		PD drive	pf	bpck
123e7751617SMauro Carvalho Chehab	MicroSolutions		hard-drive	pd	bpck
124e7751617SMauro Carvalho Chehab	MicroSolutions          8000t tape      pt      bpck
125e7751617SMauro Carvalho Chehab	SyQuest			EZ, SparQ	pd	epat
126e7751617SMauro Carvalho Chehab	Imation			Superdisk	pf	epat
127e7751617SMauro Carvalho Chehab	Maxell                  Superdisk       pf      friq
128e7751617SMauro Carvalho Chehab	Avatar			Shark		pd	epat
129e7751617SMauro Carvalho Chehab	FreeCom			CD-ROM		pcd	frpw
130e7751617SMauro Carvalho Chehab	Hewlett-Packard		5GB Tape	pt	epat
131e7751617SMauro Carvalho Chehab	Hewlett-Packard		7200e (CD)	pcd	epat
132e7751617SMauro Carvalho Chehab	Hewlett-Packard		7200e (CD-R)	pg	epat
133e7751617SMauro Carvalho Chehab	================	============	======	========
134e7751617SMauro Carvalho Chehab
135e7751617SMauro Carvalho Chehab2.1  Configuring built-in drivers
136e7751617SMauro Carvalho Chehab---------------------------------
137e7751617SMauro Carvalho Chehab
138e7751617SMauro Carvalho ChehabWe recommend that you get to know how the drivers work and how to
139e7751617SMauro Carvalho Chehabconfigure them as loadable modules, before attempting to compile a
140e7751617SMauro Carvalho Chehabkernel with the drivers built-in.
141e7751617SMauro Carvalho Chehab
142e7751617SMauro Carvalho ChehabIf you built all of your PARIDE support directly into your kernel,
143e7751617SMauro Carvalho Chehaband you have just a single parallel port IDE device, your kernel should
144e7751617SMauro Carvalho Chehablocate it automatically for you.  If you have more than one device,
145e7751617SMauro Carvalho Chehabyou may need to give some command line options to your bootloader
146e7751617SMauro Carvalho Chehab(eg: LILO), how to do that is beyond the scope of this document.
147e7751617SMauro Carvalho Chehab
148e7751617SMauro Carvalho ChehabThe high-level drivers accept a number of command line parameters, all
149e7751617SMauro Carvalho Chehabof which are documented in the source files in linux/drivers/block/paride.
150e7751617SMauro Carvalho ChehabBy default, each driver will automatically try all parallel ports it
151e7751617SMauro Carvalho Chehabcan find, and all protocol types that have been installed, until it finds
152e7751617SMauro Carvalho Chehaba parallel port IDE adapter.  Once it finds one, the probe stops.  So,
153e7751617SMauro Carvalho Chehabif you have more than one device, you will need to tell the drivers
154e7751617SMauro Carvalho Chehabhow to identify them.  This requires specifying the port address, the
155e7751617SMauro Carvalho Chehabprotocol identification number and, for some devices, the drive's
156e7751617SMauro Carvalho Chehabchain ID.  While your system is booting, a number of messages are
157e7751617SMauro Carvalho Chehabdisplayed on the console.  Like all such messages, they can be
158e7751617SMauro Carvalho Chehabreviewed with the 'dmesg' command.  Among those messages will be
159e7751617SMauro Carvalho Chehabsome lines like::
160e7751617SMauro Carvalho Chehab
161e7751617SMauro Carvalho Chehab	paride: bpck registered as protocol 0
162e7751617SMauro Carvalho Chehab	paride: epat registered as protocol 1
163e7751617SMauro Carvalho Chehab
164e7751617SMauro Carvalho ChehabThe numbers will always be the same until you build a new kernel with
165e7751617SMauro Carvalho Chehabdifferent protocol selections.  You should note these numbers as you
166e7751617SMauro Carvalho Chehabwill need them to identify the devices.
167e7751617SMauro Carvalho Chehab
168e7751617SMauro Carvalho ChehabIf you happen to be using a MicroSolutions backpack device, you will
169e7751617SMauro Carvalho Chehabalso need to know the unit ID number for each drive.  This is usually
170e7751617SMauro Carvalho Chehabthe last two digits of the drive's serial number (but read MicroSolutions'
171e7751617SMauro Carvalho Chehabdocumentation about this).
172e7751617SMauro Carvalho Chehab
173e7751617SMauro Carvalho ChehabAs an example, let's assume that you have a MicroSolutions PD/CD drive
174e7751617SMauro Carvalho Chehabwith unit ID number 36 connected to the parallel port at 0x378, a SyQuest
175e7751617SMauro Carvalho ChehabEZ-135 connected to the chained port on the PD/CD drive and also an
176e7751617SMauro Carvalho ChehabImation Superdisk connected to port 0x278.  You could give the following
177e7751617SMauro Carvalho Chehaboptions on your boot command::
178e7751617SMauro Carvalho Chehab
179e7751617SMauro Carvalho Chehab	pd.drive0=0x378,1 pf.drive0=0x278,1 pf.drive1=0x378,0,36
180e7751617SMauro Carvalho Chehab
181e7751617SMauro Carvalho ChehabIn the last option, pf.drive1 configures device /dev/pf1, the 0x378
182e7751617SMauro Carvalho Chehabis the parallel port base address, the 0 is the protocol registration
183e7751617SMauro Carvalho Chehabnumber and 36 is the chain ID.
184e7751617SMauro Carvalho Chehab
185e7751617SMauro Carvalho ChehabPlease note:  while PARIDE will work both with and without the
186e7751617SMauro Carvalho ChehabPARPORT parallel port sharing system that is included by the
187e7751617SMauro Carvalho Chehab"Parallel port support" option, PARPORT must be included and enabled
188e7751617SMauro Carvalho Chehabif you want to use chains of devices on the same parallel port.
189e7751617SMauro Carvalho Chehab
190e7751617SMauro Carvalho Chehab2.2  Loading and configuring PARIDE as modules
191e7751617SMauro Carvalho Chehab----------------------------------------------
192e7751617SMauro Carvalho Chehab
193e7751617SMauro Carvalho ChehabIt is much faster and simpler to get to understand the PARIDE drivers
194e7751617SMauro Carvalho Chehabif you use them as loadable kernel modules.
195e7751617SMauro Carvalho Chehab
196e7751617SMauro Carvalho ChehabNote 1:
197e7751617SMauro Carvalho Chehab	using these drivers with the "kerneld" automatic module loading
198e7751617SMauro Carvalho Chehab	system is not recommended for beginners, and is not documented here.
199e7751617SMauro Carvalho Chehab
200e7751617SMauro Carvalho ChehabNote 2:
201e7751617SMauro Carvalho Chehab	if you build PARPORT support as a loadable module, PARIDE must
202e7751617SMauro Carvalho Chehab	also be built as loadable modules, and PARPORT must be loaded before
203e7751617SMauro Carvalho Chehab	the PARIDE modules.
204e7751617SMauro Carvalho Chehab
205e7751617SMauro Carvalho ChehabTo use PARIDE, you must begin by::
206e7751617SMauro Carvalho Chehab
207e7751617SMauro Carvalho Chehab	insmod paride
208e7751617SMauro Carvalho Chehab
209e7751617SMauro Carvalho Chehabthis loads a base module which provides a registry for the protocols,
210e7751617SMauro Carvalho Chehabamong other tasks.
211e7751617SMauro Carvalho Chehab
212e7751617SMauro Carvalho ChehabThen, load as many of the protocol modules as you think you might need.
213e7751617SMauro Carvalho ChehabAs you load each module, it will register the protocols that it supports,
214e7751617SMauro Carvalho Chehaband print a log message to your kernel log file and your console. For
215e7751617SMauro Carvalho Chehabexample::
216e7751617SMauro Carvalho Chehab
217e7751617SMauro Carvalho Chehab	# insmod epat
218e7751617SMauro Carvalho Chehab	paride: epat registered as protocol 0
219e7751617SMauro Carvalho Chehab	# insmod kbic
220e7751617SMauro Carvalho Chehab	paride: k951 registered as protocol 1
221e7751617SMauro Carvalho Chehab        paride: k971 registered as protocol 2
222e7751617SMauro Carvalho Chehab
223e7751617SMauro Carvalho ChehabFinally, you can load high-level drivers for each kind of device that
224e7751617SMauro Carvalho Chehabyou have connected.  By default, each driver will autoprobe for a single
225e7751617SMauro Carvalho Chehabdevice, but you can support up to four similar devices by giving their
226b2105aa2SAndrew Klychkovindividual coordinates when you load the driver.
227e7751617SMauro Carvalho Chehab
228e7751617SMauro Carvalho ChehabFor example, if you had two no-name CD-ROM drives both using the
229e7751617SMauro Carvalho ChehabKingByte KBIC-951A adapter, one on port 0x378 and the other on 0x3bc
230e7751617SMauro Carvalho Chehabyou could give the following command::
231e7751617SMauro Carvalho Chehab
232e7751617SMauro Carvalho Chehab	# insmod pcd drive0=0x378,1 drive1=0x3bc,1
233e7751617SMauro Carvalho Chehab
234e7751617SMauro Carvalho ChehabFor most adapters, giving a port address and protocol number is sufficient,
235e7751617SMauro Carvalho Chehabbut check the source files in linux/drivers/block/paride for more
236e7751617SMauro Carvalho Chehabinformation.  (Hopefully someone will write some man pages one day !).
237e7751617SMauro Carvalho Chehab
238e7751617SMauro Carvalho ChehabAs another example, here's what happens when PARPORT is installed, and
239e7751617SMauro Carvalho Chehaba SyQuest EZ-135 is attached to port 0x378::
240e7751617SMauro Carvalho Chehab
241e7751617SMauro Carvalho Chehab	# insmod paride
242e7751617SMauro Carvalho Chehab	paride: version 1.0 installed
243e7751617SMauro Carvalho Chehab	# insmod epat
244e7751617SMauro Carvalho Chehab	paride: epat registered as protocol 0
245e7751617SMauro Carvalho Chehab	# insmod pd
246e7751617SMauro Carvalho Chehab	pd: pd version 1.0, major 45, cluster 64, nice 0
247e7751617SMauro Carvalho Chehab	pda: Sharing parport1 at 0x378
248e7751617SMauro Carvalho Chehab	pda: epat 1.0, Shuttle EPAT chip c3 at 0x378, mode 5 (EPP-32), delay 1
249e7751617SMauro Carvalho Chehab	pda: SyQuest EZ135A, 262144 blocks [128M], (512/16/32), removable media
250e7751617SMauro Carvalho Chehab	 pda: pda1
251e7751617SMauro Carvalho Chehab
252e7751617SMauro Carvalho ChehabNote that the last line is the output from the generic partition table
253e7751617SMauro Carvalho Chehabscanner - in this case it reports that it has found a disk with one partition.
254e7751617SMauro Carvalho Chehab
255e7751617SMauro Carvalho Chehab2.3  Using a PARIDE device
256e7751617SMauro Carvalho Chehab--------------------------
257e7751617SMauro Carvalho Chehab
258e7751617SMauro Carvalho ChehabOnce the drivers have been loaded, you can access PARIDE devices in the
259e7751617SMauro Carvalho Chehabsame way as their traditional counterparts.  You will probably need to
260e7751617SMauro Carvalho Chehabcreate the device "special files".  Here is a simple script that you can
261e7751617SMauro Carvalho Chehabcut to a file and execute::
262e7751617SMauro Carvalho Chehab
263e7751617SMauro Carvalho Chehab  #!/bin/bash
264e7751617SMauro Carvalho Chehab  #
265e7751617SMauro Carvalho Chehab  # mkd -- a script to create the device special files for the PARIDE subsystem
266e7751617SMauro Carvalho Chehab  #
267e7751617SMauro Carvalho Chehab  function mkdev {
268e7751617SMauro Carvalho Chehab    mknod $1 $2 $3 $4 ; chmod 0660 $1 ; chown root:disk $1
269e7751617SMauro Carvalho Chehab  }
270e7751617SMauro Carvalho Chehab  #
271e7751617SMauro Carvalho Chehab  function pd {
272e7751617SMauro Carvalho Chehab    D=$( printf \\$( printf "x%03x" $[ $1 + 97 ] ) )
273e7751617SMauro Carvalho Chehab    mkdev pd$D b 45 $[ $1 * 16 ]
274e7751617SMauro Carvalho Chehab    for P in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
275e7751617SMauro Carvalho Chehab    do mkdev pd$D$P b 45 $[ $1 * 16 + $P ]
276e7751617SMauro Carvalho Chehab    done
277e7751617SMauro Carvalho Chehab  }
278e7751617SMauro Carvalho Chehab  #
279e7751617SMauro Carvalho Chehab  cd /dev
280e7751617SMauro Carvalho Chehab  #
281e7751617SMauro Carvalho Chehab  for u in 0 1 2 3 ; do pd $u ; done
282e7751617SMauro Carvalho Chehab  for u in 0 1 2 3 ; do mkdev pcd$u b 46 $u ; done
283e7751617SMauro Carvalho Chehab  for u in 0 1 2 3 ; do mkdev pf$u  b 47 $u ; done
284e7751617SMauro Carvalho Chehab  for u in 0 1 2 3 ; do mkdev pt$u  c 96 $u ; done
285e7751617SMauro Carvalho Chehab  for u in 0 1 2 3 ; do mkdev npt$u c 96 $[ $u + 128 ] ; done
286e7751617SMauro Carvalho Chehab  for u in 0 1 2 3 ; do mkdev pg$u  c 97 $u ; done
287e7751617SMauro Carvalho Chehab  #
288e7751617SMauro Carvalho Chehab  # end of mkd
289e7751617SMauro Carvalho Chehab
290e7751617SMauro Carvalho ChehabWith the device files and drivers in place, you can access PARIDE devices
291e7751617SMauro Carvalho Chehablike any other Linux device.   For example, to mount a CD-ROM in pcd0, use::
292e7751617SMauro Carvalho Chehab
293e7751617SMauro Carvalho Chehab	mount /dev/pcd0 /cdrom
294e7751617SMauro Carvalho Chehab
295e7751617SMauro Carvalho ChehabIf you have a fresh Avatar Shark cartridge, and the drive is pda, you
296e7751617SMauro Carvalho Chehabmight do something like::
297e7751617SMauro Carvalho Chehab
298e7751617SMauro Carvalho Chehab	fdisk /dev/pda		-- make a new partition table with
299e7751617SMauro Carvalho Chehab				   partition 1 of type 83
300e7751617SMauro Carvalho Chehab
301e7751617SMauro Carvalho Chehab	mke2fs /dev/pda1	-- to build the file system
302e7751617SMauro Carvalho Chehab
303e7751617SMauro Carvalho Chehab	mkdir /shark		-- make a place to mount the disk
304e7751617SMauro Carvalho Chehab
305e7751617SMauro Carvalho Chehab	mount /dev/pda1 /shark
306e7751617SMauro Carvalho Chehab
307e7751617SMauro Carvalho ChehabDevices like the Imation superdisk work in the same way, except that
308e7751617SMauro Carvalho Chehabthey do not have a partition table.  For example to make a 120MB
309e7751617SMauro Carvalho Chehabfloppy that you could share with a DOS system::
310e7751617SMauro Carvalho Chehab
311e7751617SMauro Carvalho Chehab	mkdosfs /dev/pf0
312e7751617SMauro Carvalho Chehab	mount /dev/pf0 /mnt
313e7751617SMauro Carvalho Chehab
314e7751617SMauro Carvalho Chehab
315e7751617SMauro Carvalho Chehab2.4  The pf driver
316e7751617SMauro Carvalho Chehab------------------
317e7751617SMauro Carvalho Chehab
318e7751617SMauro Carvalho ChehabThe pf driver is intended for use with parallel port ATAPI disk
319e7751617SMauro Carvalho Chehabdevices.  The most common devices in this category are PD drives
320e7751617SMauro Carvalho Chehaband LS-120 drives.  Traditionally, media for these devices are not
321e7751617SMauro Carvalho Chehabpartitioned.  Consequently, the pf driver does not support partitioned
322e7751617SMauro Carvalho Chehabmedia.  This may be changed in a future version of the driver.
323e7751617SMauro Carvalho Chehab
324e7751617SMauro Carvalho Chehab2.5  Using the pt driver
325e7751617SMauro Carvalho Chehab------------------------
326e7751617SMauro Carvalho Chehab
327e7751617SMauro Carvalho ChehabThe pt driver for parallel port ATAPI tape drives is a minimal driver.
328e7751617SMauro Carvalho ChehabIt does not yet support many of the standard tape ioctl operations.
329e7751617SMauro Carvalho ChehabFor best performance, a block size of 32KB should be used.  You will
330e7751617SMauro Carvalho Chehabprobably want to set the parallel port delay to 0, if you can.
331e7751617SMauro Carvalho Chehab
332e7751617SMauro Carvalho Chehab2.6  Using the pg driver
333e7751617SMauro Carvalho Chehab------------------------
334e7751617SMauro Carvalho Chehab
335e7751617SMauro Carvalho ChehabThe pg driver can be used in conjunction with the cdrecord program
336e7751617SMauro Carvalho Chehabto create CD-ROMs.  Please get cdrecord version 1.6.1 or later
337e7751617SMauro Carvalho Chehabfrom ftp://ftp.fokus.gmd.de/pub/unix/cdrecord/ .  To record CD-R media
338e7751617SMauro Carvalho Chehabyour parallel port should ideally be set to EPP mode, and the "port delay"
339e7751617SMauro Carvalho Chehabshould be set to 0.  With those settings it is possible to record at 2x
340e7751617SMauro Carvalho Chehabspeed without any buffer underruns.  If you cannot get the driver to work
341e7751617SMauro Carvalho Chehabin EPP mode, try to use "bidirectional" or "PS/2" mode and 1x speeds only.
342e7751617SMauro Carvalho Chehab
343e7751617SMauro Carvalho Chehab
344e7751617SMauro Carvalho Chehab3. Troubleshooting
345e7751617SMauro Carvalho Chehab==================
346e7751617SMauro Carvalho Chehab
347e7751617SMauro Carvalho Chehab3.1  Use EPP mode if you can
348e7751617SMauro Carvalho Chehab----------------------------
349e7751617SMauro Carvalho Chehab
350e7751617SMauro Carvalho ChehabThe most common problems that people report with the PARIDE drivers
351e7751617SMauro Carvalho Chehabconcern the parallel port CMOS settings.  At this time, none of the
352e7751617SMauro Carvalho ChehabPARIDE protocol modules support ECP mode, or any ECP combination modes.
353e7751617SMauro Carvalho ChehabIf you are able to do so, please set your parallel port into EPP mode
354e7751617SMauro Carvalho Chehabusing your CMOS setup procedure.
355e7751617SMauro Carvalho Chehab
356e7751617SMauro Carvalho Chehab3.2  Check the port delay
357e7751617SMauro Carvalho Chehab-------------------------
358e7751617SMauro Carvalho Chehab
359e7751617SMauro Carvalho ChehabSome parallel ports cannot reliably transfer data at full speed.  To
360e7751617SMauro Carvalho Chehaboffset the errors, the PARIDE protocol modules introduce a "port
361e7751617SMauro Carvalho Chehabdelay" between each access to the i/o ports.  Each protocol sets
362e7751617SMauro Carvalho Chehaba default value for this delay.  In most cases, the user can override
363e7751617SMauro Carvalho Chehabthe default and set it to 0 - resulting in somewhat higher transfer
364e7751617SMauro Carvalho Chehabrates.  In some rare cases (especially with older 486 systems) the
365e7751617SMauro Carvalho Chehabdefault delays are not long enough.  if you experience corrupt data
366e7751617SMauro Carvalho Chehabtransfers, or unexpected failures, you may wish to increase the
367e7751617SMauro Carvalho Chehabport delay.   The delay can be programmed using the "driveN" parameters
368e7751617SMauro Carvalho Chehabto each of the high-level drivers.  Please see the notes above, or
369e7751617SMauro Carvalho Chehabread the comments at the beginning of the driver source files in
370e7751617SMauro Carvalho Chehablinux/drivers/block/paride.
371e7751617SMauro Carvalho Chehab
372e7751617SMauro Carvalho Chehab3.3  Some drives need a printer reset
373e7751617SMauro Carvalho Chehab-------------------------------------
374e7751617SMauro Carvalho Chehab
375e7751617SMauro Carvalho ChehabThere appear to be a number of "noname" external drives on the market
376e7751617SMauro Carvalho Chehabthat do not always power up correctly.  We have noticed this with some
377e7751617SMauro Carvalho Chehabdrives based on OnSpec and older Freecom adapters.  In these rare cases,
378e7751617SMauro Carvalho Chehabthe adapter can often be reinitialised by issuing a "printer reset" on
379e7751617SMauro Carvalho Chehabthe parallel port.  As the reset operation is potentially disruptive in
380e7751617SMauro Carvalho Chehabmultiple device environments, the PARIDE drivers will not do it
381e7751617SMauro Carvalho Chehabautomatically.  You can however, force a printer reset by doing::
382e7751617SMauro Carvalho Chehab
383e7751617SMauro Carvalho Chehab	insmod lp reset=1
384e7751617SMauro Carvalho Chehab	rmmod lp
385e7751617SMauro Carvalho Chehab
386e7751617SMauro Carvalho ChehabIf you have one of these marginal cases, you should probably build
387e7751617SMauro Carvalho Chehabyour paride drivers as modules, and arrange to do the printer reset
388e7751617SMauro Carvalho Chehabbefore loading the PARIDE drivers.
389e7751617SMauro Carvalho Chehab
390e7751617SMauro Carvalho Chehab3.4  Use the verbose option and dmesg if you need help
391e7751617SMauro Carvalho Chehab------------------------------------------------------
392e7751617SMauro Carvalho Chehab
393e7751617SMauro Carvalho ChehabWhile a lot of testing has gone into these drivers to make them work
394e7751617SMauro Carvalho Chehabas smoothly as possible, problems will arise.  If you do have problems,
395e7751617SMauro Carvalho Chehabplease check all the obvious things first:  does the drive work in
396e7751617SMauro Carvalho ChehabDOS with the manufacturer's drivers ?  If that doesn't yield any useful
397e7751617SMauro Carvalho Chehabclues, then please make sure that only one drive is hooked to your system,
398e7751617SMauro Carvalho Chehaband that either (a) PARPORT is enabled or (b) no other device driver
399e7751617SMauro Carvalho Chehabis using your parallel port (check in /proc/ioports).  Then, load the
400e7751617SMauro Carvalho Chehabappropriate drivers (you can load several protocol modules if you want)
401e7751617SMauro Carvalho Chehabas in::
402e7751617SMauro Carvalho Chehab
403e7751617SMauro Carvalho Chehab	# insmod paride
404e7751617SMauro Carvalho Chehab	# insmod epat
405e7751617SMauro Carvalho Chehab	# insmod bpck
406e7751617SMauro Carvalho Chehab	# insmod kbic
407e7751617SMauro Carvalho Chehab	...
408e7751617SMauro Carvalho Chehab	# insmod pd verbose=1
409e7751617SMauro Carvalho Chehab
410e7751617SMauro Carvalho Chehab(using the correct driver for the type of device you have, of course).
411e7751617SMauro Carvalho ChehabThe verbose=1 parameter will cause the drivers to log a trace of their
412e7751617SMauro Carvalho Chehabactivity as they attempt to locate your drive.
413e7751617SMauro Carvalho Chehab
414e7751617SMauro Carvalho ChehabUse 'dmesg' to capture a log of all the PARIDE messages (any messages
415e7751617SMauro Carvalho Chehabbeginning with paride:, a protocol module's name or a driver's name) and
416e7751617SMauro Carvalho Chehabinclude that with your bug report.  You can submit a bug report in one
417e7751617SMauro Carvalho Chehabof two ways.  Either send it directly to the author of the PARIDE suite,
418e7751617SMauro Carvalho Chehabby e-mail to grant@torque.net, or join the linux-parport mailing list
419e7751617SMauro Carvalho Chehaband post your report there.
420e7751617SMauro Carvalho Chehab
421e7751617SMauro Carvalho Chehab3.5  For more information or help
422e7751617SMauro Carvalho Chehab---------------------------------
423e7751617SMauro Carvalho Chehab
424e7751617SMauro Carvalho ChehabYou can join the linux-parport mailing list by sending a mail message
425e7751617SMauro Carvalho Chehabto:
426e7751617SMauro Carvalho Chehab
427e7751617SMauro Carvalho Chehab		linux-parport-request@torque.net
428e7751617SMauro Carvalho Chehab
429e7751617SMauro Carvalho Chehabwith the single word::
430e7751617SMauro Carvalho Chehab
431e7751617SMauro Carvalho Chehab		subscribe
432e7751617SMauro Carvalho Chehab
433e7751617SMauro Carvalho Chehabin the body of the mail message (not in the subject line).   Please be
434e7751617SMauro Carvalho Chehabsure that your mail program is correctly set up when you do this,  as
435e7751617SMauro Carvalho Chehabthe list manager is a robot that will subscribe you using the reply
436e7751617SMauro Carvalho Chehabaddress in your mail headers.  REMOVE any anti-spam gimmicks you may
437e7751617SMauro Carvalho Chehabhave in your mail headers, when sending mail to the list server.
438e7751617SMauro Carvalho Chehab
439e7751617SMauro Carvalho ChehabYou might also find some useful information on the linux-parport
440e7751617SMauro Carvalho Chehabweb pages (although they are not always up to date) at
441e7751617SMauro Carvalho Chehab
442e7751617SMauro Carvalho Chehab	http://web.archive.org/web/%2E/http://www.torque.net/parport/
443*246a1c4cSOndrej Zary
444*246a1c4cSOndrej Zary4. pata_parport driver
445*246a1c4cSOndrej Zary======================
446*246a1c4cSOndrej Zarypata_parport is a libata-based driver that uses the same low-level protocol
447*246a1c4cSOndrej Zarydrivers as PARIDE but there are no high-level drivers (pd, pcd, pf, pt, pg).
448*246a1c4cSOndrej ZaryThe IDE devices behind parallel port adapters are handled by the ATA layer.
449*246a1c4cSOndrej Zary
450*246a1c4cSOndrej ZaryThe device creation is also changed - no protocol numbers or parport I/O
451*246a1c4cSOndrej Zaryaddresses are used.
452*246a1c4cSOndrej Zary
453*246a1c4cSOndrej ZaryAll parports and all protocol drivers are probed automatically unless probe=0
454*246a1c4cSOndrej Zaryparameter is used. So just "modprobe epat" is enough for a Imation SuperDisk
455*246a1c4cSOndrej Zarydrive to work.
456*246a1c4cSOndrej Zary
457*246a1c4cSOndrej ZaryManual device creation::
458*246a1c4cSOndrej Zary
459*246a1c4cSOndrej Zary	# echo "port protocol mode unit delay" >/sys/bus/pata_parport/new_device
460*246a1c4cSOndrej Zary
461*246a1c4cSOndrej Zarywhere:
462*246a1c4cSOndrej Zary
463*246a1c4cSOndrej Zary	======== ================================================
464*246a1c4cSOndrej Zary	port	 parport name (or "auto" for all parports)
465*246a1c4cSOndrej Zary	protocol protocol name (or "auto" for all protocols)
466*246a1c4cSOndrej Zary	mode	 mode number (protocol-specific) or -1 for probe
467*246a1c4cSOndrej Zary	unit	 unit number (see the paride documentation above)
468*246a1c4cSOndrej Zary	delay	 I/O delay (see the paride documentation above)
469*246a1c4cSOndrej Zary	======== ================================================
470*246a1c4cSOndrej Zary
471*246a1c4cSOndrej ZaryIf you omit the parameters from the end, defaults will be used, e.g.:
472*246a1c4cSOndrej Zary
473*246a1c4cSOndrej ZaryProbe all parports with all protocols::
474*246a1c4cSOndrej Zary
475*246a1c4cSOndrej Zary	# echo auto >/sys/bus/pata_parport/new_device
476*246a1c4cSOndrej Zary
477*246a1c4cSOndrej ZaryProbe parport0 using protocol epat and mode 4 (EPP-16)::
478*246a1c4cSOndrej Zary
479*246a1c4cSOndrej Zary	# echo "parport0 epat 4" >/sys/bus/pata_parport/new_device
480*246a1c4cSOndrej Zary
481*246a1c4cSOndrej ZaryProbe parport0 using all protocols::
482*246a1c4cSOndrej Zary
483*246a1c4cSOndrej Zary	# echo "parport0 auto" >/sys/bus/pata_parport/new_device
484*246a1c4cSOndrej Zary
485*246a1c4cSOndrej ZaryProbe all parports using protoocol epat::
486*246a1c4cSOndrej Zary
487*246a1c4cSOndrej Zary	# echo "auto epat" >/sys/bus/pata_parport/new_device
488*246a1c4cSOndrej Zary
489*246a1c4cSOndrej ZaryDeleting devices::
490*246a1c4cSOndrej Zary
491*246a1c4cSOndrej Zary	# echo pata_parport.0 >/sys/bus/pata_parport/delete_device
492