mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-11-30 00:02:44 +00:00
Merge PC-98 code int i386/isa/ft.c.
This commit is contained in:
parent
6e42740802
commit
507cf9c96e
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=24199
@ -3,7 +3,7 @@
|
||||
#
|
||||
# modified for PC-9801
|
||||
#
|
||||
# $Id: files.pc98,v 1.17 1997/03/19 16:14:25 kato Exp $
|
||||
# $Id: files.pc98,v 1.18 1997/03/22 18:54:13 kato Exp $
|
||||
#
|
||||
aic7xxx_asm optional ahc device-driver \
|
||||
dependency "$S/dev/aic7xxx/*.[chyl]" \
|
||||
@ -106,7 +106,7 @@ pc98/pc98/atcompat_diskslice.c optional compat_atdisk
|
||||
i386/isa/elink.c optional ep device-driver
|
||||
#i386/isa/elink.c optional ie device-driver
|
||||
pc98/pc98/fd.c optional fd device-driver
|
||||
pc98/pc98/ft.c optional ft device-driver
|
||||
i386/isa/ft.c optional ft device-driver
|
||||
pc98/pc98/gpib.c optional gp device-driver
|
||||
pc98/isa/asc.c optional asc device-driver
|
||||
pc98/isa/gsc.c optional gsc device-driver
|
||||
|
@ -17,7 +17,7 @@
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* ft.c - QIC-40/80 floppy tape driver
|
||||
* $Id$
|
||||
* $Id: ft.c,v 1.31 1997/02/22 09:36:12 peter Exp $
|
||||
*
|
||||
* 01/19/95 ++sg
|
||||
* Cleaned up recalibrate/seek code at attach time for FreeBSD 2.x.
|
||||
@ -82,9 +82,13 @@
|
||||
#include <machine/clock.h>
|
||||
|
||||
#include <i386/isa/isa_device.h>
|
||||
#ifdef PC98
|
||||
#include <pc98/pc98/fdreg.h>
|
||||
#else
|
||||
#include <i386/isa/fdreg.h>
|
||||
#include <i386/isa/fdc.h>
|
||||
#include <i386/isa/rtc.h>
|
||||
#endif
|
||||
#include <i386/isa/fdc.h>
|
||||
#include <i386/isa/ftreg.h>
|
||||
|
||||
extern int ftintr __P((ftu_t ftu));
|
||||
@ -1507,9 +1511,17 @@ tape_recal(ftu_t ftu, int totape)
|
||||
|
||||
DPRT(("tape_recal start\n"));
|
||||
|
||||
#ifdef PC98
|
||||
outb(0xbe, FDP_FDDEXC | FDP_PORTEXC);
|
||||
#endif
|
||||
out_fdc(fdcu, NE7CMD_SPECIFY);
|
||||
#ifdef PC98
|
||||
out_fdc(fdcu, (totape) ? 0xEF : 0xCF);
|
||||
out_fdc(fdcu, 0x02);
|
||||
#else
|
||||
out_fdc(fdcu, (totape) ? 0xAD : 0xDF);
|
||||
out_fdc(fdcu, 0x02);
|
||||
#endif
|
||||
|
||||
s = splbio();
|
||||
out_fdc(fdcu, NE7CMD_RECAL);
|
||||
@ -1523,8 +1535,13 @@ tape_recal(ftu_t ftu, int totape)
|
||||
splx(s);
|
||||
|
||||
out_fdc(fdcu, NE7CMD_SPECIFY);
|
||||
#ifdef PC98
|
||||
out_fdc(fdcu, (totape) ? 0xEF : 0xCF);
|
||||
out_fdc(fdcu, 0x02);
|
||||
#else
|
||||
out_fdc(fdcu, (totape) ? 0xFD : 0xDF);
|
||||
out_fdc(fdcu, 0x02);
|
||||
#endif
|
||||
|
||||
DPRT(("tape_recal end\n"));
|
||||
return(0);
|
||||
@ -1652,21 +1669,31 @@ tape_start(ftu_t ftu, int motor)
|
||||
ft_p ft = ft_data[ftu];
|
||||
fdc_p fdc = ft->fdc;
|
||||
int s, mbits;
|
||||
#ifndef PC98
|
||||
static int mbmotor[] = { FDO_MOEN0, FDO_MOEN1, FDO_MOEN2, FDO_MOEN3 };
|
||||
#endif
|
||||
|
||||
s = splbio();
|
||||
DPRT(("tape_start start\n"));
|
||||
|
||||
/* reset, dma disable */
|
||||
#ifdef PC98
|
||||
outb(fdc->baseport+FDOUT, FDO_RST | FDO_FRY | FDO_AIE | FDO_MTON);
|
||||
#else
|
||||
outb(fdc->baseport+FDOUT, 0x00);
|
||||
#endif
|
||||
(void)ftintr_wait(ftu, FTCMD_RESET, hz/10);
|
||||
|
||||
/* raise reset, enable DMA, motor on if needed */
|
||||
#ifdef PC98
|
||||
outb(fdc->baseport+FDOUT, FDO_DMAE | FDO_MTON);
|
||||
#else
|
||||
mbits = ftu & 3;
|
||||
if (motor && ftu < 4)
|
||||
mbits |= mbmotor[ftu];
|
||||
|
||||
outb(fdc->baseport+FDOUT, FDO_FRST | FDO_FDMAEN | mbits);
|
||||
#endif
|
||||
(void)ftintr_wait(ftu, FTCMD_RESET, hz/10);
|
||||
|
||||
splx(s);
|
||||
@ -1674,8 +1701,10 @@ tape_start(ftu_t ftu, int motor)
|
||||
tape_recal(ftu, 1);
|
||||
|
||||
/* set transfer speed */
|
||||
#ifndef PC98
|
||||
outb(fdc->baseport+FDCTL, FDC_500KBPS);
|
||||
DELAY(10);
|
||||
#endif
|
||||
|
||||
DPRT(("tape_start end\n"));
|
||||
}
|
||||
@ -1697,18 +1726,28 @@ tape_end(ftu_t ftu)
|
||||
s = splbio();
|
||||
|
||||
/* reset, dma disable */
|
||||
#ifdef PC98
|
||||
outb(fdc->baseport+FDOUT, FDO_RST | FDO_FRY | FDO_AIE | FDO_MTON);
|
||||
#else
|
||||
outb(fdc->baseport+FDOUT, 0x00);
|
||||
#endif
|
||||
(void)ftintr_wait(ftu, FTCMD_RESET, hz/10);
|
||||
|
||||
/* raise reset, enable DMA */
|
||||
#ifdef PC98
|
||||
outb(fdc->baseport+FDOUT, FDO_DMAE | FDO_MTON);
|
||||
#else
|
||||
outb(fdc->baseport+FDOUT, FDO_FRST | FDO_FDMAEN);
|
||||
#endif
|
||||
(void)ftintr_wait(ftu, FTCMD_RESET, hz/10);
|
||||
|
||||
splx(s);
|
||||
|
||||
/* set transfer speed */
|
||||
#ifndef PC98
|
||||
outb(fdc->baseport+FDCTL, FDC_500KBPS);
|
||||
DELAY(10);
|
||||
#endif
|
||||
fdc->flags &= ~FDC_TAPE_BUSY;
|
||||
|
||||
DPRT(("tape_end end\n"));
|
||||
|
@ -3,7 +3,7 @@
|
||||
#
|
||||
# modified for PC-9801
|
||||
#
|
||||
# $Id: files.pc98,v 1.17 1997/03/19 16:14:25 kato Exp $
|
||||
# $Id: files.pc98,v 1.18 1997/03/22 18:54:13 kato Exp $
|
||||
#
|
||||
aic7xxx_asm optional ahc device-driver \
|
||||
dependency "$S/dev/aic7xxx/*.[chyl]" \
|
||||
@ -106,7 +106,7 @@ pc98/pc98/atcompat_diskslice.c optional compat_atdisk
|
||||
i386/isa/elink.c optional ep device-driver
|
||||
#i386/isa/elink.c optional ie device-driver
|
||||
pc98/pc98/fd.c optional fd device-driver
|
||||
pc98/pc98/ft.c optional ft device-driver
|
||||
i386/isa/ft.c optional ft device-driver
|
||||
pc98/pc98/gpib.c optional gp device-driver
|
||||
pc98/isa/asc.c optional asc device-driver
|
||||
pc98/isa/gsc.c optional gsc device-driver
|
||||
|
2586
sys/pc98/pc98/ft.c
2586
sys/pc98/pc98/ft.c
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user