I try to write a device tree about irq : <br>
<br>
IT_controller: irq_controller@20006000 {<br>
clock-frequency = <0>;<br>
interrupt-controller;<br>
#address-cells = <0>;<br>
reg = <0x20006000 0x100>;<br>
compatible = "it";<br>
device_type = "it";<br>
big-endian;<br>
};<br>
<br>
uart@200b1000{<br>
device_type="uart";<br>
compatible="uart";<br>
interrupts = <0x18 0>;<br>
interrupt-parent=<&IT_controller>; <br>
};<br>
<br>
<br>
uart_irq=of_find_node_by_type(NULL, "uart");<br>
if(uart_irq==NULL)<br>
printk("%s: No uart node found !\n", __func__);<br>
<br>
virt=irq_of_parse_and_map(uart_irq, 0);<br>
printk("Virtual irq : %d \n",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 <<a href="mailto:sebastien.chretien.enseirb@gmail.com">sebastien.chretien.enseirb@gmail.com</a>>:</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'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 <<a href="mailto:benh@kernel.crashing.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">benh@kernel.crashing.org</a>>:</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> > 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 "map" a physical interrupt to a virtual interrupt<br> is irq_create_mapping(). It takes an irq_host argument which represent<br>
the IRQ "domain" (typically irq controller) off which the interrupt you<br> are trying to map hangs.<br> <br> If you pass NULL, it will use the "default" controller, which doesn'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'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>