00README revision 103285
1103285Sikob$FreeBSD: head/sys/dev/firewire/00README 103285 2002-09-13 12:31:56Z ikob $
2103285Sikob
3103285SikobIEEE 1394 support for FreeBSD-5.X and 4.X.
4103285Sikob
5103285Sikob1. Introduction
6103285Sikob
7103285Sikob	  This tarball contains IEEE1394(FireWire) driver which is first
8103285Sikob	written by Katsushi Kobayashi[1] <ikob@koganei.wide.ad.jp> and
9103285Sikob	modified by Hidetoshi Shimokawa <simokawa@freebsd.org>.
10103285Sikob	Please note this driver is still under development.
11103285Sikob	You can find latest snapshots under:
12103285Sikob		http://people.freebsd.org/~simokawa/
13103285Sikob	named firewire-2002XXXX.tar.gz
14103285Sikob
15103285Sikob	The driver consists of 6 parts:
16103285Sikob
17103285Sikob	- fwohci.c/fwohci_pci.c
18103285Sikob		OHCI[2] driver
19103285Sikob			- IEEE1394 link/phy chip control
20103285Sikob	- firewire.c
21103285Sikob		Chip independent driver 
22103285Sikob			- CSR
23103285Sikob			- Transaction
24103285Sikob			- Character devices for userland
25103285Sikob	- fwmem.c
26103285Sikob		/dev/fwmem0: physical memory of a remote node.
27103285Sikob	- sbp.c
28103285Sikob		SBP-II[3] (a.k.a. SCSI over FireWire) driver
29103285Sikob
30103285Sikob	- if_fwe.c
31103285Sikob		NON-Standard implementation of Ethernet over FireWire.
32103285Sikob
33103285Sikob	- bus_mgm.c (userland)
34103285Sikob		Bus management function for user. 
35103285Sikob		show topology map, change gap count, bus reset, etc.
36103285Sikob
37103285Sikob2. Installation
38103285Sikob
39103285Sikob	Suppose you have kernel source at /sys.
40103285Sikob
41103285Sikob	- Extract tarball at root directory.
42103285Sikob	- cd /sys/dev/firewire
43103285Sikob	- make 
44103285Sikob	- make install
45103285Sikob	- make load
46103285Sikob
47103285Sikob	For FreeBSD-4 user:
48103285Sikob
49103285Sikob	- ./MAKEDEV
50103285Sikob
51103285Sikob3. SBP-II support (sbp)
52103285Sikob
53103285Sikob	- You need CAM(SCSI) support in your kernel.
54103285Sikob	  If you are using FreeBSD-5 before 2002/03/23 or FreeBSD-4 before
55103285Sikob	  2002/4/8, you need to apply CAM-patch in this archive
56103285Sikob	  to handle HDD's(T_RBC or T_DIRECT which doesn't support READ_6).
57103285Sikob
58103285Sikob	- If you connect a few firewire devices only, try the following to
59103285Sikob	  reduce gap overhead.
60103285Sikob
61103285Sikob		- ./bus_mgm -g 8
62103285Sikob
63103285Sikob4. Ethernet over FireWire (if_fwe)
64103285Sikob
65103285Sikob	  This is a sample driver for ethernet emulation. Please note this
66103285Sikob	does NOT conform to any standards like IP over FireWire(RFC2734[4]).
67103285Sikob	It just sends ethernet frames encapsulated in asynchronous stream
68103285Sikob	packets. It doesn't scale because it does something like unicast over		multicast, but it's easy to be implemented and you can use any
69103285Sikob	facilities what ethernet can do. (ipv6, bridging, vlan etc.)
70103285Sikob
71103285Sikob	  It also has DEVICE_POLLING[5] support. To enable it, edit your
72103285Sikob	kernel config file and Makefile.fwe then rebuild kernel and if_fwe.ko.
73103285Sikob	Note this driver checks kern.polling.enable only when enabling the
74103285Sikob	interface. When you enable polling after the interface is up,
75103285Sikob	try 'ifconfig fwe0 down;ifconfig fwe0 up'.
76103285Sikob
77103285Sikob5. FireWire for Kernel Hackers
78103285Sikob
79103285Sikob          As you know, IEEE1394 is a bus and OHCI supports physical access
80103285Sikob	to the host memory. This means that you can access the remote
81103285Sikob	host over firewire without software support at the remote host.
82103285Sikob	In other words, you can investigate remote host's physical memory
83103285Sikob	whether its OS is alive or crashed or hangs up.
84103285Sikob
85103285Sikob	  You need to apply KVMLIB-patch and rebuild libkvm then rebuild ps,
86103285Sikob	dmesg and gdb those are statically linked.
87103285Sikob	You may want to apply GDB-patch in this archive to get same behavior
88103285Sikob	as gdb with /dev/mem or want to insert savectx(&dumppcb) into panic(),
89103285Sikob	breakpoint() and so on to emulation crash dump.
90103285Sikob
91103285Sikob	  You have to determine target node_id manually at this point.
92103285Sikob	(guess using bus_mgm -t or dmesg)
93103285Sikob	(Targets should be specified by EUI64 in the future)
94103285Sikob
95103285Sikob	# sysctl kern.firewire.fwmem_node=[node_id]
96103285Sikob
97103285Sikob	# ps -agx -M /dev/fwmem0 -N /sys/i386/compile/GENERIC/kernel
98103285Sikob	# dmesg -M /dev/fwmem0 -N /sys/i386/compile/GENERIC/kernel
99103285Sikob	# gdb -k -c /dev/fwmem0 /sys/i386/compile/GENERIC/kernel.debug
100103285Sikob	# dd if=/dev/fwmem0 of=vmcore bs=1m count=[phys. memory in MB]
101103285Sikob
102103285Sikob	remote gdb at 400,000,000 bps :-)
103103285Sikob
104103285Sikob	
105103285Sikob6. DV
106103285Sikob	I have not tested yet.
107103285Sikob
108103285Sikob7. Tested HW
109103285Sikob
110103285Sikob	OS
111103285Sikob	- FreeBSD-4/i386
112103285Sikob	- FreeBSD-4/alpha
113103285Sikob	- FreeBSD-5/i386
114103285Sikob
115103285Sikob	* Not tested on SMP.
116103285Sikob	* Not tested on big-endian machine...
117103285Sikob
118103285Sikob	OHCI
119103285Sikob	- Texas Instruments TSB12LV26 (PCI)
120103285Sikob	- Texas Instruments TSB43AA22 (PCI/Cardbus)
121103285Sikob
122103285Sikob	* There might be phy probing problem but most of the OHCI
123103285Sikob	  chips should work.
124103285Sikob	* Tested with multiple firewire buses.
125103285Sikob
126103285Sikob	SBP-II
127103285Sikob	- HDD: Logitec USB/FireWire LHD-P30FU
128103285Sikob	- HDD: Yano A-dish 120GB
129103285Sikob	- HDD: Yano B-Max 320GB
130103285Sikob		The repository of cvsup2.jp.freebsd.org is on this device.
131103285Sikob	- HDD: Personal Storage 3000XT 160GB
132103285Sikob		The last sector of this drive cannot be accessed..
133103285Sikob	- DVD-RAM: Panasonic LF-D340JD 
134103285Sikob	- SCSI-FireWire converter: Yano FWSCSI-01
135103285Sikob		We can recognize only 1 device/lun at this point
136103285Sikob	- HDD: iPod, PowerBook G4 (target mode)
137103285Sikob		Reported by ikob
138103285Sikob	- Scanner: Epson GT-9700F
139103285Sikob		Now works!!
140103285Sikob		Sane-backend needs a patch(SANE-patch in this archive).
141103285Sikob
142103285Sikob	if_fwe
143103285Sikob	- IPv4, IPv6, bridging, vlan.
144103285Sikob	- You need at least two FreeBSD machines with this driver to use.
145103285Sikob
146103285SikobReferences:
147103285Sikob[1] ftp://ftp.uec.ac.jp/pub/firewire/beta/ 
148103285Sikob[2] http://developer.intel.com/technology/1394/download/ohci_11.htm
149103285Sikob[3] http://www.t10.org/scsi-3.htm
150103285Sikob[4] http://www.faqs.org/rfcs/rfc2734.html
151103285Sikob[5] http://info.iet.unipi.it/~luigi/polling/
152103285Sikob
153103285Sikob
154103285SikobHidetoshi Shimokawa
155103285Sikobsimokawa@freebsd.org
156