Remove the scd(4) driver for Sony CDU31/33 CD-ROM drives.
This is a driver for a pre-ATAPI ISA CD-ROM adapter. The driver only uses PIO.
This commit is contained in:
parent
7f6870434e
commit
8891240001
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=304498
@ -38,6 +38,8 @@
|
||||
# xargs -n1 | sort | uniq -d;
|
||||
# done
|
||||
|
||||
# 20160819: Remove scd(4)
|
||||
OLD_FILES+=usr/share/man/man4/scd.4.gz
|
||||
# 20160815: Remove mcd(4)
|
||||
OLD_FILES+=usr/share/man/man4/mcd.4.gz
|
||||
# 20160703: POSIXify locales with variants
|
||||
|
@ -441,7 +441,6 @@ MAN= aac.4 \
|
||||
sbp.4 \
|
||||
sbp_targ.4 \
|
||||
scc.4 \
|
||||
scd.4 \
|
||||
sched_4bsd.4 \
|
||||
sched_ule.4 \
|
||||
screen.4 \
|
||||
|
@ -1,74 +0,0 @@
|
||||
.\"
|
||||
.\" Copyright (c) 1995 Jordan K. Hubbard
|
||||
.\" All rights reserved.
|
||||
.\"
|
||||
.\" Redistribution and use in source and binary forms, with or without
|
||||
.\" modification, are permitted provided that the following conditions
|
||||
.\" are met:
|
||||
.\" 1. Redistributions of source code must retain the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer.
|
||||
.\" 2. Redistributions in binary form must reproduce the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer in the
|
||||
.\" documentation and/or other materials provided with the distribution.
|
||||
.\" 3. The name of the author may not be used to endorse or promote products
|
||||
.\" derived from this software without specific prior written permission
|
||||
.\"
|
||||
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
.\"
|
||||
.\" $FreeBSD$
|
||||
.\"
|
||||
.Dd March 17, 2008
|
||||
.Dt SCD 4
|
||||
.Os
|
||||
.Sh NAME
|
||||
.Nm scd
|
||||
.Nd Sony CDU31/33 CD-ROM driver
|
||||
.Sh SYNOPSIS
|
||||
.Cd "device scd"
|
||||
.Pp
|
||||
In
|
||||
.Pa /boot/device.hints :
|
||||
.Cd hint.scd.0.at="isa"
|
||||
.Cd hint.scd.0.port="0x230"
|
||||
.Sh DESCRIPTION
|
||||
The
|
||||
.Nm
|
||||
driver provides a data interface to the Sony CDU31 and CDU33A CD-ROM
|
||||
drives.
|
||||
The drive must be hooked to a Sony proprietary interface
|
||||
card or a compatible clone.
|
||||
.Sh FILES
|
||||
.Bl -tag -width /dev/[r]scd0a -compact
|
||||
.It Pa /dev/[r]scd0a
|
||||
accesses
|
||||
.Bx
|
||||
partition on the disc.
|
||||
Normally, there is only
|
||||
one file system on a CDROM disc.
|
||||
.It Pa /dev/[r]scd0c
|
||||
accesses the raw device.
|
||||
.El
|
||||
.Sh SEE ALSO
|
||||
.Pa /sys/dev/scd/scd.c
|
||||
.Sh HISTORY
|
||||
The
|
||||
.Nm
|
||||
driver first appeared in
|
||||
.Fx 2.0.5 .
|
||||
.Sh AUTHORS
|
||||
.An -nosplit
|
||||
The driver was written by
|
||||
.An Mikael Hybsch
|
||||
with code contributed by
|
||||
.An Holger Veit
|
||||
and
|
||||
.An Brian Moore .
|
@ -2411,15 +2411,10 @@ options SND_OLDSTEREO
|
||||
#
|
||||
# Miscellaneous hardware:
|
||||
#
|
||||
# scd: Sony CD-ROM using proprietary (non-ATAPI) interface
|
||||
# bktr: Brooktree bt848/848a/849a/878/879 video capture and TV Tuner board
|
||||
# joy: joystick (including IO DATA PCJOY PC Card joystick)
|
||||
# cmx: OmniKey CardMan 4040 pccard smartcard reader
|
||||
|
||||
# for the Sony CDU31/33A CDROM
|
||||
device scd
|
||||
hint.scd.0.at="isa"
|
||||
hint.scd.0.port="0x230"
|
||||
device joy # PnP aware, hints for non-PnP only
|
||||
hint.joy.0.at="isa"
|
||||
hint.joy.0.port="0x201"
|
||||
|
@ -2506,8 +2506,6 @@ dev/scc/scc_core.c optional scc
|
||||
dev/scc/scc_dev_quicc.c optional scc quicc
|
||||
dev/scc/scc_dev_sab82532.c optional scc
|
||||
dev/scc/scc_dev_z8530.c optional scc
|
||||
dev/scd/scd.c optional scd isa
|
||||
dev/scd/scd_isa.c optional scd isa
|
||||
dev/sdhci/sdhci.c optional sdhci
|
||||
dev/sdhci/sdhci_if.m optional sdhci
|
||||
dev/sdhci/sdhci_pci.c optional sdhci pci
|
||||
|
1431
sys/dev/scd/scd.c
1431
sys/dev/scd/scd.c
File diff suppressed because it is too large
Load Diff
@ -1,175 +0,0 @@
|
||||
/*
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__FBSDID("$FreeBSD$");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
#include <sys/kernel.h>
|
||||
#include <sys/module.h>
|
||||
#include <sys/conf.h>
|
||||
#include <sys/fcntl.h>
|
||||
#include <sys/bio.h>
|
||||
#include <sys/cdio.h>
|
||||
#include <sys/bus.h>
|
||||
|
||||
#include <sys/mutex.h>
|
||||
|
||||
#include <machine/bus.h>
|
||||
#include <machine/resource.h>
|
||||
#include <sys/rman.h>
|
||||
|
||||
#include <isa/isavar.h>
|
||||
|
||||
#include <dev/scd/scdreg.h>
|
||||
#include <dev/scd/scdvar.h>
|
||||
|
||||
static int scd_isa_probe (device_t);
|
||||
static int scd_isa_attach (device_t);
|
||||
static int scd_isa_detach (device_t);
|
||||
|
||||
static int scd_alloc_resources (device_t);
|
||||
static void scd_release_resources (device_t);
|
||||
|
||||
static int
|
||||
scd_isa_probe (device_t dev)
|
||||
{
|
||||
struct scd_softc * sc;
|
||||
int error;
|
||||
|
||||
/* No pnp support */
|
||||
if (isa_get_vendorid(dev))
|
||||
return (ENXIO);
|
||||
|
||||
/* IO port must be configured. */
|
||||
if (bus_get_resource_start(dev, SYS_RES_IOPORT, 0) == 0)
|
||||
return (ENXIO);
|
||||
|
||||
sc = device_get_softc(dev);
|
||||
sc->dev = dev;
|
||||
sc->port_rid = 0;
|
||||
sc->port_type = SYS_RES_IOPORT;
|
||||
error = scd_alloc_resources(dev);
|
||||
if (error)
|
||||
goto fail;
|
||||
|
||||
error = scd_probe(sc);
|
||||
if (error) {
|
||||
device_printf(dev, "Probe failed.\n");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
device_set_desc(dev, sc->data.name);
|
||||
|
||||
fail:
|
||||
scd_release_resources(dev);
|
||||
return (error);
|
||||
}
|
||||
|
||||
static int
|
||||
scd_isa_attach (device_t dev)
|
||||
{
|
||||
struct scd_softc * sc;
|
||||
int error;
|
||||
|
||||
sc = device_get_softc(dev);
|
||||
error = 0;
|
||||
|
||||
sc->dev = dev;
|
||||
sc->port_rid = 0;
|
||||
sc->port_type = SYS_RES_IOPORT;
|
||||
error = scd_alloc_resources(dev);
|
||||
if (error)
|
||||
goto fail;
|
||||
|
||||
error = scd_probe(sc);
|
||||
if (error) {
|
||||
device_printf(dev, "Re-Probe failed.\n");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
error = scd_attach(sc);
|
||||
if (error) {
|
||||
device_printf(dev, "Attach failed.\n");
|
||||
goto fail;
|
||||
}
|
||||
|
||||
return (0);
|
||||
fail:
|
||||
scd_release_resources(dev);
|
||||
return (error);
|
||||
}
|
||||
|
||||
static int
|
||||
scd_isa_detach (device_t dev)
|
||||
{
|
||||
struct scd_softc * sc;
|
||||
int error;
|
||||
|
||||
sc = device_get_softc(dev);
|
||||
error = 0;
|
||||
|
||||
destroy_dev(sc->scd_dev_t);
|
||||
|
||||
scd_release_resources(dev);
|
||||
|
||||
return (error);
|
||||
}
|
||||
|
||||
static int
|
||||
scd_alloc_resources (device_t dev)
|
||||
{
|
||||
struct scd_softc * sc;
|
||||
int error;
|
||||
|
||||
sc = device_get_softc(dev);
|
||||
error = 0;
|
||||
mtx_init(&sc->mtx, "scd", NULL, MTX_DEF);
|
||||
|
||||
if (sc->port_type) {
|
||||
sc->port = bus_alloc_resource_any(dev, sc->port_type,
|
||||
&sc->port_rid, RF_ACTIVE);
|
||||
if (sc->port == NULL) {
|
||||
device_printf(dev, "Unable to allocate PORT resource.\n");
|
||||
error = ENOMEM;
|
||||
goto bad;
|
||||
}
|
||||
}
|
||||
|
||||
bad:
|
||||
return (error);
|
||||
}
|
||||
|
||||
void
|
||||
scd_release_resources (device_t dev)
|
||||
{
|
||||
struct scd_softc * sc;
|
||||
|
||||
sc = device_get_softc(dev);
|
||||
|
||||
if (sc->port)
|
||||
bus_release_resource(dev, sc->port_type, sc->port_rid, sc->port);
|
||||
|
||||
mtx_destroy(&sc->mtx);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static device_method_t scd_isa_methods[] = {
|
||||
DEVMETHOD(device_probe, scd_isa_probe),
|
||||
DEVMETHOD(device_attach, scd_isa_attach),
|
||||
DEVMETHOD(device_detach, scd_isa_detach),
|
||||
|
||||
{ 0, 0 }
|
||||
};
|
||||
|
||||
static driver_t scd_isa_driver = {
|
||||
"scd",
|
||||
scd_isa_methods,
|
||||
sizeof(struct scd_softc)
|
||||
};
|
||||
|
||||
static devclass_t scd_devclass;
|
||||
|
||||
DRIVER_MODULE(scd, isa, scd_isa_driver, scd_devclass, NULL, 0);
|
@ -1,139 +0,0 @@
|
||||
/*-
|
||||
* Copyright (c) 1995 Mikael Hybsch
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer
|
||||
* in this position and unchanged.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. The name of the author may not be used to endorse or promote products
|
||||
* derived from this software without specific prior written permission
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* $FreeBSD$
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef SCD_H
|
||||
#define SCD_H
|
||||
|
||||
typedef unsigned char bcd_t;
|
||||
#define M_msf(msf) msf[0]
|
||||
#define S_msf(msf) msf[1]
|
||||
#define F_msf(msf) msf[2]
|
||||
|
||||
#define OREG_COMMAND 0
|
||||
#define OREG_WPARAMS 1
|
||||
#define OREG_CONTROL 3
|
||||
#define CBIT_ATTENTION_CLEAR 0x01
|
||||
#define CBIT_RESULT_READY_CLEAR 0x02
|
||||
#define CBIT_DATA_READY_CLEAR 0x04
|
||||
#define CBIT_RPARAM_CLEAR 0x40
|
||||
#define CBIT_RESET_DRIVE 0x80
|
||||
|
||||
#define IREG_STATUS 0
|
||||
#define SBIT_ATTENTION 0x01
|
||||
#define SBIT_RESULT_READY 0x02
|
||||
#define SBIT_DATA_READY 0x04
|
||||
#define SBIT_BUSY 0x80
|
||||
|
||||
#define IREG_RESULT 1
|
||||
#define IREG_DATA 2
|
||||
#define IREG_FSTATUS 3
|
||||
#define FBIT_WPARAM_READY 0x01
|
||||
|
||||
#define CMD_GET_DRIVE_CONFIG 0x00
|
||||
#define CMD_SET_DRIVE_PARAM 0x10
|
||||
#define CMD_GET_SUBCHANNEL_DATA 0x21
|
||||
#define CMD_GET_TOC 0x24
|
||||
#define CMD_READ_TOC 0x30
|
||||
#define CMD_READ 0x34
|
||||
#define CMD_PLAY_AUDIO 0x40
|
||||
#define CMD_STOP_AUDIO 0x41
|
||||
#define CMD_EJECT 0x50
|
||||
#define CMD_SPIN_UP 0x51
|
||||
#define CMD_SPIN_DOWN 0x52
|
||||
|
||||
#define ERR_CD_NOT_LOADED 0x20
|
||||
#define ERR_NO_CD_INSIDE 0x21
|
||||
#define ERR_NOT_SPINNING 0x22
|
||||
#define ERR_FATAL_READ_ERROR1 0x53
|
||||
#define ERR_FATAL_READ_ERROR2 0x57
|
||||
|
||||
#define ATTEN_DRIVE_LOADED 0x80
|
||||
#define ATTEN_EJECT_PUSHED 0x81
|
||||
#define ATTEN_AUDIO_DONE 0x90
|
||||
#define ATTEN_SPIN_UP_DONE 0x24
|
||||
#define ATTEN_SPIN_DOWN 0x27
|
||||
#define ATTEN_EJECT_DONE 0x28
|
||||
|
||||
|
||||
struct sony_drive_configuration {
|
||||
char vendor[8];
|
||||
char product[16];
|
||||
char revision[8];
|
||||
u_short config;
|
||||
} __packed;
|
||||
|
||||
/* Almost same as cd_sub_channel_position_data */
|
||||
struct sony_subchannel_position_data {
|
||||
u_char control:4;
|
||||
u_char addr_type:4;
|
||||
u_char track_number;
|
||||
u_char index_number;
|
||||
u_char rel_msf[3];
|
||||
u_char dummy;
|
||||
u_char abs_msf[3];
|
||||
} __packed;
|
||||
|
||||
struct sony_tracklist {
|
||||
u_char adr :4; /* xcdplayer needs these two values */
|
||||
u_char ctl :4;
|
||||
u_char track;
|
||||
u_char start_msf[3];
|
||||
} __packed;
|
||||
|
||||
#define MAX_TRACKS 100
|
||||
|
||||
struct sony_toc {
|
||||
u_char session_number;
|
||||
|
||||
u_char :8;
|
||||
u_char :8;
|
||||
u_char first_track;
|
||||
u_char :8;
|
||||
u_char :8;
|
||||
|
||||
u_char :8;
|
||||
u_char :8;
|
||||
u_char last_track;
|
||||
u_char :8;
|
||||
u_char :8;
|
||||
|
||||
u_char :8;
|
||||
u_char :8;
|
||||
u_char lead_out_start_msf[3];
|
||||
|
||||
struct sony_tracklist tracks[MAX_TRACKS];
|
||||
|
||||
/* The rest is just to take space in case all data is returned */
|
||||
|
||||
u_char dummy[6*9];
|
||||
} __packed;
|
||||
|
||||
#endif /* SCD_H */
|
@ -1,65 +0,0 @@
|
||||
/*
|
||||
* $FreeBSD$
|
||||
*/
|
||||
|
||||
struct scd_mbx {
|
||||
short retry;
|
||||
short nblk;
|
||||
int sz;
|
||||
u_long skip;
|
||||
struct bio * bp;
|
||||
short count;
|
||||
};
|
||||
|
||||
struct scd_data {
|
||||
char double_speed;
|
||||
char * name;
|
||||
short flags;
|
||||
int blksize;
|
||||
u_long disksize;
|
||||
int openflag;
|
||||
struct {
|
||||
unsigned int adr :4;
|
||||
unsigned int ctl :4; /* xcdplayer needs this */
|
||||
unsigned char start_msf[3];
|
||||
} toc[MAX_TRACKS];
|
||||
short first_track;
|
||||
short last_track;
|
||||
struct ioc_play_msf last_play;
|
||||
|
||||
short audio_status;
|
||||
struct bio_queue_head head; /* head of bio queue */
|
||||
struct scd_mbx mbx;
|
||||
};
|
||||
|
||||
struct scd_softc {
|
||||
device_t dev;
|
||||
struct cdev *scd_dev_t;
|
||||
int debug;
|
||||
|
||||
struct resource * port;
|
||||
int port_rid;
|
||||
int port_type;
|
||||
|
||||
struct mtx mtx;
|
||||
|
||||
struct callout timer;
|
||||
int ch_state;
|
||||
struct scd_mbx * ch_mbxsave;
|
||||
|
||||
struct scd_data data;
|
||||
};
|
||||
|
||||
#define SCD_LOCK(_sc) mtx_lock(&_sc->mtx)
|
||||
#define SCD_UNLOCK(_sc) mtx_unlock(&_sc->mtx)
|
||||
#define SCD_ASSERT_LOCKED(_sc) mtx_assert(&_sc->mtx, MA_OWNED)
|
||||
|
||||
#define SCD_READ(_sc, _reg) \
|
||||
bus_read_1(_sc->port, _reg)
|
||||
#define SCD_READ_MULTI(_sc, _reg, _addr, _count) \
|
||||
bus_read_multi_1(_sc->port, _reg, _addr, _count)
|
||||
#define SCD_WRITE(_sc, _reg, _val) \
|
||||
bus_write_1(_sc->port, _reg, _val)
|
||||
|
||||
int scd_probe (struct scd_softc *);
|
||||
int scd_attach (struct scd_softc *);
|
@ -322,7 +322,6 @@ SUBDIR= \
|
||||
${_safe} \
|
||||
${_sbni} \
|
||||
scc \
|
||||
scd \
|
||||
${_scsi_low} \
|
||||
sdhci \
|
||||
sdhci_pci \
|
||||
|
@ -1,9 +0,0 @@
|
||||
# $FreeBSD$
|
||||
|
||||
.PATH: ${.CURDIR}/../../dev/scd
|
||||
|
||||
KMOD= scd
|
||||
SRCS= scd.c scd_isa.c
|
||||
SRCS+= bus_if.h device_if.h isa_if.h
|
||||
|
||||
.include <bsd.kmod.mk>
|
Loading…
Reference in New Issue
Block a user