Port-arm archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[PATCH] saost support both pxa2[57]x.



Hi! all,


Our GUMSTIX(evbarm) will supports both the "options CPU_XSCALE_PXA2[57]0".
However saost(4) not support both pxa25x and pxa27x at the same time.

Please correct this problem for us.

Thanks,
--
kiyohara
Index: sa11x0/sa11x0_ost.c
===================================================================
RCS file: /cvsroot/src/sys/arch/arm/sa11x0/sa11x0_ost.c,v
retrieving revision 1.25
diff -u -r1.25 sa11x0_ost.c
--- sa11x0/sa11x0_ost.c 10 May 2008 15:31:04 -0000      1.25
+++ sa11x0/sa11x0_ost.c 20 Aug 2008 11:09:13 -0000
@@ -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
@@ -222,6 +224,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;
 
        printf("clock: hz=%d stathz=%d\n", hz, stathz);
@@ -257,12 +262,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);
 }
 


Home | Main Index | Thread Index | Old Index