hdmi.h 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575
  1. /*
  2. * Copyright (C) 2012 Avionic Design GmbH
  3. * Copyright (C) 2012 NVIDIA CORPORATION. All rights reserved.
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License version 2 as
  7. * published by the Free Software Foundation.
  8. */
  9. #ifndef TEGRA_HDMI_H
  10. #define TEGRA_HDMI_H 1
  11. #define HDMI_INFOFRAME_TYPE_VENDOR 0x81
  12. #define HDMI_INFOFRAME_TYPE_AVI 0x82
  13. #define HDMI_INFOFRAME_TYPE_SPD 0x83
  14. #define HDMI_INFOFRAME_TYPE_AUDIO 0x84
  15. #define HDMI_INFOFRAME_TYPE_MPEG_SRC 0x85
  16. #define HDMI_INFOFRAME_TYPE_NTSC_VBI 0x86
  17. /* all fields little endian */
  18. struct hdmi_avi_infoframe {
  19. /* PB0 */
  20. u8 csum;
  21. /* PB1 */
  22. unsigned s:2; /* scan information */
  23. unsigned b:2; /* bar info data valid */
  24. unsigned a:1; /* active info present */
  25. unsigned y:2; /* RGB or YCbCr */
  26. unsigned res1:1;
  27. /* PB2 */
  28. unsigned r:4; /* active format aspect ratio */
  29. unsigned m:2; /* picture aspect ratio */
  30. unsigned c:2; /* colorimetry */
  31. /* PB3 */
  32. unsigned sc:2; /* scan information */
  33. unsigned q:2; /* quantization range */
  34. unsigned ec:3; /* extended colorimetry */
  35. unsigned itc:1; /* it content */
  36. /* PB4 */
  37. unsigned vic:7; /* video format id code */
  38. unsigned res4:1;
  39. /* PB5 */
  40. unsigned pr:4; /* pixel repetition factor */
  41. unsigned cn:2; /* it content type*/
  42. unsigned yq:2; /* ycc quantization range */
  43. /* PB6-7 */
  44. u16 top_bar_end_line;
  45. /* PB8-9 */
  46. u16 bot_bar_start_line;
  47. /* PB10-11 */
  48. u16 left_bar_end_pixel;
  49. /* PB12-13 */
  50. u16 right_bar_start_pixel;
  51. } __packed;
  52. #define HDMI_AVI_VERSION 0x02
  53. #define HDMI_AVI_Y_RGB 0x0
  54. #define HDMI_AVI_Y_YCBCR_422 0x1
  55. #define HDMI_AVI_Y_YCBCR_444 0x2
  56. #define HDMI_AVI_B_VERT 0x1
  57. #define HDMI_AVI_B_HORIZ 0x2
  58. #define HDMI_AVI_S_NONE 0x0
  59. #define HDMI_AVI_S_OVERSCAN 0x1
  60. #define HDMI_AVI_S_UNDERSCAN 0x2
  61. #define HDMI_AVI_C_NONE 0x0
  62. #define HDMI_AVI_C_SMPTE 0x1
  63. #define HDMI_AVI_C_ITU_R 0x2
  64. #define HDMI_AVI_C_EXTENDED 0x4
  65. #define HDMI_AVI_M_4_3 0x1
  66. #define HDMI_AVI_M_16_9 0x2
  67. #define HDMI_AVI_R_SAME 0x8
  68. #define HDMI_AVI_R_4_3_CENTER 0x9
  69. #define HDMI_AVI_R_16_9_CENTER 0xa
  70. #define HDMI_AVI_R_14_9_CENTER 0xb
  71. /* all fields little endian */
  72. struct hdmi_audio_infoframe {
  73. /* PB0 */
  74. u8 csum;
  75. /* PB1 */
  76. unsigned cc:3; /* channel count */
  77. unsigned res1:1;
  78. unsigned ct:4; /* coding type */
  79. /* PB2 */
  80. unsigned ss:2; /* sample size */
  81. unsigned sf:3; /* sample frequency */
  82. unsigned res2:3;
  83. /* PB3 */
  84. unsigned cxt:5; /* coding extention type */
  85. unsigned res3:3;
  86. /* PB4 */
  87. u8 ca; /* channel/speaker allocation */
  88. /* PB5 */
  89. unsigned res5:3;
  90. unsigned lsv:4; /* level shift value */
  91. unsigned dm_inh:1; /* downmix inhibit */
  92. /* PB6-10 reserved */
  93. u8 res6;
  94. u8 res7;
  95. u8 res8;
  96. u8 res9;
  97. u8 res10;
  98. } __packed;
  99. #define HDMI_AUDIO_VERSION 0x01
  100. #define HDMI_AUDIO_CC_STREAM 0x0 /* specified by audio stream */
  101. #define HDMI_AUDIO_CC_2 0x1
  102. #define HDMI_AUDIO_CC_3 0x2
  103. #define HDMI_AUDIO_CC_4 0x3
  104. #define HDMI_AUDIO_CC_5 0x4
  105. #define HDMI_AUDIO_CC_6 0x5
  106. #define HDMI_AUDIO_CC_7 0x6
  107. #define HDMI_AUDIO_CC_8 0x7
  108. #define HDMI_AUDIO_CT_STREAM 0x0 /* specified by audio stream */
  109. #define HDMI_AUDIO_CT_PCM 0x1
  110. #define HDMI_AUDIO_CT_AC3 0x2
  111. #define HDMI_AUDIO_CT_MPEG1 0x3
  112. #define HDMI_AUDIO_CT_MP3 0x4
  113. #define HDMI_AUDIO_CT_MPEG2 0x5
  114. #define HDMI_AUDIO_CT_AAC_LC 0x6
  115. #define HDMI_AUDIO_CT_DTS 0x7
  116. #define HDMI_AUDIO_CT_ATRAC 0x8
  117. #define HDMI_AUDIO_CT_DSD 0x9
  118. #define HDMI_AUDIO_CT_E_AC3 0xa
  119. #define HDMI_AUDIO_CT_DTS_HD 0xb
  120. #define HDMI_AUDIO_CT_MLP 0xc
  121. #define HDMI_AUDIO_CT_DST 0xd
  122. #define HDMI_AUDIO_CT_WMA_PRO 0xe
  123. #define HDMI_AUDIO_CT_CXT 0xf
  124. #define HDMI_AUDIO_SF_STREAM 0x0 /* specified by audio stream */
  125. #define HDMI_AUIDO_SF_32K 0x1
  126. #define HDMI_AUDIO_SF_44_1K 0x2
  127. #define HDMI_AUDIO_SF_48K 0x3
  128. #define HDMI_AUDIO_SF_88_2K 0x4
  129. #define HDMI_AUDIO_SF_96K 0x5
  130. #define HDMI_AUDIO_SF_176_4K 0x6
  131. #define HDMI_AUDIO_SF_192K 0x7
  132. #define HDMI_AUDIO_SS_STREAM 0x0 /* specified by audio stream */
  133. #define HDMI_AUDIO_SS_16BIT 0x1
  134. #define HDMI_AUDIO_SS_20BIT 0x2
  135. #define HDMI_AUDIO_SS_24BIT 0x3
  136. #define HDMI_AUDIO_CXT_CT 0x0 /* refer to coding in CT */
  137. #define HDMI_AUDIO_CXT_HE_AAC 0x1
  138. #define HDMI_AUDIO_CXT_HE_AAC_V2 0x2
  139. #define HDMI_AUDIO_CXT_MPEG_SURROUND 0x3
  140. /* all fields little endian */
  141. struct hdmi_stereo_infoframe {
  142. /* PB0 */
  143. u8 csum;
  144. /* PB1 */
  145. u8 regid0;
  146. /* PB2 */
  147. u8 regid1;
  148. /* PB3 */
  149. u8 regid2;
  150. /* PB4 */
  151. unsigned res1:5;
  152. unsigned hdmi_video_format:3;
  153. /* PB5 */
  154. unsigned res2:4;
  155. unsigned _3d_structure:4;
  156. /* PB6*/
  157. unsigned res3:4;
  158. unsigned _3d_ext_data:4;
  159. } __packed;
  160. #define HDMI_VENDOR_VERSION 0x01
  161. /* register definitions */
  162. #define HDMI_CTXSW 0x00
  163. #define HDMI_NV_PDISP_SOR_STATE0 0x01
  164. #define SOR_STATE_UPDATE (1 << 0)
  165. #define HDMI_NV_PDISP_SOR_STATE1 0x02
  166. #define SOR_STATE_ASY_HEAD_OPMODE_AWAKE (2 << 0)
  167. #define SOR_STATE_ASY_ORMODE_NORMAL (1 << 2)
  168. #define SOR_STATE_ATTACHED (1 << 3)
  169. #define HDMI_NV_PDISP_SOR_STATE2 0x03
  170. #define SOR_STATE_ASY_OWNER_NONE (0 << 0)
  171. #define SOR_STATE_ASY_OWNER_HEAD0 (1 << 0)
  172. #define SOR_STATE_ASY_SUBOWNER_NONE (0 << 4)
  173. #define SOR_STATE_ASY_SUBOWNER_SUBHEAD0 (1 << 4)
  174. #define SOR_STATE_ASY_SUBOWNER_SUBHEAD1 (2 << 4)
  175. #define SOR_STATE_ASY_SUBOWNER_BOTH (3 << 4)
  176. #define SOR_STATE_ASY_CRCMODE_ACTIVE (0 << 6)
  177. #define SOR_STATE_ASY_CRCMODE_COMPLETE (1 << 6)
  178. #define SOR_STATE_ASY_CRCMODE_NON_ACTIVE (2 << 6)
  179. #define SOR_STATE_ASY_PROTOCOL_SINGLE_TMDS_A (1 << 8)
  180. #define SOR_STATE_ASY_PROTOCOL_CUSTOM (15 << 8)
  181. #define SOR_STATE_ASY_HSYNCPOL_POS (0 << 12)
  182. #define SOR_STATE_ASY_HSYNCPOL_NEG (1 << 12)
  183. #define SOR_STATE_ASY_VSYNCPOL_POS (0 << 13)
  184. #define SOR_STATE_ASY_VSYNCPOL_NEG (1 << 13)
  185. #define SOR_STATE_ASY_DEPOL_POS (0 << 14)
  186. #define SOR_STATE_ASY_DEPOL_NEG (1 << 14)
  187. #define HDMI_NV_PDISP_RG_HDCP_AN_MSB 0x04
  188. #define HDMI_NV_PDISP_RG_HDCP_AN_LSB 0x05
  189. #define HDMI_NV_PDISP_RG_HDCP_CN_MSB 0x06
  190. #define HDMI_NV_PDISP_RG_HDCP_CN_LSB 0x07
  191. #define HDMI_NV_PDISP_RG_HDCP_AKSV_MSB 0x08
  192. #define HDMI_NV_PDISP_RG_HDCP_AKSV_LSB 0x09
  193. #define HDMI_NV_PDISP_RG_HDCP_BKSV_MSB 0x0a
  194. #define HDMI_NV_PDISP_RG_HDCP_BKSV_LSB 0x0b
  195. #define HDMI_NV_PDISP_RG_HDCP_CKSV_MSB 0x0c
  196. #define HDMI_NV_PDISP_RG_HDCP_CKSV_LSB 0x0d
  197. #define HDMI_NV_PDISP_RG_HDCP_DKSV_MSB 0x0e
  198. #define HDMI_NV_PDISP_RG_HDCP_DKSV_LSB 0x0f
  199. #define HDMI_NV_PDISP_RG_HDCP_CTRL 0x10
  200. #define HDMI_NV_PDISP_RG_HDCP_CMODE 0x11
  201. #define HDMI_NV_PDISP_RG_HDCP_MPRIME_MSB 0x12
  202. #define HDMI_NV_PDISP_RG_HDCP_MPRIME_LSB 0x13
  203. #define HDMI_NV_PDISP_RG_HDCP_SPRIME_MSB 0x14
  204. #define HDMI_NV_PDISP_RG_HDCP_SPRIME_LSB2 0x15
  205. #define HDMI_NV_PDISP_RG_HDCP_SPRIME_LSB1 0x16
  206. #define HDMI_NV_PDISP_RG_HDCP_RI 0x17
  207. #define HDMI_NV_PDISP_RG_HDCP_CS_MSB 0x18
  208. #define HDMI_NV_PDISP_RG_HDCP_CS_LSB 0x19
  209. #define HDMI_NV_PDISP_HDMI_AUDIO_EMU0 0x1a
  210. #define HDMI_NV_PDISP_HDMI_AUDIO_EMU_RDATA0 0x1b
  211. #define HDMI_NV_PDISP_HDMI_AUDIO_EMU1 0x1c
  212. #define HDMI_NV_PDISP_HDMI_AUDIO_EMU2 0x1d
  213. #define HDMI_NV_PDISP_HDMI_AUDIO_INFOFRAME_CTRL 0x1e
  214. #define HDMI_NV_PDISP_HDMI_AUDIO_INFOFRAME_STATUS 0x1f
  215. #define HDMI_NV_PDISP_HDMI_AUDIO_INFOFRAME_HEADER 0x20
  216. #define HDMI_NV_PDISP_HDMI_AUDIO_INFOFRAME_SUBPACK0_LOW 0x21
  217. #define HDMI_NV_PDISP_HDMI_AUDIO_INFOFRAME_SUBPACK0_HIGH 0x22
  218. #define HDMI_NV_PDISP_HDMI_AVI_INFOFRAME_CTRL 0x23
  219. #define HDMI_NV_PDISP_HDMI_AVI_INFOFRAME_STATUS 0x24
  220. #define HDMI_NV_PDISP_HDMI_AVI_INFOFRAME_HEADER 0x25
  221. #define HDMI_NV_PDISP_HDMI_AVI_INFOFRAME_SUBPACK0_LOW 0x26
  222. #define HDMI_NV_PDISP_HDMI_AVI_INFOFRAME_SUBPACK0_HIGH 0x27
  223. #define HDMI_NV_PDISP_HDMI_AVI_INFOFRAME_SUBPACK1_LOW 0x28
  224. #define HDMI_NV_PDISP_HDMI_AVI_INFOFRAME_SUBPACK1_HIGH 0x29
  225. #define INFOFRAME_CTRL_ENABLE (1 << 0)
  226. #define INFOFRAME_HEADER_TYPE(x) (((x) & 0xff) << 0)
  227. #define INFOFRAME_HEADER_VERSION(x) (((x) & 0xff) << 8)
  228. #define INFOFRAME_HEADER_LEN(x) (((x) & 0x0f) << 16)
  229. #define HDMI_NV_PDISP_HDMI_GENERIC_CTRL 0x2a
  230. #define GENERIC_CTRL_ENABLE (1 << 0)
  231. #define GENERIC_CTRL_OTHER (1 << 4)
  232. #define GENERIC_CTRL_SINGLE (1 << 8)
  233. #define GENERIC_CTRL_HBLANK (1 << 12)
  234. #define GENERIC_CTRL_AUDIO (1 << 16)
  235. #define HDMI_NV_PDISP_HDMI_GENERIC_STATUS 0x2b
  236. #define HDMI_NV_PDISP_HDMI_GENERIC_HEADER 0x2c
  237. #define HDMI_NV_PDISP_HDMI_GENERIC_SUBPACK0_LOW 0x2d
  238. #define HDMI_NV_PDISP_HDMI_GENERIC_SUBPACK0_HIGH 0x2e
  239. #define HDMI_NV_PDISP_HDMI_GENERIC_SUBPACK1_LOW 0x2f
  240. #define HDMI_NV_PDISP_HDMI_GENERIC_SUBPACK1_HIGH 0x30
  241. #define HDMI_NV_PDISP_HDMI_GENERIC_SUBPACK2_LOW 0x31
  242. #define HDMI_NV_PDISP_HDMI_GENERIC_SUBPACK2_HIGH 0x32
  243. #define HDMI_NV_PDISP_HDMI_GENERIC_SUBPACK3_LOW 0x33
  244. #define HDMI_NV_PDISP_HDMI_GENERIC_SUBPACK3_HIGH 0x34
  245. #define HDMI_NV_PDISP_HDMI_ACR_CTRL 0x35
  246. #define HDMI_NV_PDISP_HDMI_ACR_0320_SUBPACK_LOW 0x36
  247. #define HDMI_NV_PDISP_HDMI_ACR_0320_SUBPACK_HIGH 0x37
  248. #define HDMI_NV_PDISP_HDMI_ACR_0441_SUBPACK_LOW 0x38
  249. #define HDMI_NV_PDISP_HDMI_ACR_0441_SUBPACK_HIGH 0x39
  250. #define HDMI_NV_PDISP_HDMI_ACR_0882_SUBPACK_LOW 0x3a
  251. #define HDMI_NV_PDISP_HDMI_ACR_0882_SUBPACK_HIGH 0x3b
  252. #define HDMI_NV_PDISP_HDMI_ACR_1764_SUBPACK_LOW 0x3c
  253. #define HDMI_NV_PDISP_HDMI_ACR_1764_SUBPACK_HIGH 0x3d
  254. #define HDMI_NV_PDISP_HDMI_ACR_0480_SUBPACK_LOW 0x3e
  255. #define HDMI_NV_PDISP_HDMI_ACR_0480_SUBPACK_HIGH 0x3f
  256. #define HDMI_NV_PDISP_HDMI_ACR_0960_SUBPACK_LOW 0x40
  257. #define HDMI_NV_PDISP_HDMI_ACR_0960_SUBPACK_HIGH 0x41
  258. #define HDMI_NV_PDISP_HDMI_ACR_1920_SUBPACK_LOW 0x42
  259. #define HDMI_NV_PDISP_HDMI_ACR_1920_SUBPACK_HIGH 0x43
  260. #define ACR_SUBPACK_CTS(x) (((x) & 0xffffff) << 8)
  261. #define ACR_SUBPACK_N(x) (((x) & 0xffffff) << 0)
  262. #define ACR_ENABLE (1 << 31)
  263. #define HDMI_NV_PDISP_HDMI_CTRL 0x44
  264. #define HDMI_CTRL_REKEY(x) (((x) & 0x7f) << 0)
  265. #define HDMI_CTRL_MAX_AC_PACKET(x) (((x) & 0x1f) << 16)
  266. #define HDMI_CTRL_ENABLE (1 << 30)
  267. #define HDMI_NV_PDISP_HDMI_VSYNC_KEEPOUT 0x45
  268. #define HDMI_NV_PDISP_HDMI_VSYNC_WINDOW 0x46
  269. #define VSYNC_WINDOW_END(x) (((x) & 0x3ff) << 0)
  270. #define VSYNC_WINDOW_START(x) (((x) & 0x3ff) << 16)
  271. #define VSYNC_WINDOW_ENABLE (1 << 31)
  272. #define HDMI_NV_PDISP_HDMI_GCP_CTRL 0x47
  273. #define HDMI_NV_PDISP_HDMI_GCP_STATUS 0x48
  274. #define HDMI_NV_PDISP_HDMI_GCP_SUBPACK 0x49
  275. #define HDMI_NV_PDISP_HDMI_CHANNEL_STATUS1 0x4a
  276. #define HDMI_NV_PDISP_HDMI_CHANNEL_STATUS2 0x4b
  277. #define HDMI_NV_PDISP_HDMI_EMU0 0x4c
  278. #define HDMI_NV_PDISP_HDMI_EMU1 0x4d
  279. #define HDMI_NV_PDISP_HDMI_EMU1_RDATA 0x4e
  280. #define HDMI_NV_PDISP_HDMI_SPARE 0x4f
  281. #define SPARE_HW_CTS (1 << 0)
  282. #define SPARE_FORCE_SW_CTS (1 << 1)
  283. #define SPARE_CTS_RESET_VAL(x) (((x) & 0x7) << 16)
  284. #define HDMI_NV_PDISP_HDMI_SPDIF_CHN_STATUS1 0x50
  285. #define HDMI_NV_PDISP_HDMI_SPDIF_CHN_STATUS2 0x51
  286. #define HDMI_NV_PDISP_HDMI_HDCPRIF_ROM_CTRL 0x53
  287. #define HDMI_NV_PDISP_SOR_CAP 0x54
  288. #define HDMI_NV_PDISP_SOR_PWR 0x55
  289. #define SOR_PWR_NORMAL_STATE_PD (0 << 0)
  290. #define SOR_PWR_NORMAL_STATE_PU (1 << 0)
  291. #define SOR_PWR_NORMAL_START_NORMAL (0 << 1)
  292. #define SOR_PWR_NORMAL_START_ALT (1 << 1)
  293. #define SOR_PWR_SAFE_STATE_PD (0 << 16)
  294. #define SOR_PWR_SAFE_STATE_PU (1 << 16)
  295. #define SOR_PWR_SETTING_NEW_DONE (0 << 31)
  296. #define SOR_PWR_SETTING_NEW_PENDING (1 << 31)
  297. #define SOR_PWR_SETTING_NEW_TRIGGER (1 << 31)
  298. #define HDMI_NV_PDISP_SOR_TEST 0x56
  299. #define HDMI_NV_PDISP_SOR_PLL0 0x57
  300. #define SOR_PLL_PWR (1 << 0)
  301. #define SOR_PLL_PDBG (1 << 1)
  302. #define SOR_PLL_VCAPD (1 << 2)
  303. #define SOR_PLL_PDPORT (1 << 3)
  304. #define SOR_PLL_RESISTORSEL (1 << 4)
  305. #define SOR_PLL_PULLDOWN (1 << 5)
  306. #define SOR_PLL_VCOCAP(x) (((x) & 0xf) << 8)
  307. #define SOR_PLL_BG_V17_S(x) (((x) & 0xf) << 12)
  308. #define SOR_PLL_FILTER(x) (((x) & 0xf) << 16)
  309. #define SOR_PLL_ICHPMP(x) (((x) & 0xf) << 24)
  310. #define SOR_PLL_TX_REG_LOAD(x) (((x) & 0xf) << 28)
  311. #define HDMI_NV_PDISP_SOR_PLL1 0x58
  312. #define SOR_PLL_TMDS_TERM_ENABLE (1 << 8)
  313. #define SOR_PLL_TMDS_TERMADJ(x) (((x) & 0xf) << 9)
  314. #define SOR_PLL_LOADADJ(x) (((x) & 0xf) << 20)
  315. #define SOR_PLL_PE_EN (1 << 28)
  316. #define SOR_PLL_HALF_FULL_PE (1 << 29)
  317. #define SOR_PLL_S_D_PIN_PE (1 << 30)
  318. #define HDMI_NV_PDISP_SOR_PLL2 0x59
  319. #define HDMI_NV_PDISP_SOR_CSTM 0x5a
  320. #define SOR_CSTM_ROTCLK(x) (((x) & 0xf) << 24)
  321. #define HDMI_NV_PDISP_SOR_LVDS 0x5b
  322. #define HDMI_NV_PDISP_SOR_CRCA 0x5c
  323. #define HDMI_NV_PDISP_SOR_CRCB 0x5d
  324. #define HDMI_NV_PDISP_SOR_BLANK 0x5e
  325. #define HDMI_NV_PDISP_SOR_SEQ_CTL 0x5f
  326. #define SOR_SEQ_CTL_PU_PC(x) (((x) & 0xf) << 0)
  327. #define SOR_SEQ_PU_PC_ALT(x) (((x) & 0xf) << 4)
  328. #define SOR_SEQ_PD_PC(x) (((x) & 0xf) << 8)
  329. #define SOR_SEQ_PD_PC_ALT(x) (((x) & 0xf) << 12)
  330. #define SOR_SEQ_PC(x) (((x) & 0xf) << 16)
  331. #define SOR_SEQ_STATUS (1 << 28)
  332. #define SOR_SEQ_SWITCH (1 << 30)
  333. #define HDMI_NV_PDISP_SOR_SEQ_INST(x) (0x60 + (x))
  334. #define SOR_SEQ_INST_WAIT_TIME(x) (((x) & 0x3ff) << 0)
  335. #define SOR_SEQ_INST_WAIT_UNITS_VSYNC (2 << 12)
  336. #define SOR_SEQ_INST_HALT (1 << 15)
  337. #define SOR_SEQ_INST_PIN_A_LOW (0 << 21)
  338. #define SOR_SEQ_INST_PIN_A_HIGH (1 << 21)
  339. #define SOR_SEQ_INST_PIN_B_LOW (0 << 22)
  340. #define SOR_SEQ_INST_PIN_B_HIGH (1 << 22)
  341. #define SOR_SEQ_INST_DRIVE_PWM_OUT_LO (1 << 23)
  342. #define HDMI_NV_PDISP_SOR_VCRCA0 0x72
  343. #define HDMI_NV_PDISP_SOR_VCRCA1 0x73
  344. #define HDMI_NV_PDISP_SOR_CCRCA0 0x74
  345. #define HDMI_NV_PDISP_SOR_CCRCA1 0x75
  346. #define HDMI_NV_PDISP_SOR_EDATAA0 0x76
  347. #define HDMI_NV_PDISP_SOR_EDATAA1 0x77
  348. #define HDMI_NV_PDISP_SOR_COUNTA0 0x78
  349. #define HDMI_NV_PDISP_SOR_COUNTA1 0x79
  350. #define HDMI_NV_PDISP_SOR_DEBUGA0 0x7a
  351. #define HDMI_NV_PDISP_SOR_DEBUGA1 0x7b
  352. #define HDMI_NV_PDISP_SOR_TRIG 0x7c
  353. #define HDMI_NV_PDISP_SOR_MSCHECK 0x7d
  354. #define HDMI_NV_PDISP_SOR_LANE_DRIVE_CURRENT 0x7e
  355. #define DRIVE_CURRENT_LANE0(x) (((x) & 0x3f) << 0)
  356. #define DRIVE_CURRENT_LANE1(x) (((x) & 0x3f) << 8)
  357. #define DRIVE_CURRENT_LANE2(x) (((x) & 0x3f) << 16)
  358. #define DRIVE_CURRENT_LANE3(x) (((x) & 0x3f) << 24)
  359. #define DRIVE_CURRENT_FUSE_OVERRIDE (1 << 31)
  360. #define DRIVE_CURRENT_1_500_mA 0x00
  361. #define DRIVE_CURRENT_1_875_mA 0x01
  362. #define DRIVE_CURRENT_2_250_mA 0x02
  363. #define DRIVE_CURRENT_2_625_mA 0x03
  364. #define DRIVE_CURRENT_3_000_mA 0x04
  365. #define DRIVE_CURRENT_3_375_mA 0x05
  366. #define DRIVE_CURRENT_3_750_mA 0x06
  367. #define DRIVE_CURRENT_4_125_mA 0x07
  368. #define DRIVE_CURRENT_4_500_mA 0x08
  369. #define DRIVE_CURRENT_4_875_mA 0x09
  370. #define DRIVE_CURRENT_5_250_mA 0x0a
  371. #define DRIVE_CURRENT_5_625_mA 0x0b
  372. #define DRIVE_CURRENT_6_000_mA 0x0c
  373. #define DRIVE_CURRENT_6_375_mA 0x0d
  374. #define DRIVE_CURRENT_6_750_mA 0x0e
  375. #define DRIVE_CURRENT_7_125_mA 0x0f
  376. #define DRIVE_CURRENT_7_500_mA 0x10
  377. #define DRIVE_CURRENT_7_875_mA 0x11
  378. #define DRIVE_CURRENT_8_250_mA 0x12
  379. #define DRIVE_CURRENT_8_625_mA 0x13
  380. #define DRIVE_CURRENT_9_000_mA 0x14
  381. #define DRIVE_CURRENT_9_375_mA 0x15
  382. #define DRIVE_CURRENT_9_750_mA 0x16
  383. #define DRIVE_CURRENT_10_125_mA 0x17
  384. #define DRIVE_CURRENT_10_500_mA 0x18
  385. #define DRIVE_CURRENT_10_875_mA 0x19
  386. #define DRIVE_CURRENT_11_250_mA 0x1a
  387. #define DRIVE_CURRENT_11_625_mA 0x1b
  388. #define DRIVE_CURRENT_12_000_mA 0x1c
  389. #define DRIVE_CURRENT_12_375_mA 0x1d
  390. #define DRIVE_CURRENT_12_750_mA 0x1e
  391. #define DRIVE_CURRENT_13_125_mA 0x1f
  392. #define DRIVE_CURRENT_13_500_mA 0x20
  393. #define DRIVE_CURRENT_13_875_mA 0x21
  394. #define DRIVE_CURRENT_14_250_mA 0x22
  395. #define DRIVE_CURRENT_14_625_mA 0x23
  396. #define DRIVE_CURRENT_15_000_mA 0x24
  397. #define DRIVE_CURRENT_15_375_mA 0x25
  398. #define DRIVE_CURRENT_15_750_mA 0x26
  399. #define DRIVE_CURRENT_16_125_mA 0x27
  400. #define DRIVE_CURRENT_16_500_mA 0x28
  401. #define DRIVE_CURRENT_16_875_mA 0x29
  402. #define DRIVE_CURRENT_17_250_mA 0x2a
  403. #define DRIVE_CURRENT_17_625_mA 0x2b
  404. #define DRIVE_CURRENT_18_000_mA 0x2c
  405. #define DRIVE_CURRENT_18_375_mA 0x2d
  406. #define DRIVE_CURRENT_18_750_mA 0x2e
  407. #define DRIVE_CURRENT_19_125_mA 0x2f
  408. #define DRIVE_CURRENT_19_500_mA 0x30
  409. #define DRIVE_CURRENT_19_875_mA 0x31
  410. #define DRIVE_CURRENT_20_250_mA 0x32
  411. #define DRIVE_CURRENT_20_625_mA 0x33
  412. #define DRIVE_CURRENT_21_000_mA 0x34
  413. #define DRIVE_CURRENT_21_375_mA 0x35
  414. #define DRIVE_CURRENT_21_750_mA 0x36
  415. #define DRIVE_CURRENT_22_125_mA 0x37
  416. #define DRIVE_CURRENT_22_500_mA 0x38
  417. #define DRIVE_CURRENT_22_875_mA 0x39
  418. #define DRIVE_CURRENT_23_250_mA 0x3a
  419. #define DRIVE_CURRENT_23_625_mA 0x3b
  420. #define DRIVE_CURRENT_24_000_mA 0x3c
  421. #define DRIVE_CURRENT_24_375_mA 0x3d
  422. #define DRIVE_CURRENT_24_750_mA 0x3e
  423. #define HDMI_NV_PDISP_AUDIO_DEBUG0 0x7f
  424. #define HDMI_NV_PDISP_AUDIO_DEBUG1 0x80
  425. #define HDMI_NV_PDISP_AUDIO_DEBUG2 0x81
  426. #define HDMI_NV_PDISP_AUDIO_FS(x) (0x82 + (x))
  427. #define AUDIO_FS_LOW(x) (((x) & 0xfff) << 0)
  428. #define AUDIO_FS_HIGH(x) (((x) & 0xfff) << 16)
  429. #define HDMI_NV_PDISP_AUDIO_PULSE_WIDTH 0x89
  430. #define HDMI_NV_PDISP_AUDIO_THRESHOLD 0x8a
  431. #define HDMI_NV_PDISP_AUDIO_CNTRL0 0x8b
  432. #define AUDIO_CNTRL0_ERROR_TOLERANCE(x) (((x) & 0xff) << 0)
  433. #define AUDIO_CNTRL0_SOURCE_SELECT_AUTO (0 << 20)
  434. #define AUDIO_CNTRL0_SOURCE_SELECT_SPDIF (1 << 20)
  435. #define AUDIO_CNTRL0_SOURCE_SELECT_HDAL (2 << 20)
  436. #define AUDIO_CNTRL0_FRAMES_PER_BLOCK(x) (((x) & 0xff) << 24)
  437. #define HDMI_NV_PDISP_AUDIO_N 0x8c
  438. #define AUDIO_N_VALUE(x) (((x) & 0xfffff) << 0)
  439. #define AUDIO_N_RESETF (1 << 20)
  440. #define AUDIO_N_GENERATE_NORMAL (0 << 24)
  441. #define AUDIO_N_GENERATE_ALTERNATE (1 << 24)
  442. #define HDMI_NV_PDISP_HDCPRIF_ROM_TIMING 0x94
  443. #define HDMI_NV_PDISP_SOR_REFCLK 0x95
  444. #define SOR_REFCLK_DIV_INT(x) (((x) & 0xff) << 8)
  445. #define SOR_REFCLK_DIV_FRAC(x) (((x) & 0x03) << 6)
  446. #define HDMI_NV_PDISP_CRC_CONTROL 0x96
  447. #define HDMI_NV_PDISP_INPUT_CONTROL 0x97
  448. #define HDMI_SRC_DISPLAYA (0 << 0)
  449. #define HDMI_SRC_DISPLAYB (1 << 0)
  450. #define ARM_VIDEO_RANGE_FULL (0 << 1)
  451. #define ARM_VIDEO_RANGE_LIMITED (1 << 1)
  452. #define HDMI_NV_PDISP_SCRATCH 0x98
  453. #define HDMI_NV_PDISP_PE_CURRENT 0x99
  454. #define PE_CURRENT0(x) (((x) & 0xf) << 0)
  455. #define PE_CURRENT1(x) (((x) & 0xf) << 8)
  456. #define PE_CURRENT2(x) (((x) & 0xf) << 16)
  457. #define PE_CURRENT3(x) (((x) & 0xf) << 24)
  458. #define PE_CURRENT_0_0_mA 0x0
  459. #define PE_CURRENT_0_5_mA 0x1
  460. #define PE_CURRENT_1_0_mA 0x2
  461. #define PE_CURRENT_1_5_mA 0x3
  462. #define PE_CURRENT_2_0_mA 0x4
  463. #define PE_CURRENT_2_5_mA 0x5
  464. #define PE_CURRENT_3_0_mA 0x6
  465. #define PE_CURRENT_3_5_mA 0x7
  466. #define PE_CURRENT_4_0_mA 0x8
  467. #define PE_CURRENT_4_5_mA 0x9
  468. #define PE_CURRENT_5_0_mA 0xa
  469. #define PE_CURRENT_5_5_mA 0xb
  470. #define PE_CURRENT_6_0_mA 0xc
  471. #define PE_CURRENT_6_5_mA 0xd
  472. #define PE_CURRENT_7_0_mA 0xe
  473. #define PE_CURRENT_7_5_mA 0xf
  474. #define HDMI_NV_PDISP_KEY_CTRL 0x9a
  475. #define HDMI_NV_PDISP_KEY_DEBUG0 0x9b
  476. #define HDMI_NV_PDISP_KEY_DEBUG1 0x9c
  477. #define HDMI_NV_PDISP_KEY_DEBUG2 0x9d
  478. #define HDMI_NV_PDISP_KEY_HDCP_KEY_0 0x9e
  479. #define HDMI_NV_PDISP_KEY_HDCP_KEY_1 0x9f
  480. #define HDMI_NV_PDISP_KEY_HDCP_KEY_2 0xa0
  481. #define HDMI_NV_PDISP_KEY_HDCP_KEY_3 0xa1
  482. #define HDMI_NV_PDISP_KEY_HDCP_KEY_TRIG 0xa2
  483. #define HDMI_NV_PDISP_KEY_SKEY_INDEX 0xa3
  484. #define HDMI_NV_PDISP_SOR_AUDIO_CNTRL0 0xac
  485. #define AUDIO_CNTRL0_INJECT_NULLSMPL (1 << 29)
  486. #define HDMI_NV_PDISP_SOR_AUDIO_HDA_ELD_BUFWR 0xbc
  487. #define HDMI_NV_PDISP_SOR_AUDIO_HDA_PRESENSE 0xbd
  488. #define HDMI_NV_PDISP_SOR_AUDIO_AVAL_0320 0xbf
  489. #define HDMI_NV_PDISP_SOR_AUDIO_AVAL_0441 0xc0
  490. #define HDMI_NV_PDISP_SOR_AUDIO_AVAL_0882 0xc1
  491. #define HDMI_NV_PDISP_SOR_AUDIO_AVAL_1764 0xc2
  492. #define HDMI_NV_PDISP_SOR_AUDIO_AVAL_0480 0xc3
  493. #define HDMI_NV_PDISP_SOR_AUDIO_AVAL_0960 0xc4
  494. #define HDMI_NV_PDISP_SOR_AUDIO_AVAL_1920 0xc5
  495. #define HDMI_NV_PDISP_SOR_AUDIO_AVAL_DEFAULT 0xc5
  496. #endif /* TEGRA_HDMI_H */