home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 2 / CD ACTUAL VOL 2.iso / docs / kernel.13 / readme.cdu < prev    next >
Encoding:
Text File  |  1995-09-10  |  6.5 KB  |  161 lines

  1.    Tips for using cdu31a.c, the driver for Sony CDU-31A and CDU-33A CDROM
  2.    drives.
  3.   
  4.    Corey Minyard (minyard@wf-rch.cirr.com)
  5.   
  6.    Colossians 3:17
  7.   
  8.    The Sony interface device driver handles Sony interface CDROM
  9.    drives and provides a complete block-level interface as well as an
  10.    ioctl() interface compatible with the Sun (as specified in
  11.    include/linux/cdrom.h).  With this interface, CDROMs can be
  12.    accessed and standard audio CDs can be played back normally.
  13.   
  14.    WARNING -     All autoprobes have been removed from the driver.
  15.           You MUST configure the CDU31A via a LILO config
  16.           at boot time or in lilo.conf.  I have the
  17.           following in my lilo.conf:
  18.   
  19.                   append="cdu31a=0x1f88,0,PAS"
  20.   
  21.           The first number is the I/O base address of the
  22.           card.  The second is the interrupt (0 means none).
  23.           The third should be "PAS" if on a Pro-Audio
  24.           spectrum, or nothing if on something else.
  25.   
  26.    This interface is (unfortunately) a polled interface.  This is
  27.    because most Sony interfaces are set up with DMA and interrupts
  28.    disables.  Some (like mine) do not even have the capability to
  29.    handle interrupts or DMA.  For this reason you will see a lot of
  30.    the following:
  31.   
  32.      retry_count = jiffies+ SONY_JIFFIES_TIMEOUT;
  33.      while ((retry_count > jiffies) && (! <some condition to wait for))
  34.      {
  35.         while (handle_sony_cd_attention())
  36.            ;
  37.   
  38.         sony_sleep();
  39.      }
  40.      if (the condition not met)
  41.      {
  42.         return an error;
  43.      }
  44.   
  45.    This ugly hack waits for something to happen, sleeping a little
  46.    between every try.  it also handles attentions, which are
  47.    asynchronous events from the drive informing the driver that a disk
  48.    has been inserted, removed, etc.
  49.   
  50.    NEWS FLASH - The driver now supports interrupts but they are
  51.    turned off by default.  Use of interrupts is highly encouraged, it
  52.    cuts CPU usage down to a reasonable level.  I had DMA in for a while
  53.    but PC DMA is just too slow.  Better to just insb() it.
  54.   
  55.    One thing about these drives: They talk in MSF (Minute Second Frame) format.
  56.    There are 75 frames a second, 60 seconds a minute, and up to 75 minutes on a
  57.    disk.  The funny thing is that these are sent to the drive in BCD, but the
  58.    interface wants to see them in decimal.  A lot of conversion goes on.
  59.   
  60.    DRIVER SPECIAL FEATURES
  61.    -----------------------
  62.   
  63.    This section describes features beyond the normal audio and CD-ROM
  64.    functions of the drive.
  65.   
  66.    2048 byte buffer mode
  67.   
  68.    If a disk is mounted with -o block=2048, data is copied straight
  69.    from the drive data port to the buffer.  Otherwise, the readahead
  70.    buffer must be involved to hold the other 1K of data when a 1K
  71.    block operation is done.  Note that with 2048 byte blocks you
  72.    cannot execute files from the CD.
  73.   
  74.    XA compatibility
  75.   
  76.    The driver should support XA disks for both the CDU31A and CDU33A.
  77.    It does this transparently, the using program doesn't need to set it.
  78.   
  79.    Multi-Session
  80.   
  81.    A multi-session disk looks just like a normal disk to the user.
  82.    Just mount one normally, and all the data should be there.
  83.    A special thanks to Koen for help with this!
  84.    
  85.    Raw sector I/O
  86.   
  87.    Using the CDROMREADAUDIO it is possible to read raw audio and data
  88.    tracks.  Both operations return 2352 bytes per sector.  On the data
  89.    tracks, the first 12 bytes is not returned by the drive and the value
  90.    of that data is indeterminate.
  91.   
  92.   
  93.     Copyright (C) 1993  Corey Minyard
  94.   
  95.     This program is free software; you can redistribute it and/or modify
  96.     it under the terms of the GNU General Public License as published by
  97.     the Free Software Foundation; either version 2 of the License, or
  98.     (at your option) any later version.
  99.   
  100.     This program is distributed in the hope that it will be useful,
  101.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  102.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  103.     GNU General Public License for more details.
  104.   
  105.     You should have received a copy of the GNU General Public License
  106.     along with this program; if not, write to the Free Software
  107.     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  108.   
  109.   /
  110.  
  111. /*
  112.   
  113.    Setting up the Sony CDU31A/CDU33A drive interface card.  If
  114.    You have another card, you are on your own.
  115.    
  116.         +----------+-----------------+----------------------+
  117.         |  JP1     |  34 Pin Conn    |                      |
  118.         |  JP2     +-----------------+                      |
  119.         |  JP3                                              |
  120.         |  JP4                                              |
  121.         |                                                   +--+
  122.         |                                                   |  +-+
  123.         |                                                   |  | |  External
  124.         |                                                   |  | |  Connector
  125.         |                                                   |  | |
  126.         |                                                   |  +-+
  127.         |                                                   +--+
  128.         |                                                   |
  129.         |                                          +--------+
  130.         |                                          |
  131.         +------------------------------------------+
  132.    
  133.       JP1 sets the Base Address, using the following settings:
  134.    
  135.         Address         Pin 1           Pin 2
  136.         -------         -----           -----
  137.         0x320           Short           Short
  138.         0x330           Short           Open
  139.         0x340           Open            Short
  140.         0x360           Open            Open
  141.    
  142.       JP2 and JP3 configure the DMA channel; they must be set the same.
  143.    
  144.         DMA             Pin 1           Pin 2           Pin 3
  145.         ---             -----           -----           -----
  146.         1               On              Off             On
  147.         2               Off             On              Off
  148.         3               Off             Off             On
  149.    
  150.       JP4 Configures the IRQ:
  151.    
  152.         IRQ     Pin 1           Pin 2           Pin 3           Pin 4
  153.         ---     -----           -----           -----           -----
  154.         3       Off             Off             On              Off
  155.         4       Off             Off*            Off             On
  156.         5       On              Off             Off             Off
  157.         6       Off             On              Off             Off
  158.    
  159.                   The documentation states to set this for interrupt
  160.                   4, but I think that is a mistake.
  161.