From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jamie Iles Subject: Re: [PATCH v2] ARM: at91: pit add DT support Date: Thu, 5 Jan 2012 14:56:29 +0000 Message-ID: <20120105145629.GB10530@page> References: <1318799895-5121-4-git-send-email-plagnioj@jcrosoft.com> <1325771308-19770-1-git-send-email-nicolas.ferre@atmel.com> <20120105120049.GB4641@page> <4F05B8A1.2010003@atmel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <4F05B8A1.2010003-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: devicetree-discuss-bounces+gldd-devicetree-discuss=m.gmane.org-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org Sender: devicetree-discuss-bounces+gldd-devicetree-discuss=m.gmane.org-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org To: Nicolas Ferre Cc: devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ@public.gmane.org, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org List-Id: devicetree@vger.kernel.org On Thu, Jan 05, 2012 at 03:50:09PM +0100, Nicolas Ferre wrote: > On 01/05/2012 01:00 PM, Jamie Iles : > > Hi Nicolas, Jean-Christophe, > > > > On Thu, Jan 05, 2012 at 02:48:28PM +0100, Nicolas Ferre wrote: > >> From: Jean-Christophe PLAGNIOL-VILLARD > >> > >> Retreive registers address and IRQ from device tree entry. Fall back > >> to built-in values if an error occurs. > >> > >> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD > >> [nicolas.ferre-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org: change error path and interrupts property handling] > >> Signed-off-by: Nicolas Ferre > >> --- > > [...] > >> diff --git a/arch/arm/mach-at91/at91sam926x_time.c > >> b/arch/arm/mach-at91/at91sam926x_time.c > >> index d89ead7..5d4c308 100644 > >> --- a/arch/arm/mach-at91/at91sam926x_time.c > >> +++ b/arch/arm/mach-at91/at91sam926x_time.c > >> @@ -14,6 +14,8 @@ > > [...] > >> +static int __init of_at91sam926x_pit_init(void) > >> +{ > >> + struct device_node *np; > >> + > >> + np = of_find_matching_node(NULL, timer_ids); > >> + if (!np) > >> + goto err; > >> + > >> + pit_base_addr = of_iomap(np, 0); > >> + if (!pit_base_addr) > >> + goto node_err; > >> + > >> + /* Get the interrupts property */ > >> + if (of_property_read_u32(np, "interrupts", &at91sam926x_pit_irq.irq)) > >> + goto ioremap_err; > > > > I think you want: > > > > at91sam926x_pit_irq.irq = irq_of_parse_and_map(np, 0); > > > > to make sure the IRQ is converted to a Linux IRQ and not a hwirq. > > Yes, that definitively makes sense. BTW, without a DT entry, how should > I map a hwirq, with the irq_domain_to_irq() helper? But I will need > access to the interrupt controller "struct irq_domain"... If you aren't booting with DT then at the moment I think on AT91 you have statically assigned irq_descs and IRQ numbers so you don't need to map them, you just know what IRQ number to request at compile time. Jamie