Fix I8042 IRQs on MPC8641 HPCN
Subsystems (2)
PATCH 1/1 Fix I8042 IRQs on MPC8641 HPCN
The I8042 mouse on the MPC8641 HPCN needs to use IRQ 12, which is currently in use by some PCI devices. This moves those devices to IRQ 11 and reserves IRQ 12 for the mouse.
Also, set IRQ 1 and IRQ 12 as legacy IRQs in the ULI 1575 legacy bridge in order to make the I8042 devices functional.
---
Note that the previous version of this patch also set up the Super I/O registers. I have removed that setup code, as there was some reservations about doing such low-level setup in the kernel.
arch/powerpc/boot/dts/mpc8641_hpcn.dts | 4 ++-- arch/powerpc/platforms/86xx/mpc86xx_hpcn.c | 14 +++++++-------
arch/powerpc/boot/dts/mpc8641_hpcn.dts +2 -2
@@ -268,7 +268,7 @@ /* IDSEL 0x1c */ e000 0 0 1 &i8259 9 2 e000 0 0 2 &i8259 a 2 - e000 0 0 3 &i8259 c 2 + e000 0 0 3 &i8259 b 2 e000 0 0 4 &i8259 7 2 /* IDSEL 0x1d */
@@ -278,7 +278,7 @@ e800 0 0 4 &i8259 0 0 /* IDSEL 0x1e */ - f000 0 0 1 &i8259 c 2 + f000 0 0 1 &i8259 b 2 f000 0 0 2 &i8259 0 0 f000 0 0 3 &i8259 0 0 f000 0 0 4 &i8259 0 0
arch/powerpc/platforms/86xx/mpc86xx_hpcn.c +7 -7
@@ -141,7 +141,7 @@ const unsigned char uli1575_irq_route_ta0x1 ,/* 9: 0b0001 */ 0x3 ,/* 10: 0b0011 */ 0x9 ,/* 11: 0b1001 */ -0xb ,/* 12: 0b1011 */ +0 ,/* 12: Reserved */ 0 ,/* 13: Reserved */ 0xd ,/* 14, 0b1101 */ 0xf, /* 15, 0b1111 */
@@ -211,7 +211,7 @@ static void __devinit quirk_uli1575(stru pirq_map_word |= (uli1575_irq_route_table[i] &0xf ) << ((irq2pin[i] -PIRQA ) *4 ); -/* ULI1575 IRQ mapping conf register default value is 0xb9317542 */ +/* ULI1575 IRQ mapping conf register default value is 0x09317542 */ DBG ("Setup ULI1575 IRQ mapping configuration register value = 0x%x\n" , pirq_map_word);pci_write_config_dword (dev,0x48 , pirq_map_word);
@@ -266,9 +266,9 @@ static void __devinit quirk_uli1575(strupci_write_config_byte (dev,0x44 ,0x30 | uli1575_irq_route_table[14 ]);pci_write_config_byte (dev,0x75 , uli1575_irq_route_table[15 ]); -/* Set IRQ14 and IRQ15 to legacy IRQs */ +/* Set IRQ1, IRQ12, IRQ14 and IRQ15 to legacy IRQs */ pci_read_config_word (dev,0x46 , &temp); - temp |=0xc000 ; + temp |=0xd002 ;pci_write_config_word (dev,0x46 , temp);/* Set i8259 interrupt trigger
@@ -280,12 +280,12 @@ static void __devinit quirk_uli1575(stru* IRQ 9: Level * IRQ 10: Level * IRQ 11: Level -* IRQ 12: Level +* IRQ 12: Edge * IRQ 14: Edge * IRQ 15: Edge */ -outb (0xfa ,0x4d0 ); -outb (0x1e ,0x4d1 ); +outb (0xf8 ,0x4d0 ); +outb (0x0e ,0x4d1 );#undef ULI1575_SET_DEV_IRQ
arch/powerpc/platforms/86xx/mpc86xx_hpcn.c static void __devinit quirk_uli1575(stru · line 288
Quoted 12 lines
arch/powerpc/platforms/86xx/mpc86xx_hpcn.c +3
-3* IRQ 9: Level * IRQ 10: Level * IRQ 11: Level -* IRQ 12: Level +* IRQ 12: Edge * IRQ 14: Edge * IRQ 15: Edge */ -outb (0xfa ,0x4d0 ); -outb (0x1e ,0x4d1 ); +outb (0xf8 ,0x4d0 ); +outb (0x0e ,0x4d1 );
The comment doesn't mention IRQ13. You're changing IRQ9 to edge as well; is this an accident? If not, you need to change the comment too.
Segher
Quoted 8 lines · Segher Boessenkool
Quoted 8 lines
* IRQ 9: Level
* IRQ 10: Level
* IRQ 11: Levelarch/powerpc/platforms/86xx/mpc86xx_hpcn.c +1
-1-* IRQ 12: Level +* IRQ 12: Edge * IRQ 14: Edge
* IRQ 15: Edge
*/
Quoted 8 lines
arch/powerpc/platforms/86xx/mpc86xx_hpcn.c static void __devinit quirk_uli1575(stru · line 288
Quoted 4 lines
arch/powerpc/platforms/86xx/mpc86xx_hpcn.c +2
-2-outb (0xfa ,0x4d0 ); -outb (0x1e ,0x4d1 ); +outb (0xf8 ,0x4d0 ); +outb (0x0e ,0x4d1 );The comment doesn't mention IRQ13. You're changing IRQ9 to edge as well; is this an accident?
Whare -- I'm only seeing bit 1 changing which corresponds to IRQ1 and is
reserved (0) anyway.
Quoted 2 lines
If not, you need
to change the comment too.
WBR, Sergei
Quoted 15 lines
Quoted 6 lines
Quoted 6 lines
* IRQ 9: Level
* IRQ 10: Level
* IRQ 11: Levelarch/powerpc/platforms/86xx/mpc86xx_hpcn.c +1
-1-* IRQ 12: Level +* IRQ 12: Edge * IRQ 14: Edge
Quoted 8 lines
arch/powerpc/platforms/86xx/mpc86xx_hpcn.c static void __devinit quirk_uli1575(stru · line 288
Quoted 6 lines
* IRQ 15: Edge */arch/powerpc/platforms/86xx/mpc86xx_hpcn.c +2
-2-outb (0xfa ,0x4d0 ); -outb (0x1e ,0x4d1 ); +outb (0xf8 ,0x4d0 ); +outb (0x0e ,0x4d1 );The comment doesn't mention IRQ13. You're changing IRQ9 to edge as well; is this an accident?
Quoted 2 lines
Whare -- I'm only seeing bit 1 changing which corresponds to IRQ1
and is reserved (0) anyway.
Uh yeah, bit 1, it's hard to count these single-byte quantities :-)
Quoted 1 line
Quoted 1 line
If not, you need to change the comment too.
Segher
Quoted 15 lines · Segher Boessenkool
Quoted 15 lines
Quoted 14 lines
arch/powerpc/platforms/86xx/mpc86xx_hpcn.c static void __devinit quirk_uli1575(stru · line 288
Quoted 12 lines
* IRQ 9: Level
* IRQ 10: Level
* IRQ 11: Levelarch/powerpc/platforms/86xx/mpc86xx_hpcn.c +1
-1-* IRQ 12: Level +* IRQ 12: Edge * IRQ 14: Edge
* IRQ 15: Edge
*/arch/powerpc/platforms/86xx/mpc86xx_hpcn.c +2
-2-outb (0xfa ,0x4d0 ); -outb (0x1e ,0x4d1 ); +outb (0xf8 ,0x4d0 ); +outb (0x0e ,0x4d1 );The comment doesn't mention IRQ13. You're changing IRQ9 to edge as well; is this an accident?
Quoted 4 lines
Quoted 2 lines
Whare -- I'm only seeing bit 1 changing which corresponds to IRQ1
and is reserved (0) anyway.Uh yeah, bit 1, it's hard to count these single-byte quantities :-)
Yep, only IRQ's 1 and 12 should be changed here.
Quoted 3 lines
Quoted 2 lines
Quoted 2 lines
If not, you need to change the comment too.
I'm not the original author of the comment, but I think it's only mentioning the IRQ's whose triggering is being modified here. The omitted IRQ's already had the correct triggering.
In any case, I can clarify the comment to make it more clear.
--Wade
Quoted 2 lines · Wade Farnsworth
In any case, I can clarify the comment to make it more clear.
Heh, department of redundancy department. :)
Quoted 2 lines
--Wade
Quoted 9 lines
Quoted 1 line
Uh yeah, bit 1, it's hard to count these single-byte quantities :-)
Yep, only IRQ's 1 and 12 should be changed here.
Quoted 1 line
Quoted 1 line
Quoted 1 line
If not, you need to change the comment too.
I'm not the original author of the comment, but I think it's only mentioning the IRQ's whose triggering is being modified here. The omitted IRQ's already had the correct triggering.
Yeah.
Quoted 1 line
In any case, I can clarify the comment to make it more clear.
The commit message already mentioned IRQ 1, all is fine :-)
Segher