linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* DTS configuration of external interrupts on 8347
@ 2008-07-23 14:58 Richard Whitlock
  2008-07-23 17:13 ` Sean MacLennan
  0 siblings, 1 reply; 4+ messages in thread
From: Richard Whitlock @ 2008-07-23 14:58 UTC (permalink / raw)
  To: linuxppc-dev

I have a small problem with a port of linux 2.6.26 to a custom board.
Our board is almost identical to the Analogue & Micro asp 8347 board, so 
I'm using Kumar Gala's excellent fsl tree (thank you Kumar) as it 
already has a defconfig for the asp.
Thanks also to Bryan O'Donoghue for pointing us in the direction of the 
asp port in the first place.

The problem we have is I am unable to request an external interrupt. We 
have an FPGA which has an interrupt line - HW IRQ_0, so thats linux IRQ 48.
I have added the following to the dts file:

fpgaKFAF@0xF8000000 {
                interrupts = <48 8>;
                interrupt-parent = <&ipic>;
}

but whenever I call request_irq() it returns -ENOSYS.

The driver loads fine, and the open function does very little - a call 
to ioremap() - which works, and a call to request_irq() which does not.
Is there anything else I have to do to configure this interrupt?

Regards,

Richard.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: DTS configuration of external interrupts on 8347
  2008-07-23 14:58 DTS configuration of external interrupts on 8347 Richard Whitlock
@ 2008-07-23 17:13 ` Sean MacLennan
  2008-07-24 15:06   ` Richard Whitlock
  0 siblings, 1 reply; 4+ messages in thread
From: Sean MacLennan @ 2008-07-23 17:13 UTC (permalink / raw)
  To: richw; +Cc: linuxppc-dev, richard.whitlo

On Wed, 23 Jul 2008 15:58:38 +0100
"Richard Whitlock" <richard.whitlo@btconnect.com> wrote:

> I have a small problem with a port of linux 2.6.26 to a custom board.
> Our board is almost identical to the Analogue & Micro asp 8347 board,
> so I'm using Kumar Gala's excellent fsl tree (thank you Kumar) as it 
> already has a defconfig for the asp.
> Thanks also to Bryan O'Donoghue for pointing us in the direction of
> the asp port in the first place.
> 
> The problem we have is I am unable to request an external interrupt.
> We have an FPGA which has an interrupt line - HW IRQ_0, so thats
> linux IRQ 48. I have added the following to the dts file:
> 
> fpgaKFAF@0xF8000000 {
>                 interrupts = <48 8>;
>                 interrupt-parent = <&ipic>;
> }
> 
> but whenever I call request_irq() it returns -ENOSYS.
> 
> The driver loads fine, and the open function does very little - a
> call to ioremap() - which works, and a call to request_irq() which
> does not. Is there anything else I have to do to configure this
> interrupt?

I don't think you have enough information in the dts. We do the same
thing on the warp (you can look at the warp.dts):

fpga@2,0 {
	compatible = "pika,fpga";
	reg = <0x00000002 0x00000000 0x00001000>;
	interrupts = <0x18 0x8>;
	interrupt-parent = <&UIC0>;
};

You need the compatible, maybe "kfaf,fpga", and I believe the reg entry
although you could try without it.

You then can use:

	of_find_compatible_node
	irq_of_parse_and_map
	request_irq

platforms/44x/warp.c shows an example using the ad7414. Just change the
ad7414 string to your compatible string.

Cheers,
   Sean

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: DTS configuration of external interrupts on 8347
  2008-07-23 17:13 ` Sean MacLennan
@ 2008-07-24 15:06   ` Richard Whitlock
  2008-07-25 10:15     ` Wang Jian
  0 siblings, 1 reply; 4+ messages in thread
From: Richard Whitlock @ 2008-07-24 15:06 UTC (permalink / raw)
  To: Sean MacLennan; +Cc: richw, linuxppc-dev

Sean MacLennan wrote:
> On Wed, 23 Jul 2008 15:58:38 +0100
> "Richard Whitlock" <richard.whitlo@btconnect.com> wrote:
>
>   
>> I have a small problem with a port of linux 2.6.26 to a custom board.
>> Our board is almost identical to the Analogue & Micro asp 8347 board,
>> so I'm using Kumar Gala's excellent fsl tree (thank you Kumar) as it 
>> already has a defconfig for the asp.
>> Thanks also to Bryan O'Donoghue for pointing us in the direction of
>> the asp port in the first place.
>>
>> The problem we have is I am unable to request an external interrupt.
>> We have an FPGA which has an interrupt line - HW IRQ_0, so thats
>> linux IRQ 48. I have added the following to the dts file:
>>
>> fpgaKFAF@0xF8000000 {
>>                 interrupts = <48 8>;
>>                 interrupt-parent = <&ipic>;
>> }
>>
>> but whenever I call request_irq() it returns -ENOSYS.
>>
>> The driver loads fine, and the open function does very little - a
>> call to ioremap() - which works, and a call to request_irq() which
>> does not. Is there anything else I have to do to configure this
>> interrupt?
>>     
>
> I don't think you have enough information in the dts. We do the same
> thing on the warp (you can look at the warp.dts):
>
> fpga@2,0 {
> 	compatible = "pika,fpga";
> 	reg = <0x00000002 0x00000000 0x00001000>;
> 	interrupts = <0x18 0x8>;
> 	interrupt-parent = <&UIC0>;
> };
>
> You need the compatible, maybe "kfaf,fpga", and I believe the reg entry
> although you could try without it.
>
> You then can use:
>
> 	of_find_compatible_node
> 	irq_of_parse_and_map
> 	request_irq
>
> platforms/44x/warp.c shows an example using the ad7414. Just change the
> ad7414 string to your compatible string.
>
> Cheers,
>    Sean
>
>
>
>   
Sean,

Thanks for that - our original code had no call to irq_of_parse_and_map().
We've put that in, as well as a call to of_find_compatible_node(), and 
now everything works fine. We have also modified our dts file along the 
lines you suggested.
Cheers,


Richard.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: DTS configuration of external interrupts on 8347
  2008-07-24 15:06   ` Richard Whitlock
@ 2008-07-25 10:15     ` Wang Jian
  0 siblings, 0 replies; 4+ messages in thread
From: Wang Jian @ 2008-07-25 10:15 UTC (permalink / raw)
  To: richw; +Cc: linuxppc-dev, Sean MacLennan

Richard Whitlock wrote:
> Sean MacLennan wrote:
>> On Wed, 23 Jul 2008 15:58:38 +0100
>> "Richard Whitlock" <richard.whitlo@btconnect.com> wrote:
>>
>>  
>>> I have a small problem with a port of linux 2.6.26 to a custom board.
>>> Our board is almost identical to the Analogue & Micro asp 8347 board,
>>> so I'm using Kumar Gala's excellent fsl tree (thank you Kumar) as it 
>>> already has a defconfig for the asp.
>>> Thanks also to Bryan O'Donoghue for pointing us in the direction of
>>> the asp port in the first place.
>>>
>>> The problem we have is I am unable to request an external interrupt.
>>> We have an FPGA which has an interrupt line - HW IRQ_0, so thats
>>> linux IRQ 48. I have added the following to the dts file:
>>>
>>> fpgaKFAF@0xF8000000 {
>>>                 interrupts = <48 8>;
>>>                 interrupt-parent = <&ipic>;
>>> }
>>>
>>> but whenever I call request_irq() it returns -ENOSYS.
>>>
>>> The driver loads fine, and the open function does very little - a
>>> call to ioremap() - which works, and a call to request_irq() which
>>> does not. Is there anything else I have to do to configure this
>>> interrupt?
>>>     
>>
>> I don't think you have enough information in the dts. We do the same
>> thing on the warp (you can look at the warp.dts):
>>
>> fpga@2,0 {
>>     compatible = "pika,fpga";
>>     reg = <0x00000002 0x00000000 0x00001000>;
>>     interrupts = <0x18 0x8>;
>>     interrupt-parent = <&UIC0>;
>> };
>>
>> You need the compatible, maybe "kfaf,fpga", and I believe the reg entry
>> although you could try without it.
>>
>> You then can use:
>>
>>     of_find_compatible_node
>>     irq_of_parse_and_map
>>     request_irq
>>
>> platforms/44x/warp.c shows an example using the ad7414. Just change the
>> ad7414 string to your compatible string.
>>
>> Cheers,
>>    Sean
>>
>>
>>
>>   
> Sean,
> 
> Thanks for that - our original code had no call to irq_of_parse_and_map().
> We've put that in, as well as a call to of_find_compatible_node(), and 
> now everything works fine. We have also modified our dts file along the 
> lines you suggested.
> Cheers,
> 

The docs on OF/DTS are very poor in this specific area. For starters, 
it's naturally assumed that after linking the drivers in and adding 
device nodes to device tree source file, all is done. But that is NOT 
enough, espeicially for non-bus device drivers. Sometime, you must add 
init code to search device tree nodes you are interested, add device 
objects for them.

I see a bunch of patches on dts documentation are pending for 2.6.27. 
Wish this area will be improved.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-07-25 10:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-23 14:58 DTS configuration of external interrupts on 8347 Richard Whitlock
2008-07-23 17:13 ` Sean MacLennan
2008-07-24 15:06   ` Richard Whitlock
2008-07-25 10:15     ` Wang Jian

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).