mcecc.h
上传用户:luoyougen
上传日期:2008-05-12
资源大小:23136k
文件大小:7k
源码类别:

VxWorks

开发平台:

C/C++

  1. /* mcecc.h - Memory Controller ASIC for ECC DRAM */
  2. /* Copyright 1994 Wind River Systems, Inc. */
  3. /*
  4. modification history
  5. --------------------
  6. 01b,29sep98,fle  doc : made it refgen parsable
  7. 01a,26oct93,dzb  written based on version 01d of drv/multi/memc040.h.
  8. */
  9. #ifdef DOC
  10. #define INCmcecch
  11. #endif /* DOC */
  12. #ifndef __INCmcecch
  13. #define __INCmcecch
  14. #ifdef __cplusplus
  15. extern "C" {
  16. #endif
  17. /*
  18.  * This file contains constants for Motorola's Memory Controller ASIC for
  19.  * ECC DRAM modules.  The macro MCECC_BASE_ADRS must be defined when including
  20.  * this header.
  21.  */
  22. #ifdef _ASMLANGUAGE
  23. #define CAST
  24. #else
  25. #define CAST (char *)
  26. #endif /* _ASMLANGUAGE */
  27. /* on-board access, register definitions */
  28. #define MCECC_REG_INTERVAL 1
  29. #ifndef MCECC_ADRS /* to permit alternative board addressing */
  30. #define MCECC_ADRS(reg)   (CAST (MCECC_BASE_ADRS + (reg * MCECC_REG_INTERVAL)))
  31. #endif /* MCECC_ADRS */
  32. #define MCECC_ID MCECC_ADRS(0x00) /* Chip ID */
  33. #define MCECC_REVISION MCECC_ADRS(0x04) /* Chip Revision Register */
  34. #define MCECC_MCR MCECC_ADRS(0x08) /* Memory Configuration Reg. */
  35. #define MCECC_BAR MCECC_ADRS(0x14) /* Base Address Register */
  36. #define MCECC_RCR MCECC_ADRS(0x18) /* RAM Control Register */
  37. #define MCECC_BCR MCECC_ADRS(0x1c) /* Bus Clock Frequency Reg. */
  38. #define MCECC_DCR MCECC_ADRS(0x20) /* Data Control Register */
  39. #define MCECC_SCR MCECC_ADRS(0x24) /* Scrub Control Register */
  40. #define MCECC_SPR_HI MCECC_ADRS(0x28) /* Scrub Period Reg (8-15) */
  41. #define MCECC_SPR_LO MCECC_ADRS(0x2c) /* Scrub Period Reg (7-0) */
  42. #define MCECC_CPC MCECC_ADRS(0x30) /* Chip Prescaler Counter */
  43. #define MCECC_STR MCECC_ADRS(0x34) /* Scrub Time Register */
  44. #define MCECC_SPC_HI MCECC_ADRS(0x38) /* Scrub Prescale Cnt (21-16) */
  45. #define MCECC_SPC_MID MCECC_ADRS(0x3c) /* Scrub Prescale Cnt (15-8) */
  46. #define MCECC_SPC_LO MCECC_ADRS(0x40) /* Scrub Prescale Cnt (7-0) */
  47. #define MCECC_STC_HI MCECC_ADRS(0x44) /* Scrub Timer Cnt (15-8) */
  48. #define MCECC_STC_LO MCECC_ADRS(0x48) /* Scrub Timer Cnt (7-0) */
  49. #define MCECC_SAC_HH MCECC_ADRS(0x4c) /* Scrub Address Cnt (26-24) */
  50. #define MCECC_SAC_H MCECC_ADRS(0x50) /* Scrub Address Cnt (23-16) */
  51. #define MCECC_SAC_L MCECC_ADRS(0x54) /* Scrub Address Cnt (15-8) */
  52. #define MCECC_SAC_LL MCECC_ADRS(0x58) /* Scrub Address Cnt (7-4) */
  53. #define MCECC_ELR MCECC_ADRS(0x5c) /* Error Logger Register */
  54. #define MCECC_EA_HH MCECC_ADRS(0x60) /* Error Address (31-24) */
  55. #define MCECC_EA_H MCECC_ADRS(0x64) /* Error Address (23-16) */
  56. #define MCECC_EA_L MCECC_ADRS(0x68) /* Error Address (15-8) */
  57. #define MCECC_EA_LL MCECC_ADRS(0x6c) /* Error Address (7-4) */
  58. #define MCECC_ESR MCECC_ADRS(0x70) /* Error Syndrome Register */
  59. #define MCECC_DR1 MCECC_ADRS(0x74) /* Defaults Register 1 */
  60. #define MCECC_DR2 MCECC_ADRS(0x78) /* Defaults Register 2 */
  61. /* MCECC_ID 0x00 Chip ID */
  62. #define MCECC_ID_RESET 0x0f /* software reset of MCECC chip */
  63. /* MCECC_MCR 0x08 Memory Configuration Register */
  64. #define MCECC_MCR_4MB 0x00 /* 4Mb of DRAM */
  65. #define MCECC_MCR_8MB 0x01 /* 8Mb of DRAM */
  66. #define MCECC_MCR_16MB 0x02 /* 16Mb of DRAM */
  67. #define MCECC_MCR_32MB 0x03 /* 32Mb of DRAM */
  68. #define MCECC_MCR_64MB 0x04 /* 64Mb of DRAM */
  69. #define MCECC_MCR_128MB 0x05 /* 128Mb of DRAM */
  70. #define MCECC_MCR_FSTRD 0x20 /* fast read */
  71. /* MCECC_RCR 0x18 RAM Control Register */
  72. #define MCECC_RCR_RAMEN 0x01 /* RAM enable */
  73. #define MCECC_RCR_NCEBEN 0x02 /* assert TEA* on noncorrectable err */
  74. #define MCECC_RCR_NCEIEN 0x04 /* interrupt on noncorrectable err */
  75. #define MCECC_RCR_RWB3 0x08 /* general purpose R/W bit */
  76. #define MCECC_RCR_SWAIT 0x10 /* snoop wait */
  77. #define MCECC_RCR_RWB5 0x20 /* general purpose R/W bit */
  78. #define MCECC_RCR_BAD 0xc0 /* base address bits 22 & 23 */
  79. /* MCECC_BCR 0x1c Bus Clock Register */
  80. #define MCECC_BCR_25MHZ 25 /* 25 MHz clock */
  81. #define MCECC_BCR_33MHZ 33 /* 33 MHz clock */
  82. /* MCECC_DCR 0x20 Data Control Register */
  83. #define MCECC_DCR_RWCKB 0x08 /* R/W checkbits */
  84. #define MCECC_DCR_ZFILL 0x10 /* zero fill */
  85. #define MCECC_DCR_DERC 0x20 /* disable error correction */
  86. /* MCECC_SCR 0x24 Scrub Control Register */
  87. #define MCECC_SCR_IDIS 0x01 /* image disable */
  88. #define MCECC_SCR_SBEIEN 0x02 /* interrupt on single bit error */
  89. #define MCECC_SCR_SCRBEN 0x08 /* enable scrubber */
  90. #define MCECC_SCR_SCRB 0x10 /* scrubber busy */
  91. #define MCECC_SCR_HITDIS 0x20 /* not implemented (Mot) */
  92. #define MCECC_SCR_RADATA 0x40 /* not implemented (Mot) */
  93. #define MCECC_SCR_RACODE 0x80 /* not implemented (Mot) */
  94. #define MCECC_SCRUB_DIS 0x00 /* disable scrubber */
  95. /* MCECC_STR 0x34 Scrub Time On/Time Off Register */
  96. #define MCECC_STR_OFF_IMMED 0x00 /* request DRAM immediately */
  97. #define MCECC_STR_OFF_16 0x01 /* request DRAM after 16 clocks */
  98. #define MCECC_STR_OFF_32 0x02 /* request DRAM after 32 clocks */
  99. #define MCECC_STR_OFF_64 0x03 /* request DRAM after 64 clocks */
  100. #define MCECC_STR_OFF_128 0x04 /* request DRAM after 128 clocks */
  101. #define MCECC_STR_OFF_256 0x05 /* request DRAM after 256 clocks */
  102. #define MCECC_STR_OFF_512 0x06 /* request DRAM after 512 clocks */
  103. #define MCECC_STR_OFF_NEVER 0x07 /* never request DRAM */
  104. #define MCECC_STR_ON_1 0x00 /* keep DRAM for 1 clock */
  105. #define MCECC_STR_ON_16 0x08 /* keep DRAM for 16 clocks */
  106. #define MCECC_STR_ON_32 0x10 /* keep DRAM for 32 clocks */
  107. #define MCECC_STR_ON_64 0x18 /* keep DRAM for 64 clocks */
  108. #define MCECC_STR_ON_128 0x20 /* keep DRAM for 128 clocks */
  109. #define MCECC_STR_ON_256 0x28 /* keep DRAM for 256 clocks */
  110. #define MCECC_STR_ON_512 0x30 /* keep DRAM for 512 clocks */
  111. #define MCECC_STR_ON_TOTAL 0x38 /* keep DRAM for total scrub time */
  112. #define MCECC_STR_SRDIS 0x80 /* scrubber read disable */
  113. /* MCECC_ELR 0x5c Error Logger Register */
  114. #define MCECC_ELR_SBE 0x01 /* single bit error */
  115. #define MCECC_ELR_MBE 0x02 /* multiple bit error */
  116. #define MCECC_ELR_EALT 0x08 /* error with alternate bus master */
  117. #define MCECC_ELR_ERA 0x10 /* not implemented (Mot) */
  118. #define MCECC_ELR_ESCRB 0x20 /* error with scrubber */
  119. #define MCECC_ELR_ERD 0x40 /* error occurred on a READ */
  120. #define MCECC_ELR_ERRLOG 0x80 /* error log is full */
  121. /* MCECC_DR1 0x74 Default Register 1 */
  122. #define MCECC_DR1_4M 0x00 /* 4Mb of DRAM */
  123. #define MCECC_DR1_8M 0x01 /* 8Mb of DRAM */
  124. #define MCECC_DR1_16M 0x02 /* 16Mb of DRAM */
  125. #define MCECC_DR1_32M 0x03 /* 32Mb of DRAM */
  126. #define MCECC_DR1_64M 0x04 /* 64Mb of DRAM */
  127. #define MCECC_DR1_128M 0x05 /* 128Mb of DRAM */
  128. #define MCECC_DR1_SELI0 0x80 /* register base address select 0 */
  129. #define MCECC_DR1_SELI1 0x10 /* register base address select 1 */
  130. #define MCECC_DR1_FSTRD 0x20 /* fast DRAM reads */
  131. #define MCECC_DR1_STATCOL 0x40 /* ? */
  132. #define MCECC_DR1_WRHDIS 0x80 /* not implemented (Mot) */
  133. /* MCECC_DR2 0x78 Default Register 2 */
  134. #define MCECC_DR2_RESST0 0x01 /* general purpose R/W bit */
  135. #define MCECC_DR2_RESST1 0x02 /* general purpose R/W bit */
  136. #define MCECC_DR2_RESST2 0x04 /* general purpose R/W bit */
  137. #define MCECC_DR2_NOCACHE 0x08 /* SCR can be cleared by software */
  138. #define MCECC_DR2_TVECT 0x10 /* test vendor vectors */
  139. #define MCECC_DR2_REFDIS 0x20 /* disable refreshing DRAM */
  140. #define MCECC_DR2_XY_FLIP 0x40 /* select opposite cache latches */
  141. #define MCECC_DR2_FRC_OPN 0x80 /* force DRAM read latches open */
  142. #ifdef __cplusplus
  143. }
  144. #endif
  145. #endif /* __INCmcecch */