Home | History | Annotate | Line # | Download | only in dev
fdreg.h revision 1.2.172.1
      1  1.2.172.1  yamt /*	$NetBSD: fdreg.h,v 1.2.172.1 2010/03/11 15:02:09 yamt Exp $	*/
      2        1.1   leo 
      3        1.1   leo /*
      4        1.1   leo  * Copyright (c) 1995 Leo Weppelman.
      5        1.1   leo  * All rights reserved.
      6        1.1   leo  *
      7        1.1   leo  * Redistribution and use in source and binary forms, with or without
      8        1.1   leo  * modification, are permitted provided that the following conditions
      9        1.1   leo  * are met:
     10        1.1   leo  * 1. Redistributions of source code must retain the above copyright
     11        1.1   leo  *    notice, this list of conditions and the following disclaimer.
     12        1.1   leo  * 2. Redistributions in binary form must reproduce the above copyright
     13        1.1   leo  *    notice, this list of conditions and the following disclaimer in the
     14        1.1   leo  *    documentation and/or other materials provided with the distribution.
     15        1.1   leo  *
     16        1.1   leo  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     17        1.1   leo  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     18        1.1   leo  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     19        1.1   leo  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
     20        1.1   leo  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
     21        1.1   leo  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     22        1.1   leo  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     23        1.1   leo  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     24        1.1   leo  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
     25        1.1   leo  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     26        1.1   leo  */
     27        1.1   leo 
     28        1.1   leo #ifndef _FDREG_H
     29        1.1   leo #define _FDREG_H
     30        1.1   leo /*
     31        1.1   leo  * Atari TT hardware:
     32        1.1   leo  * Western Digital 1772 Floppy Disk Controller.
     33        1.1   leo  */
     34        1.1   leo 
     35        1.1   leo /*
     36        1.1   leo  * Accessing the FDC registers is indirect through ST-specific
     37        1.1   leo  * DMA circuitry. See also dma.h.
     38        1.1   leo  */
     39        1.2   leo #define	FDC_CS	(DMA_FDC              )	/* command/status		*/
     40        1.2   leo #define	FDC_TR	(DMA_FDC|       DMA_A0)	/* track register		*/
     41        1.2   leo #define	FDC_SR	(DMA_FDC|DMA_A1       )	/* sector register		*/
     42        1.2   leo #define	FDC_DR	(DMA_FDC|DMA_A1|DMA_A0)	/* data register		*/
     43        1.1   leo 
     44        1.1   leo /*
     45        1.1   leo  * commands (relevant bits/fields indicated)
     46        1.1   leo  */
     47        1.1   leo #define	RESTORE	0x00		/* ( HVRR) seek to track 0		*/
     48        1.1   leo #define	SEEK	0x10		/* ( HVRR) seek to track		*/
     49        1.1   leo #define	STEP	0x20		/* (UHVRR) step in same direction	*/
     50        1.1   leo #define	STEPI	0x40		/* (UHVRR) step in			*/
     51        1.1   leo #define	STEPO	0x60		/* (UHVRR) step out			*/
     52        1.1   leo #define	F_READ	0x80		/* (MHE00) read sector			*/
     53        1.1   leo #define	F_WRITE	0xA0		/* (MHEPA) write sector			*/
     54        1.1   leo #define	READID	0xC0		/* ( HE00) read sector ID		*/
     55        1.1   leo #define	READTR	0xE0		/* ( HE00) read track			*/
     56        1.1   leo #define	WRITETR	0xF0		/* ( HEP0) write track			*/
     57        1.1   leo #define	IRUPT	0xD0		/* ( IIII) force interrupt		*/
     58        1.1   leo 
     59        1.1   leo /*
     60        1.1   leo  * other bits/fields in command register
     61        1.1   leo  */
     62        1.1   leo #define	RATE6	0x00		/* not 2, but  6 msec steprate		*/
     63        1.1   leo #define	RATE12	0x01		/* not 3, but 12 msec steprate		*/
     64        1.1   leo #define	RATE2	0x02		/* not 5, but  2 msec steprate		*/
     65        1.1   leo #define	RATE3	0x03		/* not 6, but  3 msec steprate		*/
     66        1.1   leo #define	VBIT	0x04		/* verify sector ID			*/
     67        1.1   leo #define	HBIT	0x08		/* suppress motor on sequence		*/
     68        1.1   leo #define	UBIT	0x10		/* update track register		*/
     69        1.1   leo #define	EBIT	0x04		/* wait 30 msec to settle		*/
     70        1.1   leo #define	MBIT	0x10		/* multi-sector				*/
     71        1.1   leo #define	PBIT	0x02		/* write precompensate			*/
     72        1.1   leo #define	A0BIT	0x01		/* suppress (?) data address mark	*/
     73        1.1   leo #define	IINDEX	0x04		/* interrupt on each index pulse	*/
     74        1.1   leo #define	IFORCE	0x08		/* force interrupt			*/
     75        1.1   leo 
     76        1.1   leo /*
     77        1.1   leo  * status register
     78        1.1   leo  */
     79        1.1   leo #define	BUSY	0x01		/* set if command under execution	*/
     80        1.1   leo #define	DRQ	0x02		/* Data Register status (pin c1)	*/
     81        1.1   leo #define	LD_T00	0x04		/* lost data; track 00			*/
     82        1.1   leo #define	CRCERR	0x08		/* CRC error				*/
     83        1.1   leo #define	RNF	0x10		/* Record Not Found			*/
     84        1.1   leo #define	RT_SU	0x20		/* Record Type; Spin Up completed	*/
     85        1.1   leo #define	WRI_PRO	0x40		/* Write Protected			*/
     86        1.1   leo #define	MOTORON	0x80		/* Motor On				*/
     87        1.1   leo 
     88        1.1   leo #endif /* _FDREG_H */
     89