1 /* 2 * Definitions for a Mitsumi CD-ROM interface 3 * 4 * Copyright (C) 1992 Martin Harriss 5 * 6 * martin@bdsi.com 7 * 8 * This program is free software; you can redistribute it and/or modify 9 * it under the terms of the GNU General Public License as published by 10 * the Free Software Foundation; either version 2 of the License, or 11 * (at your option) any later version. 12 * 13 * This program is distributed in the hope that it will be useful, 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 * GNU General Public License for more details. 17 * 18 * You should have received a copy of the GNU General Public License 19 * along with this program; if not, write to the Free Software 20 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 21 * 22 */ 23
24 /* *** change this to set the I/O port address */ 25 #defineMCD_BASE_ADDR 0x300
26
27 /* *** change this to set the interrupt number */ 28 #defineMCD_INTR_NR 11
29
30 /* *** make the following line uncommented, if you're sure, 31 * *** all configuration is done */ 32 /* #define I_WAS_HERE */ 33
34 /* Increase this if you get lots of timeouts */ 35 #defineMCD_STATUS_DELAY 200
36
37 /* number of times to retry a command before giving up */ 38 #defineMCD_RETRY_ATTEMPTS 5
39
40 /* port access macro */ 41 #defineMCDPORT(x) (mcd_port + (x))
42
43 /* status bits */ 44
45 #define MST_CMD_CHECK 0x01 /* command error */ 46 #defineMST_BUSY 0x02 /* now playing */ 47 #define MST_READ_ERR 0x04 /* read error */ 48 #define MST_DSK_TYPE 0x08
49 #define MST_SERVO_CHECK 0x10
50 #defineMST_DSK_CHG 0x20 /* disk removed or changed */ 51 #defineMST_READY 0x40 /* disk in the drive */ 52 #defineMST_DOOR_OPEN 0x80 /* door is open */ 53
54 /* flag bits */ 55
56 #defineMFL_DATA 0x02 /* data available */ 57 #defineMFL_STATUS 0x04 /* status available */ 58
59 /* commands */ 60
61 #defineMCMD_GET_DISK_INFO 0x10 /* read info from disk */ 62 #defineMCMD_GET_Q_CHANNEL 0x20 /* read info from q channel */ 63 #defineMCMD_GET_STATUS 0x40
64 #defineMCMD_SET_MODE 0x50
65 #define MCMD_SOFT_RESET 0x60
66 #defineMCMD_STOP 0x70 /* stop play */ 67 #defineMCMD_CONFIG_DRIVE 0x90
68 #defineMCMD_SET_VOLUME 0xAE /* set audio level */ 69 #defineMCMD_PLAY_READ 0xC0 /* play or read data */ 70 #defineMCMD_GET_VERSION 0xDC
71 #defineMCMD_EJECT 0xF6 /* eject (FX drive) */ 72
73 /* borrowed from hd.c */ 74
75 #defineREAD_DATA(port, buf, nr) \
76 insb(port, buf, nr)
77
78 #defineSET_TIMER(func, jifs) \
79 ((timer_table[MCD_TIMER].expires = jiffies + jifs), \
80 (timer_table[MCD_TIMER].fn = func), \
81 (timer_active |= 1<<MCD_TIMER))
82
83 #defineCLEAR_TIMERtimer_active &= ~(1<<MCD_TIMER)
84
85 #defineMAX_TRACKS 104
86
87 structmsf{ 88 unsignedcharmin;
89 unsignedcharsec;
90 unsignedcharframe;
91 };
92
93 structmcd_Play_msf{ 94 structmsfstart;
95 structmsfend;
96 };
97
98 structmcd_DiskInfo{ 99 unsignedcharfirst;
100 unsignedcharlast;
101 structmsfdiskLength;
102 structmsffirstTrack;
103 };
104
105 structmcd_Toc{ 106 unsignedcharctrl_addr;
107 unsignedchartrack;
108 unsignedcharpointIndex;
109 structmsftrackTime;
110 structmsfdiskTime;
111 };
112
113 #ifndefI_WAS_HERE 114 #warning You have not edited mcd.h
115 #warning Perhaps irq and i/o settings are wrong.
116 #endif