summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2019-01-01 15:54:34 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2019-01-01 15:54:34 +0000
commitcfcad1d390273c0d49132ec5c1accf3b6ed72447 (patch)
tree1b7f22fab543bd1cb311d01bab0773f2e6beddd3 /sys
parent7f9612167d8dbd3e63d8250bdeaad0c6dab0276b (diff)
Add RK3399 TSADC clock.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/fdt/rkclock.c9
-rw-r--r--sys/dev/fdt/rkclock_clocks.h1
2 files changed, 9 insertions, 1 deletions
diff --git a/sys/dev/fdt/rkclock.c b/sys/dev/fdt/rkclock.c
index 7c8036daedb..80fb368b999 100644
--- a/sys/dev/fdt/rkclock.c
+++ b/sys/dev/fdt/rkclock.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rkclock.c,v 1.39 2019/01/01 14:41:46 kettenis Exp $ */
+/* $OpenBSD: rkclock.c,v 1.40 2019/01/01 15:54:33 kettenis Exp $ */
/*
* Copyright (c) 2017, 2018 Mark Kettenis <kettenis@openbsd.org>
*
@@ -1481,6 +1481,11 @@ struct rkclock rk3399_clocks[] = {
RK3399_XIN24M }
},
{
+ RK3399_CLK_TSADC, RK3399_CRU_CLKSEL_CON(27),
+ SEL(15, 15), DIV(9, 0),
+ { RK3399_XIN24M, RK3399_CLK_32K }
+ },
+ {
RK3399_CLK_UART0, RK3399_CRU_CLKSEL_CON(33),
SEL(9, 8), 0,
{ 0, 0, RK3399_XIN24M }
@@ -1828,6 +1833,8 @@ rk3399_get_frequency(void *cookie, uint32_t *cells)
return rk3399_get_armclk(sc, RK3399_CRU_CLKSEL_CON(2));
case RK3399_XIN24M:
return 24000000;
+ case RK3399_CLK_32K:
+ return 32768;
default:
break;
}
diff --git a/sys/dev/fdt/rkclock_clocks.h b/sys/dev/fdt/rkclock_clocks.h
index 1e0456b125d..b61b5e912f8 100644
--- a/sys/dev/fdt/rkclock_clocks.h
+++ b/sys/dev/fdt/rkclock_clocks.h
@@ -172,3 +172,4 @@
#define RK3399_PCLK_I2C8 29
#define RK3399_XIN24M 1023
+#define RK3399_CLK_32K 1022