From: Hitoshi Mitake <mitake@dcl.info.waseda.ac.jp>
To: linux-sh@vger.kernel.org
Subject: Re: [PATCH 1/4] Add the directory mach-sh2007 for SH-2007 board support
Date: Mon, 07 Jun 2010 15:06:32 +0000 [thread overview]
Message-ID: <4C0D0AF8.80103@dcl.info.waseda.ac.jp> (raw)
In-Reply-To: <1275292796-26602-2-git-send-email-mitake@dcl.info.waseda.ac.jp>
On 06/07/10 12:02, Paul Mundt wrote:
> On Sat, Jun 05, 2010 at 10:32:19PM +0900, Hitoshi Mitake wrote:
>> On 06/02/10 15:32, Paul Mundt wrote:
>>>> +/* Support for external interrupt pins in IRQ mode */
>>>> +enum {IRQ0 = 1, IRQ1, IRQ2, IRQ3, IRQ4, IRQ5, IRQ6, IRQ7};
>>>> +static struct intc_vect irq_vectors[] __initdata = {
>>>> + INTC_IRQ(IRQ0, IRQ_SMC0),
>>>> + INTC_IRQ(IRQ1, IRQ_SMC1),
>>>> + INTC_IRQ(IRQ2, IRQ_CFCARD),
>>>> + INTC_IRQ(IRQ3, IRQ_IDE),
>>>> + INTC_IRQ(IRQ4, 3),
>>>> + INTC_IRQ(IRQ5, 4),
>>>> + INTC_IRQ(IRQ6, 5),
>>>> + INTC_IRQ(IRQ7, 7),
>>>> +};
>>>> +
>>>> +static struct intc_mask_reg irq_mask_registers[] __initdata = {
>>>> + { INTC_INTMSK0, INTC_INTMSKCLR0, 32,
>>>> + { IRQ0, IRQ1, IRQ2, IRQ3, IRQ4, IRQ5, IRQ6, IRQ7 } },
>>>> +};
>>>> +
>>>> +static struct intc_prio_reg irq_prio_registers[] __initdata = {
>>>> + { INTC_INTPRI, 0, 32, 4,
>>>> + { IRQ0, IRQ1, IRQ2, IRQ3, IRQ4, IRQ5, IRQ6, IRQ7 } },
>>>> +};
>>>> +
>>>> +static struct intc_sense_reg irq_sense_registers[] __initdata = {
>>>> + { INTC_ICR1, 32, 2,
>>>> + { IRQ0, IRQ1, IRQ2, IRQ3, IRQ4, IRQ5, IRQ6, IRQ7 } },
>>>> +};
>>>> +
>>>> +static struct intc_mask_reg irq_ack_registers[] __initdata = {
>>>> + { INTC_INTREQ, 0, 32,
>>>> + { IRQ0, IRQ1, IRQ2, IRQ3, IRQ4, IRQ5, IRQ6, IRQ7 } },
>>>> +};
>>>> +
>>>> +static DECLARE_INTC_DESC_ACK(intc_irq_desc, "sh7780-irq",
irq_vectors,
>>>> + NULL, irq_mask_registers, irq_prio_registers,
>>>> + irq_sense_registers, irq_ack_registers);
>>>> +
>>> None of this is needed, it's all taken care of by the SH7780 CPU code
>>> already.
>>
>> These IRQs are things for devicde specific,
>> I think this is required for board support.
>> # I'm an only newbie, if I make some mistakes,
>> # please point out :)
>
> I suspect this just stems from a misunderstanding of how to interact with
> the IRQ code. All of these registers are part of the SH7780 CPU IRQ
> controllers, and have nothing to do with the device. The only thing that
> is device specific is how these IRQs are used, and we already expose full
> control for that to the boards.
>
> If you read through arch/sh/kernel/cpu/sh4a/setup-sh7780.c you can see
> that everything is already centrally managed by the CPU, so the only
> thing you need to take care of is the IRQ mapping and IRQ mode pins
> setting.
>
> If your board has an FPGA that's chained off of the IRLs then you can set
> the controller in to IRL mode, or if you're simply using them as IRQ0-7
> directly and letting the CPU controller take care of the masking, then
> you can simply throw the controller in to IRQ mode.
>
> Simply grep for plat_irq_setup_pins() to see how the CPU/board
> interaction works for this, you'll likely want IRQ_MODE_IRQ for this
> case.
>
Ah, I noticed my misunderstanding.
plat_irq_setup_pins(IRQ_MODE_IRQ);
is enough for me to init ICR.
Thanks for your correcting!
And I have a question,
Can I set evt2irq(INTEVT) to struct resource.start directly?
# INTEVT is the value like 0x220
If I do so, mv_irq_demux can be NULL because
evt2irq(INTEVT) is equal to the first argument of do_IRQ().
I don't know the traditional way of SH board support,
and it seems that there is no board takes the way I described above.
So I cannot judge this way is correct or not...
next prev parent reply other threads:[~2010-06-07 15:06 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-31 7:59 [PATCH 1/4] Add the directory mach-sh2007 for SH-2007 board support Hitoshi Mitake
2010-06-02 6:32 ` Paul Mundt
2010-06-05 13:32 ` Hitoshi Mitake
2010-06-07 3:02 ` Paul Mundt
2010-06-07 15:06 ` Hitoshi Mitake [this message]
2010-06-08 4:00 ` Paul Mundt
2010-06-08 10:06 ` Hitoshi Mitake
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=4C0D0AF8.80103@dcl.info.waseda.ac.jp \
--to=mitake@dcl.info.waseda.ac.jp \
--cc=linux-sh@vger.kernel.org \
/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