* [machdep_calls] IRQ
@ 2008-08-21 7:13 Sébastien Chrétien
2008-08-21 8:02 ` Michael Ellerman
0 siblings, 1 reply; 5+ messages in thread
From: Sébastien Chrétien @ 2008-08-21 7:13 UTC (permalink / raw)
To: linuxppc-dev
[-- Attachment #1: Type: text/plain, Size: 262 bytes --]
Hello,
What are the constraints in order to implement a irq_init function ?
I think it has to set the mask. Does it enable IRQ ?
What is the aim or get_irq ? Does it retun an information about the mask,
the states, or... ?
Thanks
Sébastien Chrétien
[-- Attachment #2: Type: text/html, Size: 298 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [machdep_calls] IRQ
2008-08-21 7:13 [machdep_calls] IRQ Sébastien Chrétien
@ 2008-08-21 8:02 ` Michael Ellerman
2008-08-21 8:23 ` Sébastien Chrétien
0 siblings, 1 reply; 5+ messages in thread
From: Michael Ellerman @ 2008-08-21 8:02 UTC (permalink / raw)
To: Sébastien Chrétien; +Cc: linuxppc-dev
[-- Attachment #1: Type: text/plain, Size: 1410 bytes --]
On Thu, 2008-08-21 at 09:13 +0200, Sébastien Chrétien wrote:
> Hello,
>
> What are the constraints in order to implement a irq_init function ?
You mean ppc_md.init_IRQ() ?
If so, it's a hook you can use to setup your interrupt controller. It's
called from init_IRQ() (arch/powerpc/kernel/irq.c), which is called from
start_kernel() (init/main.c).
Not long after it is called irqs are enabled. I think it is the last
callback into arch code before irqs are enabled.
When it is called the device tree is unflattened, so you can use the of_
API. Bootmem is setup so you can use alloc_bootmem(), but you can't
kmalloc yet. ioremap should work.
> What is the aim or get_irq ? Does it retun an information about the
> mask, the states, or... ?
The aim of ppc_md.get_irq() ? It's called from do_IRQ()
(arch/powerpc/kernel/irq.c) which is called from assembler in the
appropriate head_x.S
It just returns the number (virtual number) of the irq that just fired.
If for some reason you took a spurious interrupt it should return
NO_IRQ.
I'm not sure what you mean about masks or states, someone else might
though.
cheers
--
Michael Ellerman
OzLabs, IBM Australia Development Lab
wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)
We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [machdep_calls] IRQ
2008-08-21 8:02 ` Michael Ellerman
@ 2008-08-21 8:23 ` Sébastien Chrétien
2008-08-22 5:20 ` Michael Ellerman
0 siblings, 1 reply; 5+ messages in thread
From: Sébastien Chrétien @ 2008-08-21 8:23 UTC (permalink / raw)
To: michael; +Cc: linuxppc-dev
[-- Attachment #1: Type: text/plain, Size: 1874 bytes --]
Exactly, I mean ppc_md.init_IRQ().
Ok. What have I to setup in this function ? I set the mask and other
registers. Is it right ? How do I chose the mask ?
At the end of this funtion, IRQ are disable. Is that right ? So who does
enable IRQs ?
Sorry for all this questions, I am learning the low layer of Linux.
2008/8/21, Michael Ellerman <michael@ellerman.id.au>:
>
> On Thu, 2008-08-21 at 09:13 +0200, Sébastien Chrétien wrote:
> > Hello,
> >
> > What are the constraints in order to implement a irq_init function ?
>
>
> You mean ppc_md.init_IRQ() ?
>
> If so, it's a hook you can use to setup your interrupt controller. It's
> called from init_IRQ() (arch/powerpc/kernel/irq.c), which is called from
> start_kernel() (init/main.c).
>
> Not long after it is called irqs are enabled. I think it is the last
> callback into arch code before irqs are enabled.
>
> When it is called the device tree is unflattened, so you can use the of_
> API. Bootmem is setup so you can use alloc_bootmem(), but you can't
> kmalloc yet. ioremap should work.
>
>
>
> > What is the aim or get_irq ? Does it retun an information about the
> > mask, the states, or... ?
>
>
> The aim of ppc_md.get_irq() ? It's called from do_IRQ()
> (arch/powerpc/kernel/irq.c) which is called from assembler in the
> appropriate head_x.S
>
> It just returns the number (virtual number) of the irq that just fired.
> If for some reason you took a spurious interrupt it should return
> NO_IRQ.
>
> I'm not sure what you mean about masks or states, someone else might
> though.
>
> cheers
>
> --
> Michael Ellerman
> OzLabs, IBM Australia Development Lab
>
> wwweb: http://michael.ellerman.id.au
> phone: +61 2 6212 1183 (tie line 70 21183)
>
> We do not inherit the earth from our ancestors,
> we borrow it from our children. - S.M.A.R.T Person
>
>
[-- Attachment #2: Type: text/html, Size: 2285 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [machdep_calls] IRQ
2008-08-21 8:23 ` Sébastien Chrétien
@ 2008-08-22 5:20 ` Michael Ellerman
2008-08-22 9:48 ` Sébastien Chrétien
0 siblings, 1 reply; 5+ messages in thread
From: Michael Ellerman @ 2008-08-22 5:20 UTC (permalink / raw)
To: Sébastien Chrétien; +Cc: linuxppc-dev
[-- Attachment #1: Type: text/plain, Size: 853 bytes --]
On Thu, 2008-08-21 at 10:23 +0200, Sébastien Chrétien wrote:
> Exactly, I mean ppc_md.init_IRQ().
> Ok. What have I to setup in this function ? I set the mask and other
> registers. Is it right ? How do I chose the mask ?
It totally depends on your platform, I really can't tell you. You can
look at similar platform code if there is some, otherwise the reference
manual for your hardware or similar should have what you need.
> At the end of this funtion, IRQ are disable. Is that right ? So who
> does enable IRQs ?
Yes, irqs get enabled a bit later in start_kernel().
cheers
--
Michael Ellerman
OzLabs, IBM Australia Development Lab
wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)
We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [machdep_calls] IRQ
2008-08-22 5:20 ` Michael Ellerman
@ 2008-08-22 9:48 ` Sébastien Chrétien
0 siblings, 0 replies; 5+ messages in thread
From: Sébastien Chrétien @ 2008-08-22 9:48 UTC (permalink / raw)
To: michael; +Cc: linuxppc-dev
[-- Attachment #1: Type: text/plain, Size: 1031 bytes --]
Ok thank you, I will begin to implement the irq functions
2008/8/22, Michael Ellerman <michael@ellerman.id.au>:
>
> On Thu, 2008-08-21 at 10:23 +0200, Sébastien Chrétien wrote:
> > Exactly, I mean ppc_md.init_IRQ().
>
> > Ok. What have I to setup in this function ? I set the mask and other
> > registers. Is it right ? How do I chose the mask ?
>
>
> It totally depends on your platform, I really can't tell you. You can
> look at similar platform code if there is some, otherwise the reference
> manual for your hardware or similar should have what you need.
>
>
> > At the end of this funtion, IRQ are disable. Is that right ? So who
> > does enable IRQs ?
>
>
> Yes, irqs get enabled a bit later in start_kernel().
>
>
> cheers
>
> --
> Michael Ellerman
> OzLabs, IBM Australia Development Lab
>
> wwweb: http://michael.ellerman.id.au
> phone: +61 2 6212 1183 (tie line 70 21183)
>
> We do not inherit the earth from our ancestors,
> we borrow it from our children. - S.M.A.R.T Person
>
>
[-- Attachment #2: Type: text/html, Size: 1391 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2008-08-22 9:48 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-21 7:13 [machdep_calls] IRQ Sébastien Chrétien
2008-08-21 8:02 ` Michael Ellerman
2008-08-21 8:23 ` Sébastien Chrétien
2008-08-22 5:20 ` Michael Ellerman
2008-08-22 9:48 ` Sébastien Chrétien
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).