From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.239]) by ozlabs.org (Postfix) with ESMTP id 03C1BDE308 for ; Thu, 21 Aug 2008 18:23:12 +1000 (EST) Received: by rv-out-0506.google.com with SMTP id f6so792400rvb.9 for ; Thu, 21 Aug 2008 01:23:11 -0700 (PDT) Message-ID: <319b0ac50808210123m81e8364od983d5dbbb601104@mail.gmail.com> Date: Thu, 21 Aug 2008 10:23:11 +0200 From: "=?ISO-8859-1?Q?S=E9bastien_Chr=E9tien?=" To: michael@ellerman.id.au Subject: Re: [machdep_calls] IRQ In-Reply-To: <1219305767.8008.14.camel@localhost> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_21113_5989041.1219306991399" References: <319b0ac50808210013p677ebb91vf3b30748138c6d4c@mail.gmail.com> <1219305767.8008.14.camel@localhost> Cc: linuxppc-dev@ozlabs.org List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , ------=_Part_21113_5989041.1219306991399 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline 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 : > > On Thu, 2008-08-21 at 09:13 +0200, S=E9bastien Chr=E9tien 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 > > ------=_Part_21113_5989041.1219306991399 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Exactly, I mean ppc_md.init_IRQ().
Ok. What have I to setup in this function ? I set the mask and other regist= ers. Is it right ?  How do I chose the mask ?
At the end of this funtion, IRQ are disable. Is that right ? So who does en= able 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=E9bastien Chr=E9tien wrote:
> H= ello,
>
> What are the constraints in order to implement a ir= q_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&#= 39;t
kmalloc yet. ioremap should work.



> What is t= he 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 call= ed 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_I= RQ.

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 62= 12 1183 (tie line 70 21183)

We do not inherit the earth from our a= ncestors,
we borrow it from our children. - S.M.A.R.T Person


------=_Part_21113_5989041.1219306991399--