summaryrefslogtreecommitdiff
path: root/sys/dev/fdt
diff options
context:
space:
mode:
authorPatrick Wildt <patrick@cvs.openbsd.org>2019-10-07 19:28:44 +0000
committerPatrick Wildt <patrick@cvs.openbsd.org>2019-10-07 19:28:44 +0000
commit39ca62366a00f42893010f58c51ae1d7967b7f24 (patch)
tree711462986b399e83cb3019243ba19e6b454cc06a /sys/dev/fdt
parent0d49a9020866458920dd955d1558d955df89058b (diff)
Add SPI clocks.
ok kettenis@
Diffstat (limited to 'sys/dev/fdt')
-rw-r--r--sys/dev/fdt/mvclock.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/sys/dev/fdt/mvclock.c b/sys/dev/fdt/mvclock.c
index 2d8713a4398..7accdad05f4 100644
--- a/sys/dev/fdt/mvclock.c
+++ b/sys/dev/fdt/mvclock.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mvclock.c,v 1.4 2019/09/06 08:44:21 patrick Exp $ */
+/* $OpenBSD: mvclock.c,v 1.5 2019/10/07 19:28:43 patrick Exp $ */
/*
* Copyright (c) 2018 Mark Kettenis <kettenis@openbsd.org>
*
@@ -247,6 +247,7 @@ cp110_enable(void *cookie, uint32_t *cells, int on)
/* Armada 3700 Periph block */
#define PERIPH_NB_MMC 0x0
+#define PERIPH_NB_SQF 0x7
#define PERIPH_NB_I2C2 0x9
#define PERIPH_NB_I2C1 0xa
#define PERIPH_SB_GBE1_CORE 0x7
@@ -277,6 +278,8 @@ a3700_periph_nb_enable(void *cookie, uint32_t *cells, int on)
switch (idx) {
case PERIPH_NB_MMC:
return a3700_periph_enable(sc, 2, on);
+ case PERIPH_NB_SQF:
+ return a3700_periph_enable(sc, 12, on);
case PERIPH_NB_I2C2:
return a3700_periph_enable(sc, 16, on);
case PERIPH_NB_I2C1:
@@ -301,6 +304,11 @@ a3700_periph_nb_get_frequency(void *cookie, uint32_t *cells)
freq /= a3700_periph_get_double_div(sc,
PERIPH_DIV_SEL2, 16, 13);
return freq;
+ case PERIPH_NB_SQF:
+ freq = a3700_periph_tbg_get_frequency(sc, 12);
+ freq /= a3700_periph_get_double_div(sc,
+ PERIPH_DIV_SEL1, 27, 24);
+ return freq;
default:
break;
}