summaryrefslogtreecommitdiff
path: root/sys/src/9/imx8/clock.c
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2022-07-09 15:15:55 +0000
committercinap_lenrek <cinap_lenrek@felloff.net>2022-07-09 15:15:55 +0000
commit2b89cdee025d9b3faccd62bc3515d7ed749ae26f (patch)
tree592449d518d4b2adbb3cb74cb2a8695aad01d149 /sys/src/9/imx8/clock.c
parent29a6cbf7ee601665c7ca204385d96a6c2a3080d8 (diff)
imx8: set virtual timer offset to zero for all cores
we want CNTVCT_EL0 to be the same on all cores, so we set the offset the same so it effectively becomes the system counter.
Diffstat (limited to 'sys/src/9/imx8/clock.c')
-rw-r--r--sys/src/9/imx8/clock.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/src/9/imx8/clock.c b/sys/src/9/imx8/clock.c
index 0338856aa..a6b9ab034 100644
--- a/sys/src/9/imx8/clock.c
+++ b/sys/src/9/imx8/clock.c
@@ -41,6 +41,9 @@ clockinit(void)
freq = sysrd(CNTFRQ_EL0);
print("timer frequency %lld Hz\n", freq);
}
+ m->cpuhz = freq;
+ m->cpumhz = (freq + Mhz/2 - 1) / Mhz;
+ m->cyclefreq = freq;
intrenable(IRQcntpns, localclockintr, nil, BUSUNKNOWN, "clock");
}