Changeset View
Changeset View
Standalone View
Standalone View
sys/arm/allwinner/aw_rtc.c
Show First 20 Lines • Show All 131 Lines • ▼ Show 20 Lines | struct aw_rtc_conf h3_conf = { | ||||
.rtc_losc_sta = A31_LOSC_AUTO_SWT_STA, | .rtc_losc_sta = A31_LOSC_AUTO_SWT_STA, | ||||
}; | }; | ||||
static struct ofw_compat_data compat_data[] = { | static struct ofw_compat_data compat_data[] = { | ||||
{ "allwinner,sun4i-a10-rtc", (uintptr_t) &a10_conf }, | { "allwinner,sun4i-a10-rtc", (uintptr_t) &a10_conf }, | ||||
{ "allwinner,sun7i-a20-rtc", (uintptr_t) &a20_conf }, | { "allwinner,sun7i-a20-rtc", (uintptr_t) &a20_conf }, | ||||
{ "allwinner,sun6i-a31-rtc", (uintptr_t) &a31_conf }, | { "allwinner,sun6i-a31-rtc", (uintptr_t) &a31_conf }, | ||||
{ "allwinner,sun8i-h3-rtc", (uintptr_t) &h3_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-h5-rtc", (uintptr_t) &h3_conf }, | ||||
{ "allwinner,sun50i-h6-rtc", (uintptr_t) &h3_conf }, | { "allwinner,sun50i-h6-rtc", (uintptr_t) &h3_conf }, | ||||
{ NULL, 0 } | { NULL, 0 } | ||||
}; | }; | ||||
struct aw_rtc_softc { | struct aw_rtc_softc { | ||||
struct resource *res; | struct resource *res; | ||||
struct aw_rtc_conf *conf; | struct aw_rtc_conf *conf; | ||||
▲ Show 20 Lines • Show All 104 Lines • ▼ Show 20 Lines | aw_rtc_install_clocks(struct aw_rtc_softc *sc, device_t dev) { | ||||
struct clkdom *clkdom; | struct clkdom *clkdom; | ||||
const char **clknames; | const char **clknames; | ||||
phandle_t node; | phandle_t node; | ||||
int nclocks; | int nclocks; | ||||
node = ofw_bus_get_node(dev); | node = ofw_bus_get_node(dev); | ||||
nclocks = ofw_bus_string_list_to_array(node, "clock-output-names", &clknames); | nclocks = ofw_bus_string_list_to_array(node, "clock-output-names", &clknames); | ||||
/* No clocks to export */ | /* No clocks to export */ | ||||
if (nclocks <= 0) | if (nclocks <= 0) { | ||||
if (bootverbose) | |||||
device_printf(dev, "No clocks to export\n"); | |||||
return; | return; | ||||
} | |||||
if (nclocks != 3) { | if (nclocks != 3) { | ||||
device_printf(dev, "Having only %d clocks instead of 3, aborting\n", nclocks); | device_printf(dev, "Having only %d clocks instead of 3, aborting\n", nclocks); | ||||
return; | return; | ||||
} | } | ||||
clkdom = clkdom_create(dev); | clkdom = clkdom_create(dev); | ||||
▲ Show 20 Lines • Show All 99 Lines • Show Last 20 Lines |