From: "Sébastien Chrétien" <sebastien.chretien.enseirb@gmail.com>
To: benh@kernel.crashing.org
Cc: Scott Wood <scottwood@freescale.com>,
M B <super.firetwister@googlemail.com>,
linuxppc-dev@ozlabs.org
Subject: Re: irq
Date: Thu, 4 Sep 2008 15:23:21 +0200 [thread overview]
Message-ID: <319b0ac50809040623q1c32049ake8a5ea21fd5972cd@mail.gmail.com> (raw)
In-Reply-To: <319b0ac50809040127l2c506007vd6400a5edf912b71@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2959 bytes --]
I try to write a device tree about irq :
IT_controller: irq_controller@20006000 {
clock-frequency = <0>;
interrupt-controller;
#address-cells = <0>;
reg = <0x20006000 0x100>;
compatible = "it";
device_type = "it";
big-endian;
};
uart@200b1000{
device_type="uart";
compatible="uart";
interrupts = <0x18 0>;
interrupt-parent=<&IT_controller>;
};
uart_irq=of_find_node_by_type(NULL, "uart");
if(uart_irq==NULL)
printk("%s: No uart node found !\n", __func__);
virt=irq_of_parse_and_map(uart_irq, 0);
printk("Virtual irq : %d \n",virt);
When I boot linux, virt=0;
What is wrong ?
2008/9/4, Sébastien Chrétien <sebastien.chretien.enseirb@gmail.com>:
>
> I read the booting_without_of.txt document and the Interrupt Mapping
> docucument from http://playground.sun.com/1275. But I don't understand all
> parameters. Can somebody help me to create my device tree about interrupt
> part ?
>
> I have an interrupt controller at the adresse 0x20006000. The irq_id range
> is 1 to 63.
> I would like to try UART interrupt, which have ids : 0x18 (tranmission fifo
> empty,
> 0x19 (reception fifo full), 0x1a (reception error), 0x1b (break emission).
> What other informations are needed ?
>
>
> Nothing is cascaded.
>
> Thanks
>
>
>
>
> 2008/9/4, Benjamin Herrenschmidt <benh@kernel.crashing.org>:
>>
>> On Wed, 2008-09-03 at 23:02 +0200, Sébastien Chrétien wrote:
>>
>> > irq_of_parse_and_map is equivalent to ioremap in the MMU case ?
>>
>>
>> On the powerpc architecture, we use virtualized IRQ numbers in order to
>> deal with the wide range of interrupt controllers around and multiple
>> of them cascaded.
>>
>> The base function to "map" a physical interrupt to a virtual interrupt
>> is irq_create_mapping(). It takes an irq_host argument which represent
>> the IRQ "domain" (typically irq controller) off which the interrupt you
>> are trying to map hangs.
>>
>> If you pass NULL, it will use the "default" controller, which doesn't
>> always exist, it depends on the platform. Usually, platforms set that
>> to the toplevel PIC.
>>
>> However, normally, that function shouldn't be used directly. Instead,
>> you should create a representation of your device in the device-tree
>> along with the appropriate interrupt mapping, and then use the
>> irq_of_parse_and_map() function to obtain a mapped virtual irq based
>> on the device-tree information. This will take care of finding the
>> right irq_host but will also properly setup the polarity of the
>> interrupt etc...
>>
>> Now, as to how you should represent the interrupt in the device-tree,
>> this should be explained in Documentation/booting-without-of.txt
>>
>> Cheers,
>> Ben.
>>
>>
>
[-- Attachment #2: Type: text/html, Size: 4901 bytes --]
next prev parent reply other threads:[~2008-09-04 13:23 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-03 14:15 irq Sébastien Chrétien
2008-09-03 14:36 ` irq Daniele Bosi
2008-09-03 15:03 ` irq Sébastien Chrétien
2008-09-03 16:05 ` irq M B
2008-09-03 16:36 ` irq Sébastien Chrétien
2008-09-03 17:08 ` irq Scott Wood
2008-09-03 21:02 ` irq Sébastien Chrétien
2008-09-03 21:03 ` irq Scott Wood
2008-09-04 3:02 ` irq Benjamin Herrenschmidt
2008-09-04 8:27 ` irq Sébastien Chrétien
2008-09-04 13:23 ` Sébastien Chrétien [this message]
2008-09-04 14:18 ` irq Scott Wood
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=319b0ac50809040623q1c32049ake8a5ea21fd5972cd@mail.gmail.com \
--to=sebastien.chretien.enseirb@gmail.com \
--cc=benh@kernel.crashing.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=scottwood@freescale.com \
--cc=super.firetwister@googlemail.com \
/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;
as well as URLs for NNTP newsgroup(s).