在基于powerpc的linux中,request_irq里填的是软件中断号,也就是/proc/interrupts 里的编号
很不幸的是他们不是一一对应,也没有线性规律
做移植的时候对着dts和手册反复比较,有时会有拿不准的时候
最好能够一目了然地流出来内核识别的软件中断号和硬件中断号的映射关系
于是可以在arch/powerpc/kernel/irq.c的irq_create_of_mapping()
里看到,软件中断号 硬件中断号是在这里完成映射的
在最后的return virq; 前面加一句
printk("!-_- hard %lu --- virtual %lu \n",hwirq,virq);
就这么简单,启动时就能一目了然看到对应关系了,对驱动移植很有帮助
!-_- hard 38 --- virtual 38
!-_- hard 14 --- virtual 16
!-_- hard 15 --- virtual 17
!-_- hard 37 --- virtual 37
!-_- hard 36 --- virtual 36
!-_- hard 35 --- virtual 35
!-_- hard 34 --- virtual 34
!-_- hard 33 --- virtual 33
!-_- hard 32 --- virtual 32
!-_- hard 19 --- virtual 19
!-_- hard 20 --- virtual 20
!-_- hard 9 --- virtual 18
!-_- hard 10 --- virtual 21
!-_- hard 18 --- virtual 22
!-_- hard 19 --- virtual 19
!-_- hard 16 --- virtual 23
------------------------------------------------------
root@MPC8313erdb:/# cat /proc/interrupts
CPU0
16: 26 IPIC Level i2c-mpc
17: 0 IPIC Level i2c-mpc
18: 224 IPIC Level serial
22: 4 IPIC Edge serial
23: 341 IPIC Level mpc83xx_spi
35: 0 IPIC Level enet_error
36: 1783 IPIC Level enet_rx
37: 544 IPIC Level enet_tx
77: 1 IPIC Level fsl-elbc
阅读(2156) | 评论(0) | 转发(0) |