iomd.h 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  1. /*
  2. * arch/arm/include/asm/hardware/iomd.h
  3. *
  4. * Copyright (C) 1999 Russell King
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License version 2 as
  8. * published by the Free Software Foundation.
  9. *
  10. * This file contains information out the IOMD ASIC used in the
  11. * Acorn RiscPC and subsequently integrated into the CLPS7500 chips.
  12. */
  13. #ifndef __ASMARM_HARDWARE_IOMD_H
  14. #define __ASMARM_HARDWARE_IOMD_H
  15. #ifndef __ASSEMBLY__
  16. /*
  17. * We use __raw_base variants here so that we give the compiler the
  18. * chance to keep IOC_BASE in a register.
  19. */
  20. #define iomd_readb(off) __raw_readb(IOMD_BASE + (off))
  21. #define iomd_readl(off) __raw_readl(IOMD_BASE + (off))
  22. #define iomd_writeb(val,off) __raw_writeb(val, IOMD_BASE + (off))
  23. #define iomd_writel(val,off) __raw_writel(val, IOMD_BASE + (off))
  24. #endif
  25. #define IOMD_CONTROL (0x000)
  26. #define IOMD_KARTTX (0x004)
  27. #define IOMD_KARTRX (0x004)
  28. #define IOMD_KCTRL (0x008)
  29. #ifdef CONFIG_ARCH_CLPS7500
  30. #define IOMD_IOLINES (0x00C)
  31. #endif
  32. #define IOMD_IRQSTATA (0x010)
  33. #define IOMD_IRQREQA (0x014)
  34. #define IOMD_IRQCLRA (0x014)
  35. #define IOMD_IRQMASKA (0x018)
  36. #ifdef CONFIG_ARCH_CLPS7500
  37. #define IOMD_SUSMODE (0x01C)
  38. #endif
  39. #define IOMD_IRQSTATB (0x020)
  40. #define IOMD_IRQREQB (0x024)
  41. #define IOMD_IRQMASKB (0x028)
  42. #define IOMD_FIQSTAT (0x030)
  43. #define IOMD_FIQREQ (0x034)
  44. #define IOMD_FIQMASK (0x038)
  45. #ifdef CONFIG_ARCH_CLPS7500
  46. #define IOMD_CLKCTL (0x03C)
  47. #endif
  48. #define IOMD_T0CNTL (0x040)
  49. #define IOMD_T0LTCHL (0x040)
  50. #define IOMD_T0CNTH (0x044)
  51. #define IOMD_T0LTCHH (0x044)
  52. #define IOMD_T0GO (0x048)
  53. #define IOMD_T0LATCH (0x04c)
  54. #define IOMD_T1CNTL (0x050)
  55. #define IOMD_T1LTCHL (0x050)
  56. #define IOMD_T1CNTH (0x054)
  57. #define IOMD_T1LTCHH (0x054)
  58. #define IOMD_T1GO (0x058)
  59. #define IOMD_T1LATCH (0x05c)
  60. #ifdef CONFIG_ARCH_CLPS7500
  61. #define IOMD_IRQSTATC (0x060)
  62. #define IOMD_IRQREQC (0x064)
  63. #define IOMD_IRQMASKC (0x068)
  64. #define IOMD_VIDMUX (0x06c)
  65. #define IOMD_IRQSTATD (0x070)
  66. #define IOMD_IRQREQD (0x074)
  67. #define IOMD_IRQMASKD (0x078)
  68. #endif
  69. #define IOMD_ROMCR0 (0x080)
  70. #define IOMD_ROMCR1 (0x084)
  71. #ifdef CONFIG_ARCH_RPC
  72. #define IOMD_DRAMCR (0x088)
  73. #endif
  74. #define IOMD_REFCR (0x08C)
  75. #define IOMD_FSIZE (0x090)
  76. #define IOMD_ID0 (0x094)
  77. #define IOMD_ID1 (0x098)
  78. #define IOMD_VERSION (0x09C)
  79. #ifdef CONFIG_ARCH_RPC
  80. #define IOMD_MOUSEX (0x0A0)
  81. #define IOMD_MOUSEY (0x0A4)
  82. #endif
  83. #ifdef CONFIG_ARCH_CLPS7500
  84. #define IOMD_MSEDAT (0x0A8)
  85. #define IOMD_MSECTL (0x0Ac)
  86. #endif
  87. #ifdef CONFIG_ARCH_RPC
  88. #define IOMD_DMATCR (0x0C0)
  89. #endif
  90. #define IOMD_IOTCR (0x0C4)
  91. #define IOMD_ECTCR (0x0C8)
  92. #ifdef CONFIG_ARCH_RPC
  93. #define IOMD_DMAEXT (0x0CC)
  94. #endif
  95. #ifdef CONFIG_ARCH_CLPS7500
  96. #define IOMD_ASTCR (0x0CC)
  97. #define IOMD_DRAMCR (0x0D0)
  98. #define IOMD_SELFREF (0x0D4)
  99. #define IOMD_ATODICR (0x0E0)
  100. #define IOMD_ATODSR (0x0E4)
  101. #define IOMD_ATODCC (0x0E8)
  102. #define IOMD_ATODCNT1 (0x0EC)
  103. #define IOMD_ATODCNT2 (0x0F0)
  104. #define IOMD_ATODCNT3 (0x0F4)
  105. #define IOMD_ATODCNT4 (0x0F8)
  106. #endif
  107. #ifdef CONFIG_ARCH_RPC
  108. #define DMA_EXT_IO0 1
  109. #define DMA_EXT_IO1 2
  110. #define DMA_EXT_IO2 4
  111. #define DMA_EXT_IO3 8
  112. #define IOMD_IO0CURA (0x100)
  113. #define IOMD_IO0ENDA (0x104)
  114. #define IOMD_IO0CURB (0x108)
  115. #define IOMD_IO0ENDB (0x10C)
  116. #define IOMD_IO0CR (0x110)
  117. #define IOMD_IO0ST (0x114)
  118. #define IOMD_IO1CURA (0x120)
  119. #define IOMD_IO1ENDA (0x124)
  120. #define IOMD_IO1CURB (0x128)
  121. #define IOMD_IO1ENDB (0x12C)
  122. #define IOMD_IO1CR (0x130)
  123. #define IOMD_IO1ST (0x134)
  124. #define IOMD_IO2CURA (0x140)
  125. #define IOMD_IO2ENDA (0x144)
  126. #define IOMD_IO2CURB (0x148)
  127. #define IOMD_IO2ENDB (0x14C)
  128. #define IOMD_IO2CR (0x150)
  129. #define IOMD_IO2ST (0x154)
  130. #define IOMD_IO3CURA (0x160)
  131. #define IOMD_IO3ENDA (0x164)
  132. #define IOMD_IO3CURB (0x168)
  133. #define IOMD_IO3ENDB (0x16C)
  134. #define IOMD_IO3CR (0x170)
  135. #define IOMD_IO3ST (0x174)
  136. #endif
  137. #define IOMD_SD0CURA (0x180)
  138. #define IOMD_SD0ENDA (0x184)
  139. #define IOMD_SD0CURB (0x188)
  140. #define IOMD_SD0ENDB (0x18C)
  141. #define IOMD_SD0CR (0x190)
  142. #define IOMD_SD0ST (0x194)
  143. #ifdef CONFIG_ARCH_RPC
  144. #define IOMD_SD1CURA (0x1A0)
  145. #define IOMD_SD1ENDA (0x1A4)
  146. #define IOMD_SD1CURB (0x1A8)
  147. #define IOMD_SD1ENDB (0x1AC)
  148. #define IOMD_SD1CR (0x1B0)
  149. #define IOMD_SD1ST (0x1B4)
  150. #endif
  151. #define IOMD_CURSCUR (0x1C0)
  152. #define IOMD_CURSINIT (0x1C4)
  153. #define IOMD_VIDCUR (0x1D0)
  154. #define IOMD_VIDEND (0x1D4)
  155. #define IOMD_VIDSTART (0x1D8)
  156. #define IOMD_VIDINIT (0x1DC)
  157. #define IOMD_VIDCR (0x1E0)
  158. #define IOMD_DMASTAT (0x1F0)
  159. #define IOMD_DMAREQ (0x1F4)
  160. #define IOMD_DMAMASK (0x1F8)
  161. #define DMA_END_S (1 << 31)
  162. #define DMA_END_L (1 << 30)
  163. #define DMA_CR_C 0x80
  164. #define DMA_CR_D 0x40
  165. #define DMA_CR_E 0x20
  166. #define DMA_ST_OFL 4
  167. #define DMA_ST_INT 2
  168. #define DMA_ST_AB 1
  169. /*
  170. * DMA (MEMC) compatibility
  171. */
  172. #define HALF_SAM vram_half_sam
  173. #define VDMA_ALIGNMENT (HALF_SAM * 2)
  174. #define VDMA_XFERSIZE (HALF_SAM)
  175. #define VDMA_INIT IOMD_VIDINIT
  176. #define VDMA_START IOMD_VIDSTART
  177. #define VDMA_END IOMD_VIDEND
  178. #ifndef __ASSEMBLY__
  179. extern unsigned int vram_half_sam;
  180. #define video_set_dma(start,end,offset) \
  181. do { \
  182. outl (SCREEN_START + start, VDMA_START); \
  183. outl (SCREEN_START + end - VDMA_XFERSIZE, VDMA_END); \
  184. if (offset >= end - VDMA_XFERSIZE) \
  185. offset |= 0x40000000; \
  186. outl (SCREEN_START + offset, VDMA_INIT); \
  187. } while (0)
  188. #endif
  189. #endif