Zynq的中断号在dts中的表示

关于zynq的中断述,在网上和datesheet中已经有详细的说明,但是在3.X的内核中,开始用dts来详细所有device的infor和source,这里就有关于中断号的指定,但是在关于zynq的dts文件中,我们看到指定的中断号不是datesheet上说所的Id,但是在proc下,我们可以看到每个设备的中断号对应关系:

 

zynq> more /proc/interrupts 
           CPU0       CPU1       
 27:          0          0       GIC  27  gt
 29:        233        282       GIC  29  twd
 35:          0          0       GIC  35  f800c000.ps7-ocmc
 39:          2          0       GIC  39  f8007100.ps7-xadc
 40:          0          0       GIC  40  f8007000.ps7-dev-cfg
 43:        530          0       GIC  43  ttc_clockevent
 45:          0          0       GIC  45  f8003000.ps7-dma
 46:          0          0       GIC  46  f8003000.ps7-dma
 47:          0          0       GIC  47  f8003000.ps7-dma
 48:          0          0       GIC  48  f8003000.ps7-dma
 49:          0          0       GIC  49  f8003000.ps7-dma
 51:         10          0       GIC  51  e000d000.ps7-qspi
 53:          0          0       GIC  53  ehci_hcd:usb1
 54:          0          0       GIC  54  eth0
 56:         35          0       GIC  56  mmc0
 72:          0          0       GIC  72  f8003000.ps7-dma
 73:          0          0       GIC  73  f8003000.ps7-dma
 74:          0          0       GIC  74  f8003000.ps7-dma
 75:          0          0       GIC  75  f8003000.ps7-dma
 82:         68          0       GIC  82  xuartps
IPI1:          0        495  Timer broadcast interrupts
IPI2:       1187       1239  Rescheduling interrupts
IPI3:          0          0  Function call interrupts
IPI4:         16         80  Single function call interrupts
IPI5:          0          0  CPU stop interrupts
IPI6:         42         23  IRQ work interrupts
IPI7:          0          0  completion interrupts
Err:          0
zynq> 



在datesheet中,我们可以看到与上面的表述是相对应的:

Zynq的中断号在dts中的表示_第1张图片

 

这里是相对应的,如eth0的中断号为54,但是在dts中关于interrupte的指定如下,如关于eth0的表述:

		ps7_ethernet_0: ps7-ethernet@e000b000 {
			#address-cells = <1>;
			#size-cells = <0>;
			clock-names = "ref_clk", "aper_clk";
			clocks = <&clkc 13>, <&clkc 30>;
			compatible = "xlnx,ps7-ethernet-1.00.a";
			interrupt-parent = <&ps7_scugic_0>;
			interrupts = <0 22 4>;
			local-mac-address = [00 0a 35 00 00 00];
			phy-handle = <&phy0>;
			phy-mode = "rgmii-id";
			reg = <0xe000b000 0x1000>;
			xlnx,eth-mode = <0x1>;
			xlnx,has-mdio = <0x1>;
			xlnx,ptp-enet-clock = <111111115>;
			mdio {
				#address-cells = <1>;
				#size-cells = <0>;
				phy0: phy@0 {
					compatible = "marvell,88e1510";
					device_type = "ethernet-phy";
					reg = <0>;
				} ;
			} ;
		} ;


这里指定中断的类型为SPI,中断号为22,中断是高电平触发。这里指定的中断号22,其实不是datesheet上指定的中断号,而是用的对应在spi_status寄存器中的序号,eth0是在spi_status_0中的bit22,所以这里就指定为中断号为22,如果是在spi_status_1中的22,这中断号就是32+22=54.

你可能感兴趣的:(linux,ARM,驱动开发)