.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * Copyright (c) 2014, The Linux Foundation. All rights reserved. |
---|
3 | | - * |
---|
4 | | - * This software is licensed under the terms of the GNU General Public |
---|
5 | | - * License version 2, as published by the Free Software Foundation, and |
---|
6 | | - * may be copied, distributed, and modified under those terms. |
---|
7 | | - * |
---|
8 | | - * This program is distributed in the hope that it will be useful, |
---|
9 | | - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
10 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
11 | | - * GNU General Public License for more details. |
---|
12 | 4 | */ |
---|
13 | 5 | |
---|
14 | 6 | #include <linux/kernel.h> |
---|
.. | .. |
---|
30 | 22 | #include "clk-pll.h" |
---|
31 | 23 | #include "clk-rcg.h" |
---|
32 | 24 | #include "clk-branch.h" |
---|
| 25 | +#include "clk-hfpll.h" |
---|
33 | 26 | #include "reset.h" |
---|
34 | 27 | |
---|
35 | 28 | static struct clk_pll pll0 = { |
---|
.. | .. |
---|
111 | 104 | .num_parents = 1, |
---|
112 | 105 | .ops = &clk_pll_vote_ops, |
---|
113 | 106 | }, |
---|
| 107 | +}; |
---|
| 108 | + |
---|
| 109 | +static struct hfpll_data hfpll0_data = { |
---|
| 110 | + .mode_reg = 0x3200, |
---|
| 111 | + .l_reg = 0x3208, |
---|
| 112 | + .m_reg = 0x320c, |
---|
| 113 | + .n_reg = 0x3210, |
---|
| 114 | + .config_reg = 0x3204, |
---|
| 115 | + .status_reg = 0x321c, |
---|
| 116 | + .config_val = 0x7845c665, |
---|
| 117 | + .droop_reg = 0x3214, |
---|
| 118 | + .droop_val = 0x0108c000, |
---|
| 119 | + .min_rate = 600000000UL, |
---|
| 120 | + .max_rate = 1800000000UL, |
---|
| 121 | +}; |
---|
| 122 | + |
---|
| 123 | +static struct clk_hfpll hfpll0 = { |
---|
| 124 | + .d = &hfpll0_data, |
---|
| 125 | + .clkr.hw.init = &(struct clk_init_data){ |
---|
| 126 | + .parent_names = (const char *[]){ "pxo" }, |
---|
| 127 | + .num_parents = 1, |
---|
| 128 | + .name = "hfpll0", |
---|
| 129 | + .ops = &clk_ops_hfpll, |
---|
| 130 | + .flags = CLK_IGNORE_UNUSED, |
---|
| 131 | + }, |
---|
| 132 | + .lock = __SPIN_LOCK_UNLOCKED(hfpll0.lock), |
---|
| 133 | +}; |
---|
| 134 | + |
---|
| 135 | +static struct hfpll_data hfpll1_data = { |
---|
| 136 | + .mode_reg = 0x3240, |
---|
| 137 | + .l_reg = 0x3248, |
---|
| 138 | + .m_reg = 0x324c, |
---|
| 139 | + .n_reg = 0x3250, |
---|
| 140 | + .config_reg = 0x3244, |
---|
| 141 | + .status_reg = 0x325c, |
---|
| 142 | + .config_val = 0x7845c665, |
---|
| 143 | + .droop_reg = 0x3314, |
---|
| 144 | + .droop_val = 0x0108c000, |
---|
| 145 | + .min_rate = 600000000UL, |
---|
| 146 | + .max_rate = 1800000000UL, |
---|
| 147 | +}; |
---|
| 148 | + |
---|
| 149 | +static struct clk_hfpll hfpll1 = { |
---|
| 150 | + .d = &hfpll1_data, |
---|
| 151 | + .clkr.hw.init = &(struct clk_init_data){ |
---|
| 152 | + .parent_names = (const char *[]){ "pxo" }, |
---|
| 153 | + .num_parents = 1, |
---|
| 154 | + .name = "hfpll1", |
---|
| 155 | + .ops = &clk_ops_hfpll, |
---|
| 156 | + .flags = CLK_IGNORE_UNUSED, |
---|
| 157 | + }, |
---|
| 158 | + .lock = __SPIN_LOCK_UNLOCKED(hfpll1.lock), |
---|
| 159 | +}; |
---|
| 160 | + |
---|
| 161 | +static struct hfpll_data hfpll_l2_data = { |
---|
| 162 | + .mode_reg = 0x3300, |
---|
| 163 | + .l_reg = 0x3308, |
---|
| 164 | + .m_reg = 0x330c, |
---|
| 165 | + .n_reg = 0x3310, |
---|
| 166 | + .config_reg = 0x3304, |
---|
| 167 | + .status_reg = 0x331c, |
---|
| 168 | + .config_val = 0x7845c665, |
---|
| 169 | + .droop_reg = 0x3314, |
---|
| 170 | + .droop_val = 0x0108c000, |
---|
| 171 | + .min_rate = 600000000UL, |
---|
| 172 | + .max_rate = 1800000000UL, |
---|
| 173 | +}; |
---|
| 174 | + |
---|
| 175 | +static struct clk_hfpll hfpll_l2 = { |
---|
| 176 | + .d = &hfpll_l2_data, |
---|
| 177 | + .clkr.hw.init = &(struct clk_init_data){ |
---|
| 178 | + .parent_names = (const char *[]){ "pxo" }, |
---|
| 179 | + .num_parents = 1, |
---|
| 180 | + .name = "hfpll_l2", |
---|
| 181 | + .ops = &clk_ops_hfpll, |
---|
| 182 | + .flags = CLK_IGNORE_UNUSED, |
---|
| 183 | + }, |
---|
| 184 | + .lock = __SPIN_LOCK_UNLOCKED(hfpll_l2.lock), |
---|
114 | 185 | }; |
---|
115 | 186 | |
---|
116 | 187 | static struct clk_pll pll14 = { |
---|
.. | .. |
---|
1153 | 1224 | .parent_map = gcc_pxo_pll8_map, |
---|
1154 | 1225 | }, |
---|
1155 | 1226 | .clkr = { |
---|
| 1227 | + .enable_reg = 0x2e80, |
---|
| 1228 | + .enable_mask = BIT(11), |
---|
1156 | 1229 | .hw.init = &(struct clk_init_data){ |
---|
1157 | 1230 | .name = "prng_src", |
---|
1158 | 1231 | .parent_names = gcc_pxo_pll8, |
---|
.. | .. |
---|
2797 | 2870 | [UBI32_CORE2_CLK_SRC] = &ubi32_core2_src_clk.clkr, |
---|
2798 | 2871 | [NSSTCM_CLK_SRC] = &nss_tcm_src.clkr, |
---|
2799 | 2872 | [NSSTCM_CLK] = &nss_tcm_clk.clkr, |
---|
| 2873 | + [PLL9] = &hfpll0.clkr, |
---|
| 2874 | + [PLL10] = &hfpll1.clkr, |
---|
| 2875 | + [PLL12] = &hfpll_l2.clkr, |
---|
2800 | 2876 | }; |
---|
2801 | 2877 | |
---|
2802 | 2878 | static const struct qcom_reset_map gcc_ipq806x_resets[] = { |
---|
.. | .. |
---|
3013 | 3089 | regmap_write(regmap, 0x3cf8, 8); |
---|
3014 | 3090 | regmap_write(regmap, 0x3d18, 8); |
---|
3015 | 3091 | |
---|
3016 | | - return 0; |
---|
| 3092 | + return of_platform_populate(pdev->dev.of_node, NULL, NULL, &pdev->dev); |
---|
3017 | 3093 | } |
---|
3018 | 3094 | |
---|
3019 | 3095 | static struct platform_driver gcc_ipq806x_driver = { |
---|