@@ -56,6 +56,37 @@ static void __init exynos_arm64_init_clocks(struct device_node *np,
56
56
iounmap (reg_base );
57
57
}
58
58
59
+ /**
60
+ * exynos_arm64_enable_bus_clk - Enable parent clock of specified CMU
61
+ *
62
+ * @dev: Device object; may be NULL if this function is not being
63
+ * called from platform driver probe function
64
+ * @np: CMU device tree node
65
+ * @cmu: CMU data
66
+ *
67
+ * Keep CMU parent clock running (needed for CMU registers access).
68
+ *
69
+ * Return: 0 on success or a negative error code on failure.
70
+ */
71
+ static int __init exynos_arm64_enable_bus_clk (struct device * dev ,
72
+ struct device_node * np , const struct samsung_cmu_info * cmu )
73
+ {
74
+ struct clk * parent_clk ;
75
+
76
+ if (!cmu -> clk_name )
77
+ return 0 ;
78
+
79
+ if (dev )
80
+ parent_clk = clk_get (dev , cmu -> clk_name );
81
+ else
82
+ parent_clk = of_clk_get_by_name (np , cmu -> clk_name );
83
+
84
+ if (IS_ERR (parent_clk ))
85
+ return PTR_ERR (parent_clk );
86
+
87
+ return clk_prepare_enable (parent_clk );
88
+ }
89
+
59
90
/**
60
91
* exynos_arm64_register_cmu - Register specified Exynos CMU domain
61
92
* @dev: Device object; may be NULL if this function is not being
@@ -72,22 +103,16 @@ static void __init exynos_arm64_init_clocks(struct device_node *np,
72
103
void __init exynos_arm64_register_cmu (struct device * dev ,
73
104
struct device_node * np , const struct samsung_cmu_info * cmu )
74
105
{
75
- /* Keep CMU parent clock running (needed for CMU registers access) */
76
- if (cmu -> clk_name ) {
77
- struct clk * parent_clk ;
78
-
79
- if (dev )
80
- parent_clk = clk_get (dev , cmu -> clk_name );
81
- else
82
- parent_clk = of_clk_get_by_name (np , cmu -> clk_name );
83
-
84
- if (IS_ERR (parent_clk )) {
85
- pr_err ("%s: could not find bus clock %s; err = %ld\n" ,
86
- __func__ , cmu -> clk_name , PTR_ERR (parent_clk ));
87
- } else {
88
- clk_prepare_enable (parent_clk );
89
- }
90
- }
106
+ int err ;
107
+
108
+ /*
109
+ * Try to boot even if the parent clock enablement fails, as it might be
110
+ * already enabled by bootloader.
111
+ */
112
+ err = exynos_arm64_enable_bus_clk (dev , np , cmu );
113
+ if (err )
114
+ pr_err ("%s: could not enable bus clock %s; err = %d\n" ,
115
+ __func__ , cmu -> clk_name , err );
91
116
92
117
exynos_arm64_init_clocks (np , cmu -> clk_regs , cmu -> nr_clk_regs );
93
118
samsung_cmu_register_one (np , cmu );
0 commit comments