diff options
| author | Stephen Boyd <sboyd@kernel.org> | 2018-12-14 17:03:38 -0500 |
|---|---|---|
| committer | Stephen Boyd <sboyd@kernel.org> | 2018-12-14 17:03:38 -0500 |
| commit | b677574bdf292e31c8f9810ff0fc0b35839d4636 (patch) | |
| tree | 36cdf93f655abe8d09654c7f2f22816296004172 /drivers/clk/imx | |
| parent | 2de34ed964891c0a58d03b20705437d8831fd6de (diff) | |
| parent | 7128d7f7bae11217cdd304b0620a4461102e599b (diff) | |
Merge branch 'clk-imx7ulp' into clk-next
* clk-imx7ulp:
clk: imx: imx7ulp: add arm hsrun mode clocks support
dt-bindings: clock: imx7ulp: add HSRUN mode related clocks
Diffstat (limited to 'drivers/clk/imx')
| -rw-r--r-- | drivers/clk/imx/clk-imx7ulp.c | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/drivers/clk/imx/clk-imx7ulp.c b/drivers/clk/imx/clk-imx7ulp.c index 3b7507ff7869..4e18f629f823 100644 --- a/drivers/clk/imx/clk-imx7ulp.c +++ b/drivers/clk/imx/clk-imx7ulp.c | |||
| @@ -29,6 +29,7 @@ static const char * const ddr_sels[] = { "apll_pfd_sel", "upll", }; | |||
| 29 | static const char * const nic_sels[] = { "firc", "ddr_clk", }; | 29 | static const char * const nic_sels[] = { "firc", "ddr_clk", }; |
| 30 | static const char * const periph_plat_sels[] = { "dummy", "nic1_bus_clk", "nic1_clk", "ddr_clk", "apll_pfd2", "apll_pfd1", "apll_pfd0", "upll", }; | 30 | static const char * const periph_plat_sels[] = { "dummy", "nic1_bus_clk", "nic1_clk", "ddr_clk", "apll_pfd2", "apll_pfd1", "apll_pfd0", "upll", }; |
| 31 | static const char * const periph_bus_sels[] = { "dummy", "sosc_bus_clk", "mpll", "firc_bus_clk", "rosc", "nic1_bus_clk", "nic1_clk", "spll_bus_clk", }; | 31 | static const char * const periph_bus_sels[] = { "dummy", "sosc_bus_clk", "mpll", "firc_bus_clk", "rosc", "nic1_bus_clk", "nic1_clk", "spll_bus_clk", }; |
| 32 | static const char * const arm_sels[] = { "divcore", "dummy", "dummy", "hsrun_divcore", }; | ||
| 32 | 33 | ||
| 33 | /* used by sosc/sirc/firc/ddr/spll/apll dividers */ | 34 | /* used by sosc/sirc/firc/ddr/spll/apll dividers */ |
| 34 | static const struct clk_div_table ulp_div_table[] = { | 35 | static const struct clk_div_table ulp_div_table[] = { |
| @@ -102,10 +103,12 @@ static void __init imx7ulp_clk_scg1_init(struct device_node *np) | |||
| 102 | 103 | ||
| 103 | /* scs/ddr/nic select different clock source requires that clock to be enabled first */ | 104 | /* scs/ddr/nic select different clock source requires that clock to be enabled first */ |
| 104 | clks[IMX7ULP_CLK_SYS_SEL] = imx_clk_hw_mux2("scs_sel", base + 0x14, 24, 4, scs_sels, ARRAY_SIZE(scs_sels)); | 105 | clks[IMX7ULP_CLK_SYS_SEL] = imx_clk_hw_mux2("scs_sel", base + 0x14, 24, 4, scs_sels, ARRAY_SIZE(scs_sels)); |
| 106 | clks[IMX7ULP_CLK_HSRUN_SYS_SEL] = imx_clk_hw_mux2("hsrun_scs_sel", base + 0x1c, 24, 4, scs_sels, ARRAY_SIZE(scs_sels)); | ||
| 105 | clks[IMX7ULP_CLK_NIC_SEL] = imx_clk_hw_mux2("nic_sel", base + 0x40, 28, 1, nic_sels, ARRAY_SIZE(nic_sels)); | 107 | clks[IMX7ULP_CLK_NIC_SEL] = imx_clk_hw_mux2("nic_sel", base + 0x40, 28, 1, nic_sels, ARRAY_SIZE(nic_sels)); |
| 106 | clks[IMX7ULP_CLK_DDR_SEL] = imx_clk_hw_mux_flags("ddr_sel", base + 0x30, 24, 1, ddr_sels, ARRAY_SIZE(ddr_sels), CLK_SET_RATE_PARENT | CLK_OPS_PARENT_ENABLE); | 108 | clks[IMX7ULP_CLK_DDR_SEL] = imx_clk_hw_mux_flags("ddr_sel", base + 0x30, 24, 1, ddr_sels, ARRAY_SIZE(ddr_sels), CLK_SET_RATE_PARENT | CLK_OPS_PARENT_ENABLE); |
| 107 | 109 | ||
| 108 | clks[IMX7ULP_CLK_CORE_DIV] = imx_clk_hw_divider_flags("divcore", "scs_sel", base + 0x14, 16, 4, CLK_SET_RATE_PARENT | CLK_IS_CRITICAL); | 110 | clks[IMX7ULP_CLK_CORE_DIV] = imx_clk_hw_divider_flags("divcore", "scs_sel", base + 0x14, 16, 4, CLK_SET_RATE_PARENT); |
| 111 | clks[IMX7ULP_CLK_HSRUN_CORE_DIV] = imx_clk_hw_divider_flags("hsrun_divcore", "hsrun_scs_sel", base + 0x1c, 16, 4, CLK_SET_RATE_PARENT); | ||
| 109 | 112 | ||
| 110 | clks[IMX7ULP_CLK_DDR_DIV] = imx_clk_divider_gate("ddr_clk", "ddr_sel", CLK_SET_RATE_PARENT | CLK_IS_CRITICAL, base + 0x30, 0, 3, | 113 | clks[IMX7ULP_CLK_DDR_DIV] = imx_clk_divider_gate("ddr_clk", "ddr_sel", CLK_SET_RATE_PARENT | CLK_IS_CRITICAL, base + 0x30, 0, 3, |
| 111 | 0, ulp_div_table, &imx_ccm_lock); | 114 | 0, ulp_div_table, &imx_ccm_lock); |
| @@ -218,3 +221,29 @@ static void __init imx7ulp_clk_pcc3_init(struct device_node *np) | |||
| 218 | of_clk_add_hw_provider(np, of_clk_hw_onecell_get, clk_data); | 221 | of_clk_add_hw_provider(np, of_clk_hw_onecell_get, clk_data); |
| 219 | } | 222 | } |
| 220 | CLK_OF_DECLARE(imx7ulp_clk_pcc3, "fsl,imx7ulp-pcc3", imx7ulp_clk_pcc3_init); | 223 | CLK_OF_DECLARE(imx7ulp_clk_pcc3, "fsl,imx7ulp-pcc3", imx7ulp_clk_pcc3_init); |
| 224 | |||
| 225 | static void __init imx7ulp_clk_smc1_init(struct device_node *np) | ||
| 226 | { | ||
| 227 | struct clk_hw_onecell_data *clk_data; | ||
| 228 | struct clk_hw **clks; | ||
| 229 | void __iomem *base; | ||
| 230 | |||
| 231 | clk_data = kzalloc(sizeof(*clk_data) + sizeof(*clk_data->hws) * | ||
| 232 | IMX7ULP_CLK_SMC1_END, GFP_KERNEL); | ||
| 233 | if (!clk_data) | ||
| 234 | return; | ||
| 235 | |||
| 236 | clk_data->num = IMX7ULP_CLK_SMC1_END; | ||
| 237 | clks = clk_data->hws; | ||
| 238 | |||
| 239 | /* SMC1 */ | ||
| 240 | base = of_iomap(np, 0); | ||
| 241 | WARN_ON(!base); | ||
| 242 | |||
| 243 | clks[IMX7ULP_CLK_ARM] = imx_clk_hw_mux_flags("arm", base + 0x10, 8, 2, arm_sels, ARRAY_SIZE(arm_sels), CLK_IS_CRITICAL); | ||
| 244 | |||
| 245 | imx_check_clk_hws(clks, clk_data->num); | ||
| 246 | |||
| 247 | of_clk_add_hw_provider(np, of_clk_hw_onecell_get, clk_data); | ||
| 248 | } | ||
| 249 | CLK_OF_DECLARE(imx7ulp_clk_smc1, "fsl,imx7ulp-smc1", imx7ulp_clk_smc1_init); | ||
