pmu_struct.h 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756
  1. /**
  2. * SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. */
  6. #pragma once
  7. #include <stdint.h>
  8. #include <stddef.h>
  9. #ifdef __cplusplus
  10. extern "C" {
  11. #endif
  12. #include "soc.h"
  13. #include "soc/pmu_reg.h"
  14. typedef union {
  15. struct {
  16. uint32_t reserved0 : 21;
  17. uint32_t vdd_spi_pd_en: 1;
  18. uint32_t mem_dslp : 1;
  19. uint32_t mem_pd_en : 4;
  20. uint32_t wifi_pd_en : 1;
  21. uint32_t reserved1 : 1;
  22. uint32_t cpu_pd_en : 1;
  23. uint32_t aon_pd_en : 1;
  24. uint32_t top_pd_en : 1;
  25. };
  26. uint32_t val;
  27. } pmu_hp_dig_power_reg_t;
  28. typedef union {
  29. struct {
  30. uint32_t reserved0: 30;
  31. uint32_t code : 2;
  32. };
  33. uint32_t val;
  34. } pmu_hp_icg_modem_reg_t;
  35. typedef union {
  36. struct {
  37. uint32_t reserved0 : 24;
  38. uint32_t uart_wakeup_en : 1;
  39. uint32_t lp_pad_hold_all: 1;
  40. uint32_t hp_pad_hold_all: 1;
  41. uint32_t dig_pad_slp_sel: 1;
  42. uint32_t dig_pause_wdt : 1;
  43. uint32_t dig_cpu_stall : 1;
  44. uint32_t reserved1 : 2;
  45. };
  46. uint32_t val;
  47. } pmu_hp_sys_cntl_reg_t;
  48. typedef union {
  49. struct {
  50. uint32_t reserved0 : 26;
  51. uint32_t i2c_iso_en : 1;
  52. uint32_t i2c_retention: 1;
  53. uint32_t xpd_bb_i2c : 1;
  54. uint32_t xpd_bbpll_i2c: 1;
  55. uint32_t xpd_bbpll : 1;
  56. uint32_t reserved1 : 1;
  57. };
  58. uint32_t val;
  59. } pmu_hp_clk_power_reg_t;
  60. typedef union {
  61. struct {
  62. uint32_t reserved0 : 25;
  63. uint32_t xpd_bias : 1;
  64. uint32_t dbg_atten : 4;
  65. uint32_t pd_cur : 1;
  66. uint32_t bias_sleep: 1;
  67. };
  68. uint32_t val;
  69. } pmu_hp_bias_reg_t;
  70. typedef union {
  71. struct { /* HP: Active State */
  72. uint32_t reserved0 : 4;
  73. uint32_t hp_sleep2active_backup_modem_clk_code: 2;
  74. uint32_t hp_modem2active_backup_modem_clk_code: 2;
  75. uint32_t reserved1 : 2;
  76. uint32_t hp_active_retention_mode : 1;
  77. uint32_t hp_sleep2active_retention_en : 1;
  78. uint32_t hp_modem2active_retention_en : 1;
  79. uint32_t reserved2 : 1;
  80. uint32_t hp_sleep2active_backup_clk_sel : 2;
  81. uint32_t hp_modem2active_backup_clk_sel : 2;
  82. uint32_t reserved3 : 2;
  83. uint32_t hp_sleep2active_backup_mode : 3;
  84. uint32_t hp_modem2active_backup_mode : 3;
  85. uint32_t reserved4 : 3;
  86. uint32_t hp_sleep2active_backup_en : 1;
  87. uint32_t hp_modem2active_backup_en : 1;
  88. uint32_t reserved5 : 1;
  89. };
  90. struct { /* HP: Modem State */
  91. uint32_t reserved6 : 4;
  92. uint32_t hp_sleep2modem_backup_modem_clk_code : 2;
  93. uint32_t reserved7 : 4;
  94. uint32_t hp_modem_retention_mode : 1;
  95. uint32_t hp_sleep2modem_retention_en : 1;
  96. uint32_t reserved8 : 2;
  97. uint32_t hp_sleep2modem_backup_clk_sel : 2;
  98. uint32_t reserved9 : 4;
  99. uint32_t hp_sleep2modem_backup_mode : 3;
  100. uint32_t reserved10 : 6;
  101. uint32_t hp_sleep2modem_backup_en : 1;
  102. uint32_t reserved11 : 2;
  103. };
  104. struct { /* HP: Sleep State */
  105. uint32_t reserved12 : 6;
  106. uint32_t hp_modem2sleep_backup_modem_clk_code : 2;
  107. uint32_t hp_active2sleep_backup_modem_clk_code: 2;
  108. uint32_t hp_sleep_retention_mode : 1;
  109. uint32_t reserved13 : 1;
  110. uint32_t hp_modem2sleep_retention_en : 1;
  111. uint32_t hp_active2sleep_retention_en : 1;
  112. uint32_t reserved14 : 2;
  113. uint32_t hp_modem2sleep_backup_clk_sel : 2;
  114. uint32_t hp_active2sleep_backup_clk_sel : 2;
  115. uint32_t reserved15 : 3;
  116. uint32_t hp_modem2sleep_backup_mode : 3;
  117. uint32_t hp_active2sleep_backup_mode : 3;
  118. uint32_t reserved16 : 1;
  119. uint32_t hp_modem2sleep_backup_en : 1;
  120. uint32_t hp_active2sleep_backup_en : 1;
  121. };
  122. uint32_t val;
  123. } pmu_hp_backup_reg_t;
  124. typedef union {
  125. struct {
  126. uint32_t reserved0 : 26;
  127. uint32_t dig_sysclk_nodiv: 1;
  128. uint32_t icg_sysclk_en : 1;
  129. uint32_t sysclk_slp_sel : 1;
  130. uint32_t icg_slp_sel : 1;
  131. uint32_t dig_sysclk_sel : 2;
  132. };
  133. uint32_t val;
  134. } pmu_hp_sysclk_reg_t;
  135. typedef union {
  136. struct {
  137. uint32_t reserved0 : 4; /* Only HP_ACTIVE modem under hp system is valid */
  138. uint32_t lp_dbias_vol : 5; /* Only HP_ACTIVE modem under hp system is valid */
  139. uint32_t hp_dbias_vol : 5; /* Only HP_ACTIVE modem under hp system is valid */
  140. uint32_t dbias_sel : 1; /* Only HP_ACTIVE modem under hp system is valid */
  141. uint32_t dbias_init : 1; /* Only HP_ACTIVE modem under hp system is valid */
  142. uint32_t slp_mem_xpd : 1;
  143. uint32_t slp_logic_xpd : 1;
  144. uint32_t xpd : 1;
  145. uint32_t slp_mem_dbias : 4;
  146. uint32_t slp_logic_dbias: 4;
  147. uint32_t dbias : 5;
  148. };
  149. uint32_t val;
  150. } pmu_hp_regulator0_reg_t;
  151. typedef union {
  152. struct {
  153. uint32_t reserved0: 8;
  154. uint32_t drv_b : 24;
  155. };
  156. uint32_t val;
  157. } pmu_hp_regulator1_reg_t;
  158. typedef union {
  159. struct {
  160. uint32_t reserved0: 31;
  161. uint32_t xpd_xtal : 1;
  162. };
  163. uint32_t val;
  164. } pmu_hp_xtal_reg_t;
  165. typedef struct pmu_hp_hw_regmap_t{
  166. pmu_hp_dig_power_reg_t dig_power;
  167. uint32_t icg_func;
  168. uint32_t icg_apb;
  169. pmu_hp_icg_modem_reg_t icg_modem;
  170. pmu_hp_sys_cntl_reg_t syscntl;
  171. pmu_hp_clk_power_reg_t clk_power;
  172. pmu_hp_bias_reg_t bias;
  173. pmu_hp_backup_reg_t backup;
  174. uint32_t backup_clk;
  175. pmu_hp_sysclk_reg_t sysclk;
  176. pmu_hp_regulator0_reg_t regulator0;
  177. pmu_hp_regulator1_reg_t regulator1;
  178. pmu_hp_xtal_reg_t xtal;
  179. } pmu_hp_hw_regmap_t;
  180. /** */
  181. typedef union {
  182. struct {
  183. uint32_t reserved0: 21;
  184. uint32_t slp_xpd : 1;
  185. uint32_t xpd : 1;
  186. uint32_t slp_dbias: 4;
  187. uint32_t dbias : 5;
  188. };
  189. uint32_t val;
  190. } pmu_lp_regulator0_reg_t;
  191. typedef union {
  192. struct {
  193. uint32_t reserved0: 28;
  194. uint32_t drv_b : 4;
  195. };
  196. uint32_t val;
  197. } pmu_lp_regulator1_reg_t;
  198. typedef union {
  199. struct {
  200. uint32_t reserved0: 31;
  201. uint32_t xpd_xtal : 1;
  202. };
  203. uint32_t val;
  204. } pmu_lp_xtal_reg_t;
  205. typedef union {
  206. struct {
  207. uint32_t reserved0 : 30;
  208. uint32_t mem_dslp : 1;
  209. uint32_t peri_pd_en: 1;
  210. };
  211. uint32_t val;
  212. } pmu_lp_dig_power_reg_t;
  213. typedef union {
  214. struct {
  215. uint32_t reserved0 : 28;
  216. uint32_t xpd_xtal32k: 1;
  217. uint32_t xpd_rc32k : 1;
  218. uint32_t xpd_fosc : 1;
  219. uint32_t pd_osc : 1;
  220. };
  221. uint32_t val;
  222. } pmu_lp_clk_power_reg_t;
  223. typedef union {
  224. struct {
  225. uint32_t reserved0 : 25;
  226. uint32_t xpd_bias : 1;
  227. uint32_t dbg_atten : 4;
  228. uint32_t pd_cur : 1;
  229. uint32_t bias_sleep: 1;
  230. };
  231. uint32_t val;
  232. } pmu_lp_bias_reg_t;
  233. typedef struct pmu_lp_hw_regmap_t{
  234. pmu_lp_regulator0_reg_t regulator0;
  235. pmu_lp_regulator1_reg_t regulator1;
  236. pmu_lp_xtal_reg_t xtal; /* Only LP_SLEEP mode under lp system is valid */
  237. pmu_lp_dig_power_reg_t dig_power;
  238. pmu_lp_clk_power_reg_t clk_power;
  239. pmu_lp_bias_reg_t bias; /* Only LP_SLEEP mode under lp system is valid */
  240. } pmu_lp_hw_regmap_t;
  241. typedef union {
  242. struct {
  243. uint32_t tie_low_global_bbpll_icg : 1;
  244. uint32_t tie_low_global_xtal_icg : 1;
  245. uint32_t tie_low_i2c_retention : 1;
  246. uint32_t tie_low_xpd_bb_i2c : 1;
  247. uint32_t tie_low_xpd_bbpll_i2c : 1;
  248. uint32_t tie_low_xpd_bbpll : 1;
  249. uint32_t tie_low_xpd_xtal : 1;
  250. uint32_t reserved0 : 18;
  251. uint32_t tie_high_global_bbpll_icg: 1;
  252. uint32_t tie_high_global_xtal_icg : 1;
  253. uint32_t tie_high_i2c_retention : 1;
  254. uint32_t tie_high_xpd_bb_i2c : 1;
  255. uint32_t tie_high_xpd_bbpll_i2c : 1;
  256. uint32_t tie_high_xpd_bbpll : 1;
  257. uint32_t tie_high_xpd_xtal : 1;
  258. };
  259. uint32_t val;
  260. } pmu_imm_hp_clk_power_reg_t;
  261. typedef union {
  262. struct {
  263. uint32_t reserved0 : 28;
  264. uint32_t update_dig_icg_switch: 1;
  265. uint32_t tie_low_icg_slp_sel : 1;
  266. uint32_t tie_high_icg_slp_sel : 1;
  267. uint32_t update_dig_sysclk_sel: 1;
  268. };
  269. uint32_t val;
  270. } pmu_imm_sleep_sysclk_reg_t;
  271. typedef union {
  272. struct {
  273. uint32_t reserved0 : 31;
  274. uint32_t update_dig_icg_func_en: 1;
  275. };
  276. uint32_t val;
  277. } pmu_imm_hp_func_icg_reg_t;
  278. typedef union {
  279. struct {
  280. uint32_t reserved0 : 31;
  281. uint32_t update_dig_icg_apb_en: 1;
  282. };
  283. uint32_t val;
  284. } pmu_imm_hp_apb_icg_reg_t;
  285. typedef union {
  286. struct {
  287. uint32_t reserved0 : 31;
  288. uint32_t update_dig_icg_modem_en: 1;
  289. };
  290. uint32_t val;
  291. } pmu_imm_modem_icg_reg_t;
  292. typedef union {
  293. struct {
  294. uint32_t reserved0 : 30;
  295. uint32_t tie_low_lp_rootclk_sel : 1;
  296. uint32_t tie_high_lp_rootclk_sel: 1;
  297. };
  298. uint32_t val;
  299. } pmu_imm_lp_icg_reg_t;
  300. typedef union {
  301. struct {
  302. uint32_t reserved0 : 28;
  303. uint32_t tie_high_lp_pad_hold_all: 1;
  304. uint32_t tie_low_lp_pad_hold_all : 1;
  305. uint32_t tie_high_hp_pad_hold_all: 1;
  306. uint32_t tie_low_hp_pad_hold_all : 1;
  307. };
  308. uint32_t val;
  309. } pmu_imm_pad_hold_all_reg_t;
  310. typedef union {
  311. struct {
  312. uint32_t reserved0 : 30;
  313. uint32_t tie_high_i2c_iso_en: 1;
  314. uint32_t tie_low_i2c_iso_en : 1;
  315. };
  316. uint32_t val;
  317. } pmu_imm_i2c_isolate_reg_t;
  318. typedef struct pmu_imm_hw_regmap_t{
  319. pmu_imm_hp_clk_power_reg_t clk_power;
  320. pmu_imm_sleep_sysclk_reg_t sleep_sysclk;
  321. pmu_imm_hp_func_icg_reg_t hp_func_icg;
  322. pmu_imm_hp_apb_icg_reg_t hp_apb_icg;
  323. pmu_imm_modem_icg_reg_t modem_icg;
  324. pmu_imm_lp_icg_reg_t lp_icg;
  325. pmu_imm_pad_hold_all_reg_t pad_hold_all;
  326. pmu_imm_i2c_isolate_reg_t i2c_iso;
  327. } pmu_imm_hw_regmap_t;
  328. typedef union {
  329. struct {
  330. uint32_t reserved0 : 5;
  331. uint32_t powerdown_timer: 9;
  332. uint32_t powerup_timer : 9;
  333. uint32_t wait_timer : 9;
  334. };
  335. uint32_t val;
  336. } pmu_power_wait_timer0_reg_t;
  337. typedef union {
  338. struct {
  339. uint32_t reserved0 : 9;
  340. uint32_t powerdown_timer: 7;
  341. uint32_t powerup_timer : 7;
  342. uint32_t wait_timer : 9;
  343. };
  344. uint32_t val;
  345. } pmu_power_wait_timer1_reg_t;
  346. typedef union {
  347. struct {
  348. uint32_t force_reset : 1;
  349. uint32_t force_iso : 1;
  350. uint32_t force_pu : 1;
  351. uint32_t force_no_reset: 1;
  352. uint32_t force_no_iso : 1;
  353. uint32_t force_pd : 1;
  354. uint32_t mask : 5; /* Invalid of lp peripherals */
  355. uint32_t reserved0 : 16; /* Invalid of lp peripherals */
  356. uint32_t pd_mask : 5; /* Invalid of lp peripherals */
  357. };
  358. uint32_t val;
  359. } pmu_power_domain_cntl_reg_t;
  360. typedef union {
  361. struct {
  362. uint32_t force_hp_mem_iso : 4;
  363. uint32_t force_hp_mem_pd : 4;
  364. uint32_t reserved0 : 16;
  365. uint32_t force_hp_mem_no_iso: 4;
  366. uint32_t force_hp_mem_pu : 4;
  367. };
  368. uint32_t val;
  369. } pmu_power_memory_cntl_reg_t;
  370. typedef union {
  371. struct {
  372. uint32_t mem2_pd_mask: 5;
  373. uint32_t mem1_pd_mask: 5;
  374. uint32_t mem0_pd_mask: 5;
  375. uint32_t reserved0 : 2;
  376. uint32_t mem2_mask : 5;
  377. uint32_t mem1_mask : 5;
  378. uint32_t mem0_mask : 5;
  379. };
  380. uint32_t val;
  381. } pmu_power_memory_mask_reg_t;
  382. typedef union {
  383. struct {
  384. uint32_t force_hp_pad_no_iso_all: 1;
  385. uint32_t force_hp_pad_iso_all : 1;
  386. uint32_t reserved0 : 30;
  387. };
  388. uint32_t val;
  389. } pmu_power_hp_pad_reg_t;
  390. typedef union {
  391. struct {
  392. uint32_t reserved0 : 18;
  393. uint32_t pwr_wait : 11;
  394. uint32_t pwr_sw : 2;
  395. uint32_t pwr_sel_sw: 1;
  396. };
  397. uint32_t val;
  398. } pmu_power_vdd_spi_cntl_reg_t;
  399. typedef union {
  400. struct {
  401. uint32_t wait_xtal_stable: 16;
  402. uint32_t wait_pll_stable : 16;
  403. };
  404. uint32_t val;
  405. } pmu_power_clk_wait_cntl_reg_t;
  406. typedef struct pmu_power_hw_regmap_t{
  407. pmu_power_wait_timer0_reg_t wait_timer0;
  408. pmu_power_wait_timer1_reg_t wait_timer1;
  409. pmu_power_domain_cntl_reg_t hp_pd[5];
  410. pmu_power_domain_cntl_reg_t lp_peri;
  411. pmu_power_memory_cntl_reg_t mem_cntl;
  412. pmu_power_memory_mask_reg_t mem_mask;
  413. pmu_power_hp_pad_reg_t hp_pad;
  414. pmu_power_vdd_spi_cntl_reg_t vdd_spi;
  415. pmu_power_clk_wait_cntl_reg_t clk_wait;
  416. } pmu_power_hw_regmap_t;
  417. typedef union {
  418. struct {
  419. uint32_t reserved0: 31;
  420. uint32_t sleep_req: 1;
  421. };
  422. uint32_t val;
  423. } pmu_slp_wakeup_cntl0_reg_t;
  424. typedef union {
  425. struct {
  426. uint32_t sleep_reject_ena: 31;
  427. uint32_t slp_reject_en : 1;
  428. };
  429. uint32_t val;
  430. } pmu_slp_wakeup_cntl1_reg_t;
  431. typedef union {
  432. struct {
  433. uint32_t lp_min_slp_val: 8;
  434. uint32_t hp_min_slp_val: 8;
  435. uint32_t sleep_prt_sel : 2;
  436. uint32_t reserved0 : 14;
  437. };
  438. uint32_t val;
  439. } pmu_slp_wakeup_cntl3_reg_t;
  440. typedef union {
  441. struct {
  442. uint32_t reserved0 : 31;
  443. uint32_t slp_reject_cause_clr: 1;
  444. };
  445. uint32_t val;
  446. } pmu_slp_wakeup_cntl4_reg_t;
  447. typedef union {
  448. struct {
  449. uint32_t modem_wait_target : 20;
  450. uint32_t reserved0 : 4;
  451. uint32_t lp_ana_wait_target: 8;
  452. };
  453. uint32_t val;
  454. } pmu_slp_wakeup_cntl5_reg_t;
  455. typedef union {
  456. struct {
  457. uint32_t soc_wakeup_wait : 20;
  458. uint32_t reserved0 : 10;
  459. uint32_t soc_wakeup_wait_cfg: 2;
  460. };
  461. uint32_t val;
  462. } pmu_slp_wakeup_cntl6_reg_t;
  463. typedef union {
  464. struct {
  465. uint32_t reserved0 : 16;
  466. uint32_t ana_wait_target: 16;
  467. };
  468. uint32_t val;
  469. } pmu_slp_wakeup_cntl7_reg_t;
  470. typedef struct pmu_wakeup_hw_regmap_t{
  471. pmu_slp_wakeup_cntl0_reg_t cntl0;
  472. pmu_slp_wakeup_cntl1_reg_t cntl1;
  473. uint32_t cntl2;
  474. pmu_slp_wakeup_cntl3_reg_t cntl3;
  475. pmu_slp_wakeup_cntl4_reg_t cntl4;
  476. pmu_slp_wakeup_cntl5_reg_t cntl5;
  477. pmu_slp_wakeup_cntl6_reg_t cntl6;
  478. pmu_slp_wakeup_cntl7_reg_t cntl7;
  479. uint32_t status0;
  480. uint32_t status1;
  481. } pmu_wakeup_hw_regmap_t;
  482. typedef union {
  483. struct {
  484. uint32_t i2c_por_wait_target: 8;
  485. uint32_t reserved0 : 24;
  486. };
  487. uint32_t val;
  488. } pmu_hp_clk_poweron_reg_t;
  489. typedef union {
  490. struct {
  491. uint32_t modify_icg_cntl_wait: 8;
  492. uint32_t switch_icg_cntl_wait: 8;
  493. uint32_t reserved0 : 16;
  494. };
  495. uint32_t val;
  496. } pmu_hp_clk_cntl_reg_t;
  497. typedef union {
  498. struct {
  499. uint32_t reserved0: 31;
  500. uint32_t por_done : 1;
  501. };
  502. uint32_t val;
  503. } pmu_por_status_reg_t;
  504. typedef union {
  505. struct {
  506. uint32_t reserved0 : 26;
  507. uint32_t perif_i2c_rstb: 1;
  508. uint32_t xpd_perif_i2c : 1;
  509. uint32_t xpd_txrf_i2c : 1;
  510. uint32_t xpd_rfrx_pbus : 1;
  511. uint32_t xpd_ckgen_i2c : 1;
  512. uint32_t xpd_pll_i2c : 1;
  513. };
  514. uint32_t val;
  515. } pmu_rf_pwc_reg_t;
  516. typedef union {
  517. struct {
  518. uint32_t reserved0 : 31;
  519. uint32_t backup_sysclk_nodiv: 1;
  520. };
  521. uint32_t val;
  522. } pmu_backup_cfg_reg_t;
  523. typedef union {
  524. struct {
  525. uint32_t reserved0 : 27;
  526. uint32_t lp_cpu_exc: 1;
  527. uint32_t sdio_idle : 1;
  528. uint32_t sw : 1;
  529. uint32_t reject : 1;
  530. uint32_t wakeup : 1;
  531. };
  532. uint32_t val;
  533. } pmu_hp_intr_reg_t;
  534. typedef struct pmu_hp_ext_hw_regmap_t{
  535. pmu_hp_clk_poweron_reg_t clk_poweron;
  536. pmu_hp_clk_cntl_reg_t clk_cntl;
  537. pmu_por_status_reg_t por_status;
  538. pmu_rf_pwc_reg_t rf_pwc;
  539. pmu_backup_cfg_reg_t backup_cfg;
  540. pmu_hp_intr_reg_t int_raw;
  541. pmu_hp_intr_reg_t int_st;
  542. pmu_hp_intr_reg_t int_ena;
  543. pmu_hp_intr_reg_t int_clr;
  544. } pmu_hp_ext_hw_regmap_t;
  545. typedef union {
  546. struct {
  547. uint32_t reserved0 : 20;
  548. uint32_t lp_cpu_wakeup : 1;
  549. uint32_t modem_switch_active_end : 1;
  550. uint32_t sleep_switch_active_end : 1;
  551. uint32_t sleep_switch_modem_end : 1;
  552. uint32_t modem_switch_sleep_end : 1;
  553. uint32_t active_swtich_sleep_end : 1;
  554. uint32_t modem_switch_active_start: 1;
  555. uint32_t sleep_switch_active_start: 1;
  556. uint32_t sleep_switch_modem_start : 1;
  557. uint32_t modem_switch_sleep_start : 1;
  558. uint32_t active_switch_sleep_start: 1;
  559. uint32_t sw_trigger : 1;
  560. };
  561. uint32_t val;
  562. } pmu_lp_intr_reg_t;
  563. typedef union {
  564. struct {
  565. uint32_t waiti_rdy : 1;
  566. uint32_t stall_rdy : 1;
  567. uint32_t reserved0 : 16;
  568. uint32_t force_stall : 1;
  569. uint32_t slp_waiti_flag_en : 1;
  570. uint32_t slp_stall_flag_en : 1;
  571. uint32_t slp_stall_wait : 8;
  572. uint32_t slp_stall_en : 1;
  573. uint32_t slp_reset_en : 1;
  574. uint32_t slp_bypass_intr_en: 1;
  575. };
  576. uint32_t val;
  577. } pmu_lp_cpu_pwr0_reg_t;
  578. typedef union {
  579. struct {
  580. uint32_t wakeup_en: 16;
  581. uint32_t reserved0: 15;
  582. uint32_t sleep_req: 1;
  583. };
  584. uint32_t val;
  585. } pmu_lp_cpu_pwr1_reg_t;
  586. typedef struct pmu_lp_ext_hw_regmap_t{
  587. pmu_lp_intr_reg_t int_raw;
  588. pmu_lp_intr_reg_t int_st;
  589. pmu_lp_intr_reg_t int_ena;
  590. pmu_lp_intr_reg_t int_clr;
  591. pmu_lp_cpu_pwr0_reg_t pwr0;
  592. pmu_lp_cpu_pwr1_reg_t pwr1;
  593. } pmu_lp_ext_hw_regmap_t;
  594. typedef struct pmu_dev_t{
  595. volatile pmu_hp_hw_regmap_t hp_sys[3];
  596. volatile pmu_lp_hw_regmap_t lp_sys[2];
  597. volatile pmu_imm_hw_regmap_t imm;
  598. volatile pmu_power_hw_regmap_t power;
  599. volatile pmu_wakeup_hw_regmap_t wakeup;
  600. volatile pmu_hp_ext_hw_regmap_t hp_ext;
  601. volatile pmu_lp_ext_hw_regmap_t lp_ext;
  602. union {
  603. struct {
  604. uint32_t reserved0 : 30;
  605. volatile uint32_t lp_trigger_hp: 1;
  606. volatile uint32_t hp_trigger_lp: 1;
  607. };
  608. volatile uint32_t val;
  609. } hp_lp_cpu_comm;
  610. union {
  611. struct {
  612. uint32_t reserved0 : 31;
  613. volatile uint32_t dig_regulator_en_cal: 1;
  614. };
  615. volatile uint32_t val;
  616. } hp_regulator_cfg;
  617. union {
  618. struct {
  619. uint32_t reserved0 : 11;
  620. volatile uint32_t last_st : 7;
  621. volatile uint32_t target_st : 7;
  622. volatile uint32_t current_st: 7;
  623. };
  624. volatile uint32_t val;
  625. } main_state;
  626. union {
  627. struct {
  628. uint32_t reserved0: 13;
  629. volatile uint32_t backup_st: 5;
  630. volatile uint32_t lp_pwr_st: 5;
  631. volatile uint32_t hp_pwr_st: 9;
  632. };
  633. volatile uint32_t val;
  634. } pwr_state;
  635. union {
  636. struct {
  637. volatile uint32_t stable_xpd_bbpll : 1;
  638. volatile uint32_t stable_xpd_xtal : 1;
  639. volatile uint32_t reserved0 : 13;
  640. volatile uint32_t sysclk_slp_sel : 1;
  641. volatile uint32_t sysclk_sel : 2;
  642. volatile uint32_t sysclk_nodiv : 1;
  643. volatile uint32_t icg_sysclk_en : 1;
  644. volatile uint32_t icg_modem_switch : 1;
  645. volatile uint32_t icg_modem_code : 2;
  646. volatile uint32_t icg_slp_sel : 1;
  647. volatile uint32_t icg_global_xtal : 1;
  648. volatile uint32_t icg_global_pll : 1;
  649. volatile uint32_t ana_i2c_iso_en : 1;
  650. volatile uint32_t ana_i2c_retention: 1;
  651. volatile uint32_t ana_xpd_bb_i2c : 1;
  652. volatile uint32_t ana_xpd_bbpll_i2c: 1;
  653. volatile uint32_t ana_xpd_bbpll : 1;
  654. volatile uint32_t ana_xpd_xtal : 1;
  655. };
  656. volatile uint32_t val;
  657. } clk_state0;
  658. volatile uint32_t clk_state1;
  659. volatile uint32_t clk_state2;
  660. union {
  661. struct {
  662. uint32_t reserved0 : 31;
  663. volatile uint32_t stable_vdd_spi_pwr_drv: 1;
  664. };
  665. volatile uint32_t val;
  666. } vdd_spi_status;
  667. uint32_t reserved[150];
  668. union {
  669. struct {
  670. volatile uint32_t pmu_date: 31;
  671. volatile uint32_t clk_en : 1;
  672. };
  673. volatile uint32_t val;
  674. } date;
  675. } pmu_dev_t;
  676. extern pmu_dev_t PMU;
  677. #ifndef __cplusplus
  678. _Static_assert(sizeof(pmu_dev_t) == 0x400, "Invalid size of pmu_dev_t structure");
  679. _Static_assert(offsetof(pmu_dev_t, reserved) == (PMU_VDD_SPI_STATUS_REG - DR_REG_PMU_BASE) + 4, "Invalid size of pmu_dev_t structure");
  680. #endif
  681. #ifdef __cplusplus
  682. }
  683. #endif