OpenCores
URL https://opencores.org/ocsvn/or1k_old/or1k_old/trunk

Subversion Repositories or1k_old

[/] [or1k_old/] [trunk/] [rc203soc/] [sw/] [uClinux/] [include/] [linux/] [mcd.h] - Diff between revs 1765 and 1782

Only display areas with differences | Details | Blame | View Log

Rev 1765 Rev 1782
/*
/*
 * Definitions for a Mitsumi CD-ROM interface
 * Definitions for a Mitsumi CD-ROM interface
 *
 *
 *      Copyright (C) 1992  Martin Harriss
 *      Copyright (C) 1992  Martin Harriss
 *
 *
 *      martin@bdsi.com
 *      martin@bdsi.com
 *
 *
 *  This program is free software; you can redistribute it and/or modify
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *  (at your option) any later version.
 *
 *
 *  This program is distributed in the hope that it will be useful,
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *  GNU General Public License for more details.
 *
 *
 *  You should have received a copy of the GNU General Public License
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 *
 *
 */
 */
 
 
/* *** change this to set the I/O port address */
/* *** change this to set the I/O port address */
#define MCD_BASE_ADDR           0x300
#define MCD_BASE_ADDR           0x300
 
 
/* *** change this to set the interrupt number */
/* *** change this to set the interrupt number */
#define MCD_INTR_NR     11
#define MCD_INTR_NR     11
 
 
/* *** make the following line uncommented, if you're sure,
/* *** make the following line uncommented, if you're sure,
 * *** all configuration is done */
 * *** all configuration is done */
/* #define I_WAS_HERE */
/* #define I_WAS_HERE */
 
 
/* Increase this if you get lots of timeouts */
/* Increase this if you get lots of timeouts */
#define MCD_STATUS_DELAY        200
#define MCD_STATUS_DELAY        200
 
 
/* number of times to retry a command before giving up */
/* number of times to retry a command before giving up */
#define MCD_RETRY_ATTEMPTS      5
#define MCD_RETRY_ATTEMPTS      5
 
 
/* port access macro */
/* port access macro */
#define MCDPORT(x)              (mcd_port + (x))
#define MCDPORT(x)              (mcd_port + (x))
 
 
/* status bits */
/* status bits */
 
 
#define MST_CMD_CHECK           0x01            /* command error */
#define MST_CMD_CHECK           0x01            /* command error */
#define MST_BUSY                0x02            /* now playing */
#define MST_BUSY                0x02            /* now playing */
#define MST_READ_ERR            0x04            /* read error */
#define MST_READ_ERR            0x04            /* read error */
#define MST_DSK_TYPE            0x08
#define MST_DSK_TYPE            0x08
#define MST_SERVO_CHECK         0x10
#define MST_SERVO_CHECK         0x10
#define MST_DSK_CHG             0x20            /* disk removed or changed */
#define MST_DSK_CHG             0x20            /* disk removed or changed */
#define MST_READY               0x40            /* disk in the drive */
#define MST_READY               0x40            /* disk in the drive */
#define MST_DOOR_OPEN           0x80            /* door is open */
#define MST_DOOR_OPEN           0x80            /* door is open */
 
 
/* flag bits */
/* flag bits */
 
 
#define MFL_DATA                0x02            /* data available */
#define MFL_DATA                0x02            /* data available */
#define MFL_STATUS              0x04            /* status available */
#define MFL_STATUS              0x04            /* status available */
 
 
/* commands */
/* commands */
 
 
#define MCMD_GET_DISK_INFO      0x10            /* read info from disk */
#define MCMD_GET_DISK_INFO      0x10            /* read info from disk */
#define MCMD_GET_Q_CHANNEL      0x20            /* read info from q channel */
#define MCMD_GET_Q_CHANNEL      0x20            /* read info from q channel */
#define MCMD_GET_STATUS         0x40
#define MCMD_GET_STATUS         0x40
#define MCMD_SET_MODE           0x50
#define MCMD_SET_MODE           0x50
#define MCMD_SOFT_RESET         0x60
#define MCMD_SOFT_RESET         0x60
#define MCMD_STOP               0x70            /* stop play */
#define MCMD_STOP               0x70            /* stop play */
#define MCMD_CONFIG_DRIVE       0x90
#define MCMD_CONFIG_DRIVE       0x90
#define MCMD_SET_VOLUME         0xAE            /* set audio level */
#define MCMD_SET_VOLUME         0xAE            /* set audio level */
#define MCMD_PLAY_READ          0xC0            /* play or read data */
#define MCMD_PLAY_READ          0xC0            /* play or read data */
#define MCMD_GET_VERSION        0xDC
#define MCMD_GET_VERSION        0xDC
#define MCMD_EJECT              0xF6            /* eject (FX drive) */
#define MCMD_EJECT              0xF6            /* eject (FX drive) */
 
 
/* borrowed from hd.c */
/* borrowed from hd.c */
 
 
#define READ_DATA(port, buf, nr) \
#define READ_DATA(port, buf, nr) \
insb(port, buf, nr)
insb(port, buf, nr)
 
 
#define SET_TIMER(func, jifs) \
#define SET_TIMER(func, jifs) \
        ((timer_table[MCD_TIMER].expires = jiffies + jifs), \
        ((timer_table[MCD_TIMER].expires = jiffies + jifs), \
        (timer_table[MCD_TIMER].fn = func), \
        (timer_table[MCD_TIMER].fn = func), \
        (timer_active |= 1<<MCD_TIMER))
        (timer_active |= 1<<MCD_TIMER))
 
 
#define CLEAR_TIMER             timer_active &= ~(1<<MCD_TIMER)
#define CLEAR_TIMER             timer_active &= ~(1<<MCD_TIMER)
 
 
#define MAX_TRACKS              104
#define MAX_TRACKS              104
 
 
struct msf {
struct msf {
        unsigned char   min;
        unsigned char   min;
        unsigned char   sec;
        unsigned char   sec;
        unsigned char   frame;
        unsigned char   frame;
};
};
 
 
struct mcd_Play_msf {
struct mcd_Play_msf {
        struct msf      start;
        struct msf      start;
        struct msf      end;
        struct msf      end;
};
};
 
 
struct mcd_DiskInfo {
struct mcd_DiskInfo {
        unsigned char   first;
        unsigned char   first;
        unsigned char   last;
        unsigned char   last;
        struct msf      diskLength;
        struct msf      diskLength;
        struct msf      firstTrack;
        struct msf      firstTrack;
};
};
 
 
struct mcd_Toc {
struct mcd_Toc {
        unsigned char   ctrl_addr;
        unsigned char   ctrl_addr;
        unsigned char   track;
        unsigned char   track;
        unsigned char   pointIndex;
        unsigned char   pointIndex;
        struct msf      trackTime;
        struct msf      trackTime;
        struct msf      diskTime;
        struct msf      diskTime;
};
};
 
 
#ifndef I_WAS_HERE
#ifndef I_WAS_HERE
#warning You have not edited mcd.h
#warning You have not edited mcd.h
#warning Perhaps irq and i/o settings are wrong.
#warning Perhaps irq and i/o settings are wrong.
#endif
#endif
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.