* [Xenomai-help] reading/writing registers
@ 2011-05-03 12:07 Aurele Traynard
2011-05-03 17:36 ` Gilles Chanteperdrix
0 siblings, 1 reply; 6+ messages in thread
From: Aurele Traynard @ 2011-05-03 12:07 UTC (permalink / raw)
To: Xenomai help
[-- Attachment #1: Type: text/plain, Size: 887 bytes --]
hello,
I am writing a little test. I put all my RT things in a module : one ISR and
one RT task.
in init_module I call :
drv->data.regs = ioremap(0x04000000, 64*1024*1024);
drv->data.gpio = ioremap(0x40E00000, 64*1024*1024);
this is to acces registers
rthal_irq_request(8, my_rt_isr, NULL, &(drv->data));
rthal_irq_enable(8);
for the ISR
in my interrupt routine I use : writel(1, data->gpio + 0x48); for hardware
interrupt acknowledge
but when my interrupt routine is called linux is freezing so i think that I
am never going out of the ISR (I am 99.9% sure).
I am not sure but I think that It is due to the hardware interrupt
aknoledge...
my question is :
can I call "writel(1, data->gpio + 0x48);" in my ISR?
is it good or not?
is there an other way to access registers?
thanks for your answers.
PS firstly I was calling : "GEDR0 = 0x1;" but in RT task this macro doesn't
work
[-- Attachment #2: Type: text/html, Size: 1019 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Xenomai-help] reading/writing registers
2011-05-03 12:07 [Xenomai-help] reading/writing registers Aurele Traynard
@ 2011-05-03 17:36 ` Gilles Chanteperdrix
2011-05-04 7:11 ` Aurele Traynard
0 siblings, 1 reply; 6+ messages in thread
From: Gilles Chanteperdrix @ 2011-05-03 17:36 UTC (permalink / raw)
To: Aurele Traynard; +Cc: Xenomai help
On 05/03/2011 02:07 PM, Aurele Traynard wrote:
> hello,
>
> I am writing a little test. I put all my RT things in a module : one ISR and
> one RT task.
> in init_module I call :
>
> drv->data.regs = ioremap(0x04000000, 64*1024*1024);
> drv->data.gpio = ioremap(0x40E00000, 64*1024*1024);
> this is to acces registers
>
> rthal_irq_request(8, my_rt_isr, NULL, &(drv->data));
> rthal_irq_enable(8);
> for the ISR
>
> in my interrupt routine I use : writel(1, data->gpio + 0x48); for hardware
> interrupt acknowledge
>
> but when my interrupt routine is called linux is freezing so i think that I
> am never going out of the ISR (I am 99.9% sure).
> I am not sure but I think that It is due to the hardware interrupt
> aknoledge...
>
> my question is :
> can I call "writel(1, data->gpio + 0x48);" in my ISR?
> is it good or not?
> is there an other way to access registers?
>
> thanks for your answers.
>
> PS firstly I was calling : "GEDR0 = 0x1;" but in RT task this macro doesn't
> work
Why is that? What are the symptoms?
Other than that, have a look at:
http://www.xenomai.org/index.php/Request_for_information
--
Gilles.
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [Xenomai-help] reading/writing registers
2011-05-03 17:36 ` Gilles Chanteperdrix
@ 2011-05-04 7:11 ` Aurele Traynard
2011-05-04 7:23 ` Gilles Chanteperdrix
0 siblings, 1 reply; 6+ messages in thread
From: Aurele Traynard @ 2011-05-04 7:11 UTC (permalink / raw)
To: Gilles Chanteperdrix; +Cc: Xenomai help
[-- Attachment #1: Type: text/plain, Size: 2104 bytes --]
Ok I will explain more things :
My software makes the system freezing, when my interrupt handler is called
for the first time I think that he is called again and again and again and
this never stops. And so this freeze the system
but I am not totaly sure.
I'm sure that it is not Xenomai's fault it is just mine. I think I don't use
Xenomai correctly...
That's why I am asking if "ioremap" "readl/writel" is the best way to
read/write CPU registers and if there are other ways.
CPU (XScale) : PXA270 520MHz, 256Mo RAM (100MHz)
gcc : from CodeSourcery
$ arm-none-linux-gnueabi-gcc --version
$ arm-none-linux-gnueabi-gcc (Sourcery G++ Lite 2010q1-202) 4.4.1
linux : 2.6.33.2
Xenomai 2.5.6
patch : ksrc/arch/arm/patches/adeos-ipipe-2.6.33-arm-1.18-02.patch
2011/5/3 Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
> On 05/03/2011 02:07 PM, Aurele Traynard wrote:
> > hello,
> >
> > I am writing a little test. I put all my RT things in a module : one ISR
> and
> > one RT task.
> > in init_module I call :
> >
> > drv->data.regs = ioremap(0x04000000, 64*1024*1024);
> > drv->data.gpio = ioremap(0x40E00000, 64*1024*1024);
> > this is to acces registers
> >
> > rthal_irq_request(8, my_rt_isr, NULL, &(drv->data));
> > rthal_irq_enable(8);
> > for the ISR
> >
> > in my interrupt routine I use : writel(1, data->gpio + 0x48); for
> hardware
> > interrupt acknowledge
> >
> > but when my interrupt routine is called linux is freezing so i think that
> I
> > am never going out of the ISR (I am 99.9% sure).
> > I am not sure but I think that It is due to the hardware interrupt
> > aknoledge...
> >
> > my question is :
> > can I call "writel(1, data->gpio + 0x48);" in my ISR?
> > is it good or not?
> > is there an other way to access registers?
> >
> > thanks for your answers.
> >
> > PS firstly I was calling : "GEDR0 = 0x1;" but in RT task this macro
> doesn't
> > work
>
> Why is that? What are the symptoms?
>
> Other than that, have a look at:
> http://www.xenomai.org/index.php/Request_for_information
>
> --
> Gilles.
>
[-- Attachment #2: Type: text/html, Size: 2847 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Xenomai-help] reading/writing registers
2011-05-04 7:11 ` Aurele Traynard
@ 2011-05-04 7:23 ` Gilles Chanteperdrix
2011-05-04 8:59 ` Aurele Traynard
0 siblings, 1 reply; 6+ messages in thread
From: Gilles Chanteperdrix @ 2011-05-04 7:23 UTC (permalink / raw)
To: Aurele Traynard; +Cc: Xenomai help
On 05/04/2011 09:11 AM, Aurele Traynard wrote:
> Ok I will explain more things :
> My software makes the system freezing, when my interrupt handler is called
> for the first time I think that he is called again and again and again and
> this never stops. And so this freeze the system
> but I am not totaly sure.
> I'm sure that it is not Xenomai's fault it is just mine. I think I don't use
> Xenomai correctly...
> That's why I am asking if "ioremap" "readl/writel" is the best way to
> read/write CPU registers and if there are other ways.
Yes they are. But if your aim is to acknowledge/mask the interrupt line
at the interrupt controller level, this should not be done in the
interrupt handler, it is supposed to be done in the irqchip callbacks
for the interrupt controller you use.
--
Gilles.
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [Xenomai-help] reading/writing registers
2011-05-04 7:23 ` Gilles Chanteperdrix
@ 2011-05-04 8:59 ` Aurele Traynard
2011-05-04 9:25 ` Gilles Chanteperdrix
0 siblings, 1 reply; 6+ messages in thread
From: Aurele Traynard @ 2011-05-04 8:59 UTC (permalink / raw)
To: Gilles Chanteperdrix; +Cc: Xenomai help
[-- Attachment #1: Type: text/plain, Size: 1224 bytes --]
2011/5/4 Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
> On 05/04/2011 09:11 AM, Aurele Traynard wrote:
> > Ok I will explain more things :
> > My software makes the system freezing, when my interrupt handler is
> called
> > for the first time I think that he is called again and again and again
> and
> > this never stops. And so this freeze the system
> > but I am not totaly sure.
> > I'm sure that it is not Xenomai's fault it is just mine. I think I don't
> use
> > Xenomai correctly...
> > That's why I am asking if "ioremap" "readl/writel" is the best way to
> > read/write CPU registers and if there are other ways.
>
> Yes they are. But if your aim is to acknowledge/mask the interrupt line
> at the interrupt controller level, this should not be done in the
> interrupt handler, it is supposed to be done in the irqchip callbacks
> for the interrupt controller you use.
>
> --
> Gilles.
>
Ok if i understood I should put acknowledge/mask in a callback, and this
callback should be the "rthal_irq_ackfn_t ackfn" argument (in
rthal_irq_request)?
But if I would like to read write any other register in my interrupt handler
how should I do?
[-- Attachment #2: Type: text/html, Size: 1648 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Xenomai-help] reading/writing registers
2011-05-04 8:59 ` Aurele Traynard
@ 2011-05-04 9:25 ` Gilles Chanteperdrix
0 siblings, 0 replies; 6+ messages in thread
From: Gilles Chanteperdrix @ 2011-05-04 9:25 UTC (permalink / raw)
To: Aurele Traynard; +Cc: Xenomai help
On 05/04/2011 10:59 AM, Aurele Traynard wrote:
> 2011/5/4 Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
>
>> On 05/04/2011 09:11 AM, Aurele Traynard wrote:
>>> Ok I will explain more things :
>>> My software makes the system freezing, when my interrupt handler is
>> called
>>> for the first time I think that he is called again and again and again
>> and
>>> this never stops. And so this freeze the system
>>> but I am not totaly sure.
>>> I'm sure that it is not Xenomai's fault it is just mine. I think I don't
>> use
>>> Xenomai correctly...
>>> That's why I am asking if "ioremap" "readl/writel" is the best way to
>>> read/write CPU registers and if there are other ways.
>>
>> Yes they are. But if your aim is to acknowledge/mask the interrupt line
>> at the interrupt controller level, this should not be done in the
>> interrupt handler, it is supposed to be done in the irqchip callbacks
>> for the interrupt controller you use.
>>
>> --
>> Gilles.
>>
>
> Ok if i understood I should put acknowledge/mask in a callback, and this
> callback should be the "rthal_irq_ackfn_t ackfn" argument (in
> rthal_irq_request)?
Maybe it will work, but the correct way to do this is to rely on the
Linux irq chip abstraction layer.
> But if I would like to read write any other register in my interrupt handler
> how should I do?
Use readl.
--
Gilles.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2011-05-04 9:25 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-03 12:07 [Xenomai-help] reading/writing registers Aurele Traynard
2011-05-03 17:36 ` Gilles Chanteperdrix
2011-05-04 7:11 ` Aurele Traynard
2011-05-04 7:23 ` Gilles Chanteperdrix
2011-05-04 8:59 ` Aurele Traynard
2011-05-04 9:25 ` 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.