Module Name: src Committed By: kiyohara Date: Sat Aug 1 10:33:58 UTC 2009
Modified Files: src/sys/arch/arm/sa11x0: sa11x0_ost.c Log Message: Support run-time configuration for PXA25x and PXA27x. To generate a diff of this commit: cvs rdiff -u -r1.26 -r1.27 src/sys/arch/arm/sa11x0/sa11x0_ost.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/arm/sa11x0/sa11x0_ost.c diff -u src/sys/arch/arm/sa11x0/sa11x0_ost.c:1.26 src/sys/arch/arm/sa11x0/sa11x0_ost.c:1.27 --- src/sys/arch/arm/sa11x0/sa11x0_ost.c:1.26 Fri May 29 14:15:44 2009 +++ src/sys/arch/arm/sa11x0/sa11x0_ost.c Sat Aug 1 10:33:58 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: sa11x0_ost.c,v 1.26 2009/05/29 14:15:44 rjs Exp $ */ +/* $NetBSD: sa11x0_ost.c,v 1.27 2009/08/01 10:33:58 kiyohara Exp $ */ /* * Copyright (c) 1997 Mark Brinicombe. @@ -38,7 +38,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: sa11x0_ost.c,v 1.26 2009/05/29 14:15:44 rjs Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sa11x0_ost.c,v 1.27 2009/08/01 10:33:58 kiyohara Exp $"); #include <sys/types.h> #include <sys/param.h> @@ -80,7 +80,9 @@ static struct saost_softc *saost_sc = NULL; #if defined(CPU_XSCALE_PXA270) && defined(CPU_XSCALE_PXA250) -#error ost needs to dynamically configure the frequency +#include <arm/xscale/pxa2x0cpu.h> +static uint32_t freq; +#define TIMER_FREQUENCY freq #elif defined(CPU_XSCALE_PXA270) #define TIMER_FREQUENCY 3250000 /* PXA270 uses 3.25MHz */ #else @@ -223,6 +225,9 @@ stathz = STATHZ; profhz = stathz; +#if defined(CPU_XSCALE_PXA270) && defined(CPU_XSCALE_PXA250) + TIMER_FREQUENCY = (CPU_IS_PXA250) ? 3686400 : 3250000; +#endif sc->sc_statclock_step = TIMER_FREQUENCY / stathz; aprint_normal("clock: hz=%d stathz=%d\n", hz, stathz); @@ -258,12 +263,17 @@ { static struct timecounter saost_tc = { .tc_get_timecount = saost_tc_get_timecount, - .tc_frequency = TIMER_FREQUENCY, .tc_counter_mask = ~0, .tc_name = "saost_count", +#if !(defined(CPU_XSCALE_PXA270) && defined(CPU_XSCALE_PXA250)) + .tc_frequency = TIMER_FREQUENCY, +#endif .tc_quality = 100, }; +#if defined(CPU_XSCALE_PXA270) && defined(CPU_XSCALE_PXA250) + saost_tc.tc_frequency = TIMER_FREQUENCY, +#endif tc_init(&saost_tc); }