hc
2024-05-10 23fa18eaa71266feff7ba8d83022d9e1cc83c65a
kernel/drivers/clk/qcom/gcc-ipq806x.c
....@@ -1,14 +1,6 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * 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.
124 */
135
146 #include <linux/kernel.h>
....@@ -30,6 +22,7 @@
3022 #include "clk-pll.h"
3123 #include "clk-rcg.h"
3224 #include "clk-branch.h"
25
+#include "clk-hfpll.h"
3326 #include "reset.h"
3427
3528 static struct clk_pll pll0 = {
....@@ -111,6 +104,84 @@
111104 .num_parents = 1,
112105 .ops = &clk_pll_vote_ops,
113106 },
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),
114185 };
115186
116187 static struct clk_pll pll14 = {
....@@ -1153,6 +1224,8 @@
11531224 .parent_map = gcc_pxo_pll8_map,
11541225 },
11551226 .clkr = {
1227
+ .enable_reg = 0x2e80,
1228
+ .enable_mask = BIT(11),
11561229 .hw.init = &(struct clk_init_data){
11571230 .name = "prng_src",
11581231 .parent_names = gcc_pxo_pll8,
....@@ -2797,6 +2870,9 @@
27972870 [UBI32_CORE2_CLK_SRC] = &ubi32_core2_src_clk.clkr,
27982871 [NSSTCM_CLK_SRC] = &nss_tcm_src.clkr,
27992872 [NSSTCM_CLK] = &nss_tcm_clk.clkr,
2873
+ [PLL9] = &hfpll0.clkr,
2874
+ [PLL10] = &hfpll1.clkr,
2875
+ [PLL12] = &hfpll_l2.clkr,
28002876 };
28012877
28022878 static const struct qcom_reset_map gcc_ipq806x_resets[] = {
....@@ -3013,7 +3089,7 @@
30133089 regmap_write(regmap, 0x3cf8, 8);
30143090 regmap_write(regmap, 0x3d18, 8);
30153091
3016
- return 0;
3092
+ return of_platform_populate(pdev->dev.of_node, NULL, NULL, &pdev->dev);
30173093 }
30183094
30193095 static struct platform_driver gcc_ipq806x_driver = {