Re: [Xenomai-core] Xenomai on PXA255

2006-05-29 Thread Gilles Chanteperdrix
Bart Jonkers wrote:
  Hey,
  
  I'm trying to run Xenomai enabled kernel on the PXA255 (arm). When I
  compile the patched kernel, I get some undefined references errors.
  When I search through the patched kernel, I found the functions an
  variables defined for the integrator architecture.
  
  Which functions and variables need I to define for the PXA255 and what
  are there purpose, so I can add support for the PXA255 processor.
  Or are there some patches around to support the PXA255.

The Ipipe patch for ARM only support the integrator platform for
now. There exist patch for another ARM platform, but it exist only as
a separated patch. Looking at the patch contents it seems that the only
patched files specific to the integrator architecture are :
arch/arm/mach-integrator/core.c
arch/arm/mach-integrator/integrator_cp.c
include/asm-arm/arch-integrator/entry-macro.S
include/asm-arm/arch-integrator/platform.h
include/asm-arm/arch-integrator/timex.h

Looking rapidly at these files, it seems that the machine specific
functions and variables are reduced to:

int __ipipe_mach_timerint;
int __ipipe_mach_timerstolen;
unsigned int __ipipe_mach_ticks_per_jiffy;

void __ipipe_mach_acktimer(void);
unsigned long long __ipipe_mach_get_tsc(void);
void __ipipe_mach_set_dec(unsigned long reload);
unsigned long __ipipe_mach_get_dec(void);

If you provide the same variables and functions for the PXA platform, I
think there is no modification to be done at Xenomai level.

-- 


Gilles Chanteperdrix.

___
Xenomai-core mailing list
Xenomai-core@gna.org
https://mail.gna.org/listinfo/xenomai-core


Re: [Xenomai-core] Xenomai on PXA255

2006-05-29 Thread Bart Jonkers
On Mon, 2006-05-29 at 16:00 +0200, Gilles Chanteperdrix wrote:
 Bart Jonkers wrote:
   Hey,
   
   I'm trying to run Xenomai enabled kernel on the PXA255 (arm). When I
   compile the patched kernel, I get some undefined references errors.
   When I search through the patched kernel, I found the functions an
   variables defined for the integrator architecture.
   
   Which functions and variables need I to define for the PXA255 and what
   are there purpose, so I can add support for the PXA255 processor.
   Or are there some patches around to support the PXA255.
 
 The Ipipe patch for ARM only support the integrator platform for
 now. There exist patch for another ARM platform, but it exist only as
 a separated patch. Looking at the patch contents it seems that the only
 patched files specific to the integrator architecture are :
 arch/arm/mach-integrator/core.c
 arch/arm/mach-integrator/integrator_cp.c
 include/asm-arm/arch-integrator/entry-macro.S
 include/asm-arm/arch-integrator/platform.h
 include/asm-arm/arch-integrator/timex.h
 
 Looking rapidly at these files, it seems that the machine specific
 functions and variables are reduced to:
 
 int __ipipe_mach_timerint;
 int __ipipe_mach_timerstolen;
 unsigned int __ipipe_mach_ticks_per_jiffy;
 
 void __ipipe_mach_acktimer(void);
 unsigned long long __ipipe_mach_get_tsc(void);
 void __ipipe_mach_set_dec(unsigned long reload);
 unsigned long __ipipe_mach_get_dec(void);
 
 If you provide the same variables and functions for the PXA platform, I
 think there is no modification to be done at Xenomai level.
I found this out already. But it would be a easier to implement this
functions if I know what they have to do. So could somebody give an
explanation of this variables and functions?

Thanks,
Bart
 


___
Xenomai-core mailing list
Xenomai-core@gna.org
https://mail.gna.org/listinfo/xenomai-core


Re: [Xenomai-core] Xenomai on PXA255

2006-05-29 Thread Stelian Pop
Le lundi 29 mai 2006 à 16:14 +0200, Bart Jonkers a écrit :

  The Ipipe patch for ARM only support the integrator platform for
  now. There exist patch for another ARM platform, but it exist only as
  a separated patch. Looking at the patch contents it seems that the only
  patched files specific to the integrator architecture are :
  arch/arm/mach-integrator/core.c
  arch/arm/mach-integrator/integrator_cp.c
  include/asm-arm/arch-integrator/entry-macro.S
  include/asm-arm/arch-integrator/platform.h
  include/asm-arm/arch-integrator/timex.h
  
  Looking rapidly at these files, it seems that the machine specific
  functions and variables are reduced to:
  
  int __ipipe_mach_timerint;
  int __ipipe_mach_timerstolen;
  unsigned int __ipipe_mach_ticks_per_jiffy;
  
  void __ipipe_mach_acktimer(void);
  unsigned long long __ipipe_mach_get_tsc(void);
  void __ipipe_mach_set_dec(unsigned long reload);
  unsigned long __ipipe_mach_get_dec(void);
  
  If you provide the same variables and functions for the PXA platform, I
  think there is no modification to be done at Xenomai level.

Gilles is 100% correct. All the platform specific code has to do is
provide the low level timer manipulation functions.

 I found this out already. But it would be a easier to implement this
 functions if I know what they have to do. So could somebody give an
 explanation of this variables and functions?

Well, __ipipe_mach_acktimer acks the timer, __ipipe_mach_get_tsc returns
the TSC of the platform, __ipipe_mach_set_dec sets the decrementer etc.
Should I go on ?

If you have specific questions feel free to ask. But I suggest you read
and try to understand the code first.

Stelian.
-- 
Stelian Pop [EMAIL PROTECTED]



___
Xenomai-core mailing list
Xenomai-core@gna.org
https://mail.gna.org/listinfo/xenomai-core


Re: [Xenomai-core] Xenomai on PXA255

2006-05-29 Thread Gilles Chanteperdrix
Stelian Pop wrote:
  If you have specific questions feel free to ask. But I suggest you read
  and try to understand the code first.

Maybe we could provide a quick overview of how this works, Stelian,
please correct me if I am wrong. 

If we start before rthal_timer_request is called, when the timer is
handled by Linux, we see that __ipipe_decr_ticks is set to
__ipipe_mach_ticks_per_jiffy, so that __ipipe_grab_irq does not
reprogram the timer. But __ipipe_mach_timerstolen is set to 0, so
integrator_timer_interrupt reprogram the timer at each tick.

Now, when rthal_timer_request (defined in  ksrc/arch/arm/hal.c) is
called when Xenomai start handling the timer, we can see the two
different modes:

- in periodic mode, ipipe_tune_timer get called (indirectly via
  rthal_set_timer, defined in include/asm-generic/hal.h), so
  the proper value of __ipipe_decr_ticks is computed using
  __ipipe_mach_ticks_per_jiffy, and __ipipe_mach_set_dec get called by
  __ipipe_grab_irq at each tick to reprogram the timer

- in aperiodic (aka one-shot) mode, ipipe_tune_timer does not get
  called, so __ipipe_decr_ticks remains set to
  __ipipe_mach_ticks_per_jiffy and __ipipe_grab_irq does not call
  __ipipe_mach_set_dec. Instead, __ipipe_mach_set_dec is called for
  each shot by Xenomai (function rthal_timer_program_shot in
  include/asm-arm/hal.h)

In both modes, __ipipe_mach_timerstolen is set to 1, so that
integrator_timer_interrupt never reprograms the timer. 

When CONFIG_IPIPE is set, integrator_timer_interrupt never acks the
timer interrupt, instead, it gets ack'ed and unmasked in
__ipipe_ack_timerirq, installed as an acknowledge function for the timer
IRQ in __ipipe_enable_pipeline.

-- 


Gilles Chanteperdrix.

___
Xenomai-core mailing list
Xenomai-core@gna.org
https://mail.gna.org/listinfo/xenomai-core


Re: [Xenomai-core] Xenomai on PXA255

2006-05-29 Thread Stelian Pop
Le lundi 29 mai 2006 à 17:45 +0200, Gilles Chanteperdrix a écrit :
 Stelian Pop wrote:
   If you have specific questions feel free to ask. But I suggest you read
   and try to understand the code first.
 
 Maybe we could provide a quick overview of how this works, Stelian,
 please correct me if I am wrong. 

Your description is accurate. However, such deep knowledge on the inner
workings should not be needed to port Xenomai to a new ARM platform.
(well, in case it works immediately. Debugging the port could need more
knowledge :) ).

In the list of 'undocumented' functions there is also
__ipipe_mach_get_tsc() which should return some accurate time
information. Most of the ARM platforms do not have a special Time Stamp
Clock register, so most of the time the tick count is used instead
(giving a TSC resolution of one microsecond). This is what standard
Linux also use.

If the platform has something more appropriate than the core timer for
measuring the time, this function is where you need to wire it.

Stelian.
-- 
Stelian Pop [EMAIL PROTECTED]
Open Wide


___
Xenomai-core mailing list
Xenomai-core@gna.org
https://mail.gna.org/listinfo/xenomai-core