intel_bios.h 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. /*
  2. * Copyright © 2016 Intel Corporation
  3. *
  4. * Permission is hereby granted, free of charge, to any person obtaining a
  5. * copy of this software and associated documentation files (the "Software"),
  6. * to deal in the Software without restriction, including without limitation
  7. * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  8. * and/or sell copies of the Software, and to permit persons to whom the
  9. * Software is furnished to do so, subject to the following conditions:
  10. *
  11. * The above copyright notice and this permission notice (including the next
  12. * paragraph) shall be included in all copies or substantial portions of the
  13. * Software.
  14. *
  15. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  16. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  17. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  18. * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  19. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  20. * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  21. * SOFTWARE.
  22. */
  23. /*
  24. * Please use intel_vbt_defs.h for VBT private data, to hide and abstract away
  25. * the VBT from the rest of the driver. Add the parsed, clean data to struct
  26. * intel_vbt_data within struct drm_i915_private.
  27. */
  28. #ifndef _INTEL_BIOS_H_
  29. #define _INTEL_BIOS_H_
  30. enum intel_backlight_type {
  31. INTEL_BACKLIGHT_PMIC,
  32. INTEL_BACKLIGHT_LPSS,
  33. INTEL_BACKLIGHT_DISPLAY_DDI,
  34. INTEL_BACKLIGHT_DSI_DCS,
  35. INTEL_BACKLIGHT_PANEL_DRIVER_INTERFACE,
  36. };
  37. struct edp_power_seq {
  38. u16 t1_t3;
  39. u16 t8;
  40. u16 t9;
  41. u16 t10;
  42. u16 t11_t12;
  43. } __packed;
  44. /* MIPI Sequence Block definitions */
  45. enum mipi_seq {
  46. MIPI_SEQ_END = 0,
  47. MIPI_SEQ_ASSERT_RESET,
  48. MIPI_SEQ_INIT_OTP,
  49. MIPI_SEQ_DISPLAY_ON,
  50. MIPI_SEQ_DISPLAY_OFF,
  51. MIPI_SEQ_DEASSERT_RESET,
  52. MIPI_SEQ_BACKLIGHT_ON, /* sequence block v2+ */
  53. MIPI_SEQ_BACKLIGHT_OFF, /* sequence block v2+ */
  54. MIPI_SEQ_TEAR_ON, /* sequence block v2+ */
  55. MIPI_SEQ_TEAR_OFF, /* sequence block v3+ */
  56. MIPI_SEQ_POWER_ON, /* sequence block v3+ */
  57. MIPI_SEQ_POWER_OFF, /* sequence block v3+ */
  58. MIPI_SEQ_MAX
  59. };
  60. enum mipi_seq_element {
  61. MIPI_SEQ_ELEM_END = 0,
  62. MIPI_SEQ_ELEM_SEND_PKT,
  63. MIPI_SEQ_ELEM_DELAY,
  64. MIPI_SEQ_ELEM_GPIO,
  65. MIPI_SEQ_ELEM_I2C, /* sequence block v2+ */
  66. MIPI_SEQ_ELEM_SPI, /* sequence block v3+ */
  67. MIPI_SEQ_ELEM_PMIC, /* sequence block v3+ */
  68. MIPI_SEQ_ELEM_MAX
  69. };
  70. #define MIPI_DSI_UNDEFINED_PANEL_ID 0
  71. #define MIPI_DSI_GENERIC_PANEL_ID 1
  72. struct mipi_config {
  73. u16 panel_id;
  74. /* General Params */
  75. u32 enable_dithering:1;
  76. u32 rsvd1:1;
  77. u32 is_bridge:1;
  78. u32 panel_arch_type:2;
  79. u32 is_cmd_mode:1;
  80. #define NON_BURST_SYNC_PULSE 0x1
  81. #define NON_BURST_SYNC_EVENTS 0x2
  82. #define BURST_MODE 0x3
  83. u32 video_transfer_mode:2;
  84. u32 cabc_supported:1;
  85. #define PPS_BLC_PMIC 0
  86. #define PPS_BLC_SOC 1
  87. u32 pwm_blc:1;
  88. /* Bit 13:10 */
  89. #define PIXEL_FORMAT_RGB565 0x1
  90. #define PIXEL_FORMAT_RGB666 0x2
  91. #define PIXEL_FORMAT_RGB666_LOOSELY_PACKED 0x3
  92. #define PIXEL_FORMAT_RGB888 0x4
  93. u32 videomode_color_format:4;
  94. /* Bit 15:14 */
  95. #define ENABLE_ROTATION_0 0x0
  96. #define ENABLE_ROTATION_90 0x1
  97. #define ENABLE_ROTATION_180 0x2
  98. #define ENABLE_ROTATION_270 0x3
  99. u32 rotation:2;
  100. u32 bta_enabled:1;
  101. u32 rsvd2:15;
  102. /* 2 byte Port Description */
  103. #define DUAL_LINK_NOT_SUPPORTED 0
  104. #define DUAL_LINK_FRONT_BACK 1
  105. #define DUAL_LINK_PIXEL_ALT 2
  106. u16 dual_link:2;
  107. u16 lane_cnt:2;
  108. u16 pixel_overlap:3;
  109. u16 rgb_flip:1;
  110. #define DL_DCS_PORT_A 0x00
  111. #define DL_DCS_PORT_C 0x01
  112. #define DL_DCS_PORT_A_AND_C 0x02
  113. u16 dl_dcs_cabc_ports:2;
  114. u16 dl_dcs_backlight_ports:2;
  115. u16 rsvd3:4;
  116. u16 rsvd4;
  117. u8 rsvd5;
  118. u32 target_burst_mode_freq;
  119. u32 dsi_ddr_clk;
  120. u32 bridge_ref_clk;
  121. #define BYTE_CLK_SEL_20MHZ 0
  122. #define BYTE_CLK_SEL_10MHZ 1
  123. #define BYTE_CLK_SEL_5MHZ 2
  124. u8 byte_clk_sel:2;
  125. u8 rsvd6:6;
  126. /* DPHY Flags */
  127. u16 dphy_param_valid:1;
  128. u16 eot_pkt_disabled:1;
  129. u16 enable_clk_stop:1;
  130. u16 rsvd7:13;
  131. u32 hs_tx_timeout;
  132. u32 lp_rx_timeout;
  133. u32 turn_around_timeout;
  134. u32 device_reset_timer;
  135. u32 master_init_timer;
  136. u32 dbi_bw_timer;
  137. u32 lp_byte_clk_val;
  138. /* 4 byte Dphy Params */
  139. u32 prepare_cnt:6;
  140. u32 rsvd8:2;
  141. u32 clk_zero_cnt:8;
  142. u32 trail_cnt:5;
  143. u32 rsvd9:3;
  144. u32 exit_zero_cnt:6;
  145. u32 rsvd10:2;
  146. u32 clk_lane_switch_cnt;
  147. u32 hl_switch_cnt;
  148. u32 rsvd11[6];
  149. /* timings based on dphy spec */
  150. u8 tclk_miss;
  151. u8 tclk_post;
  152. u8 rsvd12;
  153. u8 tclk_pre;
  154. u8 tclk_prepare;
  155. u8 tclk_settle;
  156. u8 tclk_term_enable;
  157. u8 tclk_trail;
  158. u16 tclk_prepare_clkzero;
  159. u8 rsvd13;
  160. u8 td_term_enable;
  161. u8 teot;
  162. u8 ths_exit;
  163. u8 ths_prepare;
  164. u16 ths_prepare_hszero;
  165. u8 rsvd14;
  166. u8 ths_settle;
  167. u8 ths_skip;
  168. u8 ths_trail;
  169. u8 tinit;
  170. u8 tlpx;
  171. u8 rsvd15[3];
  172. /* GPIOs */
  173. u8 panel_enable;
  174. u8 bl_enable;
  175. u8 pwm_enable;
  176. u8 reset_r_n;
  177. u8 pwr_down_r;
  178. u8 stdby_r_n;
  179. } __packed;
  180. /* all delays have a unit of 100us */
  181. struct mipi_pps_data {
  182. u16 panel_on_delay;
  183. u16 bl_enable_delay;
  184. u16 bl_disable_delay;
  185. u16 panel_off_delay;
  186. u16 panel_power_cycle_delay;
  187. } __packed;
  188. #endif /* _INTEL_BIOS_H_ */