xref: /openbmc/u-boot/arch/arm/include/asm/arch-omap5/clock.h (revision 83d290c56fab2d38cd1ab4c4cc7099559c1d5046)
1*83d290c5STom Rini /* SPDX-License-Identifier: GPL-2.0+ */
2af1d002fSLokesh Vutla /*
3af1d002fSLokesh Vutla  * (C) Copyright 2010
4af1d002fSLokesh Vutla  * Texas Instruments, <www.ti.com>
5af1d002fSLokesh Vutla  *
6af1d002fSLokesh Vutla  *	Aneesh V <aneesh@ti.com>
7af1d002fSLokesh Vutla  *	Sricharan R <r.sricharan@ti.com>
8af1d002fSLokesh Vutla  */
9af1d002fSLokesh Vutla #ifndef _CLOCKS_OMAP5_H_
10af1d002fSLokesh Vutla #define _CLOCKS_OMAP5_H_
11af1d002fSLokesh Vutla #include <common.h>
12af1d002fSLokesh Vutla #include <asm/omap_common.h>
13af1d002fSLokesh Vutla 
14af1d002fSLokesh Vutla /*
15af1d002fSLokesh Vutla  * Assuming a maximum of 1.5 GHz ARM speed and a minimum of 2 cycles per
16af1d002fSLokesh Vutla  * loop, allow for a minimum of 2 ms wait (in reality the wait will be
17af1d002fSLokesh Vutla  * much more than that)
18af1d002fSLokesh Vutla  */
19af1d002fSLokesh Vutla #define LDELAY		1000000
20af1d002fSLokesh Vutla 
21af1d002fSLokesh Vutla /* CM_DLL_CTRL */
22af1d002fSLokesh Vutla #define CM_DLL_CTRL_OVERRIDE_SHIFT		0
23af1d002fSLokesh Vutla #define CM_DLL_CTRL_OVERRIDE_MASK		(1 << 0)
24af1d002fSLokesh Vutla #define CM_DLL_CTRL_NO_OVERRIDE			0
25af1d002fSLokesh Vutla 
26af1d002fSLokesh Vutla /* CM_CLKMODE_DPLL */
27af1d002fSLokesh Vutla #define CM_CLKMODE_DPLL_REGM4XEN_SHIFT		11
28af1d002fSLokesh Vutla #define CM_CLKMODE_DPLL_REGM4XEN_MASK		(1 << 11)
29af1d002fSLokesh Vutla #define CM_CLKMODE_DPLL_LPMODE_EN_SHIFT		10
30af1d002fSLokesh Vutla #define CM_CLKMODE_DPLL_LPMODE_EN_MASK		(1 << 10)
31af1d002fSLokesh Vutla #define CM_CLKMODE_DPLL_RELOCK_RAMP_EN_SHIFT	9
32af1d002fSLokesh Vutla #define CM_CLKMODE_DPLL_RELOCK_RAMP_EN_MASK	(1 << 9)
33af1d002fSLokesh Vutla #define CM_CLKMODE_DPLL_DRIFTGUARD_EN_SHIFT	8
34af1d002fSLokesh Vutla #define CM_CLKMODE_DPLL_DRIFTGUARD_EN_MASK	(1 << 8)
35af1d002fSLokesh Vutla #define CM_CLKMODE_DPLL_RAMP_RATE_SHIFT		5
36af1d002fSLokesh Vutla #define CM_CLKMODE_DPLL_RAMP_RATE_MASK		(0x7 << 5)
37af1d002fSLokesh Vutla #define CM_CLKMODE_DPLL_EN_SHIFT		0
38af1d002fSLokesh Vutla #define CM_CLKMODE_DPLL_EN_MASK			(0x7 << 0)
39af1d002fSLokesh Vutla 
40af1d002fSLokesh Vutla #define CM_CLKMODE_DPLL_DPLL_EN_SHIFT		0
41af1d002fSLokesh Vutla #define CM_CLKMODE_DPLL_DPLL_EN_MASK		7
42af1d002fSLokesh Vutla 
43af1d002fSLokesh Vutla #define DPLL_EN_STOP			1
44af1d002fSLokesh Vutla #define DPLL_EN_MN_BYPASS		4
45af1d002fSLokesh Vutla #define DPLL_EN_LOW_POWER_BYPASS	5
46af1d002fSLokesh Vutla #define DPLL_EN_FAST_RELOCK_BYPASS	6
47af1d002fSLokesh Vutla #define DPLL_EN_LOCK			7
48af1d002fSLokesh Vutla 
49af1d002fSLokesh Vutla /* CM_IDLEST_DPLL fields */
50af1d002fSLokesh Vutla #define ST_DPLL_CLK_MASK		1
51af1d002fSLokesh Vutla 
52af1d002fSLokesh Vutla /* SGX */
53af1d002fSLokesh Vutla #define CLKSEL_GPU_HYD_GCLK_MASK		(1 << 25)
54af1d002fSLokesh Vutla #define CLKSEL_GPU_CORE_GCLK_MASK		(1 << 24)
55af1d002fSLokesh Vutla 
56af1d002fSLokesh Vutla /* CM_CLKSEL_DPLL */
57af1d002fSLokesh Vutla #define CM_CLKSEL_DPLL_DPLL_SD_DIV_SHIFT	24
58af1d002fSLokesh Vutla #define CM_CLKSEL_DPLL_DPLL_SD_DIV_MASK		(0xFF << 24)
59af1d002fSLokesh Vutla #define CM_CLKSEL_DPLL_M_SHIFT			8
60af1d002fSLokesh Vutla #define CM_CLKSEL_DPLL_M_MASK			(0x7FF << 8)
61af1d002fSLokesh Vutla #define CM_CLKSEL_DPLL_N_SHIFT			0
62af1d002fSLokesh Vutla #define CM_CLKSEL_DPLL_N_MASK			0x7F
63af1d002fSLokesh Vutla #define CM_CLKSEL_DCC_EN_SHIFT			22
64af1d002fSLokesh Vutla #define CM_CLKSEL_DCC_EN_MASK			(1 << 22)
65af1d002fSLokesh Vutla 
66af1d002fSLokesh Vutla /* CM_SYS_CLKSEL */
67af1d002fSLokesh Vutla #define CM_SYS_CLKSEL_SYS_CLKSEL_MASK  7
68af1d002fSLokesh Vutla 
69af1d002fSLokesh Vutla /* CM_CLKSEL_CORE */
70af1d002fSLokesh Vutla #define CLKSEL_CORE_SHIFT	0
71af1d002fSLokesh Vutla #define CLKSEL_L3_SHIFT		4
72af1d002fSLokesh Vutla #define CLKSEL_L4_SHIFT		8
73af1d002fSLokesh Vutla 
74af1d002fSLokesh Vutla #define CLKSEL_CORE_X2_DIV_1	0
75af1d002fSLokesh Vutla #define CLKSEL_L3_CORE_DIV_2	1
76af1d002fSLokesh Vutla #define CLKSEL_L4_L3_DIV_2	1
77af1d002fSLokesh Vutla 
78af1d002fSLokesh Vutla /* CM_ABE_PLL_REF_CLKSEL */
79af1d002fSLokesh Vutla #define CM_ABE_PLL_REF_CLKSEL_CLKSEL_SHIFT	0
80af1d002fSLokesh Vutla #define CM_ABE_PLL_REF_CLKSEL_CLKSEL_MASK	1
81af1d002fSLokesh Vutla #define CM_ABE_PLL_REF_CLKSEL_CLKSEL_SYSCLK	0
82af1d002fSLokesh Vutla #define CM_ABE_PLL_REF_CLKSEL_CLKSEL_32KCLK	1
8397405d84SLokesh Vutla 
8497405d84SLokesh Vutla /* CM_CLKSEL_ABE_PLL_SYS */
8597405d84SLokesh Vutla #define CM_CLKSEL_ABE_PLL_SYS_CLKSEL_SHIFT	0
8697405d84SLokesh Vutla #define CM_CLKSEL_ABE_PLL_SYS_CLKSEL_MASK	1
8797405d84SLokesh Vutla #define CM_ABE_PLL_SYS_CLKSEL_SYSCLK1		0
8897405d84SLokesh Vutla #define CM_ABE_PLL_SYS_CLKSEL_SYSCLK2		1
89af1d002fSLokesh Vutla 
90af1d002fSLokesh Vutla /* CM_BYPCLK_DPLL_IVA */
91af1d002fSLokesh Vutla #define CM_BYPCLK_DPLL_IVA_CLKSEL_SHIFT		0
92af1d002fSLokesh Vutla #define CM_BYPCLK_DPLL_IVA_CLKSEL_MASK		3
93af1d002fSLokesh Vutla 
94af1d002fSLokesh Vutla #define DPLL_IVA_CLKSEL_CORE_X2_DIV_2		1
95af1d002fSLokesh Vutla 
96af1d002fSLokesh Vutla /* CM_SHADOW_FREQ_CONFIG1 */
97af1d002fSLokesh Vutla #define SHADOW_FREQ_CONFIG1_FREQ_UPDATE_MASK	1
98af1d002fSLokesh Vutla #define SHADOW_FREQ_CONFIG1_DLL_OVERRIDE_MASK	4
99af1d002fSLokesh Vutla #define SHADOW_FREQ_CONFIG1_DLL_RESET_MASK	8
100af1d002fSLokesh Vutla 
101af1d002fSLokesh Vutla #define SHADOW_FREQ_CONFIG1_DPLL_EN_SHIFT	8
102af1d002fSLokesh Vutla #define SHADOW_FREQ_CONFIG1_DPLL_EN_MASK	(7 << 8)
103af1d002fSLokesh Vutla 
104af1d002fSLokesh Vutla #define SHADOW_FREQ_CONFIG1_M2_DIV_SHIFT	11
105af1d002fSLokesh Vutla #define SHADOW_FREQ_CONFIG1_M2_DIV_MASK		(0x1F << 11)
106af1d002fSLokesh Vutla 
107af1d002fSLokesh Vutla /*CM_<clock_domain>__CLKCTRL */
108af1d002fSLokesh Vutla #define CD_CLKCTRL_CLKTRCTRL_SHIFT		0
109af1d002fSLokesh Vutla #define CD_CLKCTRL_CLKTRCTRL_MASK		3
110af1d002fSLokesh Vutla 
111af1d002fSLokesh Vutla #define CD_CLKCTRL_CLKTRCTRL_NO_SLEEP		0
112af1d002fSLokesh Vutla #define CD_CLKCTRL_CLKTRCTRL_SW_SLEEP		1
113af1d002fSLokesh Vutla #define CD_CLKCTRL_CLKTRCTRL_SW_WKUP		2
114af1d002fSLokesh Vutla #define CD_CLKCTRL_CLKTRCTRL_HW_AUTO		3
115af1d002fSLokesh Vutla 
116af1d002fSLokesh Vutla 
117af1d002fSLokesh Vutla /* CM_<clock_domain>_<module>_CLKCTRL */
118af1d002fSLokesh Vutla #define MODULE_CLKCTRL_MODULEMODE_SHIFT		0
119af1d002fSLokesh Vutla #define MODULE_CLKCTRL_MODULEMODE_MASK		3
120af1d002fSLokesh Vutla #define MODULE_CLKCTRL_IDLEST_SHIFT		16
121af1d002fSLokesh Vutla #define MODULE_CLKCTRL_IDLEST_MASK		(3 << 16)
122af1d002fSLokesh Vutla 
123af1d002fSLokesh Vutla #define MODULE_CLKCTRL_MODULEMODE_SW_DISABLE		0
124af1d002fSLokesh Vutla #define MODULE_CLKCTRL_MODULEMODE_HW_AUTO		1
125af1d002fSLokesh Vutla #define MODULE_CLKCTRL_MODULEMODE_SW_EXPLICIT_EN	2
126af1d002fSLokesh Vutla 
127af1d002fSLokesh Vutla #define MODULE_CLKCTRL_IDLEST_FULLY_FUNCTIONAL	0
128af1d002fSLokesh Vutla #define MODULE_CLKCTRL_IDLEST_TRANSITIONING	1
129af1d002fSLokesh Vutla #define MODULE_CLKCTRL_IDLEST_IDLE		2
130af1d002fSLokesh Vutla #define MODULE_CLKCTRL_IDLEST_DISABLED		3
131af1d002fSLokesh Vutla 
132af1d002fSLokesh Vutla /* CM_L4PER_GPIO4_CLKCTRL */
133af1d002fSLokesh Vutla #define GPIO4_CLKCTRL_OPTFCLKEN_MASK		(1 << 8)
134af1d002fSLokesh Vutla 
135af1d002fSLokesh Vutla /* CM_L3INIT_HSMMCn_CLKCTRL */
136af1d002fSLokesh Vutla #define HSMMC_CLKCTRL_CLKSEL_MASK		(1 << 24)
1372022270cSKishon Vijay Abraham I #define HSMMC_CLKCTRL_CLKSEL_DIV_MASK		(3 << 25)
138af1d002fSLokesh Vutla 
1398ffcf74bSRoger Quadros /* CM_L3INIT_SATA_CLKCTRL */
1408ffcf74bSRoger Quadros #define SATA_CLKCTRL_OPTFCLKEN_MASK		(1 << 8)
1418ffcf74bSRoger Quadros 
142af1d002fSLokesh Vutla /* CM_WKUP_GPTIMER1_CLKCTRL */
143af1d002fSLokesh Vutla #define GPTIMER1_CLKCTRL_CLKSEL_MASK		(1 << 24)
144af1d002fSLokesh Vutla 
145af1d002fSLokesh Vutla /* CM_CAM_ISS_CLKCTRL */
146af1d002fSLokesh Vutla #define ISS_CLKCTRL_OPTFCLKEN_MASK		(1 << 8)
147af1d002fSLokesh Vutla 
148af1d002fSLokesh Vutla /* CM_DSS_DSS_CLKCTRL */
149af1d002fSLokesh Vutla #define DSS_CLKCTRL_OPTFCLKEN_MASK		0xF00
150af1d002fSLokesh Vutla 
151af1d002fSLokesh Vutla /* CM_L3INIT_USBPHY_CLKCTRL */
152af1d002fSLokesh Vutla #define USBPHY_CLKCTRL_OPTFCLKEN_PHY_48M_MASK	8
153af1d002fSLokesh Vutla 
154d3d037aeSDan Murphy /* CM_L3INIT_USB_HOST_HS_CLKCTRL */
155d3d037aeSDan Murphy #define OPTFCLKEN_FUNC48M_CLK			(1 << 15)
156d3d037aeSDan Murphy #define OPTFCLKEN_HSIC480M_P2_CLK		(1 << 14)
157d3d037aeSDan Murphy #define OPTFCLKEN_HSIC480M_P1_CLK		(1 << 13)
158d3d037aeSDan Murphy #define OPTFCLKEN_HSIC60M_P2_CLK		(1 << 12)
159d3d037aeSDan Murphy #define OPTFCLKEN_HSIC60M_P1_CLK		(1 << 11)
160d3d037aeSDan Murphy #define OPTFCLKEN_UTMI_P3_CLK			(1 << 10)
161d3d037aeSDan Murphy #define OPTFCLKEN_UTMI_P2_CLK			(1 << 9)
162d3d037aeSDan Murphy #define OPTFCLKEN_UTMI_P1_CLK			(1 << 8)
163d3d037aeSDan Murphy #define OPTFCLKEN_HSIC480M_P3_CLK		(1 << 7)
164d3d037aeSDan Murphy #define OPTFCLKEN_HSIC60M_P3_CLK		(1 << 6)
165d3d037aeSDan Murphy 
166d3d037aeSDan Murphy /* CM_L3INIT_USB_TLL_HS_CLKCTRL */
167d3d037aeSDan Murphy #define OPTFCLKEN_USB_CH0_CLK_ENABLE	(1 << 8)
168d3d037aeSDan Murphy #define OPTFCLKEN_USB_CH1_CLK_ENABLE	(1 << 9)
169d3d037aeSDan Murphy #define OPTFCLKEN_USB_CH2_CLK_ENABLE	(1 << 10)
170d3d037aeSDan Murphy 
171d861a333SDan Murphy /* CM_COREAON_USB_PHY_CORE_CLKCTRL */
172d861a333SDan Murphy #define USBPHY_CORE_CLKCTRL_OPTFCLKEN_CLK32K	(1 << 8)
173d861a333SDan Murphy 
1747beaf8b6SKishon Vijay Abraham I /* CM_COREAON_L3INIT_60M_GFCLK_CLKCTRL */
1757beaf8b6SKishon Vijay Abraham I #define L3INIT_CLKCTRL_OPTFCLKEN_60M_GFCLK	(1 << 8)
1767beaf8b6SKishon Vijay Abraham I 
177d861a333SDan Murphy /* CM_L3INIT_USB_OTG_SS_CLKCTRL */
178d861a333SDan Murphy #define OTG_SS_CLKCTRL_MODULEMODE_HW	(1 << 0)
179d861a333SDan Murphy #define OPTFCLKEN_REFCLK960M			(1 << 8)
180d861a333SDan Murphy 
181d861a333SDan Murphy /* CM_L3INIT_OCP2SCP1_CLKCTRL */
182d861a333SDan Murphy #define OCP2SCP1_CLKCTRL_MODULEMODE_HW	(1 << 0)
183d861a333SDan Murphy 
184af1d002fSLokesh Vutla /* CM_MPU_MPU_CLKCTRL */
185af1d002fSLokesh Vutla #define MPU_CLKCTRL_CLKSEL_EMIF_DIV_MODE_SHIFT	24
186af1d002fSLokesh Vutla #define MPU_CLKCTRL_CLKSEL_EMIF_DIV_MODE_MASK	(3 << 24)
187af1d002fSLokesh Vutla #define MPU_CLKCTRL_CLKSEL_ABE_DIV_MODE_SHIFT	26
188af1d002fSLokesh Vutla #define MPU_CLKCTRL_CLKSEL_ABE_DIV_MODE_MASK	(1 << 26)
189af1d002fSLokesh Vutla 
190af1d002fSLokesh Vutla /* CM_WKUPAON_SCRM_CLKCTRL */
191af1d002fSLokesh Vutla #define OPTFCLKEN_SCRM_PER_SHIFT		9
192af1d002fSLokesh Vutla #define OPTFCLKEN_SCRM_PER_MASK			(1 << 9)
193af1d002fSLokesh Vutla #define OPTFCLKEN_SCRM_CORE_SHIFT		8
194af1d002fSLokesh Vutla #define OPTFCLKEN_SCRM_CORE_MASK		(1 << 8)
195af1d002fSLokesh Vutla 
196af1d002fSLokesh Vutla /* CM_COREAON_IO_SRCOMP_CLKCTRL */
197af1d002fSLokesh Vutla #define OPTFCLKEN_SRCOMP_FCLK_SHIFT		8
198af1d002fSLokesh Vutla #define OPTFCLKEN_SRCOMP_FCLK_MASK		(1 << 8)
199af1d002fSLokesh Vutla 
200af1d002fSLokesh Vutla /* PRM_RSTTIME */
201af1d002fSLokesh Vutla #define RSTTIME1_SHIFT				0
202af1d002fSLokesh Vutla #define RSTTIME1_MASK				(0x3ff << 0)
203af1d002fSLokesh Vutla 
204af1d002fSLokesh Vutla /* Clock frequencies */
205af1d002fSLokesh Vutla #define OMAP_SYS_CLK_IND_38_4_MHZ	6
206af1d002fSLokesh Vutla 
207af1d002fSLokesh Vutla /* PRM_VC_VAL_BYPASS */
208af1d002fSLokesh Vutla #define PRM_VC_I2C_CHANNEL_FREQ_KHZ	400
209af1d002fSLokesh Vutla 
210834e91afSDan Murphy /* CTRL_CORE_SRCOMP_NORTH_SIDE */
211834e91afSDan Murphy #define USB2PHY_DISCHGDET	(1 << 29)
212834e91afSDan Murphy #define USB2PHY_AUTORESUME_EN (1 << 30)
213834e91afSDan Murphy 
214af1d002fSLokesh Vutla /* SMPS */
215af1d002fSLokesh Vutla #define SMPS_I2C_SLAVE_ADDR	0x12
216af1d002fSLokesh Vutla #define SMPS_REG_ADDR_12_MPU	0x23
217af1d002fSLokesh Vutla #define SMPS_REG_ADDR_45_IVA	0x2B
218af1d002fSLokesh Vutla #define SMPS_REG_ADDR_8_CORE	0x37
219af1d002fSLokesh Vutla 
220af1d002fSLokesh Vutla /* PALMAS VOLTAGE SETTINGS in mv for OPP_NOMINAL */
221af1d002fSLokesh Vutla /* ES1.0 settings */
222af1d002fSLokesh Vutla #define VDD_MPU		1040
223af1d002fSLokesh Vutla #define VDD_MM		1040
224af1d002fSLokesh Vutla #define VDD_CORE	1040
225af1d002fSLokesh Vutla 
226af1d002fSLokesh Vutla #define VDD_MPU_LOW	890
227af1d002fSLokesh Vutla #define VDD_MM_LOW	890
228af1d002fSLokesh Vutla #define VDD_CORE_LOW	890
229af1d002fSLokesh Vutla 
230af1d002fSLokesh Vutla /* ES2.0 settings */
231af1d002fSLokesh Vutla #define VDD_MPU_ES2	1060
232af1d002fSLokesh Vutla #define VDD_MM_ES2	1025
233af1d002fSLokesh Vutla #define VDD_CORE_ES2	1040
234af1d002fSLokesh Vutla 
235af1d002fSLokesh Vutla #define VDD_MPU_ES2_HIGH 1250
236af1d002fSLokesh Vutla #define VDD_MM_ES2_OD  1120
237af1d002fSLokesh Vutla 
2380459bc30SNishanth Menon /* Efuse register offsets for OMAP5 platform */
2390459bc30SNishanth Menon #define OMAP5_ES2_EFUSE_BASE	0x4A002000
2400459bc30SNishanth Menon #define OMAP5_ES2_PROD_REGBITS	16
2410459bc30SNishanth Menon 
2420459bc30SNishanth Menon /* CONTROL_STD_FUSE_OPP_VDD_CORE_3 */
2430459bc30SNishanth Menon #define OMAP5_ES2_PROD_CORE_OPNO_VMIN	(OMAP5_ES2_EFUSE_BASE + 0x1D8)
2440459bc30SNishanth Menon 
2450459bc30SNishanth Menon /* CONTROL_STD_FUSE_OPP_VDD_MM_4 */
2460459bc30SNishanth Menon #define OMAP5_ES2_PROD_MM_OPNO_VMIN	(OMAP5_ES2_EFUSE_BASE + 0x1A4)
2470459bc30SNishanth Menon /* CONTROL_STD_FUSE_OPP_VDD_MM_5 */
2480459bc30SNishanth Menon #define OMAP5_ES2_PROD_MM_OPOD_VMIN	(OMAP5_ES2_EFUSE_BASE + 0x1A8)
2490459bc30SNishanth Menon /* CONTROL_STD_FUSE_OPP_VDD_MPU_6 */
2500459bc30SNishanth Menon #define OMAP5_ES2_PROD_MPU_OPNO_VMIN	(OMAP5_ES2_EFUSE_BASE + 0x1C4)
2510459bc30SNishanth Menon /* CONTROL_STD_FUSE_OPP_VDD_MPU_7 */
2520459bc30SNishanth Menon #define OMAP5_ES2_PROD_MPU_OPHI_VMIN	(OMAP5_ES2_EFUSE_BASE + 0x1C8)
2530459bc30SNishanth Menon 
254e42523f5SAnna, Suman /* DRA74x/75x/72x voltage settings in mv for OPP_NOM per DM */
25588730f19SAnna, Suman #define VDD_MPU_DRA7_NOM	1150
25688730f19SAnna, Suman #define VDD_CORE_DRA7_NOM	1150
25788730f19SAnna, Suman #define VDD_EVE_DRA7_NOM	1060
25888730f19SAnna, Suman #define VDD_GPU_DRA7_NOM	1060
25988730f19SAnna, Suman #define VDD_IVA_DRA7_NOM	1060
26088730f19SAnna, Suman 
26188730f19SAnna, Suman /* DRA74x/75x/72x voltage settings in mv for OPP_OD per DM */
26288730f19SAnna, Suman #define VDD_EVE_DRA7_OD		1150
26388730f19SAnna, Suman #define VDD_GPU_DRA7_OD		1150
26488730f19SAnna, Suman #define VDD_IVA_DRA7_OD		1150
26588730f19SAnna, Suman 
26688730f19SAnna, Suman /* DRA74x/75x/72x voltage settings in mv for OPP_HIGH per DM */
26788730f19SAnna, Suman #define VDD_EVE_DRA7_HIGH	1250
26888730f19SAnna, Suman #define VDD_GPU_DRA7_HIGH	1250
26988730f19SAnna, Suman #define VDD_IVA_DRA7_HIGH	1250
270b558af81SLubomir Popov 
27118c9d55aSNishanth Menon /* Efuse register offsets for DRA7xx platform */
27218c9d55aSNishanth Menon #define DRA752_EFUSE_BASE	0x4A002000
27318c9d55aSNishanth Menon #define DRA752_EFUSE_REGBITS	16
27418c9d55aSNishanth Menon /* STD_FUSE_OPP_VMIN_IVA_2 */
27518c9d55aSNishanth Menon #define STD_FUSE_OPP_VMIN_IVA_NOM	(DRA752_EFUSE_BASE + 0x05CC)
27618c9d55aSNishanth Menon /* STD_FUSE_OPP_VMIN_IVA_3 */
27718c9d55aSNishanth Menon #define STD_FUSE_OPP_VMIN_IVA_OD	(DRA752_EFUSE_BASE + 0x05D0)
27818c9d55aSNishanth Menon /* STD_FUSE_OPP_VMIN_IVA_4 */
27918c9d55aSNishanth Menon #define STD_FUSE_OPP_VMIN_IVA_HIGH	(DRA752_EFUSE_BASE + 0x05D4)
28018c9d55aSNishanth Menon /* STD_FUSE_OPP_VMIN_DSPEVE_2 */
28118c9d55aSNishanth Menon #define STD_FUSE_OPP_VMIN_DSPEVE_NOM	(DRA752_EFUSE_BASE + 0x05E0)
28218c9d55aSNishanth Menon /* STD_FUSE_OPP_VMIN_DSPEVE_3 */
28318c9d55aSNishanth Menon #define STD_FUSE_OPP_VMIN_DSPEVE_OD	(DRA752_EFUSE_BASE + 0x05E4)
28418c9d55aSNishanth Menon /* STD_FUSE_OPP_VMIN_DSPEVE_4 */
28518c9d55aSNishanth Menon #define STD_FUSE_OPP_VMIN_DSPEVE_HIGH	(DRA752_EFUSE_BASE + 0x05E8)
28618c9d55aSNishanth Menon /* STD_FUSE_OPP_VMIN_CORE_2 */
28718c9d55aSNishanth Menon #define STD_FUSE_OPP_VMIN_CORE_NOM	(DRA752_EFUSE_BASE + 0x05F4)
28818c9d55aSNishanth Menon /* STD_FUSE_OPP_VMIN_GPU_2 */
28918c9d55aSNishanth Menon #define STD_FUSE_OPP_VMIN_GPU_NOM	(DRA752_EFUSE_BASE + 0x1B08)
29018c9d55aSNishanth Menon /* STD_FUSE_OPP_VMIN_GPU_3 */
29118c9d55aSNishanth Menon #define STD_FUSE_OPP_VMIN_GPU_OD	(DRA752_EFUSE_BASE + 0x1B0C)
29218c9d55aSNishanth Menon /* STD_FUSE_OPP_VMIN_GPU_4 */
29318c9d55aSNishanth Menon #define STD_FUSE_OPP_VMIN_GPU_HIGH	(DRA752_EFUSE_BASE + 0x1B10)
29418c9d55aSNishanth Menon /* STD_FUSE_OPP_VMIN_MPU_2 */
29518c9d55aSNishanth Menon #define STD_FUSE_OPP_VMIN_MPU_NOM	(DRA752_EFUSE_BASE + 0x1B20)
29618c9d55aSNishanth Menon /* STD_FUSE_OPP_VMIN_MPU_3 */
29718c9d55aSNishanth Menon #define STD_FUSE_OPP_VMIN_MPU_OD	(DRA752_EFUSE_BASE + 0x1B24)
29818c9d55aSNishanth Menon /* STD_FUSE_OPP_VMIN_MPU_4 */
29918c9d55aSNishanth Menon #define STD_FUSE_OPP_VMIN_MPU_HIGH	(DRA752_EFUSE_BASE + 0x1B28)
30018c9d55aSNishanth Menon 
301fba82eb7SSuman Anna #if defined(CONFIG_DRA7_MPU_OPP_HIGH)
302fba82eb7SSuman Anna #define DRA7_MPU_OPP	OPP_HIGH
303fba82eb7SSuman Anna #elif defined(CONFIG_DRA7_MPU_OPP_OD)
304fba82eb7SSuman Anna #define DRA7_MPU_OPP	OPP_OD
305fba82eb7SSuman Anna #else /* OPP_NOM default */
306fba82eb7SSuman Anna #define DRA7_MPU_OPP	OPP_NOM
307fba82eb7SSuman Anna #endif
30888730f19SAnna, Suman 
309fba82eb7SSuman Anna /* OPP_NOM only available option for CORE */
310fba82eb7SSuman Anna #define DRA7_CORE_OPP	OPP_NOM
311fba82eb7SSuman Anna 
312fba82eb7SSuman Anna #if defined(CONFIG_DRA7_DSPEVE_OPP_HIGH)
313fba82eb7SSuman Anna #define DRA7_DSPEVE_OPP	OPP_HIGH
314fba82eb7SSuman Anna #elif defined(CONFIG_DRA7_DSPEVE_OPP_OD)
315fba82eb7SSuman Anna #define DRA7_DSPEVE_OPP	OPP_OD
316fba82eb7SSuman Anna #else /* OPP_NOM default */
317fba82eb7SSuman Anna #define DRA7_DSPEVE_OPP	OPP_NOM
318fba82eb7SSuman Anna #endif
319fba82eb7SSuman Anna 
320fba82eb7SSuman Anna #if defined(CONFIG_DRA7_IVA_OPP_HIGH)
321fba82eb7SSuman Anna #define DRA7_IVA_OPP	OPP_HIGH
322fba82eb7SSuman Anna #elif defined(CONFIG_DRA7_IVA_OPP_OD)
323fba82eb7SSuman Anna #define DRA7_IVA_OPP	OPP_OD
324fba82eb7SSuman Anna #else /* OPP_NOM default */
325fba82eb7SSuman Anna #define DRA7_IVA_OPP	OPP_NOM
326fba82eb7SSuman Anna #endif
327fba82eb7SSuman Anna 
328fba82eb7SSuman Anna #if defined(CONFIG_DRA7_GPU_OPP_HIGH)
329fba82eb7SSuman Anna #define DRA7_GPU_OPP	OPP_HIGH
330fba82eb7SSuman Anna #elif defined(CONFIG_DRA7_GPU_OPP_OD)
331fba82eb7SSuman Anna #define DRA7_GPU_OPP	OPP_OD
332fba82eb7SSuman Anna #else /* OPP_NOM default */
333fba82eb7SSuman Anna #define DRA7_GPU_OPP	OPP_NOM
334fba82eb7SSuman Anna #endif
33527c9596fSAnna, Suman 
336af1d002fSLokesh Vutla /* Standard offset is 0.5v expressed in uv */
337af1d002fSLokesh Vutla #define PALMAS_SMPS_BASE_VOLT_UV 500000
338af1d002fSLokesh Vutla 
339f56e6350SKeerthy /* Offset is 0.73V for LP873x */
340f56e6350SKeerthy #define LP873X_BUCK_BASE_VOLT_UV		730000
341f56e6350SKeerthy 
342c2476055SKeerthy /* Offset is 0.73V for LP87565 */
343c2476055SKeerthy #define LP87565_BUCK_BASE_VOLT_UV		730000
344c2476055SKeerthy 
34563fc0c77SLokesh Vutla /* TPS659038 */
34663fc0c77SLokesh Vutla #define TPS659038_I2C_SLAVE_ADDR		0x58
347c27cd33bSFelipe Balbi #define TPS659038_REG_ADDR_SMPS12		0x23
348c27cd33bSFelipe Balbi #define TPS659038_REG_ADDR_SMPS45		0x2B
349c27cd33bSFelipe Balbi #define TPS659038_REG_ADDR_SMPS6		0x2F
350c27cd33bSFelipe Balbi #define TPS659038_REG_ADDR_SMPS7		0x33
351c27cd33bSFelipe Balbi #define TPS659038_REG_ADDR_SMPS8		0x37
35263fc0c77SLokesh Vutla 
353b558af81SLubomir Popov /* TPS65917 */
354b558af81SLubomir Popov #define TPS65917_I2C_SLAVE_ADDR		0x58
355b558af81SLubomir Popov #define TPS65917_REG_ADDR_SMPS1		0x23
356b558af81SLubomir Popov #define TPS65917_REG_ADDR_SMPS2		0x27
357b558af81SLubomir Popov #define TPS65917_REG_ADDR_SMPS3		0x2F
358c2476055SKeerthy #define TPS65917_REG_ADDR_SMPS4		0x33
359b558af81SLubomir Popov 
360f56e6350SKeerthy /* LP873X */
361f56e6350SKeerthy #define LP873X_I2C_SLAVE_ADDR		0x60
362f56e6350SKeerthy #define LP873X_REG_ADDR_BUCK0		0x6
363f56e6350SKeerthy #define LP873X_REG_ADDR_BUCK1		0x7
364f56e6350SKeerthy #define LP873X_REG_ADDR_LDO1		0xA
365b558af81SLubomir Popov 
366c2476055SKeerthy /* LP87565 */
367c2476055SKeerthy #define LP87565_I2C_SLAVE_ADDR		0x61
368c2476055SKeerthy #define LP87565_REG_ADDR_BUCK01		0xA
369c2476055SKeerthy #define LP87565_REG_ADDR_BUCK23		0xE
370c2476055SKeerthy 
371af1d002fSLokesh Vutla /* TPS */
372af1d002fSLokesh Vutla #define TPS62361_I2C_SLAVE_ADDR		0x60
373af1d002fSLokesh Vutla #define TPS62361_REG_ADDR_SET0		0x0
374af1d002fSLokesh Vutla #define TPS62361_REG_ADDR_SET1		0x1
375af1d002fSLokesh Vutla #define TPS62361_REG_ADDR_SET2		0x2
376af1d002fSLokesh Vutla #define TPS62361_REG_ADDR_SET3		0x3
377af1d002fSLokesh Vutla #define TPS62361_REG_ADDR_CTRL		0x4
378af1d002fSLokesh Vutla #define TPS62361_REG_ADDR_TEMP		0x5
379af1d002fSLokesh Vutla #define TPS62361_REG_ADDR_RMP_CTRL	0x6
380af1d002fSLokesh Vutla #define TPS62361_REG_ADDR_CHIP_ID	0x8
381af1d002fSLokesh Vutla #define TPS62361_REG_ADDR_CHIP_ID_2	0x9
382af1d002fSLokesh Vutla 
383af1d002fSLokesh Vutla #define TPS62361_BASE_VOLT_MV	500
384af1d002fSLokesh Vutla #define TPS62361_VSEL0_GPIO	7
385af1d002fSLokesh Vutla 
386ee28edacSLubomir Popov /* Defines for DPLL setup */
387ee28edacSLubomir Popov #define DPLL_LOCKED_FREQ_TOLERANCE_0		0
388ee28edacSLubomir Popov #define DPLL_LOCKED_FREQ_TOLERANCE_500_KHZ	500
389ee28edacSLubomir Popov #define DPLL_LOCKED_FREQ_TOLERANCE_1_MHZ	1000
390ee28edacSLubomir Popov 
391af1d002fSLokesh Vutla #define DPLL_NO_LOCK	0
392af1d002fSLokesh Vutla #define DPLL_LOCK	1
393af1d002fSLokesh Vutla 
3943891a54fSNishanth Menon #if defined(CONFIG_DRA7XX)
395f9b814a8SSricharan R #define V_OSCK			20000000	/* Clock output from T2 */
396f9b814a8SSricharan R #else
397f9b814a8SSricharan R #define V_OSCK			19200000	/* Clock output from T2 */
398f9b814a8SSricharan R #endif
399f9b814a8SSricharan R 
400f9b814a8SSricharan R #define V_SCLK	V_OSCK
401ee28edacSLubomir Popov 
402d57b649eSDmitry Lifshitz /* CKO buffer control */
403d57b649eSDmitry Lifshitz #define CKOBUFFER_CLK_ENABLE_MASK	(1 << 28)
404d57b649eSDmitry Lifshitz 
405ee28edacSLubomir Popov /* AUXCLKx reg fields */
406ee28edacSLubomir Popov #define AUXCLK_ENABLE_MASK		(1 << 8)
407ee28edacSLubomir Popov #define AUXCLK_SRCSELECT_SHIFT		1
408ee28edacSLubomir Popov #define AUXCLK_SRCSELECT_MASK		(3 << 1)
409ee28edacSLubomir Popov #define AUXCLK_CLKDIV_SHIFT		16
410ee28edacSLubomir Popov #define AUXCLK_CLKDIV_MASK		(0xF << 16)
411ee28edacSLubomir Popov 
412ee28edacSLubomir Popov #define AUXCLK_SRCSELECT_SYS_CLK	0
413ee28edacSLubomir Popov #define AUXCLK_SRCSELECT_CORE_DPLL	1
414ee28edacSLubomir Popov #define AUXCLK_SRCSELECT_PER_DPLL	2
415ee28edacSLubomir Popov #define AUXCLK_SRCSELECT_ALTERNATE	3
416ee28edacSLubomir Popov 
417af1d002fSLokesh Vutla #endif /* _CLOCKS_OMAP5_H_ */
418