omap_ssi_regs.h 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. /* Hardware definitions for SSI.
  2. *
  3. * Copyright (C) 2010 Nokia Corporation. All rights reserved.
  4. *
  5. * Contact: Carlos Chinea <carlos.chinea@nokia.com>
  6. *
  7. * This program is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU General Public License
  9. * version 2 as published by the Free Software Foundation.
  10. *
  11. * This program is distributed in the hope that it will be useful, but
  12. * WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program; if not, write to the Free Software
  18. * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  19. * 02110-1301 USA
  20. */
  21. #ifndef __OMAP_SSI_REGS_H__
  22. #define __OMAP_SSI_REGS_H__
  23. /*
  24. * SSI SYS registers
  25. */
  26. #define SSI_REVISION_REG 0
  27. # define SSI_REV_MAJOR 0xf0
  28. # define SSI_REV_MINOR 0xf
  29. #define SSI_SYSCONFIG_REG 0x10
  30. # define SSI_AUTOIDLE (1 << 0)
  31. # define SSI_SOFTRESET (1 << 1)
  32. # define SSI_SIDLEMODE_FORCE 0
  33. # define SSI_SIDLEMODE_NO (1 << 3)
  34. # define SSI_SIDLEMODE_SMART (1 << 4)
  35. # define SSI_SIDLEMODE_MASK 0x18
  36. # define SSI_MIDLEMODE_FORCE 0
  37. # define SSI_MIDLEMODE_NO (1 << 12)
  38. # define SSI_MIDLEMODE_SMART (1 << 13)
  39. # define SSI_MIDLEMODE_MASK 0x3000
  40. #define SSI_SYSSTATUS_REG 0x14
  41. # define SSI_RESETDONE 1
  42. #define SSI_MPU_STATUS_REG(port, irq) (0x808 + ((port) * 0x10) + ((irq) * 2))
  43. #define SSI_MPU_ENABLE_REG(port, irq) (0x80c + ((port) * 0x10) + ((irq) * 8))
  44. # define SSI_DATAACCEPT(channel) (1 << (channel))
  45. # define SSI_DATAAVAILABLE(channel) (1 << ((channel) + 8))
  46. # define SSI_DATAOVERRUN(channel) (1 << ((channel) + 16))
  47. # define SSI_ERROROCCURED (1 << 24)
  48. # define SSI_BREAKDETECTED (1 << 25)
  49. #define SSI_GDD_MPU_IRQ_STATUS_REG 0x0800
  50. #define SSI_GDD_MPU_IRQ_ENABLE_REG 0x0804
  51. # define SSI_GDD_LCH(channel) (1 << (channel))
  52. #define SSI_WAKE_REG(port) (0xc00 + ((port) * 0x10))
  53. #define SSI_CLEAR_WAKE_REG(port) (0xc04 + ((port) * 0x10))
  54. #define SSI_SET_WAKE_REG(port) (0xc08 + ((port) * 0x10))
  55. # define SSI_WAKE(channel) (1 << (channel))
  56. # define SSI_WAKE_MASK 0xff
  57. /*
  58. * SSI SST registers
  59. */
  60. #define SSI_SST_ID_REG 0
  61. #define SSI_SST_MODE_REG 4
  62. # define SSI_MODE_VAL_MASK 3
  63. # define SSI_MODE_SLEEP 0
  64. # define SSI_MODE_STREAM 1
  65. # define SSI_MODE_FRAME 2
  66. # define SSI_MODE_MULTIPOINTS 3
  67. #define SSI_SST_FRAMESIZE_REG 8
  68. # define SSI_FRAMESIZE_DEFAULT 31
  69. #define SSI_SST_TXSTATE_REG 0xc
  70. # define SSI_TXSTATE_IDLE 0
  71. #define SSI_SST_BUFSTATE_REG 0x10
  72. # define SSI_FULL(channel) (1 << (channel))
  73. #define SSI_SST_DIVISOR_REG 0x18
  74. # define SSI_MAX_DIVISOR 127
  75. #define SSI_SST_BREAK_REG 0x20
  76. #define SSI_SST_CHANNELS_REG 0x24
  77. # define SSI_CHANNELS_DEFAULT 4
  78. #define SSI_SST_ARBMODE_REG 0x28
  79. # define SSI_ARBMODE_ROUNDROBIN 0
  80. # define SSI_ARBMODE_PRIORITY 1
  81. #define SSI_SST_BUFFER_CH_REG(channel) (0x80 + ((channel) * 4))
  82. #define SSI_SST_SWAPBUF_CH_REG(channel) (0xc0 + ((channel) * 4))
  83. /*
  84. * SSI SSR registers
  85. */
  86. #define SSI_SSR_ID_REG 0
  87. #define SSI_SSR_MODE_REG 4
  88. #define SSI_SSR_FRAMESIZE_REG 8
  89. #define SSI_SSR_RXSTATE_REG 0xc
  90. #define SSI_SSR_BUFSTATE_REG 0x10
  91. # define SSI_NOTEMPTY(channel) (1 << (channel))
  92. #define SSI_SSR_BREAK_REG 0x1c
  93. #define SSI_SSR_ERROR_REG 0x20
  94. #define SSI_SSR_ERRORACK_REG 0x24
  95. #define SSI_SSR_OVERRUN_REG 0x2c
  96. #define SSI_SSR_OVERRUNACK_REG 0x30
  97. #define SSI_SSR_TIMEOUT_REG 0x34
  98. # define SSI_TIMEOUT_DEFAULT 0
  99. #define SSI_SSR_CHANNELS_REG 0x28
  100. #define SSI_SSR_BUFFER_CH_REG(channel) (0x80 + ((channel) * 4))
  101. #define SSI_SSR_SWAPBUF_CH_REG(channel) (0xc0 + ((channel) * 4))
  102. /*
  103. * SSI GDD registers
  104. */
  105. #define SSI_GDD_HW_ID_REG 0
  106. #define SSI_GDD_PPORT_ID_REG 0x10
  107. #define SSI_GDD_MPORT_ID_REG 0x14
  108. #define SSI_GDD_PPORT_SR_REG 0x20
  109. #define SSI_GDD_MPORT_SR_REG 0x24
  110. # define SSI_ACTIVE_LCH_NUM_MASK 0xff
  111. #define SSI_GDD_TEST_REG 0x40
  112. # define SSI_TEST 1
  113. #define SSI_GDD_GCR_REG 0x100
  114. # define SSI_CLK_AUTOGATING_ON (1 << 3)
  115. # define SSI_FREE (1 << 2)
  116. # define SSI_SWITCH_OFF (1 << 0)
  117. #define SSI_GDD_GRST_REG 0x200
  118. # define SSI_SWRESET 1
  119. #define SSI_GDD_CSDP_REG(channel) (0x800 + ((channel) * 0x40))
  120. # define SSI_DST_BURST_EN_MASK 0xc000
  121. # define SSI_DST_SINGLE_ACCESS0 0
  122. # define SSI_DST_SINGLE_ACCESS (1 << 14)
  123. # define SSI_DST_BURST_4x32_BIT (2 << 14)
  124. # define SSI_DST_BURST_8x32_BIT (3 << 14)
  125. # define SSI_DST_MASK 0x1e00
  126. # define SSI_DST_MEMORY_PORT (8 << 9)
  127. # define SSI_DST_PERIPHERAL_PORT (9 << 9)
  128. # define SSI_SRC_BURST_EN_MASK 0x180
  129. # define SSI_SRC_SINGLE_ACCESS0 0
  130. # define SSI_SRC_SINGLE_ACCESS (1 << 7)
  131. # define SSI_SRC_BURST_4x32_BIT (2 << 7)
  132. # define SSI_SRC_BURST_8x32_BIT (3 << 7)
  133. # define SSI_SRC_MASK 0x3c
  134. # define SSI_SRC_MEMORY_PORT (8 << 2)
  135. # define SSI_SRC_PERIPHERAL_PORT (9 << 2)
  136. # define SSI_DATA_TYPE_MASK 3
  137. # define SSI_DATA_TYPE_S32 2
  138. #define SSI_GDD_CCR_REG(channel) (0x802 + ((channel) * 0x40))
  139. # define SSI_DST_AMODE_MASK (3 << 14)
  140. # define SSI_DST_AMODE_CONST 0
  141. # define SSI_DST_AMODE_POSTINC (1 << 12)
  142. # define SSI_SRC_AMODE_MASK (3 << 12)
  143. # define SSI_SRC_AMODE_CONST 0
  144. # define SSI_SRC_AMODE_POSTINC (1 << 12)
  145. # define SSI_CCR_ENABLE (1 << 7)
  146. # define SSI_CCR_SYNC_MASK 0x1f
  147. #define SSI_GDD_CICR_REG(channel) (0x804 + ((channel) * 0x40))
  148. # define SSI_BLOCK_IE (1 << 5)
  149. # define SSI_HALF_IE (1 << 2)
  150. # define SSI_TOUT_IE (1 << 0)
  151. #define SSI_GDD_CSR_REG(channel) (0x806 + ((channel) * 0x40))
  152. # define SSI_CSR_SYNC (1 << 6)
  153. # define SSI_CSR_BLOCK (1 << 5)
  154. # define SSI_CSR_HALF (1 << 2)
  155. # define SSI_CSR_TOUR (1 << 0)
  156. #define SSI_GDD_CSSA_REG(channel) (0x808 + ((channel) * 0x40))
  157. #define SSI_GDD_CDSA_REG(channel) (0x80c + ((channel) * 0x40))
  158. #define SSI_GDD_CEN_REG(channel) (0x810 + ((channel) * 0x40))
  159. #define SSI_GDD_CSAC_REG(channel) (0x818 + ((channel) * 0x40))
  160. #define SSI_GDD_CDAC_REG(channel) (0x81a + ((channel) * 0x40))
  161. #define SSI_GDD_CLNK_CTRL_REG(channel) (0x828 + ((channel) * 0x40))
  162. # define SSI_ENABLE_LNK (1 << 15)
  163. # define SSI_STOP_LNK (1 << 14)
  164. # define SSI_NEXT_CH_ID_MASK 0xf
  165. #endif /* __OMAP_SSI_REGS_H__ */