gpio_gk7102s_ov9732_joyhonest.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. #ifndef GPIO_CFG_JOYHONEST_H_
  2. #define GPIO_CFG_JOYHONEST_H_
  3. #include "adi_types.h"
  4. #include "adi_gpio.h"
  5. #if defined(GK7102S_OV9732_JOYHONEST)
  6. #define CONFIG_MACH_GK7102S_OV9732_JOYHONEST
  7. #endif
  8. #if defined(GK7102S_QFN_OV9732_JH)
  9. #define CONFIG_MACH_GK7102S_QFN_OV9732_JH
  10. #endif
  11. #define CONFIG_PHY_USE_AO_MCLK
  12. #define CONFIG_SYSTEM_USE_SDCARD
  13. //#define CONFIG_PHY_USE_SD_CLK
  14. #ifdef CONFIG_PHY_USE_AO_MCLK
  15. #define SYSTEM_GPIO_PHY_CLK GADI_GPIO_TYPE_OUTPUT_AOMCLK
  16. #endif
  17. #ifdef CONFIG_PHY_USE_SD_CLK
  18. #define SYSTEM_GPIO_PHY_CLK GADI_GPIO_TYPE_OUTPUT_SDIO_CLK
  19. #endif
  20. #ifdef CONFIG_PHY_USE_EXTERN_CLK
  21. #define SYSTEM_GPIO_PHY_CLK GADI_GPIO_TYPE_INPUT_0
  22. #endif
  23. #if defined(CONFIG_MACH_GK7102S_OV9732_JOYHONEST)
  24. #ifdef CONFIG_SYSTEM_USE_EXTERN_I2S
  25. #define SYSTEM_GPIO_I2S_TABLE \
  26. { GADI_GPIO_4 , GADI_GPIO_TYPE_INPUT_CLK_AU }, \
  27. { GADI_GPIO_5 , GADI_GPIO_TYPE_INPUT_I2S_WS }, \
  28. { GADI_GPIO_6 , GADI_GPIO_TYPE_INPUT_I2S_SI }, \
  29. { GADI_GPIO_7 , GADI_GPIO_TYPE_INPUT_I2S_CLK },
  30. #else
  31. #define SYSTEM_GPIO_I2S_TABLE \
  32. { GADI_GPIO_4 , GADI_GPIO_TYPE_OUTPUT_SPI1_SO }, \
  33. { GADI_GPIO_5 , GADI_GPIO_TYPE_OUTPUT_SPI0_SO }, \
  34. { GADI_GPIO_6 , GADI_GPIO_TYPE_OUTPUT_SPI1_SCLK }, \
  35. { GADI_GPIO_7 , GADI_GPIO_TYPE_OUTPUT_PWM3_OUT },
  36. #endif
  37. #ifdef CONFIG_SYSTEM_USE_SDCARD
  38. #define SYSTEM_GPIO_SD_TABLE \
  39. { GADI_GPIO_2, GADI_GPIO_TYPE_OUTPUT_SDIO_CLK }, \
  40. { GADI_GPIO_58, GADI_GPIO_TYPE_INPUT_SD_CD_N }, \
  41. { GADI_GPIO_18, GADI_GPIO_TYPE_INOUT_SD_CMD }, \
  42. { GADI_GPIO_35, GADI_GPIO_TYPE_INOUT_SD_DATA_0 }, \
  43. { GADI_GPIO_33, GADI_GPIO_TYPE_INOUT_SD_DATA_1 }, \
  44. { GADI_GPIO_19, GADI_GPIO_TYPE_INOUT_SD_DATA_2 }, \
  45. { GADI_GPIO_36, GADI_GPIO_TYPE_INOUT_SD_DATA_3 }, \
  46. { GADI_GPIO_60, GADI_GPIO_TYPE_INOUT_SD1_DATA_0 }, \
  47. { GADI_GPIO_3, GADI_GPIO_TYPE_INOUT_SD1_DATA_1 }, \
  48. { GADI_GPIO_56, GADI_GPIO_TYPE_INOUT_SD1_DATA_2 }, \
  49. { GADI_GPIO_59, GADI_GPIO_TYPE_INOUT_SD1_DATA_3 }, \
  50. { GADI_GPIO_32, GADI_GPIO_TYPE_OUTPUT_SDIO1_CLK }, \
  51. { GADI_GPIO_57, GADI_GPIO_TYPE_INOUT_SD1_CMD },
  52. #endif
  53. //------------------------system gpio map---------------------------
  54. #define SYSTEM_GPIO_XREF_TABLE \
  55. { GADI_GPIO_0 , GADI_GPIO_TYPE_OUTPUT_SF_CS0 }, \
  56. { GADI_GPIO_1 , GADI_GPIO_TYPE_INPUT_0 }, \
  57. { GADI_GPIO_4 , GADI_GPIO_TYPE_INPUT_0 }, \
  58. { GADI_GPIO_5 , GADI_GPIO_TYPE_INPUT_0 }, \
  59. { GADI_GPIO_6 , GADI_GPIO_TYPE_INPUT_0 }, \
  60. { GADI_GPIO_7 , GADI_GPIO_TYPE_INPUT_0 }, \
  61. { GADI_GPIO_8 , GADI_GPIO_TYPE_INPUT_0 }, \
  62. { GADI_GPIO_9 , GADI_GPIO_TYPE_INPUT_0 }, \
  63. { GADI_GPIO_11, GADI_GPIO_TYPE_INPUT_0 }, \
  64. { GADI_GPIO_13, GADI_GPIO_TYPE_INPUT_0 }, \
  65. { GADI_GPIO_14, GADI_GPIO_TYPE_INPUT_0 }, \
  66. { GADI_GPIO_15, GADI_GPIO_TYPE_INPUT_0 }, \
  67. { GADI_GPIO_16, GADI_GPIO_TYPE_INPUT_0 }, \
  68. { GADI_GPIO_17, GADI_GPIO_TYPE_INPUT_0 }, \
  69. { GADI_GPIO_20, GADI_GPIO_TYPE_INPUT_0 }, \
  70. { GADI_GPIO_21, GADI_GPIO_TYPE_INPUT_0 }, \
  71. { GADI_GPIO_22, GADI_GPIO_TYPE_INPUT_0 }, \
  72. { GADI_GPIO_23, GADI_GPIO_TYPE_OUTPUT_1 /*Sensor pwdn*/ }, \
  73. { GADI_GPIO_24, GADI_GPIO_TYPE_INPUT_0 }, \
  74. { GADI_GPIO_25, GADI_GPIO_TYPE_INPUT_UART0_RX }, \
  75. { GADI_GPIO_26, GADI_GPIO_TYPE_OUTPUT_UART0_TX }, \
  76. { GADI_GPIO_27, GADI_GPIO_TYPE_OUTPUT_1 /*Sensor reset*/}, \
  77. { GADI_GPIO_28, GADI_GPIO_TYPE_INOUT_I2C_DATA /*S D*/}, \
  78. { GADI_GPIO_29, GADI_GPIO_TYPE_INOUT_I2C_CLK /*S C*/}, \
  79. { GADI_GPIO_30, GADI_GPIO_TYPE_INPUT_0 }, \
  80. { GADI_GPIO_31, GADI_GPIO_TYPE_INPUT_0 }, \
  81. { GADI_GPIO_34, GADI_GPIO_TYPE_OUTPUT_0 }, \
  82. { GADI_GPIO_37, GADI_GPIO_TYPE_INOUT_I2C_DATA2 }, \
  83. { GADI_GPIO_38, GADI_GPIO_TYPE_INOUT_I2C_CLK2 }, \
  84. { GADI_GPIO_39, GADI_GPIO_TYPE_INPUT_0 }, \
  85. SYSTEM_GPIO_SD_TABLE\
  86. { GADI_GPIO_48, SYSTEM_GPIO_PHY_CLK }, \
  87. { GADI_GPIO_49, GADI_GPIO_TYPE_INPUT_0 }, \
  88. { GADI_GPIO_51, GADI_GPIO_TYPE_OUTPUT_1 }, \
  89. { GADI_GPIO_52, GADI_GPIO_TYPE_INPUT_0 }, \
  90. { GADI_GPIO_53, GADI_GPIO_TYPE_INPUT_0 }, \
  91. { GADI_GPIO_54, GADI_GPIO_TYPE_OUTPUT_EPHY_LED_3 }, \
  92. { GADI_GPIO_55, GADI_GPIO_TYPE_INPUT_0 }, \
  93. { GADI_GPIO_61, GADI_GPIO_TYPE_INPUT_0 }, \
  94. { GADI_GPIO_62, GADI_GPIO_TYPE_INPUT_0 }
  95. #define SYSTEM_GPIO_IR_CUT1 GADI_GPIO_49
  96. #define SYSTEM_GPIO_IR_CUT2 GADI_GPIO_24
  97. #define SYSTEM_GPIO_RED_LED_CTRL GADI_GPIO_10
  98. #define SYSTEM_GPIO_BLUE_LED_CTRL GADI_GPIO_9
  99. #define SYSTEM_GPIO_SENSOR_RESET GADI_GPIO_27
  100. #define SYSTEM_GPIO_RECORD_CTRL GADI_GPIO_47
  101. #define SYSTEM_GPIO_SNAP_CTRL GADI_GPIO_50
  102. #define SYSTEM_GPIO_PHY_SPEED_LED GADI_GPIO_54
  103. #define SYSTEM_GPIO_SPI0_EN0 GADI_GPIO_8 // not real pin
  104. #define SYSTEM_GPIO_SPI1_EN0 GADI_GPIO_9 // not real pin
  105. #define SYSTEM_GPIO_USB_HOST GADI_GPIO_50 // not real pin
  106. #define SYSTEM_GPIO_SD_DETECT GADI_GPIO_45
  107. #define SYSTEM_GPIO_SD_POWER GADI_GPIO_55 // not real pin
  108. #endif /***CONFIG_MACH_GK7102S_OV9732_JOYHONEST END***/
  109. #if defined(CONFIG_MACH_GK7102S_QFN_OV9732_JH)
  110. //------------------------system gpio map---------------------------
  111. #define SYSTEM_GPIO_XREF_TABLE \
  112. { GADI_GPIO_0 , GADI_GPIO_TYPE_OUTPUT_SF_CS0 }, \
  113. { GADI_GPIO_1 , GADI_GPIO_TYPE_OUTPUT_SF_CS1 }, \
  114. { GADI_GPIO_2 , GADI_GPIO_TYPE_UNDEFINED }, \
  115. { GADI_GPIO_3 , GADI_GPIO_TYPE_UNDEFINED }, \
  116. { GADI_GPIO_4 , GADI_GPIO_TYPE_UNDEFINED }, \
  117. { GADI_GPIO_5 , GADI_GPIO_TYPE_UNDEFINED }, \
  118. { GADI_GPIO_6 , GADI_GPIO_TYPE_UNDEFINED }, \
  119. { GADI_GPIO_7 , GADI_GPIO_TYPE_INOUT_I2C_CLK /*S C*/}, \
  120. { GADI_GPIO_8 , GADI_GPIO_TYPE_UNDEFINED }, \
  121. { GADI_GPIO_9 , GADI_GPIO_TYPE_UNDEFINED }, \
  122. { GADI_GPIO_10, GADI_GPIO_TYPE_UNDEFINED }, \
  123. { GADI_GPIO_11, GADI_GPIO_TYPE_UNDEFINED }, \
  124. { GADI_GPIO_12, GADI_GPIO_TYPE_UNDEFINED }, \
  125. { GADI_GPIO_13, GADI_GPIO_TYPE_UNDEFINED }, \
  126. { GADI_GPIO_14, GADI_GPIO_TYPE_INOUT_I2C_DATA /*S D*/}, \
  127. { GADI_GPIO_15, GADI_GPIO_TYPE_UNDEFINED }, \
  128. { GADI_GPIO_16, GADI_GPIO_TYPE_UNDEFINED }, \
  129. { GADI_GPIO_17, GADI_GPIO_TYPE_UNDEFINED }, \
  130. { GADI_GPIO_18, GADI_GPIO_TYPE_UNDEFINED }, \
  131. { GADI_GPIO_19, GADI_GPIO_TYPE_UNDEFINED }, \
  132. { GADI_GPIO_20, GADI_GPIO_TYPE_UNDEFINED }, \
  133. { GADI_GPIO_21, GADI_GPIO_TYPE_UNDEFINED }, \
  134. { GADI_GPIO_22, GADI_GPIO_TYPE_UNDEFINED }, \
  135. { GADI_GPIO_23, GADI_GPIO_TYPE_OUTPUT_1 /*Sensor pwdn*/ }, \
  136. { GADI_GPIO_24, GADI_GPIO_TYPE_UNDEFINED }, \
  137. { GADI_GPIO_25, GADI_GPIO_TYPE_INPUT_UART0_RX }, \
  138. { GADI_GPIO_26, GADI_GPIO_TYPE_OUTPUT_UART0_TX }, \
  139. { GADI_GPIO_27, GADI_GPIO_TYPE_OUTPUT_1 /*Sensor reset*/ }, \
  140. { GADI_GPIO_28, GADI_GPIO_TYPE_UNDEFINED }, \
  141. { GADI_GPIO_29, GADI_GPIO_TYPE_UNDEFINED }, \
  142. { GADI_GPIO_30, GADI_GPIO_TYPE_UNDEFINED }, \
  143. { GADI_GPIO_31, GADI_GPIO_TYPE_UNDEFINED }, \
  144. { GADI_GPIO_32, GADI_GPIO_TYPE_UNDEFINED }, \
  145. { GADI_GPIO_33, GADI_GPIO_TYPE_UNDEFINED }, \
  146. { GADI_GPIO_34, GADI_GPIO_TYPE_UNDEFINED }, \
  147. { GADI_GPIO_35, GADI_GPIO_TYPE_UNDEFINED }, \
  148. { GADI_GPIO_36, GADI_GPIO_TYPE_INOUT_SD1_DATA_1 }, \
  149. { GADI_GPIO_37, GADI_GPIO_TYPE_UNDEFINED }, \
  150. { GADI_GPIO_38, GADI_GPIO_TYPE_UNDEFINED }, \
  151. { GADI_GPIO_39, GADI_GPIO_TYPE_UNDEFINED }, \
  152. { GADI_GPIO_40, GADI_GPIO_TYPE_UNDEFINED }, \
  153. { GADI_GPIO_41, GADI_GPIO_TYPE_INOUT_SD_DATA_2 }, \
  154. { GADI_GPIO_42, GADI_GPIO_TYPE_INOUT_SD_DATA_3 }, \
  155. { GADI_GPIO_43, GADI_GPIO_TYPE_INOUT_SD_CMD }, \
  156. { GADI_GPIO_44, GADI_GPIO_TYPE_OUTPUT_SDIO_CLK }, \
  157. { GADI_GPIO_45, GADI_GPIO_TYPE_INOUT_SD_DATA_0 }, \
  158. { GADI_GPIO_46, GADI_GPIO_TYPE_INOUT_SD_DATA_1 }, \
  159. { GADI_GPIO_47, GADI_GPIO_TYPE_INPUT_SD_CD_N }, \
  160. { GADI_GPIO_48, GADI_GPIO_TYPE_UNDEFINED }, \
  161. { GADI_GPIO_49, GADI_GPIO_TYPE_UNDEFINED }, \
  162. { GADI_GPIO_50, GADI_GPIO_TYPE_UNDEFINED }, \
  163. { GADI_GPIO_51, GADI_GPIO_TYPE_UNDEFINED }, \
  164. { GADI_GPIO_52, GADI_GPIO_TYPE_UNDEFINED }, \
  165. { GADI_GPIO_53, GADI_GPIO_TYPE_UNDEFINED }, \
  166. { GADI_GPIO_54, GADI_GPIO_TYPE_OUTPUT_EPHY_LED_3 }, \
  167. { GADI_GPIO_55, GADI_GPIO_TYPE_UNDEFINED }, \
  168. { GADI_GPIO_56, GADI_GPIO_TYPE_INOUT_SD1_DATA_2 }, \
  169. { GADI_GPIO_57, GADI_GPIO_TYPE_OUTPUT_SDIO1_CLK }, \
  170. { GADI_GPIO_58, GADI_GPIO_TYPE_INOUT_SD1_CMD }, \
  171. { GADI_GPIO_59, GADI_GPIO_TYPE_INOUT_SD1_DATA_3 }, \
  172. { GADI_GPIO_60, GADI_GPIO_TYPE_INOUT_SD1_DATA_0 }, \
  173. { GADI_GPIO_61, GADI_GPIO_TYPE_INOUT_I2C_DATA2 }, \
  174. { GADI_GPIO_62, GADI_GPIO_TYPE_INOUT_I2C_CLK2 }
  175. #define SYSTEM_GPIO_IR_CUT1 GADI_GPIO_32
  176. #define SYSTEM_GPIO_IR_CUT2 GADI_GPIO_31
  177. #define SYSTEM_GPIO_RED_LED_CTRL GADI_GPIO_6
  178. #define SYSTEM_GPIO_BLUE_LED_CTRL GADI_GPIO_5
  179. #define SYSTEM_GPIO_SENSOR_RESET GADI_GPIO_27
  180. #define SYSTEM_GPIO_PHY_RESET GADI_GPIO_30
  181. #define SYSTEM_GPIO_PHY_SPEED_LED GADI_GPIO_33
  182. #define SYSTEM_GPIO_RECORD_CTRL GADI_GPIO_20
  183. #define SYSTEM_GPIO_SNAP_CTRL GADI_GPIO_21
  184. #endif /*CONFIG_MACH_GK7102S_QFN_OV9732_JH END*/
  185. #endif /* GPIO_CFG_JOYHONEST_H_ */