---------------------------------------------------------------------------
	IBM Smart Capture Card device driver for FreeBSD (Ver.0.34)

				Takeshi OHAHSI
				Kyushu Institute of Thechnology, JAPAN
				ohashi@mickey.ai.kyutech.ac.jp
				96/08/11
---------------------------------------------------------------------------

0. What is IBM Smart Capture Card?

 It is a video capture card that is PCMCIA type II. It capture an
 image up to 640x480, actual 240 lines. It handle NTSC video signal
 and TV signal with an optional TV-tuner. It is become a digital video
 camera with an optional Clip-On-Camera.
 There are two type card that are Smart Capture Card and Smart Capture
 Card II, we call them SCC and SCC2. SCC2 is same as SCC, exept that
 SCC2 has hardware dithering functions. Then we use SCC that means
 both of them. 

 Product information of Smart Capture Card (in Japanese)
   http://www.ibm.co.jp/pc/prod/hb/0485.html

 Driver information of Windows95 and etc. (in Japanese)
   http://web.kyoto-inet.or.jp/people/yozaki/scc95p10.html

1. About this package.

 This package includes a device driver of SCC for FreeBSD and PAO.

 PAO home page
   http://www.mt.cs.keio.ac.jp/person/hosokawa/PAO/

 We checked it following combinations.
   FreeBSD-2.2-960612-SNAP + PAO-960731
   FreeBSD-2.1.5-RELEASE   + PAO-960731
   FreeBSD-2.1.0-RELEASE   + (upgraded as PAO-960731)

 We call them bliefly as 22SNAP, 215R and 210R.

 The latest driver is located in the URL. 
   ftp://at_ohasi.mickey.ai.kyutech.ac.jp/pub/mc/scc/driver/FreeBSD/

 Linux version is made also by Koji OKAMURA at Kobe Univ. (oka@kobe-u.ac.jp)
   ftp://ftp.kobe-u.ac.jp/pub/mc/scc/driver/linux/

2. Installation of the driver

2.1 Make a new kernel include the SCC driver

2.1.1 Copy driver source codes to kernel source tree

 # cp scc.c      /sys/i386/isa/scc.c
 # cp scc_cs.h   /sys/i386/isa/scc_cs.h
 # cp scc_subr.c /sys/i386/isa/scc_subr.c
 # cp scc.h      /sys/i386/include/scc.h

 Copy scc.h to /usr/include/machine

 # cp scc.h /usr/include/machine/scc.h

2.1.2 Edit /sys/i386/isa/scc.c

 The released defaults are sweet for 22SNAP.

 If your system is 215R or 210R, define FREEBSD210R, otherwise
 undefine it.
 Please browse section 5 FAQs.

2.1.2 Edit some files under /sys/i386/conf/

 Add the following lines to /sys/i386/conf/files.i386
 i386/isa/scc.c                  optional        scc     device-driver
 i386/isa/scc_subr.c             optional        scc     device-driver

 Add the following lines to your kenrnel configuration file, for
 example /sys/i386/conf/PAO.
 device          scc0 at isa? port 0x240 irq 10 iomem 0xd4000 vector sccintr
 device          scc1 at isa? port 0x244 irq 11 iomem 0xd8000 vector sccintr

2.1.3 Edit some files under /sys/i386/i386/

 If your system is 215R or 210R, patch to the /sys/i386/i386/conf.c.
 Note, each patch includes an absolute path.

 # patch -p0 < conf.c.diff-215R
 (or)
 # patch -p0 < conf.c.diff-210R

 If your system is 22SNAP or 215R, patch to the /sys/i386/i386/userconfig.c
 Note, each patch includes an absolute path.
 Warning: We did not check about 210R.
          This patch will add the following line in device_info[].
  {"scc",         "IBM Smart Capture Card",           0,      CLS_MMEDIA},

 # patch -p0 < userconfig.c.diff-215R
 (or)
 # patch -p0 < userconfig.c.diff-22SNAP


2.1.4 Make and install new kernel

 In this case, we assume your config file name is PAO. Make new kernel
 and install it.

 # cd /sys/i386/conf
 # config PAO
 # cd /sys/compile/PAO
 # make depend
 # make
 # make install

2.2 Make special devices

 # cd /dev
 # mknod scc0 c 76 0
 # mknod sccctl0 c 76 128

 (if you want to use 2nd SCC, make special devices for 2nd SCC)  
 # mknod scc1 c 76 1
 # mknod sccctl0 c 76 129

 If your system is 22SNAP or 215R, the major number is 76, but 210R,
 the major number is 71.

2.3 Set up /etc/pccard.conf

2.3.1 Check that scc entry exist.

 Following lines are default setting of pccard.conf.sample.
 # IBM Smart Capture Card
 card "IBM Corp\." "Video Capture"
         config  default "scc0" any
         cardmem 0xd4000 0x0 0x8000
         insert  echo Smart Capture Card inserted
         remove  echo Smart Capture Card removed

 If you want to use 2nd scc, please edit /etc/pccard.conf as follows.
 # IBM Smart Capture Card
 card "IBM Corp\." "Video Capture"
         config  default "scc0" any
         cardmem 0xd4000 0x0 0x4000
         config  default "scc1" any
         cardmem 0xd9000 0x0 0x4000
         insert  echo Smart Capture Card inserted
         remove  echo Smart Capture Card removed

2.4 Reboot

2.4.1 Check the following message that are reported form kernel at
      boot up.

 pccard driver scc added
 scc0 not found

 (For 2nd scc as follows)
 pccard driver scc added
 scc1 not found

 These message mean that scc driver for ISA device was not found but
 the driver for PC-card was added.

2.4.2 Insert a SCC to a PC-Card slot

 scc0: init

 It is success, if this message was displayed and PC-card event beep
 wringed.

2.4.3 Remove the SCC form the PC-Card slot

 scc0: unload
 Return IRQ=10
 Card removed, slot 0
 stray irq 10

 These messages are a sample of my system.

 Caution: Don't remove the SCC when an aplication is accessing it.

3. Change log

Ver.0.34 (Alpha RELEASE version)

4. Checked machines

 Alpha test status of the driver for FreeBSD

 Machine     | PCIC type   | comment
 ------------+-------------+---------------------------------------
 Desktop     | IBM King    | OK (define REMAP, Maxmem 48K)
 FMV-450NL/S | CL-PD6710   | OK (define REMAP or not, Maxmem 80K)
 FMV-450NL/T | CL-PD6710   | OK (define REMAP)
 TP230Cs-YB7 | VLSI 82C146 | only slot0 (define REMAP, Maxmem  32K)
 TP230Cs-FBZ | VLSI 82C146 | only slot0 (define REMAP, Maxmem  32K)
 jetmini     | RF5C396L    | OK (define REMAP)
 Power/V note| Vadem 468   | OK (define REMAP, Maxmem 48K)
 TP535       | CL-PD67??   | OK (define REMAP)
 TP530Cs     | i82891A     | only slot0 (define REMAP)
 DHU2 CTS5120| ?           | OK
 Mebius (P90)| Vadem 468   | only slot0 (define REMAP)

 Alpha test status of the driver for Linux

 ThinkPad230CS         OK
 ThinkPad230Cs(FBW)    OK
 ThinkPad370           OK
 ToshibaT610CT         only slot0
 Mebius(P90)           OK

 Please report me if your machine is not listed above.
   ohashi@mickey.ai.kyutech.ac.jp

5. FAQ

 Q1 Hung up my machine when I use an aplication.
 
 A1 Plese undefine REMAP_MEM_WIN in /sys/i386/isa/scc.c. By this
    change driver would not change memory window. Then maximum image
    size depends on the memory window size that is defined in
    /etc/pccard.conf

 (under translation)

6. Acknowledgement

I am  great thankful for members of SCC-Driver/Tester ML, especially,
Yoshihisa NAKAGAWA, Koji OKAMURA, Yoshihito OZAKI. And I also
acknowledge to Tatsume HOSOKAWA who is the director of PAO maintenance
team and members of BSD-nomads ML.