Module: xenomai-2.5
Branch: master
Commit: 9db485ee949ee3f308b6917b6e6c62e49605d5d4
URL:    
http://git.xenomai.org/?p=xenomai-2.5.git;a=commit;h=9db485ee949ee3f308b6917b6e6c62e49605d5d4

Author: Philippe Gerum <r...@xenomai.org>
Date:   Sun Mar  7 16:30:29 2010 +0100

powerpc: move to SYSINFO v2

---

 include/asm-powerpc/bits/init.h  |    2 +-
 include/asm-powerpc/bits/timer.h |    2 +-
 include/asm-powerpc/hal.h        |   11 -----------
 ksrc/arch/powerpc/hal.c          |   14 +++++++-------
 4 files changed, 9 insertions(+), 20 deletions(-)

diff --git a/include/asm-powerpc/bits/init.h b/include/asm-powerpc/bits/init.h
index e90e1c6..3e8e5e5 100644
--- a/include/asm-powerpc/bits/init.h
+++ b/include/asm-powerpc/bits/init.h
@@ -82,7 +82,7 @@ static inline int xnarch_init(void)
        set_cpus_allowed(current, cpumask_of_cpu(0));
 #endif /* CONFIG_SMP && MODULE */
 
-       xnarch_init_timeconv(RTHAL_CPU_FREQ);
+       xnarch_init_timeconv(RTHAL_CLOCK_FREQ);
 
        ret = xnarch_calibrate_sched();
        if (ret)
diff --git a/include/asm-powerpc/bits/timer.h b/include/asm-powerpc/bits/timer.h
index b61f496..8253bc0 100644
--- a/include/asm-powerpc/bits/timer.h
+++ b/include/asm-powerpc/bits/timer.h
@@ -37,7 +37,7 @@ static inline void xnarch_program_timer_shot(unsigned long 
delay)
         * billions ticks.
         */
        rthal_timer_program_shot(rthal_imuldiv_ceil
-                                (delay, RTHAL_TIMER_FREQ, RTHAL_CPU_FREQ));
+                                (delay, RTHAL_TIMER_FREQ, RTHAL_CLOCK_FREQ));
 }
 
 static inline int xnarch_send_timer_ipi(xnarch_cpumask_t mask)
diff --git a/include/asm-powerpc/hal.h b/include/asm-powerpc/hal.h
index 7539636..23c57dc 100644
--- a/include/asm-powerpc/hal.h
+++ b/include/asm-powerpc/hal.h
@@ -81,17 +81,6 @@ static inline void rthal_timer_program_shot(unsigned long 
delay)
 #ifdef CONFIG_40x
                mtspr(SPRN_PIT, delay);
 #else /* !CONFIG_40x */
-#ifdef CONFIG_PPC_PASEMI
-               /*
-                * PA6T rev Ax have decrementer ticking at 1/2 tb rate
-                * and set_dec() will scale back the delay
-                * accordingly; since our timing code assumes
-                * timebase_freq == decrementer_freq, we need to
-                * double the delay before set_dec() computes the
-                * final value used to program the decrementer.
-                */
-               delay <<= 1;
-#endif
                /*
                 * Decrementer must be set to a positive 32bit value,
                 * otherwise it would flood us with exceptions.
diff --git a/ksrc/arch/powerpc/hal.c b/ksrc/arch/powerpc/hal.c
index 81673c4..70e55ff 100644
--- a/ksrc/arch/powerpc/hal.c
+++ b/ksrc/arch/powerpc/hal.c
@@ -177,10 +177,6 @@ int rthal_timer_request(
 
        res = ipipe_request_tickdev("decrementer", mode_emul, tick_emul, cpu,
                                    tmfreq);
-       /*
-        * Ignore the returned timer freq; the timebase freq is more
-        * accurate (CPU_FREQ == timebase freq for this port).
-        */
        switch (res) {
        case CLOCK_EVT_MODE_PERIODIC:
                /* oneshot tick emulation callback won't be used, ask
@@ -332,7 +328,7 @@ void rthal_timer_release(int cpu)
 
 unsigned long rthal_timer_calibrate(void)
 {
-       return 1000000000 / RTHAL_CPU_FREQ;
+       return 1000000000 / RTHAL_CLOCK_FREQ;
 }
 
 int rthal_irq_host_request(unsigned irq,
@@ -447,10 +443,14 @@ int rthal_arch_init(void)
 #endif /* CONFIG_ALTIVEC */
 
        if (rthal_cpufreq_arg == 0)
-               /* The CPU frequency is expressed as the timebase frequency
-                  for this port. */
                rthal_cpufreq_arg = (unsigned long)rthal_get_cpufreq();
 
+       if (rthal_timerfreq_arg == 0)
+               rthal_timerfreq_arg = (unsigned long)rthal_get_timerfreq();
+
+       if (rthal_clockfreq_arg == 0)
+               rthal_clockfreq_arg = (unsigned long)rthal_get_clockfreq();
+
        return 0;
 }
 


_______________________________________________
Xenomai-git mailing list
Xenomai-git@gna.org
https://mail.gna.org/listinfo/xenomai-git

Reply via email to