imcreg.h 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. /* $OpenBSD: imcreg.h,v 1.5 2014/07/02 17:44:35 miod Exp $ */
  2. /* $NetBSD: imcreg.h,v 1.4 2005/12/11 12:18:52 christos Exp $ */
  3. /*
  4. * Copyright (c) 2001 Rafal K. Boni
  5. * All rights reserved.
  6. *
  7. * Redistribution and use in source and binary forms, with or without
  8. * modification, are permitted provided that the following conditions
  9. * are met:
  10. * 1. Redistributions of source code must retain the above copyright
  11. * notice, this list of conditions and the following disclaimer.
  12. * 2. Redistributions in binary form must reproduce the above copyright
  13. * notice, this list of conditions and the following disclaimer in the
  14. * documentation and/or other materials provided with the distribution.
  15. * 3. The name of the author may not be used to endorse or promote products
  16. * derived from this software without specific prior written permission.
  17. *
  18. * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
  19. * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  20. * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  21. * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  22. * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  23. * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  24. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  25. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  26. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  27. * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  28. */
  29. #define IMC_BASE 0x1fa00000
  30. #define IMC_CPUCTRL0 0x04 /* CPU control, register 0 */
  31. #define IMC_CPUCTRL0_REFMASK 0x0000000f /* # lines to refresh */
  32. #define IMC_CPUCTRL0_RFE 0x00000010 /* refresh enable */
  33. #define IMC_CPUCTRL0_GPR 0x00000020 /* GIO parity enable */
  34. #define IMC_CPUCTRL0_MPR 0x00000040 /* memory parity enable */
  35. #define IMC_CPUCTRL0_CPR 0x00000080 /* cpu bus parity enable */
  36. #define IMC_CPUCTRL0_WDOG 0x00000100 /* watchdog enable */
  37. #define IMC_CPUCTRL0_SIN 0x00000200 /* reset system */
  38. #define IMC_CPUCTRL0_GRR 0x00000400 /* graphics reset */
  39. #define IMC_CPUCTRL0_ENLOCK 0x00000800 /* enable EISA memory lock */
  40. #define IMC_CPUCTRL0_CMDPAR 0x00001000 /* SysCmd parity enable */
  41. #define IMC_CPUCTRL0_INTENA 0x00002000 /* enable CPU interrupts */
  42. #define IMC_CPUCTRL0_SNOOPENA 0x00004000 /* enable gfx DMA snoop */
  43. #define IMC_CPUCTRL0_PROM_WRENA 0x00008000 /* disable buserr on PROM
  44. * writes */
  45. #define IMC_CPUCTRL0_WRST 0x00010000 /* warm restart (reset cpu) */
  46. /* Bit 17 reserved 0x00020000 */
  47. #define IMC_CPUCTRL0_LITTLE 0x00040000 /* MC little-endian toggle */
  48. #define IMC_CPUCTRL0_WRRST 0x00080000 /* cpu warm reset */
  49. #define IMC_CPUCTRL0_MUXHWMSK 0x01f00000 /* MUX fifo high-water mask */
  50. #define IMC_CPUCTRL0_BADPAR 0x02000000 /* generate bad parity on
  51. * CPU->memory writes */
  52. #define IMC_CPUCTRL0_NCHKMEMPAR 0x04000000 /* disable CPU parity check
  53. * on memory reads. */
  54. #define IMC_CPUCTRL0_BACK2 0x08000000 /* enable back2back GIO wrt */
  55. #define IMC_CPUCTRL0_BUSRTMSK 0xf0000000 /* stall cycle for berr data */
  56. #define IMC_CPUCTRL1 0x0c /* CPU control, register 1 */
  57. #define IMC_CPUCTRL1_MCHWMSK 0x0000000f /* MC FIFO high water mask */
  58. #define IMC_CPUCTRL1_ABORTEN 0x00000010 /* Enable GIO bus timeouts */
  59. /* Bits 5 - 11 reserved 0x00000fe0 */
  60. #define IMC_CPUCTRL1_HPCFX 0x00001000 /* HPC endian fix */
  61. #define IMC_CPUCTRL1_HPCLITTLE 0x00002000 /* HPC DMA is little-endian */
  62. #define IMC_CPUCTRL1_EXP0FX 0x00004000 /* EXP0 endian fix */
  63. #define IMC_CPUCTRL1_EXP0LITTLE 0x00008000 /* EXP0 DMA is little-endian */
  64. #define IMC_CPUCTRL1_EXP1FX 0x00010000 /* EXP1 endian fix */
  65. #define IMC_CPUCTRL1_EXP1LITTLE 0x00020000 /* EXP1 DMA is little-endian */
  66. #define IMC_WDOG 0x14 /* Watchdog counter */
  67. #define IMC_WDOG_MASK 0x001fffff /* counter mask */
  68. #define IMC_SYSID 0x1c /* MC revision register */
  69. #define IMC_SYSID_REVMASK 0x0000000f /* MC revision mask */
  70. #define IMC_SYSID_HAVEISA 0x00000010 /* EISA present */
  71. #define IMC_RPSSDIV 0x2c /* RPSS divider */
  72. #define IMC_RPSSDIV_DIVMSK 0x000000ff /* RPC divider mask */
  73. #define IMC_RPSSDIV_INCMSK 0x0000ff00 /* RPC increment mask */
  74. #define IMC_EEPROM 0x34 /* EEPROM serial interface */
  75. /* Bit 1 is reserved 0x00000001 */
  76. #define IMC_EEPROM_CS 0x00000002 /* EEPROM chip select */
  77. #define IMC_EEPROM_SCK 0x00000004 /* EEPROM serial clock */
  78. #define IMC_EEPROM_SO 0x00000008 /* Serial data to EEPROM */
  79. #define IMC_EEPROM_SI 0x00000010 /* Serial data from EEPROM */
  80. #define IMC_CTRLD 0x44 /* Refresh counter preload */
  81. #define IMC_CTRLD_MSK 0x000000ff /* Counter preload mask */
  82. #define IMC_REFCTR 0x4c /* Refresh counter */
  83. #define IMC_REFCTR_MSK 0x000000ff /* Refresh counter mask */
  84. #define IMC_GIO64ARB 0x84 /* GIO64 arbitration params */
  85. #define IMC_GIO64ARB_HPC64 0x00000001 /* HPC addr size (32/64bit) */
  86. #define IMC_GIO64ARB_GRX64 0x00000002 /* Gfx addr size (32/64bit) */
  87. #define IMC_GIO64ARB_EXP064 0x00000004 /* EXP0 addr size (32/64bit) */
  88. #define IMC_GIO64ARB_EXP164 0x00000008 /* EXP1 addr size (32/64bit) */
  89. #define IMC_GIO64ARB_EISA64 0x00000010 /* EISA addr size (32/64bit) */
  90. #define IMC_GIO64ARB_HPCEXP64 0x00000020 /* HPC2 addr size (32/64bit) */
  91. #define IMC_GIO64ARB_GRXRT 0x00000040 /* Gfx is realtime device */
  92. #define IMC_GIO64ARB_EXP0RT 0x00000080 /* EXP0 is realtime device */
  93. #define IMC_GIO64ARB_EXP1RT 0x00000100 /* EXP1 is realtime device */
  94. #define IMC_GIO64ARB_EISAMST 0x00000200 /* EISA can be busmaster */
  95. #define IMC_GIO64ARB_ONEGIO 0x00000400 /* Only one GIO64 bus */
  96. #define IMC_GIO64ARB_GRXMST 0x00000800 /* Gfx can be busmaster */
  97. #define IMC_GIO64ARB_EXP0MST 0x00001000 /* EXP0 can be busmaster */
  98. #define IMC_GIO64ARB_EXP1MST 0x00002000 /* EXP1 can be busmaster */
  99. #define IMC_GIO64ARB_EXP0PIPE 0x00004000 /* EXP0 is pipelined */
  100. #define IMC_GIO64ARB_EXP1PIPE 0x00008000 /* EXP1 is pipelined */
  101. #define IMC_CPUTIME 0x8c /* Arbiter CPU time period */
  102. #define IMC_LBTIME 0x9c /* Arbiter long-burst time */
  103. #define IMC_MEMCFG0 0xc4 /* Mem config, register 0 */
  104. #define IMC_MEMCFG1 0xcc /* Mem config, register 1 */
  105. #define IMC_MEMC_BANK_MASK 0x0000ffff
  106. #define IMC_MEMC_BANK_SHIFT 16
  107. #define IMC_MEMC_ADDR_MASK 0x00ff
  108. #define IMC_MEMC_ADDR_SHIFT 0
  109. #define IMC_MEMC_SIZE_MASK 0x1f00
  110. #define IMC_MEMC_SIZE_SHIFT 8
  111. #define IMC_MEMC_LSHIFT 22 /* 4MB units */
  112. #define IMC_MEMC_LSHIFT_HUGE 24 /* 16MB units */
  113. #define IMC_MEMC_VALID 0x2000
  114. #define IMC_MEMC_SUBBANKS 0x4000
  115. #define IMC_CPU_MEMACC 0xd4 /* CPU mem access config */
  116. #define IMC_GIO_MEMACC 0xdc /* GIO mem access config */
  117. #define IMC_CPU_ERRADDR 0xe4 /* CPU error address */
  118. #define IMC_CPU_ERRSTAT 0xec /* CPU error status */
  119. #define IMC_CPU_ERRSTAT_RD 0x00000100 /* memory parity error */
  120. #define IMC_CPU_ERRSTAT_PAR 0x00000200 /* CPU parity error */
  121. #define IMC_CPU_ERRSTAT_ADDR 0x00000400 /* memory bus error */
  122. #define IMC_CPU_ERRSTAT_SYSAD 0x00000800 /* SysAD parity error */
  123. #define IMC_CPU_ERRSTAT_SYSCMD 0x00001000 /* syscmd parity error */
  124. #define IMC_GIO_ERRADDR 0xf4 /* GIO error address */
  125. #define IMC_GIO_ERRSTAT 0xfc /* GIO error status */
  126. #define IMC_GIO_ERRSTAT_RD 0x00000100 /* read parity error */
  127. #define IMC_GIO_ERRSTAT_WR 0x00000200 /* write parity error */
  128. #define IMC_GIO_ERRSTAT_TMO 0x00000400 /* bus timeout */
  129. #define IMC_GIO_ERRSTAT_PROM 0x00000800 /* PROM write while disabled */
  130. #define IMC_GIO_ERRSTAT_ADDR 0x00001000 /* parity error during */
  131. /* address cycle */
  132. #define IMC_GIO_ERRSTAT_BC 0x00002000 /* parity error during */
  133. /* byte count cycle */
  134. #define IMC_GIO_ERRSTAT_PIO_RD 0x00004000 /* data parity error during */
  135. /* PIO read */
  136. #define IMC_GIO_ERRSTAT_PIO_WR 0x00008000 /* data parity error during */
  137. /* PIO write */
  138. /* {CPU,GIO}_ERRSTAT bits in ECC mode */
  139. #define IMC_ECC_ERRSTAT_FUW 0x00000001 /* fast mode uncached write */
  140. #define IMC_ECC_ERRSTAT_MULTI 0x00000002 /* multi bit error */
  141. #define IMC_RPSS 0x1004 /* RPSS counter */
  142. /*
  143. * IP26/IP28 ECC Controller defines
  144. */
  145. #define ECC_BASE 0x60000000
  146. /* control register */
  147. #define ECC_CTRL 0x00
  148. #define ECC_CTRL_ENABLE 0x00000000 /* fast mode */
  149. #define ECC_CTRL_DISABLE 0x00010000 /* slow mode */
  150. #define ECC_CTRL_WRITE 0x00020000 /* write low bits to chip */
  151. #define ECC_CTRL_INT_CLR 0x00030000 /* clear pending interrupts */
  152. #define ECC_CTRL_CHK_ENABLE 0x00050000 /* enable ECC err generation */
  153. #define ECC_CTRL_CHK_DISABLE 0x00060000 /* disable ECC err generation */
  154. /* ecc control chip modes */
  155. #define ECC_MODE_PASSTHROUGH 0x0002 /* error detection only */
  156. #define ECC_MODE_NORMAL 0x0003 /* error detection and correction */