linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* Additional IRQ handlers in ppc4xx_init_IRQ()
@ 2001-10-23  7:10 David Müller (ELSOFT AG)
  2001-10-23 18:32 ` Dan Malek
  0 siblings, 1 reply; 3+ messages in thread
From: David Müller (ELSOFT AG) @ 2001-10-23  7:10 UTC (permalink / raw)
  To: linuxppc-embedded


Hello

I have a question regarding the registration of additional IRQ handlers
for a PPC405GP based board. The board uses the PIC inside the PIIX4 too,
so i have set NR_BOARD_IRQ to 16 in my board specific include file and
extended ppc4xx_init_IRQ as follows:

static void __init
ppc4xx_init_IRQ(void)
{
	int i;

	ppc4xx_pic_init();

#if !defined(CONFIG_PIP405) && !defined(CONFIG_MIP405)
	for (i = 0; i < NR_IRQS; i++)
		irq_desc[i].handler = ppc4xx_pic;
#else
/* MPL PIP405 / MIP405 uses PIIX4 PIC too */
	for (i = 0; i < NR_AIC_IRQS; i++)
		irq_desc[i].handler = ppc4xx_pic;
	for (i = NR_AIC_IRQS; i < NR_IRQS; i++)
		irq_desc[i].handler = &i8259_pic;

	i8259_pic_irq_offset = NR_AIC_IRQS;
	i8259_init();
	request_irq(ISA_BRIDGE_INT, pip405_mip405_i8259_action, 0,
		    "i8259 cascade", NULL);
#endif
	return;
}


Perhaps something like the following would be a better solution:

static void __init
ppc4xx_init_IRQ(void)
{
	int i;

	ppc4xx_pic_init();

	for (i = 0; i < NR_IRQS; i++)
		irq_desc[i].handler = ppc4xx_pic;
#if defined(CONFIG_IRQ_FIXUP)
         board_fixup_irq();
#endif

	return;
}

Which is the way to go?


Dave


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Additional IRQ handlers in ppc4xx_init_IRQ()
  2001-10-23  7:10 Additional IRQ handlers in ppc4xx_init_IRQ() David Müller (ELSOFT AG)
@ 2001-10-23 18:32 ` Dan Malek
  2001-10-24  9:26   ` David Müller (ELSOFT AG)
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Malek @ 2001-10-23 18:32 UTC (permalink / raw)
  To: David Müller; +Cc: linuxppc-embedded


"David Müller (ELSOFT AG)" wrote:

> I have a question regarding the registration of additional IRQ handlers
> for a PPC405GP based board.

Where are Matt's changes for the Tivo?  It would address this and give
us another example of how this should be structured.


> extended ppc4xx_init_IRQ as follows:

This is not an appealing solution.  We should change ppc4xx_pic_init()
to initialize the internal interrupt controller irq descriptor, and then
create a standard board initialization call for board specific changes.


> static void __init
> ppc4xx_init_IRQ(void)
> {
>         int i;
>
>         ppc4xx_pic_init();
>
+	  ppc4xx_pic_board_init();
>         return;
> }
>

The '...board_init()' function can be empty for those boards that don't
require any additional controller initialization.


>         for (i = 0; i < NR_IRQS; i++)
>                 irq_desc[i].handler = ppc4xx_pic;

The NR_IRQS should represent the total number of interrupts across all
controllers.  The pic_init() should change this loop to initialize either
NR_AIC or NR_UIC depending upon a 403 or 405 interrupt controller.  No
#ifdefs necessary.

Thanks.


	-- Dan

** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Additional IRQ handlers in ppc4xx_init_IRQ()
  2001-10-23 18:32 ` Dan Malek
@ 2001-10-24  9:26   ` David Müller (ELSOFT AG)
  0 siblings, 0 replies; 3+ messages in thread
From: David Müller (ELSOFT AG) @ 2001-10-24  9:26 UTC (permalink / raw)
  To: Dan Malek; +Cc: linuxppc-embedded


Dan Malek wrote:

> "David Müller (ELSOFT AG)" wrote:
>
>
>>I have a question regarding the registration of additional IRQ handlers
>>for a PPC405GP based board.
>>
>
> Where are Matt's changes for the Tivo?  It would address this and give
> us another example of how this should be structured.
>
>
>
>>extended ppc4xx_init_IRQ as follows:
>>
>
> This is not an appealing solution.  We should change ppc4xx_pic_init()
> to initialize the internal interrupt controller irq descriptor, and then
> create a standard board initialization call for board specific changes.
>
>
>
>>static void __init
>>ppc4xx_init_IRQ(void)
>>{
>>        int i;
>>
>>        ppc4xx_pic_init();
>>
>>
> +	  ppc4xx_pic_board_init();
>
>>        return;
>>}
>>
>>
>
> The '...board_init()' function can be empty for those boards that don't
> require any additional controller initialization.
>
>
>
>>        for (i = 0; i < NR_IRQS; i++)
>>                irq_desc[i].handler = ppc4xx_pic;
>>
>
> The NR_IRQS should represent the total number of interrupts across all
> controllers.  The pic_init() should change this loop to initialize either
> NR_AIC or NR_UIC depending upon a 403 or 405 interrupt controller.  No
> #ifdefs necessary.
>


This seems to be pretty much the same as my second proposal (except for the

#defines) if i understand you correctly.


Dave


** Sent via the linuxppc-embedded mail list. See http://lists.linuxppc.org/

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2001-10-24  9:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-10-23  7:10 Additional IRQ handlers in ppc4xx_init_IRQ() David Müller (ELSOFT AG)
2001-10-23 18:32 ` Dan Malek
2001-10-24  9:26   ` David Müller (ELSOFT AG)

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).