BoardConfig.h 11 KB

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