Skip to contentSkip to conversation

RFC 8259 handling suggestion and MPC107 in openpic

DISCUSSION Dag Nygren 2 participants 3 messages Nov 2, 2001 – Nov 5, 2001

lore
Share & tools
lore

Dag Nygren

author
#0 lore raw

Hi,

just browsed through the different PPC setups
with an 8259.

Every single one has the following code in xxx_init_IRQ:

for ( i = 0 ; i < NUM_8259_INTERRUPTS ; i++ )

        irq_desc[i].handler = &i8259_pic;

i8259_init();

Seems like everyone having an i8259 wants to use it ;-) Would it make sense to move the loop into
the beginning of i8259_init()
in the following format ?

for ( i =i8259_pic.irq_offset ; i < i8259_pic.irq_offset + NUM_8259_INTERRUPTS ; i++ )

        irq_desc[i].handler = &i8259_pic;

I would also suggest that the "dummy" handling of the MPC107, now in some ports (my project included) would be integrated into open_pic.c

BRGDS

--
Dag Nygren email: [email protected]
Oy Espoon NewTech Ab phone: +358 9 8024910
Träsktorpet 3 fax: +358 9 8024916
02360 ESBO Mobile: +358 400 426312
FINLAND

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

#1 lore raw
Quoted 1 line · Dag Nygren

Seems like everyone having an i8259 wants to use it ;-)

You often must use it. If device interrupts are wired to it, you don't have a choice.

Quoted 3 lines

for ( i =i8259_pic.irq_offset ; i < i8259_pic.irq_offset + NUM_8259_INTERRUPTS ; i++ )

        irq_desc[i].handler = &i8259_pic;

Argh....you are just implementing what we had many years ago when we attempted a multi-level interrupt controller design.

We have recently been discussing this on the embedded ppc list as well. IMHO, we should have a properly designed multi-level interrupt controller software structure that maps to a hardware design. All interrupt controllers start numbering their interrupts from zero, to some maximum number supported. We should have software objects and functions that understand and support this, along with cascading controllers to any arbitrary interrupt at a higher level. Once we have this in place, we can place a "virtual" layer (or anything else) on top to provide the useful abstractions we need when using interrupts in the system.

Quoted 1 line

From our experience, by trying to merge these virtual abstractions

into the lowest level (irq_offset + NUM_INTERRUPTS kind of thing) gives us a solution (hack :-) for one board but doesn't provide any design flexibility that will be useful in a subsequent board port.

Thanks.

	-- Dan

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

author
#2 lore raw
Quoted 9 lines
Quoted 1 line · Dag Nygren

Seems like everyone having an i8259 wants to use it ;-)

You often must use it. If device interrupts are wired to it, you don't have a choice.

Quoted 6 lines
Quoted 3 lines

for ( i =i8259_pic.irq_offset ; i < i8259_pic.irq_offset + NUM_8259_INTERRUPTS ; i++ )

        irq_desc[i].handler = &i8259_pic;

Argh....you are just implementing what we had many years ago when we attempted a multi-level interrupt controller design.

Just hate to see the same code duplicated 5-10 times in the different xxxx_setup.c files.

Quoted 10 lines

We have recently been discussing this on the embedded ppc list as well. IMHO, we should have a properly designed multi-level interrupt controller software structure that maps to a hardware design. All interrupt controllers start numbering their interrupts from zero, to some maximum number supported. We should have software objects and functions that understand and support this, along with cascading controllers to any arbitrary interrupt at a higher level. Once we have this in place, we can place a "virtual" layer (or anything else) on top to provide the useful abstractions we need when using interrupts in the system.

You are quite right, but until we have this abstraction we could have the above code in the i8259 "module".
Thus saving the porting guys some code duplication.

Quoted 4 lines

From our experience, by trying to merge these virtual abstractions into the lowest level (irq_offset + NUM_INTERRUPTS kind of thing) gives us a solution (hack :-) for one board but doesn't provide any design flexibility that will be useful in a subsequent board port.

Would my revised open_pic be a starting point ? Even if I did not think as far as you suggest now.

Dag

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