cdu31a 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. CDU31A/CDU33A Driver Info
  2. -------------------------
  3. Information on the Sony CDU31A/CDU33A CDROM driver for the Linux
  4. kernel.
  5. Corey Minyard (minyard@metronet.com)
  6. Colossians 3:17
  7. Crude Table of Contents
  8. -----------------------
  9. Setting Up the Hardware
  10. Configuring the Kernel
  11. Configuring as a Module
  12. Driver Special Features
  13. This device driver handles Sony CDU31A/CDU33A CDROM drives and
  14. provides a complete block-level interface as well as an ioctl()
  15. interface as specified in include/linux/cdrom.h). With this
  16. interface, CDROMs can be accessed, standard audio CDs can be played
  17. back normally, and CD audio information can be read off the drive.
  18. Note that this will only work for CDU31A/CDU33A drives. Some vendors
  19. market their drives as CDU31A compatible. They lie. Their drives are
  20. really CDU31A hardware interface compatible (they can plug into the
  21. same card). They are not software compatible.
  22. Setting Up the Hardware
  23. -----------------------
  24. The CDU31A driver is unable to safely tell if an interface card is
  25. present that it can use because the interface card does not announce
  26. its presence in any way besides placing 4 I/O locations in memory. It
  27. used to just probe memory and attempt commands, but Linus wisely asked
  28. me to remove that because it could really screw up other hardware in
  29. the system.
  30. Because of this, you must tell the kernel where the drive interface
  31. is, what interrupts are used, and possibly if you are on a PAS-16
  32. soundcard.
  33. If you have the Sony CDU31A/CDU33A drive interface card, the following
  34. diagram will help you set it up. If you have another card, you are on
  35. your own. You need to make sure that the I/O address and interrupt is
  36. not used by another card in the system. You will need to know the I/O
  37. address and interrupt you have set. Note that use of interrupts is
  38. highly recommended, if possible, it really cuts down on CPU used.
  39. Unfortunately, most soundcards do not support interrupts for their
  40. CDROM interfaces. By default, the Sony interface card comes with
  41. interrupts disabled.
  42. +----------+-----------------+----------------------+
  43. | JP1 | 34 Pin Conn | |
  44. | JP2 +-----------------+ |
  45. | JP3 |
  46. | JP4 |
  47. | +--+
  48. | | +-+
  49. | | | | External
  50. | | | | Connector
  51. | | | |
  52. | | +-+
  53. | +--+
  54. | |
  55. | +--------+
  56. | |
  57. +------------------------------------------+
  58. JP1 sets the Base Address, using the following settings:
  59. Address Pin 1 Pin 2
  60. ------- ----- -----
  61. 0x320 Short Short
  62. 0x330 Short Open
  63. 0x340 Open Short
  64. 0x360 Open Open
  65. JP2 and JP3 configure the DMA channel; they must be set the same.
  66. DMA Pin 1 Pin 2 Pin 3
  67. --- ----- ----- -----
  68. 1 On Off On
  69. 2 Off On Off
  70. 3 Off Off On
  71. JP4 Configures the IRQ:
  72. IRQ Pin 1 Pin 2 Pin 3 Pin 4
  73. --- ----- ----- ----- -----
  74. 3 Off Off On Off
  75. 4 Off Off* Off On
  76. 5 On Off Off Off
  77. 6 Off On Off Off
  78. The documentation states to set this for interrupt
  79. 4, but I think that is a mistake.
  80. Note that if you have another interface card, you will need to look at
  81. the documentation to find the I/O base address. This is specified to
  82. the SLCD.SYS driver for DOS with the /B: parameter, so you can look at
  83. you DOS driver setup to find the address, if necessary.
  84. Configuring the Kernel
  85. ----------------------
  86. You must tell the kernel where the drive is at boot time. This can be
  87. done at the Linux boot prompt, by using LILO, or by using Bootlin.
  88. Note that this is no substitute for HOWTOs and LILO documentation, if
  89. you are confused please read those for info on bootline configuration
  90. and LILO.
  91. At the linux boot prompt, press the ALT key and add the following line
  92. after the boot name (you can let the kernel boot, it will tell you the
  93. default boot name while booting):
  94. cdu31a=<base address>,<interrupt>[,PAS]
  95. The base address needs to have "0x" in front of it, since it is in
  96. hex. For instance, to configure a drive at address 320 on interrupt 5,
  97. use the following:
  98. cdu31a=0x320,5
  99. I use the following boot line:
  100. cdu31a=0x1f88,0,PAS
  101. because I have a PAS-16 which does not support interrupt for the
  102. CDU31A interface.
  103. Adding this as an append line at the beginning of the /etc/lilo.conf
  104. file will set it for lilo configurations. I have the following as the
  105. first line in my lilo.conf file:
  106. append="cdu31a=0x1f88,0"
  107. I'm not sure how to set up Bootlin (I have never used it), if someone
  108. would like to fill in this section please do.
  109. Configuring as a Module
  110. -----------------------
  111. The driver supports loading as a module. However, you must specify
  112. the boot address and interrupt on the boot line to insmod. You can't
  113. use modprobe to load it, since modprobe doesn't support setting
  114. variables.
  115. Anyway, I use the following line to load my driver as a module
  116. /sbin/insmod /lib/modules/`uname -r`/misc/cdu31a.o cdu31a_port=0x1f88
  117. You can set the following variables in the driver:
  118. cdu31a_port=<I/O address> - sets the base I/O. If hex, put 0x in
  119. front of it. This must be specified.
  120. cdu31a_irq=<interrupt> - Sets the interrupt number. Leaving this
  121. off will turn interrupts off.
  122. Driver Special Features
  123. -----------------------
  124. This section describes features beyond the normal audio and CD-ROM
  125. functions of the drive.
  126. 2048 byte buffer mode
  127. If a disk is mounted with -o block=2048, data is copied straight from
  128. the drive data port to the buffer. Otherwise, the readahead buffer
  129. must be involved to hold the other 1K of data when a 1K block
  130. operation is done. Note that with 2048 byte blocks you cannot execute
  131. files from the CD.
  132. XA compatibility
  133. The driver should support XA disks for both the CDU31A and CDU33A. It
  134. does this transparently, the using program doesn't need to set it.
  135. Multi-Session
  136. A multi-session disk looks just like a normal disk to the user. Just
  137. mount one normally, and all the data should be there. A special
  138. thanks to Koen for help with this!
  139. Raw sector I/O
  140. Using the CDROMREADAUDIO it is possible to read raw audio and data
  141. tracks. Both operations return 2352 bytes per sector. On the data
  142. tracks, the first 12 bytes is not returned by the drive and the value
  143. of that data is indeterminate.