diff options
author | Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> | 2019-01-14 22:33:35 -0500 |
---|---|---|
committer | Stephen Boyd <sboyd@kernel.org> | 2019-02-22 02:58:12 -0500 |
commit | 9831289f6f629b6aac4bd4491bc54dcebdc0b6ba (patch) | |
tree | 6a45bdba02d3b046f4916b1e4f117d883a23a9ff /drivers | |
parent | bfeffd155283772bbe78c6a05dec7c0128ee500c (diff) |
clk: actions: Add configurable PLL delay
S500 SoC requires configurable delay for different PLLs. Hence, add
a separate macro for declaring a PLL with configurable delay and also
modify the existing OWL_PLL_NO_PARENT macro to use default delay so
that no need to modify the existing S700/S900 drivers.
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/clk/actions/owl-pll.c | 2 | ||||
-rw-r--r-- | drivers/clk/actions/owl-pll.h | 30 |
2 files changed, 25 insertions, 7 deletions
diff --git a/drivers/clk/actions/owl-pll.c b/drivers/clk/actions/owl-pll.c index 058e06d7099f..02437bdedf4d 100644 --- a/drivers/clk/actions/owl-pll.c +++ b/drivers/clk/actions/owl-pll.c | |||
@@ -179,7 +179,7 @@ static int owl_pll_set_rate(struct clk_hw *hw, unsigned long rate, | |||
179 | 179 | ||
180 | regmap_write(common->regmap, pll_hw->reg, reg); | 180 | regmap_write(common->regmap, pll_hw->reg, reg); |
181 | 181 | ||
182 | udelay(PLL_STABILITY_WAIT_US); | 182 | udelay(pll_hw->delay); |
183 | 183 | ||
184 | return 0; | 184 | return 0; |
185 | } | 185 | } |
diff --git a/drivers/clk/actions/owl-pll.h b/drivers/clk/actions/owl-pll.h index 0aae30abd5dc..6fb0d45bb088 100644 --- a/drivers/clk/actions/owl-pll.h +++ b/drivers/clk/actions/owl-pll.h | |||
@@ -13,6 +13,8 @@ | |||
13 | 13 | ||
14 | #include "owl-common.h" | 14 | #include "owl-common.h" |
15 | 15 | ||
16 | #define OWL_PLL_DEF_DELAY 50 | ||
17 | |||
16 | /* last entry should have rate = 0 */ | 18 | /* last entry should have rate = 0 */ |
17 | struct clk_pll_table { | 19 | struct clk_pll_table { |
18 | unsigned int val; | 20 | unsigned int val; |
@@ -27,6 +29,7 @@ struct owl_pll_hw { | |||
27 | u8 width; | 29 | u8 width; |
28 | u8 min_mul; | 30 | u8 min_mul; |
29 | u8 max_mul; | 31 | u8 max_mul; |
32 | u8 delay; | ||
30 | const struct clk_pll_table *table; | 33 | const struct clk_pll_table *table; |
31 | }; | 34 | }; |
32 | 35 | ||
@@ -36,7 +39,7 @@ struct owl_pll { | |||
36 | }; | 39 | }; |
37 | 40 | ||
38 | #define OWL_PLL_HW(_reg, _bfreq, _bit_idx, _shift, \ | 41 | #define OWL_PLL_HW(_reg, _bfreq, _bit_idx, _shift, \ |
39 | _width, _min_mul, _max_mul, _table) \ | 42 | _width, _min_mul, _max_mul, _delay, _table) \ |
40 | { \ | 43 | { \ |
41 | .reg = _reg, \ | 44 | .reg = _reg, \ |
42 | .bfreq = _bfreq, \ | 45 | .bfreq = _bfreq, \ |
@@ -45,6 +48,7 @@ struct owl_pll { | |||
45 | .width = _width, \ | 48 | .width = _width, \ |
46 | .min_mul = _min_mul, \ | 49 | .min_mul = _min_mul, \ |
47 | .max_mul = _max_mul, \ | 50 | .max_mul = _max_mul, \ |
51 | .delay = _delay, \ | ||
48 | .table = _table, \ | 52 | .table = _table, \ |
49 | } | 53 | } |
50 | 54 | ||
@@ -52,8 +56,8 @@ struct owl_pll { | |||
52 | _shift, _width, _min_mul, _max_mul, _table, _flags) \ | 56 | _shift, _width, _min_mul, _max_mul, _table, _flags) \ |
53 | struct owl_pll _struct = { \ | 57 | struct owl_pll _struct = { \ |
54 | .pll_hw = OWL_PLL_HW(_reg, _bfreq, _bit_idx, _shift, \ | 58 | .pll_hw = OWL_PLL_HW(_reg, _bfreq, _bit_idx, _shift, \ |
55 | _width, _min_mul, \ | 59 | _width, _min_mul, _max_mul, \ |
56 | _max_mul, _table), \ | 60 | OWL_PLL_DEF_DELAY, _table), \ |
57 | .common = { \ | 61 | .common = { \ |
58 | .regmap = NULL, \ | 62 | .regmap = NULL, \ |
59 | .hw.init = CLK_HW_INIT(_name, \ | 63 | .hw.init = CLK_HW_INIT(_name, \ |
@@ -67,8 +71,23 @@ struct owl_pll { | |||
67 | _shift, _width, _min_mul, _max_mul, _table, _flags) \ | 71 | _shift, _width, _min_mul, _max_mul, _table, _flags) \ |
68 | struct owl_pll _struct = { \ | 72 | struct owl_pll _struct = { \ |
69 | .pll_hw = OWL_PLL_HW(_reg, _bfreq, _bit_idx, _shift, \ | 73 | .pll_hw = OWL_PLL_HW(_reg, _bfreq, _bit_idx, _shift, \ |
70 | _width, _min_mul, \ | 74 | _width, _min_mul, _max_mul, \ |
71 | _max_mul, _table), \ | 75 | OWL_PLL_DEF_DELAY, _table), \ |
76 | .common = { \ | ||
77 | .regmap = NULL, \ | ||
78 | .hw.init = CLK_HW_INIT_NO_PARENT(_name, \ | ||
79 | &owl_pll_ops, \ | ||
80 | _flags), \ | ||
81 | }, \ | ||
82 | } | ||
83 | |||
84 | #define OWL_PLL_NO_PARENT_DELAY(_struct, _name, _reg, _bfreq, _bit_idx, \ | ||
85 | _shift, _width, _min_mul, _max_mul, _delay, _table, \ | ||
86 | _flags) \ | ||
87 | struct owl_pll _struct = { \ | ||
88 | .pll_hw = OWL_PLL_HW(_reg, _bfreq, _bit_idx, _shift, \ | ||
89 | _width, _min_mul, _max_mul, \ | ||
90 | _delay, _table), \ | ||
72 | .common = { \ | 91 | .common = { \ |
73 | .regmap = NULL, \ | 92 | .regmap = NULL, \ |
74 | .hw.init = CLK_HW_INIT_NO_PARENT(_name, \ | 93 | .hw.init = CLK_HW_INIT_NO_PARENT(_name, \ |
@@ -78,7 +97,6 @@ struct owl_pll { | |||
78 | } | 97 | } |
79 | 98 | ||
80 | #define mul_mask(m) ((1 << ((m)->width)) - 1) | 99 | #define mul_mask(m) ((1 << ((m)->width)) - 1) |
81 | #define PLL_STABILITY_WAIT_US (50) | ||
82 | 100 | ||
83 | static inline struct owl_pll *hw_to_owl_pll(const struct clk_hw *hw) | 101 | static inline struct owl_pll *hw_to_owl_pll(const struct clk_hw *hw) |
84 | { | 102 | { |