Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

clk: sunxi-ng: Add support for the Allwinner H616 R-CCU

The clocks itself are identical to the H6 R-CCU, it's just that the H616
has not all of them implemented (or connected).

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
Acked-by: Maxime Ripard <mripard@kernel.org>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Link: https://lore.kernel.org/r/20210127172500.13356-3-andre.przywara@arm.com

authored by

Andre Przywara and committed by
Maxime Ripard
394a36dd f8d0e2ba

+49 -1
+1 -1
drivers/clk/sunxi-ng/Kconfig
··· 33 33 depends on (ARM64 && ARCH_SUNXI) || COMPILE_TEST 34 34 35 35 config SUN50I_H6_R_CCU 36 - bool "Support for the Allwinner H6 PRCM CCU" 36 + bool "Support for the Allwinner H6 and H616 PRCM CCU" 37 37 default ARM64 && ARCH_SUNXI 38 38 depends on (ARM64 && ARCH_SUNXI) || COMPILE_TEST 39 39
+48
drivers/clk/sunxi-ng/ccu-sun50i-h6-r.c
··· 139 139 &w1_clk.common, 140 140 }; 141 141 142 + static struct ccu_common *sun50i_h616_r_ccu_clks[] = { 143 + &r_apb1_clk.common, 144 + &r_apb2_clk.common, 145 + &r_apb1_twd_clk.common, 146 + &r_apb2_i2c_clk.common, 147 + &r_apb2_rsb_clk.common, 148 + &r_apb1_ir_clk.common, 149 + &ir_clk.common, 150 + }; 151 + 142 152 static struct clk_hw_onecell_data sun50i_h6_r_hw_clks = { 143 153 .hws = { 144 154 [CLK_AR100] = &ar100_clk.common.hw, ··· 169 159 .num = CLK_NUMBER, 170 160 }; 171 161 162 + static struct clk_hw_onecell_data sun50i_h616_r_hw_clks = { 163 + .hws = { 164 + [CLK_R_AHB] = &r_ahb_clk.hw, 165 + [CLK_R_APB1] = &r_apb1_clk.common.hw, 166 + [CLK_R_APB2] = &r_apb2_clk.common.hw, 167 + [CLK_R_APB1_TWD] = &r_apb1_twd_clk.common.hw, 168 + [CLK_R_APB2_I2C] = &r_apb2_i2c_clk.common.hw, 169 + [CLK_R_APB2_RSB] = &r_apb2_rsb_clk.common.hw, 170 + [CLK_R_APB1_IR] = &r_apb1_ir_clk.common.hw, 171 + [CLK_IR] = &ir_clk.common.hw, 172 + }, 173 + .num = CLK_NUMBER, 174 + }; 175 + 172 176 static struct ccu_reset_map sun50i_h6_r_ccu_resets[] = { 173 177 [RST_R_APB1_TIMER] = { 0x11c, BIT(16) }, 174 178 [RST_R_APB1_TWD] = { 0x12c, BIT(16) }, ··· 194 170 [RST_R_APB1_W1] = { 0x1ec, BIT(16) }, 195 171 }; 196 172 173 + static struct ccu_reset_map sun50i_h616_r_ccu_resets[] = { 174 + [RST_R_APB1_TWD] = { 0x12c, BIT(16) }, 175 + [RST_R_APB2_I2C] = { 0x19c, BIT(16) }, 176 + [RST_R_APB2_RSB] = { 0x1bc, BIT(16) }, 177 + [RST_R_APB1_IR] = { 0x1cc, BIT(16) }, 178 + }; 179 + 197 180 static const struct sunxi_ccu_desc sun50i_h6_r_ccu_desc = { 198 181 .ccu_clks = sun50i_h6_r_ccu_clks, 199 182 .num_ccu_clks = ARRAY_SIZE(sun50i_h6_r_ccu_clks), ··· 209 178 210 179 .resets = sun50i_h6_r_ccu_resets, 211 180 .num_resets = ARRAY_SIZE(sun50i_h6_r_ccu_resets), 181 + }; 182 + 183 + static const struct sunxi_ccu_desc sun50i_h616_r_ccu_desc = { 184 + .ccu_clks = sun50i_h616_r_ccu_clks, 185 + .num_ccu_clks = ARRAY_SIZE(sun50i_h616_r_ccu_clks), 186 + 187 + .hw_clks = &sun50i_h616_r_hw_clks, 188 + 189 + .resets = sun50i_h616_r_ccu_resets, 190 + .num_resets = ARRAY_SIZE(sun50i_h616_r_ccu_resets), 212 191 }; 213 192 214 193 static void __init sunxi_r_ccu_init(struct device_node *node, ··· 241 200 } 242 201 CLK_OF_DECLARE(sun50i_h6_r_ccu, "allwinner,sun50i-h6-r-ccu", 243 202 sun50i_h6_r_ccu_setup); 203 + 204 + static void __init sun50i_h616_r_ccu_setup(struct device_node *node) 205 + { 206 + sunxi_r_ccu_init(node, &sun50i_h616_r_ccu_desc); 207 + } 208 + CLK_OF_DECLARE(sun50i_h616_r_ccu, "allwinner,sun50i-h616-r-ccu", 209 + sun50i_h616_r_ccu_setup);