All of lore.kernel.org
 help / color / mirror / Atom feed
* [Adeos-main] Porting to Intel IXP425
@ 2007-03-30 10:20 Richard Cochran
  2007-03-30 11:35 ` Sebastian Smolorz
  0 siblings, 1 reply; 12+ messages in thread
From: Richard Cochran @ 2007-03-30 10:20 UTC (permalink / raw)
  To: adeos-main

I am porting to the IXP425 using adeos-ipipe-2.6.19-arm-1.6-04.patch.

Apart from the code itself, I guess that there is nothing written
about what the bits in mach-xxx must do. If I am wrong, please point
me in the right direction.

Looking at __ipipe_mach_irq_mux_p and __ipipe_mach_demux_irq:

The 'mux_p' seems to identify one of the IRQs, and this IRQ is special
in some way. The 'mux' here stands for 'multiplex', I guess. But what
exactly is the meaning of this macro?

The purpose of 'demux_irq' appears to be to check the interrupt
controller for all pending interrupts, and feed them back to the ipipe
via '__ipipe_handle_irq'. Is that right?

Thanks,
Richard


************************************************************************
***
Richard Cochran (Mr), Software Development
OMICRON electronics GmbH, Oberes Ried 1, A-6833 Klaus / Austria
Tel.: +43 5523 507 425, Fax.: +43 5523 507 7425
http://www.omicron.at/         mailto:richard.cochran@domain.hid
************************************************************************
***



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Adeos-main] Porting to Intel IXP425
  2007-03-30 10:20 [Adeos-main] Porting to Intel IXP425 Richard Cochran
@ 2007-03-30 11:35 ` Sebastian Smolorz
  2007-03-30 12:16   ` Gilles Chanteperdrix
  0 siblings, 1 reply; 12+ messages in thread
From: Sebastian Smolorz @ 2007-03-30 11:35 UTC (permalink / raw)
  To: Richard Cochran; +Cc: adeos-main

Richard Cochran wrote:
> Looking at __ipipe_mach_irq_mux_p and __ipipe_mach_demux_irq:
>
> The 'mux_p' seems to identify one of the IRQs, and this IRQ is special
> in some way. The 'mux' here stands for 'multiplex', I guess. But what
> exactly is the meaning of this macro?

It has to determine whether a given IRQ is cascaded and therefore must be 
specially serviced WRT acknowledging. The required acknowledging of 
IRQ-subchannels is done in __ipipe_mach_demux_irq together with the call of 
__ipipe_handle_irq() after having determined the correct IRQ number where 
necessary.

-- 
Sebastian


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Adeos-main] Porting to Intel IXP425
  2007-03-30 11:35 ` Sebastian Smolorz
@ 2007-03-30 12:16   ` Gilles Chanteperdrix
  2007-03-30 13:51     ` Richard Cochran
  0 siblings, 1 reply; 12+ messages in thread
From: Gilles Chanteperdrix @ 2007-03-30 12:16 UTC (permalink / raw)
  To: Sebastian Smolorz; +Cc: adeos-main, Richard Cochran

Sebastian Smolorz wrote:
> Richard Cochran wrote:
> 
>>Looking at __ipipe_mach_irq_mux_p and __ipipe_mach_demux_irq:
>>
>>The 'mux_p' seems to identify one of the IRQs, and this IRQ is special
>>in some way. The 'mux' here stands for 'multiplex', I guess. But what
>>exactly is the meaning of this macro?
> 
> 
> It has to determine whether a given IRQ is cascaded and therefore must be 
> specially serviced WRT acknowledging. The required acknowledging of 
> IRQ-subchannels is done in __ipipe_mach_demux_irq together with the call of 
> __ipipe_handle_irq() after having determined the correct IRQ number where 
> necessary.
> 

Right. And I think the IXP425 has no cascaded IRQ, so you can define
__ipipe_mach_irq_mux_p to 0, and do not have to implement
__ipipe_mach_demux_irq.

-- 
                                                 Gilles Chanteperdrix


^ permalink raw reply	[flat|nested] 12+ messages in thread

* RE: [Adeos-main] Porting to Intel IXP425
  2007-03-30 12:16   ` Gilles Chanteperdrix
@ 2007-03-30 13:51     ` Richard Cochran
  2007-03-30 14:05       ` Gilles Chanteperdrix
  0 siblings, 1 reply; 12+ messages in thread
From: Richard Cochran @ 2007-03-30 13:51 UTC (permalink / raw)
  To: adeos-main

> Right. And I think the IXP425 has no cascaded IRQ, so you can define
> __ipipe_mach_irq_mux_p to 0, and do not have to implement
> __ipipe_mach_demux_irq.

That was easy.

(The IXP425 has no cascaded interrupts.)

Now, about the rest, by reading the other arm ports, I learned the
following:

__ipipe_mach_get_dec()

Returns the periodic timer interval in HW ticks.

__ipipe_mach_set_dec()

Sets the periodic timer interval.

__ipipe_mach_get_tsc()

Returns the free flowing time stamp register as a 64 bit integer.

__ipipe_mach_acktimer()

Called by the timer ISR, clears the timer interrupt.

__ipipe_mach_release_timer()

Restores the timer interval to the value expected by Linux.


Did I get it right?

Thanks,
Richard


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Adeos-main] Porting to Intel IXP425
  2007-03-30 13:51     ` Richard Cochran
@ 2007-03-30 14:05       ` Gilles Chanteperdrix
  2007-03-30 14:33         ` Richard Cochran
  2007-03-30 14:55         ` [Adeos-main] " Philippe Gerum
  0 siblings, 2 replies; 12+ messages in thread
From: Gilles Chanteperdrix @ 2007-03-30 14:05 UTC (permalink / raw)
  To: Richard Cochran; +Cc: adeos-main

Richard Cochran wrote:
>>Right. And I think the IXP425 has no cascaded IRQ, so you can define
>>__ipipe_mach_irq_mux_p to 0, and do not have to implement
>>__ipipe_mach_demux_irq.
> 
> 
> That was easy.
> 
> (The IXP425 has no cascaded interrupts.)
> 
> Now, about the rest, by reading the other arm ports, I learned the
> following:
> 
> __ipipe_mach_get_dec()
> 
> Returns the periodic timer interval in HW ticks.
> 
> __ipipe_mach_set_dec()
> 
> Sets the periodic timer interval.

The timer is aperiodic (most of the time) when running Xenomai, so
__ipipe_mach_set_dec is called for each timer tick and programs the
timer hardware for the next tick.

> 
> __ipipe_mach_get_tsc()
> 
> Returns the free flowing time stamp register as a 64 bit integer.
> 
> __ipipe_mach_acktimer()
> 
> Called by the timer ISR, clears the timer interrupt.
> 
> __ipipe_mach_release_timer()
> 
> Restores the timer interval to the value expected by Linux.

__ipipe_mach_release_timer is called when Xenomai stops handling the
timer and let Linux handle it.


-- 
                                                 Gilles Chanteperdrix


^ permalink raw reply	[flat|nested] 12+ messages in thread

* RE: [Adeos-main] Porting to Intel IXP425
  2007-03-30 14:05       ` Gilles Chanteperdrix
@ 2007-03-30 14:33         ` Richard Cochran
  2007-03-30 14:41           ` Gilles Chanteperdrix
  2007-03-30 14:55         ` [Adeos-main] " Philippe Gerum
  1 sibling, 1 reply; 12+ messages in thread
From: Richard Cochran @ 2007-03-30 14:33 UTC (permalink / raw)
  To: Gilles Chanteperdrix; +Cc: adeos-main

> The timer is aperiodic (most of the time) when running Xenomai, so
> __ipipe_mach_set_dec is called for each timer tick and programs the
> timer hardware for the next tick.

Okay, so does that mean that I should implement a "one-shot" timer, or
are we talking about resetting the periodic timer once in a while?

(BTW, in one-shot mode, the IXP425 timer does not do what the Developers
Manual, part 252480-006, says that it does!)

> __ipipe_mach_release_timer is called when Xenomai stops handling the
> timer and let Linux handle it.

But why does Xenomai do this? When unloading the module?


Richard



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Adeos-main] Porting to Intel IXP425
  2007-03-30 14:33         ` Richard Cochran
@ 2007-03-30 14:41           ` Gilles Chanteperdrix
  2007-03-30 21:29             ` [Adeos-main] " Schlägl Manfred jun.
  0 siblings, 1 reply; 12+ messages in thread
From: Gilles Chanteperdrix @ 2007-03-30 14:41 UTC (permalink / raw)
  To: Richard Cochran; +Cc: adeos-main

Richard Cochran wrote:
>>The timer is aperiodic (most of the time) when running Xenomai, so
>>__ipipe_mach_set_dec is called for each timer tick and programs the
>>timer hardware for the next tick.
> 
> 
> Okay, so does that mean that I should implement a "one-shot" timer, or
> are we talking about resetting the periodic timer once in a while?
> 
> (BTW, in one-shot mode, the IXP425 timer does not do what the Developers
> Manual, part 252480-006, says that it does!)

Yes, the one shot mode is Xenomai default mode. The implementation of a
periodic timer over the one-shot timer is already done by the generic
ARM part of the Adeos patch.

> 
> 
>>__ipipe_mach_release_timer is called when Xenomai stops handling the
>>timer and let Linux handle it.
> 
> 
> But why does Xenomai do this? When unloading the module?

Yes, exactly.

-- 
                                                 Gilles Chanteperdrix


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Adeos-main] Porting to Intel IXP425
  2007-03-30 14:05       ` Gilles Chanteperdrix
  2007-03-30 14:33         ` Richard Cochran
@ 2007-03-30 14:55         ` Philippe Gerum
  2007-03-30 16:07           ` Richard Cochran
  1 sibling, 1 reply; 12+ messages in thread
From: Philippe Gerum @ 2007-03-30 14:55 UTC (permalink / raw)
  To: Gilles Chanteperdrix; +Cc: adeos-main, Richard Cochran

On Fri, 2007-03-30 at 16:05 +0200, Gilles Chanteperdrix wrote:
> Richard Cochran wrote:
> >>Right. And I think the IXP425 has no cascaded IRQ, so you can define
> >>__ipipe_mach_irq_mux_p to 0, and do not have to implement
> >>__ipipe_mach_demux_irq.
> > 
> > 
> > That was easy.
> > 
> > (The IXP425 has no cascaded interrupts.)
> > 
> > Now, about the rest, by reading the other arm ports, I learned the
> > following:
> > 
> > __ipipe_mach_get_dec()
> > 
> > Returns the periodic timer interval in HW ticks.
> > 
> > __ipipe_mach_set_dec()
> > 
> > Sets the periodic timer interval.
> 
> The timer is aperiodic (most of the time) when running Xenomai,

Moreover, Xenomai 2.4 (i.e. our current development trunk/) will always
drive the timer chip in oneshot mode. Periodic mode is emulated over
aperiodic ticks there.

>  so
> __ipipe_mach_set_dec is called for each timer tick and programs the
> timer hardware for the next tick.
> 
> > 
> > __ipipe_mach_get_tsc()
> > 
> > Returns the free flowing time stamp register as a 64 bit integer.
> > 
> > __ipipe_mach_acktimer()
> > 
> > Called by the timer ISR, clears the timer interrupt.
> > 
> > __ipipe_mach_release_timer()
> > 
> > Restores the timer interval to the value expected by Linux.
> 
> __ipipe_mach_release_timer is called when Xenomai stops handling the
> timer and let Linux handle it.
> 
> 
-- 
Philippe.




^ permalink raw reply	[flat|nested] 12+ messages in thread

* RE: [Adeos-main] Porting to Intel IXP425
  2007-03-30 14:55         ` [Adeos-main] " Philippe Gerum
@ 2007-03-30 16:07           ` Richard Cochran
  2007-03-30 17:16             ` Gilles Chanteperdrix
  0 siblings, 1 reply; 12+ messages in thread
From: Richard Cochran @ 2007-03-30 16:07 UTC (permalink / raw)
  To: adeos-main


Just to be clear, does __ipipe_mach_get_dec() return the _dialed_
number of ticks, or the _remaining_ number of ticks?

Thanks again,
Richard


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Adeos-main] Porting to Intel IXP425
  2007-03-30 16:07           ` Richard Cochran
@ 2007-03-30 17:16             ` Gilles Chanteperdrix
  0 siblings, 0 replies; 12+ messages in thread
From: Gilles Chanteperdrix @ 2007-03-30 17:16 UTC (permalink / raw)
  To: Richard Cochran; +Cc: adeos-main

Richard Cochran wrote:
> Just to be clear, does __ipipe_mach_get_dec() return the _dialed_
> number of ticks, or the _remaining_ number of ticks?

__ipipe_mach_get_dec() is supposed to return the number of remaining ticks.

-- 
                                                 Gilles Chanteperdrix


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Adeos-main] Re: Porting to Intel IXP425
  2007-03-30 14:41           ` Gilles Chanteperdrix
@ 2007-03-30 21:29             ` Schlägl Manfred jun.
  2007-03-31 10:33               ` Gilles Chanteperdrix
  0 siblings, 1 reply; 12+ messages in thread
From: Schlägl Manfred jun. @ 2007-03-30 21:29 UTC (permalink / raw)
  To: adeos-main

[-- Attachment #1: Type: text/plain, Size: 1354 bytes --]

Am Freitag, den 30.03.2007, 16:41 +0200 schrieb Gilles Chanteperdrix:
> Richard Cochran wrote:
> >>The timer is aperiodic (most of the time) when running Xenomai, so
> >>__ipipe_mach_set_dec is called for each timer tick and programs the
> >>timer hardware for the next tick.
> > 
> > 
> > Okay, so does that mean that I should implement a "one-shot" timer, or
> > are we talking about resetting the periodic timer once in a while?
> > 
> > (BTW, in one-shot mode, the IXP425 timer does not do what the Developers
> > Manual, part 252480-006, says that it does!)
> 
> Yes, the one shot mode is Xenomai default mode. The implementation of a
> periodic timer over the one-shot timer is already done by the generic
> ARM part of the Adeos patch.

It's better to use a periodic implementation in background, because then
you are able to messure the lost ticks between a timer-interrupt and
programming next timer-event.

Example with 16bit timer:
 * Periode: 27000 Ticks 
 * Timer counts down to zero (Interrupt) & wrap around to 2^16-1 
 * Reprogramm Timer with new Periode (lost-ticks = 2^16 - timerval)

These lost-ticks should be added to the global time-stamp (returned by
get_tsc) and should mentioned at the linux-gettimeoffset-function also.


Lost-ticks could sum up to a bothering time-error.

- Manfred Schlaegl


[-- Attachment #2: Dies ist ein digital signierter Nachrichtenteil --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Adeos-main] Re: Porting to Intel IXP425
  2007-03-30 21:29             ` [Adeos-main] " Schlägl Manfred jun.
@ 2007-03-31 10:33               ` Gilles Chanteperdrix
  0 siblings, 0 replies; 12+ messages in thread
From: Gilles Chanteperdrix @ 2007-03-31 10:33 UTC (permalink / raw)
  To: Schlägl Manfred jun.; +Cc: adeos-main

Schlägl "Manfred jun." wrote:
 > Am Freitag, den 30.03.2007, 16:41 +0200 schrieb Gilles Chanteperdrix:
 > > Richard Cochran wrote:
 > > >>The timer is aperiodic (most of the time) when running Xenomai, so
 > > >>__ipipe_mach_set_dec is called for each timer tick and programs the
 > > >>timer hardware for the next tick.
 > > > 
 > > > 
 > > > Okay, so does that mean that I should implement a "one-shot" timer, or
 > > > are we talking about resetting the periodic timer once in a while?
 > > > 
 > > > (BTW, in one-shot mode, the IXP425 timer does not do what the Developers
 > > > Manual, part 252480-006, says that it does!)
 > > 
 > > Yes, the one shot mode is Xenomai default mode. The implementation of a
 > > periodic timer over the one-shot timer is already done by the generic
 > > ARM part of the Adeos patch.
 > 
 > It's better to use a periodic implementation in background, because then
 > you are able to messure the lost ticks between a timer-interrupt and
 > programming next timer-event.
 > 
 > Example with 16bit timer:
 >  * Periode: 27000 Ticks 
 >  * Timer counts down to zero (Interrupt) & wrap around to 2^16-1 
 >  * Reprogramm Timer with new Periode (lost-ticks = 2^16 - timerval)
 > 
 > These lost-ticks should be added to the global time-stamp (returned by
 > get_tsc) and should mentioned at the linux-gettimeoffset-function also.
 > 
 > 
 > Lost-ticks could sum up to a bothering time-error.

This is needed for machines where the hardware timer is based on a
decrementer. But for machines with a free-running counter and a match
register, reading the value of the free-running counter is
simpler. IXP425 is in the  "free-running counter and match register
category". So, its implementation should look like the one of the PXA.

-- 


					    Gilles Chanteperdrix.


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2007-03-31 10:33 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-30 10:20 [Adeos-main] Porting to Intel IXP425 Richard Cochran
2007-03-30 11:35 ` Sebastian Smolorz
2007-03-30 12:16   ` Gilles Chanteperdrix
2007-03-30 13:51     ` Richard Cochran
2007-03-30 14:05       ` Gilles Chanteperdrix
2007-03-30 14:33         ` Richard Cochran
2007-03-30 14:41           ` Gilles Chanteperdrix
2007-03-30 21:29             ` [Adeos-main] " Schlägl Manfred jun.
2007-03-31 10:33               ` Gilles Chanteperdrix
2007-03-30 14:55         ` [Adeos-main] " Philippe Gerum
2007-03-30 16:07           ` Richard Cochran
2007-03-30 17:16             ` Gilles Chanteperdrix

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.