summaryrefslogtreecommitdiff
path: root/sys/arch/armv7/sunxi
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2016-11-21 20:22:44 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2016-11-21 20:22:44 +0000
commit932a0665b2eac67e954a05f61828a4a12d3122c7 (patch)
tree9666498ba76175b8a8aec33fe3c439244e5cfe7a /sys/arch/armv7/sunxi
parent9a482b0bb9303743acac15edcc639d235a0c229a (diff)
Add support for "allwinner,sun9i-a80-usb-mod-clk" and
"allwinner,sun9i-a80-usb-phy-clk" compatile clocks. Enable parent clock of clock gates.
Diffstat (limited to 'sys/arch/armv7/sunxi')
-rw-r--r--sys/arch/armv7/sunxi/sxiccmu.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/sys/arch/armv7/sunxi/sxiccmu.c b/sys/arch/armv7/sunxi/sxiccmu.c
index 66c5a5fe8d6..c1414dabf63 100644
--- a/sys/arch/armv7/sunxi/sxiccmu.c
+++ b/sys/arch/armv7/sunxi/sxiccmu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sxiccmu.c,v 1.25 2016/11/10 19:59:22 kettenis Exp $ */
+/* $OpenBSD: sxiccmu.c,v 1.26 2016/11/21 20:22:43 kettenis Exp $ */
/*
* Copyright (c) 2007,2009 Dale Rahn <drahn@openbsd.org>
* Copyright (c) 2013 Artturi Alm
@@ -325,6 +325,18 @@ struct sxiccmu_device sxiccmu_devices[] = {
.set_frequency = sxiccmu_mmc_set_frequency,
.enable = sxiccmu_mmc_enable
},
+ {
+ .compat = "allwinner,sun9i-a80-usb-mod-clk",
+ .get_frequency = sxiccmu_gen_get_frequency,
+ .enable = sxiccmu_gate_enable,
+ .reset = sxiccmu_reset
+ },
+ {
+ .compat = "allwinner,sun9i-a80-usb-phy-clk",
+ .get_frequency = sxiccmu_gen_get_frequency,
+ .enable = sxiccmu_gate_enable,
+ .reset = sxiccmu_reset
+ },
};
void
@@ -580,10 +592,13 @@ sxiccmu_gate_enable(void *cookie, uint32_t *cells, int on)
int reg = cells[0] / 32;
int bit = cells[0] % 32;
- if (on)
+ if (on) {
+ clock_enable(sc->sc_node, NULL);
SXISET4(sc, reg * 4, (1U << bit));
- else
+ } else {
SXICLR4(sc, reg * 4, (1U << bit));
+ clock_disable(sc->sc_node, NULL);
+ }
}
void