quec_boot_pin_map.c 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391
  1. /**
  2. @file
  3. quec_boot_pin_index.c
  4. @brief
  5. quectel boot pin index interface.
  6. */
  7. /*================================================================
  8. Copyright (c) 2020 Quectel Wireless Solution, Co., Ltd. All Rights Reserved.
  9. Quectel Wireless Solution Proprietary and Confidential.
  10. =================================================================*/
  11. /*=================================================================
  12. EDIT HISTORY FOR MODULE
  13. This section contains comments describing changes made to the module.
  14. Notice that changes are listed in reverse chronological order.
  15. WHEN WHO WHAT, WHERE, WHY
  16. ------------ ------- -------------------------------------------------------------------------------
  17. 16/06/2021 Sum Init version
  18. =================================================================*/
  19. /*===========================================================================
  20. * include files
  21. ===========================================================================*/
  22. //#include "quec_boot_pin_index.h"
  23. #include "quec_cust_feature.h"
  24. #include "hwregs.h"
  25. #include "quec_boot_pin_cfg.h"
  26. #include "ql_type.h"
  27. #include "drv_adc.h"
  28. #include "stdio.h"
  29. const ql_boot_model_diff_ctx_s ql_boot_model_diff_ctx =
  30. {
  31. #ifdef CONFIG_QUEC_PROJECT_FEATURE_GNSS
  32. true
  33. #else
  34. false
  35. #endif
  36. };
  37. /**********************************************************************************************
  38. *>>>如何修改某个pin的复用功能
  39. * 用复用pin对应的reg,func,替换下map数组中的reg,func,根据所选的pin所在的电压域,填写是否要
  40. * 开启电压域。
  41. * 注:
  42. * 1.pin脚对应的reg在quec_pin_cfg_ECXXX.c中可以找到。
  43. * 2.pin脚的func和power domain 在ECXXXXEGXXXX配置_UIS8910DM(或者UIS8850)_GPIO_Spec_VX.X.xlsx
  44. * excel表中可以找到。
  45. * 3.drv_bits分2bits和4bits 可以在quec_pin_cfg_ECXXXX.c中查到。
  46. * 其中,2bits类型的驱动能力等级如下:
  47. * 0: Driven strength 2mA 1: Driven strength 4mA 2: Driven strength 6mA 3: Driven strength 8mA
  48. * 4bits类型的驱动能力等级如下:
  49. * 0: Driven strength 3mA 1: Driven strength 6mA 2: Driven strength 9mA 3: Driven strength 12mA
  50. * 4: Driven strength 15mA 5: Driven strength 18mA 6: Driven strength 21mA 7: Driven strength 24mA
  51. * 8: Driven strength 27mA 9: Driven strength 30mA 10: Driven strength 33mA 11: Driven strength 36mA
  52. * 12: Driven strength 39mA 13: Driven strength 42mA 14: Driven strength 45mA 15: Driven strength 48mA
  53. **********************************************************************************************/
  54. /*==================================================================
  55. ******************************uart*********************************
  56. ==================================================================*/
  57. #ifdef CONFIG_QUEC_PROJECT_FEATURE_BOOT_URC
  58. //UART1默认的 UART2/UART3需要set func
  59. //#define QL_BOOT_UART_PORT_NUM_MAX (2)
  60. #if defined(CONFIG_QL_PROJECT_DEF_EC800G) || defined(CONFIG_QL_PROJECT_DEF_EG800G)
  61. ql_boot_uart_pin_cfg_t quec_boot_uart_pin_cfg_map[QL_BOOT_UART_PORT_NUM_MAX] = /* pin initialize */
  62. {
  63. {
  64. QL_BOOT_UART_PORT_4,
  65. /* reg func power_domain power val pad reg drv_val*/
  66. /*UART4_TX */{ &hwp_iomux->uart_2_rts , 4 , QUEC_BOOT_V_NONE , POWER_LEVEL_UNUSED , NULL , 0 },
  67. /*UART4_RX */{ &hwp_iomux->uart_2_cts , 4 , QUEC_BOOT_V_NONE , POWER_LEVEL_UNUSED , NULL , 0 },
  68. },
  69. {
  70. QL_BOOT_UART_PORT_2,
  71. /* reg func power_domain power val pad reg drv_val*/
  72. /*UART2_TX */{ &hwp_iomux->uart_2_cts , 2 , QUEC_BOOT_V_NONE , POWER_LEVEL_UNUSED , NULL , 0 },
  73. /*UART2_RX */{ &hwp_iomux->uart_2_rts , 4 , QUEC_BOOT_V_NONE , POWER_LEVEL_UNUSED , NULL , 0 },
  74. },
  75. {
  76. QL_BOOT_UART_PORT_3,
  77. /* reg func power_domain power val pad reg drv_val*/
  78. /*UART3_TX */{ &hwp_iomux->gpio_7 , 4 , QUEC_BOOT_V_NONE , POWER_LEVEL_UNUSED , NULL , 0 },
  79. /*UART3_RX */{ &hwp_iomux->gpio_6 , 4 , QUEC_BOOT_V_NONE , POWER_LEVEL_UNUSED , NULL , 0 },
  80. },
  81. {
  82. QL_BOOT_UART_PORT_5,
  83. /* reg func power_domain power val pad reg drv_val*/
  84. /*UART5_TX */{ NULL , 0 , QUEC_BOOT_V_NONE , POWER_LEVEL_UNUSED , NULL , 0 },
  85. /*UART5_RX */{ NULL , 0 , QUEC_BOOT_V_NONE , POWER_LEVEL_UNUSED , NULL , 0 },
  86. },
  87. {
  88. QL_BOOT_UART_PORT_6,
  89. /* reg func power_domain power val pad reg drv_val*/
  90. /*UART6_TX */{ NULL , 0 , QUEC_BOOT_V_NONE , POWER_LEVEL_UNUSED , NULL , 0 },
  91. /*UART6_RX */{ NULL , 0 , QUEC_BOOT_V_NONE , POWER_LEVEL_UNUSED , NULL , 0 },
  92. }
  93. };
  94. #elif (defined CONFIG_QL_PROJECT_DEF_EC600G)
  95. ql_boot_uart_pin_cfg_t quec_boot_uart_pin_cfg_map[QL_BOOT_UART_PORT_NUM_MAX] = /* pin initialize */
  96. {
  97. {
  98. QL_BOOT_UART_PORT_4,
  99. /* reg func power_domain power val pad reg drv_val*/
  100. /*UART4_TX */{ NULL , 0 , QUEC_BOOT_V_NONE , POWER_LEVEL_UNUSED , NULL , 0 },
  101. /*UART4_RX */{ NULL , 0 , QUEC_BOOT_V_NONE , POWER_LEVEL_UNUSED , NULL , 0 },
  102. },
  103. {
  104. QL_BOOT_UART_PORT_2,
  105. /* reg func power_domain power val pad reg drv_val*/
  106. /*UART2_TX */{ &hwp_iomux->uart_2_rxd , 0 , QUEC_BOOT_V_NONE , POWER_LEVEL_UNUSED , NULL , 0 },
  107. /*UART2_RX */{ &hwp_iomux->uart_2_txd , 0 , QUEC_BOOT_V_NONE , POWER_LEVEL_UNUSED , NULL , 0 },
  108. },
  109. {
  110. QL_BOOT_UART_PORT_3,
  111. /* reg func power_domain power val pad reg drv_val*/
  112. /*UART3_TX */{ NULL , 0 , QUEC_BOOT_V_NONE , POWER_LEVEL_UNUSED , NULL , 0 },
  113. /*UART3_RX */{ NULL , 0 , QUEC_BOOT_V_NONE , POWER_LEVEL_UNUSED , NULL , 0 },
  114. },
  115. {
  116. QL_BOOT_UART_PORT_5,
  117. /* reg func power_domain power val pad reg drv_val*/
  118. /*UART5_TX */{ NULL , 0 , QUEC_BOOT_V_NONE , POWER_LEVEL_UNUSED , NULL , 0 },
  119. /*UART5_RX */{ NULL , 0 , QUEC_BOOT_V_NONE , POWER_LEVEL_UNUSED , NULL , 0 },
  120. },
  121. {
  122. QL_BOOT_UART_PORT_6,
  123. /* reg func power_domain power val pad reg drv_val*/
  124. /*UART6_TX */{ NULL , 0 , QUEC_BOOT_V_NONE , POWER_LEVEL_UNUSED , NULL , 0 },
  125. /*UART6_RX */{ NULL , 0 , QUEC_BOOT_V_NONE , POWER_LEVEL_UNUSED , NULL , 0 },
  126. }
  127. };
  128. #elif (defined CONFIG_QL_PROJECT_DEF_EG700G)
  129. ql_boot_uart_pin_cfg_t quec_boot_uart_pin_cfg_map[QL_BOOT_UART_PORT_NUM_MAX] = /* pin initialize */
  130. {
  131. {
  132. QL_BOOT_UART_PORT_4,
  133. /* reg func power_domain power val pad reg drv_val*/
  134. /*UART4_TX */{ NULL , 0 , QUEC_BOOT_V_NONE , POWER_LEVEL_UNUSED , NULL , 0 },
  135. /*UART4_RX */{ NULL , 0 , QUEC_BOOT_V_NONE , POWER_LEVEL_UNUSED , NULL , 0 },
  136. },
  137. {
  138. QL_BOOT_UART_PORT_2,
  139. /* reg func power_domain power val pad reg drv_val*/
  140. /*UART2_TX */{ NULL , 0 , QUEC_BOOT_V_NONE , POWER_LEVEL_UNUSED , NULL , 0 },
  141. /*UART2_RX */{ NULL , 0 , QUEC_BOOT_V_NONE , POWER_LEVEL_UNUSED , NULL , 0 },
  142. },
  143. {
  144. QL_BOOT_UART_PORT_3,
  145. /* reg func power_domain power val pad reg drv_val*/
  146. /*UART3_TX */{ NULL , 0 , QUEC_BOOT_V_NONE , POWER_LEVEL_UNUSED , NULL , 0 },
  147. /*UART3_RX */{ NULL , 0 , QUEC_BOOT_V_NONE , POWER_LEVEL_UNUSED , NULL , 0 },
  148. },
  149. {
  150. QL_BOOT_UART_PORT_5,
  151. /* reg func power_domain power val pad reg drv_val*/
  152. /*UART5_TX */{ NULL , 0 , QUEC_BOOT_V_NONE , POWER_LEVEL_UNUSED , NULL , 0 },
  153. /*UART5_RX */{ NULL , 0 , QUEC_BOOT_V_NONE , POWER_LEVEL_UNUSED , NULL , 0 },
  154. },
  155. {
  156. QL_BOOT_UART_PORT_6,
  157. /* reg func power_domain power val pad reg drv_val*/
  158. /*UART6_TX */{ &hwp_iomux->gpio_6 , 0 , QUEC_BOOT_V_NONE , POWER_LEVEL_UNUSED , NULL , 0 },
  159. /*UART6_RX */{ &hwp_iomux->gpio_7 , 0 , QUEC_BOOT_V_NONE , POWER_LEVEL_UNUSED , NULL , 0 },
  160. }
  161. };
  162. #elif (defined CONFIG_QL_PROJECT_DEF_EC200G)
  163. ql_boot_uart_pin_cfg_t quec_boot_uart_pin_cfg_map[QL_BOOT_UART_PORT_NUM_MAX] = /* pin initialize */
  164. {
  165. {
  166. QL_BOOT_UART_PORT_4,
  167. /* reg func power_domain power val pad reg drv_val*/
  168. /*UART4_TX */{ NULL , 0 , QUEC_BOOT_V_NONE , POWER_LEVEL_UNUSED , NULL , 0 },
  169. /*UART4_RX */{ NULL , 0 , QUEC_BOOT_V_NONE , POWER_LEVEL_UNUSED , NULL , 0 },
  170. },
  171. {
  172. QL_BOOT_UART_PORT_2,
  173. /* reg func power_domain power val pad reg drv_val*/
  174. /*UART2_TX */{ NULL , 0 , QUEC_BOOT_V_NONE , POWER_LEVEL_UNUSED , NULL , 0 },
  175. /*UART2_RX */{ NULL , 0 , QUEC_BOOT_V_NONE , POWER_LEVEL_UNUSED , NULL , 0 },
  176. },
  177. {
  178. QL_BOOT_UART_PORT_3,
  179. /* reg func power_domain power val pad reg drv_val*/
  180. /*UART3_TX */{ NULL , 0 , QUEC_BOOT_V_NONE , POWER_LEVEL_UNUSED , NULL , 0 },
  181. /*UART3_RX */{ NULL , 0 , QUEC_BOOT_V_NONE , POWER_LEVEL_UNUSED , NULL , 0 },
  182. },
  183. {
  184. QL_BOOT_UART_PORT_5,
  185. /* reg func power_domain power val pad reg drv_val*/
  186. /*UART5_TX */{ &hwp_iomux->keyin_5 , 0 , QUEC_BOOT_V_NONE , POWER_LEVEL_UNUSED , NULL , 0 },
  187. /*UART5_RX */{ &hwp_iomux->keyin_4 , 0 , QUEC_BOOT_V_NONE , POWER_LEVEL_UNUSED , NULL , 0 },
  188. },
  189. {
  190. QL_BOOT_UART_PORT_6,
  191. /* reg func power_domain power val pad reg drv_val*/
  192. /*UART6_TX */{ NULL , 0 , QUEC_BOOT_V_NONE , POWER_LEVEL_UNUSED , NULL , 0 },
  193. /*UART6_RX */{ NULL , 0 , QUEC_BOOT_V_NONE , POWER_LEVEL_UNUSED , NULL , 0 },
  194. }
  195. };
  196. #endif
  197. #endif
  198. /*==================================================================
  199. *******************************spi*********************************
  200. ==================================================================*/
  201. #if (defined CONFIG_QUEC_PROJECT_FEATURE_BOOT_NAND_FLASH || defined CONFIG_QUEC_PROJECT_FEATURE_BOOT_SPI4_EXTNSFFS || defined CONFIG_QUEC_PROJECT_FEATURE_BOOT_SPI4_NORFLASH)
  202. //#define QL_BOOT_SPI_PORT_NUM_MAX (2)
  203. uint8_t ql_boot_cur_spi4_port = QL_BOOT_CUR_SPI_PORT;
  204. #if defined(CONFIG_QL_PROJECT_DEF_EC800G) || defined(CONFIG_QL_PROJECT_DEF_EG800G)
  205. ql_boot_spi_pin_cfg_t quec_boot_spi_pin_cfg_map[QL_BOOT_SPI_PORT_NUM_MAX] = /* pin initialize */
  206. {
  207. {
  208. QL_BOOT_SPI_PORT_1,
  209. /* reg func power_domain power val pad reg drv_val*/
  210. /*SPI_1_CLK */{ NULL , 1 , QUEC_BOOT_V_NONE , POWER_LEVEL_UNUSED , NULL , 0 },
  211. /*SPI_1_CS */{ NULL , 1 , QUEC_BOOT_V_NONE , POWER_LEVEL_UNUSED , NULL , 0 },
  212. /*SPI_1_MOSI */{ NULL , 1 , QUEC_BOOT_V_NONE , POWER_LEVEL_UNUSED , NULL , 0 },
  213. /*SPI_1_MISO */{ NULL , 1 , QUEC_BOOT_V_NONE , POWER_LEVEL_UNUSED , NULL , 0 },
  214. },
  215. {
  216. QL_BOOT_SPI_PORT_2,
  217. /* reg func power_domain power val pad reg drv_val*/
  218. #if 0
  219. /*SPI_2_CLK */{ &hwp_iomux->gpio_0 , 1 , QUEC_BOOT_V_NONE , POWER_LEVEL_UNUSED , &hwp_iomux->pad_gpio_0 , 8 },
  220. /*SPI_2_CS */{ &hwp_iomux->gpio_1 , 1 , QUEC_BOOT_V_NONE , POWER_LEVEL_UNUSED , &hwp_iomux->pad_gpio_1 , 8 },
  221. /*SPI_2_MOSI */{ &hwp_iomux->gpio_2 , 1 , QUEC_BOOT_V_NONE , POWER_LEVEL_UNUSED , &hwp_iomux->pad_gpio_2 , 8 },
  222. /*SPI_2_MISO */{ &hwp_iomux->gpio_3 , 1 , QUEC_BOOT_V_NONE , POWER_LEVEL_UNUSED , &hwp_iomux->pad_gpio_3 , 8 },
  223. #else //TE-A上和6线SPI复用的
  224. /*SPI_2_CLK */{ &hwp_iomux->gpio_18 , 2 , QUEC_BOOT_V_NONE , POWER_LEVEL_UNUSED , NULL , 0 },
  225. /*SPI_2_CS */{ &hwp_iomux->gpio_19 , 2 , QUEC_BOOT_V_NONE , POWER_LEVEL_UNUSED , NULL , 0 },
  226. /*SPI_2_MOSI */{ &hwp_iomux->gpio_20 , 2 , QUEC_BOOT_V_NONE , POWER_LEVEL_UNUSED , NULL , 0 },
  227. /*SPI_2_MISO */{ &hwp_iomux->gpio_21 , 2 , QUEC_BOOT_V_NONE , POWER_LEVEL_UNUSED , NULL , 0 },
  228. #endif
  229. }
  230. };
  231. #elif defined CONFIG_QL_PROJECT_DEF_EC600G
  232. ql_boot_spi_pin_cfg_t quec_boot_spi_pin_cfg_map[QL_BOOT_SPI_PORT_NUM_MAX] = /* pin initialize */
  233. {
  234. {
  235. QL_BOOT_SPI_PORT_1,
  236. /* reg func power_domain power val pad reg drv_val*/
  237. /*SPI_1_CLK */{ &hwp_iomux->sw_clk , 3 , QUEC_BOOT_V_NONE , POWER_LEVEL_UNUSED , NULL , 0 },
  238. /*SPI_1_CS */{ &hwp_iomux->sw_dio , 3 , QUEC_BOOT_V_NONE , POWER_LEVEL_UNUSED , NULL , 0 },
  239. //使用GPIO的方式来控制SPI CS引脚
  240. ///*SPI_1_CS */{ &hwp_iomux->pad_gpio_10_cfg_reg , 0 , QUEC_BOOT_V_NONE , POWER_LEVEL_UNUSED , NULL , 0 },
  241. /*SPI_1_MOSI */{ &hwp_iomux->debug_host_rx , 3 , QUEC_BOOT_V_NONE , POWER_LEVEL_UNUSED , NULL , 0 },
  242. /*SPI_1_MISO */{ &hwp_iomux->debug_host_tx , 3 , QUEC_BOOT_V_NONE , POWER_LEVEL_UNUSED , NULL , 0 },
  243. },
  244. {
  245. QL_BOOT_SPI_PORT_2,
  246. /* reg func power_domain power val pad reg drv_val*/
  247. /*SPI_2_CLK */{ &hwp_iomux->gpio_0 , 1 , QUEC_BOOT_V_NONE , POWER_LEVEL_UNUSED , NULL , 0 },
  248. /*SPI_2_CS */{ &hwp_iomux->gpio_1 , 1 , QUEC_BOOT_V_NONE , POWER_LEVEL_UNUSED , NULL , 0 },
  249. /*SPI_2_MOSI */{ &hwp_iomux->gpio_2 , 1 , QUEC_BOOT_V_NONE , POWER_LEVEL_UNUSED , NULL , 0 },
  250. /*SPI_2_MISO */{ &hwp_iomux->gpio_3 , 1 , QUEC_BOOT_V_NONE , POWER_LEVEL_UNUSED , NULL , 0 },
  251. }
  252. };
  253. #elif (defined CONFIG_QL_PROJECT_DEF_EG700G)
  254. //EG700U只支持SPI1,定义SPI2只是为了统一,可以编译通过
  255. //EG700U only support SPI1,definition of SPI2 is just for unification, and can be compiled passed
  256. ql_boot_spi_pin_cfg_t quec_boot_spi_pin_cfg_map[QL_BOOT_SPI_PORT_NUM_MAX] = /* pin initialize */
  257. {
  258. {
  259. QL_BOOT_SPI_PORT_1,
  260. /* reg func power_domain power val pad reg drv_val*/
  261. /*SPI_1_CLK */{ NULL , 1 , QUEC_BOOT_V_NONE , POWER_LEVEL_UNUSED , NULL , 0 },
  262. /*SPI_1_CS */{ NULL , 1 , QUEC_BOOT_V_NONE , POWER_LEVEL_UNUSED , NULL , 0 },
  263. /*SPI_1_MOSI */{ NULL , 1 , QUEC_BOOT_V_NONE , POWER_LEVEL_UNUSED , NULL , 0 },
  264. /*SPI_1_MISO */{ NULL , 1 , QUEC_BOOT_V_NONE , POWER_LEVEL_UNUSED , NULL , 0 },
  265. },
  266. {
  267. QL_BOOT_SPI_PORT_2,
  268. /* reg func power_domain power val pad reg drv_val*/
  269. #if 1
  270. /*SPI_2_CLK */{ &hwp_iomux->gpio_0 , 1 , QUEC_BOOT_V_NONE , POWER_LEVEL_UNUSED , NULL , 0 },
  271. /*SPI_2_CS */{ &hwp_iomux->gpio_1 , 1 , QUEC_BOOT_V_NONE , POWER_LEVEL_UNUSED , NULL , 0 },
  272. /*SPI_2_MOSI */{ &hwp_iomux->gpio_2 , 1 , QUEC_BOOT_V_NONE , POWER_LEVEL_UNUSED , NULL , 0 },
  273. /*SPI_2_MISO */{ &hwp_iomux->gpio_3 , 1 , QUEC_BOOT_V_NONE , POWER_LEVEL_UNUSED , NULL , 0 },
  274. #else
  275. /*SPI_2_CLK */{ &hwp_iomux->gpio_18 , 2 , QUEC_BOOT_V_NONE , POWER_LEVEL_UNUSED , NULL , 0 },
  276. /*SPI_2_CS */{ &hwp_iomux->gpio_19 , 2 , QUEC_BOOT_V_NONE , POWER_LEVEL_UNUSED , NULL , 0 },
  277. /*SPI_2_MOSI */{ &hwp_iomux->gpio_20 , 2 , QUEC_BOOT_V_NONE , POWER_LEVEL_UNUSED , NULL , 0 },
  278. /*SPI_2_MISO */{ &hwp_iomux->gpio_21 , 2 , QUEC_BOOT_V_NONE , POWER_LEVEL_UNUSED , NULL , 0 },
  279. #endif
  280. }
  281. };
  282. #elif defined CONFIG_QL_PROJECT_DEF_EC200G
  283. ql_boot_spi_pin_cfg_t quec_boot_spi_pin_cfg_map[QL_BOOT_SPI_PORT_NUM_MAX] = /* pin initialize */
  284. {
  285. {
  286. QL_BOOT_SPI_PORT_1,
  287. /* reg func power_domain power val pad reg drv_val */
  288. /*SPI_1_CLK */{ &hwp_iomux->sw_clk , 3 , QUEC_BOOT_V_NONE , POWER_LEVEL_UNUSED , NULL , 0 },
  289. /*SPI_1_CS */{ &hwp_iomux->sw_dio , 3 , QUEC_BOOT_V_NONE , POWER_LEVEL_UNUSED , NULL , 0 },
  290. /*SPI_1_MOSI */{ &hwp_iomux->debug_host_rx , 3 , QUEC_BOOT_V_NONE , POWER_LEVEL_UNUSED , NULL , 0 },
  291. /*SPI_1_MISO */{ &hwp_iomux->debug_host_tx , 3 , QUEC_BOOT_V_NONE , POWER_LEVEL_UNUSED , NULL , 0 },
  292. },
  293. {
  294. QL_BOOT_SPI_PORT_2,
  295. /* reg func power_domain power val pad reg drv_val */
  296. /*SPI_2_CLK */{ &hwp_iomux->gpio_0 , 1 , QUEC_BOOT_V_NONE , POWER_LEVEL_UNUSED , NULL , 0 },
  297. /*SPI_2_CS */{ &hwp_iomux->gpio_1 , 1 , QUEC_BOOT_V_NONE , POWER_LEVEL_UNUSED , NULL , 0 },
  298. /*SPI_2_MOSI */{ &hwp_iomux->gpio_2 , 1 , QUEC_BOOT_V_NONE , POWER_LEVEL_UNUSED , NULL , 0 },
  299. /*SPI_2_MISO */{ &hwp_iomux->gpio_3 , 1 , QUEC_BOOT_V_NONE , POWER_LEVEL_UNUSED , NULL , 0 },
  300. }
  301. };
  302. #endif
  303. #endif
  304. /*==================================================================
  305. *******************************spi6*********************************
  306. ==================================================================*/
  307. #ifndef CONFIG_QUEC_PROJECT_FEATURE_SPI6_EXT_NOR
  308. __attribute__((weak)) uint8_t ql_spi6_clk_div = 0xb;
  309. #endif
  310. #if (defined CONFIG_QUEC_PROJECT_FEATURE_SPI6_EXT_NOR || defined CONFIG_QUEC_PROJECT_FEATURE_BOOT_SPI6_NAND)
  311. //#define QL_BOOT_SPI6_PORT_NUM_MAX (2)
  312. uint8_t ql_boot_cur_spi6_port = QL_BOOT_CUR_SPI6_PORT;
  313. ql_boot_spi6_pin_cfg_t quec_boot_spi6_pin_cfg_map[QL_BOOT_SPI6_PORT_NUM_MAX] = /* pin initialize */
  314. {
  315. {
  316. QL_BOOT_SPI_PORT_1,
  317. /* reg func power_domain power val pad reg drv_val */
  318. /*SPI_1_CLK */{ &hwp_iomux->gpio_18 , 1 , QUEC_BOOT_V_NONE , POWER_LEVEL_UNUSED , &hwp_iomux->pad_gpio_18 , 3 },
  319. /*SPI_1_CS */{ &hwp_iomux->gpio_19 , 1 , QUEC_BOOT_V_NONE , POWER_LEVEL_UNUSED , &hwp_iomux->pad_gpio_19 , 3 },
  320. /*SPI_1_SIO0 */{ &hwp_iomux->gpio_20 , 1 , QUEC_BOOT_V_NONE , POWER_LEVEL_UNUSED , &hwp_iomux->pad_gpio_20 , 3 },
  321. /*SPI_1_SIO1 */{ &hwp_iomux->gpio_21 , 1 , QUEC_BOOT_V_NONE , POWER_LEVEL_UNUSED , &hwp_iomux->pad_gpio_21 , 3 },
  322. /*SPI_1_SIO2 */{ &hwp_iomux->gpio_22 , 1 , QUEC_BOOT_V_NONE , POWER_LEVEL_UNUSED , &hwp_iomux->pad_gpio_22 , 3 },
  323. /*SPI_1_SIO3 */{ &hwp_iomux->gpio_23 , 1 , QUEC_BOOT_V_NONE , POWER_LEVEL_UNUSED , &hwp_iomux->pad_gpio_23 , 3 },
  324. },
  325. {
  326. /*
  327. lcd power_domain: POWER_LEVEL_1700MV --POWER_LEVEL_3200MV
  328. If your module supports GPS, the LCD voltage range can only be set to 1800mV to 1900mV.
  329. Do not go beyond this range, otherwise you will burn out the GPS chip,
  330. because the GPS chip is also powered by the LCD voltage range.
  331. */
  332. QL_BOOT_SPI_PORT_2,
  333. #if defined(CONFIG_QL_PROJECT_DEF_EC800G) || defined(CONFIG_QL_PROJECT_DEF_EG800G)
  334. //EC800G只支持6线SPI1,定义6线SPI2只是为了统一,可以编译通过
  335. //EC800G only support Quad SPI1,definition of Quad SPI2 is just for unification, and can be compiled passed
  336. /* reg func power_domain power val pad reg drv_val */
  337. /*SPI_2_CLK */{ NULL , 1 , QUEC_BOOT_V_LCD , POWER_LEVEL_1800MV , NULL , 0 },
  338. /*SPI_2_CS */{ NULL , 1 , QUEC_BOOT_V_LCD , POWER_LEVEL_1800MV , NULL , 0 },
  339. /*SPI_2_SIO0 */{ NULL , 1 , QUEC_BOOT_V_LCD , POWER_LEVEL_1800MV , NULL , 0 },
  340. /*SPI_2_SIO1 */{ NULL , 1 , QUEC_BOOT_V_LCD , POWER_LEVEL_1800MV , NULL , 0 },
  341. /*SPI_2_SIO2 */{ NULL , 1 , QUEC_BOOT_V_LCD , POWER_LEVEL_1800MV , NULL , 0 },
  342. /*SPI_2_SIO3 */{ NULL , 1 , QUEC_BOOT_V_LCD , POWER_LEVEL_1800MV , NULL , 0 },
  343. #elif (defined CONFIG_QL_PROJECT_DEF_EC600G) || (defined CONFIG_QL_PROJECT_DEF_EG700G) || (defined CONFIG_QL_PROJECT_DEF_EC200G)
  344. /* reg func power_domain power val pad reg drv_val */
  345. /*SPI_2_CLK */{ &hwp_iomux->spi_lcd_sio , 1 , QUEC_BOOT_V_LCD , POWER_LEVEL_1800MV , &hwp_iomux->pad_spi_lcd_sio , 6 },
  346. /*SPI_2_CS */{ &hwp_iomux->spi_lcd_sdc , 1 , QUEC_BOOT_V_LCD , POWER_LEVEL_1800MV , &hwp_iomux->pad_spi_lcd_sdc , 6 },
  347. /*SPI_2_SIO0 */{ &hwp_iomux->spi_lcd_clk , 1 , QUEC_BOOT_V_LCD , POWER_LEVEL_1800MV , &hwp_iomux->pad_spi_lcd_clk , 6 },
  348. /*SPI_2_SIO1 */{ &hwp_iomux->spi_lcd_cs , 1 , QUEC_BOOT_V_LCD , POWER_LEVEL_1800MV , &hwp_iomux->pad_spi_lcd_cs , 6 },
  349. /*SPI_2_SIO2 */{ &hwp_iomux->spi_lcd_select , 1 , QUEC_BOOT_V_LCD , POWER_LEVEL_1800MV , &hwp_iomux->pad_spi_lcd_select , 6 },
  350. /*SPI_2_SIO3 */{ &hwp_iomux->lcd_fmark , 1 , QUEC_BOOT_V_LCD , POWER_LEVEL_1800MV , &hwp_iomux->pad_lcd_fmark , 6 },
  351. #endif
  352. }
  353. };
  354. #endif
  355. /********************************************************************************
  356. ADC channel corresponds to the drv
  357. *********************************************************************************/
  358. #ifdef CONFIG_QUEC_PROJECT_FEATURE_BOOT_ADC
  359. #define ADC_CHANNEL_NONE (-1)
  360. const ql_boot_adc_channel_s ql_boot_adc_channel_num =
  361. /* ADC0 ADC1 ADC2 ADC3 Vbat */
  362. #if defined(CONFIG_QL_PROJECT_DEF_EC800G) || defined(CONFIG_QL_PROJECT_DEF_EG800G)
  363. { ADC_CHANNEL_1, ADC_CHANNEL_2, ADC_CHANNEL_NONE, ADC_CHANNEL_NONE, ADC_CHANNEL_VBATSENSE};
  364. #elif defined CONFIG_QL_PROJECT_DEF_EC600G
  365. { ADC_CHANNEL_1, ADC_CHANNEL_2, ADC_CHANNEL_3 , ADC_CHANNEL_4, ADC_CHANNEL_VBATSENSE};
  366. #elif defined CONFIG_QL_PROJECT_DEF_EG700G
  367. { ADC_CHANNEL_1, ADC_CHANNEL_2, ADC_CHANNEL_3 , ADC_CHANNEL_4, ADC_CHANNEL_VBATSENSE};
  368. #elif defined CONFIG_QL_PROJECT_DEF_EC200G
  369. { ADC_CHANNEL_1, ADC_CHANNEL_2, ADC_CHANNEL_3 , ADC_CHANNEL_NONE, ADC_CHANNEL_VBATSENSE};
  370. #endif
  371. #endif