m32104ut_pld.h 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. #ifndef _M32104UT_M32104UT_PLD_H
  2. #define _M32104UT_M32104UT_PLD_H
  3. /*
  4. * include/asm-m32r/m32104ut/m32104ut_pld.h
  5. *
  6. * Definitions for Programmable Logic Device(PLD) on M32104UT board.
  7. * Based on m32700ut_pld.h
  8. *
  9. * Copyright (c) 2002 Takeo Takahashi
  10. * Copyright (c) 2005 Naoto Sugai
  11. *
  12. * This file is subject to the terms and conditions of the GNU General
  13. * Public License. See the file "COPYING" in the main directory of
  14. * this archive for more details.
  15. */
  16. #if defined(CONFIG_PLAT_M32104UT)
  17. #define PLD_PLAT_BASE 0x02c00000
  18. #else
  19. #error "no platform configuration"
  20. #endif
  21. #ifndef __ASSEMBLY__
  22. /*
  23. * C functions use non-cache address.
  24. */
  25. #define PLD_BASE (PLD_PLAT_BASE /* + NONCACHE_OFFSET */)
  26. #define __reg8 (volatile unsigned char *)
  27. #define __reg16 (volatile unsigned short *)
  28. #define __reg32 (volatile unsigned int *)
  29. #else
  30. #define PLD_BASE (PLD_PLAT_BASE + NONCACHE_OFFSET)
  31. #define __reg8
  32. #define __reg16
  33. #define __reg32
  34. #endif /* __ASSEMBLY__ */
  35. /* CFC */
  36. #define PLD_CFRSTCR __reg16(PLD_BASE + 0x0000)
  37. #define PLD_CFSTS __reg16(PLD_BASE + 0x0002)
  38. #define PLD_CFIMASK __reg16(PLD_BASE + 0x0004)
  39. #define PLD_CFBUFCR __reg16(PLD_BASE + 0x0006)
  40. /* MMC */
  41. #define PLD_MMCCR __reg16(PLD_BASE + 0x4000)
  42. #define PLD_MMCMOD __reg16(PLD_BASE + 0x4002)
  43. #define PLD_MMCSTS __reg16(PLD_BASE + 0x4006)
  44. #define PLD_MMCBAUR __reg16(PLD_BASE + 0x400a)
  45. #define PLD_MMCCMDBCUT __reg16(PLD_BASE + 0x400c)
  46. #define PLD_MMCCDTBCUT __reg16(PLD_BASE + 0x400e)
  47. #define PLD_MMCDET __reg16(PLD_BASE + 0x4010)
  48. #define PLD_MMCWP __reg16(PLD_BASE + 0x4012)
  49. #define PLD_MMCWDATA __reg16(PLD_BASE + 0x5000)
  50. #define PLD_MMCRDATA __reg16(PLD_BASE + 0x6000)
  51. #define PLD_MMCCMDDATA __reg16(PLD_BASE + 0x7000)
  52. #define PLD_MMCRSPDATA __reg16(PLD_BASE + 0x7006)
  53. /* ICU
  54. * ICUISTS: status register
  55. * ICUIREQ0: request register
  56. * ICUIREQ1: request register
  57. * ICUCR3: control register for CFIREQ# interrupt
  58. * ICUCR4: control register for CFC Card insert interrupt
  59. * ICUCR5: control register for CFC Card eject interrupt
  60. * ICUCR6: control register for external interrupt
  61. * ICUCR11: control register for MMC Card insert/eject interrupt
  62. * ICUCR13: control register for SC error interrupt
  63. * ICUCR14: control register for SC receive interrupt
  64. * ICUCR15: control register for SC send interrupt
  65. */
  66. #define PLD_IRQ_INT0 (M32104UT_PLD_IRQ_BASE + 0) /* None */
  67. #define PLD_IRQ_CFIREQ (M32104UT_PLD_IRQ_BASE + 3) /* CF IREQ */
  68. #define PLD_IRQ_CFC_INSERT (M32104UT_PLD_IRQ_BASE + 4) /* CF Insert */
  69. #define PLD_IRQ_CFC_EJECT (M32104UT_PLD_IRQ_BASE + 5) /* CF Eject */
  70. #define PLD_IRQ_EXINT (M32104UT_PLD_IRQ_BASE + 6) /* EXINT */
  71. #define PLD_IRQ_MMCCARD (M32104UT_PLD_IRQ_BASE + 11) /* MMC Insert/Eject */
  72. #define PLD_IRQ_SC_ERROR (M32104UT_PLD_IRQ_BASE + 13) /* SC error */
  73. #define PLD_IRQ_SC_RCV (M32104UT_PLD_IRQ_BASE + 14) /* SC receive */
  74. #define PLD_IRQ_SC_SND (M32104UT_PLD_IRQ_BASE + 15) /* SC send */
  75. #define PLD_ICUISTS __reg16(PLD_BASE + 0x8002)
  76. #define PLD_ICUISTS_VECB_MASK (0xf000)
  77. #define PLD_ICUISTS_VECB(x) ((x) & PLD_ICUISTS_VECB_MASK)
  78. #define PLD_ICUISTS_ISN_MASK (0x07c0)
  79. #define PLD_ICUISTS_ISN(x) ((x) & PLD_ICUISTS_ISN_MASK)
  80. #define PLD_ICUCR3 __reg16(PLD_BASE + 0x8104)
  81. #define PLD_ICUCR4 __reg16(PLD_BASE + 0x8106)
  82. #define PLD_ICUCR5 __reg16(PLD_BASE + 0x8108)
  83. #define PLD_ICUCR6 __reg16(PLD_BASE + 0x810a)
  84. #define PLD_ICUCR11 __reg16(PLD_BASE + 0x8114)
  85. #define PLD_ICUCR13 __reg16(PLD_BASE + 0x8118)
  86. #define PLD_ICUCR14 __reg16(PLD_BASE + 0x811a)
  87. #define PLD_ICUCR15 __reg16(PLD_BASE + 0x811c)
  88. #define PLD_ICUCR_IEN (0x1000)
  89. #define PLD_ICUCR_IREQ (0x0100)
  90. #define PLD_ICUCR_ISMOD00 (0x0000) /* Low edge */
  91. #define PLD_ICUCR_ISMOD01 (0x0010) /* Low level */
  92. #define PLD_ICUCR_ISMOD02 (0x0020) /* High edge */
  93. #define PLD_ICUCR_ISMOD03 (0x0030) /* High level */
  94. #define PLD_ICUCR_ILEVEL0 (0x0000)
  95. #define PLD_ICUCR_ILEVEL1 (0x0001)
  96. #define PLD_ICUCR_ILEVEL2 (0x0002)
  97. #define PLD_ICUCR_ILEVEL3 (0x0003)
  98. #define PLD_ICUCR_ILEVEL4 (0x0004)
  99. #define PLD_ICUCR_ILEVEL5 (0x0005)
  100. #define PLD_ICUCR_ILEVEL6 (0x0006)
  101. #define PLD_ICUCR_ILEVEL7 (0x0007)
  102. /* Power Control of MMC and CF */
  103. #define PLD_CPCR __reg16(PLD_BASE + 0x14000)
  104. #define PLD_CPCR_CDP 0x0001
  105. /* LED Control
  106. *
  107. * 1: DIP swich side
  108. * 2: Reset switch side
  109. */
  110. #define PLD_IOLEDCR __reg16(PLD_BASE + 0x14002)
  111. #define PLD_IOLED_1_ON 0x001
  112. #define PLD_IOLED_1_OFF 0x000
  113. #define PLD_IOLED_2_ON 0x002
  114. #define PLD_IOLED_2_OFF 0x000
  115. /* DIP Switch
  116. * 0: Write-protect of Flash Memory (0:protected, 1:non-protected)
  117. * 1: -
  118. * 2: -
  119. * 3: -
  120. */
  121. #define PLD_IOSWSTS __reg16(PLD_BASE + 0x14004)
  122. #define PLD_IOSWSTS_IOSW2 0x0200
  123. #define PLD_IOSWSTS_IOSW1 0x0100
  124. #define PLD_IOSWSTS_IOWP0 0x0001
  125. /* CRC */
  126. #define PLD_CRC7DATA __reg16(PLD_BASE + 0x18000)
  127. #define PLD_CRC7INDATA __reg16(PLD_BASE + 0x18002)
  128. #define PLD_CRC16DATA __reg16(PLD_BASE + 0x18004)
  129. #define PLD_CRC16INDATA __reg16(PLD_BASE + 0x18006)
  130. #define PLD_CRC16ADATA __reg16(PLD_BASE + 0x18008)
  131. #define PLD_CRC16AINDATA __reg16(PLD_BASE + 0x1800a)
  132. /* RTC */
  133. #define PLD_RTCCR __reg16(PLD_BASE + 0x1c000)
  134. #define PLD_RTCBAUR __reg16(PLD_BASE + 0x1c002)
  135. #define PLD_RTCWRDATA __reg16(PLD_BASE + 0x1c004)
  136. #define PLD_RTCRDDATA __reg16(PLD_BASE + 0x1c006)
  137. #define PLD_RTCRSTODT __reg16(PLD_BASE + 0x1c008)
  138. /* SIM Card */
  139. #define PLD_SCCR __reg16(PLD_BASE + 0x38000)
  140. #define PLD_SCMOD __reg16(PLD_BASE + 0x38004)
  141. #define PLD_SCSTS __reg16(PLD_BASE + 0x38006)
  142. #define PLD_SCINTCR __reg16(PLD_BASE + 0x38008)
  143. #define PLD_SCBAUR __reg16(PLD_BASE + 0x3800a)
  144. #define PLD_SCTXB __reg16(PLD_BASE + 0x3800c)
  145. #define PLD_SCRXB __reg16(PLD_BASE + 0x3800e)
  146. #endif /* _M32104UT_M32104UT_PLD_H */