83xx: requesting external interrupts

Joakim Tjernlund joakim.tjernlund at transmode.se
Sun Jul 1 00:02:50 EST 2007


 

> -----Original Message-----
> From: Andy Fleming [mailto:afleming at freescale.com] 
> Sent: den 30 juni 2007 01:55
> To: Joakim Tjernlund
> Cc: bwarren at qstreams.com; linuxppc-embedded at ozlabs.org
> Subject: Re: 83xx: requesting external interrupts
> 
> 
> On Jun 29, 2007, at 06:34, Joakim Tjernlund wrote:
> > mdio at 2320 {
> > 			#address-cells = <1>;
> > 			#size-cells = <0>;
> > 			reg = <2320 18>;
> > 			device_type = "mdio";
> > 			compatible = "ucc_geth_phy";
> >
> > 			phy1: ethernet-phy at 0 {
> > 				interrupt-parent = <&ipic>;
> > 				interrupts = <12 2>; //EXT IRQ2
> > 				reg = <0>; // 0
> > 				device_type = "ethernet-phy";
> > 				interface = <3>; //ENET_100_MII
> > 			};
> >
> > Now the things is that the IRQ works with and without the
> >  /* All external IRQs + Generic timer IRQs must be initialized by  
> > BSP */
> >  const int bsp_irqs[] = {48, 17, 18, 19, 20, 21, 22, 23, 90, 78,  
> > 84, 72};
> >  for (i=0;i<sizeof(bsp_irqs)/sizeof(bsp_irqs[0]);i++)
> > 	virq = irq_create_mapping(NULL, bsp_irqs[i]);
> 
> 
> This isn't how to use the device tree.  That is, you *aren't* using  
> the device tree.  You want to read the node of every device you want  
> to set up, and create the mapping.  Look at irq_of_parse_and_map().   
> Look in include/asm-powerpc/prom.h, at of_irq_to_resource(), which  
> maps an irq in the device tree.

I use both!
I see that ipic.c does all the work for me, so I should just drop
the above code. It is strange though that the virq # changes if
I keep the code.

hmm, maybe if I sort the bsp_irqs[] list numerically it will be the same?
Am at home ATM so I can't verify.

 Jocke




More information about the Linuxppc-embedded mailing list