universe.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. /*
  2. * (C) Copyright 2003 Stefan Roese, stefan.roese@esd-electronics.com
  3. *
  4. * See file CREDITS for list of people who contributed to this
  5. * project.
  6. *
  7. * This program is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU General Public License as
  9. * published by the Free Software Foundation; either version 2 of
  10. * the License, or (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  20. * MA 02111-1307 USA
  21. */
  22. #ifndef _universe_h
  23. #define _universe_h
  24. typedef struct _UNIVERSE UNIVERSE;
  25. typedef struct _SLAVE_IMAGE SLAVE_IMAGE;
  26. typedef struct _TDMA_CMD_PACKET TDMA_CMD_PACKET;
  27. struct _SLAVE_IMAGE {
  28. unsigned int ctl; /* Control */
  29. unsigned int bs; /* Base */
  30. unsigned int bd; /* Bound */
  31. unsigned int to; /* Translation */
  32. unsigned int reserved;
  33. };
  34. struct _UNIVERSE {
  35. unsigned int pci_id;
  36. unsigned int pci_csr;
  37. unsigned int pci_class;
  38. unsigned int pci_misc0;
  39. unsigned int pci_bs;
  40. unsigned int spare0[10];
  41. unsigned int pci_misc1;
  42. unsigned int spare1[48];
  43. SLAVE_IMAGE lsi[4];
  44. unsigned int spare2[8];
  45. unsigned int scyc_ctl;
  46. unsigned int scyc_addr;
  47. unsigned int scyc_en;
  48. unsigned int scyc_cmp;
  49. unsigned int scyc_swp;
  50. unsigned int lmisc;
  51. unsigned int slsi;
  52. unsigned int l_cmderr;
  53. unsigned int laerr;
  54. unsigned int spare3[27];
  55. unsigned int dctl;
  56. unsigned int dtbc;
  57. unsigned int dla;
  58. unsigned int spare4[1];
  59. unsigned int dva;
  60. unsigned int spare5[1];
  61. unsigned int dcpp;
  62. unsigned int spare6[1];
  63. unsigned int dgcs;
  64. unsigned int d_llue;
  65. unsigned int spare7[54];
  66. unsigned int lint_en;
  67. unsigned int lint_stat;
  68. unsigned int lint_map0;
  69. unsigned int lint_map1;
  70. unsigned int vint_en;
  71. unsigned int vint_stat;
  72. unsigned int vint_map0;
  73. unsigned int vint_map1;
  74. unsigned int statid;
  75. unsigned int vx_statid[7];
  76. unsigned int spare8[48];
  77. unsigned int mast_ctl;
  78. unsigned int misc_ctl;
  79. unsigned int misc_stat;
  80. unsigned int user_am;
  81. unsigned int spare9[700];
  82. SLAVE_IMAGE vsi[4];
  83. unsigned int spare10[8];
  84. unsigned int vrai_ctl;
  85. unsigned int vrai_bs;
  86. unsigned int spare11[2];
  87. unsigned int vcsr_ctl;
  88. unsigned int vcsr_to;
  89. unsigned int v_amerr;
  90. unsigned int vaerr;
  91. unsigned int spare12[25];
  92. unsigned int vcsr_clr;
  93. unsigned int vcsr_set;
  94. unsigned int vcsr_bs;
  95. };
  96. #define IRQ_VOWN 0x0001
  97. #define IRQ_VIRQ1 0x0002
  98. #define IRQ_VIRQ2 0x0004
  99. #define IRQ_VIRQ3 0x0008
  100. #define IRQ_VIRQ4 0x0010
  101. #define IRQ_VIRQ5 0x0020
  102. #define IRQ_VIRQ6 0x0040
  103. #define IRQ_VIRQ7 0x0080
  104. #define IRQ_DMA 0x0100
  105. #define IRQ_LERR 0x0200
  106. #define IRQ_VERR 0x0400
  107. #define IRQ_res 0x0800
  108. #define IRQ_IACK 0x1000
  109. #define IRQ_SWINT 0x2000
  110. #define IRQ_SYSFAIL 0x4000
  111. #define IRQ_ACFAIL 0x8000
  112. struct _TDMA_CMD_PACKET {
  113. unsigned int dctl; /* DMA Control */
  114. unsigned int dtbc; /* Transfer Byte Count */
  115. unsigned int dlv; /* PCI Address */
  116. unsigned int res1; /* Reserved */
  117. unsigned int dva; /* Vme Address */
  118. unsigned int res2; /* Reserved */
  119. unsigned int dcpp; /* Pointer to Numed Cmd Packet with rPN */
  120. unsigned int res3; /* Reserved */
  121. };
  122. #define VME_AM_A16 0x01
  123. #define VME_AM_A24 0x02
  124. #define VME_AM_A32 0x03
  125. #define VME_AM_Axx 0x03
  126. #define VME_AM_SUP 0x04
  127. #define VME_AM_DATA 0x10
  128. #define VME_AM_PROG 0x20
  129. #define VME_AM_Mxx 0x30
  130. #define VME_FLAG_D8 0x01
  131. #define VME_FLAG_D16 0x02
  132. #define VME_FLAG_D32 0x03
  133. #define VME_FLAG_Dxx 0x03
  134. #define PCI_MS_MEM 0x01
  135. #define PCI_MS_IO 0x02
  136. #define PCI_MS_CONFIG 0x03
  137. #define PCI_MS_Mxx 0x03
  138. #endif