dc.h 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545
  1. /*
  2. * (C) Copyright 2010
  3. * NVIDIA Corporation <www.nvidia.com>
  4. *
  5. * See file CREDITS for list of people who contributed to this
  6. * project.
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public License as
  10. * published by the Free Software Foundation; either version 2 of
  11. * the License, or (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  21. * MA 02111-1307 USA
  22. */
  23. #ifndef __ASM_ARCH_TEGRA_DC_H
  24. #define __ASM_ARCH_TEGRA_DC_H
  25. /* Register definitions for the Tegra display controller */
  26. /* CMD register 0x000 ~ 0x43 */
  27. struct dc_cmd_reg {
  28. /* Address 0x000 ~ 0x002 */
  29. uint gen_incr_syncpt; /* _CMD_GENERAL_INCR_SYNCPT_0 */
  30. uint gen_incr_syncpt_ctrl; /* _CMD_GENERAL_INCR_SYNCPT_CNTRL_0 */
  31. uint gen_incr_syncpt_err; /* _CMD_GENERAL_INCR_SYNCPT_ERROR_0 */
  32. uint reserved0[5]; /* reserved_0[5] */
  33. /* Address 0x008 ~ 0x00a */
  34. uint win_a_incr_syncpt; /* _CMD_WIN_A_INCR_SYNCPT_0 */
  35. uint win_a_incr_syncpt_ctrl; /* _CMD_WIN_A_INCR_SYNCPT_CNTRL_0 */
  36. uint win_a_incr_syncpt_err; /* _CMD_WIN_A_INCR_SYNCPT_ERROR_0 */
  37. uint reserved1[5]; /* reserved_1[5] */
  38. /* Address 0x010 ~ 0x012 */
  39. uint win_b_incr_syncpt; /* _CMD_WIN_B_INCR_SYNCPT_0 */
  40. uint win_b_incr_syncpt_ctrl; /* _CMD_WIN_B_INCR_SYNCPT_CNTRL_0 */
  41. uint win_b_incr_syncpt_err; /* _CMD_WIN_B_INCR_SYNCPT_ERROR_0 */
  42. uint reserved2[5]; /* reserved_2[5] */
  43. /* Address 0x018 ~ 0x01a */
  44. uint win_c_incr_syncpt; /* _CMD_WIN_C_INCR_SYNCPT_0 */
  45. uint win_c_incr_syncpt_ctrl; /* _CMD_WIN_C_INCR_SYNCPT_CNTRL_0 */
  46. uint win_c_incr_syncpt_err; /* _CMD_WIN_C_INCR_SYNCPT_ERROR_0 */
  47. uint reserved3[13]; /* reserved_3[13] */
  48. /* Address 0x028 */
  49. uint cont_syncpt_vsync; /* _CMD_CONT_SYNCPT_VSYNC_0 */
  50. uint reserved4[7]; /* reserved_4[7] */
  51. /* Address 0x030 ~ 0x033 */
  52. uint ctxsw; /* _CMD_CTXSW_0 */
  53. uint disp_cmd_opt0; /* _CMD_DISPLAY_COMMAND_OPTION0_0 */
  54. uint disp_cmd; /* _CMD_DISPLAY_COMMAND_0 */
  55. uint sig_raise; /* _CMD_SIGNAL_RAISE_0 */
  56. uint reserved5[2]; /* reserved_0[2] */
  57. /* Address 0x036 ~ 0x03e */
  58. uint disp_pow_ctrl; /* _CMD_DISPLAY_POWER_CONTROL_0 */
  59. uint int_stat; /* _CMD_INT_STATUS_0 */
  60. uint int_mask; /* _CMD_INT_MASK_0 */
  61. uint int_enb; /* _CMD_INT_ENABLE_0 */
  62. uint int_type; /* _CMD_INT_TYPE_0 */
  63. uint int_polarity; /* _CMD_INT_POLARITY_0 */
  64. uint sig_raise1; /* _CMD_SIGNAL_RAISE1_0 */
  65. uint sig_raise2; /* _CMD_SIGNAL_RAISE2_0 */
  66. uint sig_raise3; /* _CMD_SIGNAL_RAISE3_0 */
  67. uint reserved6; /* reserved_6 */
  68. /* Address 0x040 ~ 0x043 */
  69. uint state_access; /* _CMD_STATE_ACCESS_0 */
  70. uint state_ctrl; /* _CMD_STATE_CONTROL_0 */
  71. uint disp_win_header; /* _CMD_DISPLAY_WINDOW_HEADER_0 */
  72. uint reg_act_ctrl; /* _CMD_REG_ACT_CONTROL_0 */
  73. };
  74. enum {
  75. PIN_REG_COUNT = 4,
  76. PIN_OUTPUT_SEL_COUNT = 7,
  77. };
  78. /* COM register 0x300 ~ 0x329 */
  79. struct dc_com_reg {
  80. /* Address 0x300 ~ 0x301 */
  81. uint crc_ctrl; /* _COM_CRC_CONTROL_0 */
  82. uint crc_checksum; /* _COM_CRC_CHECKSUM_0 */
  83. /* _COM_PIN_OUTPUT_ENABLE0/1/2/3_0: Address 0x302 ~ 0x305 */
  84. uint pin_output_enb[PIN_REG_COUNT];
  85. /* _COM_PIN_OUTPUT_POLARITY0/1/2/3_0: Address 0x306 ~ 0x309 */
  86. uint pin_output_polarity[PIN_REG_COUNT];
  87. /* _COM_PIN_OUTPUT_DATA0/1/2/3_0: Address 0x30a ~ 0x30d */
  88. uint pin_output_data[PIN_REG_COUNT];
  89. /* _COM_PIN_INPUT_ENABLE0_0: Address 0x30e ~ 0x311 */
  90. uint pin_input_enb[PIN_REG_COUNT];
  91. /* Address 0x312 ~ 0x313 */
  92. uint pin_input_data0; /* _COM_PIN_INPUT_DATA0_0 */
  93. uint pin_input_data1; /* _COM_PIN_INPUT_DATA1_0 */
  94. /* _COM_PIN_OUTPUT_SELECT0/1/2/3/4/5/6_0: Address 0x314 ~ 0x31a */
  95. uint pin_output_sel[PIN_OUTPUT_SEL_COUNT];
  96. /* Address 0x31b ~ 0x329 */
  97. uint pin_misc_ctrl; /* _COM_PIN_MISC_CONTROL_0 */
  98. uint pm0_ctrl; /* _COM_PM0_CONTROL_0 */
  99. uint pm0_duty_cycle; /* _COM_PM0_DUTY_CYCLE_0 */
  100. uint pm1_ctrl; /* _COM_PM1_CONTROL_0 */
  101. uint pm1_duty_cycle; /* _COM_PM1_DUTY_CYCLE_0 */
  102. uint spi_ctrl; /* _COM_SPI_CONTROL_0 */
  103. uint spi_start_byte; /* _COM_SPI_START_BYTE_0 */
  104. uint hspi_wr_data_ab; /* _COM_HSPI_WRITE_DATA_AB_0 */
  105. uint hspi_wr_data_cd; /* _COM_HSPI_WRITE_DATA_CD */
  106. uint hspi_cs_dc; /* _COM_HSPI_CS_DC_0 */
  107. uint scratch_reg_a; /* _COM_SCRATCH_REGISTER_A_0 */
  108. uint scratch_reg_b; /* _COM_SCRATCH_REGISTER_B_0 */
  109. uint gpio_ctrl; /* _COM_GPIO_CTRL_0 */
  110. uint gpio_debounce_cnt; /* _COM_GPIO_DEBOUNCE_COUNTER_0 */
  111. uint crc_checksum_latched; /* _COM_CRC_CHECKSUM_LATCHED_0 */
  112. };
  113. enum dc_disp_h_pulse_pos {
  114. H_PULSE0_POSITION_A,
  115. H_PULSE0_POSITION_B,
  116. H_PULSE0_POSITION_C,
  117. H_PULSE0_POSITION_D,
  118. H_PULSE0_POSITION_COUNT,
  119. };
  120. struct _disp_h_pulse {
  121. /* _DISP_H_PULSE0/1/2_CONTROL_0 */
  122. uint h_pulse_ctrl;
  123. /* _DISP_H_PULSE0/1/2_POSITION_A/B/C/D_0 */
  124. uint h_pulse_pos[H_PULSE0_POSITION_COUNT];
  125. };
  126. enum dc_disp_v_pulse_pos {
  127. V_PULSE0_POSITION_A,
  128. V_PULSE0_POSITION_B,
  129. V_PULSE0_POSITION_C,
  130. V_PULSE0_POSITION_COUNT,
  131. };
  132. struct _disp_v_pulse0 {
  133. /* _DISP_H_PULSE0/1_CONTROL_0 */
  134. uint v_pulse_ctrl;
  135. /* _DISP_H_PULSE0/1_POSITION_A/B/C_0 */
  136. uint v_pulse_pos[V_PULSE0_POSITION_COUNT];
  137. };
  138. struct _disp_v_pulse2 {
  139. /* _DISP_H_PULSE2/3_CONTROL_0 */
  140. uint v_pulse_ctrl;
  141. /* _DISP_H_PULSE2/3_POSITION_A_0 */
  142. uint v_pulse_pos_a;
  143. };
  144. enum dc_disp_h_pulse_reg {
  145. H_PULSE0,
  146. H_PULSE1,
  147. H_PULSE2,
  148. H_PULSE_COUNT,
  149. };
  150. enum dc_disp_pp_select {
  151. PP_SELECT_A,
  152. PP_SELECT_B,
  153. PP_SELECT_C,
  154. PP_SELECT_D,
  155. PP_SELECT_COUNT,
  156. };
  157. /* DISP register 0x400 ~ 0x4c1 */
  158. struct dc_disp_reg {
  159. /* Address 0x400 ~ 0x40a */
  160. uint disp_signal_opt0; /* _DISP_DISP_SIGNAL_OPTIONS0_0 */
  161. uint disp_signal_opt1; /* _DISP_DISP_SIGNAL_OPTIONS1_0 */
  162. uint disp_win_opt; /* _DISP_DISP_WIN_OPTIONS_0 */
  163. uint mem_high_pri; /* _DISP_MEM_HIGH_PRIORITY_0 */
  164. uint mem_high_pri_timer; /* _DISP_MEM_HIGH_PRIORITY_TIMER_0 */
  165. uint disp_timing_opt; /* _DISP_DISP_TIMING_OPTIONS_0 */
  166. uint ref_to_sync; /* _DISP_REF_TO_SYNC_0 */
  167. uint sync_width; /* _DISP_SYNC_WIDTH_0 */
  168. uint back_porch; /* _DISP_BACK_PORCH_0 */
  169. uint disp_active; /* _DISP_DISP_ACTIVE_0 */
  170. uint front_porch; /* _DISP_FRONT_PORCH_0 */
  171. /* Address 0x40b ~ 0x419: _DISP_H_PULSE0/1/2_ */
  172. struct _disp_h_pulse h_pulse[H_PULSE_COUNT];
  173. /* Address 0x41a ~ 0x421 */
  174. struct _disp_v_pulse0 v_pulse0; /* _DISP_V_PULSE0_ */
  175. struct _disp_v_pulse0 v_pulse1; /* _DISP_V_PULSE1_ */
  176. /* Address 0x422 ~ 0x425 */
  177. struct _disp_v_pulse2 v_pulse3; /* _DISP_V_PULSE2_ */
  178. struct _disp_v_pulse2 v_pulse4; /* _DISP_V_PULSE3_ */
  179. /* Address 0x426 ~ 0x429 */
  180. uint m0_ctrl; /* _DISP_M0_CONTROL_0 */
  181. uint m1_ctrl; /* _DISP_M1_CONTROL_0 */
  182. uint di_ctrl; /* _DISP_DI_CONTROL_0 */
  183. uint pp_ctrl; /* _DISP_PP_CONTROL_0 */
  184. /* Address 0x42a ~ 0x42d: _DISP_PP_SELECT_A/B/C/D_0 */
  185. uint pp_select[PP_SELECT_COUNT];
  186. /* Address 0x42e ~ 0x435 */
  187. uint disp_clk_ctrl; /* _DISP_DISP_CLOCK_CONTROL_0 */
  188. uint disp_interface_ctrl; /* _DISP_DISP_INTERFACE_CONTROL_0 */
  189. uint disp_color_ctrl; /* _DISP_DISP_COLOR_CONTROL_0 */
  190. uint shift_clk_opt; /* _DISP_SHIFT_CLOCK_OPTIONS_0 */
  191. uint data_enable_opt; /* _DISP_DATA_ENABLE_OPTIONS_0 */
  192. uint serial_interface_opt; /* _DISP_SERIAL_INTERFACE_OPTIONS_0 */
  193. uint lcd_spi_opt; /* _DISP_LCD_SPI_OPTIONS_0 */
  194. uint border_color; /* _DISP_BORDER_COLOR_0 */
  195. /* Address 0x436 ~ 0x439 */
  196. uint color_key0_lower; /* _DISP_COLOR_KEY0_LOWER_0 */
  197. uint color_key0_upper; /* _DISP_COLOR_KEY0_UPPER_0 */
  198. uint color_key1_lower; /* _DISP_COLOR_KEY1_LOWER_0 */
  199. uint color_key1_upper; /* _DISP_COLOR_KEY1_UPPER_0 */
  200. uint reserved0[2]; /* reserved_0[2] */
  201. /* Address 0x43c ~ 0x442 */
  202. uint cursor_foreground; /* _DISP_CURSOR_FOREGROUND_0 */
  203. uint cursor_background; /* _DISP_CURSOR_BACKGROUND_0 */
  204. uint cursor_start_addr; /* _DISP_CURSOR_START_ADDR_0 */
  205. uint cursor_start_addr_ns; /* _DISP_CURSOR_START_ADDR_NS_0 */
  206. uint cursor_pos; /* _DISP_CURSOR_POSITION_0 */
  207. uint cursor_pos_ns; /* _DISP_CURSOR_POSITION_NS_0 */
  208. uint seq_ctrl; /* _DISP_INIT_SEQ_CONTROL_0 */
  209. /* Address 0x442 ~ 0x446 */
  210. uint spi_init_seq_data_a; /* _DISP_SPI_INIT_SEQ_DATA_A_0 */
  211. uint spi_init_seq_data_b; /* _DISP_SPI_INIT_SEQ_DATA_B_0 */
  212. uint spi_init_seq_data_c; /* _DISP_SPI_INIT_SEQ_DATA_C_0 */
  213. uint spi_init_seq_data_d; /* _DISP_SPI_INIT_SEQ_DATA_D_0 */
  214. uint reserved1[0x39]; /* reserved1[0x39], */
  215. /* Address 0x480 ~ 0x484 */
  216. uint dc_mccif_fifoctrl; /* _DISP_DC_MCCIF_FIFOCTRL_0 */
  217. uint mccif_disp0a_hyst; /* _DISP_MCCIF_DISPLAY0A_HYST_0 */
  218. uint mccif_disp0b_hyst; /* _DISP_MCCIF_DISPLAY0B_HYST_0 */
  219. uint mccif_disp0c_hyst; /* _DISP_MCCIF_DISPLAY0C_HYST_0 */
  220. uint mccif_disp1b_hyst; /* _DISP_MCCIF_DISPLAY1B_HYST_0 */
  221. uint reserved2[0x3b]; /* reserved2[0x3b] */
  222. /* Address 0x4c0 ~ 0x4c1 */
  223. uint dac_crt_ctrl; /* _DISP_DAC_CRT_CTRL_0 */
  224. uint disp_misc_ctrl; /* _DISP_DISP_MISC_CONTROL_0 */
  225. };
  226. enum dc_winc_filter_p {
  227. WINC_FILTER_COUNT = 0x10,
  228. };
  229. /* Window A/B/C register 0x500 ~ 0x628 */
  230. struct dc_winc_reg {
  231. /* Address 0x500 */
  232. uint color_palette; /* _WINC_COLOR_PALETTE_0 */
  233. uint reserved0[0xff]; /* reserved_0[0xff] */
  234. /* Address 0x600 */
  235. uint palette_color_ext; /* _WINC_PALETTE_COLOR_EXT_0 */
  236. /* _WINC_H_FILTER_P00~0F_0 */
  237. /* Address 0x601 ~ 0x610 */
  238. uint h_filter_p[WINC_FILTER_COUNT];
  239. /* Address 0x611 ~ 0x618 */
  240. uint csc_yof; /* _WINC_CSC_YOF_0 */
  241. uint csc_kyrgb; /* _WINC_CSC_KYRGB_0 */
  242. uint csc_kur; /* _WINC_CSC_KUR_0 */
  243. uint csc_kvr; /* _WINC_CSC_KVR_0 */
  244. uint csc_kug; /* _WINC_CSC_KUG_0 */
  245. uint csc_kvg; /* _WINC_CSC_KVG_0 */
  246. uint csc_kub; /* _WINC_CSC_KUB_0 */
  247. uint csc_kvb; /* _WINC_CSC_KVB_0 */
  248. /* Address 0x619 ~ 0x628: _WINC_V_FILTER_P00~0F_0 */
  249. uint v_filter_p[WINC_FILTER_COUNT];
  250. };
  251. /* WIN A/B/C Register 0x700 ~ 0x714*/
  252. struct dc_win_reg {
  253. /* Address 0x700 ~ 0x714 */
  254. uint win_opt; /* _WIN_WIN_OPTIONS_0 */
  255. uint byte_swap; /* _WIN_BYTE_SWAP_0 */
  256. uint buffer_ctrl; /* _WIN_BUFFER_CONTROL_0 */
  257. uint color_depth; /* _WIN_COLOR_DEPTH_0 */
  258. uint pos; /* _WIN_POSITION_0 */
  259. uint size; /* _WIN_SIZE_0 */
  260. uint prescaled_size; /* _WIN_PRESCALED_SIZE_0 */
  261. uint h_initial_dda; /* _WIN_H_INITIAL_DDA_0 */
  262. uint v_initial_dda; /* _WIN_V_INITIAL_DDA_0 */
  263. uint dda_increment; /* _WIN_DDA_INCREMENT_0 */
  264. uint line_stride; /* _WIN_LINE_STRIDE_0 */
  265. uint buf_stride; /* _WIN_BUF_STRIDE_0 */
  266. uint uv_buf_stride; /* _WIN_UV_BUF_STRIDE_0 */
  267. uint buffer_addr_mode; /* _WIN_BUFFER_ADDR_MODE_0 */
  268. uint dv_ctrl; /* _WIN_DV_CONTROL_0 */
  269. uint blend_nokey; /* _WIN_BLEND_NOKEY_0 */
  270. uint blend_1win; /* _WIN_BLEND_1WIN_0 */
  271. uint blend_2win_x; /* _WIN_BLEND_2WIN_X_0 */
  272. uint blend_2win_y; /* _WIN_BLEND_2WIN_Y_0 */
  273. uint blend_3win_xy; /* _WIN_BLEND_3WIN_XY_0 */
  274. uint hp_fetch_ctrl; /* _WIN_HP_FETCH_CONTROL_0 */
  275. };
  276. /* WINBUF A/B/C Register 0x800 ~ 0x80a */
  277. struct dc_winbuf_reg {
  278. /* Address 0x800 ~ 0x80a */
  279. uint start_addr; /* _WINBUF_START_ADDR_0 */
  280. uint start_addr_ns; /* _WINBUF_START_ADDR_NS_0 */
  281. uint start_addr_u; /* _WINBUF_START_ADDR_U_0 */
  282. uint start_addr_u_ns; /* _WINBUF_START_ADDR_U_NS_0 */
  283. uint start_addr_v; /* _WINBUF_START_ADDR_V_0 */
  284. uint start_addr_v_ns; /* _WINBUF_START_ADDR_V_NS_0 */
  285. uint addr_h_offset; /* _WINBUF_ADDR_H_OFFSET_0 */
  286. uint addr_h_offset_ns; /* _WINBUF_ADDR_H_OFFSET_NS_0 */
  287. uint addr_v_offset; /* _WINBUF_ADDR_V_OFFSET_0 */
  288. uint addr_v_offset_ns; /* _WINBUF_ADDR_V_OFFSET_NS_0 */
  289. uint uflow_status; /* _WINBUF_UFLOW_STATUS_0 */
  290. };
  291. /* Display Controller (DC_) regs */
  292. struct dc_ctlr {
  293. struct dc_cmd_reg cmd; /* CMD register 0x000 ~ 0x43 */
  294. uint reserved0[0x2bc];
  295. struct dc_com_reg com; /* COM register 0x300 ~ 0x329 */
  296. uint reserved1[0xd6];
  297. struct dc_disp_reg disp; /* DISP register 0x400 ~ 0x4c1 */
  298. uint reserved2[0x3e];
  299. struct dc_winc_reg winc; /* Window A/B/C 0x500 ~ 0x628 */
  300. uint reserved3[0xd7];
  301. struct dc_win_reg win; /* WIN A/B/C 0x700 ~ 0x714*/
  302. uint reserved4[0xeb];
  303. struct dc_winbuf_reg winbuf; /* WINBUF A/B/C 0x800 ~ 0x80a */
  304. };
  305. #define BIT(pos) (1U << pos)
  306. /* DC_CMD_DISPLAY_COMMAND 0x032 */
  307. #define CTRL_MODE_SHIFT 5
  308. #define CTRL_MODE_MASK (0x3 << CTRL_MODE_SHIFT)
  309. enum {
  310. CTRL_MODE_STOP,
  311. CTRL_MODE_C_DISPLAY,
  312. CTRL_MODE_NC_DISPLAY,
  313. };
  314. /* _WIN_COLOR_DEPTH_0 */
  315. enum win_color_depth_id {
  316. COLOR_DEPTH_P1,
  317. COLOR_DEPTH_P2,
  318. COLOR_DEPTH_P4,
  319. COLOR_DEPTH_P8,
  320. COLOR_DEPTH_B4G4R4A4,
  321. COLOR_DEPTH_B5G5R5A,
  322. COLOR_DEPTH_B5G6R5,
  323. COLOR_DEPTH_AB5G5R5,
  324. COLOR_DEPTH_B8G8R8A8 = 12,
  325. COLOR_DEPTH_R8G8B8A8,
  326. COLOR_DEPTH_B6x2G6x2R6x2A8,
  327. COLOR_DEPTH_R6x2G6x2B6x2A8,
  328. COLOR_DEPTH_YCbCr422,
  329. COLOR_DEPTH_YUV422,
  330. COLOR_DEPTH_YCbCr420P,
  331. COLOR_DEPTH_YUV420P,
  332. COLOR_DEPTH_YCbCr422P,
  333. COLOR_DEPTH_YUV422P,
  334. COLOR_DEPTH_YCbCr422R,
  335. COLOR_DEPTH_YUV422R,
  336. COLOR_DEPTH_YCbCr422RA,
  337. COLOR_DEPTH_YUV422RA,
  338. };
  339. /* DC_CMD_DISPLAY_POWER_CONTROL 0x036 */
  340. #define PW0_ENABLE BIT(0)
  341. #define PW1_ENABLE BIT(2)
  342. #define PW2_ENABLE BIT(4)
  343. #define PW3_ENABLE BIT(6)
  344. #define PW4_ENABLE BIT(8)
  345. #define PM0_ENABLE BIT(16)
  346. #define PM1_ENABLE BIT(18)
  347. #define SPI_ENABLE BIT(24)
  348. #define HSPI_ENABLE BIT(25)
  349. /* DC_CMD_STATE_CONTROL 0x041 */
  350. #define GENERAL_ACT_REQ BIT(0)
  351. #define WIN_A_ACT_REQ BIT(1)
  352. #define WIN_B_ACT_REQ BIT(2)
  353. #define WIN_C_ACT_REQ BIT(3)
  354. #define GENERAL_UPDATE BIT(8)
  355. #define WIN_A_UPDATE BIT(9)
  356. #define WIN_B_UPDATE BIT(10)
  357. #define WIN_C_UPDATE BIT(11)
  358. /* DC_CMD_DISPLAY_WINDOW_HEADER 0x042 */
  359. #define WINDOW_A_SELECT BIT(4)
  360. #define WINDOW_B_SELECT BIT(5)
  361. #define WINDOW_C_SELECT BIT(6)
  362. /* DC_DISP_DISP_CLOCK_CONTROL 0x42e */
  363. #define SHIFT_CLK_DIVIDER_SHIFT 0
  364. #define SHIFT_CLK_DIVIDER_MASK (0xff << SHIFT_CLK_DIVIDER_SHIFT)
  365. #define PIXEL_CLK_DIVIDER_SHIFT 8
  366. #define PIXEL_CLK_DIVIDER_MSK (0xf << PIXEL_CLK_DIVIDER_SHIFT)
  367. enum {
  368. PIXEL_CLK_DIVIDER_PCD1,
  369. PIXEL_CLK_DIVIDER_PCD1H,
  370. PIXEL_CLK_DIVIDER_PCD2,
  371. PIXEL_CLK_DIVIDER_PCD3,
  372. PIXEL_CLK_DIVIDER_PCD4,
  373. PIXEL_CLK_DIVIDER_PCD6,
  374. PIXEL_CLK_DIVIDER_PCD8,
  375. PIXEL_CLK_DIVIDER_PCD9,
  376. PIXEL_CLK_DIVIDER_PCD12,
  377. PIXEL_CLK_DIVIDER_PCD16,
  378. PIXEL_CLK_DIVIDER_PCD18,
  379. PIXEL_CLK_DIVIDER_PCD24,
  380. PIXEL_CLK_DIVIDER_PCD13,
  381. };
  382. /* DC_DISP_DISP_INTERFACE_CONTROL 0x42f */
  383. #define DATA_FORMAT_SHIFT 0
  384. #define DATA_FORMAT_MASK (0xf << DATA_FORMAT_SHIFT)
  385. enum {
  386. DATA_FORMAT_DF1P1C,
  387. DATA_FORMAT_DF1P2C24B,
  388. DATA_FORMAT_DF1P2C18B,
  389. DATA_FORMAT_DF1P2C16B,
  390. DATA_FORMAT_DF2S,
  391. DATA_FORMAT_DF3S,
  392. DATA_FORMAT_DFSPI,
  393. DATA_FORMAT_DF1P3C24B,
  394. DATA_FORMAT_DF1P3C18B,
  395. };
  396. #define DATA_ALIGNMENT_SHIFT 8
  397. enum {
  398. DATA_ALIGNMENT_MSB,
  399. DATA_ALIGNMENT_LSB,
  400. };
  401. #define DATA_ORDER_SHIFT 9
  402. enum {
  403. DATA_ORDER_RED_BLUE,
  404. DATA_ORDER_BLUE_RED,
  405. };
  406. /* DC_DISP_DATA_ENABLE_OPTIONS 0x432 */
  407. #define DE_SELECT_SHIFT 0
  408. #define DE_SELECT_MASK (0x3 << DE_SELECT_SHIFT)
  409. #define DE_SELECT_ACTIVE_BLANK 0x0
  410. #define DE_SELECT_ACTIVE 0x1
  411. #define DE_SELECT_ACTIVE_IS 0x2
  412. #define DE_CONTROL_SHIFT 2
  413. #define DE_CONTROL_MASK (0x7 << DE_CONTROL_SHIFT)
  414. enum {
  415. DE_CONTROL_ONECLK,
  416. DE_CONTROL_NORMAL,
  417. DE_CONTROL_EARLY_EXT,
  418. DE_CONTROL_EARLY,
  419. DE_CONTROL_ACTIVE_BLANK,
  420. };
  421. /* DC_WIN_WIN_OPTIONS 0x700 */
  422. #define H_DIRECTION BIT(0)
  423. enum {
  424. H_DIRECTION_INCREMENT,
  425. H_DIRECTION_DECREMENT,
  426. };
  427. #define V_DIRECTION BIT(2)
  428. enum {
  429. V_DIRECTION_INCREMENT,
  430. V_DIRECTION_DECREMENT,
  431. };
  432. #define COLOR_EXPAND BIT(6)
  433. #define CP_ENABLE BIT(16)
  434. #define DV_ENABLE BIT(20)
  435. #define WIN_ENABLE BIT(30)
  436. /* DC_WIN_BYTE_SWAP 0x701 */
  437. #define BYTE_SWAP_SHIFT 0
  438. #define BYTE_SWAP_MASK (3 << BYTE_SWAP_SHIFT)
  439. enum {
  440. BYTE_SWAP_NOSWAP,
  441. BYTE_SWAP_SWAP2,
  442. BYTE_SWAP_SWAP4,
  443. BYTE_SWAP_SWAP4HW
  444. };
  445. /* DC_WIN_POSITION 0x704 */
  446. #define H_POSITION_SHIFT 0
  447. #define H_POSITION_MASK (0x1FFF << H_POSITION_SHIFT)
  448. #define V_POSITION_SHIFT 16
  449. #define V_POSITION_MASK (0x1FFF << V_POSITION_SHIFT)
  450. /* DC_WIN_SIZE 0x705 */
  451. #define H_SIZE_SHIFT 0
  452. #define H_SIZE_MASK (0x1FFF << H_SIZE_SHIFT)
  453. #define V_SIZE_SHIFT 16
  454. #define V_SIZE_MASK (0x1FFF << V_SIZE_SHIFT)
  455. /* DC_WIN_PRESCALED_SIZE 0x706 */
  456. #define H_PRESCALED_SIZE_SHIFT 0
  457. #define H_PRESCALED_SIZE_MASK (0x7FFF << H_PRESCALED_SIZE)
  458. #define V_PRESCALED_SIZE_SHIFT 16
  459. #define V_PRESCALED_SIZE_MASK (0x1FFF << V_PRESCALED_SIZE)
  460. /* DC_WIN_DDA_INCREMENT 0x709 */
  461. #define H_DDA_INC_SHIFT 0
  462. #define H_DDA_INC_MASK (0xFFFF << H_DDA_INC_SHIFT)
  463. #define V_DDA_INC_SHIFT 16
  464. #define V_DDA_INC_MASK (0xFFFF << V_DDA_INC_SHIFT)
  465. #endif /* __ASM_ARCH_TEGRA_DC_H */