Skip to contentSkip to conversation

devicetree and IRQ7 mapping for T1042(mpic)

DISCUSSION Joakim Tjernlund 2 participants 5 messages Oct 14, 2015 – Oct 15, 2015

lore
Share & tools
lore
#0 lore raw

I am trying to figure out how to describe/map external IRQ7 in the devicetr= ee.

Basically either IRQ7 to be left alone by Linux(becase u-boot already set i= t up)
or map IRQ7 to sie 0(MPIC_EILR7=3D0xf0) and prio=3D0xf(MPIC_EIVPR7=3D0x4f00=
00)

There is no need for SW handler because IRQ7 will be routed to the DDR cont= roller
and case an automatic Self Refresh just before CPU reset.

I cannot figure out how to do this. Any ideas?

If not possible from devicetree, then can one do it from board code?

Jocke=

#1 lore raw
Quoted 7 lines · Joakim Tjernlund

I am trying to figure out how to describe/map external IRQ7 in the devicetree.

Basically either IRQ7 to be left alone by Linux(becase u-boot already set it up)
or map IRQ7 to sie 0(MPIC_EILR7=0xf0) and prio=0xf(MPIC_EIVPR7=0x4f0000)

Quoted 7 lines

There is no need for SW handler because IRQ7 will be routed to the DDR controller
and case an automatic Self Refresh just before CPU reset.

I cannot figure out how to do this. Any ideas?

If not possible from devicetree, then can one do it from board code?

The device tree describes the hardware. Priority is configuration, and thus doesn't belong there. You can call mpic_irq_set_priority() from board code.

Likewise, the fact that you want to route irq7 to sie0 is configuration, not hardware description. At most, the device tree should describe is what is connected to each sie output. There's no current Linux support for routing an interrupt to sie or anything other than "int".

-Scott

#2 lore raw
Quoted 20 lines · Scott Wood
Quoted 7 lines · Joakim Tjernlund

I am trying to figure out how to describe/map external IRQ7 in the devicetree.

Basically either IRQ7 to be left alone by Linux(becase u-boot already set it up)
or map IRQ7 to sie 0(MPIC_EILR7=0xf0) and prio=0xf(MPIC_EIVPR7=0x4f0000)

Quoted 7 lines

There is no need for SW handler because IRQ7 will be routed to the DDR controller
and case an automatic Self Refresh just before CPU reset.

I cannot figure out how to do this. Any ideas?

If not possible from devicetree, then can one do it from board code?

The device tree describes the hardware. Priority is configuration, and thus
doesn't belong there. You can call mpic_irq_set_priority() from board code.

Quoted 5 lines

Likewise, the fact that you want to route irq7 to sie0 is configuration, not
hardware description. At most, the device tree should describe is what is connected to each sie output. There's no current Linux support for routing an interrupt to sie or anything other than "int".

BTW, priority is meaningless for interrupts routed to sie.

-Scott

#3 lore raw
In reply to Scott Wood
Quoted 5 lines · Scott Wood
Quoted 4 lines · Joakim Tjernlund

I am trying to figure out how to describe/map external IRQ7 in the=20 devicetree.
=20
Basically either IRQ7 to be left alone by Linux(becase u-boot already s=

et=20

Quoted 2 lines
Quoted 2 lines

it up)
or map IRQ7 to sie 0(MPIC_EILR7=3D0xf0) and prio=3D0xf(MPIC_EIVPR7=3D0x=

4f0000)

Quoted 2 lines
Quoted 2 lines

=20
There is no need for SW handler because IRQ7 will be routed to the DDR=

=20

Quoted 8 lines
Quoted 6 lines

controller
and case an automatic Self Refresh just before CPU reset. =20
I cannot figure out how to do this. Any ideas?
=20
If not possible from devicetree, then can one do it from board code?

=20
The device tree describes the hardware. Priority is configuration, and t=

hus=20

Quoted 1 line

doesn't belong there. You can call mpic_irq_set_priority() from board co=

de.

Right.

Quoted 2 lines

=20
Likewise, the fact that you want to route irq7 to sie0 is configuration, =

not=20

Quoted 1 line

hardware description. At most, the device tree should describe is what i=

s=20

Quoted 1 line

connected to each sie output. There's no current Linux support for routi=

ng=20

Quoted 1 line

an interrupt to sie or anything other than "int".

That explains why I could not find any mpic function for that ..

I found mpic dev. trees property "protected-sources" which might do what I = want, just
leave the the irq alone but I cannot figure out what value to write there. Could you give me any example how to calculate dev. tree irq number for IRQ= 7?

The mpic.txt mentions "Interrupt Source Configuration Registers" but google=
did
not turn up anything useful for me.

Jocke=

#4 lore raw
Quoted 42 lines · Joakim Tjernlund
Quoted 13 lines · Scott Wood
Quoted 12 lines · Joakim Tjernlund

I am trying to figure out how to describe/map external IRQ7 in the devicetree.

Basically either IRQ7 to be left alone by Linux(becase u-boot already set
it up)
or map IRQ7 to sie 0(MPIC_EILR7=0xf0) and prio=0xf(MPIC_EIVPR7=0x4f0000)

There is no need for SW handler because IRQ7 will be routed to the DDR controller
and case an automatic Self Refresh just before CPU reset.

Quoted 8 lines
Quoted 3 lines

I cannot figure out how to do this. Any ideas?

If not possible from devicetree, then can one do it from board code?

The device tree describes the hardware. Priority is configuration, and thus
doesn't belong there. You can call mpic_irq_set_priority() from board code.

Right.

Quoted 8 lines

Likewise, the fact that you want to route irq7 to sie0 is configuration, not
hardware description. At most, the device tree should describe is what is
connected to each sie output. There's no current Linux support for routing
an interrupt to sie or anything other than "int".

That explains why I could not find any mpic function for that ..

I found mpic dev. trees property "protected-sources" which might do what I want, just
leave the the irq alone but I cannot figure out what value to write there. Could you give me any example how to calculate dev. tree irq number for IRQ7?

Quoted 3 lines

The mpic.txt mentions "Interrupt Source Configuration Registers" but google did
not turn up anything useful for me.

The device tree number for external IRQ 7 is 7. Another option is to use the pic-no-reset property.

-Scott