hdmi4_core.h 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273
  1. /*
  2. * HDMI header definition for OMAP4 HDMI core IP
  3. *
  4. * Copyright (C) 2010-2011 Texas Instruments Incorporated - http://www.ti.com/
  5. *
  6. * This program is free software; you can redistribute it and/or modify it
  7. * under the terms of the GNU General Public License version 2 as published by
  8. * the Free Software Foundation.
  9. *
  10. * This program is distributed in the hope that it will be useful, but WITHOUT
  11. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  12. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  13. * more details.
  14. *
  15. * You should have received a copy of the GNU General Public License along with
  16. * this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. #ifndef _HDMI4_CORE_H_
  19. #define _HDMI4_CORE_H_
  20. #include "hdmi.h"
  21. /* OMAP4 HDMI IP Core System */
  22. #define HDMI_CORE_SYS_VND_IDL 0x0
  23. #define HDMI_CORE_SYS_DEV_IDL 0x8
  24. #define HDMI_CORE_SYS_DEV_IDH 0xC
  25. #define HDMI_CORE_SYS_DEV_REV 0x10
  26. #define HDMI_CORE_SYS_SRST 0x14
  27. #define HDMI_CORE_SYS_SYS_CTRL1 0x20
  28. #define HDMI_CORE_SYS_SYS_STAT 0x24
  29. #define HDMI_CORE_SYS_SYS_CTRL3 0x28
  30. #define HDMI_CORE_SYS_DCTL 0x34
  31. #define HDMI_CORE_SYS_DE_DLY 0xC8
  32. #define HDMI_CORE_SYS_DE_CTRL 0xCC
  33. #define HDMI_CORE_SYS_DE_TOP 0xD0
  34. #define HDMI_CORE_SYS_DE_CNTL 0xD8
  35. #define HDMI_CORE_SYS_DE_CNTH 0xDC
  36. #define HDMI_CORE_SYS_DE_LINL 0xE0
  37. #define HDMI_CORE_SYS_DE_LINH_1 0xE4
  38. #define HDMI_CORE_SYS_HRES_L 0xE8
  39. #define HDMI_CORE_SYS_HRES_H 0xEC
  40. #define HDMI_CORE_SYS_VRES_L 0xF0
  41. #define HDMI_CORE_SYS_VRES_H 0xF4
  42. #define HDMI_CORE_SYS_IADJUST 0xF8
  43. #define HDMI_CORE_SYS_POLDETECT 0xFC
  44. #define HDMI_CORE_SYS_HWIDTH1 0x110
  45. #define HDMI_CORE_SYS_HWIDTH2 0x114
  46. #define HDMI_CORE_SYS_VWIDTH 0x11C
  47. #define HDMI_CORE_SYS_VID_CTRL 0x120
  48. #define HDMI_CORE_SYS_VID_ACEN 0x124
  49. #define HDMI_CORE_SYS_VID_MODE 0x128
  50. #define HDMI_CORE_SYS_VID_BLANK1 0x12C
  51. #define HDMI_CORE_SYS_VID_BLANK2 0x130
  52. #define HDMI_CORE_SYS_VID_BLANK3 0x134
  53. #define HDMI_CORE_SYS_DC_HEADER 0x138
  54. #define HDMI_CORE_SYS_VID_DITHER 0x13C
  55. #define HDMI_CORE_SYS_RGB2XVYCC_CT 0x140
  56. #define HDMI_CORE_SYS_R2Y_COEFF_LOW 0x144
  57. #define HDMI_CORE_SYS_R2Y_COEFF_UP 0x148
  58. #define HDMI_CORE_SYS_G2Y_COEFF_LOW 0x14C
  59. #define HDMI_CORE_SYS_G2Y_COEFF_UP 0x150
  60. #define HDMI_CORE_SYS_B2Y_COEFF_LOW 0x154
  61. #define HDMI_CORE_SYS_B2Y_COEFF_UP 0x158
  62. #define HDMI_CORE_SYS_R2CB_COEFF_LOW 0x15C
  63. #define HDMI_CORE_SYS_R2CB_COEFF_UP 0x160
  64. #define HDMI_CORE_SYS_G2CB_COEFF_LOW 0x164
  65. #define HDMI_CORE_SYS_G2CB_COEFF_UP 0x168
  66. #define HDMI_CORE_SYS_B2CB_COEFF_LOW 0x16C
  67. #define HDMI_CORE_SYS_B2CB_COEFF_UP 0x170
  68. #define HDMI_CORE_SYS_R2CR_COEFF_LOW 0x174
  69. #define HDMI_CORE_SYS_R2CR_COEFF_UP 0x178
  70. #define HDMI_CORE_SYS_G2CR_COEFF_LOW 0x17C
  71. #define HDMI_CORE_SYS_G2CR_COEFF_UP 0x180
  72. #define HDMI_CORE_SYS_B2CR_COEFF_LOW 0x184
  73. #define HDMI_CORE_SYS_B2CR_COEFF_UP 0x188
  74. #define HDMI_CORE_SYS_RGB_OFFSET_LOW 0x18C
  75. #define HDMI_CORE_SYS_RGB_OFFSET_UP 0x190
  76. #define HDMI_CORE_SYS_Y_OFFSET_LOW 0x194
  77. #define HDMI_CORE_SYS_Y_OFFSET_UP 0x198
  78. #define HDMI_CORE_SYS_CBCR_OFFSET_LOW 0x19C
  79. #define HDMI_CORE_SYS_CBCR_OFFSET_UP 0x1A0
  80. #define HDMI_CORE_SYS_INTR_STATE 0x1C0
  81. #define HDMI_CORE_SYS_INTR1 0x1C4
  82. #define HDMI_CORE_SYS_INTR2 0x1C8
  83. #define HDMI_CORE_SYS_INTR3 0x1CC
  84. #define HDMI_CORE_SYS_INTR4 0x1D0
  85. #define HDMI_CORE_SYS_INTR_UNMASK1 0x1D4
  86. #define HDMI_CORE_SYS_INTR_UNMASK2 0x1D8
  87. #define HDMI_CORE_SYS_INTR_UNMASK3 0x1DC
  88. #define HDMI_CORE_SYS_INTR_UNMASK4 0x1E0
  89. #define HDMI_CORE_SYS_INTR_CTRL 0x1E4
  90. #define HDMI_CORE_SYS_TMDS_CTRL 0x208
  91. /* value definitions for HDMI_CORE_SYS_SYS_CTRL1 fields */
  92. #define HDMI_CORE_SYS_SYS_CTRL1_VEN_FOLLOWVSYNC 0x1
  93. #define HDMI_CORE_SYS_SYS_CTRL1_HEN_FOLLOWHSYNC 0x1
  94. #define HDMI_CORE_SYS_SYS_CTRL1_BSEL_24BITBUS 0x1
  95. #define HDMI_CORE_SYS_SYS_CTRL1_EDGE_RISINGEDGE 0x1
  96. /* HDMI DDC E-DID */
  97. #define HDMI_CORE_DDC_ADDR 0x3B4
  98. #define HDMI_CORE_DDC_SEGM 0x3B8
  99. #define HDMI_CORE_DDC_OFFSET 0x3BC
  100. #define HDMI_CORE_DDC_COUNT1 0x3C0
  101. #define HDMI_CORE_DDC_COUNT2 0x3C4
  102. #define HDMI_CORE_DDC_STATUS 0x3C8
  103. #define HDMI_CORE_DDC_CMD 0x3CC
  104. #define HDMI_CORE_DDC_DATA 0x3D0
  105. /* HDMI IP Core Audio Video */
  106. #define HDMI_CORE_AV_ACR_CTRL 0x4
  107. #define HDMI_CORE_AV_FREQ_SVAL 0x8
  108. #define HDMI_CORE_AV_N_SVAL1 0xC
  109. #define HDMI_CORE_AV_N_SVAL2 0x10
  110. #define HDMI_CORE_AV_N_SVAL3 0x14
  111. #define HDMI_CORE_AV_CTS_SVAL1 0x18
  112. #define HDMI_CORE_AV_CTS_SVAL2 0x1C
  113. #define HDMI_CORE_AV_CTS_SVAL3 0x20
  114. #define HDMI_CORE_AV_CTS_HVAL1 0x24
  115. #define HDMI_CORE_AV_CTS_HVAL2 0x28
  116. #define HDMI_CORE_AV_CTS_HVAL3 0x2C
  117. #define HDMI_CORE_AV_AUD_MODE 0x50
  118. #define HDMI_CORE_AV_SPDIF_CTRL 0x54
  119. #define HDMI_CORE_AV_HW_SPDIF_FS 0x60
  120. #define HDMI_CORE_AV_SWAP_I2S 0x64
  121. #define HDMI_CORE_AV_SPDIF_ERTH 0x6C
  122. #define HDMI_CORE_AV_I2S_IN_MAP 0x70
  123. #define HDMI_CORE_AV_I2S_IN_CTRL 0x74
  124. #define HDMI_CORE_AV_I2S_CHST0 0x78
  125. #define HDMI_CORE_AV_I2S_CHST1 0x7C
  126. #define HDMI_CORE_AV_I2S_CHST2 0x80
  127. #define HDMI_CORE_AV_I2S_CHST4 0x84
  128. #define HDMI_CORE_AV_I2S_CHST5 0x88
  129. #define HDMI_CORE_AV_ASRC 0x8C
  130. #define HDMI_CORE_AV_I2S_IN_LEN 0x90
  131. #define HDMI_CORE_AV_HDMI_CTRL 0xBC
  132. #define HDMI_CORE_AV_AUDO_TXSTAT 0xC0
  133. #define HDMI_CORE_AV_AUD_PAR_BUSCLK_1 0xCC
  134. #define HDMI_CORE_AV_AUD_PAR_BUSCLK_2 0xD0
  135. #define HDMI_CORE_AV_AUD_PAR_BUSCLK_3 0xD4
  136. #define HDMI_CORE_AV_TEST_TXCTRL 0xF0
  137. #define HDMI_CORE_AV_DPD 0xF4
  138. #define HDMI_CORE_AV_PB_CTRL1 0xF8
  139. #define HDMI_CORE_AV_PB_CTRL2 0xFC
  140. #define HDMI_CORE_AV_AVI_BASE 0x100
  141. #define HDMI_CORE_AV_AVI_TYPE 0x100
  142. #define HDMI_CORE_AV_AVI_VERS 0x104
  143. #define HDMI_CORE_AV_AVI_LEN 0x108
  144. #define HDMI_CORE_AV_AVI_CHSUM 0x10C
  145. #define HDMI_CORE_AV_AVI_DBYTE(n) (n * 4 + 0x110)
  146. #define HDMI_CORE_AV_SPD_TYPE 0x180
  147. #define HDMI_CORE_AV_SPD_VERS 0x184
  148. #define HDMI_CORE_AV_SPD_LEN 0x188
  149. #define HDMI_CORE_AV_SPD_CHSUM 0x18C
  150. #define HDMI_CORE_AV_SPD_DBYTE(n) (n * 4 + 0x190)
  151. #define HDMI_CORE_AV_AUDIO_TYPE 0x200
  152. #define HDMI_CORE_AV_AUDIO_VERS 0x204
  153. #define HDMI_CORE_AV_AUDIO_LEN 0x208
  154. #define HDMI_CORE_AV_AUDIO_CHSUM 0x20C
  155. #define HDMI_CORE_AV_AUD_DBYTE(n) (n * 4 + 0x210)
  156. #define HDMI_CORE_AV_MPEG_TYPE 0x280
  157. #define HDMI_CORE_AV_MPEG_VERS 0x284
  158. #define HDMI_CORE_AV_MPEG_LEN 0x288
  159. #define HDMI_CORE_AV_MPEG_CHSUM 0x28C
  160. #define HDMI_CORE_AV_MPEG_DBYTE(n) (n * 4 + 0x290)
  161. #define HDMI_CORE_AV_GEN_DBYTE(n) (n * 4 + 0x300)
  162. #define HDMI_CORE_AV_CP_BYTE1 0x37C
  163. #define HDMI_CORE_AV_GEN2_DBYTE(n) (n * 4 + 0x380)
  164. #define HDMI_CORE_AV_CEC_ADDR_ID 0x3FC
  165. #define HDMI_CORE_AV_SPD_DBYTE_ELSIZE 0x4
  166. #define HDMI_CORE_AV_GEN2_DBYTE_ELSIZE 0x4
  167. #define HDMI_CORE_AV_MPEG_DBYTE_ELSIZE 0x4
  168. #define HDMI_CORE_AV_GEN_DBYTE_ELSIZE 0x4
  169. #define HDMI_CORE_AV_AVI_DBYTE_NELEMS 15
  170. #define HDMI_CORE_AV_SPD_DBYTE_NELEMS 27
  171. #define HDMI_CORE_AV_AUD_DBYTE_NELEMS 10
  172. #define HDMI_CORE_AV_MPEG_DBYTE_NELEMS 27
  173. #define HDMI_CORE_AV_GEN_DBYTE_NELEMS 31
  174. #define HDMI_CORE_AV_GEN2_DBYTE_NELEMS 31
  175. enum hdmi_core_inputbus_width {
  176. HDMI_INPUT_8BIT = 0,
  177. HDMI_INPUT_10BIT = 1,
  178. HDMI_INPUT_12BIT = 2
  179. };
  180. enum hdmi_core_dither_trunc {
  181. HDMI_OUTPUTTRUNCATION_8BIT = 0,
  182. HDMI_OUTPUTTRUNCATION_10BIT = 1,
  183. HDMI_OUTPUTTRUNCATION_12BIT = 2,
  184. HDMI_OUTPUTDITHER_8BIT = 3,
  185. HDMI_OUTPUTDITHER_10BIT = 4,
  186. HDMI_OUTPUTDITHER_12BIT = 5
  187. };
  188. enum hdmi_core_deepcolor_ed {
  189. HDMI_DEEPCOLORPACKECTDISABLE = 0,
  190. HDMI_DEEPCOLORPACKECTENABLE = 1
  191. };
  192. enum hdmi_core_packet_mode {
  193. HDMI_PACKETMODERESERVEDVALUE = 0,
  194. HDMI_PACKETMODE24BITPERPIXEL = 4,
  195. HDMI_PACKETMODE30BITPERPIXEL = 5,
  196. HDMI_PACKETMODE36BITPERPIXEL = 6,
  197. HDMI_PACKETMODE48BITPERPIXEL = 7
  198. };
  199. enum hdmi_core_tclkselclkmult {
  200. HDMI_FPLL05IDCK = 0,
  201. HDMI_FPLL10IDCK = 1,
  202. HDMI_FPLL20IDCK = 2,
  203. HDMI_FPLL40IDCK = 3
  204. };
  205. enum hdmi_core_packet_ctrl {
  206. HDMI_PACKETENABLE = 1,
  207. HDMI_PACKETDISABLE = 0,
  208. HDMI_PACKETREPEATON = 1,
  209. HDMI_PACKETREPEATOFF = 0
  210. };
  211. enum hdmi_audio_i2s_config {
  212. HDMI_AUDIO_I2S_MSB_SHIFTED_FIRST = 0,
  213. HDMI_AUDIO_I2S_LSB_SHIFTED_FIRST = 1,
  214. HDMI_AUDIO_I2S_SCK_EDGE_FALLING = 0,
  215. HDMI_AUDIO_I2S_SCK_EDGE_RISING = 1,
  216. HDMI_AUDIO_I2S_VBIT_FOR_PCM = 0,
  217. HDMI_AUDIO_I2S_VBIT_FOR_COMPRESSED = 1,
  218. HDMI_AUDIO_I2S_FIRST_BIT_SHIFT = 0,
  219. HDMI_AUDIO_I2S_FIRST_BIT_NO_SHIFT = 1,
  220. HDMI_AUDIO_I2S_SD0_EN = 1,
  221. HDMI_AUDIO_I2S_SD1_EN = 1 << 1,
  222. HDMI_AUDIO_I2S_SD2_EN = 1 << 2,
  223. HDMI_AUDIO_I2S_SD3_EN = 1 << 3,
  224. };
  225. struct hdmi_core_video_config {
  226. enum hdmi_core_inputbus_width ip_bus_width;
  227. enum hdmi_core_dither_trunc op_dither_truc;
  228. enum hdmi_core_deepcolor_ed deep_color_pkt;
  229. enum hdmi_core_packet_mode pkt_mode;
  230. enum hdmi_core_hdmi_dvi hdmi_dvi;
  231. enum hdmi_core_tclkselclkmult tclk_sel_clkmult;
  232. };
  233. struct hdmi_core_packet_enable_repeat {
  234. u32 audio_pkt;
  235. u32 audio_pkt_repeat;
  236. u32 avi_infoframe;
  237. u32 avi_infoframe_repeat;
  238. u32 gen_cntrl_pkt;
  239. u32 gen_cntrl_pkt_repeat;
  240. u32 generic_pkt;
  241. u32 generic_pkt_repeat;
  242. };
  243. int hdmi4_read_edid(struct hdmi_core_data *core, u8 *edid, int len);
  244. void hdmi4_configure(struct hdmi_core_data *core, struct hdmi_wp_data *wp,
  245. struct hdmi_config *cfg);
  246. void hdmi4_core_dump(struct hdmi_core_data *core, struct seq_file *s);
  247. int hdmi4_core_init(struct platform_device *pdev, struct hdmi_core_data *core);
  248. int hdmi4_audio_start(struct hdmi_core_data *core, struct hdmi_wp_data *wp);
  249. void hdmi4_audio_stop(struct hdmi_core_data *core, struct hdmi_wp_data *wp);
  250. int hdmi4_audio_config(struct hdmi_core_data *core, struct hdmi_wp_data *wp,
  251. struct omap_dss_audio *audio, u32 pclk);
  252. #endif