diff options
author | Jim Lin <jilin@nvidia.com> | 2014-05-14 20:32:57 -0400 |
---|---|---|
committer | Mike Turquette <mturquette@linaro.org> | 2014-05-23 01:14:51 -0400 |
commit | 2cfe16748bec853cb6b83d19546dfd226898b222 (patch) | |
tree | b9fccdbca9baeafb46a3bbe2a24c7366156d46f9 /drivers/clk/tegra/clk-pll.c | |
parent | c675a00c2d666c8e90da335eafbbae81201d53f7 (diff) |
clk: tegra: Enable hardware control of PLLE
Enable hardware control of PLLE spread-spectrum, IDDQ, and enable
controls when enabling PLLE. The hardware (e.g. XUSB) using PLLE
will use these controls for power-saving optimizations.
Signed-off-by: Jim Lin <jilin@nvidia.com>
Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
Diffstat (limited to 'drivers/clk/tegra/clk-pll.c')
-rw-r--r-- | drivers/clk/tegra/clk-pll.c | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/drivers/clk/tegra/clk-pll.c b/drivers/clk/tegra/clk-pll.c index e1769addf435..39e0959b61bd 100644 --- a/drivers/clk/tegra/clk-pll.c +++ b/drivers/clk/tegra/clk-pll.c | |||
@@ -96,10 +96,20 @@ | |||
96 | (PLLE_SS_MAX_VAL | PLLE_SS_INC_VAL | PLLE_SS_INCINTRV_VAL) | 96 | (PLLE_SS_MAX_VAL | PLLE_SS_INC_VAL | PLLE_SS_INCINTRV_VAL) |
97 | 97 | ||
98 | #define PLLE_AUX_PLLP_SEL BIT(2) | 98 | #define PLLE_AUX_PLLP_SEL BIT(2) |
99 | #define PLLE_AUX_USE_LOCKDET BIT(3) | ||
99 | #define PLLE_AUX_ENABLE_SWCTL BIT(4) | 100 | #define PLLE_AUX_ENABLE_SWCTL BIT(4) |
101 | #define PLLE_AUX_SS_SWCTL BIT(6) | ||
100 | #define PLLE_AUX_SEQ_ENABLE BIT(24) | 102 | #define PLLE_AUX_SEQ_ENABLE BIT(24) |
103 | #define PLLE_AUX_SEQ_START_STATE BIT(25) | ||
101 | #define PLLE_AUX_PLLRE_SEL BIT(28) | 104 | #define PLLE_AUX_PLLRE_SEL BIT(28) |
102 | 105 | ||
106 | #define XUSBIO_PLL_CFG0 0x51c | ||
107 | #define XUSBIO_PLL_CFG0_PADPLL_RESET_SWCTL BIT(0) | ||
108 | #define XUSBIO_PLL_CFG0_CLK_ENABLE_SWCTL BIT(2) | ||
109 | #define XUSBIO_PLL_CFG0_PADPLL_USE_LOCKDET BIT(6) | ||
110 | #define XUSBIO_PLL_CFG0_SEQ_ENABLE BIT(24) | ||
111 | #define XUSBIO_PLL_CFG0_SEQ_START_STATE BIT(25) | ||
112 | |||
103 | #define PLLE_MISC_PLLE_PTS BIT(8) | 113 | #define PLLE_MISC_PLLE_PTS BIT(8) |
104 | #define PLLE_MISC_IDDQ_SW_VALUE BIT(13) | 114 | #define PLLE_MISC_IDDQ_SW_VALUE BIT(13) |
105 | #define PLLE_MISC_IDDQ_SW_CTRL BIT(14) | 115 | #define PLLE_MISC_IDDQ_SW_CTRL BIT(14) |
@@ -1318,7 +1328,28 @@ static int clk_plle_tegra114_enable(struct clk_hw *hw) | |||
1318 | pll_writel(val, PLLE_SS_CTRL, pll); | 1328 | pll_writel(val, PLLE_SS_CTRL, pll); |
1319 | udelay(1); | 1329 | udelay(1); |
1320 | 1330 | ||
1321 | /* TODO: enable hw control of xusb brick pll */ | 1331 | /* Enable hw control of xusb brick pll */ |
1332 | val = pll_readl_misc(pll); | ||
1333 | val &= ~PLLE_MISC_IDDQ_SW_CTRL; | ||
1334 | pll_writel_misc(val, pll); | ||
1335 | |||
1336 | val = pll_readl(pll->params->aux_reg, pll); | ||
1337 | val |= (PLLE_AUX_USE_LOCKDET | PLLE_AUX_SEQ_START_STATE); | ||
1338 | val &= ~(PLLE_AUX_ENABLE_SWCTL | PLLE_AUX_SS_SWCTL); | ||
1339 | pll_writel(val, pll->params->aux_reg, pll); | ||
1340 | udelay(1); | ||
1341 | val |= PLLE_AUX_SEQ_ENABLE; | ||
1342 | pll_writel(val, pll->params->aux_reg, pll); | ||
1343 | |||
1344 | val = pll_readl(XUSBIO_PLL_CFG0, pll); | ||
1345 | val |= (XUSBIO_PLL_CFG0_PADPLL_USE_LOCKDET | | ||
1346 | XUSBIO_PLL_CFG0_SEQ_START_STATE); | ||
1347 | val &= ~(XUSBIO_PLL_CFG0_CLK_ENABLE_SWCTL | | ||
1348 | XUSBIO_PLL_CFG0_PADPLL_RESET_SWCTL); | ||
1349 | pll_writel(val, XUSBIO_PLL_CFG0, pll); | ||
1350 | udelay(1); | ||
1351 | val |= XUSBIO_PLL_CFG0_SEQ_ENABLE; | ||
1352 | pll_writel(val, XUSBIO_PLL_CFG0, pll); | ||
1322 | 1353 | ||
1323 | out: | 1354 | out: |
1324 | if (pll->lock) | 1355 | if (pll->lock) |