public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: nicolas.ferre@atmel.com (Nicolas Ferre)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH V2] arm/tegra: convert tegra20 to GIC devicetree binding
Date: Tue, 29 Nov 2011 18:17:27 +0100	[thread overview]
Message-ID: <4ED513A7.4060102@atmel.com> (raw)
In-Reply-To: <74CDBE0F657A3D45AFBB94109FB122FF174FDAFADC@HQMAIL01.nvidia.com>

On 11/29/2011 06:13 PM, Stephen Warren :
> Cousson, Benoit wrote at Tuesday, November 29, 2011 6:01 AM:
>> Hi Stephen&  Peter,
>>
>> On 11/29/2011 1:54 AM, Stephen Warren wrote:
>>> From: pdeschrijver at nvidia.com<pdeschrijver@nvidia.com>
>>
>> [...]
>>
>>> @@ -125,6 +131,14 @@ void __init tegra_init_irq(void)
>>>    	gic_arch_extn.irq_unmask = tegra_unmask;
>>>    	gic_arch_extn.irq_retrigger = tegra_retrigger;
>>>
>>> -	gic_init(0, 29, IO_ADDRESS(TEGRA_ARM_INT_DIST_BASE),
>>> -		 IO_ADDRESS(TEGRA_ARM_PERIF_BASE + 0x100));
>>> +#ifdef CONFIG_OF
>>> +	/* Check if there is a devicetree present as of_irq_init doesn't
>>> +	 * indicate if an interrupt controller node was found.
>>> +	 */
>>> +	if (of_find_node_by_path("/"))
>>> +		of_irq_init(tegra_irq_match);
>>> +	else
>>> +#endif
>>
>> For the same kind of need, I found the following API:
>>
>> of_have_populated_dt()
>>
>> Moreover, it returns false if !CONFIG_OF, so it will avoid the #ifdef.
>
> That sounds like a great idea. Unfortunately, of_irq_init() is a DT-only
> function. Exynos has the following in mainline to solve this:
>
>          if (!of_have_populated_dt())
>                  gic_init_bases(...);
> #ifdef CONFIG_OF
>          else
>                  of_irq_init(exynos4_dt_irq_match);
> #endif
>
> Perhaps we should add a dummy of_irq_init() too, so that we can remove
> this ifdef.

+1 for this idea: I have the same issue with at91.
I think that a macro is preferred instead a function: it will also 
remove the need for a protection for the matching table.

Best regards,
-- 
Nicolas Ferre

  reply	other threads:[~2011-11-29 17:17 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-29  0:54 [PATCH V2] arm/tegra: convert tegra20 to GIC devicetree binding Stephen Warren
2011-11-29 13:00 ` Cousson, Benoit
2011-11-29 17:13   ` Stephen Warren
2011-11-29 17:17     ` Nicolas Ferre [this message]
2011-11-29 17:47     ` Cousson, Benoit
2011-11-29 19:52       ` Rob Herring
2011-11-29 21:08         ` Stephen Warren
2011-11-29 22:24           ` Rob Herring
2011-11-29 22:58             ` Stephen Warren
2011-11-29 23:16               ` Rob Herring
2011-11-29 23:22                 ` Stephen Warren

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4ED513A7.4060102@atmel.com \
    --to=nicolas.ferre@atmel.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox