tsi148.h 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. /*
  2. * (C) Copyright 2009 Reinhard Arlt, reinhard.arlt@esd-electronics.com
  3. *
  4. * base on universe.h by
  5. *
  6. * (C) Copyright 2003 Stefan Roese, stefan.roese@esd-electronics.com
  7. *
  8. * SPDX-License-Identifier: GPL-2.0+
  9. */
  10. #ifndef _tsi148_h
  11. #define _tsi148_h
  12. #ifndef PCI_DEVICE_ID_TUNDRA_TSI148
  13. #define PCI_DEVICE_ID_TUNDRA_TSI148 0x0148
  14. #endif
  15. typedef struct _TSI148 TSI148;
  16. typedef struct _OUTBOUND OUTBOUND;
  17. typedef struct _INBOUND INBOUND;
  18. typedef struct _TDMA_CMD_PACKET TDMA_CMD_PACKET;
  19. struct _OUTBOUND {
  20. unsigned int otsau; /* 0x000 Outbound start upper */
  21. unsigned int otsal; /* 0x004 Outbouud start lower */
  22. unsigned int oteau; /* 0x008 Outbound end upper */
  23. unsigned int oteal; /* 0x00c Outbound end lower */
  24. unsigned int otofu; /* 0x010 Outbound translation upper */
  25. unsigned int otofl; /* 0x014 Outbound translation lower */
  26. unsigned int otbs; /* 0x018 Outbound translation 2eSST */
  27. unsigned int otat; /* 0x01c Outbound translation attr */
  28. };
  29. struct _INBOUND {
  30. unsigned int itsau; /* 0x000 inbound start upper */
  31. unsigned int itsal; /* 0x004 inbouud start lower */
  32. unsigned int iteau; /* 0x008 inbound end upper */
  33. unsigned int iteal; /* 0x00c inbound end lower */
  34. unsigned int itofu; /* 0x010 inbound translation upper */
  35. unsigned int itofl; /* 0x014 inbound translation lower */
  36. unsigned int itat; /* 0x018 inbound translation attr */
  37. unsigned int spare; /* 0x01c not used */
  38. };
  39. struct _TSI148 {
  40. unsigned int pci_id; /* 0x000 */
  41. unsigned int pci_csr; /* 0x004 */
  42. unsigned int pci_class; /* 0x008 */
  43. unsigned int pci_misc0; /* 0x00c */
  44. unsigned int pci_mbarl; /* 0x010 */
  45. unsigned int pci_mbarh; /* 0x014 */
  46. unsigned int spare0[(0x03c-0x018)/4]; /* 0x018 */
  47. unsigned int pci_misc1; /* 0x03c */
  48. unsigned int pci_pcixcap; /* 0x040 */
  49. unsigned int pci_pcixstat; /* 0x044 */
  50. unsigned int spare1[(0x100-0x048)/4]; /* 0x048 */
  51. OUTBOUND outbound[8]; /* 0x100 */
  52. unsigned int viack[8]; /* 0x204 */
  53. unsigned int rmwau; /* 0x220 */
  54. unsigned int rmwal; /* 0x224 */
  55. unsigned int rmwen; /* 0x228 */
  56. unsigned int rmwc; /* 0x22c */
  57. unsigned int rmws; /* 0x230 */
  58. unsigned int vmctrl; /* 0x234 */
  59. unsigned int vctrl; /* 0x238 */
  60. unsigned int vstat; /* 0x23c */
  61. unsigned int pcsr; /* 0x240 */
  62. unsigned int spare2[3]; /* 0x244 - 0x24c */
  63. unsigned int vmefl; /* 0x250 */
  64. unsigned int spare3[3]; /* 0x254 - 0x25c */
  65. unsigned int veau; /* 0x260 */
  66. unsigned int veal; /* 0x264 */
  67. unsigned int veat; /* 0x268 */
  68. unsigned int spare4[1]; /* 0x26c */
  69. unsigned int edpau; /* 0x270 */
  70. unsigned int edpal; /* 0x274 */
  71. unsigned int edpxa; /* 0x278 */
  72. unsigned int edpxs; /* 0x27c */
  73. unsigned int edpat; /* 0x280 */
  74. unsigned int spare5[31]; /* 0x284 - 0x2fc */
  75. INBOUND inbound[8]; /* 0x100 */
  76. unsigned int gbau; /* 0x400 */
  77. unsigned int gbal; /* 0x404 */
  78. unsigned int gcsrat; /* 0x408 */
  79. unsigned int cbau; /* 0x40c */
  80. unsigned int cbal; /* 0x410 */
  81. unsigned int crgat; /* 0x414 */
  82. unsigned int crou; /* 0x418 */
  83. unsigned int crol; /* 0x41c */
  84. unsigned int crat; /* 0x420 */
  85. unsigned int lmbau; /* 0x424 */
  86. unsigned int lmbal; /* 0x428 */
  87. unsigned int lmat; /* 0x42c */
  88. unsigned int r64bcu; /* 0x430 */
  89. unsigned int r64bcl; /* 0x434 */
  90. unsigned int bpgtr; /* 0x438 */
  91. unsigned int bpctr; /* 0x43c */
  92. unsigned int vicr; /* 0x440 */
  93. unsigned int spare6[1]; /* 0x444 */
  94. unsigned int inten; /* 0x448 */
  95. unsigned int inteo; /* 0x44c */
  96. unsigned int ints; /* 0x450 */
  97. unsigned int intc; /* 0x454 */
  98. unsigned int intm1; /* 0x458 */
  99. unsigned int intm2; /* 0x45c */
  100. unsigned int spare7[40]; /* 0x460 - 0x4fc */
  101. unsigned int dctl0; /* 0x500 */
  102. unsigned int dsta0; /* 0x504 */
  103. unsigned int dcsau0; /* 0x508 */
  104. unsigned int dcsal0; /* 0x50c */
  105. unsigned int dcdau0; /* 0x510 */
  106. unsigned int dcdal0; /* 0x514 */
  107. unsigned int dclau0; /* 0x518 */
  108. unsigned int dclal0; /* 0x51c */
  109. unsigned int dsau0; /* 0x520 */
  110. unsigned int dsal0; /* 0x524 */
  111. unsigned int ddau0; /* 0x528 */
  112. unsigned int ddal0; /* 0x52c */
  113. unsigned int dsat0; /* 0x530 */
  114. unsigned int ddat0; /* 0x534 */
  115. unsigned int dnlau0; /* 0x538 */
  116. unsigned int dnlal0; /* 0x53c */
  117. unsigned int dcnt0; /* 0x540 */
  118. unsigned int ddbs0; /* 0x544 */
  119. unsigned int r20[14]; /* 0x548 - 0x57c */
  120. unsigned int dctl1; /* 0x580 */
  121. unsigned int dsta1; /* 0x584 */
  122. unsigned int dcsau1; /* 0x588 */
  123. unsigned int dcsal1; /* 0x58c */
  124. unsigned int dcdau1; /* 0x590 */
  125. unsigned int dcdal1; /* 0x594 */
  126. unsigned int dclau1; /* 0x598 */
  127. unsigned int dclal1; /* 0x59c */
  128. unsigned int dsau1; /* 0x5a0 */
  129. unsigned int dsal1; /* 0x5a4 */
  130. unsigned int ddau1; /* 0x5a8 */
  131. unsigned int ddal1; /* 0x5ac */
  132. unsigned int dsat1; /* 0x5b0 */
  133. unsigned int ddat1; /* 0x5b4 */
  134. unsigned int dnlau1; /* 0x5b8 */
  135. unsigned int dnlal1; /* 0x5bc */
  136. unsigned int dcnt1; /* 0x5c0 */
  137. unsigned int ddbs1; /* 0x5c4 */
  138. unsigned int r21[14]; /* 0x5c8 - 0x5fc */
  139. unsigned int devi_veni_2; /* 0x600 */
  140. unsigned int gctrl_ga_revid; /* 0x604 */
  141. unsigned int semaphore0_1_2_3; /* 0x608 */
  142. unsigned int semaphore4_5_6_7; /* 0x60c */
  143. unsigned int mbox0; /* 0x610 */
  144. unsigned int mbox1; /* 0x614 */
  145. unsigned int mbox2; /* 0x618 */
  146. unsigned int mbox3; /* 0x61c */
  147. unsigned int r22[629]; /* 0x620 - 0xff0 */
  148. unsigned int csrbcr; /* 0xff4 */
  149. unsigned int csrbsr; /* 0xff8 */
  150. unsigned int cbar; /* 0xffc */
  151. };
  152. #define IRQ_VOWN 0x0001
  153. #define IRQ_VIRQ1 0x0002
  154. #define IRQ_VIRQ2 0x0004
  155. #define IRQ_VIRQ3 0x0008
  156. #define IRQ_VIRQ4 0x0010
  157. #define IRQ_VIRQ5 0x0020
  158. #define IRQ_VIRQ6 0x0040
  159. #define IRQ_VIRQ7 0x0080
  160. #define IRQ_DMA 0x0100
  161. #define IRQ_LERR 0x0200
  162. #define IRQ_VERR 0x0400
  163. #define IRQ_res 0x0800
  164. #define IRQ_IACK 0x1000
  165. #define IRQ_SWINT 0x2000
  166. #define IRQ_SYSFAIL 0x4000
  167. #define IRQ_ACFAIL 0x8000
  168. struct _TDMA_CMD_PACKET {
  169. unsigned int dctl; /* DMA Control */
  170. unsigned int dtbc; /* Transfer Byte Count */
  171. unsigned int dlv; /* PCI Address */
  172. unsigned int res1; /* Reserved */
  173. unsigned int dva; /* Vme Address */
  174. unsigned int res2; /* Reserved */
  175. unsigned int dcpp; /* Pointer to Numed Cmd Packet with rPN */
  176. unsigned int res3; /* Reserved */
  177. };
  178. #define VME_AM_A16 0x01
  179. #define VME_AM_A24 0x02
  180. #define VME_AM_A32 0x03
  181. #define VME_AM_Axx 0x03
  182. #define VME_AM_USR 0x04
  183. #define VME_AM_SUP 0x08
  184. #define VME_AM_DATA 0x10
  185. #define VME_AM_PROG 0x20
  186. #define VME_AM_Mxx (VME_AM_DATA | VME_AM_PROG)
  187. #define VME_FLAG_D8 0x01
  188. #define VME_FLAG_D16 0x02
  189. #define VME_FLAG_D32 0x03
  190. #define VME_FLAG_Dxx 0x03
  191. #endif