*BSD News Article 51630


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!simtel!news.sprintlink.net!EU.net!sun4nl!news.iaf.nl!iafnl.iaf.nl!fozzie.sun3.iaf.nl!root
From: geert@sun3.iaf.nl (Geert Bosch)
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: Panasonic 52x CDROM support
Date: 20 Sep 1995 01:18:51 GMT
Organization: La Calandre Infortunee
Lines: 186
Message-ID: <43nq5r$bbu@fozzie.sun3.iaf.nl>
References: <DF12ux.8r@nemesis.lonestar.org>
Reply-To: geert@sun3.iaf.nl
NNTP-Posting-Host: fozzie.sun3.iaf.nl

:The problem is that there is no documentation on what the 522/523 command
:set *is*.  All we know is that it is different, mainly because Matsushita
:says so and the 562/563 DOS drivers don't work on 522/523 hardware. 

This night I browsed through the Linux sources (which include support for the 52x as well as
the 56x drives) and I noticed that the Linux driver was much less readable than the
FreeBSD driver. I made the following table which outlines the CD-ROM commands used in
the Linux and the BSD driver:

 Drive Commands:				CR-52x	CR-56x
					0	1

Seek					01	01
Read Data               READ		02	10
Read XA-Data            		03
Read Header             		04
Spin Up 	    			05	02
Spin Down 		DOOROPEN	06	06
Diagnostic              		07
Read UPC                		08	88?
Read ISRC               		09
Play Audio              		0A	PLAYTRKS?
Play Audio MSF          PLAYBLOCKS	0B	0E
Play Audio Track/Index  		0C
  Reset						0A
  LockCtl 		LOCK			0C
  TrayCtl 		DOORCLOSE		07
  SubChanInf?					11
  - 			ABORT			08
  -			PLAYTRKS		0F
	
Status Commands:

Read Status        	NOP		81	05?
Read Error              READERROR	82	82
Read Drive Version      READID		83	83
Mode Select (set mode)  MODESELECT	84	09
Mode Sense  (get mode)  MODESENSE	85	84
Set XA Parameter        		86
Read XA Parameter       		87
Read Capacity           		88	85
Read SUB_Q              READSUBQ 	89	87
Read Disc Code          		8A
Read Disc Information   READDINFO	8B	8B
Read TOC                READTOC		8C	8C
Pause/Resume            PAUSE		8D	0D
Read Packet             		8E	8E
  MultiSession					8D
Read Path Check         		00

/*
 * bits of the CDi_status register:
 */
#define s_not_result_ready 0x04  /* 0: "result ready" */
#define s_not_data_ready 0x02    /* 0: "data ready"   */
#define s_attention 0x01         /* 1: "attention required", */

/*
 * "generation specific" defs of the status_byte:
 */

/* CR-52x */
#define p0_door_closed  0x80
#define p0_caddy_in     0x40
#define p0_spinning     0x20
#define p0_check        0x10
#define p0_success      0x08 /* unused */
#define p0_busy         0x04
#define p0_bit_1        0x02 /* unused */
#define p0_disk_ok      0x01

/* CR-56x */
#define p1_door_closed  0x80
#define p1_disk_in      0x40
#define p1_spinning     0x20
#define p1_check        0x10
#define p1_busy         0x08
#define p1_door_locked  0x04
#define p1_bit_1        0x02 /* unused */
#define p1_disk_ok      0x01



:There may be differences in addition to the command set, such as how the commands
:and data transfers handshake, length of commands, timing, etc. 

There appeared to be a difference in reading the results of a command: for the 52x
it is neccessary to wait for (inb(port + 1) & 0x04) to become zero, before reading
each byte of the result.

:The Creative interface is pretty stupid and without interrupts or DMA, it is up to the
:driver to know when it has waited "long enough".  
The advantage of a stupid interface without interrupts and DMA is that it is (should be)
easier to program for.
:
:The TEAC CD55A is a similar problem.  It connects to the Creative interface,
:but has a completely different command structure than the 562/563 (10 bytes
:versus 7), and the CD55A uses the control signals differently than the
:562/563 drives do. 
The TEAC drive implementation isn't complete in the Linux driver: the driver is
only recognized. 
The 52x drives use the same command length: only the command codes are
different, the parameters appear to be identical. The status results are also
a little different.

:Also like the 522/523, the CD55A has no published command set.  So a lot of
:effort has to go into finding out how to operate the hardware.  

The Linux sources do contain the commands needed to use the 52x, but as
I'm a novice on the subject of Unix driver hacking it wasn't easy to browse
through a device driver source of 130 kB (the Linux one). Implementing
the changes needed to at least recognize the 52x turned out to be very
hard too: I didn't succeed in doing it this night, maybe somebody can help.

I'll include the diff's I made until now with this posting.
:
:If you have information on the 522/523 command set and precise programming
:details, that will help getting support added for those drives.

Precise details are a little hard, but I hope somebody can help me sort things out.


Greetings,
  Geert




-- 
E-Mail: geert@sun3.iaf.nl 
 Phone: +31-53-303054

begin 666 matcd.diff.Z
M'YV0*@*":!.&SA@R7][(27/&Q9@$5-#4 :&DCAL0(&* D"%#APP<'F%DS)&C
MAH(6* <6/.@PP94R9$!,*0-GHT@8,W34Z!CCQLB2"@(*'4I415"!,63 D,$B
M:0P;((8JP)C&#1T09-[ D?-&3!D45:_"44B'15@0!Q?:*9-B*H@];A-8G,/0
M#4RT:,+(0=N&S)8F0; ,:4)D2A(M778H" '"[8@T9LB4,0-"2I$I1:@\<2+D
MR1,J<;/**3.G#!T48^6439MF;8H="1*\4"&%M&D0=_)>;<,0S56O(-[4V2O9
M3IHQ952\<%S&#1G((&9;QJR9LV<JRN,*IR,&-=D54) $P<P"QNO8LWD\]7&D
MCMXP5LN4 3&'3L$Z<T# R5LZ.\8$>I3!U1=C](5"@62\%A>"6\#010]./ $%
M;.BI$ 0(HX4QQQMNA"$&&WF D)<<;;!!6GYCO-$&0<ZY$%=L"?R'441IH*@B
MBS'=D08;;(!@1A@[@A"&&70(^&)L,NKWQAT"ME!'30H)2:2 &-I&APL@1%30
M"?D]L81_(#P6V62579;99IU]%A=T*+1957>IT;'"%%0$04454Z0 @@D@H$ $
M%44XP0>=@::@9P@]]/EGH(,"ZH2A(/#!!T;IK0=FC!CU^:9WJJU A)U!')HH
M#'B888:ALJF@G@T^9(=2"QDIQ512-,P PJLMN'565EMU]=59<9IE%5IDJ,66
M6W#]-U===XTQ(E]^ 288888AIAAC8DI&V1!2[(3%8B#(Y09=9]@5D[-Z8550
M&%LDE1BX"9R5!@L@Z'%MF&6P49ICD&E;)G5H7A>:0E9RNEJQK;%%H716XJ;;
M0+W]-I]PQ)5A'')@CM#<<Y1)9V9U:6*WW KX.@?=;-QZFQW)"I"<+9DIR_ M
MR0 *^ :!!B*H(,T,.@A"HI8%04014DCQA!2*T4R000C-P<:2"!I,+PSTLK96
MU7WM'.[2!WVQ51EAD"$U"#G02\:Z6B=PA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