pmic_ana.h 39 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220
  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 _PMIC_ANA_H_
  13. #define _PMIC_ANA_H_
  14. // Auto generated by dtools(see dtools.txt for its version).
  15. // Don't edit it manually!
  16. #define REG_PMIC_ANA_SET_OFFSET (256)
  17. #define REG_PMIC_ANA_CLR_OFFSET (512)
  18. #define REG_PMIC_ANA_BASE (0x51108c00)
  19. typedef volatile struct
  20. {
  21. uint32_t chip_id_low; // 0x00000000
  22. uint32_t chip_id_high; // 0x00000004
  23. uint32_t module_en0; // 0x00000008
  24. uint32_t dig_clk_en0; // 0x0000000c
  25. uint32_t rtc_clk_en0; // 0x00000010
  26. uint32_t soft_rst0; // 0x00000014
  27. uint32_t xtl_wait; // 0x00000018
  28. uint32_t rg_dvdd_reserved1; // 0x0000001c
  29. uint32_t vbat_ctrl0; // 0x00000020
  30. uint32_t thm_otp_ctrl; // 0x00000024
  31. uint32_t led_ctrl; // 0x00000028
  32. uint32_t kpled_ctrl1; // 0x0000002c
  33. uint32_t ldo_vbat_ctrl1; // 0x00000030
  34. uint32_t ldo_vbat_ctrl2; // 0x00000034
  35. uint32_t ldo_vbat_ctrl3; // 0x00000038
  36. uint32_t ldo_ana_ctrl; // 0x0000003c
  37. uint32_t ldo_vio18_ctrl; // 0x00000040
  38. uint32_t ldo_vgen_ctrl1; // 0x00000044
  39. uint32_t ldo_spimem_ctrl; // 0x00000048
  40. uint32_t ldo_camd_ctrl; // 0x0000004c
  41. uint32_t ldo_rf15_ctrl; // 0x00000050
  42. uint32_t ldo_vgen_ctrl3; // 0x00000054
  43. uint32_t ldo_lp18_ctrl; // 0x00000058
  44. uint32_t ldo_rf12_ctrl; // 0x0000005c
  45. uint32_t dcdc_ctrl1; // 0x00000060
  46. uint32_t vcore_ctrl2; // 0x00000064
  47. uint32_t vcore_ctrl3; // 0x00000068
  48. uint32_t vrf_ctrl0; // 0x0000006c
  49. uint32_t vrf_ctrl1; // 0x00000070
  50. uint32_t vgen_ctrl2; // 0x00000074
  51. uint32_t vgen_ctrl3; // 0x00000078
  52. uint32_t chgr_ctrl1; // 0x0000007c
  53. uint32_t auxadc_ctrl; // 0x00000080
  54. uint32_t chgr_status; // 0x00000084
  55. uint32_t arch_en; // 0x00000088
  56. uint32_t mcu_wr_prot_value; // 0x0000008c
  57. uint32_t __144[1]; // 0x00000090
  58. uint32_t dcdc_core_reg1; // 0x00000094
  59. uint32_t dcdc_gen_reg1; // 0x00000098
  60. uint32_t dcdc_vrf_reg1; // 0x0000009c
  61. uint32_t bg_ctrl0; // 0x000000a0
  62. uint32_t ldo_vosel1; // 0x000000a4
  63. uint32_t ldo_vosel3; // 0x000000a8
  64. uint32_t ldo_vosel4; // 0x000000ac
  65. uint32_t ldo_lp18_vio33_ctrl1; // 0x000000b0
  66. uint32_t reserved_reg_core; // 0x000000b4
  67. uint32_t reserved_reg1; // 0x000000b8
  68. uint32_t reserved_reg2; // 0x000000bc
  69. uint32_t ldo_sim_ctrl0; // 0x000000c0
  70. uint32_t ldo_sim_vosel; // 0x000000c4
  71. uint32_t sim_vpa_ctrl0; // 0x000000c8
  72. uint32_t ldo_sim_ctrl1; // 0x000000cc
  73. uint32_t vpa_ctrl0; // 0x000000d0
  74. uint32_t vpa_ctrl1; // 0x000000d4
  75. uint32_t vpa_ctrl2; // 0x000000d8
  76. uint32_t vpa_ctrl3; // 0x000000dc
  77. uint32_t dcdc_vpa_reg1; // 0x000000e0
  78. uint32_t __228[57]; // 0x000000e4
  79. uint32_t sim_vpa_ctrl0_set; // 0x000001c8
  80. uint32_t ldo_sim_ctrl1_set; // 0x000001cc
  81. uint32_t __464[62]; // 0x000001d0
  82. uint32_t sim_vpa_ctrl0_clr; // 0x000002c8
  83. uint32_t ldo_sim_ctrl1_clr; // 0x000002cc
  84. } HWP_PMIC_ANA_T;
  85. #define hwp_pmicAna ((HWP_PMIC_ANA_T *)REG_ACCESS_ADDRESS(REG_PMIC_ANA_BASE))
  86. // chip_id_low
  87. typedef union {
  88. uint32_t v;
  89. struct
  90. {
  91. uint32_t chip_id_low : 16; // [15:0], read only
  92. uint32_t __31_16 : 16; // [31:16]
  93. } b;
  94. } REG_PMIC_ANA_CHIP_ID_LOW_T;
  95. // chip_id_high
  96. typedef union {
  97. uint32_t v;
  98. struct
  99. {
  100. uint32_t chip_id_high : 16; // [15:0], read only
  101. uint32_t __31_16 : 16; // [31:16]
  102. } b;
  103. } REG_PMIC_ANA_CHIP_ID_HIGH_T;
  104. // module_en0
  105. typedef union {
  106. uint32_t v;
  107. struct
  108. {
  109. uint32_t cal_en : 1; // [0]
  110. uint32_t __4_1 : 4; // [4:1]
  111. uint32_t adc_en : 1; // [5]
  112. uint32_t efs_en : 1; // [6]
  113. uint32_t __8_7 : 2; // [8:7]
  114. uint32_t bltc_en : 1; // [9]
  115. uint32_t __11_10 : 2; // [11:10]
  116. uint32_t tmr_en : 1; // [12]
  117. uint32_t __31_13 : 19; // [31:13]
  118. } b;
  119. } REG_PMIC_ANA_MODULE_EN0_T;
  120. // dig_clk_en0
  121. typedef union {
  122. uint32_t v;
  123. struct
  124. {
  125. uint32_t __1_0 : 2; // [1:0]
  126. uint32_t clk_cal_en : 1; // [2]
  127. uint32_t clk_cal_src_sel : 2; // [4:3]
  128. uint32_t clk_auxadc_en : 1; // [5]
  129. uint32_t clk_auxad_en : 1; // [6]
  130. uint32_t __31_7 : 25; // [31:7]
  131. } b;
  132. } REG_PMIC_ANA_DIG_CLK_EN0_T;
  133. // rtc_clk_en0
  134. typedef union {
  135. uint32_t v;
  136. struct
  137. {
  138. uint32_t rtc_arch_en : 1; // [0]
  139. uint32_t __6_1 : 6; // [6:1]
  140. uint32_t rtc_bltc_en : 1; // [7]
  141. uint32_t __12_8 : 5; // [12:8]
  142. uint32_t rtc_tmr_en : 1; // [13]
  143. uint32_t __31_14 : 18; // [31:14]
  144. } b;
  145. } REG_PMIC_ANA_RTC_CLK_EN0_T;
  146. // soft_rst0
  147. typedef union {
  148. uint32_t v;
  149. struct
  150. {
  151. uint32_t cal_soft_rst : 1; // [0]
  152. uint32_t __3_1 : 3; // [3:1]
  153. uint32_t tmr_soft_rst : 1; // [4]
  154. uint32_t __5_5 : 1; // [5]
  155. uint32_t adc_soft_rst : 1; // [6]
  156. uint32_t efs_soft_rst : 1; // [7]
  157. uint32_t __8_8 : 1; // [8]
  158. uint32_t bltc_soft_rst : 1; // [9]
  159. uint32_t __31_10 : 22; // [31:10]
  160. } b;
  161. } REG_PMIC_ANA_SOFT_RST0_T;
  162. // xtl_wait
  163. typedef union {
  164. uint32_t v;
  165. struct
  166. {
  167. uint32_t xtl_wait : 8; // [7:0]
  168. uint32_t __14_8 : 7; // [14:8]
  169. uint32_t slp_rgb_pd_en : 1; // [15]
  170. uint32_t __31_16 : 16; // [31:16]
  171. } b;
  172. } REG_PMIC_ANA_XTL_WAIT_T;
  173. // rg_dvdd_reserved1
  174. typedef union {
  175. uint32_t v;
  176. struct
  177. {
  178. uint32_t rg_dvdd_reserved1 : 8; // [7:0]
  179. uint32_t rg_dvdd_reserved0 : 8; // [15:8]
  180. uint32_t __31_16 : 16; // [31:16]
  181. } b;
  182. } REG_PMIC_ANA_RG_DVDD_RESERVED1_T;
  183. // vbat_ctrl0
  184. typedef union {
  185. uint32_t v;
  186. struct
  187. {
  188. uint32_t rg_ldo_vbat_auxcal_sel : 3; // [2:0]
  189. uint32_t __31_3 : 29; // [31:3]
  190. } b;
  191. } REG_PMIC_ANA_VBAT_CTRL0_T;
  192. // thm_otp_ctrl
  193. typedef union {
  194. uint32_t v;
  195. struct
  196. {
  197. uint32_t rg_otp_op : 3; // [2:0]
  198. uint32_t rg_otp_en : 1; // [3]
  199. uint32_t __31_4 : 28; // [31:4]
  200. } b;
  201. } REG_PMIC_ANA_THM_OTP_CTRL_T;
  202. // led_ctrl
  203. typedef union {
  204. uint32_t v;
  205. struct
  206. {
  207. uint32_t rg_ib_trim : 7; // [6:0]
  208. uint32_t rg_ib_rex_en : 1; // [7]
  209. uint32_t rg_batdet_cur_i : 3; // [10:8]
  210. uint32_t rg_batdet_cur_en : 1; // [11]
  211. uint32_t ib_trim_em_sel : 1; // [12]
  212. uint32_t __31_13 : 19; // [31:13]
  213. } b;
  214. } REG_PMIC_ANA_LED_CTRL_T;
  215. // kpled_ctrl1
  216. typedef union {
  217. uint32_t v;
  218. struct
  219. {
  220. uint32_t rg_ldo_kpled_shpt_pd : 1; // [0]
  221. uint32_t rg_ldo_kpled_v : 3; // [3:1]
  222. uint32_t rg_ldo_kpled_cap_sel : 1; // [4]
  223. uint32_t rg_ldo_kpled_stb : 2; // [6:5]
  224. uint32_t rg_ldo_kpled_shpt_adj : 1; // [7]
  225. uint32_t rg_kpled_v : 4; // [11:8]
  226. uint32_t rg_ldo_kpled_cl_adj : 1; // [12]
  227. uint32_t __31_13 : 19; // [31:13]
  228. } b;
  229. } REG_PMIC_ANA_KPLED_CTRL1_T;
  230. // ldo_vbat_ctrl1
  231. typedef union {
  232. uint32_t v;
  233. struct
  234. {
  235. uint32_t rg_ldo_usb33_discharge_en : 1; // [0]
  236. uint32_t rg_ldo_usb33_stb : 2; // [2:1]
  237. uint32_t rg_ldo_usb33_rz_adj : 1; // [3]
  238. uint32_t rg_ldo_usb33_shpt_en : 1; // [4]
  239. uint32_t rg_ldo_usb33_cl_adj : 3; // [7:5]
  240. uint32_t __31_8 : 24; // [31:8]
  241. } b;
  242. } REG_PMIC_ANA_LDO_VBAT_CTRL1_T;
  243. // ldo_vbat_ctrl2
  244. typedef union {
  245. uint32_t v;
  246. struct
  247. {
  248. uint32_t rg_ldo_cama_discharge_en : 1; // [0]
  249. uint32_t rg_ldo_cama_stb : 2; // [2:1]
  250. uint32_t rg_ldo_cama_rz_adj : 1; // [3]
  251. uint32_t rg_ldo_cama_shpt_en : 1; // [4]
  252. uint32_t rg_ldo_cama_cl_adj : 3; // [7:5]
  253. uint32_t rg_ldo_vio33_discharge_en : 1; // [8]
  254. uint32_t rg_ldo_vio33_stb : 2; // [10:9]
  255. uint32_t rg_ldo_vio33_rz_adj : 1; // [11]
  256. uint32_t rg_ldo_vio33_shpt_en : 1; // [12]
  257. uint32_t rg_ldo_vio33_cl_adj : 3; // [15:13]
  258. uint32_t __31_16 : 16; // [31:16]
  259. } b;
  260. } REG_PMIC_ANA_LDO_VBAT_CTRL2_T;
  261. // ldo_vbat_ctrl3
  262. typedef union {
  263. uint32_t v;
  264. struct
  265. {
  266. uint32_t rg_ldo_mmc_discharge_en : 1; // [0]
  267. uint32_t rg_ldo_mmc_stb : 2; // [2:1]
  268. uint32_t rg_ldo_mmc_rz_adj : 1; // [3]
  269. uint32_t rg_ldo_mmc_shpt_en : 1; // [4]
  270. uint32_t rg_ldo_mmc_cl_adj : 3; // [7:5]
  271. uint32_t rg_ldo_lcd_discharge_en : 1; // [8]
  272. uint32_t rg_ldo_lcd_stb : 2; // [10:9]
  273. uint32_t rg_ldo_lcd_rz_adj : 1; // [11]
  274. uint32_t rg_ldo_lcd_shpt_en : 1; // [12]
  275. uint32_t rg_ldo_lcd_cl_adj : 3; // [15:13]
  276. uint32_t __31_16 : 16; // [31:16]
  277. } b;
  278. } REG_PMIC_ANA_LDO_VBAT_CTRL3_T;
  279. // ldo_ana_ctrl
  280. typedef union {
  281. uint32_t v;
  282. struct
  283. {
  284. uint32_t rg_ldo_ana_v : 6; // [5:0]
  285. uint32_t __7_6 : 2; // [7:6]
  286. uint32_t rg_ldo_ana_cap_sel : 1; // [8]
  287. uint32_t rg_ldo_ana_bp : 1; // [9]
  288. uint32_t rg_ldo_ana_stb : 2; // [11:10]
  289. uint32_t rg_ldo_ana_shpt_adj : 1; // [12]
  290. uint32_t rg_ldo_ana_shpt_pd : 1; // [13]
  291. uint32_t rg_ldo_ana_cl_adj : 1; // [14]
  292. uint32_t __31_15 : 17; // [31:15]
  293. } b;
  294. } REG_PMIC_ANA_LDO_ANA_CTRL_T;
  295. // ldo_vio18_ctrl
  296. typedef union {
  297. uint32_t v;
  298. struct
  299. {
  300. uint32_t rg_ldo_vio18_v : 6; // [5:0]
  301. uint32_t __7_6 : 2; // [7:6]
  302. uint32_t rg_ldo_vio18_cap_sel : 1; // [8]
  303. uint32_t rg_ldo_vio18_bp : 1; // [9]
  304. uint32_t rg_ldo_vio18_stb : 2; // [11:10]
  305. uint32_t rg_ldo_vio18_shpt_adj : 1; // [12]
  306. uint32_t rg_ldo_vio18_shpt_pd : 1; // [13]
  307. uint32_t rg_ldo_vio18_cl_adj : 1; // [14]
  308. uint32_t __31_15 : 17; // [31:15]
  309. } b;
  310. } REG_PMIC_ANA_LDO_VIO18_CTRL_T;
  311. // ldo_vgen_ctrl1
  312. typedef union {
  313. uint32_t v;
  314. struct
  315. {
  316. uint32_t rg_ldo_mem_v : 6; // [5:0]
  317. uint32_t __7_6 : 2; // [7:6]
  318. uint32_t rg_ldo_mem_cap_sel : 1; // [8]
  319. uint32_t rg_ldo_mem_bp : 1; // [9]
  320. uint32_t rg_ldo_mem_stb : 2; // [11:10]
  321. uint32_t rg_ldo_mem_shpt_adj : 1; // [12]
  322. uint32_t rg_ldo_mem_shpt_pd : 1; // [13]
  323. uint32_t rg_ldo_mem_cl_adj : 1; // [14]
  324. uint32_t __31_15 : 17; // [31:15]
  325. } b;
  326. } REG_PMIC_ANA_LDO_VGEN_CTRL1_T;
  327. // ldo_spimem_ctrl
  328. typedef union {
  329. uint32_t v;
  330. struct
  331. {
  332. uint32_t rg_ldo_spimem_v : 6; // [5:0]
  333. uint32_t __7_6 : 2; // [7:6]
  334. uint32_t rg_ldo_spimem_cap_sel : 1; // [8]
  335. uint32_t rg_ldo_spimem_bp : 1; // [9]
  336. uint32_t rg_ldo_spimem_stb : 2; // [11:10]
  337. uint32_t rg_ldo_spimem_shpt_adj : 1; // [12]
  338. uint32_t rg_ldo_spimem_shpt_pd : 1; // [13]
  339. uint32_t rg_ldo_spimem_cl_adj : 1; // [14]
  340. uint32_t __31_15 : 17; // [31:15]
  341. } b;
  342. } REG_PMIC_ANA_LDO_SPIMEM_CTRL_T;
  343. // ldo_camd_ctrl
  344. typedef union {
  345. uint32_t v;
  346. struct
  347. {
  348. uint32_t rg_ldo_camd_v : 6; // [5:0]
  349. uint32_t __7_6 : 2; // [7:6]
  350. uint32_t rg_ldo_camd_cap_sel : 1; // [8]
  351. uint32_t rg_ldo_camd_bp : 1; // [9]
  352. uint32_t rg_ldo_camd_stb : 2; // [11:10]
  353. uint32_t rg_ldo_camd_shpt_adj : 1; // [12]
  354. uint32_t rg_ldo_camd_shpt_pd : 1; // [13]
  355. uint32_t rg_ldo_camd_cl_adj : 1; // [14]
  356. uint32_t __31_15 : 17; // [31:15]
  357. } b;
  358. } REG_PMIC_ANA_LDO_CAMD_CTRL_T;
  359. // ldo_rf15_ctrl
  360. typedef union {
  361. uint32_t v;
  362. struct
  363. {
  364. uint32_t rg_ldo_rf15_v : 6; // [5:0]
  365. uint32_t __7_6 : 2; // [7:6]
  366. uint32_t rg_ldo_rf15_cap_sel : 1; // [8]
  367. uint32_t rg_ldo_rf15_bp : 1; // [9]
  368. uint32_t rg_ldo_rf15_stb : 2; // [11:10]
  369. uint32_t rg_ldo_rf15_shpt_adj : 1; // [12]
  370. uint32_t rg_ldo_rf15_shpt_pd : 1; // [13]
  371. uint32_t rg_ldo_rf15_cl_adj : 1; // [14]
  372. uint32_t __31_15 : 17; // [31:15]
  373. } b;
  374. } REG_PMIC_ANA_LDO_RF15_CTRL_T;
  375. // ldo_lp18_ctrl
  376. typedef union {
  377. uint32_t v;
  378. struct
  379. {
  380. uint32_t __7_0 : 8; // [7:0]
  381. uint32_t rg_ldo_lp18_discharge_en : 1; // [8]
  382. uint32_t rg_ldo_lp18_stb : 2; // [10:9]
  383. uint32_t rg_ldo_lp18_rz_adj : 1; // [11]
  384. uint32_t rg_ldo_lp18_shpt_en : 1; // [12]
  385. uint32_t rg_ldo_lp18_cl_adj : 3; // [15:13]
  386. uint32_t __31_16 : 16; // [31:16]
  387. } b;
  388. } REG_PMIC_ANA_LDO_LP18_CTRL_T;
  389. // ldo_rf12_ctrl
  390. typedef union {
  391. uint32_t v;
  392. struct
  393. {
  394. uint32_t rg_ldo_rf12_cap_sel : 1; // [0]
  395. uint32_t rg_ldo_rf12_bp : 1; // [1]
  396. uint32_t rg_ldo_rf12_stb : 2; // [3:2]
  397. uint32_t rg_ldo_rf12_v : 6; // [9:4]
  398. uint32_t rg_ldo_rf12_shpt_adj : 1; // [10]
  399. uint32_t rg_ldo_rf12_shpt_pd : 1; // [11]
  400. uint32_t rg_ldo_rf12_cl_adj : 1; // [12]
  401. uint32_t __31_13 : 19; // [31:13]
  402. } b;
  403. } REG_PMIC_ANA_LDO_RF12_CTRL_T;
  404. // dcdc_ctrl1
  405. typedef union {
  406. uint32_t v;
  407. struct
  408. {
  409. uint32_t rg_dcdc_clkout_sel : 4; // [3:0]
  410. uint32_t rg_dcdc_clkout_uniphase : 1; // [4]
  411. uint32_t __10_5 : 6; // [10:5]
  412. uint32_t rg_clk3m_out_en : 1; // [11]
  413. uint32_t rg_dcdc_auxtrim_sel : 4; // [15:12]
  414. uint32_t __31_16 : 16; // [31:16]
  415. } b;
  416. } REG_PMIC_ANA_DCDC_CTRL1_T;
  417. // vcore_ctrl2
  418. typedef union {
  419. uint32_t v;
  420. struct
  421. {
  422. uint32_t rg_vcore_curses_r : 2; // [1:0]
  423. uint32_t rg_vcore_curavg : 2; // [3:2]
  424. uint32_t rg_vcore_curlimit_r : 2; // [5:4]
  425. uint32_t rg_vcore_antiring_en : 1; // [6]
  426. uint32_t __31_7 : 25; // [31:7]
  427. } b;
  428. } REG_PMIC_ANA_VCORE_CTRL2_T;
  429. // vcore_ctrl3
  430. typedef union {
  431. uint32_t v;
  432. struct
  433. {
  434. uint32_t rg_vcore_sr_ls : 2; // [1:0]
  435. uint32_t rg_vcore_sr_hs : 2; // [3:2]
  436. uint32_t rg_vcore_slope : 2; // [5:4]
  437. uint32_t rg_vcore_rcomp : 2; // [7:6]
  438. uint32_t rg_vcore_pfm_vh : 2; // [9:8]
  439. uint32_t rg_vcore_zx_offset : 2; // [11:10]
  440. uint32_t rg_vcore_zx_disable : 1; // [12]
  441. uint32_t rg_vcore_force_pwm : 1; // [13]
  442. uint32_t __31_14 : 18; // [31:14]
  443. } b;
  444. } REG_PMIC_ANA_VCORE_CTRL3_T;
  445. // vrf_ctrl0
  446. typedef union {
  447. uint32_t v;
  448. struct
  449. {
  450. uint32_t rg_vrf_curses_r : 2; // [1:0]
  451. uint32_t rg_vrf_curavg : 2; // [3:2]
  452. uint32_t rg_vrf_curlimit_r : 2; // [5:4]
  453. uint32_t rg_vrf_antiring_en : 1; // [6]
  454. uint32_t __31_7 : 25; // [31:7]
  455. } b;
  456. } REG_PMIC_ANA_VRF_CTRL0_T;
  457. // vrf_ctrl1
  458. typedef union {
  459. uint32_t v;
  460. struct
  461. {
  462. uint32_t rg_vrf_sr_ls : 2; // [1:0]
  463. uint32_t rg_vrf_sr_hs : 2; // [3:2]
  464. uint32_t rg_vrf_slope : 2; // [5:4]
  465. uint32_t rg_vrf_rcomp : 2; // [7:6]
  466. uint32_t rg_vrf_pfm_vh : 2; // [9:8]
  467. uint32_t rg_vrf_zx_offset : 2; // [11:10]
  468. uint32_t rg_vrf_zx_disable : 1; // [12]
  469. uint32_t rg_vrf_force_pwm : 1; // [13]
  470. uint32_t __31_14 : 18; // [31:14]
  471. } b;
  472. } REG_PMIC_ANA_VRF_CTRL1_T;
  473. // vgen_ctrl2
  474. typedef union {
  475. uint32_t v;
  476. struct
  477. {
  478. uint32_t rg_vgen_curses_r : 2; // [1:0]
  479. uint32_t rg_vgen_curlimit_r : 2; // [3:2]
  480. uint32_t rg_vgen_zx_offset : 2; // [5:4]
  481. uint32_t rg_vgen_zx_disable : 1; // [6]
  482. uint32_t rg_vgen_antiring_en : 1; // [7]
  483. uint32_t dcdc_gen_clk_rst : 1; // [8]
  484. uint32_t __31_9 : 23; // [31:9]
  485. } b;
  486. } REG_PMIC_ANA_VGEN_CTRL2_T;
  487. // vgen_ctrl3
  488. typedef union {
  489. uint32_t v;
  490. struct
  491. {
  492. uint32_t rg_vgen_sr_ls : 2; // [1:0]
  493. uint32_t rg_vgen_sr_hs : 2; // [3:2]
  494. uint32_t rg_vgen_slope : 2; // [5:4]
  495. uint32_t rg_vgen_rcomp : 2; // [7:6]
  496. uint32_t rg_vgen_pfm_vh : 2; // [9:8]
  497. uint32_t rg_vgen_maxduty_sel : 1; // [10]
  498. uint32_t rg_vgen_force_pwm : 1; // [11]
  499. uint32_t __31_12 : 20; // [31:12]
  500. } b;
  501. } REG_PMIC_ANA_VGEN_CTRL3_T;
  502. // chgr_ctrl1
  503. typedef union {
  504. uint32_t v;
  505. struct
  506. {
  507. uint32_t chgr_cc_i : 4; // [3:0]
  508. uint32_t vchg_ovp_v : 2; // [5:4]
  509. uint32_t chgr_iterm : 2; // [7:6]
  510. uint32_t chgr_end_v : 2; // [9:8]
  511. uint32_t chgr_cc_en : 1; // [10]
  512. uint32_t __31_11 : 21; // [31:11]
  513. } b;
  514. } REG_PMIC_ANA_CHGR_CTRL1_T;
  515. // auxadc_ctrl
  516. typedef union {
  517. uint32_t v;
  518. struct
  519. {
  520. uint32_t rg_auxad_sgn_code : 1; // [0]
  521. uint32_t rg_auxad_ref_sel : 1; // [1]
  522. uint32_t rg_auxad_vss_sel : 1; // [2]
  523. uint32_t rg_auxad_test_en : 1; // [3]
  524. uint32_t rg_auxad_currentsen_en : 1; // [4]
  525. uint32_t rg_auxad_thm_cal : 1; // [5]
  526. uint32_t __31_6 : 26; // [31:6]
  527. } b;
  528. } REG_PMIC_ANA_AUXADC_CTRL_T;
  529. // chgr_status
  530. typedef union {
  531. uint32_t v;
  532. struct
  533. {
  534. uint32_t vchg_ovi : 1; // [0], read only
  535. uint32_t __1_1 : 1; // [1]
  536. uint32_t chgr_int : 1; // [2], read only
  537. uint32_t chgr_on : 1; // [3], read only
  538. uint32_t chgr_cv_status : 1; // [4], read only
  539. uint32_t cdp_int : 1; // [5], read only
  540. uint32_t dcp_int : 1; // [6], read only
  541. uint32_t sdp_int : 1; // [7], read only
  542. uint32_t chg_det : 1; // [8], read only
  543. uint32_t dcp_det : 1; // [9], read only
  544. uint32_t dp_low : 1; // [10], read only
  545. uint32_t chg_det_done : 1; // [11], read only
  546. uint32_t non_dcp_int : 1; // [12], read only
  547. uint32_t __31_13 : 19; // [31:13]
  548. } b;
  549. } REG_PMIC_ANA_CHGR_STATUS_T;
  550. // arch_en
  551. typedef union {
  552. uint32_t v;
  553. struct
  554. {
  555. uint32_t arch_en : 1; // [0]
  556. uint32_t __31_1 : 31; // [31:1]
  557. } b;
  558. } REG_PMIC_ANA_ARCH_EN_T;
  559. // mcu_wr_prot_value
  560. typedef union {
  561. uint32_t v;
  562. struct
  563. {
  564. uint32_t mcu_wr_prot_value : 15; // [14:0]
  565. uint32_t mcu_wr_prot : 1; // [15], read only
  566. uint32_t __31_16 : 16; // [31:16]
  567. } b;
  568. } REG_PMIC_ANA_MCU_WR_PROT_VALUE_T;
  569. // dcdc_core_reg1
  570. typedef union {
  571. uint32_t v;
  572. struct
  573. {
  574. uint32_t div_base_vcore : 6; // [5:0]
  575. uint32_t phase_sel_vcore : 6; // [11:6]
  576. uint32_t div_clk_vcore_en : 1; // [12]
  577. uint32_t __31_13 : 19; // [31:13]
  578. } b;
  579. } REG_PMIC_ANA_DCDC_CORE_REG1_T;
  580. // dcdc_gen_reg1
  581. typedef union {
  582. uint32_t v;
  583. struct
  584. {
  585. uint32_t div_base_vgen : 6; // [5:0]
  586. uint32_t phase_sel_vgen : 6; // [11:6]
  587. uint32_t div_clk_vgen_en : 1; // [12]
  588. uint32_t __31_13 : 19; // [31:13]
  589. } b;
  590. } REG_PMIC_ANA_DCDC_GEN_REG1_T;
  591. // dcdc_vrf_reg1
  592. typedef union {
  593. uint32_t v;
  594. struct
  595. {
  596. uint32_t div_base_vrf : 6; // [5:0]
  597. uint32_t phase_sel_vrf : 6; // [11:6]
  598. uint32_t div_clk_vrf_en : 1; // [12]
  599. uint32_t __31_13 : 19; // [31:13]
  600. } b;
  601. } REG_PMIC_ANA_DCDC_VRF_REG1_T;
  602. // bg_ctrl0
  603. typedef union {
  604. uint32_t v;
  605. struct
  606. {
  607. uint32_t __7_0 : 8; // [7:0]
  608. uint32_t rg_bg_ts : 1; // [8]
  609. uint32_t __11_9 : 3; // [11:9]
  610. uint32_t bg_chop_en : 1; // [12]
  611. uint32_t __31_13 : 19; // [31:13]
  612. } b;
  613. } REG_PMIC_ANA_BG_CTRL0_T;
  614. // ldo_vosel1
  615. typedef union {
  616. uint32_t v;
  617. struct
  618. {
  619. uint32_t rg_ldo_cama_vosel : 6; // [5:0]
  620. uint32_t __9_6 : 4; // [9:6]
  621. uint32_t rg_ldo_usb33_vosel : 6; // [15:10]
  622. uint32_t __31_16 : 16; // [31:16]
  623. } b;
  624. } REG_PMIC_ANA_LDO_VOSEL1_T;
  625. // ldo_vosel3
  626. typedef union {
  627. uint32_t v;
  628. struct
  629. {
  630. uint32_t rg_ldo_vio33_vosel : 6; // [5:0]
  631. uint32_t __9_6 : 4; // [9:6]
  632. uint32_t rg_ldo_mmc_vosel : 6; // [15:10]
  633. uint32_t __31_16 : 16; // [31:16]
  634. } b;
  635. } REG_PMIC_ANA_LDO_VOSEL3_T;
  636. // ldo_vosel4
  637. typedef union {
  638. uint32_t v;
  639. struct
  640. {
  641. uint32_t rg_ldo_lp18_vosel : 6; // [5:0]
  642. uint32_t __9_6 : 4; // [9:6]
  643. uint32_t rg_ldo_lcd_vosel : 6; // [15:10]
  644. uint32_t __31_16 : 16; // [31:16]
  645. } b;
  646. } REG_PMIC_ANA_LDO_VOSEL4_T;
  647. // ldo_lp18_vio33_ctrl1
  648. typedef union {
  649. uint32_t v;
  650. struct
  651. {
  652. uint32_t rg_ldo_vio33_ulp_itrim : 2; // [1:0]
  653. uint32_t __3_2 : 2; // [3:2]
  654. uint32_t rg_ldo_vio33_ulp_ifb_en : 1; // [4]
  655. uint32_t __7_5 : 3; // [7:5]
  656. uint32_t rg_ldo_lp18_ulp_itrim : 2; // [9:8]
  657. uint32_t __11_10 : 2; // [11:10]
  658. uint32_t rg_ldo_lp18_ulp_ifb_en : 1; // [12]
  659. uint32_t __31_13 : 19; // [31:13]
  660. } b;
  661. } REG_PMIC_ANA_LDO_LP18_VIO33_CTRL1_T;
  662. // reserved_reg_core
  663. typedef union {
  664. uint32_t v;
  665. struct
  666. {
  667. uint32_t reserved_core : 16; // [15:0]
  668. uint32_t __31_16 : 16; // [31:16]
  669. } b;
  670. } REG_PMIC_ANA_RESERVED_REG_CORE_T;
  671. // ldo_sim_ctrl0
  672. typedef union {
  673. uint32_t v;
  674. struct
  675. {
  676. uint32_t rg_ldo_sim0_discharge_en : 1; // [0]
  677. uint32_t rg_ldo_sim0_stb : 2; // [2:1]
  678. uint32_t rg_ldo_sim0_rz_adj : 1; // [3]
  679. uint32_t rg_ldo_sim0_shpt_en : 1; // [4]
  680. uint32_t rg_ldo_sim0_cl_adj : 3; // [7:5]
  681. uint32_t rg_ldo_sim1_discharge_en : 1; // [8]
  682. uint32_t rg_ldo_sim1_stb : 2; // [10:9]
  683. uint32_t rg_ldo_sim1_rz_adj : 1; // [11]
  684. uint32_t rg_ldo_sim1_shpt_en : 1; // [12]
  685. uint32_t rg_ldo_sim1_cl_adj : 3; // [15:13]
  686. uint32_t __31_16 : 16; // [31:16]
  687. } b;
  688. } REG_PMIC_ANA_LDO_SIM_CTRL0_T;
  689. // ldo_sim_vosel
  690. typedef union {
  691. uint32_t v;
  692. struct
  693. {
  694. uint32_t rg_ldo_sim1_vosel : 6; // [5:0]
  695. uint32_t __9_6 : 4; // [9:6]
  696. uint32_t rg_ldo_sim0_vosel : 6; // [15:10]
  697. uint32_t __31_16 : 16; // [31:16]
  698. } b;
  699. } REG_PMIC_ANA_LDO_SIM_VOSEL_T;
  700. // sim_vpa_ctrl0
  701. typedef union {
  702. uint32_t v;
  703. struct
  704. {
  705. uint32_t rg_vpa_pd : 1; // [0]
  706. uint32_t __3_1 : 3; // [3:1]
  707. uint32_t rg_vpa_lp_en : 1; // [4]
  708. uint32_t __7_5 : 3; // [7:5]
  709. uint32_t da_ldo_sim1_lp_en : 1; // [8]
  710. uint32_t da_ldo_sim0_lp_en : 1; // [9]
  711. uint32_t __11_10 : 2; // [11:10]
  712. uint32_t da_ldo_sim1_pd : 1; // [12]
  713. uint32_t da_ldo_sim0_pd : 1; // [13]
  714. uint32_t __31_14 : 18; // [31:14]
  715. } b;
  716. } REG_PMIC_ANA_SIM_VPA_CTRL0_T;
  717. // ldo_sim_ctrl1
  718. typedef union {
  719. uint32_t v;
  720. struct
  721. {
  722. uint32_t __7_0 : 8; // [7:0]
  723. uint32_t slp_ldosim0_lp_en : 1; // [8]
  724. uint32_t slp_ldosim1_lp_en : 1; // [9]
  725. uint32_t __11_10 : 2; // [11:10]
  726. uint32_t slp_ldosim0_pd_en : 1; // [12]
  727. uint32_t slp_ldosim1_pd_en : 1; // [13]
  728. uint32_t __31_14 : 18; // [31:14]
  729. } b;
  730. } REG_PMIC_ANA_LDO_SIM_CTRL1_T;
  731. // vpa_ctrl0
  732. typedef union {
  733. uint32_t v;
  734. struct
  735. {
  736. uint32_t da_vpa_votrim : 5; // [4:0]
  737. uint32_t __11_5 : 7; // [11:5]
  738. uint32_t ldo_vpa_votrim_sw_sel : 1; // [12]
  739. uint32_t __31_13 : 19; // [31:13]
  740. } b;
  741. } REG_PMIC_ANA_VPA_CTRL0_T;
  742. // vpa_ctrl1
  743. typedef union {
  744. uint32_t v;
  745. struct
  746. {
  747. uint32_t rg_vpa_vosel : 7; // [6:0]
  748. uint32_t __31_7 : 25; // [31:7]
  749. } b;
  750. } REG_PMIC_ANA_VPA_CTRL1_T;
  751. // vpa_ctrl2
  752. typedef union {
  753. uint32_t v;
  754. struct
  755. {
  756. uint32_t rg_vpa_curses_m : 2; // [1:0]
  757. uint32_t rg_vpa_curlimit_r : 2; // [3:2]
  758. uint32_t rg_vpa_ccomp3 : 2; // [5:4]
  759. uint32_t rg_vpa_bypass_threshold : 2; // [7:6]
  760. uint32_t rg_vpa_bypass_forceon : 1; // [8]
  761. uint32_t rg_vpa_bypass_disable : 1; // [9]
  762. uint32_t rg_vpa_apc_ramp_sel : 1; // [10]
  763. uint32_t rg_vpa_apc_enable : 1; // [11]
  764. uint32_t rg_vpa_antiring_en : 1; // [12]
  765. uint32_t rg_vpa_zx_offset : 2; // [14:13]
  766. uint32_t rg_vpa_zx_disable : 1; // [15]
  767. uint32_t __31_16 : 16; // [31:16]
  768. } b;
  769. } REG_PMIC_ANA_VPA_CTRL2_T;
  770. // vpa_ctrl3
  771. typedef union {
  772. uint32_t v;
  773. struct
  774. {
  775. uint32_t rg_vpa_sr_ls : 2; // [1:0]
  776. uint32_t rg_vpa_sr_hs : 2; // [3:2]
  777. uint32_t rg_vpa_sawtooth_slope : 2; // [5:4]
  778. uint32_t rg_vpa_rcomp3 : 2; // [7:6]
  779. uint32_t rg_vpa_rcomp2 : 2; // [9:8]
  780. uint32_t rg_vpa_pfm_threshold : 2; // [11:10]
  781. uint32_t rg_vpa_maxduty_sel : 1; // [12]
  782. uint32_t rg_vpa_force_pwm : 1; // [13]
  783. uint32_t rg_vpa_dvs_on : 1; // [14]
  784. uint32_t rg_vpa_sawtoothcal_rst : 1; // [15]
  785. uint32_t __31_16 : 16; // [31:16]
  786. } b;
  787. } REG_PMIC_ANA_VPA_CTRL3_T;
  788. // dcdc_vpa_reg1
  789. typedef union {
  790. uint32_t v;
  791. struct
  792. {
  793. uint32_t div_base_vpa : 6; // [5:0]
  794. uint32_t phase_sel_vpa : 6; // [11:6]
  795. uint32_t div_clk_vpa_en : 1; // [12]
  796. uint32_t __31_13 : 19; // [31:13]
  797. } b;
  798. } REG_PMIC_ANA_DCDC_VPA_REG1_T;
  799. // chip_id_low
  800. #define PMIC_ANA_CHIP_ID_LOW(n) (((n)&0xffff) << 0)
  801. // chip_id_high
  802. #define PMIC_ANA_CHIP_ID_HIGH(n) (((n)&0xffff) << 0)
  803. // module_en0
  804. #define PMIC_ANA_CAL_EN (1 << 0)
  805. #define PMIC_ANA_ADC_EN (1 << 5)
  806. #define PMIC_ANA_EFS_EN (1 << 6)
  807. #define PMIC_ANA_BLTC_EN (1 << 9)
  808. #define PMIC_ANA_TMR_EN (1 << 12)
  809. // dig_clk_en0
  810. #define PMIC_ANA_CLK_CAL_EN (1 << 2)
  811. #define PMIC_ANA_CLK_CAL_SRC_SEL(n) (((n)&0x3) << 3)
  812. #define PMIC_ANA_CLK_AUXADC_EN (1 << 5)
  813. #define PMIC_ANA_CLK_AUXAD_EN (1 << 6)
  814. // rtc_clk_en0
  815. #define PMIC_ANA_RTC_ARCH_EN (1 << 0)
  816. #define PMIC_ANA_RTC_BLTC_EN (1 << 7)
  817. #define PMIC_ANA_RTC_TMR_EN (1 << 13)
  818. // soft_rst0
  819. #define PMIC_ANA_CAL_SOFT_RST (1 << 0)
  820. #define PMIC_ANA_TMR_SOFT_RST (1 << 4)
  821. #define PMIC_ANA_ADC_SOFT_RST (1 << 6)
  822. #define PMIC_ANA_EFS_SOFT_RST (1 << 7)
  823. #define PMIC_ANA_BLTC_SOFT_RST (1 << 9)
  824. // xtl_wait
  825. #define PMIC_ANA_XTL_WAIT(n) (((n)&0xff) << 0)
  826. #define PMIC_ANA_SLP_RGB_PD_EN (1 << 15)
  827. // rg_dvdd_reserved1
  828. #define PMIC_ANA_RG_DVDD_RESERVED1(n) (((n)&0xff) << 0)
  829. #define PMIC_ANA_RG_DVDD_RESERVED0(n) (((n)&0xff) << 8)
  830. // vbat_ctrl0
  831. #define PMIC_ANA_RG_LDO_VBAT_AUXCAL_SEL(n) (((n)&0x7) << 0)
  832. // thm_otp_ctrl
  833. #define PMIC_ANA_RG_OTP_OP(n) (((n)&0x7) << 0)
  834. #define PMIC_ANA_RG_OTP_EN (1 << 3)
  835. // led_ctrl
  836. #define PMIC_ANA_RG_IB_TRIM(n) (((n)&0x7f) << 0)
  837. #define PMIC_ANA_RG_IB_REX_EN (1 << 7)
  838. #define PMIC_ANA_RG_BATDET_CUR_I(n) (((n)&0x7) << 8)
  839. #define PMIC_ANA_RG_BATDET_CUR_EN (1 << 11)
  840. #define PMIC_ANA_IB_TRIM_EM_SEL (1 << 12)
  841. // kpled_ctrl1
  842. #define PMIC_ANA_RG_LDO_KPLED_SHPT_PD (1 << 0)
  843. #define PMIC_ANA_RG_LDO_KPLED_V(n) (((n)&0x7) << 1)
  844. #define PMIC_ANA_RG_LDO_KPLED_CAP_SEL (1 << 4)
  845. #define PMIC_ANA_RG_LDO_KPLED_STB(n) (((n)&0x3) << 5)
  846. #define PMIC_ANA_RG_LDO_KPLED_SHPT_ADJ (1 << 7)
  847. #define PMIC_ANA_RG_KPLED_V(n) (((n)&0xf) << 8)
  848. #define PMIC_ANA_RG_LDO_KPLED_CL_ADJ (1 << 12)
  849. // ldo_vbat_ctrl1
  850. #define PMIC_ANA_RG_LDO_USB33_DISCHARGE_EN (1 << 0)
  851. #define PMIC_ANA_RG_LDO_USB33_STB(n) (((n)&0x3) << 1)
  852. #define PMIC_ANA_RG_LDO_USB33_RZ_ADJ (1 << 3)
  853. #define PMIC_ANA_RG_LDO_USB33_SHPT_EN (1 << 4)
  854. #define PMIC_ANA_RG_LDO_USB33_CL_ADJ(n) (((n)&0x7) << 5)
  855. // ldo_vbat_ctrl2
  856. #define PMIC_ANA_RG_LDO_CAMA_DISCHARGE_EN (1 << 0)
  857. #define PMIC_ANA_RG_LDO_CAMA_STB(n) (((n)&0x3) << 1)
  858. #define PMIC_ANA_RG_LDO_CAMA_RZ_ADJ (1 << 3)
  859. #define PMIC_ANA_RG_LDO_CAMA_SHPT_EN (1 << 4)
  860. #define PMIC_ANA_RG_LDO_CAMA_CL_ADJ(n) (((n)&0x7) << 5)
  861. #define PMIC_ANA_RG_LDO_VIO33_DISCHARGE_EN (1 << 8)
  862. #define PMIC_ANA_RG_LDO_VIO33_STB(n) (((n)&0x3) << 9)
  863. #define PMIC_ANA_RG_LDO_VIO33_RZ_ADJ (1 << 11)
  864. #define PMIC_ANA_RG_LDO_VIO33_SHPT_EN (1 << 12)
  865. #define PMIC_ANA_RG_LDO_VIO33_CL_ADJ(n) (((n)&0x7) << 13)
  866. // ldo_vbat_ctrl3
  867. #define PMIC_ANA_RG_LDO_MMC_DISCHARGE_EN (1 << 0)
  868. #define PMIC_ANA_RG_LDO_MMC_STB(n) (((n)&0x3) << 1)
  869. #define PMIC_ANA_RG_LDO_MMC_RZ_ADJ (1 << 3)
  870. #define PMIC_ANA_RG_LDO_MMC_SHPT_EN (1 << 4)
  871. #define PMIC_ANA_RG_LDO_MMC_CL_ADJ(n) (((n)&0x7) << 5)
  872. #define PMIC_ANA_RG_LDO_LCD_DISCHARGE_EN (1 << 8)
  873. #define PMIC_ANA_RG_LDO_LCD_STB(n) (((n)&0x3) << 9)
  874. #define PMIC_ANA_RG_LDO_LCD_RZ_ADJ (1 << 11)
  875. #define PMIC_ANA_RG_LDO_LCD_SHPT_EN (1 << 12)
  876. #define PMIC_ANA_RG_LDO_LCD_CL_ADJ(n) (((n)&0x7) << 13)
  877. // ldo_ana_ctrl
  878. #define PMIC_ANA_RG_LDO_ANA_V(n) (((n)&0x3f) << 0)
  879. #define PMIC_ANA_RG_LDO_ANA_CAP_SEL (1 << 8)
  880. #define PMIC_ANA_RG_LDO_ANA_BP (1 << 9)
  881. #define PMIC_ANA_RG_LDO_ANA_STB(n) (((n)&0x3) << 10)
  882. #define PMIC_ANA_RG_LDO_ANA_SHPT_ADJ (1 << 12)
  883. #define PMIC_ANA_RG_LDO_ANA_SHPT_PD (1 << 13)
  884. #define PMIC_ANA_RG_LDO_ANA_CL_ADJ (1 << 14)
  885. // ldo_vio18_ctrl
  886. #define PMIC_ANA_RG_LDO_VIO18_V(n) (((n)&0x3f) << 0)
  887. #define PMIC_ANA_RG_LDO_VIO18_CAP_SEL (1 << 8)
  888. #define PMIC_ANA_RG_LDO_VIO18_BP (1 << 9)
  889. #define PMIC_ANA_RG_LDO_VIO18_STB(n) (((n)&0x3) << 10)
  890. #define PMIC_ANA_RG_LDO_VIO18_SHPT_ADJ (1 << 12)
  891. #define PMIC_ANA_RG_LDO_VIO18_SHPT_PD (1 << 13)
  892. #define PMIC_ANA_RG_LDO_VIO18_CL_ADJ (1 << 14)
  893. // ldo_vgen_ctrl1
  894. #define PMIC_ANA_RG_LDO_MEM_V(n) (((n)&0x3f) << 0)
  895. #define PMIC_ANA_RG_LDO_MEM_CAP_SEL (1 << 8)
  896. #define PMIC_ANA_RG_LDO_MEM_BP (1 << 9)
  897. #define PMIC_ANA_RG_LDO_MEM_STB(n) (((n)&0x3) << 10)
  898. #define PMIC_ANA_RG_LDO_MEM_SHPT_ADJ (1 << 12)
  899. #define PMIC_ANA_RG_LDO_MEM_SHPT_PD (1 << 13)
  900. #define PMIC_ANA_RG_LDO_MEM_CL_ADJ (1 << 14)
  901. // ldo_spimem_ctrl
  902. #define PMIC_ANA_RG_LDO_SPIMEM_V(n) (((n)&0x3f) << 0)
  903. #define PMIC_ANA_RG_LDO_SPIMEM_CAP_SEL (1 << 8)
  904. #define PMIC_ANA_RG_LDO_SPIMEM_BP (1 << 9)
  905. #define PMIC_ANA_RG_LDO_SPIMEM_STB(n) (((n)&0x3) << 10)
  906. #define PMIC_ANA_RG_LDO_SPIMEM_SHPT_ADJ (1 << 12)
  907. #define PMIC_ANA_RG_LDO_SPIMEM_SHPT_PD (1 << 13)
  908. #define PMIC_ANA_RG_LDO_SPIMEM_CL_ADJ (1 << 14)
  909. // ldo_camd_ctrl
  910. #define PMIC_ANA_RG_LDO_CAMD_V(n) (((n)&0x3f) << 0)
  911. #define PMIC_ANA_RG_LDO_CAMD_CAP_SEL (1 << 8)
  912. #define PMIC_ANA_RG_LDO_CAMD_BP (1 << 9)
  913. #define PMIC_ANA_RG_LDO_CAMD_STB(n) (((n)&0x3) << 10)
  914. #define PMIC_ANA_RG_LDO_CAMD_SHPT_ADJ (1 << 12)
  915. #define PMIC_ANA_RG_LDO_CAMD_SHPT_PD (1 << 13)
  916. #define PMIC_ANA_RG_LDO_CAMD_CL_ADJ (1 << 14)
  917. // ldo_rf15_ctrl
  918. #define PMIC_ANA_RG_LDO_RF15_V(n) (((n)&0x3f) << 0)
  919. #define PMIC_ANA_RG_LDO_RF15_CAP_SEL (1 << 8)
  920. #define PMIC_ANA_RG_LDO_RF15_BP (1 << 9)
  921. #define PMIC_ANA_RG_LDO_RF15_STB(n) (((n)&0x3) << 10)
  922. #define PMIC_ANA_RG_LDO_RF15_SHPT_ADJ (1 << 12)
  923. #define PMIC_ANA_RG_LDO_RF15_SHPT_PD (1 << 13)
  924. #define PMIC_ANA_RG_LDO_RF15_CL_ADJ (1 << 14)
  925. // ldo_lp18_ctrl
  926. #define PMIC_ANA_RG_LDO_LP18_DISCHARGE_EN (1 << 8)
  927. #define PMIC_ANA_RG_LDO_LP18_STB(n) (((n)&0x3) << 9)
  928. #define PMIC_ANA_RG_LDO_LP18_RZ_ADJ (1 << 11)
  929. #define PMIC_ANA_RG_LDO_LP18_SHPT_EN (1 << 12)
  930. #define PMIC_ANA_RG_LDO_LP18_CL_ADJ(n) (((n)&0x7) << 13)
  931. // ldo_rf12_ctrl
  932. #define PMIC_ANA_RG_LDO_RF12_CAP_SEL (1 << 0)
  933. #define PMIC_ANA_RG_LDO_RF12_BP (1 << 1)
  934. #define PMIC_ANA_RG_LDO_RF12_STB(n) (((n)&0x3) << 2)
  935. #define PMIC_ANA_RG_LDO_RF12_V(n) (((n)&0x3f) << 4)
  936. #define PMIC_ANA_RG_LDO_RF12_SHPT_ADJ (1 << 10)
  937. #define PMIC_ANA_RG_LDO_RF12_SHPT_PD (1 << 11)
  938. #define PMIC_ANA_RG_LDO_RF12_CL_ADJ (1 << 12)
  939. // dcdc_ctrl1
  940. #define PMIC_ANA_RG_DCDC_CLKOUT_SEL(n) (((n)&0xf) << 0)
  941. #define PMIC_ANA_RG_DCDC_CLKOUT_UNIPHASE (1 << 4)
  942. #define PMIC_ANA_RG_CLK3M_OUT_EN (1 << 11)
  943. #define PMIC_ANA_RG_DCDC_AUXTRIM_SEL(n) (((n)&0xf) << 12)
  944. // vcore_ctrl2
  945. #define PMIC_ANA_RG_VCORE_CURSES_R(n) (((n)&0x3) << 0)
  946. #define PMIC_ANA_RG_VCORE_CURAVG(n) (((n)&0x3) << 2)
  947. #define PMIC_ANA_RG_VCORE_CURLIMIT_R(n) (((n)&0x3) << 4)
  948. #define PMIC_ANA_RG_VCORE_ANTIRING_EN (1 << 6)
  949. // vcore_ctrl3
  950. #define PMIC_ANA_RG_VCORE_SR_LS(n) (((n)&0x3) << 0)
  951. #define PMIC_ANA_RG_VCORE_SR_HS(n) (((n)&0x3) << 2)
  952. #define PMIC_ANA_RG_VCORE_SLOPE(n) (((n)&0x3) << 4)
  953. #define PMIC_ANA_RG_VCORE_RCOMP(n) (((n)&0x3) << 6)
  954. #define PMIC_ANA_RG_VCORE_PFM_VH(n) (((n)&0x3) << 8)
  955. #define PMIC_ANA_RG_VCORE_ZX_OFFSET(n) (((n)&0x3) << 10)
  956. #define PMIC_ANA_RG_VCORE_ZX_DISABLE (1 << 12)
  957. #define PMIC_ANA_RG_VCORE_FORCE_PWM (1 << 13)
  958. // vrf_ctrl0
  959. #define PMIC_ANA_RG_VRF_CURSES_R(n) (((n)&0x3) << 0)
  960. #define PMIC_ANA_RG_VRF_CURAVG(n) (((n)&0x3) << 2)
  961. #define PMIC_ANA_RG_VRF_CURLIMIT_R(n) (((n)&0x3) << 4)
  962. #define PMIC_ANA_RG_VRF_ANTIRING_EN (1 << 6)
  963. // vrf_ctrl1
  964. #define PMIC_ANA_RG_VRF_SR_LS(n) (((n)&0x3) << 0)
  965. #define PMIC_ANA_RG_VRF_SR_HS(n) (((n)&0x3) << 2)
  966. #define PMIC_ANA_RG_VRF_SLOPE(n) (((n)&0x3) << 4)
  967. #define PMIC_ANA_RG_VRF_RCOMP(n) (((n)&0x3) << 6)
  968. #define PMIC_ANA_RG_VRF_PFM_VH(n) (((n)&0x3) << 8)
  969. #define PMIC_ANA_RG_VRF_ZX_OFFSET(n) (((n)&0x3) << 10)
  970. #define PMIC_ANA_RG_VRF_ZX_DISABLE (1 << 12)
  971. #define PMIC_ANA_RG_VRF_FORCE_PWM (1 << 13)
  972. // vgen_ctrl2
  973. #define PMIC_ANA_RG_VGEN_CURSES_R(n) (((n)&0x3) << 0)
  974. #define PMIC_ANA_RG_VGEN_CURLIMIT_R(n) (((n)&0x3) << 2)
  975. #define PMIC_ANA_RG_VGEN_ZX_OFFSET(n) (((n)&0x3) << 4)
  976. #define PMIC_ANA_RG_VGEN_ZX_DISABLE (1 << 6)
  977. #define PMIC_ANA_RG_VGEN_ANTIRING_EN (1 << 7)
  978. #define PMIC_ANA_DCDC_GEN_CLK_RST (1 << 8)
  979. // vgen_ctrl3
  980. #define PMIC_ANA_RG_VGEN_SR_LS(n) (((n)&0x3) << 0)
  981. #define PMIC_ANA_RG_VGEN_SR_HS(n) (((n)&0x3) << 2)
  982. #define PMIC_ANA_RG_VGEN_SLOPE(n) (((n)&0x3) << 4)
  983. #define PMIC_ANA_RG_VGEN_RCOMP(n) (((n)&0x3) << 6)
  984. #define PMIC_ANA_RG_VGEN_PFM_VH(n) (((n)&0x3) << 8)
  985. #define PMIC_ANA_RG_VGEN_MAXDUTY_SEL (1 << 10)
  986. #define PMIC_ANA_RG_VGEN_FORCE_PWM (1 << 11)
  987. // chgr_ctrl1
  988. #define PMIC_ANA_CHGR_CC_I(n) (((n)&0xf) << 0)
  989. #define PMIC_ANA_VCHG_OVP_V(n) (((n)&0x3) << 4)
  990. #define PMIC_ANA_CHGR_ITERM(n) (((n)&0x3) << 6)
  991. #define PMIC_ANA_CHGR_END_V(n) (((n)&0x3) << 8)
  992. #define PMIC_ANA_CHGR_CC_EN (1 << 10)
  993. // auxadc_ctrl
  994. #define PMIC_ANA_RG_AUXAD_SGN_CODE (1 << 0)
  995. #define PMIC_ANA_RG_AUXAD_REF_SEL (1 << 1)
  996. #define PMIC_ANA_RG_AUXAD_VSS_SEL (1 << 2)
  997. #define PMIC_ANA_RG_AUXAD_TEST_EN (1 << 3)
  998. #define PMIC_ANA_RG_AUXAD_CURRENTSEN_EN (1 << 4)
  999. #define PMIC_ANA_RG_AUXAD_THM_CAL (1 << 5)
  1000. // chgr_status
  1001. #define PMIC_ANA_VCHG_OVI (1 << 0)
  1002. #define PMIC_ANA_CHGR_INT (1 << 2)
  1003. #define PMIC_ANA_CHGR_ON (1 << 3)
  1004. #define PMIC_ANA_CHGR_CV_STATUS (1 << 4)
  1005. #define PMIC_ANA_CDP_INT (1 << 5)
  1006. #define PMIC_ANA_DCP_INT (1 << 6)
  1007. #define PMIC_ANA_SDP_INT (1 << 7)
  1008. #define PMIC_ANA_CHG_DET (1 << 8)
  1009. #define PMIC_ANA_DCP_DET (1 << 9)
  1010. #define PMIC_ANA_DP_LOW (1 << 10)
  1011. #define PMIC_ANA_CHG_DET_DONE (1 << 11)
  1012. #define PMIC_ANA_NON_DCP_INT (1 << 12)
  1013. // arch_en
  1014. #define PMIC_ANA_ARCH_EN (1 << 0)
  1015. // mcu_wr_prot_value
  1016. #define PMIC_ANA_MCU_WR_PROT_VALUE(n) (((n)&0x7fff) << 0)
  1017. #define PMIC_ANA_MCU_WR_PROT (1 << 15)
  1018. // dcdc_core_reg1
  1019. #define PMIC_ANA_DIV_BASE_VCORE(n) (((n)&0x3f) << 0)
  1020. #define PMIC_ANA_PHASE_SEL_VCORE(n) (((n)&0x3f) << 6)
  1021. #define PMIC_ANA_DIV_CLK_VCORE_EN (1 << 12)
  1022. // dcdc_gen_reg1
  1023. #define PMIC_ANA_DIV_BASE_VGEN(n) (((n)&0x3f) << 0)
  1024. #define PMIC_ANA_PHASE_SEL_VGEN(n) (((n)&0x3f) << 6)
  1025. #define PMIC_ANA_DIV_CLK_VGEN_EN (1 << 12)
  1026. // dcdc_vrf_reg1
  1027. #define PMIC_ANA_DIV_BASE_VRF(n) (((n)&0x3f) << 0)
  1028. #define PMIC_ANA_PHASE_SEL_VRF(n) (((n)&0x3f) << 6)
  1029. #define PMIC_ANA_DIV_CLK_VRF_EN (1 << 12)
  1030. // bg_ctrl0
  1031. #define PMIC_ANA_RG_BG_TS (1 << 8)
  1032. #define PMIC_ANA_BG_CHOP_EN (1 << 12)
  1033. // ldo_vosel1
  1034. #define PMIC_ANA_RG_LDO_CAMA_VOSEL(n) (((n)&0x3f) << 0)
  1035. #define PMIC_ANA_RG_LDO_USB33_VOSEL(n) (((n)&0x3f) << 10)
  1036. // ldo_vosel3
  1037. #define PMIC_ANA_RG_LDO_VIO33_VOSEL(n) (((n)&0x3f) << 0)
  1038. #define PMIC_ANA_RG_LDO_MMC_VOSEL(n) (((n)&0x3f) << 10)
  1039. // ldo_vosel4
  1040. #define PMIC_ANA_RG_LDO_LP18_VOSEL(n) (((n)&0x3f) << 0)
  1041. #define PMIC_ANA_RG_LDO_LCD_VOSEL(n) (((n)&0x3f) << 10)
  1042. // ldo_lp18_vio33_ctrl1
  1043. #define PMIC_ANA_RG_LDO_VIO33_ULP_ITRIM(n) (((n)&0x3) << 0)
  1044. #define PMIC_ANA_RG_LDO_VIO33_ULP_IFB_EN (1 << 4)
  1045. #define PMIC_ANA_RG_LDO_LP18_ULP_ITRIM(n) (((n)&0x3) << 8)
  1046. #define PMIC_ANA_RG_LDO_LP18_ULP_IFB_EN (1 << 12)
  1047. // reserved_reg_core
  1048. #define PMIC_ANA_RESERVED_CORE(n) (((n)&0xffff) << 0)
  1049. // ldo_sim_ctrl0
  1050. #define PMIC_ANA_RG_LDO_SIM0_DISCHARGE_EN (1 << 0)
  1051. #define PMIC_ANA_RG_LDO_SIM0_STB(n) (((n)&0x3) << 1)
  1052. #define PMIC_ANA_RG_LDO_SIM0_RZ_ADJ (1 << 3)
  1053. #define PMIC_ANA_RG_LDO_SIM0_SHPT_EN (1 << 4)
  1054. #define PMIC_ANA_RG_LDO_SIM0_CL_ADJ(n) (((n)&0x7) << 5)
  1055. #define PMIC_ANA_RG_LDO_SIM1_DISCHARGE_EN (1 << 8)
  1056. #define PMIC_ANA_RG_LDO_SIM1_STB(n) (((n)&0x3) << 9)
  1057. #define PMIC_ANA_RG_LDO_SIM1_RZ_ADJ (1 << 11)
  1058. #define PMIC_ANA_RG_LDO_SIM1_SHPT_EN (1 << 12)
  1059. #define PMIC_ANA_RG_LDO_SIM1_CL_ADJ(n) (((n)&0x7) << 13)
  1060. // ldo_sim_vosel
  1061. #define PMIC_ANA_RG_LDO_SIM1_VOSEL(n) (((n)&0x3f) << 0)
  1062. #define PMIC_ANA_RG_LDO_SIM0_VOSEL(n) (((n)&0x3f) << 10)
  1063. // sim_vpa_ctrl0
  1064. #define PMIC_ANA_RG_VPA_PD (1 << 0)
  1065. #define PMIC_ANA_RG_VPA_LP_EN (1 << 4)
  1066. #define PMIC_ANA_DA_LDO_SIM1_LP_EN (1 << 8)
  1067. #define PMIC_ANA_DA_LDO_SIM0_LP_EN (1 << 9)
  1068. #define PMIC_ANA_DA_LDO_SIM1_PD (1 << 12)
  1069. #define PMIC_ANA_DA_LDO_SIM0_PD (1 << 13)
  1070. // ldo_sim_ctrl1
  1071. #define PMIC_ANA_SLP_LDOSIM0_LP_EN (1 << 8)
  1072. #define PMIC_ANA_SLP_LDOSIM1_LP_EN (1 << 9)
  1073. #define PMIC_ANA_SLP_LDOSIM0_PD_EN (1 << 12)
  1074. #define PMIC_ANA_SLP_LDOSIM1_PD_EN (1 << 13)
  1075. // vpa_ctrl0
  1076. #define PMIC_ANA_DA_VPA_VOTRIM(n) (((n)&0x1f) << 0)
  1077. #define PMIC_ANA_LDO_VPA_VOTRIM_SW_SEL (1 << 12)
  1078. // vpa_ctrl1
  1079. #define PMIC_ANA_RG_VPA_VOSEL(n) (((n)&0x7f) << 0)
  1080. // vpa_ctrl2
  1081. #define PMIC_ANA_RG_VPA_CURSES_M(n) (((n)&0x3) << 0)
  1082. #define PMIC_ANA_RG_VPA_CURLIMIT_R(n) (((n)&0x3) << 2)
  1083. #define PMIC_ANA_RG_VPA_CCOMP3(n) (((n)&0x3) << 4)
  1084. #define PMIC_ANA_RG_VPA_BYPASS_THRESHOLD(n) (((n)&0x3) << 6)
  1085. #define PMIC_ANA_RG_VPA_BYPASS_FORCEON (1 << 8)
  1086. #define PMIC_ANA_RG_VPA_BYPASS_DISABLE (1 << 9)
  1087. #define PMIC_ANA_RG_VPA_APC_RAMP_SEL (1 << 10)
  1088. #define PMIC_ANA_RG_VPA_APC_ENABLE (1 << 11)
  1089. #define PMIC_ANA_RG_VPA_ANTIRING_EN (1 << 12)
  1090. #define PMIC_ANA_RG_VPA_ZX_OFFSET(n) (((n)&0x3) << 13)
  1091. #define PMIC_ANA_RG_VPA_ZX_DISABLE (1 << 15)
  1092. // vpa_ctrl3
  1093. #define PMIC_ANA_RG_VPA_SR_LS(n) (((n)&0x3) << 0)
  1094. #define PMIC_ANA_RG_VPA_SR_HS(n) (((n)&0x3) << 2)
  1095. #define PMIC_ANA_RG_VPA_SAWTOOTH_SLOPE(n) (((n)&0x3) << 4)
  1096. #define PMIC_ANA_RG_VPA_RCOMP3(n) (((n)&0x3) << 6)
  1097. #define PMIC_ANA_RG_VPA_RCOMP2(n) (((n)&0x3) << 8)
  1098. #define PMIC_ANA_RG_VPA_PFM_THRESHOLD(n) (((n)&0x3) << 10)
  1099. #define PMIC_ANA_RG_VPA_MAXDUTY_SEL (1 << 12)
  1100. #define PMIC_ANA_RG_VPA_FORCE_PWM (1 << 13)
  1101. #define PMIC_ANA_RG_VPA_DVS_ON (1 << 14)
  1102. #define PMIC_ANA_RG_VPA_SAWTOOTHCAL_RST (1 << 15)
  1103. // dcdc_vpa_reg1
  1104. #define PMIC_ANA_DIV_BASE_VPA(n) (((n)&0x3f) << 0)
  1105. #define PMIC_ANA_PHASE_SEL_VPA(n) (((n)&0x3f) << 6)
  1106. #define PMIC_ANA_DIV_CLK_VPA_EN (1 << 12)
  1107. #endif // _PMIC_ANA_H_