atafdreg.h 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. #ifndef _LINUX_FDREG_H
  2. #define _LINUX_FDREG_H
  3. /*
  4. ** WD1772 stuff
  5. */
  6. /* register codes */
  7. #define FDCSELREG_STP (0x80) /* command/status register */
  8. #define FDCSELREG_TRA (0x82) /* track register */
  9. #define FDCSELREG_SEC (0x84) /* sector register */
  10. #define FDCSELREG_DTA (0x86) /* data register */
  11. /* register names for FDC_READ/WRITE macros */
  12. #define FDCREG_CMD 0
  13. #define FDCREG_STATUS 0
  14. #define FDCREG_TRACK 2
  15. #define FDCREG_SECTOR 4
  16. #define FDCREG_DATA 6
  17. /* command opcodes */
  18. #define FDCCMD_RESTORE (0x00) /* - */
  19. #define FDCCMD_SEEK (0x10) /* | */
  20. #define FDCCMD_STEP (0x20) /* | TYP 1 Commands */
  21. #define FDCCMD_STIN (0x40) /* | */
  22. #define FDCCMD_STOT (0x60) /* - */
  23. #define FDCCMD_RDSEC (0x80) /* - TYP 2 Commands */
  24. #define FDCCMD_WRSEC (0xa0) /* - " */
  25. #define FDCCMD_RDADR (0xc0) /* - */
  26. #define FDCCMD_RDTRA (0xe0) /* | TYP 3 Commands */
  27. #define FDCCMD_WRTRA (0xf0) /* - */
  28. #define FDCCMD_FORCI (0xd0) /* - TYP 4 Command */
  29. /* command modifier bits */
  30. #define FDCCMDADD_SR6 (0x00) /* step rate settings */
  31. #define FDCCMDADD_SR12 (0x01)
  32. #define FDCCMDADD_SR2 (0x02)
  33. #define FDCCMDADD_SR3 (0x03)
  34. #define FDCCMDADD_V (0x04) /* verify */
  35. #define FDCCMDADD_H (0x08) /* wait for spin-up */
  36. #define FDCCMDADD_U (0x10) /* update track register */
  37. #define FDCCMDADD_M (0x10) /* multiple sector access */
  38. #define FDCCMDADD_E (0x04) /* head settling flag */
  39. #define FDCCMDADD_P (0x02) /* precompensation off */
  40. #define FDCCMDADD_A0 (0x01) /* DAM flag */
  41. /* status register bits */
  42. #define FDCSTAT_MOTORON (0x80) /* motor on */
  43. #define FDCSTAT_WPROT (0x40) /* write protected (FDCCMD_WR*) */
  44. #define FDCSTAT_SPINUP (0x20) /* motor speed stable (Type I) */
  45. #define FDCSTAT_DELDAM (0x20) /* sector has deleted DAM (Type II+III) */
  46. #define FDCSTAT_RECNF (0x10) /* record not found */
  47. #define FDCSTAT_CRC (0x08) /* CRC error */
  48. #define FDCSTAT_TR00 (0x04) /* Track 00 flag (Type I) */
  49. #define FDCSTAT_LOST (0x04) /* Lost Data (Type II+III) */
  50. #define FDCSTAT_IDX (0x02) /* Index status (Type I) */
  51. #define FDCSTAT_DRQ (0x02) /* DRQ status (Type II+III) */
  52. #define FDCSTAT_BUSY (0x01) /* FDC is busy */
  53. /* PSG Port A Bit Nr 0 .. Side Sel .. 0 -> Side 1 1 -> Side 2 */
  54. #define DSKSIDE (0x01)
  55. #define DSKDRVNONE (0x06)
  56. #define DSKDRV0 (0x02)
  57. #define DSKDRV1 (0x04)
  58. /* step rates */
  59. #define FDCSTEP_6 0x00
  60. #define FDCSTEP_12 0x01
  61. #define FDCSTEP_2 0x02
  62. #define FDCSTEP_3 0x03
  63. #endif