Skip to content

Commit 38d321b

Browse files
Andre-ARMjernejsk
authored andcommitted
clk: sunxi-ng: h6-r: Add RTC gate clock
The H6 and H616 feature an (undocumented) bus clock gate for accessing the RTC registers. This seems to be enabled at reset (or by the BootROM), so we got away without it so far, but exists regardless. Since the new RTC clock binding for the H616 requires this "bus" clock to be specified in the DT, add this to R_CCU clock driver and expose it on the DT side with a new number. We do this for both the H6 and H616, but mark it as IGNORE_UNUSED, as we cannot reference it in any H6 DTs. Signed-off-by: Andre Przywara <[email protected]> Reviewed-by: Samuel Holland <[email protected]> Signed-off-by: Jernej Skrabec <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 3123109 commit 38d321b

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ static SUNXI_CCU_GATE(r_apb1_ir_clk, "r-apb1-ir", "r-apb1",
9898
0x1cc, BIT(0), 0);
9999
static SUNXI_CCU_GATE(r_apb1_w1_clk, "r-apb1-w1", "r-apb1",
100100
0x1ec, BIT(0), 0);
101+
static SUNXI_CCU_GATE(r_apb1_rtc_clk, "r-apb1-rtc", "r-apb1",
102+
0x20c, BIT(0), CLK_IGNORE_UNUSED);
101103

102104
/* Information of IR(RX) mod clock is gathered from BSP source code */
103105
static const char * const r_mod0_default_parents[] = { "osc32k", "osc24M" };
@@ -147,6 +149,7 @@ static struct ccu_common *sun50i_h616_r_ccu_clks[] = {
147149
&r_apb2_i2c_clk.common,
148150
&r_apb2_rsb_clk.common,
149151
&r_apb1_ir_clk.common,
152+
&r_apb1_rtc_clk.common,
150153
&ir_clk.common,
151154
};
152155

@@ -164,6 +167,7 @@ static struct clk_hw_onecell_data sun50i_h6_r_hw_clks = {
164167
[CLK_R_APB2_RSB] = &r_apb2_rsb_clk.common.hw,
165168
[CLK_R_APB1_IR] = &r_apb1_ir_clk.common.hw,
166169
[CLK_R_APB1_W1] = &r_apb1_w1_clk.common.hw,
170+
[CLK_R_APB1_RTC] = &r_apb1_rtc_clk.common.hw,
167171
[CLK_IR] = &ir_clk.common.hw,
168172
[CLK_W1] = &w1_clk.common.hw,
169173
},
@@ -179,6 +183,7 @@ static struct clk_hw_onecell_data sun50i_h616_r_hw_clks = {
179183
[CLK_R_APB2_I2C] = &r_apb2_i2c_clk.common.hw,
180184
[CLK_R_APB2_RSB] = &r_apb2_rsb_clk.common.hw,
181185
[CLK_R_APB1_IR] = &r_apb1_ir_clk.common.hw,
186+
[CLK_R_APB1_RTC] = &r_apb1_rtc_clk.common.hw,
182187
[CLK_IR] = &ir_clk.common.hw,
183188
},
184189
.num = CLK_NUMBER,

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_R_APB2_RSB + 1)
17+
#define CLK_NUMBER (CLK_R_APB1_RTC + 1)
1818

1919
#endif /* _CCU_SUN50I_H6_R_H */

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,6 @@
2222
#define CLK_W1 12
2323

2424
#define CLK_R_APB2_RSB 13
25+
#define CLK_R_APB1_RTC 14
2526

2627
#endif /* _DT_BINDINGS_CLK_SUN50I_H6_R_CCU_H_ */

0 commit comments

Comments
 (0)