Skip to content

Commit 0482a4e

Browse files
smaeulwens
authored andcommitted
clk: sunxi-ng: h6-r: Add R_APB2_RSB clock and reset
While no information about the H6 RSB controller is included in the datasheet or manual, the vendor BSP and power management blob both reference the RSB clock parent and register address. These values were verified by experimentation. Since this clock/reset are added late, the specifier is added at the end to maintain the existing DT binding. The code is kept in register order. Signed-off-by: Samuel Holland <samuel@sholland.org> Acked-by: Maxime Ripard <mripard@kernel.org> Signed-off-by: Chen-Yu Tsai <wens@csie.org>
1 parent 5c8fe58 commit 0482a4e

4 files changed

Lines changed: 9 additions & 1 deletion

File tree

drivers/clk/sunxi-ng/ccu-sun50i-h6-r.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ static SUNXI_CCU_GATE(r_apb2_uart_clk, "r-apb2-uart", "r-apb2",
9191
0x18c, BIT(0), 0);
9292
static SUNXI_CCU_GATE(r_apb2_i2c_clk, "r-apb2-i2c", "r-apb2",
9393
0x19c, BIT(0), 0);
94+
static SUNXI_CCU_GATE(r_apb2_rsb_clk, "r-apb2-rsb", "r-apb2",
95+
0x1bc, BIT(0), 0);
9496
static SUNXI_CCU_GATE(r_apb1_ir_clk, "r-apb1-ir", "r-apb1",
9597
0x1cc, BIT(0), 0);
9698
static SUNXI_CCU_GATE(r_apb1_w1_clk, "r-apb1-w1", "r-apb1",
@@ -130,6 +132,7 @@ static struct ccu_common *sun50i_h6_r_ccu_clks[] = {
130132
&r_apb1_pwm_clk.common,
131133
&r_apb2_uart_clk.common,
132134
&r_apb2_i2c_clk.common,
135+
&r_apb2_rsb_clk.common,
133136
&r_apb1_ir_clk.common,
134137
&r_apb1_w1_clk.common,
135138
&ir_clk.common,
@@ -147,6 +150,7 @@ static struct clk_hw_onecell_data sun50i_h6_r_hw_clks = {
147150
[CLK_R_APB1_PWM] = &r_apb1_pwm_clk.common.hw,
148151
[CLK_R_APB2_UART] = &r_apb2_uart_clk.common.hw,
149152
[CLK_R_APB2_I2C] = &r_apb2_i2c_clk.common.hw,
153+
[CLK_R_APB2_RSB] = &r_apb2_rsb_clk.common.hw,
150154
[CLK_R_APB1_IR] = &r_apb1_ir_clk.common.hw,
151155
[CLK_R_APB1_W1] = &r_apb1_w1_clk.common.hw,
152156
[CLK_IR] = &ir_clk.common.hw,
@@ -161,6 +165,7 @@ static struct ccu_reset_map sun50i_h6_r_ccu_resets[] = {
161165
[RST_R_APB1_PWM] = { 0x13c, BIT(16) },
162166
[RST_R_APB2_UART] = { 0x18c, BIT(16) },
163167
[RST_R_APB2_I2C] = { 0x19c, BIT(16) },
168+
[RST_R_APB2_RSB] = { 0x1bc, BIT(16) },
164169
[RST_R_APB1_IR] = { 0x1cc, BIT(16) },
165170
[RST_R_APB1_W1] = { 0x1ec, BIT(16) },
166171
};

drivers/clk/sunxi-ng/ccu-sun50i-h6-r.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@
1414

1515
#define CLK_R_APB2 3
1616

17-
#define CLK_NUMBER (CLK_W1 + 1)
17+
#define CLK_NUMBER (CLK_R_APB2_RSB + 1)
1818

1919
#endif /* _CCU_SUN50I_H6_R_H */

include/dt-bindings/clock/sun50i-h6-r-ccu.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,6 @@
2121
#define CLK_IR 11
2222
#define CLK_W1 12
2323

24+
#define CLK_R_APB2_RSB 13
25+
2426
#endif /* _DT_BINDINGS_CLK_SUN50I_H6_R_CCU_H_ */

include/dt-bindings/reset/sun50i-h6-r-ccu.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@
1313
#define RST_R_APB2_I2C 4
1414
#define RST_R_APB1_IR 5
1515
#define RST_R_APB1_W1 6
16+
#define RST_R_APB2_RSB 7
1617

1718
#endif /* _DT_BINDINGS_RST_SUN50I_H6_R_CCU_H_ */

0 commit comments

Comments
 (0)