I try to write a device tree about irq : <br>
<br>
IT_controller: irq_controller@20006000 {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; clock-frequency = &lt;0&gt;;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; interrupt-controller;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; #address-cells = &lt;0&gt;;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; reg = &lt;0x20006000 0x100&gt;;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; compatible = &quot;it&quot;;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; device_type = &quot;it&quot;;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; big-endian;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; };<br>
<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; uart@200b1000{<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; device_type=&quot;uart&quot;;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; compatible=&quot;uart&quot;;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; interrupts = &lt;0x18 0&gt;;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
interrupt-parent=&lt;&amp;IT_controller&gt;;&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; };<br>
<br>
<br>
uart_irq=of_find_node_by_type(NULL, &quot;uart&quot;);<br>
&nbsp;&nbsp;&nbsp; if(uart_irq==NULL)<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;printk(&quot;%s: No uart node found !\n&quot;, __func__);<br>
<br>
&nbsp;&nbsp;&nbsp; virt=irq_of_parse_and_map(uart_irq, 0);<br>
&nbsp;&nbsp;&nbsp; printk(&quot;Virtual irq : %d \n&quot;,virt);<br>
<br>
<br>
When I boot linux, virt=0;<br>
<br>
What is wrong ?<br>
<br><br><div><span class="gmail_quote">2008/9/4, Sébastien Chrétien &lt;<a href="mailto:sebastien.chretien.enseirb@gmail.com">sebastien.chretien.enseirb@gmail.com</a>&gt;:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I read the booting_without_of.txt document and the Interrupt Mapping
docucument from <a href="http://playground.sun.com/1275" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://playground.sun.com/1275</a>. But I don&#39;t understand
all parameters. Can somebody help me to create my device tree about
interrupt part ?<br>
<br>
I have an interrupt controller at the adresse 0x20006000. The irq_id range is 1 to 63.<br>
I would like to try UART interrupt, which have ids : 0x18 (tranmission fifo empty,<br>
0x19 (reception fifo full), 0x1a (reception error), 0x1b (break emission).<br>
What other informations are needed ?<br>
<br>
<br>
Nothing is cascaded.<br>
<br>
Thanks<br>
<br>
<br>
<br><br><div><span class="gmail_quote">2008/9/4, Benjamin Herrenschmidt &lt;<a href="mailto:benh@kernel.crashing.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">benh@kernel.crashing.org</a>&gt;:</span><div>
<span class="e" id="q_11c2c797973e45b9_1"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On Wed, 2008-09-03 at 23:02 +0200, Sébastien Chrétien wrote:<br> <br> &gt; irq_of_parse_and_map is equivalent to ioremap in the MMU case ?<br> <br> <br>On the powerpc architecture, we use virtualized IRQ numbers in order to<br>

 deal with the wide range of interrupt controllers around and multiple<br> of them cascaded.<br> <br> The base function to &quot;map&quot; a physical interrupt to a virtual interrupt<br> is irq_create_mapping(). It takes an irq_host argument which represent<br>

 the IRQ &quot;domain&quot; (typically irq controller) off which the interrupt you<br> are trying to map hangs.<br> <br> If you pass NULL, it will use the &quot;default&quot; controller, which doesn&#39;t<br> always exist, it depends on the platform. Usually, platforms set that<br>

 to the toplevel PIC.<br> <br> However, normally, that function shouldn&#39;t be used directly. Instead,<br> you should create a representation of your device in the device-tree<br> along with the appropriate interrupt mapping, and then use the<br>

 irq_of_parse_and_map() function to obtain a mapped virtual irq based<br> on the device-tree information. This will take care of finding the<br> right irq_host but will also properly setup the polarity of the<br> interrupt etc...<br>

 <br> Now, as to how you should represent the interrupt in the device-tree,<br> this should be explained in Documentation/booting-without-of.txt<br> <br> Cheers,<br> Ben.<br> <br> </blockquote></span></div></div><br>
</blockquote></div><br>