forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/drivers/clk/mvebu/kirkwood.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0
12 /*
23 * Marvell Kirkwood SoC clocks
34 *
....@@ -7,9 +8,6 @@
78 * Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
89 * Andrew Lunn <andrew@lunn.ch>
910 *
10
- * This file is licensed under the terms of the GNU General Public
11
- * License version 2. This program is licensed "as is" without any
12
- * warranty of any kind, whether express or implied.
1311 */
1412
1513 #include <linux/kernel.h>
....@@ -187,6 +185,11 @@
187185 }
188186 }
189187
188
+static u32 __init mv98dx1135_get_tclk_freq(void __iomem *sar)
189
+{
190
+ return 166666667;
191
+}
192
+
190193 static const struct coreclk_soc_desc kirkwood_coreclks = {
191194 .get_tclk_freq = kirkwood_get_tclk_freq,
192195 .get_cpu_freq = kirkwood_get_cpu_freq,
....@@ -199,6 +202,14 @@
199202 .get_tclk_freq = kirkwood_get_tclk_freq,
200203 .get_cpu_freq = mv88f6180_get_cpu_freq,
201204 .get_clk_ratio = mv88f6180_get_clk_ratio,
205
+ .ratios = kirkwood_coreclk_ratios,
206
+ .num_ratios = ARRAY_SIZE(kirkwood_coreclk_ratios),
207
+};
208
+
209
+static const struct coreclk_soc_desc mv98dx1135_coreclks = {
210
+ .get_tclk_freq = mv98dx1135_get_tclk_freq,
211
+ .get_cpu_freq = kirkwood_get_cpu_freq,
212
+ .get_clk_ratio = kirkwood_get_clk_ratio,
202213 .ratios = kirkwood_coreclk_ratios,
203214 .num_ratios = ARRAY_SIZE(kirkwood_coreclk_ratios),
204215 };
....@@ -328,6 +339,8 @@
328339
329340 if (of_device_is_compatible(np, "marvell,mv88f6180-core-clock"))
330341 mvebu_coreclk_setup(np, &mv88f6180_coreclks);
342
+ else if (of_device_is_compatible(np, "marvell,mv98dx1135-core-clock"))
343
+ mvebu_coreclk_setup(np, &mv98dx1135_coreclks);
331344 else
332345 mvebu_coreclk_setup(np, &kirkwood_coreclks);
333346
....@@ -342,3 +355,5 @@
342355 kirkwood_clk_init);
343356 CLK_OF_DECLARE(mv88f6180_clk, "marvell,mv88f6180-core-clock",
344357 kirkwood_clk_init);
358
+CLK_OF_DECLARE(98dx1135_clk, "marvell,mv98dx1135-core-clock",
359
+ kirkwood_clk_init);