mappi2_pld.h 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. #ifndef _MAPPI2_PLD_H
  2. #define _MAPPI2_PLD_H
  3. /*
  4. * include/asm-m32r/mappi2/mappi2_pld.h
  5. *
  6. * Definitions for Extended IO Logic on MAPPI2 board.
  7. * based on m32700ut_pld.h
  8. *
  9. * This file is subject to the terms and conditions of the GNU General
  10. * Public License. See the file "COPYING" in the main directory of
  11. * this archive for more details.
  12. */
  13. #ifndef __ASSEMBLY__
  14. /* FIXME:
  15. * Some C functions use non-cache address, so can't define non-cache address.
  16. */
  17. #define PLD_BASE (0x10c00000 /* + NONCACHE_OFFSET */)
  18. #define __reg8 (volatile unsigned char *)
  19. #define __reg16 (volatile unsigned short *)
  20. #define __reg32 (volatile unsigned int *)
  21. #else
  22. #define PLD_BASE (0x10c00000 + NONCACHE_OFFSET)
  23. #define __reg8
  24. #define __reg16
  25. #define __reg32
  26. #endif /* __ASSEMBLY__ */
  27. /* CFC */
  28. #define PLD_CFRSTCR __reg16(PLD_BASE + 0x0000)
  29. #define PLD_CFSTS __reg16(PLD_BASE + 0x0002)
  30. #define PLD_CFIMASK __reg16(PLD_BASE + 0x0004)
  31. #define PLD_CFBUFCR __reg16(PLD_BASE + 0x0006)
  32. #define PLD_CFCR0 __reg16(PLD_BASE + 0x000a)
  33. #define PLD_CFCR1 __reg16(PLD_BASE + 0x000c)
  34. /* MMC */
  35. #define PLD_MMCCR __reg16(PLD_BASE + 0x4000)
  36. #define PLD_MMCMOD __reg16(PLD_BASE + 0x4002)
  37. #define PLD_MMCSTS __reg16(PLD_BASE + 0x4006)
  38. #define PLD_MMCBAUR __reg16(PLD_BASE + 0x400a)
  39. #define PLD_MMCCMDBCUT __reg16(PLD_BASE + 0x400c)
  40. #define PLD_MMCCDTBCUT __reg16(PLD_BASE + 0x400e)
  41. #define PLD_MMCDET __reg16(PLD_BASE + 0x4010)
  42. #define PLD_MMCWP __reg16(PLD_BASE + 0x4012)
  43. #define PLD_MMCWDATA __reg16(PLD_BASE + 0x5000)
  44. #define PLD_MMCRDATA __reg16(PLD_BASE + 0x6000)
  45. #define PLD_MMCCMDDATA __reg16(PLD_BASE + 0x7000)
  46. #define PLD_MMCRSPDATA __reg16(PLD_BASE + 0x7006)
  47. /* Power Control of MMC and CF */
  48. #define PLD_CPCR __reg16(PLD_BASE + 0x14000)
  49. /*==== ICU ====*/
  50. #define M32R_IRQ_PC104 (5) /* INT4(PC/104) */
  51. #define M32R_IRQ_I2C (28) /* I2C-BUS */
  52. #if 1
  53. #define PLD_IRQ_CFIREQ (40) /* CFC Card Interrupt */
  54. #define PLD_IRQ_CFC_INSERT (41) /* CFC Card Insert */
  55. #define PLD_IRQ_CFC_EJECT (42) /* CFC Card Eject */
  56. #define PLD_IRQ_MMCCARD (43) /* MMC Card Insert */
  57. #define PLD_IRQ_MMCIRQ (44) /* MMC Transfer Done */
  58. #else
  59. #define PLD_IRQ_CFIREQ (34) /* CFC Card Interrupt */
  60. #define PLD_IRQ_CFC_INSERT (35) /* CFC Card Insert */
  61. #define PLD_IRQ_CFC_EJECT (36) /* CFC Card Eject */
  62. #define PLD_IRQ_MMCCARD (37) /* MMC Card Insert */
  63. #define PLD_IRQ_MMCIRQ (38) /* MMC Transfer Done */
  64. #endif
  65. #if 0
  66. /* LED Control
  67. *
  68. * 1: DIP swich side
  69. * 2: Reset switch side
  70. */
  71. #define PLD_IOLEDCR __reg16(PLD_BASE + 0x14002)
  72. #define PLD_IOLED_1_ON 0x001
  73. #define PLD_IOLED_1_OFF 0x000
  74. #define PLD_IOLED_2_ON 0x002
  75. #define PLD_IOLED_2_OFF 0x000
  76. /* DIP Switch
  77. * 0: Write-protect of Flash Memory (0:protected, 1:non-protected)
  78. * 1: -
  79. * 2: -
  80. * 3: -
  81. */
  82. #define PLD_IOSWSTS __reg16(PLD_BASE + 0x14004)
  83. #define PLD_IOSWSTS_IOSW2 0x0200
  84. #define PLD_IOSWSTS_IOSW1 0x0100
  85. #define PLD_IOSWSTS_IOWP0 0x0001
  86. #endif
  87. /* CRC */
  88. #define PLD_CRC7DATA __reg16(PLD_BASE + 0x18000)
  89. #define PLD_CRC7INDATA __reg16(PLD_BASE + 0x18002)
  90. #define PLD_CRC16DATA __reg16(PLD_BASE + 0x18004)
  91. #define PLD_CRC16INDATA __reg16(PLD_BASE + 0x18006)
  92. #define PLD_CRC16ADATA __reg16(PLD_BASE + 0x18008)
  93. #define PLD_CRC16AINDATA __reg16(PLD_BASE + 0x1800a)
  94. #if 0
  95. /* RTC */
  96. #define PLD_RTCCR __reg16(PLD_BASE + 0x1c000)
  97. #define PLD_RTCBAUR __reg16(PLD_BASE + 0x1c002)
  98. #define PLD_RTCWRDATA __reg16(PLD_BASE + 0x1c004)
  99. #define PLD_RTCRDDATA __reg16(PLD_BASE + 0x1c006)
  100. #define PLD_RTCRSTODT __reg16(PLD_BASE + 0x1c008)
  101. /* SIO0 */
  102. #define PLD_ESIO0CR __reg16(PLD_BASE + 0x20000)
  103. #define PLD_ESIO0CR_TXEN 0x0001
  104. #define PLD_ESIO0CR_RXEN 0x0002
  105. #define PLD_ESIO0MOD0 __reg16(PLD_BASE + 0x20002)
  106. #define PLD_ESIO0MOD0_CTSS 0x0040
  107. #define PLD_ESIO0MOD0_RTSS 0x0080
  108. #define PLD_ESIO0MOD1 __reg16(PLD_BASE + 0x20004)
  109. #define PLD_ESIO0MOD1_LMFS 0x0010
  110. #define PLD_ESIO0STS __reg16(PLD_BASE + 0x20006)
  111. #define PLD_ESIO0STS_TEMP 0x0001
  112. #define PLD_ESIO0STS_TXCP 0x0002
  113. #define PLD_ESIO0STS_RXCP 0x0004
  114. #define PLD_ESIO0STS_TXSC 0x0100
  115. #define PLD_ESIO0STS_RXSC 0x0200
  116. #define PLD_ESIO0STS_TXREADY (PLD_ESIO0STS_TXCP | PLD_ESIO0STS_TEMP)
  117. #define PLD_ESIO0INTCR __reg16(PLD_BASE + 0x20008)
  118. #define PLD_ESIO0INTCR_TXIEN 0x0002
  119. #define PLD_ESIO0INTCR_RXCEN 0x0004
  120. #define PLD_ESIO0BAUR __reg16(PLD_BASE + 0x2000a)
  121. #define PLD_ESIO0TXB __reg16(PLD_BASE + 0x2000c)
  122. #define PLD_ESIO0RXB __reg16(PLD_BASE + 0x2000e)
  123. /* SIM Card */
  124. #define PLD_SCCR __reg16(PLD_BASE + 0x38000)
  125. #define PLD_SCMOD __reg16(PLD_BASE + 0x38004)
  126. #define PLD_SCSTS __reg16(PLD_BASE + 0x38006)
  127. #define PLD_SCINTCR __reg16(PLD_BASE + 0x38008)
  128. #define PLD_SCBAUR __reg16(PLD_BASE + 0x3800a)
  129. #define PLD_SCTXB __reg16(PLD_BASE + 0x3800c)
  130. #define PLD_SCRXB __reg16(PLD_BASE + 0x3800e)
  131. #endif
  132. #endif /* _MAPPI2_PLD.H */