hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/clk/renesas/r8a7743-cpg-mssr.c
....@@ -1,16 +1,14 @@
1
+// SPDX-License-Identifier: GPL-2.0
12 /*
23 * r8a7743 Clock Pulse Generator / Module Standby and Software Reset
34 *
45 * Copyright (C) 2016 Cogent Embedded Inc.
5
- *
6
- * This program is free software; you can redistribute it and/or modify it
7
- * under the terms of the GNU General Public License version 2 as published
8
- * by the Free Software Foundation; of the License.
96 */
107
118 #include <linux/device.h>
129 #include <linux/init.h>
1310 #include <linux/kernel.h>
11
+#include <linux/of.h>
1412 #include <linux/soc/renesas/rcar-rst.h>
1513
1614 #include <dt-bindings/clock/r8a7743-cpg-mssr.h>
....@@ -37,7 +35,7 @@
3735 MOD_CLK_BASE
3836 };
3937
40
-static const struct cpg_core_clk r8a7743_core_clks[] __initconst = {
38
+static struct cpg_core_clk r8a7743_core_clks[] __initdata = {
4139 /* External Clock Inputs */
4240 DEF_INPUT("extal", CLK_EXTAL),
4341 DEF_INPUT("usb_extal", CLK_USB_EXTAL),
....@@ -94,7 +92,7 @@
9492 DEF_MOD("tmu0", 125, R8A7743_CLK_CP),
9593 DEF_MOD("vsp1du1", 127, R8A7743_CLK_ZS),
9694 DEF_MOD("vsp1du0", 128, R8A7743_CLK_ZS),
97
- DEF_MOD("vsp1-sy", 131, R8A7743_CLK_ZS),
95
+ DEF_MOD("vsps", 131, R8A7743_CLK_ZS),
9896 DEF_MOD("scifa2", 202, R8A7743_CLK_MP),
9997 DEF_MOD("scifa1", 203, R8A7743_CLK_MP),
10098 DEF_MOD("scifa0", 204, R8A7743_CLK_MP),
....@@ -238,6 +236,8 @@
238236 static int __init r8a7743_cpg_mssr_init(struct device *dev)
239237 {
240238 const struct rcar_gen2_cpg_pll_config *cpg_pll_config;
239
+ struct device_node *np = dev->of_node;
240
+ unsigned int i;
241241 u32 cpg_mode;
242242 int error;
243243
....@@ -247,6 +247,14 @@
247247
248248 cpg_pll_config = &cpg_pll_configs[CPG_PLL_CONFIG_INDEX(cpg_mode)];
249249
250
+ if (of_device_is_compatible(np, "renesas,r8a7744-cpg-mssr")) {
251
+ /* RZ/G1N uses a 1/5 divider for ZG */
252
+ for (i = 0; i < ARRAY_SIZE(r8a7743_core_clks); i++)
253
+ if (r8a7743_core_clks[i].id == R8A7743_CLK_ZG) {
254
+ r8a7743_core_clks[i].div = 5;
255
+ break;
256
+ }
257
+ }
250258 return rcar_gen2_cpg_init(cpg_pll_config, 2, cpg_mode);
251259 }
252260