1*323e9233Smiod /* $OpenBSD: fdreg.h,v 1.1 2005/03/09 18:41:49 miod Exp $ */ 2*323e9233Smiod /* $NetBSD: fdreg.h,v 1.9 2003/08/07 16:29:35 agc Exp $ */ 3*323e9233Smiod 4*323e9233Smiod /*- 5*323e9233Smiod * Copyright (c) 1991 The Regents of the University of California. 6*323e9233Smiod * All rights reserved. 7*323e9233Smiod * 8*323e9233Smiod * Redistribution and use in source and binary forms, with or without 9*323e9233Smiod * modification, are permitted provided that the following conditions 10*323e9233Smiod * are met: 11*323e9233Smiod * 1. Redistributions of source code must retain the above copyright 12*323e9233Smiod * notice, this list of conditions and the following disclaimer. 13*323e9233Smiod * 2. Redistributions in binary form must reproduce the above copyright 14*323e9233Smiod * notice, this list of conditions and the following disclaimer in the 15*323e9233Smiod * documentation and/or other materials provided with the distribution. 16*323e9233Smiod * 3. Neither the name of the University nor the names of its contributors 17*323e9233Smiod * may be used to endorse or promote products derived from this software 18*323e9233Smiod * without specific prior written permission. 19*323e9233Smiod * 20*323e9233Smiod * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 21*323e9233Smiod * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22*323e9233Smiod * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23*323e9233Smiod * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 24*323e9233Smiod * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25*323e9233Smiod * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 26*323e9233Smiod * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 27*323e9233Smiod * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 28*323e9233Smiod * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 29*323e9233Smiod * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 30*323e9233Smiod * SUCH DAMAGE. 31*323e9233Smiod * 32*323e9233Smiod * @(#)fdreg.h 7.1 (Berkeley) 5/9/91 33*323e9233Smiod */ 34*323e9233Smiod 35*323e9233Smiod /* 36*323e9233Smiod * AT floppy controller registers and bitfields 37*323e9233Smiod */ 38*323e9233Smiod 39*323e9233Smiod /* uses NEC765 controller */ 40*323e9233Smiod #include <dev/ic/nec765reg.h> 41*323e9233Smiod 42*323e9233Smiod /* 43*323e9233Smiod * Register offsets for the 82077 controller. 44*323e9233Smiod */ 45*323e9233Smiod #define FDREG77_STATUSA 0 46*323e9233Smiod #define FDREG77_STATUSB 1 47*323e9233Smiod #define FDREG77_DOR 2 /* Digital Output Register (R/W) */ 48*323e9233Smiod #define FDREG77_TDR 3 /* Tape Control Register (R/W) */ 49*323e9233Smiod #define FDREG77_MSR 4 /* Main Status Register (R) */ 50*323e9233Smiod #define FDREG77_DRS 4 /* Data Rate Select Register (W) */ 51*323e9233Smiod #define FDREG77_FIFO 5 /* Data (FIFO) register (R/W) */ 52*323e9233Smiod #define FDREG77_DIR 7 /* Digital Input Register (R) */ 53*323e9233Smiod #define FDREG77_CCR 7 /* Configuration Control (W) */ 54*323e9233Smiod 55*323e9233Smiod /* Data Select Register bits */ 56*323e9233Smiod #define DRS_RESET 0x80 57*323e9233Smiod #define DRS_POWER 0x40 58*323e9233Smiod #define DRS_PLL 0x20 59*323e9233Smiod #define FDC_500KBPS 0x00 /* 500KBPS MFM drive transfer rate */ 60*323e9233Smiod #define FDC_300KBPS 0x01 /* 300KBPS MFM drive transfer rate */ 61*323e9233Smiod #define FDC_250KBPS 0x02 /* 250KBPS MFM drive transfer rate */ 62*323e9233Smiod #define FDC_125KBPS 0x03 /* 125KBPS FM drive transfer rate */ 63*323e9233Smiod 64*323e9233Smiod /* Digital Output Register bits (modified on suns) */ 65*323e9233Smiod #define FDO_DS 0x01 /* floppy device select (neg) */ 66*323e9233Smiod #define FDO_FRST 0x04 /* floppy controller reset (neg) */ 67*323e9233Smiod #define FDO_FDMAEN 0x08 /* enable floppy DMA and Interrupt */ 68*323e9233Smiod #define FDO_MOEN(n) ((1 << n) << 4) /* motor enable */ 69*323e9233Smiod #define FDO_DEN 0x40 /* Density select */ 70*323e9233Smiod #define FDO_EJ 0x80 /* Eject disk */ 71*323e9233Smiod 72*323e9233Smiod /* Digital Input Register bits */ 73*323e9233Smiod #define FDI_DCHG 0x80 /* diskette has been changed */ 74*323e9233Smiod 75*323e9233Smiod /* XXX - find a place for these... */ 76*323e9233Smiod #define NE7CMD_CFG 0x13 77*323e9233Smiod #define CFG_EIS 0x40 78*323e9233Smiod #define CFG_EFIFO 0x20 79*323e9233Smiod #define CFG_POLL 0x10 80*323e9233Smiod #define CFG_THRHLD_MASK 0x0f 81*323e9233Smiod 82*323e9233Smiod #define NE7CMD_LOCK 0x14 83*323e9233Smiod #define CFG_LOCK 0x80 84*323e9233Smiod 85*323e9233Smiod #define NE7CMD_MOTOR 0x0b 86*323e9233Smiod #define MOTOR_ON 0x80 87*323e9233Smiod 88*323e9233Smiod #define NE7CMD_DUMPREG 0x0e 89*323e9233Smiod #define NE7CMD_VERSION 0x10 90*323e9233Smiod 91*323e9233Smiod #define ST1_OVERRUN 0x10 92*323e9233Smiod 93*323e9233Smiod #define NE7_SPECIFY_NODMA 0x01 94