xref: /openbmc/u-boot/include/power/hi6553_pmic.h (revision ad3098f7)
1 /*
2  * (C) Copyright 2015 Linaro
3  * Peter Griffin <peter.griffin@linaro.org>
4  *
5  * SPDX-License-Identifier:	GPL-2.0+
6  */
7 
8 #ifndef __HI6553_PMIC_H__
9 #define __HI6553_PMIC_H__
10 
11 /* Registers */
12 enum {
13 	HI6553_VERSION_REG = 0x000,
14 	HI6553_ENABLE2_LDO1_8 = 0x029,
15 	HI6553_DISABLE2_LDO1_8,
16 	HI6553_ONOFF_STATUS2_LDO1_8,
17 	HI6553_ENABLE3_LDO9_16,
18 	HI6553_DISABLE3_LDO9_16,
19 	HI6553_ONOFF_STATUS3_LDO9_16,
20 
21 	HI6553_DISABLE6_XO_CLK = 0x036,
22 	HI6553_PERI_EN_MARK = 0x040,
23 	HI6553_BUCK2_REG1 = 0x04a,
24 	HI6553_BUCK2_REG5 = 0x04e,
25 	HI6553_BUCK2_REG6,
26 
27 	HI6553_BUCK3_REG3 = 0x054,
28 	HI6553_BUCK3_REG5 = 0x056,
29 	HI6553_BUCK3_REG6,
30 	HI6553_BUCK4_REG2 = 0x05b,
31 	HI6553_BUCK4_REG5 = 0x05e,
32 	HI6553_BUCK4_REG6,
33 
34 	HI6553_CLK_TOP0 = 0x063,
35 	HI6553_CLK_TOP3 = 0x066,
36 	HI6553_CLK_TOP4,
37 	HI6553_VSET_BUCK2_ADJ = 0x06d,
38 	HI6553_VSET_BUCK3_ADJ,
39 	HI6553_LDO7_REG_ADJ = 0x078,
40 	HI6553_LDO10_REG_ADJ = 0x07b,
41 	HI6553_LDO19_REG_ADJ = 0x084,
42 	HI6553_LDO20_REG_ADJ,
43 	HI6553_DR_LED_CTRL = 0x098,
44 	HI6553_DR_OUT_CTRL,
45 	HI6553_DR3_ISET,
46 	HI6553_DR3_START_DEL,
47 	HI6553_DR4_ISET,
48 	HI6553_DR4_START_DEL,
49 	HI6553_DR345_TIM_CONF0 = 0x0a0,
50 	HI6553_NP_REG_ADJ1 = 0x0be,
51 	HI6553_NP_REG_CHG = 0x0c0,
52 	HI6553_BUCK01_CTRL2 = 0x0d9,
53 	HI6553_BUCK0_CTRL1 = 0x0dd,
54 	HI6553_BUCK0_CTRL5 = 0x0e1,
55 	HI6553_BUCK0_CTRL7 = 0x0e3,
56 	HI6553_BUCK1_CTRL1 = 0x0e8,
57 	HI6553_BUCK1_CTRL5 = 0x0ec,
58 	HI6553_BUCK1_CTRL7 = 0x0ef,
59 	HI6553_CLK19M2_600_586_EN = 0x0fe,
60 };
61 
62 #define HI6553_DISABLE6_XO_CLK_BB		(1 << 0)
63 #define HI6553_DISABLE6_XO_CLK_CONN		(1 << 1)
64 #define HI6553_DISABLE6_XO_CLK_NFC		(1 << 2)
65 #define HI6553_DISABLE6_XO_CLK_RF1		(1 << 3)
66 #define HI6553_DISABLE6_XO_CLK_RF2		(1 << 4)
67 
68 #define HI6553_LED_START_DELAY_TIME		0x00
69 #define HI6553_LED_ELEC_VALUE			0x07
70 #define HI6553_LED_LIGHT_TIME			0xf0
71 #define HI6553_LED_GREEN_ENABLE			(1 << 1)
72 #define HI6553_LED_OUT_CTRL			0x00
73 
74 #define HI6553_PMU_V300				0x30
75 #define HI6553_PMU_V310				0x31
76 
77 int power_hi6553_init(u8 *base);
78 
79 #endif	/* __HI6553_PMIC_H__ */
80