All of lore.kernel.org
 help / color / mirror / Atom feed
* RE: [Adeos-main] Re: Re: Porting to Intel IXP425
       [not found] <899865CA54E4444DAF2E3639C04C5F4805EC65@domain.hid>
@ 2007-04-02 12:01 ` Schlägl Manfred jun.
  2007-04-02 12:23   ` Gilles Chanteperdrix
  0 siblings, 1 reply; 6+ messages in thread
From: Schlägl Manfred jun. @ 2007-04-02 12:01 UTC (permalink / raw)
  To: adeos-main

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

Am Montag, den 02.04.2007, 13:34 +0200 schrieb Richard Cochran:
> > Then you have to implement it like I described. 
> > 
> > Take a look at the implementation for integrator-platforms.
> > (Timer with wraparound)
> 
> Well, as I said, the IXP425 one-shot timer mode does _not_ wrap around.
> It just stops.

> I'm not sure how (or why) to account for the clock ticks that transpire
> during the interrupt handler.
> 
> There are no clock ticks lost in __ipipe_mach_get_tsc, since this gets the
> value of a free-flowing timer.
> 
> Previously you wrote,
> 
> > These lost-ticks should be added to the global time-stamp (returned by
> > get_tsc) and should mentioned at the linux-gettimeoffset-function also.
> 
> Can you be more specific? What is the "linux-gettimeoffset-function" of
> which you speak?

Linux gettimeoffset calls a march-specific function
(ixp4xx_gettimeoffset) which delivers the time in us since the last
timer-tick (timer-interrupt).

> > Lost-ticks could sum up to a bothering time-error.
> 
> But in the plain-old Linux code, no such adjustment is made (using a
> periodic timer, see below).

In this implementation a time-stamp register is used. Excuse me, I
misunderstood your mail before...
Forget what i said. It's quite simpler to use such a timer for adeos. 
Gilles Chanteperdrix is right.

> 
> Does the Linux IXP4xx timer code have a bug?
> 
> Richard
> 
> 
> linux-2.6.19/arch/arm/mach-ixp4xx/common.c, from line 223:
> 
> /*************************************************************************
>  * IXP4xx timer tick
>  * We use OS timer1 on the CPU for the timer tick and the timestamp 
>  * counter as a source of real clock ticks to account for missed jiffies.
>  *************************************************************************/
> 
> static unsigned volatile last_jiffy_time;
> 
> #define CLOCK_TICKS_PER_USEC	((CLOCK_TICK_RATE + USEC_PER_SEC/2) / USEC_PER_SEC)
> 
> static irqreturn_t ixp4xx_timer_interrupt(int irq, void *dev_id)
> {
> 	write_seqlock(&xtime_lock);
> 
> 	/* Clear Pending Interrupt by writing '1' to it */
> 	*IXP4XX_OSST = IXP4XX_OSST_TIMER_1_PEND;
> 
> 	/*
> 	 * Catch up with the real idea of time
> 	 */
> 	while ((signed long)(*IXP4XX_OSTS - last_jiffy_time) >= LATCH) {
> 		timer_tick();
> 		last_jiffy_time += LATCH;
> 	}
> 
> 	write_sequnlock(&xtime_lock);
> 
> 	return IRQ_HANDLED;
> }
> 
> static struct irqaction ixp4xx_timer_irq = {
> 	.name		= "IXP4xx Timer Tick",
> 	.flags		= IRQF_DISABLED | IRQF_TIMER,
> 	.handler	= ixp4xx_timer_interrupt,
> };
> 
> static void __init ixp4xx_timer_init(void)
> {
> 	/* Clear Pending Interrupt by writing '1' to it */
> 	*IXP4XX_OSST = IXP4XX_OSST_TIMER_1_PEND;
> 
> 	/* Setup the Timer counter value */
> 	*IXP4XX_OSRT1 = (LATCH & ~IXP4XX_OST_RELOAD_MASK) | IXP4XX_OST_ENABLE;
> 
> 	/* Reset time-stamp counter */
> 	*IXP4XX_OSTS = 0;
> 	last_jiffy_time = 0;
> 
> 	/* Connect the interrupt handler and enable the interrupt */
> 	setup_irq(IRQ_IXP4XX_TIMER1, &ixp4xx_timer_irq);
> }
> 
> > 
> > 
> > - Manfred Schlaegl
> > 

- Manfred Schlaegl

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

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

* Re: [Adeos-main] Re: Re: Porting to Intel IXP425
  2007-04-02 12:01 ` [Adeos-main] Re: Re: Porting to Intel IXP425 Schlägl Manfred jun.
@ 2007-04-02 12:23   ` Gilles Chanteperdrix
  0 siblings, 0 replies; 6+ messages in thread
From: Gilles Chanteperdrix @ 2007-04-02 12:23 UTC (permalink / raw)
  To: "Schlägl \"Manfred jun.\""; +Cc: adeos-main

Schlägl Manfred jun. wrote:
> Am Montag, den 02.04.2007, 13:34 +0200 schrieb Richard Cochran:
> 
>>>Then you have to implement it like I described. 
>>>
>>>Take a look at the implementation for integrator-platforms.
>>>(Timer with wraparound)
>>
>>Well, as I said, the IXP425 one-shot timer mode does _not_ wrap around.
>>It just stops.
> 
> 
>>I'm not sure how (or why) to account for the clock ticks that transpire
>>during the interrupt handler.
>>
>>There are no clock ticks lost in __ipipe_mach_get_tsc, since this gets the
>>value of a free-flowing timer.
>>
>>Previously you wrote,
>>
>>
>>>These lost-ticks should be added to the global time-stamp (returned by
>>>get_tsc) and should mentioned at the linux-gettimeoffset-function also.
>>
>>Can you be more specific? What is the "linux-gettimeoffset-function" of
>>which you speak?
> 
> 
> Linux gettimeoffset calls a march-specific function
> (ixp4xx_gettimeoffset) which delivers the time in us since the last
> timer-tick (timer-interrupt).
> 
> 
>>>Lost-ticks could sum up to a bothering time-error.
>>
>>But in the plain-old Linux code, no such adjustment is made (using a
>>periodic timer, see below).
> 
> 
> In this implementation a time-stamp register is used. Excuse me, I
> misunderstood your mail before...
> Forget what i said. It's quite simpler to use such a timer for adeos. 
> Gilles Chanteperdrix is right.

Actually, I was looking at the IXP465 datasheet which has a free-running
counter with match register. But if I understand correctly, the IXP425
has the same free running counter as IXP465 but no match register.

-- 
                                                 Gilles Chanteperdrix


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

* RE: [Adeos-main] Re: Re: Porting to Intel IXP425
  2007-04-03  9:58     ` Gilles Chanteperdrix
@ 2007-04-03 11:34       ` Richard Cochran
  0 siblings, 0 replies; 6+ messages in thread
From: Richard Cochran @ 2007-04-03 11:34 UTC (permalink / raw)
  To: adeos-main

> I have tried to put together on Xenomai wiki some ideas on porting
> the ARM I-pipe patch on a new platform. I have not explained the
> case of the integrator, in the hope that others who know better
> could modify the howto.
> 
> http://www.xenomai.org/index.php/I-pipe:ArmPorting

This looks good. I will add to this, or refine it, based on my
experience with the IXP425.

I now have Xenomai running on the IXP425. I will test this for a while
and then post a patch on this list. I still need to get a release from
"management", but I expect to get the okay. However, the gate keeper
is away for two weeks, so please be patient!

Many thanks to all,

Richard


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

* Re: [Adeos-main] Re: Re: Porting to Intel IXP425
  2007-04-02 10:56   ` Schlägl Manfred jun.
@ 2007-04-03  9:58     ` Gilles Chanteperdrix
  2007-04-03 11:34       ` Richard Cochran
  0 siblings, 1 reply; 6+ messages in thread
From: Gilles Chanteperdrix @ 2007-04-03  9:58 UTC (permalink / raw)
  To: "Schlägl \"Manfred jun.\""; +Cc: adeos-main

Schlägl Manfred jun. wrote:
> Am Montag, den 02.04.2007, 08:52 +0200 schrieb Richard Cochran:
> 
>>>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.
>>
>>The IXP425 does not have a match register, AFAICT.
>>
>>It does have four 32-bit counters clocked at 66.66 MHz: a watch dog, a
>>free-running timestamp, and two general purpose timers.
>>
>>The general purpose timers may be used either as one-shot timers
>>(count down to zero and stop) or as periodic times (count down,
>>automatically reload, and keep going).
>>
>>I already have xenomai running on the IXP425, but I will have to take
>>a closer look at the timer code.
>>
>>Richard
> 
> 
> Then you have to implement it like I described. 
> 
> Take a look at the implementation for integrator-platforms.
> (Timer with wraparound)

I have tried to put together on Xenomai wiki some ideas on porting the
ARM I-pipe patch on a new platform. I have not explained the case of the
integrator, in the hope that others who know better could modify the howto.

http://www.xenomai.org/index.php/I-pipe:ArmPorting

-- 
                                                 Gilles Chanteperdrix


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

* Re: [Adeos-main] Re: Re: Porting to Intel IXP425
  2007-04-02  6:52 ` Richard Cochran
@ 2007-04-02 10:56   ` Schlägl Manfred jun.
  2007-04-03  9:58     ` Gilles Chanteperdrix
  0 siblings, 1 reply; 6+ messages in thread
From: Schlägl Manfred jun. @ 2007-04-02 10:56 UTC (permalink / raw)
  To: adeos-main

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

Am Montag, den 02.04.2007, 08:52 +0200 schrieb Richard Cochran:
> > 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.
> 
> The IXP425 does not have a match register, AFAICT.
> 
> It does have four 32-bit counters clocked at 66.66 MHz: a watch dog, a
> free-running timestamp, and two general purpose timers.
> 
> The general purpose timers may be used either as one-shot timers
> (count down to zero and stop) or as periodic times (count down,
> automatically reload, and keep going).
> 
> I already have xenomai running on the IXP425, but I will have to take
> a closer look at the timer code.
> 
> Richard

Then you have to implement it like I described. 

Take a look at the implementation for integrator-platforms.
(Timer with wraparound)


- Manfred Schlaegl

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

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

* [Adeos-main] Re: Re: Porting to Intel IXP425
       [not found] <200704010957.l319viZD032109@domain.hid>
@ 2007-04-02  6:52 ` Richard Cochran
  2007-04-02 10:56   ` Schlägl Manfred jun.
  0 siblings, 1 reply; 6+ messages in thread
From: Richard Cochran @ 2007-04-02  6:52 UTC (permalink / raw)
  To: adeos-main

> 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.

The IXP425 does not have a match register, AFAICT.

It does have four 32-bit counters clocked at 66.66 MHz: a watch dog, a
free-running timestamp, and two general purpose timers.

The general purpose timers may be used either as one-shot timers
(count down to zero and stop) or as periodic times (count down,
automatically reload, and keep going).

I already have xenomai running on the IXP425, but I will have to take
a closer look at the timer code.

Richard


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

end of thread, other threads:[~2007-04-03 11:34 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <899865CA54E4444DAF2E3639C04C5F4805EC65@domain.hid>
2007-04-02 12:01 ` [Adeos-main] Re: Re: Porting to Intel IXP425 Schlägl Manfred jun.
2007-04-02 12:23   ` Gilles Chanteperdrix
     [not found] <200704010957.l319viZD032109@domain.hid>
2007-04-02  6:52 ` Richard Cochran
2007-04-02 10:56   ` Schlägl Manfred jun.
2007-04-03  9:58     ` Gilles Chanteperdrix
2007-04-03 11:34       ` Richard Cochran

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.