root/include/linux/fdreg.h

/* [previous][next][first][last][top][bottom][index][help] */

INCLUDED FROM


   1 #ifndef _LINUX_FDREG_H
   2 #define _LINUX_FDREG_H
   3 /*
   4  * This file contains some defines for the floppy disk controller.
   5  * Various sources. Mostly "IBM Microcomputers: A Programmers
   6  * Handbook", Sanches and Canton.
   7  */
   8 
   9 /* Fd controller regs. S&C, about page 340 */
  10 #define FD_STATUS       0x3f4
  11 #define FD_DATA         0x3f5
  12 #define FD_DOR          0x3f2           /* Digital Output Register */
  13 #define FD_DIR          0x3f7           /* Digital Input Register (read) */
  14 #define FD_DCR          0x3f7           /* Diskette Control Register (write)*/
  15 
  16 /* Bits of main status register */
  17 #define STATUS_BUSYMASK 0x0F            /* drive busy mask */
  18 #define STATUS_BUSY     0x10            /* FDC busy */
  19 #define STATUS_DMA      0x20            /* 0- DMA mode */
  20 #define STATUS_DIR      0x40            /* 0- cpu->fdc */
  21 #define STATUS_READY    0x80            /* Data reg ready */
  22 
  23 /* Bits of FD_ST0 */
  24 #define ST0_DS          0x03            /* drive select mask */
  25 #define ST0_HA          0x04            /* Head (Address) */
  26 #define ST0_NR          0x08            /* Not Ready */
  27 #define ST0_ECE         0x10            /* Equipment chech error */
  28 #define ST0_SE          0x20            /* Seek end */
  29 #define ST0_INTR        0xC0            /* Interrupt code mask */
  30 
  31 /* Bits of FD_ST1 */
  32 #define ST1_MAM         0x01            /* Missing Address Mark */
  33 #define ST1_WP          0x02            /* Write Protect */
  34 #define ST1_ND          0x04            /* No Data - unreadable */
  35 #define ST1_OR          0x10            /* OverRun */
  36 #define ST1_CRC         0x20            /* CRC error in data or addr */
  37 #define ST1_EOC         0x80            /* End Of Cylinder */
  38 
  39 /* Bits of FD_ST2 */
  40 #define ST2_MAM         0x01            /* Missing Addess Mark (again) */
  41 #define ST2_BC          0x02            /* Bad Cylinder */
  42 #define ST2_SNS         0x04            /* Scan Not Satisfied */
  43 #define ST2_SEH         0x08            /* Scan Equal Hit */
  44 #define ST2_WC          0x10            /* Wrong Cylinder */
  45 #define ST2_CRC         0x20            /* CRC error in data field */
  46 #define ST2_CM          0x40            /* Control Mark = deleted */
  47 
  48 /* Bits of FD_ST3 */
  49 #define ST3_HA          0x04            /* Head (Address) */
  50 #define ST3_TZ          0x10            /* Track Zero signal (1=track 0) */
  51 #define ST3_WP          0x40            /* Write Protect */
  52 
  53 /* Values for FD_COMMAND */
  54 #define FD_RECALIBRATE          0x07    /* move to track 0 */
  55 #define FD_SEEK                 0x0F    /* seek track */
  56 #define FD_READ                 0xE6    /* read with MT, MFM, SKip deleted */
  57 #define FD_WRITE                0xC5    /* write with MT, MFM */
  58 #define FD_SENSEI               0x08    /* Sense Interrupt Status */
  59 #define FD_SPECIFY              0x03    /* specify HUT etc */
  60 #define FD_FORMAT               0x4D    /* format one track */
  61 #define FD_VERSION              0x10    /* get version code */
  62 #define FD_CONFIGURE            0x13    /* configure FIFO operation */
  63 #define FD_PERPENDICULAR        0x12    /* perpendicular r/w mode */
  64 
  65 /* DMA commands */
  66 #define DMA_READ        0x46
  67 #define DMA_WRITE       0x4A
  68 
  69 /* FDC version return types */
  70 #define FDC_TYPE_STD    0x80    /* normal 8272A clone FDC */
  71 #define FDC_TYPE_82077  0x90    /* FIFO + perpendicular support */
  72 
  73 #endif

/* [previous][next][first][last][top][bottom][index][help] */