[PATCH v2 4/7] ARM: pxa: add devicetree code for irq handling

Haojian Zhuang haojian.zhuang at gmail.com
Sun Jul 29 12:13:50 EDT 2012


On Sun, Jul 29, 2012 at 11:08 PM, Daniel Mack <zonque at gmail.com> wrote:
> Hi Haojian,
>
> On 28.07.2012 17:42, Haojian Zhuang wrote:
>> On Sat, Jul 28, 2012 at 5:56 PM, Daniel Mack <zonque at gmail.com> wrote:
>>> On 28.07.2012 09:17, Haojian Zhuang wrote:
>>>> On Fri, Jul 27, 2012 at 3:16 AM, Daniel Mack <zonque at gmail.com> wrote:
>>>>> Properly register on-chip interrupt using the irqdomain logic. The
>>>>> number of interrupts is taken from the devicetree node.
>>>>>
>>>>> Signed-off-by: Daniel Mack <zonque at gmail.com>
>>>>> ---
>>>>>  arch/arm/mach-pxa/irq.c    | 73 ++++++++++++++++++++++++++++++++++++++++++++++
>>>>>  arch/arm/mach-pxa/pxa3xx.c | 17 +++++++++--
>>>>>  2 files changed, 88 insertions(+), 2 deletions(-)
>>>>>
>>>>> +#ifdef CONFIG_OF
>>>>> +static struct irq_domain *pxa_irq_domain;
>>>>> +
>>>>> +static int pxa_irq_map(struct irq_domain *h, unsigned int virq,
>>>>> +                      irq_hw_number_t hw)
>>>>> +{
>>>>> +       int irq, i = hw % 32;
>>>>> +       void __iomem *base = irq_base(hw / 32);
>>>>> +
>>>>> +       /* initialize interrupt priority */
>>>>> +       if (cpu_has_ipr())
>>>>> +               __raw_writel(i | IPR_VALID, IRQ_BASE + IPR(i));
>>>> Since we have DT support at here. Could we use property for interrupt priority?
>>>
>>> Not sure what you mean here. Can you elaborate? I couldn't find any
>>> reference to IRQ priorities in other platforms either.
>>>
>>> Maybe we can also add that in a separate patch, which would also help in
>>> tracking possible regressions du to such a change?
>>>
>> cpu_has_ipr() returns true if CPU isn't PXA25x.
>> My point is that we can avoid to use cpu_is_xxx() while DT is used. We only need
>> to append a property "marvell,intc-priority" is DTS. So the code could
>> be changed
>> in below.
>> if (of_find_property(np, "marvell,intc-priority", NULL))
>>            __raw_writel(i | IPR_VALID, IRQ_BASE + IPR(i));
>>
>
> Please see the attached patch. Does that look better to you? I removed
> the cpu_has_ipr() inline function and made it a variable that is used
> and initalized from both the DT and the legacy code.
>
>
> Daniel
>

Don't forget to append this property into .dtsi file. Only PXA25x don't support
this property.

Regards
Haojian



More information about the linux-arm-kernel mailing list