From dde6da66c569118e8207db4a5b953349394fd865 Mon Sep 17 00:00:00 2001 From: Bernd Walter Date: Fri, 5 Jan 2007 02:52:06 +0000 Subject: [PATCH] MFp4: Use the next possible value for hz instead of defaulting to 128 Update tick value after modifying hz. --- sys/arm/at91/at91_st.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/sys/arm/at91/at91_st.c b/sys/arm/at91/at91_st.c index 8b61c789653d..e165f24f9606 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; - if (32768 % hz) { - printf("Cannot get %d Hz clock; using 128Hz\n", hz); - hz = 128; - } rel_value = 32768 / hz; + if (rel_value < 1) + rel_value = 1; + if (32768 % hz) { + printf("Cannot get %d Hz clock; using %dHz\n", hz, 32768 / rel_value); + hz = 32768 / rel_value; + tick = 1000000 / hz; + } /* Disable all interrupts. */ WR4(ST_IDR, 0xffffffff); /* The system timer shares the system irq (1) */