pwrctrl.h 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462
  1. /* Copyright (C) 2018 RDA Technologies Limited and/or its affiliates("RDA").
  2. * All rights reserved.
  3. *
  4. * This software is supplied "AS IS" without any warranties.
  5. * RDA assumes no responsibility or liability for the use of the software,
  6. * conveys no license or title under any patent, copyright, or mask work
  7. * right to the product. RDA reserves the right to make changes in the
  8. * software without notification. RDA also make no representation or
  9. * warranty that such application will be suitable for the specified use
  10. * without further testing or modification.
  11. */
  12. #ifndef _PWRCTRL_H_
  13. #define _PWRCTRL_H_
  14. // Auto generated by dtools(see dtools.txt for its version).
  15. // Don't edit it manually!
  16. #define REG_PWRCTRL_SET_OFFSET (1024)
  17. #define REG_PWRCTRL_CLR_OFFSET (2048)
  18. #define REG_PWRCTRL_BASE (0x51707000)
  19. typedef volatile struct
  20. {
  21. uint32_t pwrctrl_hwen; // 0x00000000
  22. uint32_t ap_pwr_ctrl; // 0x00000004
  23. uint32_t cp_pwr_ctrl; // 0x00000008
  24. uint32_t pub_pwr_ctrl; // 0x0000000c
  25. uint32_t rf_pwr_ctrl; // 0x00000010
  26. uint32_t usb_pwr_ctrl; // 0x00000014
  27. uint32_t lte_pwr_ctrl; // 0x00000018
  28. uint32_t gnss_pwr_ctrl; // 0x0000001c
  29. uint32_t ap_pwr_stat; // 0x00000020
  30. uint32_t cp_pwr_stat; // 0x00000024
  31. uint32_t pub_pwr_stat; // 0x00000028
  32. uint32_t rf_pwr_stat; // 0x0000002c
  33. uint32_t usb_pwr_stat; // 0x00000030
  34. uint32_t lte_pwr_stat; // 0x00000034
  35. uint32_t gnss_pwr_stat; // 0x00000038
  36. uint32_t state_delay; // 0x0000003c
  37. uint32_t pd_m_delay; // 0x00000040
  38. uint32_t pd_d_delay; // 0x00000044
  39. uint32_t psram_hold_ctrl; // 0x00000048
  40. uint32_t slp_bypass; // 0x0000004c
  41. uint32_t slp_timeout_flag; // 0x00000050
  42. uint32_t pwrctrl_int_en_ap; // 0x00000054
  43. uint32_t pwrctrl_int_en_cp; // 0x00000058
  44. uint32_t pwrctrl_sm_state; // 0x0000005c
  45. uint32_t __96[232]; // 0x00000060
  46. uint32_t pwrctrl_hwen_set; // 0x00000400
  47. uint32_t __1028[2]; // 0x00000404
  48. uint32_t pub_pwr_ctrl_set; // 0x0000040c
  49. uint32_t __1040[15]; // 0x00000410
  50. uint32_t slp_bypass_set; // 0x0000044c
  51. uint32_t slp_timeout_flag_set; // 0x00000450
  52. uint32_t pwrctrl_int_en_ap_set; // 0x00000454
  53. uint32_t pwrctrl_int_en_cp_set; // 0x00000458
  54. uint32_t __1116[233]; // 0x0000045c
  55. uint32_t pwrctrl_hwen_clr; // 0x00000800
  56. uint32_t __2052[2]; // 0x00000804
  57. uint32_t pub_pwr_ctrl_clr; // 0x0000080c
  58. uint32_t __2064[15]; // 0x00000810
  59. uint32_t slp_bypass_clr; // 0x0000084c
  60. uint32_t slp_timeout_flag_clr; // 0x00000850
  61. uint32_t pwrctrl_int_en_ap_clr; // 0x00000854
  62. uint32_t pwrctrl_int_en_cp_clr; // 0x00000858
  63. } HWP_PWRCTRL_T;
  64. #define hwp_pwrctrl ((HWP_PWRCTRL_T *)REG_ACCESS_ADDRESS(REG_PWRCTRL_BASE))
  65. // pwrctrl_hwen
  66. typedef union {
  67. uint32_t v;
  68. struct
  69. {
  70. uint32_t ap_pwr_hwen : 1; // [0]
  71. uint32_t cp_pwr_hwen : 1; // [1]
  72. uint32_t __31_2 : 30; // [31:2]
  73. } b;
  74. } REG_PWRCTRL_PWRCTRL_HWEN_T;
  75. // ap_pwr_ctrl
  76. typedef union {
  77. uint32_t v;
  78. struct
  79. {
  80. uint32_t ap_pwr_ctrl : 1; // [0]
  81. uint32_t __31_1 : 31; // [31:1]
  82. } b;
  83. } REG_PWRCTRL_AP_PWR_CTRL_T;
  84. // cp_pwr_ctrl
  85. typedef union {
  86. uint32_t v;
  87. struct
  88. {
  89. uint32_t cp_pwr_ctrl : 1; // [0]
  90. uint32_t __31_1 : 31; // [31:1]
  91. } b;
  92. } REG_PWRCTRL_CP_PWR_CTRL_T;
  93. // pub_pwr_ctrl
  94. typedef union {
  95. uint32_t v;
  96. struct
  97. {
  98. uint32_t ap_pol : 1; // [0]
  99. uint32_t cp_pol : 1; // [1]
  100. uint32_t __31_2 : 30; // [31:2]
  101. } b;
  102. } REG_PWRCTRL_PUB_PWR_CTRL_T;
  103. // rf_pwr_ctrl
  104. typedef union {
  105. uint32_t v;
  106. struct
  107. {
  108. uint32_t rf_pwr_ctrl : 1; // [0]
  109. uint32_t __31_1 : 31; // [31:1]
  110. } b;
  111. } REG_PWRCTRL_RF_PWR_CTRL_T;
  112. // usb_pwr_ctrl
  113. typedef union {
  114. uint32_t v;
  115. struct
  116. {
  117. uint32_t usb_pwr_ctrl : 1; // [0]
  118. uint32_t __31_1 : 31; // [31:1]
  119. } b;
  120. } REG_PWRCTRL_USB_PWR_CTRL_T;
  121. // lte_pwr_ctrl
  122. typedef union {
  123. uint32_t v;
  124. struct
  125. {
  126. uint32_t lte_pwr_ctrl : 1; // [0]
  127. uint32_t __31_1 : 31; // [31:1]
  128. } b;
  129. } REG_PWRCTRL_LTE_PWR_CTRL_T;
  130. // gnss_pwr_ctrl
  131. typedef union {
  132. uint32_t v;
  133. struct
  134. {
  135. uint32_t gnss_pwr_ctrl : 1; // [0]
  136. uint32_t __31_1 : 31; // [31:1]
  137. } b;
  138. } REG_PWRCTRL_GNSS_PWR_CTRL_T;
  139. // ap_pwr_stat
  140. typedef union {
  141. uint32_t v;
  142. struct
  143. {
  144. uint32_t ap_pwr_state : 1; // [0], read only
  145. uint32_t ap_pwr_stable : 1; // [1], read only
  146. uint32_t __31_2 : 30; // [31:2]
  147. } b;
  148. } REG_PWRCTRL_AP_PWR_STAT_T;
  149. // cp_pwr_stat
  150. typedef union {
  151. uint32_t v;
  152. struct
  153. {
  154. uint32_t cp_pwr_state : 1; // [0], read only
  155. uint32_t cp_pwr_stable : 1; // [1], read only
  156. uint32_t __31_2 : 30; // [31:2]
  157. } b;
  158. } REG_PWRCTRL_CP_PWR_STAT_T;
  159. // pub_pwr_stat
  160. typedef union {
  161. uint32_t v;
  162. struct
  163. {
  164. uint32_t pub_pwr_state : 1; // [0], read only
  165. uint32_t pub_pwr_stable : 1; // [1], read only
  166. uint32_t __31_2 : 30; // [31:2]
  167. } b;
  168. } REG_PWRCTRL_PUB_PWR_STAT_T;
  169. // rf_pwr_stat
  170. typedef union {
  171. uint32_t v;
  172. struct
  173. {
  174. uint32_t rf_pwr_state : 1; // [0], read only
  175. uint32_t rf_pwr_stable : 1; // [1], read only
  176. uint32_t __31_2 : 30; // [31:2]
  177. } b;
  178. } REG_PWRCTRL_RF_PWR_STAT_T;
  179. // usb_pwr_stat
  180. typedef union {
  181. uint32_t v;
  182. struct
  183. {
  184. uint32_t usb_pwr_state : 1; // [0], read only
  185. uint32_t usb_pwr_stable : 1; // [1], read only
  186. uint32_t __31_2 : 30; // [31:2]
  187. } b;
  188. } REG_PWRCTRL_USB_PWR_STAT_T;
  189. // lte_pwr_stat
  190. typedef union {
  191. uint32_t v;
  192. struct
  193. {
  194. uint32_t lte_pwr_state : 1; // [0], read only
  195. uint32_t lte_pwr_stable : 1; // [1], read only
  196. uint32_t __31_2 : 30; // [31:2]
  197. } b;
  198. } REG_PWRCTRL_LTE_PWR_STAT_T;
  199. // gnss_pwr_stat
  200. typedef union {
  201. uint32_t v;
  202. struct
  203. {
  204. uint32_t gnss_pwr_state : 1; // [0], read only
  205. uint32_t gnss_pwr_stable : 1; // [1], read only
  206. uint32_t __31_2 : 30; // [31:2]
  207. } b;
  208. } REG_PWRCTRL_GNSS_PWR_STAT_T;
  209. // state_delay
  210. typedef union {
  211. uint32_t v;
  212. struct
  213. {
  214. uint32_t delay_value : 16; // [15:0]
  215. uint32_t __31_16 : 16; // [31:16]
  216. } b;
  217. } REG_PWRCTRL_STATE_DELAY_T;
  218. // pd_m_delay
  219. typedef union {
  220. uint32_t v;
  221. struct
  222. {
  223. uint32_t delay_value : 16; // [15:0]
  224. uint32_t __31_16 : 16; // [31:16]
  225. } b;
  226. } REG_PWRCTRL_PD_M_DELAY_T;
  227. // pd_d_delay
  228. typedef union {
  229. uint32_t v;
  230. struct
  231. {
  232. uint32_t delay_value : 16; // [15:0]
  233. uint32_t __31_16 : 16; // [31:16]
  234. } b;
  235. } REG_PWRCTRL_PD_D_DELAY_T;
  236. // psram_hold_ctrl
  237. typedef union {
  238. uint32_t v;
  239. struct
  240. {
  241. uint32_t latch_en : 1; // [0]
  242. uint32_t __31_1 : 31; // [31:1]
  243. } b;
  244. } REG_PWRCTRL_PSRAM_HOLD_CTRL_T;
  245. // slp_bypass
  246. typedef union {
  247. uint32_t v;
  248. struct
  249. {
  250. uint32_t ap_slp_bypass : 1; // [0]
  251. uint32_t cp_slp_bypass : 1; // [1]
  252. uint32_t pub_slp_bypass : 1; // [2]
  253. uint32_t rf_slp_bypass : 1; // [3]
  254. uint32_t usb_slp_bypass : 1; // [4]
  255. uint32_t lte_slp_bypass : 1; // [5]
  256. uint32_t gnss_slp_bypass : 1; // [6]
  257. uint32_t __31_7 : 25; // [31:7]
  258. } b;
  259. } REG_PWRCTRL_SLP_BYPASS_T;
  260. // slp_timeout_flag
  261. typedef union {
  262. uint32_t v;
  263. struct
  264. {
  265. uint32_t ap_slp_timeout : 1; // [0]
  266. uint32_t cp_slp_timeout : 1; // [1]
  267. uint32_t pub_slp_timeout : 1; // [2]
  268. uint32_t rf_slp_timeout : 1; // [3]
  269. uint32_t usb_slp_timeout : 1; // [4]
  270. uint32_t lte_slp_timeout : 1; // [5]
  271. uint32_t gnss_slp_timeout : 1; // [6]
  272. uint32_t __31_7 : 25; // [31:7]
  273. } b;
  274. } REG_PWRCTRL_SLP_TIMEOUT_FLAG_T;
  275. // pwrctrl_int_en_ap
  276. typedef union {
  277. uint32_t v;
  278. struct
  279. {
  280. uint32_t pwrctrl_int_en_ap_sys : 1; // [0]
  281. uint32_t pwrctrl_int_en_cp_sys : 1; // [1]
  282. uint32_t pwrctrl_int_en_pub_sys : 1; // [2]
  283. uint32_t pwrctrl_int_en_rf_sys : 1; // [3]
  284. uint32_t pwrctrl_int_en_usb_sys : 1; // [4]
  285. uint32_t pwrctrl_int_en_lte_sys : 1; // [5]
  286. uint32_t pwrctrl_int_en_gnss_sys : 1; // [6]
  287. uint32_t __31_7 : 25; // [31:7]
  288. } b;
  289. } REG_PWRCTRL_PWRCTRL_INT_EN_AP_T;
  290. // pwrctrl_int_en_cp
  291. typedef union {
  292. uint32_t v;
  293. struct
  294. {
  295. uint32_t pwrctrl_int_en_ap_sys : 1; // [0]
  296. uint32_t pwrctrl_int_en_cp_sys : 1; // [1]
  297. uint32_t pwrctrl_int_en_pub_sys : 1; // [2]
  298. uint32_t pwrctrl_int_en_rf_sys : 1; // [3]
  299. uint32_t pwrctrl_int_en_usb_sys : 1; // [4]
  300. uint32_t pwrctrl_int_en_lte_sys : 1; // [5]
  301. uint32_t pwrctrl_int_en_gnss_sys : 1; // [6]
  302. uint32_t __31_7 : 25; // [31:7]
  303. } b;
  304. } REG_PWRCTRL_PWRCTRL_INT_EN_CP_T;
  305. // pwrctrl_sm_state
  306. typedef union {
  307. uint32_t v;
  308. struct
  309. {
  310. uint32_t ap_sm_state : 4; // [3:0], read only
  311. uint32_t cp_sm_state : 4; // [7:4], read only
  312. uint32_t pub_sm_state : 4; // [11:8], read only
  313. uint32_t rf_sm_state : 4; // [15:12], read only
  314. uint32_t usb_sm_state : 4; // [19:16], read only
  315. uint32_t lte_sm_state : 4; // [23:20], read only
  316. uint32_t gnss_sm_state : 4; // [27:24], read only
  317. uint32_t __31_28 : 4; // [31:28]
  318. } b;
  319. } REG_PWRCTRL_PWRCTRL_SM_STATE_T;
  320. // pwrctrl_hwen
  321. #define PWRCTRL_AP_PWR_HWEN (1 << 0)
  322. #define PWRCTRL_CP_PWR_HWEN (1 << 1)
  323. // ap_pwr_ctrl
  324. #define PWRCTRL_AP_PWR_CTRL (1 << 0)
  325. // cp_pwr_ctrl
  326. #define PWRCTRL_CP_PWR_CTRL (1 << 0)
  327. // pub_pwr_ctrl
  328. #define PWRCTRL_AP_POL (1 << 0)
  329. #define PWRCTRL_CP_POL (1 << 1)
  330. // rf_pwr_ctrl
  331. #define PWRCTRL_RF_PWR_CTRL (1 << 0)
  332. // usb_pwr_ctrl
  333. #define PWRCTRL_USB_PWR_CTRL (1 << 0)
  334. // lte_pwr_ctrl
  335. #define PWRCTRL_LTE_PWR_CTRL (1 << 0)
  336. // gnss_pwr_ctrl
  337. #define PWRCTRL_GNSS_PWR_CTRL (1 << 0)
  338. // ap_pwr_stat
  339. #define PWRCTRL_AP_PWR_STATE (1 << 0)
  340. #define PWRCTRL_AP_PWR_STABLE (1 << 1)
  341. // cp_pwr_stat
  342. #define PWRCTRL_CP_PWR_STATE (1 << 0)
  343. #define PWRCTRL_CP_PWR_STABLE (1 << 1)
  344. // pub_pwr_stat
  345. #define PWRCTRL_PUB_PWR_STATE (1 << 0)
  346. #define PWRCTRL_PUB_PWR_STABLE (1 << 1)
  347. // rf_pwr_stat
  348. #define PWRCTRL_RF_PWR_STATE (1 << 0)
  349. #define PWRCTRL_RF_PWR_STABLE (1 << 1)
  350. // usb_pwr_stat
  351. #define PWRCTRL_USB_PWR_STATE (1 << 0)
  352. #define PWRCTRL_USB_PWR_STABLE (1 << 1)
  353. // lte_pwr_stat
  354. #define PWRCTRL_LTE_PWR_STATE (1 << 0)
  355. #define PWRCTRL_LTE_PWR_STABLE (1 << 1)
  356. // gnss_pwr_stat
  357. #define PWRCTRL_GNSS_PWR_STATE (1 << 0)
  358. #define PWRCTRL_GNSS_PWR_STABLE (1 << 1)
  359. // state_delay
  360. #define PWRCTRL_DELAY_VALUE(n) (((n)&0xffff) << 0)
  361. // pd_m_delay
  362. #define PWRCTRL_DELAY_VALUE(n) (((n)&0xffff) << 0)
  363. // pd_d_delay
  364. #define PWRCTRL_DELAY_VALUE(n) (((n)&0xffff) << 0)
  365. // psram_hold_ctrl
  366. #define PWRCTRL_LATCH_EN (1 << 0)
  367. // slp_bypass
  368. #define PWRCTRL_AP_SLP_BYPASS (1 << 0)
  369. #define PWRCTRL_CP_SLP_BYPASS (1 << 1)
  370. #define PWRCTRL_PUB_SLP_BYPASS (1 << 2)
  371. #define PWRCTRL_RF_SLP_BYPASS (1 << 3)
  372. #define PWRCTRL_USB_SLP_BYPASS (1 << 4)
  373. #define PWRCTRL_LTE_SLP_BYPASS (1 << 5)
  374. #define PWRCTRL_GNSS_SLP_BYPASS (1 << 6)
  375. // slp_timeout_flag
  376. #define PWRCTRL_AP_SLP_TIMEOUT (1 << 0)
  377. #define PWRCTRL_CP_SLP_TIMEOUT (1 << 1)
  378. #define PWRCTRL_PUB_SLP_TIMEOUT (1 << 2)
  379. #define PWRCTRL_RF_SLP_TIMEOUT (1 << 3)
  380. #define PWRCTRL_USB_SLP_TIMEOUT (1 << 4)
  381. #define PWRCTRL_LTE_SLP_TIMEOUT (1 << 5)
  382. #define PWRCTRL_GNSS_SLP_TIMEOUT (1 << 6)
  383. // pwrctrl_int_en_ap
  384. #define PWRCTRL_PWRCTRL_INT_EN_AP_SYS (1 << 0)
  385. #define PWRCTRL_PWRCTRL_INT_EN_CP_SYS (1 << 1)
  386. #define PWRCTRL_PWRCTRL_INT_EN_PUB_SYS (1 << 2)
  387. #define PWRCTRL_PWRCTRL_INT_EN_RF_SYS (1 << 3)
  388. #define PWRCTRL_PWRCTRL_INT_EN_USB_SYS (1 << 4)
  389. #define PWRCTRL_PWRCTRL_INT_EN_LTE_SYS (1 << 5)
  390. #define PWRCTRL_PWRCTRL_INT_EN_GNSS_SYS (1 << 6)
  391. // pwrctrl_int_en_cp
  392. #define PWRCTRL_PWRCTRL_INT_EN_AP_SYS (1 << 0)
  393. #define PWRCTRL_PWRCTRL_INT_EN_CP_SYS (1 << 1)
  394. #define PWRCTRL_PWRCTRL_INT_EN_PUB_SYS (1 << 2)
  395. #define PWRCTRL_PWRCTRL_INT_EN_RF_SYS (1 << 3)
  396. #define PWRCTRL_PWRCTRL_INT_EN_USB_SYS (1 << 4)
  397. #define PWRCTRL_PWRCTRL_INT_EN_LTE_SYS (1 << 5)
  398. #define PWRCTRL_PWRCTRL_INT_EN_GNSS_SYS (1 << 6)
  399. // pwrctrl_sm_state
  400. #define PWRCTRL_AP_SM_STATE(n) (((n)&0xf) << 0)
  401. #define PWRCTRL_CP_SM_STATE(n) (((n)&0xf) << 4)
  402. #define PWRCTRL_PUB_SM_STATE(n) (((n)&0xf) << 8)
  403. #define PWRCTRL_RF_SM_STATE(n) (((n)&0xf) << 12)
  404. #define PWRCTRL_USB_SM_STATE(n) (((n)&0xf) << 16)
  405. #define PWRCTRL_LTE_SM_STATE(n) (((n)&0xf) << 20)
  406. #define PWRCTRL_GNSS_SM_STATE(n) (((n)&0xf) << 24)
  407. #endif // _PWRCTRL_H_