aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Boyd <sboyd@codeaurora.org>2018-01-10 17:45:33 -0500
committerStephen Boyd <sboyd@codeaurora.org>2018-01-10 17:45:33 -0500
commitef0e5f382f50259f78089ccbb52e441e649d45aa (patch)
tree0e8b3a79fe339717b8aea4ceae21e479576f7877
parentd96f2cf93755188e3b5ffada73a7cbb7b062d7a4 (diff)
parent7dbc7f5f4904cfddc199af171ea095490a434f15 (diff)
Merge tag 'sunxi-clk-for-4.16-2' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux into clk-allwinner
Pull Allwinner clock changes from Chen-Yu Tsai: - Fix hardware description for the DE2 clocks on the A64 and H5 SoCs - Support DE2 clocks on the H3 - Fix description for the TCON1 clock on A83T All these are non-critical, as they have no users. * tag 'sunxi-clk-for-4.16-2' of https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux: clk: sunxi-ng: a83t: Add M divider to TCON1 clock clk: sunxi-ng: fix the A64/H5 clock description of DE2 CCU clk: sunxi-ng: add support for Allwinner H3 DE2 CCU dt-bindings: fix the binding of Allwinner DE2 CCU of A83T and H3
-rw-r--r--Documentation/devicetree/bindings/clock/sun8i-de2.txt5
-rw-r--r--drivers/clk/sunxi-ng/ccu-sun8i-a83t.c4
-rw-r--r--drivers/clk/sunxi-ng/ccu-sun8i-de2.c53
3 files changed, 55 insertions, 7 deletions
diff --git a/Documentation/devicetree/bindings/clock/sun8i-de2.txt b/Documentation/devicetree/bindings/clock/sun8i-de2.txt
index 631d27cd89d6..f2fa87c4765c 100644
--- a/Documentation/devicetree/bindings/clock/sun8i-de2.txt
+++ b/Documentation/devicetree/bindings/clock/sun8i-de2.txt
@@ -4,13 +4,14 @@ Allwinner Display Engine 2.0 Clock Control Binding
4Required properties : 4Required properties :
5- compatible: must contain one of the following compatibles: 5- compatible: must contain one of the following compatibles:
6 - "allwinner,sun8i-a83t-de2-clk" 6 - "allwinner,sun8i-a83t-de2-clk"
7 - "allwinner,sun8i-h3-de2-clk"
7 - "allwinner,sun8i-v3s-de2-clk" 8 - "allwinner,sun8i-v3s-de2-clk"
8 - "allwinner,sun50i-h5-de2-clk" 9 - "allwinner,sun50i-h5-de2-clk"
9 10
10- reg: Must contain the registers base address and length 11- reg: Must contain the registers base address and length
11- clocks: phandle to the clocks feeding the display engine subsystem. 12- clocks: phandle to the clocks feeding the display engine subsystem.
12 Three are needed: 13 Three are needed:
13 - "mod": the display engine module clock 14 - "mod": the display engine module clock (on A83T it's the DE PLL)
14 - "bus": the bus clock for the whole display engine subsystem 15 - "bus": the bus clock for the whole display engine subsystem
15- clock-names: Must contain the clock names described just above 16- clock-names: Must contain the clock names described just above
16- resets: phandle to the reset control for the display engine subsystem. 17- resets: phandle to the reset control for the display engine subsystem.
@@ -19,7 +20,7 @@ Required properties :
19 20
20Example: 21Example:
21de2_clocks: clock@1000000 { 22de2_clocks: clock@1000000 {
22 compatible = "allwinner,sun8i-a83t-de2-clk"; 23 compatible = "allwinner,sun8i-h3-de2-clk";
23 reg = <0x01000000 0x100000>; 24 reg = <0x01000000 0x100000>;
24 clocks = <&ccu CLK_BUS_DE>, 25 clocks = <&ccu CLK_BUS_DE>,
25 <&ccu CLK_DE>; 26 <&ccu CLK_DE>;
diff --git a/drivers/clk/sunxi-ng/ccu-sun8i-a83t.c b/drivers/clk/sunxi-ng/ccu-sun8i-a83t.c
index 04a9c33f53f0..7d08015b980d 100644
--- a/drivers/clk/sunxi-ng/ccu-sun8i-a83t.c
+++ b/drivers/clk/sunxi-ng/ccu-sun8i-a83t.c
@@ -504,8 +504,8 @@ static SUNXI_CCU_MUX_WITH_GATE(tcon0_clk, "tcon0", tcon0_parents,
504 0x118, 24, 3, BIT(31), CLK_SET_RATE_PARENT); 504 0x118, 24, 3, BIT(31), CLK_SET_RATE_PARENT);
505 505
506static const char * const tcon1_parents[] = { "pll-video1" }; 506static const char * const tcon1_parents[] = { "pll-video1" };
507static SUNXI_CCU_MUX_WITH_GATE(tcon1_clk, "tcon1", tcon1_parents, 507static SUNXI_CCU_M_WITH_MUX_GATE(tcon1_clk, "tcon1", tcon1_parents,
508 0x11c, 24, 3, BIT(31), CLK_SET_RATE_PARENT); 508 0x11c, 0, 4, 24, 2, BIT(31), CLK_SET_RATE_PARENT);
509 509
510static SUNXI_CCU_GATE(csi_misc_clk, "csi-misc", "osc24M", 0x130, BIT(16), 0); 510static SUNXI_CCU_GATE(csi_misc_clk, "csi-misc", "osc24M", 0x130, BIT(16), 0);
511 511
diff --git a/drivers/clk/sunxi-ng/ccu-sun8i-de2.c b/drivers/clk/sunxi-ng/ccu-sun8i-de2.c
index 5cc9d9952121..468d1abaf0ee 100644
--- a/drivers/clk/sunxi-ng/ccu-sun8i-de2.c
+++ b/drivers/clk/sunxi-ng/ccu-sun8i-de2.c
@@ -41,6 +41,8 @@ static SUNXI_CCU_GATE(wb_clk, "wb", "wb-div",
41 41
42static SUNXI_CCU_M(mixer0_div_clk, "mixer0-div", "de", 0x0c, 0, 4, 42static SUNXI_CCU_M(mixer0_div_clk, "mixer0-div", "de", 0x0c, 0, 4,
43 CLK_SET_RATE_PARENT); 43 CLK_SET_RATE_PARENT);
44static SUNXI_CCU_M(mixer1_div_clk, "mixer1-div", "de", 0x0c, 4, 4,
45 CLK_SET_RATE_PARENT);
44static SUNXI_CCU_M(wb_div_clk, "wb-div", "de", 0x0c, 8, 4, 46static SUNXI_CCU_M(wb_div_clk, "wb-div", "de", 0x0c, 8, 4,
45 CLK_SET_RATE_PARENT); 47 CLK_SET_RATE_PARENT);
46 48
@@ -65,6 +67,20 @@ static struct ccu_common *sun8i_a83t_de2_clks[] = {
65 &wb_div_a83_clk.common, 67 &wb_div_a83_clk.common,
66}; 68};
67 69
70static struct ccu_common *sun8i_h3_de2_clks[] = {
71 &mixer0_clk.common,
72 &mixer1_clk.common,
73 &wb_clk.common,
74
75 &bus_mixer0_clk.common,
76 &bus_mixer1_clk.common,
77 &bus_wb_clk.common,
78
79 &mixer0_div_clk.common,
80 &mixer1_div_clk.common,
81 &wb_div_clk.common,
82};
83
68static struct ccu_common *sun8i_v3s_de2_clks[] = { 84static struct ccu_common *sun8i_v3s_de2_clks[] = {
69 &mixer0_clk.common, 85 &mixer0_clk.common,
70 &wb_clk.common, 86 &wb_clk.common,
@@ -93,6 +109,23 @@ static struct clk_hw_onecell_data sun8i_a83t_de2_hw_clks = {
93 .num = CLK_NUMBER, 109 .num = CLK_NUMBER,
94}; 110};
95 111
112static struct clk_hw_onecell_data sun8i_h3_de2_hw_clks = {
113 .hws = {
114 [CLK_MIXER0] = &mixer0_clk.common.hw,
115 [CLK_MIXER1] = &mixer1_clk.common.hw,
116 [CLK_WB] = &wb_clk.common.hw,
117
118 [CLK_BUS_MIXER0] = &bus_mixer0_clk.common.hw,
119 [CLK_BUS_MIXER1] = &bus_mixer1_clk.common.hw,
120 [CLK_BUS_WB] = &bus_wb_clk.common.hw,
121
122 [CLK_MIXER0_DIV] = &mixer0_div_clk.common.hw,
123 [CLK_MIXER1_DIV] = &mixer1_div_clk.common.hw,
124 [CLK_WB_DIV] = &wb_div_clk.common.hw,
125 },
126 .num = CLK_NUMBER,
127};
128
96static struct clk_hw_onecell_data sun8i_v3s_de2_hw_clks = { 129static struct clk_hw_onecell_data sun8i_v3s_de2_hw_clks = {
97 .hws = { 130 .hws = {
98 [CLK_MIXER0] = &mixer0_clk.common.hw, 131 [CLK_MIXER0] = &mixer0_clk.common.hw,
@@ -133,11 +166,21 @@ static const struct sunxi_ccu_desc sun8i_a83t_de2_clk_desc = {
133 .num_resets = ARRAY_SIZE(sun8i_a83t_de2_resets), 166 .num_resets = ARRAY_SIZE(sun8i_a83t_de2_resets),
134}; 167};
135 168
169static const struct sunxi_ccu_desc sun8i_h3_de2_clk_desc = {
170 .ccu_clks = sun8i_h3_de2_clks,
171 .num_ccu_clks = ARRAY_SIZE(sun8i_h3_de2_clks),
172
173 .hw_clks = &sun8i_h3_de2_hw_clks,
174
175 .resets = sun8i_a83t_de2_resets,
176 .num_resets = ARRAY_SIZE(sun8i_a83t_de2_resets),
177};
178
136static const struct sunxi_ccu_desc sun50i_a64_de2_clk_desc = { 179static const struct sunxi_ccu_desc sun50i_a64_de2_clk_desc = {
137 .ccu_clks = sun8i_a83t_de2_clks, 180 .ccu_clks = sun8i_h3_de2_clks,
138 .num_ccu_clks = ARRAY_SIZE(sun8i_a83t_de2_clks), 181 .num_ccu_clks = ARRAY_SIZE(sun8i_h3_de2_clks),
139 182
140 .hw_clks = &sun8i_a83t_de2_hw_clks, 183 .hw_clks = &sun8i_h3_de2_hw_clks,
141 184
142 .resets = sun50i_a64_de2_resets, 185 .resets = sun50i_a64_de2_resets,
143 .num_resets = ARRAY_SIZE(sun50i_a64_de2_resets), 186 .num_resets = ARRAY_SIZE(sun50i_a64_de2_resets),
@@ -238,6 +281,10 @@ static const struct of_device_id sunxi_de2_clk_ids[] = {
238 .data = &sun8i_a83t_de2_clk_desc, 281 .data = &sun8i_a83t_de2_clk_desc,
239 }, 282 },
240 { 283 {
284 .compatible = "allwinner,sun8i-h3-de2-clk",
285 .data = &sun8i_h3_de2_clk_desc,
286 },
287 {
241 .compatible = "allwinner,sun8i-v3s-de2-clk", 288 .compatible = "allwinner,sun8i-v3s-de2-clk",
242 .data = &sun8i_v3s_de2_clk_desc, 289 .data = &sun8i_v3s_de2_clk_desc,
243 }, 290 },