dgrs_es4h.h 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. /************************************************************************/
  2. /* */
  3. /* es4h.h: Hardware definition of the ES/4h Ethernet Switch, from */
  4. /* both the host and the 3051's point of view. */
  5. /* NOTE: this name is a misnomer now that there is a PCI */
  6. /* board. Everything that says "es4h" should really be */
  7. /* "se4". But we'll keep the old name for now. */
  8. /* */
  9. /* $Id: es4h.h,v 1.10 1996/08/22 17:16:53 rick Exp $ */
  10. /* */
  11. /************************************************************************/
  12. /************************************************************************/
  13. /* */
  14. /* EISA I/O Registers. These are located at 0x1000 * slot-number */
  15. /* plus the indicated address. I.E. 0x4000-0x4009 for slot 4. */
  16. /* */
  17. /************************************************************************/
  18. #define ES4H_MANUFmsb 0x00 /* Read-only */
  19. #define ES4H_MANUFlsb 0x01 /* Read-only */
  20. # define ES4H_MANUF_CODE 0x1049 /* = "DBI" */
  21. #define ES4H_PRODUCT 0x02 /* Read-only */
  22. # define ES4H_PRODUCT_CODE 0x0A
  23. # define EPC_PRODUCT_CODE 0x03
  24. #define ES4H_REVISION 0x03 /* Read-only */
  25. # define ES4H_REVISION_CODE 0x01
  26. #define ES4H_EC 0x04 /* EISA Control */
  27. # define ES4H_EC_RESET 0x04 /* WO, EISA reset */
  28. # define ES4H_EC_ENABLE 0x01 /* RW, EISA enable - set to */
  29. /* 1 before memory enable */
  30. #define ES4H_PC 0x05 /* Processor Control */
  31. # define ES4H_PC_RESET 0x04 /* RW, 3051 reset */
  32. # define ES4H_PC_INT 0x08 /* WO, assert 3051 intr. 3 */
  33. #define ES4H_MW 0x06 /* Memory Window select and enable */
  34. # define ES4H_MW_ENABLE 0x80 /* WO, enable memory */
  35. # define ES4H_MW_SELECT_MASK 0x1f /* WO, 32k window selected */
  36. #define ES4H_IS 0x07 /* Interrupt, addr select */
  37. # define ES4H_IS_INTMASK 0x07 /* WO, interrupt select */
  38. # define ES4H_IS_INTOFF 0x00 /* No IRQ */
  39. # define ES4H_IS_INT3 0x03 /* IRQ 3 */
  40. # define ES4H_IS_INT5 0x02 /* IRQ 5 */
  41. # define ES4H_IS_INT7 0x01 /* IRQ 7 */
  42. # define ES4H_IS_INT10 0x04 /* IRQ 10 */
  43. # define ES4H_IS_INT11 0x05 /* IRQ 11 */
  44. # define ES4H_IS_INT12 0x06 /* IRQ 12 */
  45. # define ES4H_IS_INT15 0x07 /* IRQ 15 */
  46. # define ES4H_IS_INTACK 0x10 /* WO, interrupt ack */
  47. # define ES4H_IS_INTPEND 0x10 /* RO, interrupt pending */
  48. # define ES4H_IS_LINEAR 0x40 /* WO, no memory windowing */
  49. # define ES4H_IS_AS15 0x80 /* RW, address select bit 15 */
  50. #define ES4H_AS_23_16 0x08 /* Address select bits 23-16 */
  51. #define ES4H_AS_31_24 0x09 /* Address select bits 31-24 */
  52. #define ES4H_IO_MAX 0x09 /* Size of I/O space */
  53. /*
  54. * PCI
  55. */
  56. #define SE6_RESET PLX_USEROUT
  57. /************************************************************************/
  58. /* */
  59. /* 3051 Memory Map */
  60. /* */
  61. /* Note: 3051 has 4K I-cache, 2K D-cache. 1 cycle is 50 nsec. */
  62. /* */
  63. /************************************************************************/
  64. #define SE4_NPORTS 4 /* # of ethernet ports */
  65. #define SE6_NPORTS 6 /* # of ethernet ports */
  66. #define SE_NPORTS 6 /* Max # of ethernet ports */
  67. #define ES4H_RAM_BASE 0x83000000 /* Base address of RAM */
  68. #define ES4H_RAM_SIZE 0x00200000 /* Size of RAM (2MB) */
  69. #define ES4H_RAM_INTBASE 0x83800000 /* Base of int-on-write RAM */
  70. /* a.k.a. PKT RAM */
  71. /* Ethernet controllers */
  72. /* See: i82596.h */
  73. #define ES4H_ETHER0_PORT 0xA2000000
  74. #define ES4H_ETHER0_CMD 0xA2000100
  75. #define ES4H_ETHER1_PORT 0xA2000200
  76. #define ES4H_ETHER1_CMD 0xA2000300
  77. #define ES4H_ETHER2_PORT 0xA2000400
  78. #define ES4H_ETHER2_CMD 0xA2000500
  79. #define ES4H_ETHER3_PORT 0xA2000600
  80. #define ES4H_ETHER3_CMD 0xA2000700
  81. #define ES4H_ETHER4_PORT 0xA2000800 /* RS SE-6 only */
  82. #define ES4H_ETHER4_CMD 0xA2000900 /* RS SE-6 only */
  83. #define ES4H_ETHER5_PORT 0xA2000A00 /* RS SE-6 only */
  84. #define ES4H_ETHER5_CMD 0xA2000B00 /* RS SE-6 only */
  85. #define ES4H_I8254 0xA2040000 /* 82C54 timers */
  86. /* See: i8254.h */
  87. #define SE4_I8254_HZ (23000000/4) /* EISA clock input freq. */
  88. #define SE4_IDT_HZ (46000000) /* EISA CPU freq. */
  89. #define SE6_I8254_HZ (20000000/4) /* PCI clock input freq. */
  90. #define SE6_IDT_HZ (50000000) /* PCI CPU freq. */
  91. #define ES4H_I8254_HZ (23000000/4) /* EISA clock input freq. */
  92. #define ES4H_GPP 0xA2050000 /* General purpose port */
  93. /*
  94. * SE-4 (EISA) GPP bits
  95. */
  96. # define ES4H_GPP_C0_100 0x0001 /* WO, Chan 0: 100 ohm TP */
  97. # define ES4H_GPP_C0_SQE 0x0002 /* WO, Chan 0: normal squelch */
  98. # define ES4H_GPP_C1_100 0x0004 /* WO, Chan 1: 100 ohm TP */
  99. # define ES4H_GPP_C1_SQE 0x0008 /* WO, Chan 1: normal squelch */
  100. # define ES4H_GPP_C2_100 0x0010 /* WO, Chan 2: 100 ohm TP */
  101. # define ES4H_GPP_C2_SQE 0x0020 /* WO, Chan 2: normal squelch */
  102. # define ES4H_GPP_C3_100 0x0040 /* WO, Chan 3: 100 ohm TP */
  103. # define ES4H_GPP_C3_SQE 0x0080 /* WO, Chan 3: normal squelch */
  104. # define ES4H_GPP_SQE 0x00AA /* WO, All: normal squelch */
  105. # define ES4H_GPP_100 0x0055 /* WO, All: 100 ohm TP */
  106. # define ES4H_GPP_HOSTINT 0x0100 /* RO, cause intr. to host */
  107. /* Hold high > 250 nsec */
  108. # define SE4_GPP_EED 0x0200 /* RW, EEPROM data bit */
  109. # define SE4_GPP_EECS 0x0400 /* RW, EEPROM chip select */
  110. # define SE4_GPP_EECK 0x0800 /* RW, EEPROM clock */
  111. /*
  112. * SE-6 (PCI) GPP bits
  113. */
  114. # define SE6_GPP_EED 0x0001 /* RW, EEPROM data bit */
  115. # define SE6_GPP_EECS 0x0002 /* RW, EEPROM chip select */
  116. # define SE6_GPP_EECK 0x0004 /* RW, EEPROM clock */
  117. # define SE6_GPP_LINK 0x00fc /* R, Link status LEDs */
  118. #define ES4H_INTVEC 0xA2060000 /* RO: Interrupt Vector */
  119. # define ES4H_IV_DMA0 0x01 /* Chan 0 DMA interrupt */
  120. # define ES4H_IV_PKT0 0x02 /* Chan 0 PKT interrupt */
  121. # define ES4H_IV_DMA1 0x04 /* Chan 1 DMA interrupt */
  122. # define ES4H_IV_PKT1 0x08 /* Chan 1 PKT interrupt */
  123. # define ES4H_IV_DMA2 0x10 /* Chan 2 DMA interrupt */
  124. # define ES4H_IV_PKT2 0x20 /* Chan 2 PKT interrupt */
  125. # define ES4H_IV_DMA3 0x40 /* Chan 3 DMA interrupt */
  126. # define ES4H_IV_PKT3 0x80 /* Chan 3 PKT interrupt */
  127. #define ES4H_INTACK 0xA2060000 /* WO: Interrupt Ack */
  128. # define ES4H_INTACK_8254 0x01 /* Real Time Clock (int 0) */
  129. # define ES4H_INTACK_HOST 0x02 /* Host (int 1) */
  130. # define ES4H_INTACK_PKT0 0x04 /* Chan 0 Pkt (int 2) */
  131. # define ES4H_INTACK_PKT1 0x08 /* Chan 1 Pkt (int 3) */
  132. # define ES4H_INTACK_PKT2 0x10 /* Chan 2 Pkt (int 4) */
  133. # define ES4H_INTACK_PKT3 0x20 /* Chan 3 Pkt (int 5) */
  134. #define SE6_PLX 0xA2070000 /* PLX 9060, SE-6 (PCI) only */
  135. /* see plx9060.h */
  136. #define SE6_PCI_VENDOR_ID 0x114F /* Digi PCI vendor ID */
  137. #define SE6_PCI_DEVICE_ID 0x0003 /* RS SE-6 device ID */
  138. #define SE6_PCI_ID ((SE6_PCI_DEVICE_ID<<16) | SE6_PCI_VENDOR_ID)
  139. /*
  140. * IDT Interrupts
  141. */
  142. #define ES4H_INT_8254 IDT_INT0
  143. #define ES4H_INT_HOST IDT_INT1
  144. #define ES4H_INT_ETHER0 IDT_INT2
  145. #define ES4H_INT_ETHER1 IDT_INT3
  146. #define ES4H_INT_ETHER2 IDT_INT4
  147. #define ES4H_INT_ETHER3 IDT_INT5
  148. /*
  149. * Because there are differences between the SE-4 and the SE-6,
  150. * we assume that the following globals will be set up at init
  151. * time in main.c to containt the appropriate constants from above
  152. */
  153. extern ushort Gpp; /* Softcopy of GPP register */
  154. extern ushort EEck; /* Clock bit */
  155. extern ushort EEcs; /* CS bit */
  156. extern ushort EEd; /* Data bit */
  157. extern ulong I8254_Hz; /* i8254 input frequency */
  158. extern ulong IDT_Hz; /* IDT CPU frequency */
  159. extern int Nports; /* Number of ethernet controllers */
  160. extern int Nchan; /* Nports+1 */