Skip to contentSkip to conversation

clk: sunxi-ng: sun6i-rtc: Add A523 specifics

PATCH In review Chen-Yu Tsai 3 participants 3 messages Sep 9, 2025 – Sep 11, 2025

Subsystems (2)
lore
Share & tools
lore

Chen-Yu Tsai

author maintainer
#0 lore raw

PATCH 1/1 clk: sunxi-ng: sun6i-rtc: Add A523 specifics

From: Chen-Yu Tsai <[email protected]>

The A523's RTC block is backward compatible with the R329's, but it also has a calibration function for its internal oscillator, which would allow it to provide a clock rate closer to the desired 32.768 KHz. This is useful on the Radxa Cubie A5E, which does not have an external 32.768 KHz crystal.

Add new compatible-specific data for it.

---
 drivers/clk/sunxi-ng/ccu-sun6i-rtc.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
drivers/clk/sunxi-ng/ccu-sun6i-rtc.c +11 -0
index 0536e880b80f..f6bfeba009e8 100644
@@ -325,6 +325,13 @@ static const struct sun6i_rtc_match_data sun50i_r329_rtc_ccu_data = {
 	.osc32k_fanout_nparents	= ARRAY_SIZE(sun50i_r329_osc32k_fanout_parents),
 };
 
+static const struct sun6i_rtc_match_data sun55i_a523_rtc_ccu_data = {
+	.have_ext_osc32k	= true,
+	.have_iosc_calibration	= true,
+	.osc32k_fanout_parents	= sun50i_r329_osc32k_fanout_parents,
+	.osc32k_fanout_nparents	= ARRAY_SIZE(sun50i_r329_osc32k_fanout_parents),
+};
+
 static const struct of_device_id sun6i_rtc_ccu_match[] = {
 	{
 		.compatible	= "allwinner,sun50i-h616-rtc",
@@ -334,6 +341,10 @@ static const struct of_device_id sun6i_rtc_ccu_match[] = {
 		.compatible	= "allwinner,sun50i-r329-rtc",
 		.data		= &sun50i_r329_rtc_ccu_data,
 	},
+	{
+		.compatible	= "allwinner,sun55i-a523-rtc",
+		.data		= &sun55i_a523_rtc_ccu_data,
+	},
 	{},
 };
 MODULE_DEVICE_TABLE(of, sun6i_rtc_ccu_match);
Signature · 1 line
2.39.5
maintainer Acked-by on v1 1/1
#1 lore raw

Dne torek, 9. september 2025 ob 19:09:47 Srednjeevropski poletni čas je Chen-Yu Tsai napisal(a):

Quoted 11 lines

From: Chen-Yu Tsai <[email protected]>

The A523's RTC block is backward compatible with the R329's, but it also has a calibration function for its internal oscillator, which would allow it to provide a clock rate closer to the desired 32.768 KHz. This is useful on the Radxa Cubie A5E, which does not have an external 32.768 KHz crystal.

Add new compatible-specific data for it.

Best regards,
Jernej

Quoted 34 lines
---
 drivers/clk/sunxi-ng/ccu-sun6i-rtc.c | 11 +++++++++++
 1 file changed, 11 insertions(+)
drivers/clk/sunxi-ng/ccu-sun6i-rtc.c +11 -0
index 0536e880b80f..f6bfeba009e8 100644
@@ -325,6 +325,13 @@ static const struct sun6i_rtc_match_data sun50i_r329_rtc_ccu_data = {
 	.osc32k_fanout_nparents	= ARRAY_SIZE(sun50i_r329_osc32k_fanout_parents),
 };
 
+static const struct sun6i_rtc_match_data sun55i_a523_rtc_ccu_data = {
+	.have_ext_osc32k	= true,
+	.have_iosc_calibration	= true,
+	.osc32k_fanout_parents	= sun50i_r329_osc32k_fanout_parents,
+	.osc32k_fanout_nparents	= ARRAY_SIZE(sun50i_r329_osc32k_fanout_parents),
+};
+
 static const struct of_device_id sun6i_rtc_ccu_match[] = {
 	{
 		.compatible	= "allwinner,sun50i-h616-rtc",
@@ -334,6 +341,10 @@ static const struct of_device_id sun6i_rtc_ccu_match[] = {
 		.compatible	= "allwinner,sun50i-r329-rtc",
 		.data		= &sun50i_r329_rtc_ccu_data,
 	},
+	{
+		.compatible	= "allwinner,sun55i-a523-rtc",
+		.data		= &sun55i_a523_rtc_ccu_data,
+	},
 	{},
 };
 MODULE_DEVICE_TABLE(of, sun6i_rtc_ccu_match);
#2 lore raw
In reply to Chen-Yu Tsai
Quoted 9 lines · Chen-Yu Tsai

The A523's RTC block is backward compatible with the R329's, but it also has a calibration function for its internal oscillator, which would allow it to provide a clock rate closer to the desired 32.768 KHz. This is useful on the Radxa Cubie A5E, which does not have an external 32.768 KHz crystal.

Add new compatible-specific data for it.

[...]

Applied to sunxi/clk-for-6.18 in local tree, thanks!

[1/1] clk: sunxi-ng: sun6i-rtc: Add A523 specifics

      commit: 7aa8781f379c32c31bd78f1408a31765b2297c43

Best regards,

Signature · 1 line
Chen-Yu Tsai <[email protected]>