public inbox for linux-sh@vger.kernel.org
 help / color / mirror / Atom feed
From: Paul Mundt <lethal@linux-sh.org>
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 03:02:09 +0000	[thread overview]
Message-ID: <20100607030209.GB4258@linux-sh.org> (raw)
In-Reply-To: <1275292796-26602-2-git-send-email-mitake@dcl.info.waseda.ac.jp>

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.

  parent reply	other threads:[~2010-06-07  3:02 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 [this message]
2010-06-07 15:06 ` Hitoshi Mitake
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=20100607030209.GB4258@linux-sh.org \
    --to=lethal@linux-sh.org \
    --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