summaryrefslogtreecommitdiffstats
path: root/sys/arm/at91/at91_st.c
diff options
context:
space:
mode:
authorticso <ticso@FreeBSD.org>2007-01-05 02:52:06 +0000
committerticso <ticso@FreeBSD.org>2007-01-05 02:52:06 +0000
commit9f4ed86194c87ed7e48143844f07a1aac808c3dc (patch)
tree6a22b98c587dd227e7e6f15a1319b59e18d58926 /sys/arm/at91/at91_st.c
parent5b47ed3f0a2ceea89f440bdc748a47fcf930b0ec (diff)
downloadFreeBSD-src-9f4ed86194c87ed7e48143844f07a1aac808c3dc.zip
FreeBSD-src-9f4ed86194c87ed7e48143844f07a1aac808c3dc.tar.gz
MFp4: Use the next possible value for hz instead of defaulting to 128
Update tick value after modifying hz.
Diffstat (limited to 'sys/arm/at91/at91_st.c')
-rw-r--r--sys/arm/at91/at91_st.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/arm/at91/at91_st.c b/sys/arm/at91/at91_st.c
index 8b61c78..e165f24 100644
--- a/sys/arm/at91/at91_st.c
+++ b/sys/arm/at91/at91_st.c
@@ -206,11 +206,14 @@ cpu_initclocks(void)
void *ih;
device_t dev = timer_softc->sc_dev;
+ rel_value = 32768 / hz;
+ if (rel_value < 1)
+ rel_value = 1;
if (32768 % hz) {
- printf("Cannot get %d Hz clock; using 128Hz\n", hz);
- hz = 128;
+ printf("Cannot get %d Hz clock; using %dHz\n", hz, 32768 / rel_value);
+ hz = 32768 / rel_value;
+ tick = 1000000 / hz;
}
- rel_value = 32768 / hz;
/* Disable all interrupts. */
WR4(ST_IDR, 0xffffffff);
/* The system timer shares the system irq (1) */
OpenPOWER on IntegriCloud