aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIcenowy Zheng <icenowy@aosc.io>2017-12-22 07:22:34 -0500
committerChen-Yu Tsai <wens@csie.org>2017-12-29 03:15:07 -0500
commit19368d99746e9fda90ab4a7decb148a9f65e3915 (patch)
tree7127e7bb2ade4ecb1e4302a279bd2799f1e3acbd
parent3525c7c3bd2b7b0b77bdb0ab46a7c5338e188a5a (diff)
clk: sunxi-ng: add support for Allwinner H3 DE2 CCU
Allwinner H3 features a DE2 CCU like the one on A83T, however the parent of the clocks is the DE module clock, not the PLL_DE clock. Add support for it. Signed-off-by: Icenowy Zheng <icenowy@aosc.io> Signed-off-by: Chen-Yu Tsai <wens@csie.org>
-rw-r--r--drivers/clk/sunxi-ng/ccu-sun8i-de2.c47
1 files changed, 47 insertions, 0 deletions
diff --git a/drivers/clk/sunxi-ng/ccu-sun8i-de2.c b/drivers/clk/sunxi-ng/ccu-sun8i-de2.c
index 5cc9d9952121..2db5d4e00ea7 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,6 +166,16 @@ 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_a83t_de2_clks,
138 .num_ccu_clks = ARRAY_SIZE(sun8i_a83t_de2_clks), 181 .num_ccu_clks = ARRAY_SIZE(sun8i_a83t_de2_clks),
@@ -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 },