hydra.h 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. /* $Linux: hydra.h,v 1.0 1994/10/26 02:03:47 cgd Exp $ */
  2. /*
  3. * Copyright (c) 1994 Timo Rossi
  4. * All rights reserved.
  5. *
  6. * Redistribution and use in source and binary forms, with or without
  7. * modification, are permitted provided that the following conditions
  8. * are met:
  9. * 1. Redistributions of source code must retain the above copyright
  10. * notice, this list of conditions and the following disclaimer.
  11. * 2. Redistributions in binary form must reproduce the above copyright
  12. * notice, this list of conditions and the following disclaimer in the
  13. * documentation and/or other materials provided with the distribution.
  14. * 3. All advertising materials mentioning features or use of this software
  15. * must display the following acknowledgement:
  16. * This product includes software developed by Timo Rossi
  17. * 4. The name of the author may not be used to endorse or promote products
  18. * derived from this software without specific prior written permission
  19. *
  20. * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
  21. * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  22. * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  23. * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  24. * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  25. * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  26. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  27. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  28. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  29. * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  30. */
  31. /*
  32. * The Hydra Systems card uses the National Semiconductor
  33. * 8390 NIC (Network Interface Controller) chip, located
  34. * at card base address + 0xffe1. NIC registers are accessible
  35. * only at odd byte addresses, so the register offsets must
  36. * be multiplied by two.
  37. *
  38. * Card address PROM is located at card base + 0xffc0 (even byte addresses)
  39. *
  40. * RAM starts at the card base address, and is 16K or 64K.
  41. * The current Amiga NetBSD hydra driver is hardwired for 16K.
  42. * It seems that the RAM should be accessed as words or longwords only.
  43. *
  44. */
  45. /* adapted for Linux by Topi Kanerva 03/29/95
  46. with original author's permission */
  47. #define HYDRA_NIC_BASE 0xffe1
  48. /* Page0 registers */
  49. #define NIC_CR 0 /* Command register */
  50. #define NIC_PSTART (1*2) /* Page start (write) */
  51. #define NIC_PSTOP (2*2) /* Page stop (write) */
  52. #define NIC_BNDRY (3*2) /* Boundary pointer */
  53. #define NIC_TSR (4*2) /* Transmit status (read) */
  54. #define NIC_TPSR (4*2) /* Transmit page start (write) */
  55. #define NIC_NCR (5*2) /* Number of collisions, read */
  56. #define NIC_TBCR0 (5*2) /* Transmit byte count low (write) */
  57. #define NIC_FIFO (6*2) /* FIFO reg. (read) */
  58. #define NIC_TBCR1 (6*2) /* Transmit byte count high (write) */
  59. #define NIC_ISR (7*2) /* Interrupt status register */
  60. #define NIC_RBCR0 (0xa*2) /* Remote byte count low (write) */
  61. #define NIC_RBCR1 (0xb*2) /* Remote byte count high (write) */
  62. #define NIC_RSR (0xc*2) /* Receive status (read) */
  63. #define NIC_RCR (0xc*2) /* Receive config (write) */
  64. #define NIC_CNTR0 (0xd*2) /* Frame alignment error count (read) */
  65. #define NIC_TCR (0xd*2) /* Transmit config (write) */
  66. #define NIC_CNTR1 (0xe*2) /* CRC error counter (read) */
  67. #define NIC_DCR (0xe*2) /* Data config (write) */
  68. #define NIC_CNTR2 (0xf*2) /* missed packet counter (read) */
  69. #define NIC_IMR (0xf*2) /* Interrupt mask reg. (write) */
  70. /* Page1 registers */
  71. #define NIC_PAR0 (1*2) /* Physical address */
  72. #define NIC_PAR1 (2*2)
  73. #define NIC_PAR2 (3*2)
  74. #define NIC_PAR3 (4*2)
  75. #define NIC_PAR4 (5*2)
  76. #define NIC_PAR5 (6*2)
  77. #define NIC_CURR (7*2) /* Current RX ring-buffer page */
  78. #define NIC_MAR0 (8*2) /* Multicast address */
  79. #define NIC_MAR1 (9*2)
  80. #define NIC_MAR2 (0xa*2)
  81. #define NIC_MAR3 (0xb*2)
  82. #define NIC_MAR4 (0xc*2)
  83. #define NIC_MAR5 (0xd*2)
  84. #define NIC_MAR6 (0xe*2)
  85. #define NIC_MAR7 (0xf*2)
  86. /* Command register definitions */
  87. #define CR_STOP 0x01 /* Stop -- software reset command */
  88. #define CR_START 0x02 /* Start */
  89. #define CR_TXP 0x04 /* Transmit packet */
  90. #define CR_RD0 0x08 /* Remote DMA cmd */
  91. #define CR_RD1 0x10
  92. #define CR_RD2 0x20
  93. #define CR_NODMA CR_RD2
  94. #define CR_PS0 0x40 /* Page select */
  95. #define CR_PS1 0x80
  96. #define CR_PAGE0 0
  97. #define CR_PAGE1 CR_PS0
  98. #define CR_PAGE2 CR_PS1
  99. /* Interrupt status reg. definitions */
  100. #define ISR_PRX 0x01 /* Packet received without errors */
  101. #define ISR_PTX 0x02 /* Packet transmitted without errors */
  102. #define ISR_RXE 0x04 /* Receive error */
  103. #define ISR_TXE 0x08 /* Transmit error */
  104. #define ISR_OVW 0x10 /* Ring buffer overrun */
  105. #define ISR_CNT 0x20 /* Counter overflow */
  106. #define ISR_RDC 0x40 /* Remote DMA compile */
  107. #define ISR_RST 0x80 /* Reset status */
  108. /* Data config reg. definitions */
  109. #define DCR_WTS 0x01 /* Word transfer select */
  110. #define DCR_BOS 0x02 /* Byte order select */
  111. #define DCR_LAS 0x04 /* Long address select */
  112. #define DCR_LS 0x08 /* Loopback select */
  113. #define DCR_AR 0x10 /* Auto-init remote */
  114. #define DCR_FT0 0x20 /* FIFO threshold select */
  115. #define DCR_FT1 0x40
  116. /* Transmit config reg. definitions */
  117. #define TCR_CRC 0x01 /* Inhibit CRC */
  118. #define TCR_LB0 0x02 /* Loopback control */
  119. #define TCR_LB1 0x04
  120. #define TCR_ATD 0x08 /* Auto transmit disable */
  121. #define TCR_OFST 0x10 /* Collision offset enable */
  122. /* Transmit status reg. definitions */
  123. #define TSR_PTX 0x01 /* Packet transmitted */
  124. #define TSR_COL 0x04 /* Transmit collided */
  125. #define TSR_ABT 0x08 /* Transmit aborted */
  126. #define TSR_CRS 0x10 /* Carrier sense lost */
  127. #define TSR_FU 0x20 /* FIFO underrun */
  128. #define TSR_CDH 0x40 /* CD Heartbeat */
  129. #define TSR_OWC 0x80 /* Out of Window Collision */
  130. /* Receiver config register definitions */
  131. #define RCR_SEP 0x01 /* Save errored packets */
  132. #define RCR_AR 0x02 /* Accept runt packets */
  133. #define RCR_AB 0x04 /* Accept broadcast */
  134. #define RCR_AM 0x08 /* Accept multicast */
  135. #define RCR_PRO 0x10 /* Promiscuous mode */
  136. #define RCR_MON 0x20 /* Monitor mode */
  137. /* Receiver status register definitions */
  138. #define RSR_PRX 0x01 /* Packet received without error */
  139. #define RSR_CRC 0x02 /* CRC error */
  140. #define RSR_FAE 0x04 /* Frame alignment error */
  141. #define RSR_FO 0x08 /* FIFO overrun */
  142. #define RSR_MPA 0x10 /* Missed packet */
  143. #define RSR_PHY 0x20 /* Physical address */
  144. #define RSR_DIS 0x40 /* Received disabled */
  145. #define RSR_DFR 0x80 /* Deferring (jabber) */
  146. /* Hydra System card address PROM offset */
  147. #define HYDRA_ADDRPROM 0xffc0