BoardConfig.h 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  1. /**
  2. * @file BoardConfig.h
  3. * @brief Header file of Board Config.
  4. *
  5. * @verbatim
  6. * ==============================================================================
  7. * ##### How to use #####
  8. * ==============================================================================
  9. *
  10. *
  11. @ endverbatim
  12. *
  13. * @author HiView SoC Software Team
  14. * @version 1.0.0
  15. * @date 2022-08-26
  16. */
  17. #ifndef __DEVICE_HIVIEW_HT7315_QDH_BOARDCONFIG_H__
  18. #define __DEVICE_HIVIEW_HT7315_QDH_BOARDCONFIG_H__
  19. /*************************************************
  20. Board Option
  21. *************************************************/
  22. #define HV_BOARD_CONFIG_NAME "HV_HT7315_PRODUCT_QHD"
  23. #define HV_BOARD_CONFIG_VER "0.02"
  24. /*************************************************
  25. Gpio config
  26. *************************************************/
  27. #define HV_BOARD_CONFIG_GPIO_HF_DET_1 (57)
  28. #define HV_BOARD_CONFIG_GPIO_LED_B (61)
  29. #define HV_BOARD_CONFIG_GPIO_PA_MUTE_CTL (63)
  30. #define HV_BOARD_CONFIG_GPIO_PA_SHDN_CTL (64)
  31. #define HV_BOARD_CONFIG_GPIO_LED_R (161)
  32. #define HV_BOARD_CONFIG_GPIO_SCALER_EE_WP (162) /* 用指示Panel时序 */
  33. #define HV_BOARD_CONFIG_GPIO_RX_AP_EN (164) /* samsung water drop */
  34. #define HV_BOARD_CONFIG_GPIO_E2_WP (0xFF)
  35. #define HV_BOARD_CONFIG_GPIO_HDMI1_RX_DDC1_SCL (208)
  36. #define HV_BOARD_CONFIG_GPIO_HDMI1_RX_DDC1_SDA (209)
  37. #define HV_BOARD_CONFIG_GPIO_PANEL_EN (210)
  38. #define HV_BOARD_CONFIG_GPIO_BLK_EN (96)
  39. #define HV_BOARD_CONFIG_GPIO_VBUS_DISCHA (211)
  40. #define HV_BOARD_CONFIG_GPIO_VBUS_PMU_EN (213)
  41. #define HV_BOARD_CONFIG_GPIO_GP_PD_PW_S (214)
  42. #define HV_BOARD_CONFIG_GPIO_CC_RD_CTL (216)
  43. #define HV_BOARD_CONFIG_GPIO_PANEL_SEQUENCE_TEST (0xFF) /* TODO customize define*/
  44. /*************************************************
  45. Port Option
  46. *************************************************/
  47. #define PORT_VALID 1
  48. #define PORT_INVALID 0
  49. #define HV_BOARD_CONFIG_MAX_HDMI_PORT_NUM 2
  50. #define HV_BOARD_CONFIG_MAX_HDCP_PORT_NUM 2
  51. #define HV_BOARD_CONFIG_MAX_DP_PORT_NUM 2
  52. #define HV_BOARD_CONFIG_MAX_RXPLL_PORT_NUM 2
  53. #define HV_BOARD_CONFIG_MAX_TYPEC_PORT_NUM 1
  54. #define HV_BOARD_CONFIG_DISPLAYPORT_0 PORT_VALID
  55. #define HV_BOARD_CONFIG_HDMI_0 PORT_VALID
  56. #define HV_BOARD_CONFIG_DISPLAYPORT_1 PORT_VALID
  57. #define HV_BOARD_CONFIG_HDMI_1 PORT_VALID
  58. #define HDMI_LANE0 0
  59. #define HDMI_LANE1 1
  60. #define HDMI_LANE2 2
  61. #define HDMI_CLK 3
  62. /* HDMI0 INNER LANE <----> OUTER LANE */
  63. /*34,35 == Lane0 PIN for the outer HDMI Lane */
  64. #define HV_BOARD_CONFIG_HDMI0_LANE0 HDMI_LANE2
  65. /*31,32 == Lane1 PIN for the outer HDMI Lane */
  66. #define HV_BOARD_CONFIG_HDMI0_LANE1 HDMI_LANE1
  67. /*28,29 == Lane2 PIN for the outer HDMI Lane */
  68. #define HV_BOARD_CONFIG_HDMI0_LANE2 HDMI_LANE0
  69. /*25,26 == Clock PIN for the outer HDMI Lane */
  70. #define HV_BOARD_CONFIG_HDMI0_CLK HDMI_CLK
  71. /* HDMI1 INNER LANE <----> OUTER LANE */
  72. /*46,47 == Lane0 PIN for the outer HDMI Lane */
  73. #define HV_BOARD_CONFIG_HDMI1_LANE0 HDMI_LANE2
  74. /*43,44 == Lane1 PIN for the outer HDMI Lane */
  75. #define HV_BOARD_CONFIG_HDMI1_LANE1 HDMI_LANE1
  76. /*40,41 == Lane2 PIN for the outer HDMI Lane */
  77. #define HV_BOARD_CONFIG_HDMI1_LANE2 HDMI_LANE0
  78. /*37,38 == Clock PIN for the outer HDMI Lane */
  79. #define HV_BOARD_CONFIG_HDMI1_CLK HDMI_CLK
  80. #define HV_BOARD_CONFIG_HDMI0_INV_PN 0xF
  81. #define HV_BOARD_CONFIG_HDMI1_INV_PN 0xF
  82. #define HV_BOARD_CONFIG_HDMI0_LANE_SWP ((HV_BOARD_CONFIG_HDMI0_CLK << 6) |\
  83. (HV_BOARD_CONFIG_HDMI0_LANE2 << 4) |\
  84. (HV_BOARD_CONFIG_HDMI0_LANE1 << 2) |\
  85. (HV_BOARD_CONFIG_HDMI0_LANE0))
  86. #define HV_BOARD_CONFIG_HDMI1_LANE_SWP ((HV_BOARD_CONFIG_HDMI1_CLK << 6) |\
  87. (HV_BOARD_CONFIG_HDMI1_LANE2 << 4) |\
  88. (HV_BOARD_CONFIG_HDMI1_LANE1 << 2) |\
  89. (HV_BOARD_CONFIG_HDMI1_LANE0))
  90. #define HV_BOARD_CONFIG_HDMI_HPD_SOURCE_5V 1
  91. #if (HV_BOARD_CONFIG_HDMI_HPD_SOURCE_5V == 1)
  92. #define HV_BOARD_CONFIG_HDMI_HPD_5V 1
  93. #else
  94. #define HV_BOARD_CONFIG_HDMI_HPD_5V 0
  95. #endif
  96. #define CABLE_DETECT_WITH_GROUND_VOL 0
  97. #define CABLE_DETECT_WITH_SOURCE_5V 1
  98. #define HV_BOARD_CONFIG_HDMI_CABLE_DETECT CABLE_DETECT_WITH_GROUND_VOL
  99. #if ((HV_BOARD_CONFIG_HDMI0_CLK != HDMI_CLK) && (HV_BOARD_CONFIG_HDMI0_LANE0 != HDMI_CLK))
  100. #error "HDMI0 lane swap ERROR"
  101. #endif
  102. #if ((HV_BOARD_CONFIG_HDMI1_CLK != HDMI_CLK) && (HV_BOARD_CONFIG_HDMI1_LANE0 != HDMI_CLK))
  103. #error "HDMI1 lane swap ERROR"
  104. #endif
  105. #define DP_PORT_NORM 0
  106. #define DP_PORT_ALTMODE 1
  107. #define DP_LANE0 0
  108. #define DP_LANE1 1
  109. #define DP_LANE2 2
  110. #define DP_LANE3 3
  111. /* DP INNER LANE <----> OUTER LANE */
  112. #define HV_BOARD_CONFIG_DP0_LANE0 DP_LANE0
  113. #define HV_BOARD_CONFIG_DP0_LANE1 DP_LANE1
  114. #define HV_BOARD_CONFIG_DP0_LANE2 DP_LANE3
  115. #define HV_BOARD_CONFIG_DP0_LANE3 DP_LANE2
  116. #define HV_BOARD_CONFIG_DP1_LANE0 DP_LANE3
  117. #define HV_BOARD_CONFIG_DP1_LANE1 DP_LANE2
  118. #define HV_BOARD_CONFIG_DP1_LANE2 DP_LANE1
  119. #define HV_BOARD_CONFIG_DP1_LANE3 DP_LANE0
  120. #define HV_BOARD_CONFIG_DP0_AUX_POLARITY 0x1
  121. #define HV_BOARD_CONFIG_DP1_AUX_POLARITY 0x0
  122. #define HV_BORAD_CONFIG_DP0_LANE_POLARITY 0xA
  123. #define HV_BORAD_CONFIG_DP1_LANE_POLARITY 0x0
  124. #define HV_BOARD_CONFIG_DP0_TYPE DP_PORT_ALTMODE
  125. #define HV_BOARD_CONFIG_DP1_TYPE DP_PORT_NORM
  126. #define HV_BOARD_CONFIG_TYPEC0_TO_DP LINK_PORT_INDEX_DP_RX0
  127. #define HV_BOARD_CONFIG_TYPEC1_TO_DP LINK_PORT_INDEX_DP_RX1
  128. #define HV_BOARD_CONFIG_DP0_TO_TYPEC 0
  129. #define HV_BOARD_CONFIG_DP1_TO_TYPEC 1
  130. #define HV_BOARD_CONFIG_SPEAKER
  131. #define HV_BOARD_CONFIG_HEADSET_GPIO_STATE_PULL_OUT GPIO_LEVEL_LOW
  132. #define HV_BOARD_CONFIG_HEADSET_GPIO_STATE_INSERT GPIO_LEVEL_HIGH
  133. #define HV_BOARD_CONFIG_PA_MUTE_ENABLE GPIO_LEVEL_HIGH
  134. #define HV_BOARD_CONFIG_PA_MUTE_DISABLE GPIO_LEVEL_LOW
  135. #define HV_BOARD_CONFIG_PA_SHDN_ENABLE GPIO_LEVEL_HIGH
  136. #define HV_BOARD_CONFIG_PA_SHDN_DISABLE GPIO_LEVEL_LOW
  137. /*************************************************
  138. eeprom i2c config
  139. bus config:
  140. typedef enum _I2cBusID{
  141. I2CM0,
  142. I2CS0,
  143. MI2C,
  144. SIMI2C0,
  145. SIMI2C1,
  146. SIMI2C2,
  147. }I2cBusID;
  148. *************************************************/
  149. /* typec pmic */
  150. #define PMIC_I2CM0 0
  151. #define PMIC_SIMI2C0 1
  152. #define PMIC_GPIO 2
  153. #define HV_BOARD_CONFIG_PMIC_MODE PMIC_I2CM0
  154. /* #define HV_BOARD_CONFIG_PMIC_SIMI2C SIMI2C1 */
  155. #define HV_BOARD_CONFIG_PMIC_ADDR (0x60)
  156. /* scaler e2p */
  157. #define HV_BOARD_CONFIG_E2P_USE_MI2C
  158. #ifdef HV_BOARD_CONFIG_E2P_USE_MI2C
  159. #define HV_BOARD_CONFIG_E2P_TYPE_2 E2P_TYPE_16K_128PAGES_16BYTE
  160. #define HV_BOARD_CONFIG_E2P_ADDR_2 (0xA0>>1)
  161. #define HV_BOARD_CONFIG_E2P_WP_GPIO_2 HV_BOARD_CONFIG_GPIO_SCALER_EE_WP
  162. #define HV_BOARD_CONFIG_E2P_WP_PROTECT_LEVEL_2 1
  163. #endif
  164. /* hdmi0 edid */
  165. #define HV_BOARD_CONFIG_E2P_USE_I2CS0
  166. #ifdef HV_BOARD_CONFIG_E2P_USE_I2CS0
  167. #define HV_BOARD_CONFIG_E2P_TYPE_1 E2P_TYPE_2K_16PAGES_16BYTE
  168. #define HV_BOARD_CONFIG_E2P_ADDR_1 (0x50)
  169. #define HV_BOARD_CONFIG_E2P_WP_GPIO_1 HV_BOARD_CONFIG_GPIO_E2_WP
  170. #define HV_BOARD_CONFIG_E2P_WP_PROTECT_LEVEL_1 1
  171. #endif
  172. /* hdmi1 edid */
  173. #define HV_BOARD_CONFIG_E2P_USE_SIMI2C0
  174. #ifdef HV_BOARD_CONFIG_E2P_USE_SIMI2C0
  175. #define HV_BOARD_CONFIG_E2P_TYPE_3 E2P_TYPE_2K_16PAGES_16BYTE
  176. #define HV_BOARD_CONFIG_E2P_ADDR_3 (0xA0)
  177. #define HV_BOARD_CONFIG_E2P_WP_GPIO_3 HV_BOARD_CONFIG_GPIO_E2_WP
  178. #define HV_BOARD_CONFIG_E2P_WP_PROTECT_LEVEL_3 1
  179. #define SIMI2C_SCL HV_BOARD_CONFIG_GPIO_HDMI1_RX_DDC1_SCL
  180. #define SIMI2C_SDA HV_BOARD_CONFIG_GPIO_HDMI1_RX_DDC1_SDA
  181. #endif
  182. #define STORAGE_EEPROM 0
  183. #define STORAGE_SPI_FLASH 1
  184. #define HV_BOARD_CONFIG_DATABASE_STORAGE_TYPE STORAGE_SPI_FLASH
  185. //#define HV_BOARD_CONFIG_LED_B_PWM 2
  186. #define HV_BOARD_CONFIG_LED_B_POL 1
  187. #define HV_BOARD_CONFIG_LED_R_POL 1
  188. #endif