Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F162923825
D50369.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D50369.diff
View Options
diff --git a/sys/arm/allwinner/aw_rtc.c b/sys/arm/allwinner/aw_rtc.c
--- a/sys/arm/allwinner/aw_rtc.c
+++ b/sys/arm/allwinner/aw_rtc.c
@@ -134,6 +134,7 @@
{ "allwinner,sun7i-a20-rtc", (uintptr_t) &a20_conf },
{ "allwinner,sun6i-a31-rtc", (uintptr_t) &a31_conf },
{ "allwinner,sun8i-h3-rtc", (uintptr_t) &h3_conf },
+ { "allwinner,sun20i-d1-rtc", (uintptr_t) &h3_conf },
{ "allwinner,sun50i-h5-rtc", (uintptr_t) &h3_conf },
{ "allwinner,sun50i-h6-rtc", (uintptr_t) &h3_conf },
{ NULL, 0 }
@@ -147,11 +148,13 @@
static struct clk_fixed_def aw_rtc_osc32k = {
.clkdef.id = 0,
+ .clkdef.name = "osc32k",
.freq = 32768,
};
static struct clk_fixed_def aw_rtc_iosc = {
.clkdef.id = 2,
+ .clkdef.name = "iosc",
};
static void aw_rtc_install_clocks(struct aw_rtc_softc *sc, device_t dev);
@@ -250,23 +253,33 @@
int nclocks;
node = ofw_bus_get_node(dev);
- nclocks = ofw_bus_string_list_to_array(node, "clock-output-names", &clknames);
- /* No clocks to export */
- if (nclocks <= 0)
- return;
- if (nclocks != 3) {
- device_printf(dev, "Having only %d clocks instead of 3, aborting\n", nclocks);
+ /* Nothing to do. */
+ if (!OF_hasprop(node, "clocks"))
return;
+
+ /*
+ * If the device tree gives us specific output names for the clocks,
+ * use them.
+ */
+ nclocks = ofw_bus_string_list_to_array(node, "clock-output-names", &clknames);
+ if (nclocks > 0) {
+ if (nclocks != 3) {
+ device_printf(dev,
+ "Found %d clocks names instead of 3, aborting\n",
+ nclocks);
+ return;
+ }
+
+ aw_rtc_osc32k.clkdef.name = clknames[0];
+ aw_rtc_iosc.clkdef.name = clknames[2];
}
clkdom = clkdom_create(dev);
- aw_rtc_osc32k.clkdef.name = clknames[0];
if (clknode_fixed_register(clkdom, &aw_rtc_osc32k) != 0)
device_printf(dev, "Cannot register osc32k clock\n");
- aw_rtc_iosc.clkdef.name = clknames[2];
aw_rtc_iosc.freq = sc->conf->iosc_freq;
if (clknode_fixed_register(clkdom, &aw_rtc_iosc) != 0)
device_printf(dev, "Cannot register iosc clock\n");
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Jul 19, 8:36 AM (18 h, 6 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
35228040
Default Alt Text
D50369.diff (1 KB)
Attached To
Mode
D50369: riscv: enable allwinner RTC
Attached
Detach File
Event Timeline
Log In to Comment