All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai-help] Virtual IRQ Numbers in powerpc?
@ 2009-10-24 17:05 A. Nolson
  2009-10-24 17:37 ` Philippe Gerum
  2009-10-24 22:13 ` [Xenomai-help] Virtual IRQ Numbers in powerpc? Philippe Gerum
  0 siblings, 2 replies; 9+ messages in thread
From: A. Nolson @ 2009-10-24 17:05 UTC (permalink / raw)
  To: xenomai

Hi,

 i have a PowerPC 405 based system using a 2.6.30 Xenomai patched kernel
and I want to manage some interrupts in userspace for some non-critical
custom drivers. I have an OF device-tree where I indicate my HW
interrupts (the ones I need to use are not shared with any already
managed interrupt in the kernel). I have been trying to initialize an
interrupt handler in userspace with rt_intr_create by using the real
interrupt numbers indicated in the dts . The handler gets loaded but no
interrupt shows up. I have seen that rt_intr_create indicates that the
irq number is "architecture dependant", but I haven't been able to spot
further explanations on this. I know that arch=powerpc use virtual
interrupts and I am wondering if I first need to map the real interrupt
in a virtual interrupt number before using it( like one would do in a
normal linux kernel driver ).

I am doing this:

    if( (err = rt_intr_create(&(dev->intr_desc), "GPIO IRQ", irqno,
I_NOAUTOENA)) < 0 ){
        pdbg(DBG_WARN, "Cannot create interrupt for GPIO
rt_intr_create=%i\n", err);
        return err;
    }
       
    rt_intr_enable (&(dev->intr_desc));

    if( (err = rt_task_spawn(&(dev->interrupt_task), "Int", 0, irq_prio,
0,fisr, (void*)&(dev->intr_desc))) < 0){
        pdbg(DBG_WARN, "Cannot Spawn ISR for GPIO. err = %d\n", err);
        return err;
    }

 What am I missing?

Thanks!

 /Alfred


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

* Re: [Xenomai-help] Virtual IRQ Numbers in powerpc?
  2009-10-24 17:05 [Xenomai-help] Virtual IRQ Numbers in powerpc? A. Nolson
@ 2009-10-24 17:37 ` Philippe Gerum
  2009-10-24 18:42   ` A. Nolson
  2009-10-24 22:13 ` [Xenomai-help] Virtual IRQ Numbers in powerpc? Philippe Gerum
  1 sibling, 1 reply; 9+ messages in thread
From: Philippe Gerum @ 2009-10-24 17:37 UTC (permalink / raw)
  To: A. Nolson; +Cc: xenomai

On Sat, 2009-10-24 at 19:05 +0200, A. Nolson wrote:
> Hi,
> 
>  i have a PowerPC 405 based system using a 2.6.30 Xenomai patched kernel
> and I want to manage some interrupts in userspace for some non-critical
> custom drivers. I have an OF device-tree where I indicate my HW
> interrupts (the ones I need to use are not shared with any already
> managed interrupt in the kernel). I have been trying to initialize an
> interrupt handler in userspace with rt_intr_create by using the real
> interrupt numbers indicated in the dts . The handler gets loaded but no
> interrupt shows up. I have seen that rt_intr_create indicates that the
> irq number is "architecture dependant", but I haven't been able to spot
> further explanations on this. I know that arch=powerpc use virtual
> interrupts and I am wondering if I first need to map the real interrupt
> in a virtual interrupt number before using it( like one would do in a
> normal linux kernel driver ).

Yes, Xenomai/ppc uses virtual interrupt mappings (which are NOT related
at all with virtual I-pipe interrupts though). You should always use the
same IRQ numbers as the vanilla kernel exposes to its drivers, this is a
rule of thumb with all archs Xenomai supports.

To sum up, you should replace the real (OF) hw IRQ number in the call to
rt_intr_create() by its remapped counterpart.

> 
> I am doing this:
> 
>     if( (err = rt_intr_create(&(dev->intr_desc), "GPIO IRQ", irqno,
> I_NOAUTOENA)) < 0 ){
>         pdbg(DBG_WARN, "Cannot create interrupt for GPIO
> rt_intr_create=%i\n", err);
>         return err;
>     }
>        
>     rt_intr_enable (&(dev->intr_desc));
> 
>     if( (err = rt_task_spawn(&(dev->interrupt_task), "Int", 0, irq_prio,
> 0,fisr, (void*)&(dev->intr_desc))) < 0){
>         pdbg(DBG_WARN, "Cannot Spawn ISR for GPIO. err = %d\n", err);
>         return err;
>     }
> 
>  What am I missing?
> 
> Thanks!
> 
>  /Alfred
> 
> _______________________________________________
> Xenomai-help mailing list
> Xenomai-help@domain.hid
> https://mail.gna.org/listinfo/xenomai-help
-- 
Philippe.




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

* Re: [Xenomai-help] Virtual IRQ Numbers in powerpc?
  2009-10-24 17:37 ` Philippe Gerum
@ 2009-10-24 18:42   ` A. Nolson
  2009-10-24 22:07     ` Philippe Gerum
  0 siblings, 1 reply; 9+ messages in thread
From: A. Nolson @ 2009-10-24 18:42 UTC (permalink / raw)
  To: Philippe Gerum; +Cc: xenomai

Philippe Gerum wrote:
> On Sat, 2009-10-24 at 19:05 +0200, A. Nolson wrote:
>   
>> Hi,
>>
>>  i have a PowerPC 405 based system using a 2.6.30 Xenomai patched kernel
>> and I want to manage some interrupts in userspace for some non-critical
>> custom drivers. I have an OF device-tree where I indicate my HW
>> interrupts (the ones I need to use are not shared with any already
>> managed interrupt in the kernel). I have been trying to initialize an
>> interrupt handler in userspace with rt_intr_create by using the real
>> interrupt numbers indicated in the dts . The handler gets loaded but no
>> interrupt shows up. I have seen that rt_intr_create indicates that the
>> irq number is "architecture dependant", but I haven't been able to spot
>> further explanations on this. I know that arch=powerpc use virtual
>> interrupts and I am wondering if I first need to map the real interrupt
>> in a virtual interrupt number before using it( like one would do in a
>> normal linux kernel driver ).
>>     
>
> Yes, Xenomai/ppc uses virtual interrupt mappings (which are NOT related
> at all with virtual I-pipe interrupts though). You should always use the
> same IRQ numbers as the vanilla kernel exposes to its drivers, this is a
> rule of thumb with all archs Xenomai supports.
>
> To sum up, you should replace the real (OF) hw IRQ number in the call to
> rt_intr_create() by its remapped counterpart.
>   
Thanks a lot for the info Phillippe. Now the question(maybe obvious)
would be, how do I remap the interrupts outside the kernel? I remember
doing this in a kernel driver, but never in userspace that is where I
need to develop now with Xenomai.
>   
>> I am doing this:
>>
>>     if( (err = rt_intr_create(&(dev->intr_desc), "GPIO IRQ", irqno,
>> I_NOAUTOENA)) < 0 ){
>>         pdbg(DBG_WARN, "Cannot create interrupt for GPIO
>> rt_intr_create=%i\n", err);
>>         return err;
>>     }
>>        
>>     rt_intr_enable (&(dev->intr_desc));
>>
>>     if( (err = rt_task_spawn(&(dev->interrupt_task), "Int", 0, irq_prio,
>> 0,fisr, (void*)&(dev->intr_desc))) < 0){
>>         pdbg(DBG_WARN, "Cannot Spawn ISR for GPIO. err = %d\n", err);
>>         return err;
>>     }
>>
>>  What am I missing?
>>
>> Thanks!
>>
>>  /Alfred
>>
>> _______________________________________________
>> Xenomai-help mailing list
>> Xenomai-help@domain.hid
>> https://mail.gna.org/listinfo/xenomai-help
>>     



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

* Re: [Xenomai-help] Virtual IRQ Numbers in powerpc?
  2009-10-24 18:42   ` A. Nolson
@ 2009-10-24 22:07     ` Philippe Gerum
  2009-10-26 15:18       ` [Xenomai-help] Supported Architecture? Matthias Frauendorf
  0 siblings, 1 reply; 9+ messages in thread
From: Philippe Gerum @ 2009-10-24 22:07 UTC (permalink / raw)
  To: A. Nolson; +Cc: xenomai

On Sat, 2009-10-24 at 20:42 +0200, A. Nolson wrote:
> Philippe Gerum wrote:
> > On Sat, 2009-10-24 at 19:05 +0200, A. Nolson wrote:
> >   
> >> Hi,
> >>
> >>  i have a PowerPC 405 based system using a 2.6.30 Xenomai patched kernel
> >> and I want to manage some interrupts in userspace for some non-critical
> >> custom drivers. I have an OF device-tree where I indicate my HW
> >> interrupts (the ones I need to use are not shared with any already
> >> managed interrupt in the kernel). I have been trying to initialize an
> >> interrupt handler in userspace with rt_intr_create by using the real
> >> interrupt numbers indicated in the dts . The handler gets loaded but no
> >> interrupt shows up. I have seen that rt_intr_create indicates that the
> >> irq number is "architecture dependant", but I haven't been able to spot
> >> further explanations on this. I know that arch=powerpc use virtual
> >> interrupts and I am wondering if I first need to map the real interrupt
> >> in a virtual interrupt number before using it( like one would do in a
> >> normal linux kernel driver ).
> >>     
> >
> > Yes, Xenomai/ppc uses virtual interrupt mappings (which are NOT related
> > at all with virtual I-pipe interrupts though). You should always use the
> > same IRQ numbers as the vanilla kernel exposes to its drivers, this is a
> > rule of thumb with all archs Xenomai supports.
> >
> > To sum up, you should replace the real (OF) hw IRQ number in the call to
> > rt_intr_create() by its remapped counterpart.
> >   
> Thanks a lot for the info Phillippe. Now the question(maybe obvious)
> would be, how do I remap the interrupts outside the kernel? I remember
> doing this in a kernel driver, but never in userspace that is where I
> need to develop now with Xenomai.

You will still need a piece of kernel code to do that; Xenomai does not
provide any userland interface for this purpose.

Maybe you could just declare your custom devices in your dts file, with
the appropriate "interrupts" properties, so that they get virtualized
during the prom parsing stage, then mapped to the UIC they belong to?

> >   
> >> I am doing this:
> >>
> >>     if( (err = rt_intr_create(&(dev->intr_desc), "GPIO IRQ", irqno,
> >> I_NOAUTOENA)) < 0 ){
> >>         pdbg(DBG_WARN, "Cannot create interrupt for GPIO
> >> rt_intr_create=%i\n", err);
> >>         return err;
> >>     }
> >>        
> >>     rt_intr_enable (&(dev->intr_desc));
> >>
> >>     if( (err = rt_task_spawn(&(dev->interrupt_task), "Int", 0, irq_prio,
> >> 0,fisr, (void*)&(dev->intr_desc))) < 0){
> >>         pdbg(DBG_WARN, "Cannot Spawn ISR for GPIO. err = %d\n", err);
> >>         return err;
> >>     }
> >>
> >>  What am I missing?
> >>
> >> Thanks!
> >>
> >>  /Alfred
> >>
> >> _______________________________________________
> >> Xenomai-help mailing list
> >> Xenomai-help@domain.hid
> >> https://mail.gna.org/listinfo/xenomai-help
> >>     
> 
-- 
Philippe.




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

* Re: [Xenomai-help] Virtual IRQ Numbers in powerpc?
  2009-10-24 17:05 [Xenomai-help] Virtual IRQ Numbers in powerpc? A. Nolson
  2009-10-24 17:37 ` Philippe Gerum
@ 2009-10-24 22:13 ` Philippe Gerum
  2009-11-02  9:54   ` Richard Cochran
  1 sibling, 1 reply; 9+ messages in thread
From: Philippe Gerum @ 2009-10-24 22:13 UTC (permalink / raw)
  To: A. Nolson; +Cc: xenomai

On Sat, 2009-10-24 at 19:05 +0200, A. Nolson wrote:
> Hi,
> 
>  i have a PowerPC 405 based system using a 2.6.30 Xenomai patched kernel

Btw,

adeos-ipipe-2.6.30-powerpc-DENX-2.7-00:   fine
adeos-ipipe-2.6.30.3-powerpc-DENX-2.7-01: BROKEN
adeos-ipipe-2.6.30.3-powerpc-DENX-2.7-02: fine

> and I want to manage some interrupts in userspace for some non-critical
> custom drivers. I have an OF device-tree where I indicate my HW
> interrupts (the ones I need to use are not shared with any already
> managed interrupt in the kernel). I have been trying to initialize an
> interrupt handler in userspace with rt_intr_create by using the real
> interrupt numbers indicated in the dts . The handler gets loaded but no
> interrupt shows up. I have seen that rt_intr_create indicates that the
> irq number is "architecture dependant", but I haven't been able to spot
> further explanations on this. I know that arch=powerpc use virtual
> interrupts and I am wondering if I first need to map the real interrupt
> in a virtual interrupt number before using it( like one would do in a
> normal linux kernel driver ).
> 
> I am doing this:
> 
>     if( (err = rt_intr_create(&(dev->intr_desc), "GPIO IRQ", irqno,
> I_NOAUTOENA)) < 0 ){
>         pdbg(DBG_WARN, "Cannot create interrupt for GPIO
> rt_intr_create=%i\n", err);
>         return err;
>     }
>        
>     rt_intr_enable (&(dev->intr_desc));
> 
>     if( (err = rt_task_spawn(&(dev->interrupt_task), "Int", 0, irq_prio,
> 0,fisr, (void*)&(dev->intr_desc))) < 0){
>         pdbg(DBG_WARN, "Cannot Spawn ISR for GPIO. err = %d\n", err);
>         return err;
>     }
> 
>  What am I missing?
> 
> Thanks!
> 
>  /Alfred
> 
> _______________________________________________
> Xenomai-help mailing list
> Xenomai-help@domain.hid
> https://mail.gna.org/listinfo/xenomai-help
-- 
Philippe.




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

* [Xenomai-help]  Supported Architecture?
  2009-10-24 22:07     ` Philippe Gerum
@ 2009-10-26 15:18       ` Matthias Frauendorf
  2009-10-26 19:43         ` Pierre Ficheux
  0 siblings, 1 reply; 9+ messages in thread
From: Matthias Frauendorf @ 2009-10-26 15:18 UTC (permalink / raw)
  To: Xenomai-help

Hello,

does anybody know if xenomai is working with the following architecture:

Intel PC-Mainboard D945GSEJT
with integrated Intel Atom Processor N270
in Mini-ITX Configuration

http://www.intel.com/cd/products/services/emea/deu/motherboards/desktop/d945gsejt/overview/416876.htm

Thank you!

Kind Regards,
Matthias Frauendorf









 
-- 
GRATIS für alle GMX-Mitglieder: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome01


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

* Re: [Xenomai-help] Supported Architecture?
  2009-10-26 15:18       ` [Xenomai-help] Supported Architecture? Matthias Frauendorf
@ 2009-10-26 19:43         ` Pierre Ficheux
  0 siblings, 0 replies; 9+ messages in thread
From: Pierre Ficheux @ 2009-10-26 19:43 UTC (permalink / raw)
  To: Matthias Frauendorf; +Cc: Xenomai-help

Matthias Frauendorf a écrit :
> Hello,
> 
> does anybody know if xenomai is working with the following architecture:
> 
> Intel PC-Mainboard D945GSEJT
> with integrated Intel Atom Processor N270
> in Mini-ITX Configuration
> 
> http://www.intel.com/cd/products/services/emea/deu/motherboards/desktop/d945gsejt/overview/416876.htm
> 
> Thank you!
> 
> Kind Regards,
> Matthias Frauendorf
> 
>

Should work fine. I currently use Xenomai on my NetPC with Atom N270.


-- 
Pierre FICHEUX -/- CTO OW/OS4I, France -\- pierre.ficheux@domain.hid
                                         http://www.os4i.com
                                         http://www.ficheux.org
I would love to change the world, but they won't give me the source code




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

* Re: [Xenomai-help] Virtual IRQ Numbers in powerpc?
  2009-10-24 22:13 ` [Xenomai-help] Virtual IRQ Numbers in powerpc? Philippe Gerum
@ 2009-11-02  9:54   ` Richard Cochran
  2009-11-02 20:00     ` Philippe Gerum
  0 siblings, 1 reply; 9+ messages in thread
From: Richard Cochran @ 2009-11-02  9:54 UTC (permalink / raw)
  To: Philippe Gerum; +Cc: xenomai

On Sun, Oct 25, 2009 at 12:13:45AM +0200, Philippe Gerum wrote:
> 
> adeos-ipipe-2.6.30-powerpc-DENX-2.7-00:   fine
> adeos-ipipe-2.6.30.3-powerpc-DENX-2.7-01: BROKEN
> adeos-ipipe-2.6.30.3-powerpc-DENX-2.7-02: fine

I am using git to track ipipe, but these two commits

  da0e45d1e84389bdf5e750e9179767fd274f7031
  9010961a407699a3908d7c2a842a8ece6084cee3

don't show up when I pull from

  git://git.denx.de/ipipe-2.6.git

I think that is because the commit are not in any branch. I think they
should be in branch ipipe-2.6.30-powerpc.

See this:

  http://git.denx.de/?p=ipipe-2.6.git;a=shortlog;h=9010961a407699a3908d7c2a842a8ece6084cee3

Richard





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

* Re: [Xenomai-help] Virtual IRQ Numbers in powerpc?
  2009-11-02  9:54   ` Richard Cochran
@ 2009-11-02 20:00     ` Philippe Gerum
  0 siblings, 0 replies; 9+ messages in thread
From: Philippe Gerum @ 2009-11-02 20:00 UTC (permalink / raw)
  To: Richard Cochran; +Cc: xenomai

On Mon, 2009-11-02 at 10:54 +0100, Richard Cochran wrote:
> On Sun, Oct 25, 2009 at 12:13:45AM +0200, Philippe Gerum wrote:
> > 
> > adeos-ipipe-2.6.30-powerpc-DENX-2.7-00:   fine
> > adeos-ipipe-2.6.30.3-powerpc-DENX-2.7-01: BROKEN
> > adeos-ipipe-2.6.30.3-powerpc-DENX-2.7-02: fine
> 
> I am using git to track ipipe, but these two commits
> 
>   da0e45d1e84389bdf5e750e9179767fd274f7031
>   9010961a407699a3908d7c2a842a8ece6084cee3
> 
> don't show up when I pull from
> 
>   git://git.denx.de/ipipe-2.6.git
> 
> I think that is because the commit are not in any branch. I think they
> should be in branch ipipe-2.6.30-powerpc.
> 
> See this:
> 
>   http://git.denx.de/?p=ipipe-2.6.git;a=shortlog;h=9010961a407699a3908d7c2a842a8ece6084cee3

Those commits seem to still be in flight from my remote staging tree to
the public one, waiting for a mirroring to happen. They are indeed part
of ipipe-2.6.30-powerpc; those are actually the latest commits on top of
2.7-01, leading to 2.7-02.

> 
> Richard
> 
> 
> 


-- 
Philippe.




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

end of thread, other threads:[~2009-11-02 20:00 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-24 17:05 [Xenomai-help] Virtual IRQ Numbers in powerpc? A. Nolson
2009-10-24 17:37 ` Philippe Gerum
2009-10-24 18:42   ` A. Nolson
2009-10-24 22:07     ` Philippe Gerum
2009-10-26 15:18       ` [Xenomai-help] Supported Architecture? Matthias Frauendorf
2009-10-26 19:43         ` Pierre Ficheux
2009-10-24 22:13 ` [Xenomai-help] Virtual IRQ Numbers in powerpc? Philippe Gerum
2009-11-02  9:54   ` Richard Cochran
2009-11-02 20:00     ` Philippe Gerum

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.