mi_pc.h 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. /*
  2. *
  3. Copyright (c) Eicon Networks, 2002.
  4. *
  5. This source file is supplied for the use with
  6. Eicon Networks range of DIVA Server Adapters.
  7. *
  8. Eicon File Revision : 2.1
  9. *
  10. This program is free software; you can redistribute it and/or modify
  11. it under the terms of the GNU General Public License as published by
  12. the Free Software Foundation; either version 2, or (at your option)
  13. any later version.
  14. *
  15. This program is distributed in the hope that it will be useful,
  16. but WITHOUT ANY WARRANTY OF ANY KIND WHATSOEVER INCLUDING ANY
  17. implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  18. See the GNU General Public License for more details.
  19. *
  20. You should have received a copy of the GNU General Public License
  21. along with this program; if not, write to the Free Software
  22. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  23. *
  24. */
  25. /*----------------------------------------------------------------------------
  26. // MAESTRA ISA PnP */
  27. #define BRI_MEMORY_BASE 0x1f700000
  28. #define BRI_MEMORY_SIZE 0x00100000 /* 1MB on the BRI */
  29. #define BRI_SHARED_RAM_SIZE 0x00010000 /* 64k shared RAM */
  30. #define BRI_RAY_TAYLOR_DSP_CODE_SIZE 0x00020000 /* max 128k DSP-Code (Ray Taylor's code) */
  31. #define BRI_ORG_MAX_DSP_CODE_SIZE 0x00050000 /* max 320k DSP-Code (Telindus) */
  32. #define BRI_V90D_MAX_DSP_CODE_SIZE 0x00060000 /* max 384k DSP-Code if V.90D included */
  33. #define BRI_CACHED_ADDR(x) (((x) & 0x1fffffffL) | 0x80000000L)
  34. #define BRI_UNCACHED_ADDR(x) (((x) & 0x1fffffffL) | 0xa0000000L)
  35. #define ADDR 4
  36. #define ADDRH 6
  37. #define DATA 0
  38. #define RESET 7
  39. #define DEFAULT_ADDRESS 0x240
  40. #define DEFAULT_IRQ 3
  41. #define M_PCI_ADDR 0x04 /* MAESTRA BRI PCI */
  42. #define M_PCI_ADDRH 0x0c /* MAESTRA BRI PCI */
  43. #define M_PCI_DATA 0x00 /* MAESTRA BRI PCI */
  44. #define M_PCI_RESET 0x10 /* MAESTRA BRI PCI */
  45. /*----------------------------------------------------------------------------
  46. // MAESTRA PRI PCI */
  47. #define MP_IRQ_RESET 0xc18 /* offset of isr in the CONFIG memory bar */
  48. #define MP_IRQ_RESET_VAL 0xfe /* value to clear an interrupt */
  49. #define MP_MEMORY_SIZE 0x00400000 /* 4MB on standard PRI */
  50. #define MP2_MEMORY_SIZE 0x00800000 /* 8MB on PRI Rev. 2 */
  51. #define MP_SHARED_RAM_OFFSET 0x00001000 /* offset of shared RAM base in the DRAM memory bar */
  52. #define MP_SHARED_RAM_SIZE 0x00010000 /* 64k shared RAM */
  53. #define MP_PROTOCOL_OFFSET (MP_SHARED_RAM_OFFSET + MP_SHARED_RAM_SIZE)
  54. #define MP_RAY_TAYLOR_DSP_CODE_SIZE 0x00040000 /* max 256k DSP-Code (Ray Taylor's code) */
  55. #define MP_ORG_MAX_DSP_CODE_SIZE 0x00060000 /* max 384k DSP-Code (Telindus) */
  56. #define MP_V90D_MAX_DSP_CODE_SIZE 0x00070000 /* max 448k DSP-Code if V.90D included) */
  57. #define MP_VOIP_MAX_DSP_CODE_SIZE 0x00090000 /* max 576k DSP-Code if voice over IP included */
  58. #define MP_CACHED_ADDR(x) (((x) & 0x1fffffffL) | 0x80000000L)
  59. #define MP_UNCACHED_ADDR(x) (((x) & 0x1fffffffL) | 0xa0000000L)
  60. #define MP_RESET 0x20 /* offset of RESET register in the DEVICES memory bar */
  61. /* RESET register bits */
  62. #define _MP_S2M_RESET 0x10 /* active lo */
  63. #define _MP_LED2 0x08 /* 1 = on */
  64. #define _MP_LED1 0x04 /* 1 = on */
  65. #define _MP_DSP_RESET 0x02 /* active lo */
  66. #define _MP_RISC_RESET 0x81 /* active hi, bit 7 for compatibility with old boards */
  67. /* CPU exception context structure in MP shared ram after trap */
  68. typedef struct mp_xcptcontext_s MP_XCPTC;
  69. struct mp_xcptcontext_s {
  70. dword sr;
  71. dword cr;
  72. dword epc;
  73. dword vaddr;
  74. dword regs[32];
  75. dword mdlo;
  76. dword mdhi;
  77. dword reseverd;
  78. dword xclass;
  79. };
  80. /* boot interface structure for PRI */
  81. struct mp_load {
  82. dword volatile cmd;
  83. dword volatile addr;
  84. dword volatile len;
  85. dword volatile err;
  86. dword volatile live;
  87. dword volatile res1[0x1b];
  88. dword volatile TrapId; /* has value 0x999999XX on a CPU trap */
  89. dword volatile res2[0x03];
  90. MP_XCPTC volatile xcpt; /* contains register dump */
  91. dword volatile rest[((0x1020>>2)-6) - 0x1b - 1 - 0x03 - (sizeof(MP_XCPTC)>>2)];
  92. dword volatile signature;
  93. dword data[60000]; /* real interface description */
  94. };
  95. /*----------------------------------------------------------------------------*/
  96. /* SERVER 4BRI (Quattro PCI) */
  97. #define MQ_BOARD_REG_OFFSET 0x800000 /* PC relative On board registers offset */
  98. #define MQ_BREG_RISC 0x1200 /* RISC Reset ect */
  99. #define MQ_RISC_COLD_RESET_MASK 0x0001 /* RISC Cold reset */
  100. #define MQ_RISC_WARM_RESET_MASK 0x0002 /* RISC Warm reset */
  101. #define MQ_BREG_IRQ_TEST 0x0608 /* Interrupt request, no CPU interaction */
  102. #define MQ_IRQ_REQ_ON 0x1
  103. #define MQ_IRQ_REQ_OFF 0x0
  104. #define MQ_BOARD_DSP_OFFSET 0xa00000 /* PC relative On board DSP regs offset */
  105. #define MQ_DSP1_ADDR_OFFSET 0x0008 /* Addr register offset DSP 1 subboard 1 */
  106. #define MQ_DSP2_ADDR_OFFSET 0x0208 /* Addr register offset DSP 2 subboard 1 */
  107. #define MQ_DSP1_DATA_OFFSET 0x0000 /* Data register offset DSP 1 subboard 1 */
  108. #define MQ_DSP2_DATA_OFFSET 0x0200 /* Data register offset DSP 2 subboard 1 */
  109. #define MQ_DSP_JUNK_OFFSET 0x0400 /* DSP Data/Addr regs subboard offset */
  110. #define MQ_ISAC_DSP_RESET 0x0028 /* ISAC and DSP reset address offset */
  111. #define MQ_BOARD_ISAC_DSP_RESET 0x800028 /* ISAC and DSP reset address offset */
  112. #define MQ_INSTANCE_COUNT 4 /* 4BRI consists of four instances */
  113. #define MQ_MEMORY_SIZE 0x00400000 /* 4MB on standard 4BRI */
  114. #define MQ_CTRL_SIZE 0x00002000 /* 8K memory mapped registers */
  115. #define MQ_SHARED_RAM_SIZE 0x00010000 /* 64k shared RAM */
  116. #define MQ_ORG_MAX_DSP_CODE_SIZE 0x00050000 /* max 320k DSP-Code (Telindus) */
  117. #define MQ_V90D_MAX_DSP_CODE_SIZE 0x00060000 /* max 384K DSP-Code if V.90D included */
  118. #define MQ_VOIP_MAX_DSP_CODE_SIZE 0x00028000 /* max 4*160k = 640K DSP-Code if voice over IP included */
  119. #define MQ_CACHED_ADDR(x) (((x) & 0x1fffffffL) | 0x80000000L)
  120. #define MQ_UNCACHED_ADDR(x) (((x) & 0x1fffffffL) | 0xa0000000L)
  121. /*--------------------------------------------------------------------------------------------*/
  122. /* Additional definitions reflecting the different address map of the SERVER 4BRI V2 */
  123. #define MQ2_BREG_RISC 0x0200 /* RISC Reset ect */
  124. #define MQ2_BREG_IRQ_TEST 0x0400 /* Interrupt request, no CPU interaction */
  125. #define MQ2_BOARD_DSP_OFFSET 0x800000 /* PC relative On board DSP regs offset */
  126. #define MQ2_DSP1_DATA_OFFSET 0x1800 /* Data register offset DSP 1 subboard 1 */
  127. #define MQ2_DSP1_ADDR_OFFSET 0x1808 /* Addr register offset DSP 1 subboard 1 */
  128. #define MQ2_DSP2_DATA_OFFSET 0x1810 /* Data register offset DSP 2 subboard 1 */
  129. #define MQ2_DSP2_ADDR_OFFSET 0x1818 /* Addr register offset DSP 2 subboard 1 */
  130. #define MQ2_DSP_JUNK_OFFSET 0x1000 /* DSP Data/Addr regs subboard offset */
  131. #define MQ2_ISAC_DSP_RESET 0x0000 /* ISAC and DSP reset address offset */
  132. #define MQ2_BOARD_ISAC_DSP_RESET 0x800000 /* ISAC and DSP reset address offset */
  133. #define MQ2_IPACX_CONFIG 0x0300 /* IPACX Configuration TE(0)/NT(1) */
  134. #define MQ2_BOARD_IPACX_CONFIG 0x800300 /* "" */
  135. #define MQ2_MEMORY_SIZE 0x01000000 /* 16MB code/data memory */
  136. #define MQ2_CTRL_SIZE 0x00008000 /* 32K memory mapped registers */
  137. /*----------------------------------------------------------------------------*/
  138. /* SERVER BRI 2M/2F as derived from 4BRI V2 */
  139. #define BRI2_MEMORY_SIZE 0x00800000 /* 8MB code/data memory */
  140. #define BRI2_PROTOCOL_MEMORY_SIZE (MQ2_MEMORY_SIZE >> 2) /* same as one 4BRI Rev.2 task */
  141. #define BRI2_CTRL_SIZE 0x00008000 /* 32K memory mapped registers */
  142. #define M_INSTANCE_COUNT 1 /* BRI consists of one instance */
  143. /*
  144. * Some useful constants for proper initialization of the GT6401x
  145. */
  146. #define ID_REG 0x0000 /*Pci reg-contain the Dev&Ven ID of the card*/
  147. #define RAS0_BASEREG 0x0010 /*Ras0 register - contain the base addr Ras0*/
  148. #define RAS2_BASEREG 0x0014
  149. #define CS_BASEREG 0x0018
  150. #define BOOT_BASEREG 0x001c
  151. #define GTREGS_BASEREG 0x0024 /*GTRegsBase reg-contain the base addr where*/
  152. /*the GT64010 internal regs where mapped */
  153. /*
  154. * GT64010 internal registers
  155. */
  156. /* DRAM device coding */
  157. #define LOW_RAS0_DREG 0x0400 /*Ras0 low decode address*/
  158. #define HI_RAS0_DREG 0x0404 /*Ras0 high decode address*/
  159. #define LOW_RAS1_DREG 0x0408 /*Ras1 low decode address*/
  160. #define HI_RAS1_DREG 0x040c /*Ras1 high decode address*/
  161. #define LOW_RAS2_DREG 0x0410 /*Ras2 low decode address*/
  162. #define HI_RAS2_DREG 0x0414 /*Ras2 high decode address*/
  163. #define LOW_RAS3_DREG 0x0418 /*Ras3 low decode address*/
  164. #define HI_RAS3_DREG 0x041c /*Ras3 high decode address*/
  165. /* I/O CS device coding */
  166. #define LOW_CS0_DREG 0x0420 /* CS0* low decode register */
  167. #define HI_CS0_DREG 0x0424 /* CS0* high decode register */
  168. #define LOW_CS1_DREG 0x0428 /* CS1* low decode register */
  169. #define HI_CS1_DREG 0x042c /* CS1* high decode register */
  170. #define LOW_CS2_DREG 0x0430 /* CS2* low decode register */
  171. #define HI_CS2_DREG 0x0434 /* CS2* high decode register */
  172. #define LOW_CS3_DREG 0x0438 /* CS3* low decode register */
  173. #define HI_CS3_DREG 0x043c /* CS3* high decode register */
  174. /* Boot PROM device coding */
  175. #define LOW_BOOTCS_DREG 0x0440 /* Boot CS low decode register */
  176. #define HI_BOOTCS_DREG 0x0444 /* Boot CS High decode register */
  177. /* DRAM group coding (for CPU) */
  178. #define LO_RAS10_GREG 0x0008 /*Ras1..0 group low decode address*/
  179. #define HI_RAS10_GREG 0x0010 /*Ras1..0 group high decode address*/
  180. #define LO_RAS32_GREG 0x0018 /*Ras3..2 group low decode address */
  181. #define HI_RAS32_GREG 0x0020 /*Ras3..2 group high decode address */
  182. /* I/O CS group coding for (CPU) */
  183. #define LO_CS20_GREG 0x0028 /* CS2..0 group low decode register */
  184. #define HI_CS20_GREG 0x0030 /* CS2..0 group high decode register */
  185. #define LO_CS3B_GREG 0x0038 /* CS3 & PROM group low decode register */
  186. #define HI_CS3B_GREG 0x0040 /* CS3 & PROM group high decode register */
  187. /* Galileo specific PCI config. */
  188. #define PCI_TIMEOUT_RET 0x0c04 /* Time Out and retry register */
  189. #define RAS10_BANKSIZE 0x0c08 /* RAS 1..0 group PCI bank size */
  190. #define RAS32_BANKSIZE 0x0c0c /* RAS 3..2 group PCI bank size */
  191. #define CS20_BANKSIZE 0x0c10 /* CS 2..0 group PCI bank size */
  192. #define CS3B_BANKSIZE 0x0c14 /* CS 3 & Boot group PCI bank size */
  193. #define DRAM_SIZE 0x0001 /*Dram size in mega bytes*/
  194. #define PROM_SIZE 0x08000 /*Prom size in bytes*/
  195. /*--------------------------------------------------------------------------*/
  196. #define OFFS_DIVA_INIT_TASK_COUNT 0x68
  197. #define OFFS_DSP_CODE_BASE_ADDR 0x6c
  198. #define OFFS_XLOG_BUF_ADDR 0x70
  199. #define OFFS_XLOG_COUNT_ADDR 0x74
  200. #define OFFS_XLOG_OUT_ADDR 0x78
  201. #define OFFS_PROTOCOL_END_ADDR 0x7c
  202. #define OFFS_PROTOCOL_ID_STRING 0x80
  203. /*--------------------------------------------------------------------------*/