sun3_scsi.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. /*
  2. * Sun3 SCSI stuff by Erik Verbruggen (erik@bigmama.xtdnet.nl)
  3. *
  4. * Sun3 DMA additions by Sam Creasey (sammy@sammy.net)
  5. *
  6. * Adapted from mac_scsinew.h:
  7. */
  8. /*
  9. * Cumana Generic NCR5380 driver defines
  10. *
  11. * Copyright 1993, Drew Eckhardt
  12. * Visionary Computing
  13. * (Unix and Linux consulting and custom programming)
  14. * drew@colorado.edu
  15. * +1 (303) 440-4894
  16. */
  17. #ifndef SUN3_SCSI_H
  18. #define SUN3_SCSI_H
  19. /* additional registers - mainly DMA control regs */
  20. /* these start at regbase + 8 -- directly after the NCR regs */
  21. struct sun3_dma_regs {
  22. unsigned short dma_addr_hi; /* vme only */
  23. unsigned short dma_addr_lo; /* vme only */
  24. unsigned short dma_count_hi; /* vme only */
  25. unsigned short dma_count_lo; /* vme only */
  26. unsigned short udc_data; /* udc dma data reg (obio only) */
  27. unsigned short udc_addr; /* uda dma addr reg (obio only) */
  28. unsigned short fifo_data; /* fifo data reg, holds extra byte on
  29. odd dma reads */
  30. unsigned short fifo_count;
  31. unsigned short csr; /* control/status reg */
  32. unsigned short bpack_hi; /* vme only */
  33. unsigned short bpack_lo; /* vme only */
  34. unsigned short ivect; /* vme only */
  35. unsigned short fifo_count_hi; /* vme only */
  36. };
  37. /* ucd chip specific regs - live in dvma space */
  38. struct sun3_udc_regs {
  39. unsigned short rsel; /* select regs to load */
  40. unsigned short addr_hi; /* high word of addr */
  41. unsigned short addr_lo; /* low word */
  42. unsigned short count; /* words to be xfer'd */
  43. unsigned short mode_hi; /* high word of channel mode */
  44. unsigned short mode_lo; /* low word of channel mode */
  45. };
  46. /* addresses of the udc registers */
  47. #define UDC_MODE 0x38
  48. #define UDC_CSR 0x2e /* command/status */
  49. #define UDC_CHN_HI 0x26 /* chain high word */
  50. #define UDC_CHN_LO 0x22 /* chain lo word */
  51. #define UDC_CURA_HI 0x1a /* cur reg A high */
  52. #define UDC_CURA_LO 0x0a /* cur reg A low */
  53. #define UDC_CURB_HI 0x12 /* cur reg B high */
  54. #define UDC_CURB_LO 0x02 /* cur reg B low */
  55. #define UDC_MODE_HI 0x56 /* mode reg high */
  56. #define UDC_MODE_LO 0x52 /* mode reg low */
  57. #define UDC_COUNT 0x32 /* words to xfer */
  58. /* some udc commands */
  59. #define UDC_RESET 0
  60. #define UDC_CHN_START 0xa0 /* start chain */
  61. #define UDC_INT_ENABLE 0x32 /* channel 1 int on */
  62. /* udc mode words */
  63. #define UDC_MODE_HIWORD 0x40
  64. #define UDC_MODE_LSEND 0xc2
  65. #define UDC_MODE_LRECV 0xd2
  66. /* udc reg selections */
  67. #define UDC_RSEL_SEND 0x282
  68. #define UDC_RSEL_RECV 0x182
  69. /* bits in csr reg */
  70. #define CSR_DMA_ACTIVE 0x8000
  71. #define CSR_DMA_CONFLICT 0x4000
  72. #define CSR_DMA_BUSERR 0x2000
  73. #define CSR_FIFO_EMPTY 0x400 /* fifo flushed? */
  74. #define CSR_SDB_INT 0x200 /* sbc interrupt pending */
  75. #define CSR_DMA_INT 0x100 /* dma interrupt pending */
  76. #define CSR_LEFT 0xc0
  77. #define CSR_LEFT_3 0xc0
  78. #define CSR_LEFT_2 0x80
  79. #define CSR_LEFT_1 0x40
  80. #define CSR_PACK_ENABLE 0x20
  81. #define CSR_DMA_ENABLE 0x10
  82. #define CSR_SEND 0x8 /* 1 = send 0 = recv */
  83. #define CSR_FIFO 0x2 /* reset fifo */
  84. #define CSR_INTR 0x4 /* interrupt enable */
  85. #define CSR_SCSI 0x1
  86. #define VME_DATA24 0x3d00
  87. #endif /* SUN3_SCSI_H */