external interrupt mapping with FPGA on loacl bus

deebul nair deebuls at gmail.com
Wed Sep 22 18:15:12 EST 2010


Hi

i have a FPGA called mcmc which is connected to the powerpc mpc8572 on the
local bus. It provides 2 interrupts which are connected to the
external interupts IRQ1 and IRQ3 of the mpc8572.
the fpga is memory mapped on the local bus at address 0xc0000000
I am able to register the interrupt and obtain virq , but no interrupts.
is the modifications made in the dts file enought/right for getting an
external interrupt??


*The modified dts file for enrm8572*

localbus at e0005000 {


#address-cells = <2>;

#size-cells = <1>;

compatible = "fsl,mpc8572-elbc", "fsl,elbc", "simple-bus";

reg = <0xe0005000 0x1000>;

interrupts = <19 2>;

interrupt-parent = <&mpic>;

ranges = <0x0 0x0 0xfc000000 0x04000000

0x1 0x0 0xc0000000 0x00080000

0x2 0x0 0x90100000 0x00008000

0x3 0x0 0x90000000 0x00040000

0x4 0x0 0x91000000 0x00008000>;

nand at 3,0 {

#address-cells = <1>;

#size-cells = <1>;

compatible = "fsl,mpc8572-fcm-nand",

"fsl,elbc-fcm-nand";

reg = <0x3 0x0 0x40000>;

u-boot at 0 {

reg = <0x0 0x02000000>;

read-only;

};

jffs2 at 2000000 {

reg = <0x02000000 0x10000000>;

};

ramdisk at 12000000 {

reg = <0x12000000 0x08000000>;

read-only;

};

kernel at 1a000000 {

reg = <0x1a000000 0x04000000>;

};

dtb at 1e000000 {

reg = <0x1e000000 0x01000000>;

read-only;

};

empty at 1f000000 {

reg = <0x1f000000 0x21000000>;

};

};



*mcmc at 1,0 {*
* *
*compatible = "fsl,fpga-pixis";*
* *
*reg = <1 0 32>;*
* *
*interrupts = <1 1 3 1>;*
* *
*interrupt-parent = <&mpic>;*

};


};

*code for registering the interrupt :*

np = of_find_compatible_node(NULL, NULL, "fsl,fpga-pixis");

mcmc_irq = irq;

virq = irq_of_parse_and_map(np, mcmc_irq);

if(virq == NO_IRQ){

printk(KERN_ERR "mcmc: failed to map interrupt");

}

printk(KERN_INFO "mcmc: interrupt mapped to virq %d\n", virq);

ret = request_irq(virq, mcmc_interrupt, IRQF_DISABLED,"mcmc", NULL);

if(ret){

printk(KERN_INFO "mcmc : cant get assigned irq %i\n errno :
<%d>\n",mcmc_irq,ret);

}

else{

printk(KERN_ALERT "Interrupt requested OK\n");

}

d :

*when i register the driver the following output is obtaine*

*for irq=1*

irq_of_parse_and_map

irq : irq_create_mapping(0xc0fffb40,0x1)

irq : using host @ c0fffb40

irq : obtained virq 18

irq : virq=12 <6>mcmc : interrupt mapped to irq 18

Interrupt requested OK!

*for irq=0*

irq_of_parse_and_map

irq : irq_create_mapping(0xc0fffb40,0x3)

irq : using host @ c0fffb40

irq : obtained virq 20

irq : virq=14 <6>mcmc : interrupt mapped to irq 20

Interrupt requested OK!





--
Cheeers

Deebul !!!!!!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20100922/f4a0fc0b/attachment-0001.html>


More information about the Linuxppc-dev mailing list